/* ============================================================================
   Steigerwaldmobile Verwaltung – Gestaltung
   Farben: Grün als Markenton (Anmeldung, Buttons, Navigation),
   geometrische Sans-Schrift
   ============================================================================ */

:root {
    --gruen: #75b63b;        /* Marken-Grün: Buttons, Links, aktive Navigation */
    --gruen-dunkel: #598b2c; /* Verlaufsende / Hover */
    --gruen-hell: #eef6e3;   /* helle Akzentfläche */
    --rot: #e5484d;
    --text: #1c2333;
    --stumm: #6b7280;
    --hintergrund: #f4f5fa;
    --karte: #ffffff;
    --rand: #e4e7f0;
    --radius: 12px;
    --schatten: 0 1px 3px rgba(28, 35, 51, 0.08), 0 8px 24px rgba(28, 35, 51, 0.06);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif; /* v12: Inter (lokal, siehe schrift.css) */
    color: var(--text);
    background: var(--hintergrund);
    font-size: 15px;
    line-height: 1.5;
}

a { color: var(--gruen-dunkel); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: 0.2px; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0; }

/* ------------------------------------------------------------- Grundlayout */

.admin-raster {
    display: grid;
    grid-template-columns: 280px 1fr; /* v7: breiter, damit das Logo komplett passt */
    min-height: 100vh;
}

.admin-seitenleiste {
    background: var(--karte);
    border-right: 1px solid var(--rand);
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: sticky;
    top: 0;
    height: 100vh;
}

/* v7: Der Inhalt nutzt die GESAMTE Bildschirmbreite (kein max-width mehr,
   ausdrücklich gewünscht für das Dashboard/Übersicht). */
.admin-inhalt {
    padding: 26px 30px 60px;
    width: 100%;
}

.admin-kopf {
    display: flex; align-items: center;
    height: 64px; margin: -20px -14px 4px; padding: 0 16px;
    background: #fff; border-bottom: 1px solid var(--rand);
}
.admin-kopf .marke-logo { height: 30px; max-width: 100%; }

.admin-marke { display: flex; align-items: center; gap: 10px; padding: 2px 6px; flex-wrap: wrap; }
.admin-marke-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.admin-marke-text strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.admin-marke-text small { color: var(--stumm); font-size: 12px; }

.marke-punkt {
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--gruen); /* v14: einfarbig, kein Verlauf */
    box-shadow: 0 0 0 4px rgba(117, 182, 59, 0.18);
    flex: none;
}

/* =====================================================================
   v27 NAVBAR: weiße Leiste, dezente Borders, graue Markierung mit
   SCHWARZEM Balken links bei hover/aktiv (statt blau/grün). Die Einträge
   stehen in einer umrandeten, verbundenen Gruppe – jede Zeile mit
   hauchfeiner Trennlinie, wie in der Referenz. */
.admin-nav { display: flex; flex-direction: column; }

