<?php $__env->startSection('title', 'Laporan Pengeluaran Toko'); ?>
<?php $__env->startSection('page-title', 'Laporan Pengeluaran Toko'); ?>

<?php $__env->startSection('content'); ?>
<div class="space-y-5">
    
    <div class="grid grid-cols-1 lg:grid-cols-3 gap-5">
        <div class="lg:col-span-2 bg-white rounded-3xl border border-slate-200 p-6 shadow-sm">
            <form method="GET" class="flex flex-wrap items-end gap-4">
                <div>
                    <label class="text-[10px] font-bold text-slate-400 uppercase tracking-widest block mb-1">Mulai</label>
                    <input type="date" name="start" value="<?php echo e($start->format('Y-m-d')); ?>" 
                        class="px-4 py-2 bg-slate-50 border border-slate-200 rounded-xl text-sm focus:ring-2 focus:ring-blue-500 outline-none">
                </div>
                <div>
                    <label class="text-[10px] font-bold text-slate-400 uppercase tracking-widest block mb-1">Selesai</label>
                    <input type="date" name="end" value="<?php echo e($end->format('Y-m-d')); ?>" 
                        class="px-4 py-2 bg-slate-50 border border-slate-200 rounded-xl text-sm focus:ring-2 focus:ring-blue-500 outline-none">
                </div>
                <button type="submit" class="px-6 py-2 bg-slate-900 text-white font-bold rounded-xl text-sm hover:bg-slate-800 transition">Filter</button>
            </form>
        </div>
        
        <div class="bg-rose-600 rounded-3xl p-6 text-white shadow-xl shadow-rose-600/20 flex flex-col justify-center">
            <div class="text-[10px] font-bold uppercase tracking-widest opacity-80 mb-1">Total Pengeluaran</div>
            <div class="text-3xl font-black">Rp <?php echo e(number_format($summary->total_amount, 0, ',', '.')); ?></div>
            <div class="text-xs mt-1 opacity-70"><?php echo e($summary->total_count); ?> catatan pengeluaran</div>
        </div>
    </div>

    
    <div class="bg-white rounded-3xl border border-slate-200 shadow-sm overflow-hidden">
        <div class="overflow-x-auto">
            <table class="w-full text-sm">
                <thead>
                    <tr class="bg-slate-50 text-slate-500 border-b border-slate-200">
                        <th class="px-4 py-4 text-left font-bold uppercase tracking-tighter">Waktu</th>
                        <th class="px-4 py-4 text-left font-bold uppercase tracking-tighter">Kategori</th>
                        <th class="px-4 py-4 text-left font-bold uppercase tracking-tighter">Keterangan</th>
                        <th class="px-4 py-4 text-right font-bold uppercase tracking-tighter">Jumlah</th>
                        <th class="px-4 py-4 text-center font-bold uppercase tracking-tighter">Petugas</th>
                        <th class="px-4 py-4 text-center font-bold uppercase tracking-tighter">Sesi POS</th>
                    </tr>
                </thead>
                <tbody class="divide-y divide-slate-100">
                    <?php $__empty_1 = true; $__currentLoopData = $expenses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $e): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <tr class="hover:bg-slate-50/50 transition">
                        <td class="px-4 py-4">
                            <div class="font-bold text-slate-700"><?php echo e($e->expense_date->format('d/m/Y')); ?></div>
                            <div class="text-[10px] text-slate-400"><?php echo e($e->expense_date->format('H:i')); ?></div>
                        </td>
                        <td class="px-4 py-4">
                            <span class="px-2 py-1 rounded-lg text-[10px] font-bold bg-slate-100 text-slate-600 uppercase"><?php echo e($e->category); ?></span>
                        </td>
                        <td class="px-4 py-4 text-slate-600 italic">"<?php echo e($e->description); ?>"</td>
                        <td class="px-4 py-4 text-right font-black text-rose-600">Rp <?php echo e(number_format($e->amount, 0, ',', '.')); ?></td>
                        <td class="px-4 py-4 text-center text-xs text-slate-500"><?php echo e($e->user->name); ?></td>
                        <td class="px-4 py-4 text-center text-[10px] font-mono text-slate-400">
                            <?php echo e($e->session ? '#S'.$e->session->id : '-'); ?>

                        </td>
                    </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <tr><td colspan="6" class="px-4 py-16 text-center text-slate-400">Belum ada catatan pengeluaran</td></tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div>
        <div class="px-6 py-4 border-t border-slate-100">
            <?php echo e($expenses->links()); ?>

        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\laragon\www\pos-umkm\resources\views/reports/expenses.blade.php ENDPATH**/ ?>