<!doctype html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>@yield('title', 'Admin Dashboard')</title>
        <link rel="icon" type="image/svg+xml" href="{{ asset('favicon.svg') }}">
        <link rel="preconnect" href="https://fonts.googleapis.com">
        <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
        <link href="https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap" rel="stylesheet">
        <link rel="stylesheet" href="{{ asset('css/site.css') }}">
        @stack('head')
    </head>
    <body class="admin-body">
        <aside class="admin-sidebar">
            <a class="brand" href="{{ route('storefront.home') }}">
                @include('partials.brand')
            </a>
            <nav class="admin-nav">
                <span>Core</span>
                <a @class(['active' => request()->routeIs('admin.dashboard')]) href="{{ route('admin.dashboard') }}">Dashboard</a>
                <span>Catalog</span>
                <a @class(['active' => request()->routeIs('admin.categories.*')]) href="{{ route('admin.categories.index') }}">Categories</a>
                <a @class(['active' => request()->routeIs('admin.products.*')]) href="{{ route('admin.products.index') }}">Products</a>
                <a @class(['active' => request()->routeIs('admin.inventory.*')]) href="{{ route('admin.inventory.index') }}">Inventory</a>
                <a @class(['active' => request()->routeIs('admin.home-sliders.*')]) href="{{ route('admin.home-sliders.index') }}">Sliders</a>
                <span>Marketing</span>
                <a @class(['active' => request()->routeIs('admin.announcements.*')]) href="{{ route('admin.announcements.index') }}">Announcements</a>
                <a @class(['active' => request()->routeIs('admin.newsletter-subscribers.*')]) href="{{ route('admin.newsletter-subscribers.index') }}">Newsletter</a>
                <a @class(['active' => request()->routeIs('admin.email-templates.*')]) href="{{ route('admin.email-templates.index') }}">Email Templates</a>
                <span>Sales</span>
                <a @class(['active' => request()->routeIs('admin.reports.*')]) href="{{ route('admin.reports.index') }}">Reports</a>
                <a @class(['active' => request()->routeIs('admin.coupons.*')]) href="{{ route('admin.coupons.index') }}">Coupons</a>
                <a @class(['active' => request()->routeIs('admin.orders.*')]) href="{{ route('admin.orders.index') }}">Orders</a>
                <span>Admin</span>
                <a @class(['active' => request()->routeIs('admin.admin-users.*')]) href="{{ route('admin.admin-users.index') }}">Admin Users</a>
                <a @class(['active' => request()->routeIs('admin.roles.*')]) href="{{ route('admin.roles.index') }}">Roles</a>
                <a @class(['active' => request()->routeIs('admin.customers.*')]) href="{{ route('admin.customers.index') }}">Customers</a>
                <a @class(['active' => request()->routeIs('admin.content-pages.*')]) href="{{ route('admin.content-pages.index') }}">Pages</a>
                <a @class(['active' => request()->routeIs('admin.settings.*')]) href="{{ route('admin.settings.edit') }}">Settings</a>
            </nav>
            <form method="POST" action="{{ route('admin.logout') }}" class="admin-logout">
                @csrf
                <button type="submit">Logout</button>
            </form>
        </aside>

        <main class="admin-main">
            @yield('content')
        </main>
        @stack('scripts')
    </body>
</html>