.nav-gruppe {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 11px 12px;
    background: none; border: 0; border-radius: 0;
    border-bottom: 1px solid #ececf1;
    box-shadow: inset 3px 0 0 transparent; /* Platzhalter für den schwarzen Balken */
    font: inherit; font-weight: 600; color: var(--text);
    cursor: pointer; text-align: left;
    transition: background 0.12s ease;
}
.nav-gruppe:hover { background: #f1f2f6; text-decoration: none; }
.nav-gruppe .nav-chev { margin-left: auto; transition: transform 0.15s ease; color: var(--stumm); }
.nav-gruppe.offen .nav-chev { transform: rotate(180deg); }

/* Navigation: Unterpunkte nutzen die GANZE Breite der Seitenleiste (Padding
   links und rechts über die komplette Navigationsbreite, nicht eingerückt). */
.nav-unter { display: none; flex-direction: column; }
.nav-unter.offen { display: flex; }
.nav-unter a {
    padding: 10px 14px 10px 20px;
    border-radius: 0;
    border-bottom: 1px solid #ececf1;
    color: #46506b; font-size: 14px;
    box-shadow: inset 3px 0 0 transparent;
    transition: background 0.12s ease;
}
.nav-unter a:hover {
    background: #f1f2f6;
    box-shadow: inset 3px 0 0 #111318; /* schwarzer Streifen links */
    text-decoration: none;
}
/* Aktiver Punkt: dezent grau hinterlegt + SCHWARZER Balken links + fett. */
.nav-unter a.aktiv {
    background: #e9eaee;
    box-shadow: inset 3px 0 0 #111318;
    color: var(--text);
    font-weight: 700;
}

/* v14: Einzelpunkt in der Navigation – gleiche Optik wie eine nav-gruppe,
   aber als Link OHNE Auf/Zuklappen (v27: grau + schwarzer Balken). */
.nav-gruppe.nav-einzel { text-decoration: none; }
.nav-gruppe.nav-einzel:hover { text-decoration: none; }
.nav-gruppe.nav-einzel.aktiv-einzel {
    background: #e9eaee;
    box-shadow: inset 3px 0 0 #111318;
    color: var(--text);
}

.seitenleiste-fuss { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }

.admin-benutzer { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.benutzer-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--gruen); /* v14: einfarbig, kein Verlauf */
    color: #fff; font-weight: 700; flex: none;
}
.benutzer-info { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.benutzer-info strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.benutzer-info small { color: var(--stumm); font-size: 12px; }

/* --------------------------------------------------------------- Elemente */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 16px; border-radius: 10px;
    border: 1px solid var(--rand); background: #fff; color: var(--text);
    font: inherit; font-weight: 600; cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.12s ease, background 0.12s ease;
    text-decoration: none;
}
.btn:hover { text-decoration: none; box-shadow: var(--schatten); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primar {
    /* v14: EINFARBIG – kein Verlauf mehr (durchgängig überall). */
    background: var(--gruen);
    border-color: transparent; color: #fff;
}
.btn-primar:hover { box-shadow: 0 6px 18px rgba(117, 182, 59, 0.35); }

.btn-gefahr { color: var(--rot); border-color: #f3c6c8; background: #fff5f5; }
.btn-gefahr:hover { background: #ffe9e9; }

.btn-klein { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }

.karte {
    background: var(--karte);
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    box-shadow: var(--schatten);
    padding: 20px 22px;
}

.seiten-kopf {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.seiten-untertitel { margin: 0; color: var(--stumm); }

.leer-hinweis { text-align: center; padding: 46px 20px; }
.leer-hinweis p { color: var(--stumm); }
.leer-hinweis .btn { margin-top: 10px; }

.stapel { display: flex; flex-direction: column; gap: 12px; }
.stumm { color: var(--stumm); }
.versteckt { display: none !important; }
.zentriert { text-align: center; }

.hinweis { padding: 10px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 14px; }
.hinweis-fehler { background: #ffe9e9; color: #a3232a; border: 1px solid #f3c6c8; }
.hinweis-erfolg { background: #eef6e3; color: #3c5c1e; border: 1px solid #cfe6b3; }

.eingabe {
    width: 100%; padding: 9px 12px;
    border: 1px solid var(--rand); border-radius: 10px;
    font: inherit; color: var(--text); background: #fff;
}
.eingabe:focus { outline: 2px solid rgba(117, 182, 59, 0.32); border-color: var(--gruen); }
.eingabe.kompakt { width: auto; padding: 6px 10px; font-size: 13.5px; }
textarea.eingabe { resize: vertical; }

.farbe-eingabe { width: 44px; height: 36px; padding: 2px; border: 1px solid var(--rand); border-radius: 8px; background: #fff; cursor: pointer; }

.feld { display: flex; flex-direction: column; gap: 5px; }
.feld > span { font-size: 13px; font-weight: 600; color: #46506b; }

.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th {
    text-align: left; font-size: 12.5px; text-transform: uppercase;
    letter-spacing: 0.4px; color: var(--stumm); padding: 8px 10px;
    border-bottom: 1px solid var(--rand);
}
.tabelle td { padding: 8px 10px; border-bottom: 1px solid #eef0f7; vertical-align: middle; }
.tabelle tr:last-child td { border-bottom: 0; }

.badge {
    display: inline-flex; align-items: center;
    padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
    background: color-mix(in srgb, var(--badge-farbe, var(--gruen)) 14%, #ffffff);
    color: var(--badge-farbe, var(--gruen));
    border: 1px solid color-mix(in srgb, var(--badge-farbe, var(--gruen)) 30%, #ffffff);
}
.badge-neutral { background: #f1f3fa; color: #46506b; border: 1px solid var(--rand); }
.badge-zeile { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }

.aktion-zeile { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.farb-punkt { width: 16px; height: 16px; border-radius: 50%; display: inline-block; flex: none; }

/* --------------------------------------------------------------- Übersicht
   v14/v16: Anleitungen als HORIZONTALE Zeilen über die gesamte Bildschirmbreite
   (statt Karten-Raster): Höhe jetzt 100px mit großem Coverbild – links das
   Bild, dann Name, Sprache, Seitenanzahl und zuletzt geändert – die Buttons
   stehen in EINER Reihe ganz rechts. Über der Liste sitzt die kleine Suche
   (Name) mit Sprachfilter (v16). */

.anleitung-liste { display: flex; flex-direction: column; gap: 10px; }

.anleitung-zeile {
    display: flex; align-items: center; gap: 14px;
    height: 100px; /* v16: 100px (vorher 50px) – größeres Coverbild */
    background: var(--karte); border: 1px solid var(--rand);
    border-radius: 12px; box-shadow: var(--schatten);
    padding: 0 12px 0 8px;
    overflow: hidden;
}
.anleitung-zeile.versteckt { display: none; }

.anleitung-mini-cover {
    flex: none; width: 84px; height: 84px; border-radius: 10px; overflow: hidden;
    background: #1d3a26; /* einfarbig, kein Verlauf */
    display: flex; align-items: center; justify-content: center;
}
.anleitung-mini-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.anleitung-mini-cover .cover-platzhalter {
    position: static; inset: auto;
    color: rgba(255, 255, 255, 0.6); font-size: 11px; font-weight: 600;
    text-align: center; line-height: 1.15; padding: 4px;
}

.anleitung-name {
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-weight: 600; font-size: 15px;
}
.anleitung-name a { color: var(--text); }

.anleitung-info {
    flex: none; font-size: 13px; color: var(--stumm); white-space: nowrap;
}

.anleitung-zeile .aktion-zeile { flex: none; gap: 6px; margin: 0; }

/* v16: Kleine Suche + Sprachfilter über der Anleitungs-Liste.
   v27: Diese Zeile sitzt jetzt in einem WEISSEN Kasten (.suche-karte),
   damit die Suche klar vom grauen Seitenhintergrund separiert ist. */
.uebersicht-suche {
    display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap;
}
.uebersicht-suche .sprache-filter > span { font-size: 12px; color: var(--stumm); }
.uebersicht-suche #uebersicht-treffer { font-size: 12.5px; padding-bottom: 8px; }

/* v27: WEISSE SUCHE-KARTE – umschließt Suchfelder/Filter als eigener
   weißer Block mit Rahmen und Schatten (Übersicht, Bibliothek, Mediathek). */
.suche-karte {
    background: var(--karte);
    border: 1px solid var(--rand);
    border-radius: 12px;
    box-shadow: var(--schatten);
    padding: 12px 14px;
    margin-bottom: 14px;
}

@media (max-width: 900px) {
    .anleitung-zeile { height: auto; flex-wrap: wrap; padding: 12px 10px; }
    .anleitung-mini-cover { width: 72px; height: 72px; }
    .anleitung-name { flex: 1 1 200px; white-space: normal; }
}

.cover-platzhalter {
    color: var(--stumm); font-size: 13px; font-weight: 600;
}

/* ----------------------------------------------------------------- Gruppen */

.spalten-raster { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }

.gruppen-zeile {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 0; border-bottom: 1px solid #eef0f7; flex-wrap: wrap;
}
.gruppen-zaehler { margin: -6px 0 0; font-size: 12.5px; }

.zeilen-form { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 260px; flex-wrap: wrap; }

/* ---------------------------------------------------------- Formularseiten */

.form-karte { max-width: 980px; }
.form-raster { display: grid; grid-template-columns: 1.2fr 1fr; gap: 26px; align-items: start; }

.cover-vorschau-box {
    border: 2px dashed var(--rand); border-radius: var(--radius);
    min-height: 220px; display: flex; align-items: center; justify-content: center;
    overflow: hidden; background: #fafbfe;
}
.cover-vorschau-box img { width: 100%; height: 100%; object-fit: cover; }
.cover-vorschau-box .cover-platzhalter { position: static; color: var(--stumm); }

/* ------------------------------------------------------------------- Login */

/* Anmeldeseite: neutraler GRAUER Hintergrund (bewusst ohne grüne Effekte) –
   das Grün kommt nur von der Marke (Logo, Buttons, Links). */
.login-koerper {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: #e8eaed;
    padding: 20px;
}

.login-karte {
    width: 100%; max-width: 400px;
    background: var(--karte); border: 1px solid var(--rand);
    border-radius: 16px; box-shadow: var(--schatten);
    padding: 30px 30px 26px;
}

/* Zentriertes Logo auf der Anmeldeseite (aus wwwroot/bilder/logo/). */
.login-logo {
    display: block;
    margin: 0 auto 22px;
    max-width: 230px;
    width: 100%;
    height: auto;
}

/* Logo in der Seitenleiste der Verwaltung.
   v7: passt sich der Breite an, sodass es in der breiteren Navigation
   vollständig sichtbar bleibt. */
.marke-logo {
    display: block;
    height: 32px; width: auto;
    max-width: 100%;
    object-fit: contain;
    flex: none;
}

.login-untertitel { color: var(--stumm); margin: 0 0 18px; }
.login-karte h1 { margin-bottom: 4px; text-align: center; }
.login-karte .login-untertitel { text-align: center; }
.login-karte .hinweis { margin-bottom: 12px; }

/* Eingabefeld für den Code aus der E-Mail (Passwort-Reset, MFA-Schritt). */
.code-eingabe {
    font-size: 20px !important;
    letter-spacing: 6px;
    text-align: center;
    font-weight: 700;
}

/* Nebelink (Passwort vergessen? / Zurück zur Anmeldung) unter dem Formular. */
.login-nebenlink { text-align: center; margin: 14px 0 0; font-size: 14px; }
.login-nebenlink a { color: var(--gruen-dunkel); font-weight: 600; }
.login-nebenlink [aria-hidden] { color: var(--stumm); margin: 0 6px; }

/* Fußzeile der Anmeldeseite: Datenschutz + Impressum (externe Links). */
.login-fuss {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--rand);
    text-align: center;
    font-size: 13px;
    color: var(--stumm);
}
.login-fuss a { color: var(--stumm); text-decoration: none; }
.login-fuss a:hover { color: var(--gruen-dunkel); text-decoration: underline; }
.login-fuss [aria-hidden] { margin: 0 8px; }

/* ------------------------------------------------------- Kleine Bildschirme
   v27 NEU: Auf dem Handy ist die Seitenleiste KOMPLETT AUSGEBLENDET.
   Stattdessen oben eine schmale Leiste: LINKS das Menü-Icon, das Logo
   ZENTRIERT in der Mitte. Das Menü öffnet die Navigation als
   VOLLBILD-FELD über die ganze Bildschirmseite. */

.mobil-leiste { display: none; }

@media (max-width: 920px) {
    .admin-raster { grid-template-columns: 1fr; }
    .admin-seitenleiste { display: none; }
    .mobil-leiste {
        display: flex;
        align-items: center;
        position: fixed;
        top: 0; left: 0; right: 0;
        height: 56px;
        background: #fff;
        border-bottom: 1px solid var(--rand);
        padding: 0 12px;
        z-index: 1200;
    }
    .mobil-burger {
        display: inline-flex; align-items: center; justify-content: center;
        width: 40px; height: 40px;
        border: 1px solid var(--rand); border-radius: 10px;
        background: #fff; color: var(--text);
        cursor: pointer;
    }
    .mobil-burger:active { transform: translateY(1px); }
    .mobil-logo {
        position: absolute;
        left: 50%; transform: translateX(-50%);
        height: 30px; width: auto;
        max-width: 55vw;
        object-fit: contain;
    }
    .admin-inhalt { padding: 76px 16px 50px; }
    .spalten-raster, .form-raster { grid-template-columns: 1fr; }
}

/* v27: VOLLBILD-NAVIGATION (mobile) – deckt die GANZE Seite ab, weiß,
   mit Logo oben und den gleichen Einträgen wie die Seitenleiste
   (grau markiert + schwarzer Balken links). */
.nav-vollbild {
    position: fixed;
    inset: 0;
    z-index: 1600;
    background: #fff;
    display: flex;
    flex-direction: column;
}
.nav-vollbild.versteckt { display: none; }
.nav-vollbild-kopf {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid #ececf1;
}
.nav-vollbild-kopf .marke-logo { height: 30px; }
.nav-vollbild-schliessen {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px;
    border: 1px solid var(--rand); border-radius: 10px;
    background: #fff; color: var(--text);
    cursor: pointer;
}
.nav-vollbild-nav { flex: 1; overflow-y: auto; padding: 10px; }
/* Die Liste im Vollbild-Menü nutzt die gleiche Optik wie die Seitenleiste
   (verbundene Zeilen mit Trennlinien) – aber mit eigenem Rahmen. */
.nav-vollbild-liste {
    border: 1px solid #ececf1;
    border-radius: 12px;
    overflow: hidden;
}
.nav-vollbild-fuss {
    padding: 14px;
    border-top: 1px solid #ececf1;
    display: flex; flex-direction: column; gap: 10px;
}
/* Hintergrund-Sperre, solange das Vollbild-Menü offen ist (admin.js). */
body.nav-gesperrt { overflow: hidden; }

/* ================================ HTML-Dialoge & Toasts (v7) ============
   Gemeinsame Gestaltung für dialoge.js (Bestätigungen statt window.confirm,
   Meldungen statt window.alert) auf allen Verwaltungsseiten. */

.dialog-hintergrund {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(12, 13, 26, 0.55);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.dialog {
    background: #fff; border-radius: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    width: 100%; max-width: 480px;
    display: flex; flex-direction: column; gap: 12px;
    padding: 18px;
}
.dialog h3 { margin: 0; font-size: 16px; }
.dialog-text { margin: 0; font-size: 14px; color: #46506b; }
.dialog-aktionen { display: flex; justify-content: flex-end; gap: 8px; }

/* v13: Formular-Dialog mit mehreren Feldern (z. B. Editor: "Seite
   bearbeiten" mit Name + Kapitel-Zuordnung). */
.dialog-feld { display: flex; flex-direction: column; gap: 5px; }
.dialog-feld label { font-size: 12.5px; font-weight: 600; color: #46506b; }

/* ================================ v20: Bibliothek – Erstell-Dialog ======
   "Neue Bibliothek-Seite" mit Seitengröße + optionalem Hintergrundbild und
   der zugehörigen Mediathek-Auswahl. Nutzt die Dialog-Basis (.dialog-hinter-
   grund/.dialog) und ergänzt nur die neuen Blöcke. */

.bib-neu-dialog {
    max-width: 560px;
    max-height: min(86vh, 720px);
    overflow-y: auto;
}
.bib-neu-zeile { display: flex; gap: 10px; }
.bib-neu-zeile .dialog-feld { flex: 1; }
.bib-neu-abschnitt {
    margin: 4px 0 0; font-size: 11.5px; text-transform: uppercase;
    letter-spacing: 0.6px; font-weight: 700; color: var(--stumm);
    border-top: 1px dashed var(--rand); padding-top: 12px;
}
.bib-neu-aktionen { display: flex; flex-direction: column; gap: 8px; }
.bib-neu-aktionen label.btn { position: relative; overflow: hidden; text-align: center; cursor: pointer; }
.bib-neu-medium-vorschau {
    border: 1px solid var(--rand); border-radius: 10px;
    min-height: 90px; max-height: 200px;
    display: flex; align-items: center; justify-content: center;
    background: #fafbfe; overflow: hidden;
}
.bib-neu-medium-vorschau img { max-width: 100%; max-height: 200px; display: block; }
.bib-neu-medien-raster {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}
.bib-neu-medium-karte {
    border: 1px solid var(--rand); border-radius: 10px; background: #fff;
    padding: 0; cursor: pointer; overflow: hidden; font: inherit;
    display: flex; flex-direction: column;
}
.bib-neu-medium-karte img { width: 100%; height: 78px; object-fit: cover; display: block; }
.bib-neu-medium-karte span {
    padding: 5px 8px; font-size: 11.5px; color: #46506b;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left;
}
.bib-neu-medium-karte:hover { border-color: var(--gruen); background: #f6f8fd; }

/* ================================ v14: Bibliothek (Adminbereich) ========
   Tabs (Kapitel | Seiten), Suche und Zeilenlisten – gleiche Optik wie die
   Anleitungs-Übersicht (50px-Zeilen, Buttons rechts in einer Reihe). */

.bib-kopfzeile {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
/* v14: Bibliothek (Adminbereich)
   Tabs (Kapitel | Seiten), Suche und Zeilenlisten – gleiche Optik wie die
   Anleitungs-Übersicht (50px-Zeilen, Buttons rechts in einer Reihe).
   v27: Tab-System wie ÜBERALL sonst (Teilen-Modal/Editor): verbundene
   Leiste mit Trennlinien, aktiver Tab grün umrahmt + hellgrün – statt
   einzelner Pillen-Knöpfe. */
.bib-tabs {
    display: flex;
    gap: 0;
    border: 1px solid var(--rand);
    border-radius: 11px;
    overflow: hidden;
    background: #f4f6fb;
}
.bib-tab {
    flex: 1;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    border: 0; background: #f4f6fb;
    border-radius: 0;
    font: inherit; font-size: 13.5px; font-weight: 700; color: #46506b;
    padding: 10px 16px; cursor: pointer; white-space: nowrap;
    transition: background 0.12s ease, color 0.12s ease;
}
.bib-tab + .bib-tab { border-left: 1px solid var(--rand); }
.bib-tab:hover { background: #eceff8; color: #1d2438; }
.bib-tab.aktiv {
    background: #f2f8ea;
    color: var(--gruen-dunkel);
    box-shadow: inset 0 0 0 2px var(--gruen);
}
.bib-tab.aktiv .bib-zaehler { background: var(--gruen); color: #fff; }
.bib-zaehler {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px;
    background: #eef0f7; font-size: 11.5px; font-weight: 700; color: #46506b;
}

/* v27: Die Suche pro Tab sitzt IN einem weißen Kasten (.suche-karte)
   unterhalb der Tab-Leiste – gleiche Separierung wie auf der Übersicht. */
.bib-suche-karte {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.bib-suche-karte .bib-treffer { font-size: 12.5px; color: var(--stumm); }

.bib-suche {
    display: flex; align-items: center; gap: 8px;
    color: var(--stumm);
}
.bib-suche .eingabe { width: 240px; }

.bib-liste { display: flex; flex-direction: column; gap: 10px; }

.bib-zeile {
    display: flex; align-items: center; gap: 12px;
    height: 50px;
    background: var(--karte); border: 1px solid var(--rand);
    border-radius: 10px; box-shadow: var(--schatten);
    padding: 0 10px 0 8px; overflow: hidden;
}
.bib-zeile.versteckt { display: none; }

.bib-icon {
    flex: none; width: 34px; height: 34px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
}
.bib-icon-kapitel { background: rgba(61, 123, 255, 0.12); color: #3d7bff; }
.bib-icon-seite { background: rgba(142, 78, 198, 0.12); color: #8e4ec6; }

.bib-name {
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-weight: 600; font-size: 14px; color: var(--text);
}
.bib-meta { flex: none; font-size: 12.5px; color: var(--stumm); white-space: nowrap; }
.bib-aktionen { flex: none; display: flex; gap: 6px; }

.bib-leer { margin: 4px 2px; }

@media (max-width: 900px) {
    .bib-zeile { height: auto; flex-wrap: wrap; padding: 10px 8px; }
    .bib-name { flex: 1 1 200px; white-space: normal; }
}

/* v8: breiter Dialog + Liste der Freigabe-Links ("Anleitung teilen"). */
.dialog.breit { max-width: 640px; }
.teilen-liste { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.teilen-eintrag {
    display: flex; align-items: center; gap: 10px;
    border: 1px solid var(--rand); border-radius: 10px;
    padding: 9px 11px; background: #fbfcfe; flex-wrap: wrap;
}
.teilen-eintrag .teil-url {
    flex: 1; min-width: 180px; font-size: 12.5px; font-family: ui-monospace, Consolas, monospace;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #46506b;
}
.teilen-eintrag .teil-meta { font-size: 12.5px; color: var(--stumm); flex: none; }
.teilen-formular { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-top: 4px; }
.teilen-formular .feld { flex: 1; min-width: 160px; }
/* v21: Ablauf-Frage (Ja / Nein – läuft nie ab) im Teilen-Modal. */
.teilen-ablauf-wahl { display: flex; gap: 16px; flex-wrap: wrap; padding-top: 2px; }
/* v21: Der SOEBEN erstellte Link wird im Tab "Aktive Links" hervorgehoben. */
.teilen-eintrag.neu { background: #eef1f9; border-color: #c9ccd6; }
.teilen-hinweis { font-size: 12.5px; color: var(--stumm); margin: 0; }

/* v16: TAB-SYSTEM im Teilen-Modal – gleiche Optik wie editor.css.
   v23: ECHTE TABS (verbundene Leiste, Teiler-Linien, aktiver Tab grün
   umrahmt + hellgrün) statt einzelner Pillen-Knöpfe. */
.teilen-tabs {
    display: flex; gap: 0; margin: 4px 0 12px;
    border: 1px solid var(--rand); border-radius: 11px;
    overflow: hidden; background: #f4f6fb;
}
.teilen-tab {
    flex: 1; display: inline-flex; align-items: center; justify-content: center;
    gap: 7px;
    border: 0; background: #f4f6fb;
    font: inherit; font-size: 13.5px; font-weight: 700; color: #46506b;
    padding: 10px 14px; cursor: pointer; white-space: nowrap;
    transition: background .12s ease, color .12s ease;
}
.teilen-tab + .teilen-tab { border-left: 1px solid var(--rand); }
.teilen-tab:hover { background: #eceff8; color: #1d2438; }
.teilen-tab.aktiv {
    background: #f2f8ea; color: var(--gruen-dunkel);
    box-shadow: inset 0 0 0 2px var(--gruen);
}
.teilen-tab.aktiv .bib-zaehler { background: var(--gruen); color: #fff; }

/* v16: Cover-Vorschau im Stepper-Modal der Übersicht (kompakter als auf der
   früheren NewTutorial-Seite). */
.modal-cover-vorschau { min-height: 120px; max-height: 180px; }
.modal-cover-vorschau img { width: 100%; height: 100%; object-fit: cover; }
.modal-cover-vorschau .cover-platzhalter { position: static; color: var(--stumm); }

/* v14: Toasts – schlicht, weiß, ohne Umrandung (siehe auch editor.css). */
.toast-bereich {
    position: fixed; right: 16px; bottom: 50px; z-index: 3000;
    display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
}
.toast {
    background: #ffffff;
    border-radius: 10px;
    border: 0;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.18);
    padding: 10px 14px;
    max-width: 360px;
    animation: admin-toast-rein 0.18s ease;
}
.toast-titel { font-size: 13.5px; font-weight: 700; color: var(--gruen-dunkel); line-height: 1.35; }
.toast.fehler .toast-titel { color: var(--rot); }
.toast.hinweis .toast-titel { color: #46506b; }
.toast-text { font-size: 13px; color: #111318; line-height: 1.45; }
@keyframes admin-toast-rein { from { transform: translateY(8px); opacity: 0; } }

/* ================================ v27: MEDIATHEK =========================
   Neue Seite /Admin/Mediathek: Dateien, Bilder, Videos und Audio zentral
   hochladen, nach Name suchen, nach Dateiendung filtern (Mehrauswahl,
   Standard: alle), löschen. Die Suche/Filter sitzen im weißen Kasten
   (.suche-karte), darunter das Raster aus Karten. */

.medien-raster {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
    gap: 12px;
}
.medien-karte {
    background: var(--karte);
    border: 1px solid var(--rand);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--schatten);
}
.medien-vorschau {
    height: 110px;
    background: #f4f6fb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.medien-vorschau img { width: 100%; height: 100%; object-fit: cover; display: block; }
.medien-vorschau .medien-symbol { color: #6b7280; }
.medien-vorschau .medien-endung {
    position: absolute;
    bottom: 6px; right: 6px;
    background: rgba(17, 19, 24, 0.72);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.medien-koerper {
    padding: 8px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.medien-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.medien-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 11.5px;
    color: var(--stumm);
}
.medien-aktionen { padding: 0 10px 10px; margin-top: auto; }

/* Dateiendungs-Filter (Mehrauswahl) als umschaltbare Chips im weißen Kasten. */
.endungs-gruppe {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}
.endungs-chip {
    position: relative;
    display: inline-flex;
    cursor: pointer;
}
.endungs-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.endungs-chip span {
    display: inline-flex;
    align-items: center;
    padding: 5px 11px;
    border: 1px solid var(--rand);
    border-radius: 999px;
    background: #f4f6fb;
    font-size: 12.5px;
    font-weight: 600;
    color: #46506b;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
    user-select: none;
}
.endungs-chip input:checked + span {
    background: #f2f8ea;
    border-color: var(--gruen);
    color: var(--gruen-dunkel);
}
.endungs-chip input:focus-visible + span {
    outline: 2px solid rgba(117, 182, 59, 0.32);
}
.endungen-alle-knopf {
    border: 0;
    background: none;
    font: inherit;
    font-size: 12.5px;
    color: var(--gruen-dunkel);
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    flex: none;
}

/* Upload-Fläche der Mediathek (ganze Fläche klickbar, mehrere Dateien). */
.medien-upload-flaeche {
    border: 2px dashed var(--rand);
    border-radius: 12px;
    background: #fafbfe;
    padding: 18px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--stumm);
    font-size: 13.5px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.12s ease, background 0.12s ease;
}
.medien-upload-flaeche:hover,
.medien-upload-flaeche.ziehen {
    border-color: var(--gruen);
    background: #f6faf1;
}
.medien-upload-flaeche strong { color: var(--gruen-dunkel); }

/* ============ v29 ============ */
.admin-seitenleiste { padding: 20px 0; }
.admin-seitenleiste .admin-kopf { margin: 0 0 4px; padding: 0 16px; }
.admin-nav, .admin-nav .nav-gruppe, .admin-nav .nav-unter a { width: 100%; margin: 0; }

.anleitung-zeile { overflow: visible; }
.anleitung-zeile:has(.aktion-dropdown.offen) { position: relative; z-index: 40; }
.gesperrt { pointer-events: none; opacity: 0.45; }

.bib-tabs, .teilen-tabs, .panel-tabs {
    border: 0; border-radius: 0; overflow: visible; background: transparent;
    border-bottom: 1px solid var(--rand); gap: 0;
}
.bib-tab, .teilen-tab, .panel-tab {
    border: 0; border-radius: 0; background: transparent; box-shadow: none;
    border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.bib-tab + .bib-tab, .teilen-tab + .teilen-tab, .panel-tab + .panel-tab { border-left: 0; }
.bib-tab:hover, .teilen-tab:hover, .panel-tab:hover { background: #f4f6fb; }
.bib-tab.aktiv, .teilen-tab.aktiv, .panel-tab.aktiv {
    background: #eef7e2; color: var(--gruen-dunkel); box-shadow: none;
    border-bottom-color: var(--gruen);
}
.teilen-tabs .teilen-tab:first-child, .teilen-tabs .teilen-tab:last-child { border-radius: 0 !important; }

.sprach-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.sprach-grid label, .sprach-haupt label { display: flex; align-items: center; gap: 6px; font-size: 13.5px; cursor: pointer; }
.sprach-haupt { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 10px; align-items: center; }
.sprach-haupt-titel { width: 100%; font-size: 12px; color: #7a839e; }

/* ============ v29b ============ */
/* Navbar: oben, kleiner, zentriert */
.admin-seitenleiste { padding: 0 !important; }
.admin-seitenleiste .admin-kopf {
    height: 56px; margin: 0; padding: 0 12px;
    justify-content: center; border-bottom: 1px solid var(--rand);
}
.admin-seitenleiste .admin-kopf .marke-logo { height: 20px; width: auto; max-width: 90%; }

/* Hauptpunkt grau (stärker), wenn ein Unterpunkt aktiv ist; Unterpunkt heller */
.nav-gruppe:has(+ .nav-unter .aktiv),
.nav-gruppe:has(+ .nav-unter a.aktiv) { background: #dfe2ea; }
.nav-unter a.aktiv { background: #f3f4f7; }

/* Modale: feste Position oben – Höhe ändert den Abstand nicht mehr */
.dialog-hintergrund { align-items: flex-start !important; padding-top: 96px !important; }
.dialog { max-height: calc(100vh - 140px); overflow-y: auto; }

/* Sprach-Dropdowns im Anleitungs-Dialog */
.sprach-feld { display: flex; flex-direction: column; gap: 6px; }
.sprach-feld > label { font-size: 13px; font-weight: 600; color: #46506b; margin-top: 4px; }
.sprach-knopf {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    width: 100%; min-height: 40px; padding: 8px 12px;
    border: 1px solid var(--rand); border-radius: 10px; background: #fff;
    font: inherit; font-size: 13.5px; color: var(--text); cursor: pointer; text-align: left;
}
.sprach-knopf:hover { border-color: #b7c39f; }
.sprach-knopf-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sprach-liste {
    display: flex; flex-direction: column; gap: 2px;
    max-height: 240px; overflow-y: auto;
    border: 1px solid var(--rand); border-radius: 10px; background: #fff; padding: 6px;
}
.sprach-eintrag {
    display: flex; align-items: center; gap: 8px; padding: 7px 8px;
    border-radius: 8px; font-size: 13.5px; cursor: pointer;
}
.sprach-eintrag:hover { background: #f2f4fb; }

/* ============ v29c ============ */
.admin-seitenleiste { gap: 0 !important; }
.admin-seitenleiste .admin-kopf .marke-logo { width: 90%; height: auto; max-width: none; }
.admin-nav { margin: 0; padding: 0; }
.nav-gruppe { padding: 16px 12px !important; }
.nav-unter a { padding: 15px 14px 15px 20px !important; }
.name-filter { min-width: 220px; }

/* ============================== v33 ============================== */
/* QR-Modal: Kopf mit X rechts */
.qr-kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.qr-kopf h3 { margin: 0; }
.qr-schliessen {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; flex: none;
    border: 1px solid var(--rand); border-radius: 10px;
    background: #fff; color: var(--text); cursor: pointer;
}
.qr-schliessen:hover { background: #f3f4f7; }
.qr-download { width: 100%; background: var(--gruen, #75b63b); border-color: var(--gruen, #75b63b); color: #fff; }
.qr-download:hover { filter: brightness(0.95); }

/* Konto unten links: 90 % Breite wie das Logo, Abstand nach unten */
.benutzer-knopf {
    width: 90%; margin: 0 auto 14px; padding: 8px 10px;
    display: flex; align-items: center; gap: 10px; text-align: left;
    border: 1px solid var(--rand); border-radius: 12px; background: #fff;
    color: inherit; font: inherit; cursor: pointer;
}
.benutzer-knopf:hover { background: #f3f4f7; }

/* Profil-Modal */
.dialog.profil-dialog { max-width: 520px; width: calc(100% - 32px); }
.profil-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--rand); margin: 12px 0 16px; }
.profil-tab {
    background: none; border: 0; border-bottom: 2px solid transparent;
    padding: 8px 10px; font: inherit; font-weight: 600; color: var(--stumm, #6b7280); cursor: pointer;
}
.profil-tab.aktiv { color: #1c2333; border-bottom-color: var(--gruen, #75b63b); }
.profil-abschnitt { display: flex; flex-direction: column; gap: 12px; }
.profil-abschnitt + .profil-abschnitt { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--rand); }
.profil-abschnitt h4 { margin: 0; font-size: 15px; }

/* Mediathek: Dateiendung-Dropdown mit Haken in zwei Spalten */
.endungs-filter { min-width: 240px; position: relative; }
.endungs-dropdown { position: relative; }
.endungs-knopf {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    width: 100%; cursor: pointer; text-align: left;
}
.endungs-knopf svg { flex: none; transition: transform 0.15s ease; }
.endungs-knopf[aria-expanded="true"] svg { transform: rotate(180deg); }
.endungs-panel {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
    width: min(380px, 90vw); padding: 12px;
    display: flex; flex-direction: column; gap: 10px;
    background: #fff; border: 1px solid var(--rand); border-radius: 12px;
    box-shadow: var(--schatten);
}
.endungs-panel.versteckt { display: none; }
.endungs-raster { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.endung-zeile { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.endung-zeile input { margin: 0; }
