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

<?php $__env->startPush('styles'); ?>
    <style>
        .metric-grid {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 18px;
            margin-bottom: 24px;
        }
        .metric-card {
            padding: 22px;
        }
        .metric-value {
            font-size: 2rem;
            color: var(--admin-gold-deep);
            margin-top: 10px;
        }
        @media (max-width: 960px) {
            .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        }
        @media (max-width: 640px) {
            .metric-grid { grid-template-columns: 1fr; }
        }
    </style>
<?php $__env->stopPush(); ?>

<?php $__env->startSection('toolbar'); ?>
    <a class="button" href="<?php echo e(route('admin.products.create')); ?>">Add Product</a>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <section class="metric-grid">
        <article class="card metric-card"><div class="meta-text">Products</div><div class="metric-value"><?php echo e($productCount); ?></div></article>
        <article class="card metric-card"><div class="meta-text">Orders</div><div class="metric-value"><?php echo e($orderCount); ?></div></article>
        <article class="card metric-card"><div class="meta-text">Pending Orders</div><div class="metric-value"><?php echo e($pendingCount); ?></div></article>
        <article class="card metric-card"><div class="meta-text">Sales Total</div><div class="metric-value">$<?php echo e(number_format($salesTotal, 2)); ?></div></article>
    </section>

    <section class="card">
        <div style="padding: 22px 22px 0;">
            <h2 style="margin: 0;">Recent Orders</h2>
        </div>
        <table>
            <thead>
                <tr>
                    <th>Order</th>
                    <th>Customer</th>
                    <th>Status</th>
                    <th>Total</th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
                <?php $__empty_1 = true; $__currentLoopData = $recentOrders; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $order): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <tr>
                        <td><?php echo e($order->order_number); ?></td>
                        <td><?php echo e($order->customer_name); ?></td>
                        <td><span class="pill"><?php echo e(ucfirst($order->status)); ?></span></td>
                        <td>$<?php echo e(number_format((float) $order->total_amount, 2)); ?></td>
                        <td><a class="ghost-button button" href="<?php echo e(route('admin.orders.show', $order)); ?>">Open</a></td>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <tr><td colspan="5" class="meta-text">No orders yet.</td></tr>
                <?php endif; ?>
            </tbody>
        </table>
    </section>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.admin', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /Users/gladwintan/Documents/New project/storefront/resources/views/admin/dashboard.blade.php ENDPATH**/ ?>