<?php $__env->startSection('title', 'My Bookings'); ?>

<?php $__env->startSection('content'); ?>
<section class="mx-auto max-w-5xl px-4 py-10 sm:px-6">
    <?php echo $__env->make('account.partials.nav', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

    <div class="space-y-3">
        <?php $__empty_1 = true; $__currentLoopData = $bookings; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $booking): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
            <?php $badge = ['pending'=>'amber','confirmed'=>'sky','checked_in'=>'emerald','checked_out'=>'slate','cancelled'=>'rose','no_show'=>'rose'][$booking->status] ?? 'slate'; ?>
            <div class="rounded-3xl bg-white p-5 shadow-sm ring-1 ring-slate-200">
                <div class="flex flex-wrap items-center gap-3">
                    <span class="text-3xl">🛏</span>
                    <div class="min-w-0 flex-1">
                        <p class="font-bold text-slate-900"><?php echo e($booking->roomType->name ?? 'Room'); ?> <span class="ml-1 font-mono text-xs text-slate-400"><?php echo e($booking->code); ?></span></p>
                        <p class="text-xs text-slate-500"><?php echo e($booking->check_in->format('D j M Y')); ?> → <?php echo e($booking->check_out->format('D j M Y')); ?> · <?php echo e($booking->adults); ?> adult<?php echo e($booking->adults === 1 ? '' : 's'); ?></p>
                    </div>
                    <div class="text-right">
                        <p class="font-extrabold text-slate-900"><?php echo e($CUR ?? '₦') . number_format((float) ($booking->total_amount), 2); ?></p>
                        <?php if($booking->balance() > 0): ?><p class="text-[11px] font-bold text-rose-500"><?php echo e($CUR ?? '₦') . number_format((float) ($booking->balance()), 2); ?> due</p><?php endif; ?>
                    </div>
                    <span class="rounded-full bg-<?php echo e($badge); ?>-100 px-2.5 py-1 text-[10px] font-bold uppercase text-<?php echo e($badge); ?>-700"><?php echo e(str_replace('_', ' ', $booking->status)); ?></span>
                    <?php if($booking->balance() > 0 && ! in_array($booking->status, ['cancelled', 'no_show'])): ?>
                        <a href="<?php echo e(route('pay.show', ['type' => 'booking', 'code' => $booking->code])); ?>" class="rounded-xl bg-gradient-to-r from-gold-400 to-gold-600 px-4 py-2 text-xs font-extrabold text-slate-950 hover:brightness-110">Pay online</a>
                    <?php endif; ?>
                </div>
            </div>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
            <div class="rounded-3xl bg-white p-12 text-center ring-1 ring-slate-200">
                <p class="text-4xl">🧳</p>
                <p class="mt-3 font-bold text-slate-600">No bookings yet</p>
                <a href="<?php echo e(route('site.book')); ?>" class="mt-4 inline-block rounded-xl bg-slate-950 px-6 py-3 text-sm font-bold text-white">Book your first stay</a>
            </div>
        <?php endif; ?>
    </div>
    <div class="mt-5"><?php echo e($bookings->links()); ?></div>
</section>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.site', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\wamp64\www\hms\resources\views/account/bookings.blade.php ENDPATH**/ ?>