<!DOCTYPE html>
<html lang="id" class="h-full bg-gray-50">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="csrf-token" content="<?php echo e(csrf_token()); ?>">
    <title><?php echo $__env->yieldContent('title', 'Kurir'); ?> - Service Center</title>

    <script src="https://cdn.tailwindcss.com"></script>
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        brand: {
                            50:  '#eff6ff',
                            100: '#dbeafe',
                            500: '#3b82f6',
                            600: '#2563eb',
                            700: '#1d4ed8',
                        }
                    }
                }
            }
        }
    </script>

    <script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.14.1/dist/cdn.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
    <script>
        const AppToast = Swal.mixin({
            toast: true, position: 'top-end',
            showConfirmButton: false, timerProgressBar: true,
            timer: 3500,
            didOpen: t => { t.onmouseenter = Swal.stopTimer; t.onmouseleave = Swal.resumeTimer; }
        });
        window.showSuccess = msg => AppToast.fire({ icon: 'success', title: msg });
        window.showError   = msg => AppToast.fire({ icon: 'error',   title: msg, timer: 5500 });
    </script>

    <?php echo $__env->yieldPushContent('head'); ?>
</head>
<body class="h-full bg-gray-100" x-data>
<header class="sticky top-0 z-40 bg-brand-700 text-white shadow-md">
    <div class="max-w-md mx-auto px-4 py-3 flex items-center justify-between">
        <div class="min-w-0">
            <p class="text-[11px] uppercase tracking-wider text-brand-100">Pickup &amp; Delivery App</p>
            <h1 class="text-base font-bold truncate">Panel Kurir</h1>
        </div>
        <div class="flex items-center gap-2">
            <span class="inline-flex items-center px-2 py-0.5 rounded-full text-[10px] font-semibold bg-brand-500">Kurir</span>
            <?php if(auth()->guard()->check()): ?>
            <form method="POST" action="<?php echo e(route('logout')); ?>">
                <?php echo csrf_field(); ?>
                <button type="submit" class="inline-flex items-center justify-center w-8 h-8 rounded-full bg-brand-600 hover:bg-brand-500 transition" title="Keluar">
                    <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"/>
                    </svg>
                </button>
            </form>
            <?php endif; ?>
        </div>
    </div>
</header>

<div class="max-w-md mx-auto px-4 pt-4"></div>
<main class="max-w-md mx-auto px-4 pb-24">
    <?php echo $__env->yieldContent('content'); ?>
</main>

<nav class="fixed bottom-0 inset-x-0 z-40 bg-white border-t border-gray-200 shadow-[0_-6px_20px_rgba(0,0,0,0.06)]">
    <div class="max-w-md mx-auto grid grid-cols-3">
        <a href="<?php echo e(route('courier.pickup')); ?>"
           class="flex flex-col items-center justify-center py-2.5 text-xs font-semibold transition <?php echo e(request()->routeIs('courier.pickup*') ? 'text-brand-700 bg-brand-50' : 'text-gray-500 hover:bg-gray-50'); ?>">
            <svg class="w-5 h-5 mb-0.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 8l4 4m0 0l-4 4m4-4H9m8 8H7a2 2 0 01-2-2V6a2 2 0 012-2h10"/>
            </svg>
            Pickup
        </a>
          <a href="<?php echo e(route('courier.delivery')); ?>"
              class="flex flex-col items-center justify-center py-2.5 text-xs font-semibold transition <?php echo e(request()->routeIs('courier.delivery') || request()->routeIs('courier.delivery.sales.*') || request()->routeIs('courier.ready') || request()->routeIs('handover.*') ? 'text-brand-700 bg-brand-50' : 'text-gray-500 hover:bg-gray-50'); ?>">
            <svg class="w-5 h-5 mb-0.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 8h10M7 12h10m-5 8a9 9 0 100-18 9 9 0 000 18z"/>
            </svg>
            Delivery
        </a>
        <a href="<?php echo e(route('courier.sop')); ?>"
           class="flex flex-col items-center justify-center py-2.5 text-xs font-semibold transition <?php echo e(request()->routeIs('courier.sop') ? 'text-brand-700 bg-brand-50' : 'text-gray-500 hover:bg-gray-50'); ?>">
            <svg class="w-5 h-5 mb-0.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.483 9.246 5 7.5 5 4.462 5 2 6.343 2 8v10c0-1.657 2.462-3 5.5-3 1.746 0 3.332.483 4.5 1.253m0-10C13.168 5.483 14.754 5 16.5 5c3.038 0 5.5 1.343 5.5 3v10c0-1.657-2.462-3-5.5-3-1.746 0-3.332.483-4.5 1.253"/>
            </svg>
            SOP
        </a>
    </div>
</nav>

<?php if(session('success')): ?>
<script>document.addEventListener('DOMContentLoaded', () => window.showSuccess(<?php echo \Illuminate\Support\Js::from(session('success'))->toHtml() ?>));</script>
<?php endif; ?>
<?php if(session('error')): ?>
<script>document.addEventListener('DOMContentLoaded', () => window.showError(<?php echo \Illuminate\Support\Js::from(session('error'))->toHtml() ?>));</script>
<?php endif; ?>
<?php if(! session('success') && ! session('error') && $errors->any()): ?>
<script>
document.addEventListener('DOMContentLoaded', () => {
    const errs = <?php echo \Illuminate\Support\Js::from($errors->all())->toHtml() ?>;
    const msg  = errs[0] + (errs.length > 1 ? ` (+${errs.length - 1} lainnya)` : '');
    window.showError(msg);
});
</script>
<?php endif; ?>

<?php echo $__env->yieldPushContent('scripts'); ?>
</body>
</html>
<?php /**PATH C:\laragon\www\Service-sistem\resources\views/layouts/courier.blade.php ENDPATH**/ ?>