/*
 * Drei Räume, eine Marke (App\Filament\Support\Raum).
 *
 *   Prüfstelle (admin)   — Nachttinte, Messing:   wer hier arbeitet, vergibt das Siegel.
 *   Kabinett (kabinett)  — Tanne, Messing:        die Kanzlei der Fachkraft.
 *   Konto (konto)        — Papier, Nachtblau:     leise und vertraulich für Suchende.
 *
 * Gemeinsam: Siegel und Messing als Erkennungszeichen, Literata in Überschriften,
 * die Fußzeile des Betreibers. Unterschiedlich: Seitenleiste, Grundfläche, Primärfarbe.
 */

/* ─── Raumfarben ─────────────────────────────────────────────────────────── */
.fi-body {
    --vf-messing: #a8813f;
    --vf-messing-hell: #d8bf8e;
    --vf-tinte: #14181c;
    --vf-papier: #f6f4ef;
    --vf-leiste-oben: #14181c;
    --vf-leiste-unten: #1f262c;
    --vf-leiste-text: rgba(255, 255, 255, .80);
    --vf-leiste-leise: rgba(255, 255, 255, .46);
    --vf-leiste-aktiv: rgba(216, 191, 142, .14);
    --vf-raum-band: linear-gradient(90deg, #14181c 0%, #2a3239 55%, #a8813f 100%);
}

.fi-body.fi-panel-admin {
    --vf-papier: #f3f2ee;
    --vf-leiste-oben: #101418;
    --vf-leiste-unten: #1d252b;
    --vf-raum-band: linear-gradient(90deg, #101418 0%, #2a3239 50%, #a8813f 100%);
}

.fi-body.fi-panel-kabinett {
    --vf-papier: #f5f3ee;
    --vf-leiste-oben: #0d2623;
    --vf-leiste-unten: #17403b;
    --vf-leiste-aktiv: rgba(216, 191, 142, .16);
    --vf-raum-band: linear-gradient(90deg, #0d2623 0%, #245f58 55%, #a8813f 100%);
}

.fi-body.fi-panel-konto {
    --vf-papier: #f7f6f2;
    --vf-raum-band: linear-gradient(90deg, #27354b 0%, #3b5885 55%, #a8813f 100%);
}

/* ─── Grundfläche ────────────────────────────────────────────────────────── */
html:not(.dark) .fi-body {
    background-color: var(--vf-papier);
}

html:not(.dark) .fi-body.fi-panel-konto {
    /* Ein einziger, sehr leiser Lichtfleck oben rechts — Ruhe statt Dekor. */
    background-image: radial-gradient(1200px 520px at 100% -10%, rgba(59, 88, 133, .07), transparent 70%);
    background-attachment: fixed;
}

/* ─── Überschriften: Literata wie auf der Website ───────────────────────── */
.fi-header-heading,
.fi-simple-header-heading,
.fi-section-header-heading,
.fi-wi-stats-overview-header-heading,
.fi-modal-heading {
    font-family: Literata, Georgia, serif;
    font-weight: 500;
    word-spacing: .08em;
}

.fi-header-heading,
.fi-simple-header-heading {
    letter-spacing: -.012em;
    word-spacing: normal;
}

.fi-header-heading {
    font-size: clamp(1.6rem, 2.2vw, 2rem);
    line-height: 1.15;
}

/* ─── Marke im Kopf ──────────────────────────────────────────────────────── */
.vf-brand {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    height: 100%;
    white-space: nowrap;
}

.vf-brand-siegel {
    width: 2.35rem;
    height: 2.35rem;
    flex: none;
}

.vf-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.vf-brand-wort {
    font-family: Literata, Georgia, serif;
    font-size: 1.32rem;
    font-weight: 500;
    letter-spacing: -.015em;
    color: var(--vf-tinte);
}

.vf-brand-raum {
    margin-top: .2rem;
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--vf-messing);
}

.dark .vf-brand-wort { color: #f3efe6; }
.dark .vf-brand-raum { color: var(--vf-messing-hell); }

/* ─── Kopfleiste: Raumband als oberste Kante ────────────────────────────── */
.fi-topbar {
    position: relative;
    box-shadow: 0 1px 0 rgba(20, 24, 28, .06);
}

.fi-topbar::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--vf-raum-band);
}

html:not(.dark) .fi-panel-konto .fi-topbar {
    background: #fbfaf6;
    border-bottom: 1px solid #e6dcc6;
}

.fi-panel-konto .fi-topbar-item.fi-active .fi-topbar-item-btn {
    box-shadow: inset 0 -2px 0 var(--vf-messing);
    border-radius: .5rem .5rem 0 0;
}

/* ─── Seitenleiste der Prüfstelle und des Kabinetts ─────────────────────── */
.fi-panel-admin .fi-sidebar,
.fi-panel-kabinett .fi-sidebar {
    background:
        radial-gradient(420px 260px at 0% 100%, rgba(168, 129, 63, .16), transparent 70%),
        linear-gradient(180deg, var(--vf-leiste-oben) 0%, var(--vf-leiste-unten) 100%) !important;
    border-inline-end: 1px solid rgba(168, 129, 63, .28);
}

/* Auf Mobilgeräten bleibt der Kopf der ausgeklappten Leiste hell — dort steht die Marke. */
.fi-panel-admin .fi-sidebar-header,
.fi-panel-kabinett .fi-sidebar-header {
    background: #fbfaf6;
}

.dark .fi-panel-admin .fi-sidebar-header,
.dark .fi-panel-kabinett .fi-sidebar-header {
    background: var(--vf-leiste-oben);
}

:is(.fi-panel-admin, .fi-panel-kabinett) .fi-sidebar-group-label {
    color: var(--vf-messing-hell);
    opacity: .85;
    font-size: .76rem;
    font-weight: 600;
    letter-spacing: .02em;
}

:is(.fi-panel-admin, .fi-panel-kabinett) .fi-sidebar-group-btn .fi-icon,
:is(.fi-panel-admin, .fi-panel-kabinett) .fi-sidebar-group-collapse-btn .fi-icon {
    color: var(--vf-leiste-leise);
}

:is(.fi-panel-admin, .fi-panel-kabinett) .fi-sidebar-item-label,
:is(.fi-panel-admin, .fi-panel-kabinett) .fi-sidebar-database-notifications-btn-label {
    color: var(--vf-leiste-text);
}

:is(.fi-panel-admin, .fi-panel-kabinett) .fi-sidebar-item-btn > .fi-icon,
:is(.fi-panel-admin, .fi-panel-kabinett) .fi-sidebar-database-notifications-btn > .fi-icon,
:is(.fi-panel-admin, .fi-panel-kabinett) .fi-sidebar-group-dropdown-trigger-btn .fi-icon {
    color: var(--vf-leiste-leise);
}

:is(.fi-panel-admin, .fi-panel-kabinett) .fi-sidebar-item.fi-sidebar-item-has-url > .fi-sidebar-item-btn:hover,
:is(.fi-panel-admin, .fi-panel-kabinett) .fi-sidebar-item.fi-sidebar-item-has-url > .fi-sidebar-item-btn:focus-visible,
:is(.fi-panel-admin, .fi-panel-kabinett) .fi-sidebar-database-notifications-btn:hover,
:is(.fi-panel-admin, .fi-panel-kabinett) .fi-sidebar-group-dropdown-trigger-btn:hover {
    background: rgba(255, 255, 255, .06);
}

:is(.fi-panel-admin, .fi-panel-kabinett) .fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background: var(--vf-leiste-aktiv);
    box-shadow: inset 2px 0 0 var(--vf-messing-hell);
    border-radius: 0 .5rem .5rem 0;
}

:is(.fi-panel-admin, .fi-panel-kabinett) .fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-sidebar-item-label {
    color: #f6ecd6;
}

:is(.fi-panel-admin, .fi-panel-kabinett) .fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-icon,
:is(.fi-panel-admin, .fi-panel-kabinett) .fi-sidebar-group.fi-active .fi-sidebar-group-dropdown-trigger-btn .fi-icon {
    color: var(--vf-messing-hell);
}

:is(.fi-panel-admin, .fi-panel-kabinett) .fi-sidebar-item-grouped-border-part-not-first,
:is(.fi-panel-admin, .fi-panel-kabinett) .fi-sidebar-item-grouped-border-part-not-last {
    background: rgba(255, 255, 255, .14);
}

:is(.fi-panel-admin, .fi-panel-kabinett) .fi-sidebar-item-grouped-border-part {
    background: rgba(255, 255, 255, .3);
}

:is(.fi-panel-admin, .fi-panel-kabinett) .fi-sidebar-item.fi-active .fi-sidebar-item-grouped-border-part {
    background: var(--vf-messing-hell);
}

:is(.fi-panel-admin, .fi-panel-kabinett) .fi-sidebar-footer,
:is(.fi-panel-admin, .fi-panel-kabinett) .fi-sidebar-header-controls::after {
    border-color: rgba(255, 255, 255, .1);
}

:is(.fi-panel-admin, .fi-panel-kabinett) .fi-sidebar .fi-icon-btn {
    color: var(--vf-leiste-leise);
}

:is(.fi-panel-admin, .fi-panel-kabinett) .fi-sidebar-nav {
    scrollbar-color: rgba(255, 255, 255, .18) transparent;
}

/* ─── Karte unten in der Seitenleiste ───────────────────────────────────── */
.vf-leiste {
    margin: 0 .75rem .75rem;
    display: flex;
    gap: .7rem;
    align-items: flex-start;
    padding: .85rem .8rem;
    border: 1px solid rgba(216, 191, 142, .22);
    border-radius: .65rem;
    background: rgba(255, 255, 255, .03);
}

.vf-leiste img { flex: none; margin-top: .1rem; }
.vf-leiste div { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.vf-leiste b { font-family: Literata, Georgia, serif; font-weight: 500; font-size: .95rem; color: #f3efe6; }
.vf-leiste span { font-size: .74rem; line-height: 1.4; color: var(--vf-leiste-leise); }
.vf-leiste a { font-size: .78rem; font-weight: 600; color: var(--vf-messing-hell); text-decoration: none; margin-top: .15rem; }
.vf-leiste a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Eingeklappt (Prüfstelle): nur das Siegel. */
@media (min-width: 1024px) {
    .fi-sidebar:not(.fi-sidebar-open) .vf-leiste { padding: .5rem; border: 0; background: none; justify-content: center; }
    .fi-sidebar:not(.fi-sidebar-open) .vf-leiste div { display: none; }
}

/* Konto hat keine Seitenleiste auf dem Desktop; die mobile Leiste bleibt hell. */
.fi-panel-konto .vf-leiste { border-color: #e6dcc6; background: #fbfaf6; }
.fi-panel-konto .vf-leiste b { color: var(--vf-tinte); }
.fi-panel-konto .vf-leiste span { color: #6b655a; }
.fi-panel-konto .vf-leiste a { color: #3b5885; }

/* ─── Inhalt: Abschnitte und Kacheln ─────────────────────────────────────── */
html:not(.dark) .fi-section:not(.fi-section-not-contained),
html:not(.dark) .fi-ta-ctn,
html:not(.dark) .vf-kachel,
html:not(.dark) .vf-karte {
    box-shadow: 0 1px 0 rgba(20, 24, 28, .04), 0 8px 24px -18px rgba(20, 24, 28, .25);
}

.vf-kachel b {
    font-family: Literata, Georgia, serif;
    font-weight: 500;
    letter-spacing: -.02em;
}

/* Listen in eigenen Ansichten (Tailwind-Klassen, die Filament nicht mitbringt). */
.fi-main ul.list-disc { list-style: disc; padding-inline-start: 1.25rem; }
.fi-main ul.list-disc > li::marker { color: var(--primary-500); }
.fi-main .space-y-1 > * + * { margin-top: .3rem; }

/* ─── Fußzeile des Betreibers ───────────────────────────────────────────── */
.vf-fuss {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .4rem 1.5rem;
    align-items: center;
    margin: 3rem auto 0;
    padding: 1.25rem 1rem 1.6rem;
    border-top: 1px solid rgba(168, 129, 63, .35);
    font-size: .78rem;
    color: #6b655a;
    width: 100%;
}

@media (min-width: 768px) { .vf-fuss { padding-inline: 1.5rem; } }
@media (min-width: 1024px) { .vf-fuss { padding-inline: 2rem; } }

.vf-fuss-marke { display: flex; align-items: center; gap: .5rem; color: #32383c; }
.vf-fuss-marke b { font-family: Literata, Georgia, serif; font-weight: 500; font-size: .92rem; }
.vf-fuss-firma { grid-column: 1; display: flex; flex-wrap: wrap; gap: .1rem 1rem; }
.vf-fuss-links { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; justify-content: flex-end; }
.vf-fuss-links a { color: inherit; text-decoration: none; }
.vf-fuss-links a:hover { color: var(--vf-messing); text-decoration: underline; text-underline-offset: 3px; }

.dark .vf-fuss { color: #9c968b; border-color: rgba(216, 191, 142, .2); }
.dark .vf-fuss-marke { color: #d6d0c4; }

@media (max-width: 640px) {
    .vf-fuss { grid-template-columns: 1fr; }
    .vf-fuss-links { grid-column: 1; grid-row: auto; justify-content: flex-start; }
}

/* ─── Anmeldeseiten ──────────────────────────────────────────────────────── */
html:not(.dark) .fi-panel-admin .fi-simple-layout,
html:not(.dark) .fi-panel-kabinett .fi-simple-layout {
    background:
        radial-gradient(900px 520px at 85% 0%, rgba(168, 129, 63, .22), transparent 65%),
        linear-gradient(160deg, var(--vf-leiste-oben) 0%, var(--vf-leiste-unten) 100%);
}

html:not(.dark) .fi-panel-konto .fi-simple-layout {
    background:
        radial-gradient(900px 520px at 85% 0%, rgba(59, 88, 133, .12), transparent 65%),
        var(--vf-papier);
}

.fi-simple-main {
    border-top: 3px solid transparent;
    border-image: var(--vf-raum-band) 1;
    box-shadow: 0 30px 60px -30px rgba(10, 14, 18, .45);
}

.fi-simple-layout .fi-logo { margin-bottom: .25rem; }

/* Fußzeile auf den Anmeldeseiten: dieselbe Fußzeile, auf dunklem Grund hell. */
.fi-simple-layout .vf-fuss { margin-top: 0; border-top-color: rgba(168, 129, 63, .25); }

html:not(.dark) :is(.fi-panel-admin, .fi-panel-kabinett) .fi-simple-layout .vf-fuss { color: rgba(255, 255, 255, .55); }
html:not(.dark) :is(.fi-panel-admin, .fi-panel-kabinett) .fi-simple-layout .vf-fuss-marke { color: rgba(255, 255, 255, .85); }
html:not(.dark) :is(.fi-panel-admin, .fi-panel-kabinett) .fi-simple-layout .vf-fuss-links a:hover { color: var(--vf-messing-hell); }

/* Konto: Übersicht */
.vf-weiter { display: grid; gap: .1rem; }
.vf-weiter a { display: grid; grid-template-columns: 1fr auto; gap: .1rem 1rem; padding: .7rem 0; border-bottom: 1px solid var(--gray-100); text-decoration: none; }
.vf-weiter a:last-child { border-bottom: 0; }
.vf-weiter b { font-weight: 600; color: var(--primary-700); }
.vf-weiter span { grid-column: 1; font-size: .85rem; color: var(--gray-500); }
.vf-weiter a:hover b { text-decoration: underline; text-underline-offset: 3px; }
.dark .vf-weiter a { border-color: rgba(255, 255, 255, .06); }
.dark .vf-weiter b { color: var(--primary-300); }

/* ─── Bewegung nur, wenn erwünscht ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .fi-body * { transition-duration: 0s !important; }
}

.vf-notiz { margin-top: .9rem; font-size: .78rem; line-height: 1.5; color: var(--gray-500); }

/* Empfehlung EAPD im Kabinett */
.vf-eapd { border-top: 3px solid var(--vf-messing); }
.vf-eapd-liste { list-style: none; padding: 0; margin: .75rem 0 0; display: grid; gap: .4rem; font-size: .88rem; }
.vf-eapd-liste li { padding-inline-start: 1.4rem; position: relative; }
.vf-eapd-liste li::before { content: ""; position: absolute; inset-inline-start: .2rem; top: .45rem; width: .55rem; height: .3rem; border-left: 2px solid var(--vf-messing); border-bottom: 2px solid var(--vf-messing); transform: rotate(-45deg); }
.vf-eapd-knoepfe { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center; margin-top: 1rem; }
.vf-eapd-link { font-size: .88rem; font-weight: 600; color: var(--primary-700); text-decoration: underline; text-underline-offset: 3px; }
.dark .vf-eapd-link { color: var(--primary-300); }

/* Seitenleiste immer auf voller Höhe, Fläche durchgehend (TZ Rollen und Rechte, 12). */
@media (min-width: 1024px) {
    .fi-panel-admin .fi-sidebar,
    .fi-panel-kabinett .fi-sidebar { min-height: 100dvh; }
}
.fi-panel-admin .fi-sidebar-nav,
.fi-panel-kabinett .fi-sidebar-nav { background: transparent; }
