<?php if (isset($component)) { $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54 = $attributes; } ?>
<?php $component = App\View\Components\AppLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('app-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\AppLayout::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
     <?php $__env->slot('header', null, []); ?> 
        <style>
            .dash-header-title {
                font-weight: 600;
                font-size: 1.5rem;
                letter-spacing: -0.01em;
                color: #0f0f0f;
            }
        </style>
        <h2 class="dash-header-title">Riwayat Pesanan</h2>
     <?php $__env->endSlot(); ?>

    <style>
        .order-wrap { 
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; 
        }

        .order-inner {
            max-width: 1200px;
            margin: 0 auto;
            padding: 40px 24px;
        }

        /* ── TABLE WRAP ── */
        .order-table-wrap {
            background: #fff;
            border: 1px solid #ebebeb;
            border-radius: 12px;
            overflow: hidden;
        }

        .order-table {
            width: 100%;
            border-collapse: collapse;
        }

        .order-table thead th {
            padding: 14px 20px;
            font-size: 0.65rem;
            font-weight: 600;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            color: #999;
            background: #fafafa;
            border-bottom: 1px solid #f0f0f0;
            text-align: left;
        }

        .order-table tbody tr {
            border-bottom: 1px solid #f5f5f5;
            transition: background 0.15s;
        }

        .order-table tbody tr:last-child { border-bottom: none; }
        .order-table tbody tr:hover { background: #fafafa; }

        .order-table td {
            padding: 18px 20px;
            vertical-align: middle;
        }

        /* ── ORDER NUMBER ── */
        .order-number {
            font-size: 0.85rem;
            font-weight: 600;
            color: #0f0f0f;
            text-decoration: none;
            border-bottom: 1px solid transparent;
            transition: border-color 0.2s;
        }

        .order-number:hover {
            border-bottom-color: #0f0f0f;
        }

        /* ── DATE ── */
        .order-date {
            font-size: 0.8rem;
            font-weight: 500;
            color: #444;
        }

        .order-time {
            font-size: 0.65rem;
            color: #bbb;
            margin-top: 2px;
        }

        /* ── TOTAL ── */
        .order-total {
            font-size: 0.85rem;
            font-weight: 600;
            color: #1a1a1a;
        }

        /* ── STATUS BADGE ── */
        .order-status {
            display: inline-block;
            padding: 4px 12px;
            font-size: 0.6rem;
            font-weight: 600;
            letter-spacing: 0.02em;
            text-transform: uppercase;
            border-radius: 30px;
        }

        .order-status-pending { background: #f5f5f5; color: #999; }
        .order-status-paid { background: #e3f2fd; color: #1565c0; }
        .order-status-processing { background: #fff3e0; color: #e65100; }
        .order-status-shipped { background: #e8eaf6; color: #3949ab; }
        .order-status-completed { background: #e8f5e9; color: #2e7d32; }
        .order-status-cancelled { background: #ffebee; color: #c62828; }

        .order-cancel-request {
            display: inline-block;
            margin-left: 8px;
            padding: 4px 8px;
            font-size: 0.55rem;
            font-weight: 600;
            letter-spacing: 0.02em;
            text-transform: uppercase;
            background: #ffebee;
            color: #c62828;
            border-radius: 30px;
        }

        /* ── ACTION LINK ── */
        .order-action {
            font-size: 0.65rem;
            font-weight: 600;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            color: #aaa;
            text-decoration: none;
            padding-bottom: 2px;
            border-bottom: 1px solid transparent;
            transition: color 0.2s, border-color 0.2s;
        }

        .order-action:hover {
            color: #0f0f0f;
            border-bottom-color: #0f0f0f;
        }

        /* ── EMPTY STATE ── */
        .order-empty {
            background: #fff;
            border: 1px solid #ebebeb;
            border-radius: 12px;
            padding: 72px 28px;
            text-align: center;
        }

        .order-empty-title {
            font-size: 1.1rem;
            font-weight: 500;
            color: #ccc;
            margin-bottom: 8px;
        }

        .order-empty-desc {
            font-size: 0.8rem;
            font-weight: 400;
            color: #ddd;
            letter-spacing: 0.02em;
            margin-bottom: 24px;
        }

        .order-empty-btn {
            display: inline-block;
            background: #0f0f0f;
            color: #fff;
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
            font-size: 0.7rem;
            font-weight: 500;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            text-decoration: none;
            padding: 10px 24px;
            border-radius: 30px;
            transition: background 0.2s;
        }

        .order-empty-btn:hover { background: #333; }

        /* ── PAGINATION ── */
        .order-pagination {
            margin-top: 24px;
        }
    </style>

    <div class="order-wrap">
        <div class="order-inner">

            
            <?php if($orders->count() > 0): ?>
                <div class="order-table-wrap">
                    <table class="order-table">
                        <thead>
                            <tr>
                                <th>No. Order</th>
                                <th>Tanggal & Waktu</th>
                                <th>Total Belanja</th>
                                <th>Status Pesanan</th>
                                <th>Aksi</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php $__currentLoopData = $orders; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $order): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr>
                                <td>
                                    <a href="<?php echo e(route('admin.orders.show', $order->id)); ?>" class="order-number">
                                        #<?php echo e($order->order_number ?? $order->id); ?>

                                    </a>
                                </td>
                                <td>
                                    <div class="order-date"><?php echo e($order->created_at->format('d M Y')); ?></div>
                                    <div class="order-time"><?php echo e($order->created_at->format('H:i')); ?> WIB</div>
                                </td>
                                <td class="order-total">Rp <?php echo e(number_format($order->total, 0, ',', '.')); ?></td>
                                <td>
                                    <?php
                                        $statusLabels = [
                                            'pending'    => 'Menunggu Bayar',
                                            'paid'       => 'Dibayar',
                                            'processing' => 'Diproses',
                                            'shipped'    => 'Dikirim',
                                            'completed'  => 'Selesai',
                                            'cancelled'  => 'Dibatalkan',
                                        ];
                                        $statusClass = [
                                            'pending'    => 'order-status-pending',
                                            'paid'       => 'order-status-paid',
                                            'processing' => 'order-status-processing',
                                            'shipped'    => 'order-status-shipped',
                                            'completed'  => 'order-status-completed',
                                            'cancelled'  => 'order-status-cancelled',
                                        ];
                                        $colorClass  = $statusClass[$order->status] ?? 'order-status-pending';
                                        $statusLabel = $statusLabels[$order->status] ?? ucfirst($order->status);
                                    ?>
                                    <span class="order-status <?php echo e($colorClass); ?>">
                                        <?php echo e($statusLabel); ?>

                                    </span>
                                    <?php if($order->cancel_request_status === 'pending'): ?>
                                        <span class="order-cancel-request">Minta Batal</span>
                                    <?php endif; ?>
                                </td>
                                <td>
                                    <a href="<?php echo e(route('admin.orders.show', $order->id)); ?>" class="order-action">
                                        Detail
                                    </a>
                                </td>
                            </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </tbody>
                    </table>
                </div>

                
                <?php if($orders->hasPages()): ?>
                    <div class="order-pagination">
                        <?php echo e($orders->links()); ?>

                    </div>
                <?php endif; ?>

            <?php else: ?>
                <div class="order-empty">
                    <div class="order-empty-title">Belum ada pesanan</div>
                    <div class="order-empty-desc">Anda belum pernah berbelanja</div>
                    <a href="<?php echo e(route('products.index')); ?>" class="order-empty-btn">Mulai Belanja</a>
                </div>
            <?php endif; ?>

        </div>
    </div>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $attributes = $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $component = $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?><?php /**PATH C:\laragon\www\toko_app\resources\views/admin/orders/index.blade.php ENDPATH**/ ?>