<?php $attributes ??= new \Illuminate\View\ComponentAttributeBag;

$__newAttributes = [];
$__propNames = \Illuminate\View\ComponentAttributeBag::extractPropNames((['title' => 'Dashboard']));

foreach ($attributes->all() as $__key => $__value) {
    if (in_array($__key, $__propNames)) {
        $$__key = $$__key ?? $__value;
    } else {
        $__newAttributes[$__key] = $__value;
    }
}

$attributes = new \Illuminate\View\ComponentAttributeBag($__newAttributes);

unset($__propNames);
unset($__newAttributes);

foreach (array_filter((['title' => 'Dashboard']), 'is_string', ARRAY_FILTER_USE_KEY) as $__key => $__value) {
    $$__key = $$__key ?? $__value;
}

$__defined_vars = get_defined_vars();

foreach ($attributes->all() as $__key => $__value) {
    if (array_key_exists($__key, $__defined_vars)) unset($$__key);
}

unset($__defined_vars, $__key, $__value); ?>
<?php
    // Only queried when the Inventory route actually exists (Step 13) —
    // cheap either way, but no reason to hit the DB for a route that
    // isn't wired up yet.
    $lowStockBadge = \Illuminate\Support\Facades\Route::has('admin.inventory.index')
        ? \App\Models\Inventory::lowStock()->count() + \App\Models\Inventory::outOfStock()->count()
        : 0;

    $navGroups = [
        'Overview' => [
            ['label' => 'Dashboard', 'route' => 'admin.dashboard', 'icon' => 'fa-solid fa-gauge-high'],
        ],
        'Catalog' => [
            ['label' => 'Products', 'route' => 'admin.products.index', 'icon' => 'fa-solid fa-shirt'],
            ['label' => 'Categories', 'route' => 'admin.categories.index', 'icon' => 'fa-solid fa-sitemap'],
            ['label' => 'Brands', 'route' => 'admin.brands.index', 'icon' => 'fa-solid fa-copyright'],
            ['label' => 'Colors', 'route' => 'admin.colors.index', 'icon' => 'fa-solid fa-palette'],
            ['label' => 'Sizes', 'route' => 'admin.sizes.index', 'icon' => 'fa-solid fa-ruler'],
        ],
        'Sales' => [
            ['label' => 'Orders', 'route' => 'admin.orders.index', 'icon' => 'fa-solid fa-receipt'],
            ['label' => 'Payments', 'route' => 'admin.payments.index', 'icon' => 'fa-solid fa-money-check-dollar'],
            ['label' => 'Coupons', 'route' => 'admin.coupons.index', 'icon' => 'fa-solid fa-tags'],
        ],
        'Customers' => [
            ['label' => 'Customers', 'route' => 'admin.customers.index', 'icon' => 'fa-solid fa-users'],
        ],
        'Marketing' => [
            ['label' => 'Banners & Ads', 'route' => 'admin.banners.index', 'icon' => 'fa-solid fa-images'],
        ],
        'Operations' => [
            ['label' => 'Inventory', 'route' => 'admin.inventory.index', 'icon' => 'fa-solid fa-boxes-stacked', 'badge' => $lowStockBadge ?: null],
            ['label' => 'Reports', 'route' => 'admin.reports.index', 'icon' => 'fa-solid fa-chart-line'],
        ],
        'System' => [
            ['label' => 'Settings', 'route' => 'admin.settings.index', 'icon' => 'fa-solid fa-gear'],
        ],
    ];
?>
<!DOCTYPE html>
<html lang="<?php echo e(str_replace('_', '-', app()->getLocale())); ?>">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title><?php echo e($title); ?> — <?php echo e(config('niyarasa.brand_name')); ?> Admin</title>
    <?php echo app('Illuminate\Foundation\Vite')(['resources/css/admin.css', 'resources/js/admin.js']); ?>
