@php
    $settings = app(\App\Services\SettingsRepository::class);
@endphp
<!DOCTYPE html>
<html
    lang="{{ str_replace('_', '-', app()->getLocale()) }}"
    data-theme-mode="system"
>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="csrf-token" content="{{ csrf_token() }}">

    {{-- An internal control panel has no business being indexed. --}}
    <meta name="robots" content="noindex, nofollow">

    <title>{{ isset($title) ? $title.' · ' : '' }}{{ $settings->string('panel_name', 'Thinkrax Central') }}</title>

    {{-- Progressive enhancement: if the CDN is unreachable the CSS falls back
         to the system sans stack, which is why nothing here blocks rendering. --}}
    <link rel="preconnect" href="https://fonts.bunny.net">
    <link href="https://fonts.bunny.net/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">

    @vite(['resources/css/app.css', 'resources/js/app.js'])
</head>
<body class="min-h-screen">

<div class="flex min-h-screen">

    <aside x-data="{ open: false }" @keydown.escape.window="open = false" class="no-print">
        <x-layout.sidebar />
    </aside>

    <div class="flex min-w-0 flex-1 flex-col">

        <x-layout.topbar />

        {{-- Verification is this panel's job. A backlog is stated everywhere. --}}
        <x-layout.queue-banner />

        <main class="flex-1 px-4 py-5 sm:px-6 lg:px-8">
            <x-ui.flash />

            {{ $slot }}
        </main>

        <footer class="no-print border-t border-slate-200 px-6 py-4 text-xs text-slate-500 dark:border-slate-800">
            <div class="flex flex-wrap items-center justify-between gap-2">
                <span>{{ config('thinkrax.company.name') }} &middot; internal control panel</span>
                <span class="tabular">{{ now()->format('D, d M Y · H:i') }}</span>
            </div>
        </footer>
    </div>
</div>

<x-ui.toast-host />

@livewireScripts
</body>
</html>
