<!DOCTYPE html>
<html lang="en" class="h-full">

<head>
    @include('layouts.partials.styles')
</head>

<body class="admin-body min-h-full">
    @php
        $siteName = setting('site_name', '360Monica');
        $siteLogo = setting('site_logo');
        $navGroups = [
            [
                'label' => 'Dashboard',
                'single_link' => true,
                'items' => [
                    ['route' => 'admin.dashboard', 'match' => 'admin.dashboard', 'icon' => 'bi-grid-1x2', 'label' => 'Dashboard', 'permission' => 'dashboard'],
                ]
            ],
            [
                'label' => 'User Management',
                'items' => [
                    ['route' => 'admin.users.index', 'match' => 'admin.users.*', 'icon' => 'bi-person-badge', 'label' => 'Users', 'permission' => 'staff'],
                    ['route' => 'admin.customers.index', 'match' => 'admin.customers.*', 'icon' => 'bi-people', 'label' => 'Customers', 'permission' => 'customers'],
                    ['route' => 'admin.roles.index', 'match' => 'admin.roles.*', 'icon' => 'bi-key', 'label' => 'Roles', 'permission' => 'staff'],
                    ['route' => 'admin.permissions.index', 'match' => 'admin.permissions.*', 'icon' => 'bi-shield-lock', 'label' => 'Permission', 'permission' => 'staff'],
                ]
            ],
            [
                'label' => 'Product Management',
                'items' => [
                    ['route' => 'admin.products.index', 'match' => 'admin.products.*', 'icon' => 'bi-box-seam', 'label' => 'Products', 'permission' => 'products'],
                    ['route' => 'admin.categories.index', 'match' => 'admin.categories.*', 'icon' => 'bi-tags', 'label' => 'Category', 'permission' => 'products'],
                    ['route' => 'admin.subcategories.index', 'match' => 'admin.subcategories.*', 'icon' => 'bi-diagram-3', 'label' => 'Subcategory', 'permission' => 'products'],
                    ['route' => 'admin.brands.index', 'match' => 'admin.brands.*', 'icon' => 'bi-award', 'label' => 'Brand', 'permission' => 'products'],
                    ['route' => 'admin.units.index', 'match' => 'admin.units.*', 'icon' => 'bi-rulers', 'label' => 'Unit', 'permission' => 'products'],
                ]
            ],
            [
                'label' => 'Sales',
                'items' => [
                    ['route' => 'admin.orders.index', 'match' => 'admin.orders.*', 'icon' => 'bi-bag-check', 'label' => 'Orders', 'permission' => 'orders'],
                    ['route' => 'admin.payments.index', 'match' => 'admin.payments.*', 'icon' => 'bi-receipt', 'label' => 'Payments', 'permission' => 'payments'],
                ]
            ],
            [
                'label' => 'CMS',
                'items' => [
                    ['route' => 'admin.page-content.index', 'match' => 'admin.page-content.*', 'icon' => 'bi-file-earmark-text', 'label' => 'Page Content', 'permission' => 'content'],
                    ['route' => 'admin.faqs.index', 'match' => 'admin.faqs.*', 'icon' => 'bi-question-circle', 'label' => 'FAQ', 'permission' => 'content'],
                    ['route' => 'admin.slides.index', 'match' => 'admin.slides.*', 'icon' => 'bi-images', 'label' => 'Slide', 'permission' => 'content'],
                ]
            ],
            [
                'label' => 'Setting',
                'items' => [
                    ['route' => 'admin.settings.index', 'match' => 'admin.settings.*', 'icon' => 'bi-gear', 'label' => 'General setting', 'permission' => 'settings'],
                    ['route' => 'admin.shipping-methods.index', 'match' => 'admin.shipping-methods.*', 'icon' => 'bi-truck', 'label' => 'Shipping', 'permission' => 'settings'],
                    ['route' => 'admin.payment-methods.index', 'match' => 'admin.payment-methods.*', 'icon' => 'bi-credit-card', 'label' => 'Payment Method', 'permission' => 'payments'],
                ]
            ],
            [
                'label' => 'Reporting',
                'items' => [
                    ['route' => 'admin.reports.sales', 'match' => 'admin.reports.sales', 'icon' => 'bi-graph-up-arrow', 'label' => 'Sale report', 'permission' => 'reports'],
                    ['route' => 'admin.reports.products', 'match' => 'admin.reports.products', 'icon' => 'bi-bar-chart', 'label' => 'Products Report', 'permission' => 'reports'],
                ]
            ],
        ];
    @endphp

    <div id="sidebar-overlay" class="admin-sidebar-overlay" onclick="AdminUI.toggleSidebar()"></div>
    @include('layouts.partials.sidebar')

    <div class="admin-shell">
        @include('layouts.partials.header')

        <main class="admin-main">
            @include('layouts.partials.breadcrumb')
            <x-admin.page-header :title="trim($__env->yieldContent('page-title', $__env->yieldContent('title', 'Dashboard')))" :description="trim($__env->yieldContent('page-description')) ?: null">
                @hasSection('page-actions')
                    <x-slot:actions>@yield('page-actions')</x-slot:actions>
                @endif
            </x-admin.page-header>

            @include('layouts.partials.alerts')

            <div class="fade-in admin-content-surface">
                @yield('content')
            </div>
        </main>

        @include('layouts.partials.footer')
    </div>

    @include('layouts.partials.scripts')
</body>

</html>