<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="csrf-token" content="{{ csrf_token() }}">
    @php($adminBrandVersion = $settings?->updated_at?->timestamp ?? $settings?->logo_media_id ?? $settings?->favicon_media_id ?? '1')
    <title>@yield('title', 'Admin') | {{ config('app.name') }}</title>
    <link rel="icon" href="{{ ($settings?->favicon_url ?? asset('uploads/placeholders/saleem-sial-favicon.png')) . '?v=' . $adminBrandVersion }}">
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js" defer></script>
    <link rel="stylesheet" href="{{ asset('assets/css/admin.css') }}">
    @stack('head')
</head>
<body class="admin-body" data-media-browser-url="{{ route('admin.media.browser') }}">
    <div class="admin-shell">
        @include('admin.partials.sidebar')

        <div class="admin-main">
            @include('admin.partials.topbar')

            <main class="admin-content">
                @if(session('success'))
                    <div class="admin-flash admin-flash--success">{{ session('success') }}</div>
                @endif

                @if(session('error'))
                    <div class="admin-flash admin-flash--error">{{ session('error') }}</div>
                @endif

                @yield('content')
            </main>
        </div>
    </div>

    <script src="{{ asset('assets/js/admin.js') }}"></script>
    @stack('scripts')
</body>
</html>
