<?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([]); ?>
    <div class="bg-[#FAF7F2] min-h-screen py-8">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            
            
            <div class="bg-gradient-to-r from-[#f59e0b] to-[#d97706] rounded-2xl p-6 mb-8 flex justify-between items-center text-white shadow-lg shadow-[#f59e0b]/20">
                <div>
                    <span class="font-bold uppercase tracking-widest text-xs opacity-80">Total Penjualan Selesai</span>
                    <h2 class="text-3xl font-black mt-1">Rp <?php echo e(number_format($totalRevenue, 0, ',', '.')); ?></h2>
                </div>
                <div class="bg-white/20 p-3 rounded-xl">
                    <svg class="w-8 h-8 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
                    </svg>
                </div>
            </div>

            
            <div class="grid grid-cols-1 md:grid-cols-4 gap-4 mb-8">
                <div class="bg-[#f0fdf4] border border-[#bbf7d0] p-6 rounded-2xl shadow-sm">
                    <p class="text-xs font-bold text-emerald-600 uppercase mb-1">Selesai</p>
                    <h3 class="text-3xl font-black text-emerald-700"><?php echo e($countSelesai); ?></h3>
                </div>
                <div class="bg-[#fef3c7] border border-[#fde68a] p-6 rounded-2xl shadow-sm">
                    <p class="text-xs font-bold text-[#d97706] uppercase mb-1">Diproses</p>
                    <h3 class="text-3xl font-black text-[#b45309]"><?php echo e($countProses); ?></h3>
                </div>
                <div class="bg-[#fff1f2] border border-[#fecdd3] p-6 rounded-2xl shadow-sm">
                    <p class="text-xs font-bold text-rose-600 uppercase mb-1">Dibatalkan</p>
                    <h3 class="text-3xl font-black text-rose-700"><?php echo e($countBatal); ?></h3>
                </div>
                <div class="bg-white border border-[#e0d3c2] p-6 rounded-2xl shadow-sm">
                    <p class="text-xs font-bold text-[#8c6a4a] uppercase mb-1">Total Order</p>
                    <h3 class="text-3xl font-black text-[#2c1a0e]"><?php echo e($orders->total()); ?></h3>
                </div>
            </div>

            
            <div class="bg-white rounded-2xl shadow-sm border border-[#e0d3c2] overflow-hidden">
                <div class="p-6 border-b border-[#f0e7dc] flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4">
                    <h2 class="font-black text-[#2c1a0e] uppercase tracking-tight flex items-center gap-2">
                        <span class="w-2 h-6 bg-[#f59e0b] rounded-full"></span>
                        Detail Transaksi Keuangan
                    </h2>
                    <div class="flex items-center gap-3">
                        
                        <a href="<?php echo e(route('orders.financial.pdf', request()->query())); ?>" 
                           class="bg-gradient-to-r from-[#f59e0b] to-[#d97706] hover:from-[#d97706] hover:to-[#b45309] text-white px-5 py-2.5 rounded-xl text-xs font-black uppercase tracking-wider flex items-center gap-2 transition-all shadow-md shadow-[#f59e0b]/20">
                            <i class="fas fa-file-pdf text-sm"></i>
                            Cetak PDF
                        </a>
                        <span class="text-xs font-bold text-[#8c6a4a] bg-[#fef9f0] px-3 py-1 rounded-full border border-[#e0d3c2]"><?php echo e($orders->total()); ?> Pesanan</span>
                    </div>
                </div>

                <div class="overflow-x-auto">
                    <table class="w-full text-left border-collapse">
                        <thead class="bg-[#fef9f0]">
                            <tr>
                                <th class="px-6 py-4 text-[10px] font-black text-[#d97706] uppercase tracking-wider">No. Order</th>
                                <th class="px-6 py-4 text-[10px] font-black text-[#d97706] uppercase tracking-wider">Pelanggan</th>
                                <th class="px-6 py-4 text-[10px] font-black text-[#d97706] uppercase tracking-wider">Metode</th>
                                <th class="px-6 py-4 text-[10px] font-black text-[#d97706] uppercase tracking-wider">Ongkir</th>
                                <th class="px-6 py-4 text-[10px] font-black text-[#d97706] uppercase tracking-wider">Total</th>
                                <th class="px-6 py-4 text-[10px] font-black text-[#d97706] uppercase tracking-wider">Status</th>
                                <th class="px-6 py-4 text-[10px] font-black text-[#d97706] uppercase tracking-wider">Tanggal</th>
                            </tr>
                        </thead>
                        <tbody class="divide-y divide-[#f0e7dc]">
                            <?php $__currentLoopData = $orders; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $order): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr class="hover:bg-[#fef9f0] transition-colors">
                                <td class="px-6 py-4 text-xs font-bold text-[#2c1a0e]">#<?php echo e($order->order_number ?? $order->id); ?></td>
                                <td class="px-6 py-4 text-xs text-[#2c1a0e] font-medium"><?php echo e($order->user->name); ?></td>
                                <td class="px-6 py-4">
                                    <span class="flex items-center gap-1 text-[10px] font-bold text-blue-600 bg-blue-50 px-2 py-1 rounded-md border border-blue-100 uppercase w-fit">
                                        <i class="fas fa-credit-card text-[8px]"></i>
                                        <?php echo e($order->payment_method ?? 'MIDTRANS'); ?>

                                    </span>
                                </td>
                                <td class="px-6 py-4 text-xs font-bold text-[#d97706]">Rp <?php echo e(number_format($order->shipping_cost ?? 0, 0, ',', '.')); ?></td>
                                <td class="px-6 py-4 text-xs font-black text-[#2c1a0e]">Rp <?php echo e(number_format($order->total_price, 0, ',', '.')); ?></td>
                                <td class="px-6 py-4">
                                    <?php
                                        $badges = [
                                            'completed' => 'bg-emerald-100 text-emerald-600 border-emerald-200',
                                            'cancelled' => 'bg-rose-100 text-rose-600 border-rose-200',
                                            'pending'   => 'bg-amber-100 text-amber-600 border-amber-200',
                                        ];
                                        $class = $badges[$order->status] ?? 'bg-blue-100 text-blue-600 border-blue-200';
                                    ?>
                                    <span class="<?php echo e($class); ?> px-2 py-1 rounded-lg text-[9px] font-black border uppercase inline-block min-w-[70px] text-center">
                                        <?php echo e($order->status); ?>

                                    </span>
                                </td>
                                <td class="px-6 py-4 text-[10px] font-bold text-[#8c6a4a]"><?php echo e($order->created_at->format('d M Y')); ?></td>
                            </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </tbody>
                    </table>
                </div>
            </div>

            <div class="mt-6">
                <?php echo e($orders->links()); ?>

            </div>
        </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\LokaPustaka\resources\views/orders/financial.blade.php ENDPATH**/ ?>