</head>
<body class="bg-surface font-sans text-ink antialiased" x-data="{ sidebarOpen: false }">
    <div class="flex min-h-screen">
        
        <aside
            class="fixed inset-y-0 left-0 z-40 flex w-64 flex-col bg-gradient-to-b from-ink via-ink to-charcoal shadow-2xl transition-transform duration-300 lg:static lg:translate-x-0"
            :class="sidebarOpen ? 'translate-x-0' : '-translate-x-full'"
        >
            <div class="flex h-16 shrink-0 items-center gap-2 border-b border-white/10 px-6">
                <span class="bg-gradient-to-r from-champagne via-champagne-light to-champagne bg-clip-text text-lg font-semibold tracking-wide text-transparent">
                   <img
        src="<?php echo e(asset('images/logo.png')); ?>"
        alt="<?php echo e(config('niyarasa.brand_name')); ?>"
        class="h-10 w-auto mx-auto"
    >
                </span>
                <span class="text-xs uppercase tracking-[0.15em] text-cream/40">Admin</span>
            </div>

            <nav class="flex-1 space-y-6 overflow-y-auto px-3 py-6">
                <?php $__currentLoopData = $navGroups; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $group => $items): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div>
                        <p class="mb-2 px-3 text-[0.65rem] font-semibold uppercase tracking-[0.12em] text-cream/35">
                            <?php echo e($group); ?>

                        </p>
                        <div class="space-y-0.5">
                            <?php $__currentLoopData = $items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <?php if (isset($component)) { $__componentOriginal25b36b426f30fd196f9d947e60e48c56 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal25b36b426f30fd196f9d947e60e48c56 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.admin.sidebar-link','data' => ['item' => $item]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('admin.sidebar-link'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['item' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($item)]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal25b36b426f30fd196f9d947e60e48c56)): ?>
<?php $attributes = $__attributesOriginal25b36b426f30fd196f9d947e60e48c56; ?>
<?php unset($__attributesOriginal25b36b426f30fd196f9d947e60e48c56); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal25b36b426f30fd196f9d947e60e48c56)): ?>
<?php $component = $__componentOriginal25b36b426f30fd196f9d947e60e48c56; ?>
<?php unset($__componentOriginal25b36b426f30fd196f9d947e60e48c56); ?>
<?php endif; ?>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>
                    </div>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </nav>

            <div class="border-t border-white/10 p-4">
                <div class="flex items-center gap-3 rounded-xl px-2 py-2 transition-colors duration-200 hover:bg-white/5">
                    <div class="flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-gradient-to-br from-champagne/30 to-champagne-light/10 text-sm font-semibold text-champagne-light ring-1 ring-champagne/20">
                        <?php echo e(Str::of(auth()->user()->name)->substr(0, 1)->upper()); ?>

                    </div>
                    <div class="min-w-0 flex-1">
                        <p class="truncate text-sm font-medium text-cream"><?php echo e(auth()->user()->name); ?></p>
                        <p class="truncate text-xs text-cream/40"><?php echo e(auth()->user()->email); ?></p>
                    </div>
                    <form method="POST" action="<?php echo e(route('admin.logout')); ?>">
                        <?php echo csrf_field(); ?>
                        <button type="submit" title="Sign out" class="btn rounded-lg p-1.5 text-cream/50 transition-all duration-200 hover:scale-110 hover:bg-danger/10 hover:text-danger">
                            <i class="fa-solid fa-arrow-right-from-bracket"></i>
                        </button>
                    </form>
                </div>
            </div>
        </aside>

        <div
            x-cloak
            x-show="sidebarOpen"
            x-on:click="sidebarOpen = false"
            class="fixed inset-0 z-30 bg-ink/60 lg:hidden"
        ></div>

        
        <div class="flex min-w-0 flex-1 flex-col">
            <header class="sticky top-0 z-20 flex h-16 shrink-0 items-center justify-between border-b border-black/5 bg-white/80 px-4 shadow-sm backdrop-blur-md sm:px-6">
                <div class="flex items-center gap-3">
                    <button type="button" x-on:click="sidebarOpen = true" class="text-ink/60 transition hover:text-ink lg:hidden">
                        <i class="fa-solid fa-bars text-lg"></i>
                    </button>
                    <h1 class="text-lg font-semibold tracking-tight text-ink"><?php echo e($title); ?></h1>
                </div>

                <a href="<?php echo e(route('home')); ?>" target="_blank" class="hidden items-center gap-1.5 text-sm text-ink/50 transition-all duration-200 hover:gap-2.5 hover:text-champagne-light sm:flex">
                    <i class="fa-solid fa-arrow-up-right-from-square text-xs"></i>
                    View Storefront
                </a>
            </header>

            <main class="flex-1 animate-[fade-up_0.5s_var(--ease-luxury)_both] p-4 sm:p-6">
                <?php echo e($slot); ?>

            </main>
        </div>
    </div>

    <?php if(session('success') || session('error') || $errors->any()): ?>
        <script>
            document.addEventListener('DOMContentLoaded', () => {
                <?php if(session('success')): ?>
                    window.Swal.fire({
                        icon: 'success',
                        title: <?php echo json_encode(session('success'), 15, 512) ?>,
                        toast: true, position: 'top-end', showConfirmButton: false, timer: 3000, timerProgressBar: true,
                    });
                <?php endif; ?>
                <?php if(session('error')): ?>
                    window.Swal.fire({
                        icon: 'error',
                        title: <?php echo json_encode(session('error'), 15, 512) ?>,
                        toast: true, position: 'top-end', showConfirmButton: false, timer: 4000, timerProgressBar: true,
                    });
                <?php endif; ?>
                <?php if($errors->any()): ?>
                    window.Swal.fire({
                        icon: 'error',
                        title: 'Please check the form',
                        text: <?php echo json_encode($errors->first(), 15, 512) ?>,
                        toast: true, position: 'top-end', showConfirmButton: false, timer: 4000, timerProgressBar: true,
                    });
                <?php endif; ?>
            });
        </script>
    <?php endif; ?>
</body>
</html>
<?php /**PATH C:\xampp\htdocs\ecommerce\resources\views/components/layouts/admin.blade.php ENDPATH**/ ?>