<?php $__env->startSection('title', 'Daily Shipments Report'); ?>
<?php $__env->startSection('page-title', 'Daily Shipments Report'); ?>

<?php $__env->startSection('content'); ?>
<div class="bg-white rounded-lg shadow-md p-6 mb-6">
    <form action="<?php echo e(route('reports.daily-shipments')); ?>" method="GET" class="flex items-end gap-4">
        <div>
            <label for="date" class="block text-sm font-medium text-gray-700 mb-1">Select Date</label>
            <input type="date" name="date" id="date" value="<?php echo e($date); ?>" class="rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500">
        </div>
        <button type="submit" class="bg-indigo-600 text-white px-4 py-2 rounded-md hover:bg-indigo-700 transition">
            Filter
        </button>
    </form>
</div>

<div class="grid grid-cols-1 md:grid-cols-4 gap-6 mb-6">
    <div class="bg-white rounded-lg shadow p-6 border-l-4 border-blue-500">
        <div class="text-gray-500 text-sm font-medium uppercase">Total Bookings</div>
        <div class="text-2xl font-bold text-gray-800 mt-2"><?php echo e($stats['total_bookings']); ?></div>
    </div>
    <div class="bg-white rounded-lg shadow p-6 border-l-4 border-green-500">
        <div class="text-gray-500 text-sm font-medium uppercase">Total Revenue</div>
        <div class="text-2xl font-bold text-gray-800 mt-2"><?php echo e(number_format($stats['total_amount'], 2)); ?></div>
    </div>
    <div class="bg-white rounded-lg shadow p-6 border-l-4 border-purple-500">
        <div class="text-gray-500 text-sm font-medium uppercase">Total Weight</div>
        <div class="text-2xl font-bold text-gray-800 mt-2"><?php echo e(number_format($stats['total_weight'], 2)); ?> kg</div>
    </div>
    <div class="bg-white rounded-lg shadow p-6 border-l-4 border-orange-500">
        <div class="text-gray-500 text-sm font-medium uppercase">Total Packages</div>
        <div class="text-2xl font-bold text-gray-800 mt-2"><?php echo e($stats['total_cartons']); ?></div>
    </div>
</div>

<div class="bg-white rounded-lg shadow-md overflow-hidden">
    <div class="px-6 py-4 border-b border-gray-200 flex justify-between items-center">
        <h3 class="text-lg font-semibold text-gray-800">Shipments for <?php echo e(\Carbon\Carbon::parse($date)->format('d M, Y')); ?></h3>
        <button onclick="window.print()" class="text-gray-600 hover:text-gray-800">
            <i class="fas fa-print mr-2"></i> Print Report
        </button>
    </div>
    <div class="overflow-x-auto">
        <table class="min-w-full divide-y divide-gray-200">
            <thead class="bg-gray-50">
                <tr>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">CNTR No</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Sender</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Receiver</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Items</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Weight</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Amount</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Status</th>
                </tr>
            </thead>
            <tbody class="bg-white divide-y divide-gray-200">
                <?php $__empty_1 = true; $__currentLoopData = $bookings; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $booking): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <tr class="hover:bg-gray-50">
                    <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">
                        <a href="<?php echo e(route('bookings.show', $booking)); ?>" class="text-indigo-600 hover:underline"><?php echo e($booking->cntr_no); ?></a>
                    </td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-700"><?php echo e($booking->customer->name ?? 'N/A'); ?></td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-700"><?php echo e($booking->receiver_name); ?></td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-700"><?php echo e($booking->carton_count); ?></td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-700"><?php echo e($booking->weight_kg); ?> kg</td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"><?php echo e(number_format($booking->total_amount, 2)); ?></td>
                    <td class="px-6 py-4 whitespace-nowrap">
                        <span class="px-2 py-1 rounded-full text-xs font-semibold 
                            <?php echo e($booking->status == 'Delivered' ? 'bg-green-100 text-green-800' : 
                               ($booking->status == 'Pending' ? 'bg-yellow-100 text-yellow-800' : 'bg-gray-100 text-gray-800')); ?>">
                            <?php echo e($booking->status); ?>

                        </span>
                    </td>
                </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <tr>
                    <td colspan="7" class="px-6 py-4 text-center text-gray-500">No shipments found for this date.</td>
                </tr>
                <?php endif; ?>
            </tbody>
        </table>
    </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:\Users\al-wasi\Downloads\cargomanagement-system\cargo-management-system\resources\views/reports/daily_shipments.blade.php ENDPATH**/ ?>