<!DOCTYPE html>
<html lang="de">
<head>
    <meta charset="utf-8">
    <title>{% block title %}{% if title|default %}{{ title|trans([], 'admin') }} ‹ {% endif %}{{ page_config().pageTitle|default('Ferienpass') }}{% endblock %}</title>

    <meta name="robots" content="noindex,follow">
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="apple-touch-icon" sizes="180x180"
          href="{{ asset('favicon/apple-touch-icon.png', 'ferienpass_core') }}">
    <link rel="icon" type="image/png" sizes="32x32"
          href="{{ asset('favicon/favicon-16x16.png', 'ferienpass_core') }}">
    <link rel="icon" type="image/png" sizes="16x16"
          href="{{ asset('favicon/favicon-16x16.png', 'ferienpass_core') }} ?>">
    <link rel="manifest" href="{{ asset ('favicon/site.webmanifest', 'ferienpass_core') }}">
    <link rel="mask-icon" href="{{ asset('favicon/safari-pinned-tab.svg', 'ferienpass_core') }}"
          color="#209bc9">
    <link rel="shortcut icon" href="{{ asset('favicon/favicon.ico', 'ferienpass_core') }}">
    <meta name="msapplication-TileColor" content="#2d89ef">
    <meta name="msapplication-config" content="{{ asset('favicon/browserconfig.xml', 'ferienpass_core') }}">
    <meta name="theme-color" content="#209bc9">

    <link rel="stylesheet" href="{{ asset ('css/admin.tailwind.css') }}">

    {# Per-tenant brand color (PageConfig): re-derives the full --color-primary-50…900
       Tailwind scale at runtime — no custom build needed. #}
    {{ brand_color_css(page_config().colorPrimary) }}

    {{ importmap('admin') }}

    {% if app.request.attributes.get('plausible') %}
        <script async src="/js/script.js"></script>
        <script>
            window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)},plausible.init=plausible.init||function(i){plausible.o=i||{}};
            plausible.init({
                endpoint: "/api/event"
            })
        </script>
    {% endif %}

    {{ head|default }}
</head>

<body class="bg-gray-50 dark:bg-gray-950/95" data-controller="ferienpass--admin-platform">

{% block body %}

    {% if 'staging' == app.environment %}
        <div class="bg-red-600 dark:bg-red-500/20 px-6 py-2.5 sm:px-3.5 sm:before:flex-1">
            <p class="text-sm leading-6 text-white dark:text-red-400 text-center">
                <strong class="font-semibold">Sie befinden sich auf der Staging-Umgebung.</strong> Änderungen werden nicht
                beibehalten.
            </p>
        </div>
    {% endif %}

    {% if is_granted('IS_IMPERSONATOR') %}
        {{ render_esi(controller('Ferienpass\\AdminBundle\\Controller\\Fragment\\ImpersonationBannerController')) }}
    {% endif %}

    <header class="bg-white dark:bg-gray-950 shadow" x-data="{ mobileMenuOpen: false }">
        {% include '@FerienpassAdmin/layout/_header.html.twig' %}
            {% include '@FerienpassAdmin/layout/_secondary_nav.html.twig' %}
    </header>

    {% block container %}

        <div class="max-w-7xl mx-auto px-2 sm:px-4 lg:px-8 @container">

            {% include '@FerienpassAdmin/layout/_breadcrumb.html.twig' %}

            {% block content %}

                <main class="py-6">
                    {% block main %}{% endblock %}
                </main>

            {% endblock %}

        </div>

    {% endblock %}

    <footer>
        {% include '@FerienpassAdmin/layout/_footer.html.twig' %}
    </footer>

    <twig:Admin:Modal />
    <twig:Admin:SlideOver />
    <twig:Admin:Notifications />

    {% include '@FerienpassAdmin/search/_command_palette.html.twig' %}
    {% include '@FerienpassAdmin/search/_create_command_palette.html.twig' %}

{% endblock %}

</body>

</html>
