<?php $__env->startSection('title', 'Dashboard'); ?>

<?php $__env->startSection('styles'); ?>
<style>
    .welcome-section {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border-radius: 20px;
        padding: 60px 40px;
        color: white;
        text-align: center;
        margin-bottom: 30px;
    }
    .welcome-section h1 {
        font-size: 2.5rem;
        font-weight: 700;
        margin-bottom: 15px;
    }
    .welcome-section p {
        font-size: 1.2rem;
        opacity: 0.9;
        margin-bottom: 25px;
    }
    .welcome-section .user-name {
        font-weight: 600;
        color: #ffd700;
    }
    .quick-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
        margin-top: 30px;
    }
    .quick-action-card {
        background: white;
        border-radius: 12px;
        padding: 25px;
        text-align: center;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        transition: all 0.3s;
        cursor: pointer;
        text-decoration: none;
        color: inherit;
    }
    .quick-action-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    }
    .quick-action-card i {
        font-size: 2.5rem;
        margin-bottom: 15px;
        color: #667eea;
    }
    .quick-action-card h5 {
        font-weight: 600;
        margin-bottom: 5px;
    }
    .quick-action-card small {
        color: #718096;
    }
    .stats-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 20px;
        margin-bottom: 30px;
    }
    .stat-card {
        background: white;
        border-radius: 12px;
        padding: 25px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    }
    .stat-card .stat-icon {
        width: 50px;
        height: 50px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        margin-bottom: 15px;
    }
    .stat-card .stat-value {
        font-size: 1.8rem;
        font-weight: 700;
        color: #2d3748;
    }
    .stat-card .stat-label {
        color: #718096;
        font-size: 0.9rem;
    }
</style>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
<div class="welcome-section">
    <h1>Welcome to <?php echo e(\App\Helpers\Settings::getSystemName()); ?></h1>
    <p>Hello, <span class="user-name"><?php echo e(Auth::user()->name); ?></span>! Your smart sales companion.</p>
    <p>Ready to make some sales today?</p>
</div>

<div class="stats-grid">
    <div class="stat-card">
        <div class="stat-icon" style="background: rgba(102, 126, 234, 0.1); color: #667eea;">
            <i class="bi bi-cart3"></i>
        </div>
        <div class="stat-value"><?php echo e(\App\Models\Order::whereDate('created_at', today())->count()); ?></div>
        <div class="stat-label">Today's Orders</div>
    </div>
    <div class="stat-card">
        <div class="stat-icon" style="background: rgba(56, 161, 105, 0.1); color: #38a169;">
            <i class="bi bi-currency-dollar"></i>
        </div>
        <div class="stat-value">Kes <?php echo e(number_format(\App\Models\Order::whereDate('created_at', today())->sum('total'), 0)); ?></div>
        <div class="stat-label">Today's Sales</div>
    </div>
    <div class="stat-card">
        <div class="stat-icon" style="background: rgba(237, 100, 166, 0.1); color: #ed64a6;">
            <i class="bi bi-box-seam"></i>
        </div>
        <div class="stat-value"><?php echo e(\App\Models\Product::where('stock_quantity', '<=', 5)->count()); ?></div>
        <div class="stat-label">Low Stock Items</div>
    </div>
    <div class="stat-card">
        <div class="stat-icon" style="background: rgba(237, 137, 54, 0.1); color: #ed8936;">
            <i class="bi bi-people"></i>
        </div>
        <div class="stat-value"><?php echo e(\App\Models\Customer::count()); ?></div>
        <div class="stat-label">Total Customers</div>
    </div>
</div>

<h4 class="mb-4">Quick Actions</h4>
<div class="quick-actions">
    <?php if(Auth::user()->hasPermission('pos.sales')): ?>
    <a href="<?php echo e(route('pos.sales')); ?>" class="quick-action-card">
        <i class="bi bi-cart-plus"></i>
        <h5>New Sale</h5>
        <small>Start a new transaction</small>
    </a>
    <?php endif; ?>
    <?php if(Auth::user()->hasPermission('orders.view')): ?>
    <a href="<?php echo e(route('orders.index')); ?>" class="quick-action-card">
        <i class="bi bi-receipt"></i>
        <h5>View Orders</h5>
        <small>View all orders</small>
    </a>
    <?php endif; ?>
    <?php if(Auth::user()->hasPermission('products.view')): ?>
    <a href="<?php echo e(route('products.index')); ?>" class="quick-action-card">
        <i class="bi bi-box-seam"></i>
        <h5>Products</h5>
        <small>Manage products</small>
    </a>
    <?php endif; ?>
    <?php if(Auth::user()->hasPermission('inventory.view')): ?>
    <a href="<?php echo e(route('inventory.index')); ?>" class="quick-action-card">
        <i class="bi bi-clipboard-data"></i>
        <h5>Inventory</h5>
        <small>Stock management</small>
    </a>
    <?php endif; ?>
    <?php if(Auth::user()->hasPermission('reports.view')): ?>
    <a href="<?php echo e(route('reports.sales')); ?>" class="quick-action-card">
        <i class="bi bi-graph-up"></i>
        <h5>Reports</h5>
        <small>View sales reports</small>
    </a>
    <?php endif; ?>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.main', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\AI PROJECT POS\PosAI3\resources\views/pos/index.blade.php ENDPATH**/ ?>