/* ═══════════════════════════════════════════════════════════════════════════
   LAIA – style_new.css
   Modernes Design-System · Alle Seiten · Root-basiert · Einheitliche Elemente
   ═══════════════════════════════════════════════════════════════════════════ */

/*       !!! DIE FOLGENDEN DINGE MÜSSEN VARIABLEN SEIN AUS STYLE_NEW.CSS !!!
    -> Farben
    -> Schriftgrößen
    -> Schriftart (muss normalerweise nicht im style vorkommen)
    -> Radien (Radius)
    -> Icon Sizes
    -> Font Weights
    -> Line Heights
    -> Spacing (Abstände)
    -> Layering (z-index)
    -> container-max (außer es wird breiter/dünner benötigt)
    -> Header height falls benötigt
    -> Transitions
    -> Schatten
    ---> Alle anderen Variablen müssen ebenso verwendet werden, wenn es sich um den Style handelt.
    
    
    Das ist SEHR WICHTIG für einheitlichen Style. Es darf nichts davon hardcoded im <style> vorkommen.
    Wenn eine Style-definition auf mindestens 2 Seiten gleich ist, muss er im globalen style_new.css stehen.
    
    PS: Der Style-Link ist im header_new.php */

/* ── Design Tokens ─────────────────────────────────────────────────────────── */
:root {
    /* Brand */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-lighter: #e0e7ff;
    --primary-dark: #4f46e5;
    --primary-darker: #3730a3;

    /* Semantische Farben */
    --success: #10b981;
    --success-light: rgba(16, 185, 129, .1);
    --success-border: rgba(16, 185, 129, .25);
    --warning: #f59e0b;
    --warning-dark: #d97706;
    --warning-light: rgba(245, 158, 11, .1);
    --warning-border: rgba(245, 158, 11, .25);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, .1);
    --danger-border: rgba(239, 68, 68, .25);
    --info: #3b82f6;
    --info-light: rgba(59, 130, 246, .08);
    --info-border: rgba(59, 130, 246, .2);

    /* Oberflächen */
    --surface: #ffffff;
    --surface-elevated: #fafaff;
    --surface-hover: #f5f5ff;
    --surface-glass: rgba(255, 255, 255, .85);
    --surface-glass-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.96));
    --bg: #f1f5f9;
    --bg-deep: linear-gradient(135deg, #f8fafc 0, #f1f5f9 50%, #fafaff 100%);

    /* Typografie */
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;

    /* Rahmen */
    --border: rgba(99, 102, 241, .08);
    --border-strong: rgba(99, 102, 241, .18);
    --border-solid: #e2e8f0;

    /* Schatten */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .03);
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, .04);
    --shadow: 0 4px 12px rgba(0, 0, 0, .05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, .07);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, .09);
    --shadow-xl: 0 24px 56px rgba(0, 0, 0, .12);

    /* Radien */
    --r-xs: 4px;
    --r-sm: 8px;
    --r: 12px;
    --r-lg: 16px;
    --r-xl: 20px;
    --r-2xl: 28px;
    --r-full: 9999px;

    /* Schrift */
    --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

    /* Header */
    --header-h: 64px;
    --header-bg: rgba(255, 255, 255, .4);

    /* Transitions */
    --trans: all .2s ease;
    --trans-slow: all .4s cubic-bezier(.22, 1, .36, 1);

    /* NEU HINZUGEFÜGT - UNVERWENDER */

    /* Schriftgrößen */
    --fz-xs: 0.75rem;
    /* 12px */
    --fz-btn-sm: 0.85rem;
    /* 13.6px */
    --fz-sm: 0.875rem;
    /* 14px */
    --fz-body-sm: 0.9rem;
    /* 14.4px */
    --fz-tab: 0.95rem;
    /* 15.2px */
    --fz-md: 1rem;
    /* 16px (Basis) */
    --fz-label: 1.05rem;
    /* 16.8px */
    --fz-lg: 1.125rem;
    /* 18px */
    --fz-h3: 1.15rem;
    /* 18.4px */
    --fz-xl: 1.25rem;
    /* 20px */
    --fz-2xl: 1.5rem;
    /* 24px */
    --fz-3xl: 1.875rem;
    /* 30px */
    --fz-4xl: 2rem;
    /* 32px */
    --fz-5xl: 2.5rem;
    /* 40px */
    --fz-6xl: 3rem;
    /* 48px */
    --fz-7xl: 3.75rem;
    /* 60px */
    --fz-8xl: 4.5rem;
    /* 72px */
    --fz-9xl: 6rem;
    /* 96px */
    --fz-10xl: 8rem;
    /* 128px */

    /* Icon Sizes */
    --icon-sm: 18px;
    --icon-slight: 22px;
    --icon-md: 24px;
    --icon-lg: 26px;
    --icon-xl: 56px;
    --icon-sm-alt: 16px;
    /* Small icon alt (16px) */
    --icon-xs: 14px;
    /* Extra small icon */
    --icon-2xl: 32px;
    /* 2xl icon */
    --icon-3xl: 44px;
    /* 3xl icon / empty state */
    --icon-md-sm: 20px;
    /* Medium-small icon */


    /* Schriftschnitte (Weights) */
    --fw-normal: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;

    /* Zeilenhöhen (Line Heights) */
    --lh-none: 1;
    --lh-tight: 1.25;
    --lh-base: 1.5;
    --lh-relaxed: 1.625;

    /* Spacing System (T-Shirt Sizes) */
    --sp-05: 0.125rem;
    /* 2px */
    --sp-1: 0.25rem;
    /* 4px */
    --sp-2: 0.5rem;
    /* 8px */
    --sp-3: 0.75rem;
    /* 12px */
    --sp-4: 1rem;
    /* 16px */
    --sp-6: 1.5rem;
    /* 24px */
    --sp-8: 2rem;
    /* 32px */
    --sp-12: 3rem;
    /* 48px */
    --sp-24: 6rem;
    /* 144px */

    /* Layering */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-header: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;

    /* Layout */
    --container-max: 1700px;
    --container-p: 1.5rem;
    --page-top-p: var(--sp-12);

    /* Kompatibilitäts-Tokens für migrierte Seiten */
    --text-main: var(--text-primary);
    --hover-bg: var(--surface-hover);
    --input-bg: var(--surface);
    --border-color: var(--border-solid);
    /* Auto-generierte semantische Farb-Tokens */
    --alert-success-text: #065f46;
    --alert-error-text: #991b1b;
    --alert-warning-text: #78350f;
    --alert-info-text: #1e40af;
    --role-student-admin-color: #1d4ed8;
    --role-teacher-color: #0f766e;
    --role-developer-bg: rgba(15, 23, 42, .08);
    --role-developer-text: #1e293b;

    cursor: default;

    /* Kalender-spezifische Tokens */
    --calendar-page-max: 1500px;
    --calendar-hero-bg:
        radial-gradient(circle at top right, rgba(99, 102, 241, .14), transparent 32%),
        linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(250, 250, 255, .92));
    --calendar-panel-bg: rgba(255, 255, 255, .92);
    --calendar-panel-border: rgba(99, 102, 241, .12);
    --calendar-weekday-bg: rgba(99, 102, 241, .06);
    --calendar-today-border: var(--primary-light);
    --calendar-today-shadow: 0 18px 40px rgba(99, 102, 241, .16);
    --calendar-empty: #cbd5e1;
    --calendar-event-special-bg: linear-gradient(135deg, rgba(254, 243, 199, .95), rgba(255, 237, 213, .95));
    --calendar-event-special-border: rgba(245, 158, 11, .28);
    --calendar-event-special-shadow: 0 12px 26px rgba(245, 158, 11, .12);
    --calendar-holiday-bg: linear-gradient(135deg, rgba(220, 252, 231, .96), rgba(224, 242, 254, .96));
    --calendar-holiday-border: rgba(16, 185, 129, .24);
    --calendar-holiday-shadow: 0 12px 24px rgba(16, 185, 129, .1);
    --calendar-event-modal-bg: linear-gradient(135deg, rgba(255, 251, 235, .98), rgba(255, 237, 213, .96));
    --calendar-event-modal-border: rgba(245, 158, 11, .3);
    --calendar-holiday-modal-bg: linear-gradient(135deg, rgba(236, 253, 245, .98), rgba(224, 242, 254, .96));
    --calendar-holiday-modal-border: rgba(16, 185, 129, .28);
    --calendar-accent-warning: #b45309;
    --calendar-accent-success: #047857;
    --calendar-accent-danger: #b91c1c;
    --calendar-role-info-bg: rgba(59, 130, 246, .1);
    --calendar-role-info-border: rgba(59, 130, 246, .22);
    --calendar-role-info-text: #2563eb;

    /* Dashboard Spezifisch */
    --dashboard-event-bg: #fffbeb;
    --dashboard-event-accent: #f59e0b;
    --dashboard-event-accent-end: #f97316;
    --dashboard-event-text: #92400e;
    --dashboard-event-border: rgba(245, 158, 11, 0.35);
    --dashboard-event-gradient-start: rgba(245, 158, 11, 0.15);
    --dashboard-event-shadow: 0 18px 40px rgba(245, 158, 11, 0.12);
    --dashboard-event-icon-shadow: 0 12px 24px rgba(249, 115, 22, 0.2);

    /* Type Badges Farben */
    --badge-sa-bg: rgba(239, 68, 68, 0.1);
    --badge-sa-text: #dc2626;
    --badge-sa-border: rgba(239, 68, 68, 0.2);

    --badge-test-bg: rgba(245, 158, 11, 0.1);
    --badge-test-text: #d97706;
    --badge-test-border: rgba(245, 158, 11, 0.2);

    --badge-mak-bg: rgba(16, 185, 129, 0.1);
    --badge-mak-text: #059669;
    --badge-mak-border: rgba(16, 185, 129, 0.2);

    --badge-wihu-bg: rgba(99, 102, 241, 0.1);
    --badge-wihu-text: var(--primary);
    --badge-wihu-border: rgba(99, 102, 241, 0.2);

    /* HÜ / WiHÜ Badge (Hausübungen) - Blau */
    --badge-hu-bg: rgba(99, 102, 241, 0.1);
    --badge-hu-text: var(--primary);
    --badge-hu-border: rgba(99, 102, 241, 0.2);

    /* PLF Badge (Prüfung/Leistungsfeststellung) - Rot/Orange wie SA */
    --badge-plf-bg: rgba(239, 68, 68, 0.1);
    --badge-plf-text: #dc2626;
    --badge-plf-border: rgba(239, 68, 68, 0.2);

    /* Quiz Badge - Gelb/Orange wie Test */
    --badge-quiz-bg: rgba(245, 158, 11, 0.1);
    --badge-quiz-text: #d97706;
    --badge-quiz-border: rgba(245, 158, 11, 0.2);

    /* MAK Badge - Grün */
    --badge-mak-bg: rgba(16, 185, 129, 0.1);
    --badge-mak-text: #059669;
    --badge-mak-border: rgba(16, 185, 129, 0.2);

    /* Effort Farben */
    --effort-extreme: #dc2626;
    --effort-high: #ea580c;
    --effort-medium: #d97706;
    --effort-low: #16a34a;

    /* Regenbogen-Palette */
    --rainbow-1: #ffadad;
    --rainbow-2: #ffd6a5;
    --rainbow-3: #fdffb6;
    --rainbow-4: #caffbf;
    --rainbow-5: #9bf6ff;

    /* Akzentfarben */
    --gold: #ffd700;

    /* Spiele-Gradients */
    --grad-snake: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --grad-gelddrucker: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --grad-tetron: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --grad-hangman: linear-gradient(157deg, rgba(0, 0, 0, 1) 0%, rgba(145, 145, 74, 1) 78%, rgba(255, 213, 0, 1) 100%);
    --grad-crosstheroad: linear-gradient(90deg, rgba(127, 173, 201, 1) 0%, rgba(255, 171, 224, 1) 100%);
    --grad-roulette: linear-gradient(90deg, rgba(2, 0, 36, 1) 0%, rgba(27, 90, 158, 1) 49%, rgba(48, 0, 87, 1) 100%);
    --grad-blackjack: linear-gradient(135deg, #0f3d2e 0%, #145a32 35%, #1e8449 65%, #f1c40f 100%);
    --grad-slots: linear-gradient(135deg, #C23869, #2A678F);
    --grad-defcon: linear-gradient(140deg, rgba(14, 77, 32, 1) 0%, rgba(87, 199, 133, 1) 50%, rgba(28, 59, 15, 1) 100%);
    --grad-colorguessr: linear-gradient(140deg, rgba(255, 0, 0, 1) 0%, rgba(255, 255, 0, 1) 20%, rgba(0, 255, 0, 1) 40%, rgba(0, 255, 255, 1) 60%, rgba(0, 0, 255, 1) 80%, rgba(255, 0, 255, 1) 100%);

    /* Für die 4-Zeilen-Berechnung im Dashboard */
    --desc-max-lines: 4;

    /* ── Fehlende / ergänzte Tokens ──────────────────────────────────── */
    --sp-5: 1.25rem;
    /* 20px – zwischen sp-4 und sp-6  */
    --fw-extrabold: 800;

    /* Glas-Hintergrund (für .apple-glass u.ä.) */
    --glass-bg: rgba(255, 255, 255, .72);

    /* Layering – Erweiterungen */
    --z-lightbox: 3000;
    --z-lightbox-ui: 3010;
    --z-calendar-dropdown: 3200;
    --z-tooltip-high: 10000;

    /* Transitions – Erweiterungen */
    /* Ergänzte Farb-Tokens */
    --orange: #f97316;
    /* Orange accent */
    --teal: #14b8a6;
    /* Teal accent */
    --violet: #8b5cf6;
    /* Violet accent */
    --badge-neutral-bg: #f1f5f9;
    /* Badge neutral bg */
    --badge-tier1-bg: #f1f5f9;
    /* Badge tier1 bg */
    --badge-tier2-color: #6d28d9;
    /* Badge tier2 text */
    --danger-dark: #b91c1c;
    /* Danger dark (hover) */
    --surface-subtle: #f8fafc;
    /* Very light surface */
    --warning-darker: #92400e;
    /* Warning darkest text */

    /* Button-Gradient Tokens */
    --success-dark: #059669;
    /* Success darker shade */
    --danger-strong: #dc2626;
    /* Danger strong/start */
    --warning-dark-btn: #d97706;
    /* Warning button start */

    --trans-spring: all .3s cubic-bezier(.34, 1.56, .64, 1);
    --trans-cubic: all .3s cubic-bezier(.4, 0, .2, 1);
}

/* ── Dark Mode Overrides ───────────────────────────────────────────────────── */
body.dark-mode {
    /* Ein entspanntes Indigo mit 90% Deckkraft für die Hauptakzente */
    --primary: rgba(129, 140, 248, 0.9);

    /* Hellerer Akzent für Hover-Effekte oder aktive Zustände */
    --primary-light: rgba(165, 180, 252, 0.8);

    /* Sehr dezente Hintergrund-Nuance (z.B. für Card-Backgrounds oder Badges) */
    --primary-lighter: rgba(199, 210, 254, 0.15);

    /* Kräftigerer Ton für Tiefe, bleibt aber im dunklen Spektrum */
    --primary-dark: rgba(99, 102, 241, 0.85);

    /* Sehr dunkler Kontrastton für Schatten oder subtile Ränder */
    --primary-darker: rgba(79, 70, 229, 0.6);
    /* Oberflächen */
    --surface: #1e293b;
    --surface-elevated: #0f172a;
    --surface-hover: #334155;
    --surface-glass: rgba(15, 23, 42, 0.85);
    --surface-glass-gradient: linear-gradient(180deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.96));
    --bg: #020617;
    --bg-deep: linear-gradient(135deg, #020617 0%, #0f172a 100%);

    /* Inputs */
    --input-bg: #1e293b;
    --input-bg-focus: #0f172a;

    /* Typografie */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #0f172a;

    /* Rahmen */
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.15);
    --border-solid: #2d3748;

    /* Header */
    --header-bg: rgba(15, 23, 42, 0.5);

    /* Dashboard Karten (spezifisch) */
    --dashboard-event-bg: #2d2005;
    --dashboard-event-text: #fde68a;
    --dashboard-event-border: rgba(245, 158, 11, 0.2);

    /* Glas (dark) */
    --glass-bg: rgba(15, 23, 42, .72);

    /* Kalender-spezifische Tokens (dark) */
    --calendar-hero-bg:
        radial-gradient(circle at top right, rgba(99, 102, 241, .12), transparent 32%),
        linear-gradient(135deg, rgba(30, 41, 59, .98), rgba(15, 23, 42, .95));
    --calendar-panel-bg: rgba(30, 41, 59, .92);
    --calendar-panel-border: rgba(99, 102, 241, .14);
    --calendar-weekday-bg: rgba(99, 102, 241, .08);
    --calendar-today-shadow: 0 18px 40px rgba(99, 102, 241, .22);
    --calendar-empty: #334155;
    --calendar-event-special-bg: linear-gradient(135deg, rgba(120, 80, 10, .55), rgba(100, 60, 10, .5));
    --calendar-event-special-border: rgba(245, 158, 11, .3);
    --calendar-holiday-bg: linear-gradient(135deg, rgba(6, 95, 70, .45), rgba(8, 80, 100, .4));
    --calendar-holiday-border: rgba(16, 185, 129, .28);
    --calendar-event-modal-bg: linear-gradient(135deg, rgba(80, 50, 5, .8), rgba(60, 35, 5, .75));
    --calendar-event-modal-border: rgba(245, 158, 11, .35);
    --calendar-holiday-modal-bg: linear-gradient(135deg, rgba(6, 78, 59, .8), rgba(8, 65, 90, .75));
    --calendar-holiday-modal-border: rgba(16, 185, 129, .32);
    --calendar-role-info-bg: rgba(59, 130, 246, .12);
    --calendar-role-info-border: rgba(59, 130, 246, .28);
    --calendar-role-info-text: #60a5fa;

    /* HÜ / WiHÜ Badge - Blau (dunkler) */
    --badge-hu-bg: rgba(99, 102, 241, 0.15);
    --badge-hu-text: #818cf8;
    /* var(--primary-light) equivalent for text contrast in dark mode */
    --badge-hu-border: rgba(99, 102, 241, 0.3);

    /* PLF Badge - Rot/Orange (dunkler) */
    --badge-plf-bg: rgba(239, 68, 68, 0.15);
    --badge-plf-text: #f87171;
    --badge-plf-border: rgba(239, 68, 68, 0.3);

    /* Quiz Badge - Gelb/Orange (dunkler) */
    --badge-quiz-bg: rgba(245, 158, 11, 0.15);
    --badge-quiz-text: #fbbf24;
    --badge-quiz-border: rgba(245, 158, 11, 0.3);

    /* MAK Badge - Grün (dunkler) */
    --badge-mak-bg: rgba(16, 185, 129, 0.15);
    --badge-mak-text: #34d399;
    --badge-mak-border: rgba(16, 185, 129, 0.3);

    /* Schatten müssen im Dark Mode kräftiger sein, um Tiefe zu erzeugen */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.6);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.8);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.9);

    --success: #34d399;
    /* Helleres Smaragdgrün */
    --warning: #fbbf24;
    /* Helleres Bernstein */
    --danger: #f87171;
    /* Weicheres Rot */
    --info: #60a5fa;
    /* Hellblau */

    --alert-warning-text: #d86522;

    color-scheme: dark;
    /* CRITICAL: Ändert Browser-UI (Scrollbars, Buttons) */

    filter: brightness(.9) contrast(1.1);
    /* Reduziert die Helligkeit von Bildern minimal */

    outline: 2px solid var(--primary-light);
    outline-offset: 2px;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Reduziere die Laufweite minimal, falls der Text zu "strahlt" */
    letter-spacing: 0.01rem;

    /* Regenbogen-Palette (Dark Mode) 
       Reduzierte Sättigung & leichte Transparenz für einen "Glow"-Effekt */
    --rainbow-1: rgba(255, 173, 173, 0.7);
    /* Soft Red */
    --rainbow-2: rgba(255, 214, 165, 0.7);
    /* Soft Orange */
    --rainbow-3: rgba(253, 255, 182, 0.6);
    /* Soft Yellow (etwas dunkler/transparenter) */
    --rainbow-4: rgba(202, 255, 191, 0.7);
    /* Soft Green */
    --rainbow-5: rgba(155, 246, 255, 0.7);
    /* Soft Blue */

}

/* ── Dark Mode Input Styling ─────────────────────────────────────────────── */
body.dark-mode .form-input,
body.dark-mode .form-select,
body.dark-mode .form-textarea,
body.dark-mode .table-input,
body.dark-mode .table-select,
body.dark-mode .add-form input,
body.dark-mode .add-form select,
body.dark-mode .add-form textarea {
    background-color: var(--input-bg);
    color: var(--text-primary);
    border-color: var(--border-solid);
}

body.dark-mode .form-input:focus,
body.dark-mode .form-input:active,
body.dark-mode .form-select:focus,
body.dark-mode .form-textarea:focus,
body.dark-mode .form-textarea:active,
body.dark-mode .table-input:focus,
body.dark-mode .add-form input:focus,
body.dark-mode .add-form input:active,
body.dark-mode .add-form select:focus,
body.dark-mode .add-form textarea:focus,
body.dark-mode .add-form textarea:active {
    background-color: var(--input-bg-focus);
    border-color: var(--primary-light);
}

/* ── Reset & Base ───────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: var(--icon-sm-alt);
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--trans);
}

a:hover {
    color: var(--primary-dark);
}

/* ── Scrollbar ──────────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, .25);
    border-radius: var(--r-full);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, .45);
}

/* ══════════════════════════════════════════════════════════════════════════════
   HEADER
══════════════════════════════════════════════════════════════════════════════ */
.laia-header {
    position: sticky;
    top: 0;
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    z-index: 200;
    height: var(--header-h);
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.laia-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-6);
    position: relative;
}

.laia-logo {
    height: 36px;
    width: auto;
    flex-shrink: 0;
}

.laia-logo-link {
    display: flex;
    align-items: center;
}

/* Desktop Nav */
.laia-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: max-content;
    max-width: calc(100% - 18rem);
}

.laia-nav a,
.laia-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .75rem;
    border-radius: var(--r-sm);
    font-size: .88rem;
    font-weight: var(--fw-medium);
    color: var(--text-secondary);
    white-space: nowrap;
    transition: var(--trans);
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    text-decoration: none;
}

.laia-nav a:hover,
.laia-nav-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.laia-nav a.active {
    background: var(--primary-lighter);
    color: var(--primary);
    font-weight: var(--fw-semibold);
}

.laia-nav .material-symbols-outlined {
    font-size: var(--icon-sm);
}

.laia-nav-arrow {
    transition: transform 0.2s ease;
}

.laia-dropdown-wrap.open .laia-nav-arrow {
    transform: rotate(180deg);
}

/* Header Actions (rechts) */
.laia-header-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-left: auto;
    position: relative;
    z-index: 1;
}

.laia-logo-link {
    position: relative;
    z-index: 1;
}

/* Profil-Button */
.laia-profile-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--r-full);
    border: 2px solid var(--border-strong);
    background: var(--surface-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: var(--trans);
    position: relative;
}

.laia-profile-btn:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-lighter);
}

.laia-profile-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Dropdown */
.laia-dropdown-wrap {
    position: relative;
}

.laia-dropdown {
    position: absolute;
    top: calc(100% + .5rem);
    right: 0;
    min-width: 220px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    padding: .4rem 0;
    z-index: 300;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px) scale(0.98);
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.2s;
}

.laia-dropdown-wrap.open .laia-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.laia-dropdown-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .6rem 1rem;
    font-size: .87rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--trans);
    background: none;
    border: none;
    width: 100%;
    font-family: var(--font);
    text-align: left;
    text-decoration: none;
}

.laia-dropdown-item:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.laia-dropdown-item .material-symbols-outlined {
    font-size: var(--icon-sm);
}

.laia-dropdown-item.danger {
    color: var(--danger);
}

.laia-dropdown-item.danger:hover {
    background: var(--danger-light);
}

.laia-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: .3rem 0;
}

.laia-dropdown-label {
    padding: .3rem 1rem .1rem;
    font-size: .73rem;
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
}

/* Hamburger */
.laia-menu-btn {
    display: none;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-sm);
    background: none;
    border: 1px solid var(--border-solid);
    cursor: pointer;
    color: var(--text-secondary);
}

@media (max-width: 900px) {
    .laia-nav {
        display: none;
    }

    .laia-menu-btn {
        display: flex;
    }
}

/* Apps-Dropdown in Nav */
.laia-nav-apps {
    position: relative;
}

/* :focus-within entfernt, damit das JS das Schließen kontrollieren kann */
.laia-nav-apps.open .laia-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* ── Side Menu (Mobile) ──────────────────────────────────────────────────────── */
.laia-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    z-index: 400;
}

.laia-side-menu {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 280px;
    background: var(--surface);
    z-index: 500;
    box-shadow: var(--shadow-xl);
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.22, 1, .36, 1);
    overflow-y: auto;
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.laia-side-menu.open {
    transform: translateX(0);
}

.laia-backdrop.open {
    display: block;
}

.laia-side-user {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem .5rem 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: .5rem;
}

.laia-side-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--r-full);
    border: 2px solid var(--border-strong);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--surface-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
}

.laia-side-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.laia-side-name {
    font-weight: var(--fw-bold);
    font-size: .9rem;
    color: var(--text-primary);
}

.laia-side-role {
    font-size: .77rem;
    color: var(--text-muted);
}

.laia-menu-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .65rem .75rem;
    border-radius: var(--r-sm);
    font-size: .9rem;
    font-weight: var(--fw-medium);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--trans);
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    width: 100%;
    text-align: left;
}

.laia-menu-link:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.laia-menu-link.active {
    background: var(--primary-lighter);
    color: var(--primary);
    font-weight: var(--fw-semibold);
}

.laia-menu-link .material-symbols-outlined {
    font-size: var(--icon-md-sm);
}

.laia-menu-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: var(--fz-xl);
    cursor: pointer;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-sm);
}

.laia-menu-close:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.laia-menu-section-label {
    font-size: .72rem;
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
    padding: .9rem .75rem .25rem;
}

/* ══════════════════════════════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════════════════════════════ */
.laia-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding: var(--sp-6);
    text-align: center;
    font-size: .82rem;
    color: var(--text-muted);
    background: var(--surface);
}

.laia-footer a {
    color: var(--text-muted);
}

.laia-footer a:hover {
    color: var(--primary);
}

.laia-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--sp-5);
    margin-top: .5rem;
}

/* ══════════════════════════════════════════════════════════════════════════════
   LAYOUT / PAGE SHELL
══════════════════════════════════════════════════════════════════════════════ */
.laia-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.laia-page-sm {
    max-width: 780px;
}

.laia-page-lg {
    max-width: 1400px;
}

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    transition: var(--trans);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(99, 102, 241, .025) 0%, transparent 55%);
    pointer-events: none;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.card-flat {
    box-shadow: none;
}

.card-flat:hover {
    transform: none;
    box-shadow: none;
}

.card-header-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: var(--fz-label);
    font-weight: var(--fw-bold);
    color: var(--text-primary);
}

.card-subtitle {
    font-size: .83rem;
    color: var(--text-muted);
    margin-top: .1rem;
}

.card-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--r);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-icon .material-symbols-outlined {
    font-size: var(--icon-slight);
}

.ci-indigo {
    background: rgba(99, 102, 241, .12);
    color: var(--primary);
}

.ci-green {
    background: rgba(16, 185, 129, .12);
    color: var(--success);
}

.ci-blue {
    background: rgba(59, 130, 246, .12);
    color: var(--info);
}

.ci-orange {
    background: rgba(249, 115, 22, .12);
    color: var(--orange);
}

.ci-red {
    background: rgba(239, 68, 68, .12);
    color: var(--danger);
}

.ci-yellow {
    background: rgba(245, 158, 11, .12);
    color: var(--warning);
}

.ci-teal {
    background: rgba(20, 184, 166, .12);
    color: var(--teal);
}

.ci-violet {
    background: rgba(139, 92, 246, .12);
    color: var(--violet);
}

/* Grid-Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-5);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-5);
}

.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: var(--sp-5);
}

@media (max-width: 700px) {

    .grid-2,
    .grid-3,
    .grid-auto {
        grid-template-columns: 1fr;
    }
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .6rem 1.1rem;
    border-radius: var(--r-full);
    font-family: var(--font);
    font-size: .875rem;
    font-weight: var(--fw-semibold);
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: var(--trans);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1;
    background: none;
    color: var(--text-primary);
    will-change: transform, background-color, box-shadow;
}

.btn:hover {
    transform: translateY(-1px);
    background: var(--surface-hover);
}

.btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    pointer-events: none;
}

.btn .material-symbols-outlined {
    font-size: var(--icon-sm);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--text-inverse);
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(99, 102, 241, .3);
    transition: var(--trans);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-lighter) 100%);
    color: var(--text-inverse);
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(99, 102, 241, .45);
    transition: var(--trans);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-dark) 0%, var(--success) 100%);
    color: var(--text-inverse);
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(16, 185, 129, .3);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(16, 185, 129, .4);
    color: var(--text-inverse);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-strong) 0%, var(--danger) 100%);
    color: var(--text-inverse);
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(239, 68, 68, .25);
}

.btn-danger:hover {
    transform: translateY(-1px);
    color: var(--text-inverse);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-dark-btn) 0%, var(--warning) 100%);
    color: var(--text-inverse);
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(245, 158, 11, .25);
}

.btn-warning:hover {
    transform: translateY(-1px);
    color: var(--text-inverse);
}

.btn-outline {
    background: var(--surface);
    border-color: var(--border-strong);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    border-color: var(--primary-light);
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--r-sm);
}

.btn-sm {
    padding: .4rem .75rem;
    font-size: .82rem;
}

.btn-sm .material-symbols-outlined {
    font-size: var(--icon-sm-alt);
}

.btn-lg {
    padding: .75rem 1.5rem;
    font-size: var(--fz-md);
    border-radius: var(--r);
}

.btn-full {
    width: 100%;
}

/* ── Forms ──────────────────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 1.1rem;
}

.form-label {
    display: block;
    font-size: .85rem;
    font-weight: var(--fw-semibold);
    color: var(--text-primary);
    margin-bottom: .45rem;
}

.form-label-hint {
    font-weight: var(--fw-normal);
    color: var(--text-muted);
    font-size: .78rem;
    margin-left: .35rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: .65rem .9rem;
    border-radius: var(--r-sm);
    border: 1.5px solid var(--border-solid);
    background: var(--surface);
    font-family: var(--font);
    font-size: .9rem;
    color: var(--text-primary);
    transition: var(--trans);
    outline: none;
    appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
    background: var(--surface);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-input:disabled,
.form-select:disabled {
    opacity: .55;
    cursor: not-allowed;
    background: var(--bg);
}

.form-textarea {
    resize: vertical;
    min-height: 90px;
}

.form-hint {
    font-size: .78rem;
    color: var(--text-muted);
    margin-top: .35rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Select Arrow */
.select-wrap {
    position: relative;
}

.select-wrap::after {
    content: '';
    position: absolute;
    right: .75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-muted);
    pointer-events: none;
}

/* Toggle Switch */
.toggle-wrap {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.toggle-label {
    font-size: .9rem;
    font-weight: var(--fw-medium);
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
}

.toggle {
    position: relative;
    width: 42px;
    height: 23px;
    flex-shrink: 0;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-track {
    position: absolute;
    inset: 0;
    background: rgba(99, 102, 241, .15);
    border-radius: var(--r-full);
    transition: background .25s;
    cursor: pointer;
}

.toggle-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
    transition: transform .25s cubic-bezier(.22, 1, .36, 1);
}

.toggle input:checked+.toggle-track {
    background: var(--primary);
}

.toggle input:checked+.toggle-track::after {
    transform: translateX(19px);
}

/* Module Row (Toggle + Label) */
.module-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .9rem 0;
    border-bottom: 1px solid var(--border);
    gap: var(--sp-4);
}

.module-row:last-child {
    border-bottom: none;
}

.module-info h4 {
    font-size: .93rem;
    font-weight: var(--fw-bold);
    color: var(--text-primary);
    margin-bottom: .15rem;
}

.module-info p {
    font-size: .8rem;
    color: var(--text-muted);
}

.module-row.locked {
    opacity: .45;
    pointer-events: none;
}

/* ── Alerts / Banners ───────────────────────────────────────────────────────── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .85rem 1rem;
    border-radius: var(--r);
    font-size: .87rem;
    line-height: 1.55;
    border: 1px solid transparent;
    margin-bottom: 1rem;
}

.alert .material-symbols-outlined {
    font-size: var(--icon-sm);
    flex-shrink: 0;
    margin-top: .05rem;
}

.alert-success {
    background: var(--success-light);
    border-color: var(--success-border);
    color: var(--alert-success-text);
}

.alert-error {
    background: var(--danger-light);
    border-color: var(--danger-border);
    color: var(--alert-error-text);
}

.alert-warning {
    background: var(--warning-light);
    border-color: var(--warning-border);
    color: var(--alert-warning-text);
}

.alert-info {
    background: var(--info-light);
    border-color: var(--info-border);
    color: var(--alert-info-text);
}

/* ── Badges ─────────────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .65rem;
    border-radius: var(--r-full);
    font-size: .75rem;
    font-weight: var(--fw-bold);
    line-height: 1;
}

.badge-primary {
    background: var(--primary-lighter);
    color: var(--primary-dark);
}

.badge-success {
    background: rgba(16, 185, 129, .1);
    color: var(--alert-success-text);
}

.badge-warning {
    background: rgba(245, 158, 11, .1);
    color: var(--warning-darker);
}

.badge-danger {
    background: rgba(239, 68, 68, .1);
    color: var(--alert-error-text);
}

.badge-neutral {
    background: var(--badge-neutral-bg);
    color: var(--text-secondary);
}

.badge-tier0 {
    background: rgba(99, 102, 241, .1);
    color: var(--primary-dark);
}

.badge-tier1 {
    background: var(--badge-tier1-bg);
    color: var(--text-secondary);
}

.badge-tier2 {
    background: rgba(139, 92, 246, .1);
    color: var(--badge-tier2-color);
}

.badge-tier3 {
    background: rgba(245, 158, 11, .1);
    color: var(--warning-darker);
}

/* ── Tables ─────────────────────────────────────────────────────────────────── */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--r);
    border: 1px solid var(--border-solid);
}

table.laia-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
    background: var(--surface);
}

.laia-table thead tr {
    background: var(--surface-elevated);
}

.laia-table th {
    padding: .75rem 1rem;
    text-align: left;
    font-size: .77rem;
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-solid);
    white-space: nowrap;
}

.laia-table td {
    padding: .8rem 1rem;
    font-size: .88rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.laia-table tr:last-child td {
    border-bottom: none;
}

.laia-table tbody tr:hover {
    background: var(--surface-elevated);
}

.laia-table .td-actions {
    display: flex;
    gap: .4rem;
    justify-content: flex-end;
}

/* Inline-Edit Inputs in Table */
.table-input {
    width: 100%;
    padding: .4rem .6rem;
    border-radius: var(--r-sm);
    border: 1.5px solid transparent;
    background: transparent;
    font-family: var(--font);
    font-size: .88rem;
    color: var(--text-primary);
    transition: var(--trans);
    outline: none;
}

.table-input:focus {
    background: var(--surface);
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, .1);
}

.table-select {
    padding: .4rem .6rem;
    border-radius: var(--r-sm);
    border: 1.5px solid var(--border-solid);
    background: var(--surface);
    font-family: var(--font);
    font-size: .85rem;
    color: var(--text-primary);
    outline: none;
    transition: var(--trans);
    cursor: pointer;
}

.table-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, .1);
}

/* ── Role Chips ─────────────────────────────────────────────────────────────── */
.role-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .6rem;
    border-radius: var(--r-full);
    font-size: .75rem;
    font-weight: var(--fw-bold);
}

.role-class_admin,
.role-teacher_admin {
    background: rgba(99, 102, 241, .1);
    color: var(--primary-dark);
}

.role-student_admin {
    background: rgba(59, 130, 246, .1);
    color: var(--role-student-admin-color);
}

.role-teacher {
    background: rgba(20, 184, 166, .1);
    color: var(--role-teacher-color);
}

.role-student {
    background: var(--badge-neutral-bg);
    color: var(--text-secondary);
}

.role-developer {
    background: var(--role-developer-bg);
    color: var(--role-developer-text);
}

/* ── Info Boxes ─────────────────────────────────────────────────────────────── */
.info-box {
    display: flex;
    gap: .65rem;
    align-items: flex-start;
    padding: .85rem 1rem;
    border-radius: var(--r);
    font-size: .85rem;
    line-height: 1.55;
    background: var(--info-light);
    border: 1px solid var(--info-border);
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.info-box .material-symbols-outlined {
    font-size: var(--icon-sm);
    flex-shrink: 0;
    margin-top: .1rem;
    color: var(--info);
}

.info-box.green {
    background: var(--success-light);
    border-color: var(--success-border);
}

.info-box.green .material-symbols-outlined {
    color: var(--success);
}

.info-box.yellow {
    background: var(--warning-light);
    border-color: var(--warning-border);
}

.info-box.yellow .material-symbols-outlined {
    color: var(--warning);
}

/* Group Tags */
.group-tag {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: var(--primary-lighter);
    color: var(--primary-dark);
    padding: .25rem .65rem;
    border-radius: var(--r-full);
    font-size: .78rem;
    font-weight: var(--fw-semibold);
    border: 1px solid rgba(99, 102, 241, .2);
}

.group-tag-del {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: var(--icon-xs);
    padding: 0;
    transition: var(--trans);
}

.group-tag-del:hover {
    color: var(--danger-dark);
}

/* Code Display */
.code-pill {
    font-family: ui-monospace, Menlo, monospace;
    font-size: .78rem;
    background: var(--surface-elevated);
    border: 1px solid var(--border-solid);
    padding: .3rem .7rem;
    border-radius: var(--r-sm);
    color: var(--text-secondary);
    word-break: break-all;
    letter-spacing: .02em;
}

/* ══════════════════════════════════════════════════════════════════════════════
   MODALS  (Standard-Template)
══════════════════════════════════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    backdrop-filter: blur(4px);
    z-index: 900;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--sp-4);
}

.modal-overlay.open {
    display: flex;
}

.modal-box {
    background: var(--surface);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 480px;
    border: 1px solid var(--border-strong);
    animation: modalIn .22s cubic-bezier(.22, 1, .36, 1) both;
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-box.modal-lg {
    max-width: 640px;
}

.modal-box.modal-sm {
    max-width: 380px;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(.93) translateY(10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.modal-header {
    display: flex;
    position: relative;
    align-items: center;
    gap: .75rem;
    padding: 1.25rem 1.5rem 0;
    flex-shrink: 0;
}

.modal-title {
    font-size: var(--fz-label);
    font-weight: var(--fw-bold);
    color: var(--text-primary);
}

.modal-subtitle {
    font-size: .82rem;
    color: var(--text-muted);
    margin-top: .1rem;
}

.modal-close {
    position: absolute;
    top: var(--sp-4);
    right: var(--sp-4);
    width: 36px;
    height: 36px;
    border-radius: var(--r-full);
    background: var(--surface-glass);
    border: 1px solid var(--border-strong);
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--trans);
    z-index: 10;
}

.modal-close:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.modal-close .material-symbols-outlined {
    font-size: var(--icon-md-sm);
}

.modal-body {
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    gap: .65rem;
    justify-content: flex-end;
    padding: 0 1.5rem 1.25rem;
    flex-shrink: 0;
}

.modal-footer.reverse {
    flex-direction: row-reverse;
}

/* ── .modal (Kalender & andere Seiten – show/hide per JS-Klasse) ──────────── */
/* Der Kalender verwendet .modal (nicht .modal-box) + togglet .show per JS.   */
.modal {
    background: var(--surface);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 540px;
    border: 1px solid var(--border-strong);
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    /* Eintritts-Animation über .show */
    opacity: 0;
    transform: scale(.94) translateY(14px);
    transition:
        opacity .26s cubic-bezier(.22, 1, .36, 1),
        transform .26s cubic-bezier(.22, 1, .36, 1);
    pointer-events: none;
}

.modal.show {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

/* Modal-Datum (Subline unter modal-title) */
.modal-date {
    font-size: var(--fz-sm);
    color: var(--text-muted);
    margin-top: var(--sp-05);
    font-weight: var(--fw-medium);
}

/* ── Button-Klassen-Aliase ────────────────────────────────────────────────── */

/* .btn.primary: Haupt-Button mit Gradient */
.btn.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--text-inverse);
    border-color: transparent;
    /* Nutzt bestehende Schatten-Variable */
    box-shadow: var(--shadow-sm);
    /* Nutzt bestehende Standard-Transition */
    transition: var(--trans);
}

.btn.primary:hover {
    transform: translateY(-1px);
    /* Nutzt bestehende mittlere Schatten-Variable */
    box-shadow: var(--shadow-md);
    color: var(--text-inverse);
}

/* .btn.icon-btn: quadratischer Icon-Button (z.B. Kalender) */
.btn.icon-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--r-full);
    flex-shrink: 0;
    /* Nutzt deine bestehende langsame Transition (inkl. cubic-bezier) */
    transition: var(--trans-slow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn.icon-btn:not(.primary):hover {
    transform: translateY(-1px);
    background: var(--surface-hover);
}

/* .cancel-btn: dezenter Abbrechen-Button */
.btn.cancel-btn,
.cancel-btn.btn {
    background: var(--surface-hover);
    border-color: var(--border-solid);
    color: var(--text-secondary);
    transition: var(--trans);
}

.btn.cancel-btn:hover,
.cancel-btn.btn:hover {
    background: var(--surface);
    border-color: var(--border-strong);
    color: var(--text-primary);
    transform: translateY(-1px);
}

/* ── action-icon (Icon-Badge in Modal-Headern) ────────────────────────────── */
.action-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--r);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.action-icon .material-symbols-outlined {
    font-size: var(--icon-md);
}

/* ── Responsive Modal (bottom-sheet auf Mobilgeräten) ───────────────────────*/
@media (max-width: 600px) {
    .modal-overlay {
        align-items: flex-end;
        /* Modal wird am unteren Rand ausgerichtet */
        padding: 0;
    }

    .modal {
        max-width: 100%;
        max-height: 94vh;
        /* Modal nimmt maximal 94% der Viewport-Höhe */
        border-radius: var(--r-xl) var(--r-xl) 0 0;
        /* Nur oben abgerundet */
        transform: translateY(30px) scale(.98);
        /* Startposition: 30px nach unten verschoben */
    }

    .modal.show {
        transform: translateY(0) scale(1);
        /* Endposition: ganz unten */
    }
}

/* Confirm Modal */
.confirm-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--r-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.confirm-icon-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.confirm-icon-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.confirm-icon .material-symbols-outlined {
    font-size: var(--icon-lg);
}

.confirm-text {
    font-size: .9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .8rem 1.1rem;
    border-radius: var(--r);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    font-size: .875rem;
    font-weight: var(--fw-medium);
    min-width: 240px;
    max-width: 360px;
    pointer-events: all;
    animation: toastIn .3s cubic-bezier(.22, 1, .36, 1) both;
}

.toast.out {
    animation: toastOut .25s ease forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: none;
    }

    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

.toast .material-symbols-outlined {
    font-size: var(--icon-sm);
    flex-shrink: 0;
}

.toast-success .material-symbols-outlined {
    color: var(--success);
}

.toast-error .material-symbols-outlined {
    color: var(--danger);
}

.toast-info .material-symbols-outlined {
    color: var(--info);
}

/* ══════════════════════════════════════════════════════════════════════════════
   ADMIN PANEL – spezifische Komponenten
══════════════════════════════════════════════════════════════════════════════ */

/* Page Hero */
.admin-hero {
    margin-bottom: 2rem;
}

.admin-hero h1 {
    font-size: 1.8rem;
    font-weight: var(--fw-extrabold);
    color: var(--text-primary);
    letter-spacing: -.03em;
    margin-bottom: .35rem;
}

.admin-hero p {
    color: var(--text-secondary);
    font-size: .95rem;
}

/* Tier Banner */
.tier-banner {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    padding: 1rem 1.25rem;
    border-radius: var(--r-lg);
    border: 1px solid;
    margin-bottom: 1.75rem;
    font-size: .88rem;
}

.tier-banner-icon {
    font-size: var(--fz-2xl);
    flex-shrink: 0;
}

.tier-banner h4 {
    font-weight: var(--fw-bold);
    font-size: .95rem;
    margin-bottom: .15rem;
}

.tier-banner p {
    color: var(--text-muted);
}

.tier-0 {
    background: rgba(99, 102, 241, .06);
    border-color: rgba(99, 102, 241, .2);
}

.tier-0 h4 {
    color: var(--primary-dark);
}

.tier-1 {
    background: var(--surface-subtle);
    border-color: var(--border-solid);
}

.tier-2 {
    background: rgba(139, 92, 246, .06);
    border-color: rgba(139, 92, 246, .2);
}

.tier-2 h4 {
    color: var(--badge-tier2-color);
}

.tier-3 {
    background: rgba(245, 158, 11, .06);
    border-color: rgba(245, 158, 11, .2);
}

.tier-3 h4 {
    color: var(--warning-darker);
}

/* User Counter Bar */
.user-bar {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    background: var(--surface-elevated);
    border-radius: var(--r);
    border: 1px solid var(--border);
    margin-bottom: 1.25rem;
    font-size: .85rem;
}

.user-bar-track {
    flex: 1;
    height: 6px;
    background: rgba(99, 102, 241, .1);
    border-radius: var(--r-full);
    overflow: hidden;
}

.user-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: var(--r-full);
    transition: width .4s ease;
}

.user-bar-fill.warn {
    background: linear-gradient(90deg, var(--warning), var(--warning));
}

.user-bar-fill.full {
    background: linear-gradient(90deg, var(--danger), var(--danger));
}

.user-bar-count {
    font-weight: var(--fw-bold);
    color: var(--text-primary);
    white-space: nowrap;
}

/* Code box in table */
.code-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--surface-elevated);
    border: 1px solid var(--border-solid);
    border-radius: var(--r-sm);
    padding: .4rem .65rem;
    font-family: ui-monospace, Menlo, monospace;
    font-size: .78rem;
    color: var(--text-secondary);
    max-width: 360px;
    word-break: break-all;
}

.copy-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary);
    display: flex;
    align-items: center;
    transition: var(--trans);
    padding: 2px;
}

.copy-btn:hover {
    color: var(--primary-dark);
}

.copy-btn .material-symbols-outlined {
    font-size: var(--icon-sm-alt);
}

/* Role info cards */
.role-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: .75rem;
    margin: 1rem 0;
}

.role-info-card {
    padding: .85rem 1rem;
    border-radius: var(--r);
    border: 1.5px solid var(--border-solid);
    background: var(--surface-elevated);
    cursor: pointer;
    transition: var(--trans);
}

.role-info-card:hover {
    border-color: var(--primary-light);
    background: var(--surface-hover);
}

.role-info-card .material-symbols-outlined {
    font-size: var(--icon-slight);
    margin-bottom: .3rem;
}

.role-info-card strong {
    display: block;
    font-size: .88rem;
    margin-bottom: .15rem;
}

.role-info-card span {
    font-size: .77rem;
    color: var(--text-muted);
}

/* Sections tabs / anchors */
.admin-tabs {
    display: flex;
    gap: .25rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    flex-wrap: wrap;
}

.admin-tab {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .6rem 1rem;
    border-bottom: 2px solid transparent;
    font-size: .875rem;
    font-weight: var(--fw-semibold);
    color: var(--text-muted);
    cursor: pointer;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: var(--font);
    transition: var(--trans);
    white-space: nowrap;
}

.admin-tab:hover {
    color: var(--text-primary);
}

.admin-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.admin-tab .material-symbols-outlined {
    font-size: var(--icon-sm);
}

.admin-section-anchor {
    scroll-margin-top: calc(var(--header-h) + 1rem);
}

/* Locked overlay */
.locked-wrap {
    position: relative;
}

.locked-overlay-mask {
    position: absolute;
    inset: 0;
    background: rgba(248, 250, 252, .75);
    border-radius: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    z-index: 10;
    backdrop-filter: blur(2px);
}

.locked-overlay-mask .material-symbols-outlined {
    font-size: var(--icon-2xl);
    color: var(--text-muted);
}

.locked-overlay-mask p {
    font-size: .85rem;
    color: var(--text-secondary);
    text-align: center;
    max-width: 220px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
}

.empty-state .material-symbols-outlined {
    font-size: var(--icon-3xl);
    margin-bottom: .5rem;
    opacity: .4;
}

.empty-state p {
    font-size: .9rem;
    max-width: 360px;
    margin: 0 auto;
}

/* ── Responsive Padding ─────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .laia-page {
        padding: 1rem .75rem 3rem;
    }

    .card {
        padding: var(--sp-5);
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 1.1rem;
        padding-right: 1.1rem;
    }
}

/* ── Utility ────────────────────────────────────────────────────────────────── */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 {
    gap: .25rem;
}

.gap-2 {
    gap: .5rem;
}

.gap-3 {
    gap: .75rem;
}

.gap-4 {
    gap: var(--sp-4);
}

.mt-1 {
    margin-top: .25rem;
}

.mt-2 {
    margin-top: .5rem;
}

.mt-3 {
    margin-top: .75rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-2 {
    margin-bottom: .5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.text-sm {
    font-size: .85rem;
}

.text-xs {
    font-size: .77rem;
}

.text-muted {
    color: var(--text-muted);
}

.text-secondary {
    color: var(--text-secondary);
}

.font-bold {
    font-weight: var(--fw-bold);
}

.font-800 {
    font-weight: var(--fw-extrabold);
}

.w-full {
    width: 100%;
}

/* ── Server-Warning Toast (zweiter Lehrer-Hinweis) ─── */
#server-warning-teacher {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    max-width: 320px;
    width: calc(100vw - 3rem);
    background: var(--surface-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--warning-border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    z-index: 800;
    overflow: hidden;
}

#filterWrapper .btn-icon {
    position: relative;
}

#filterDropdown .filter-chip.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--text-inverse);
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(99, 102, 241, .3);
}

/* Filter-Button aktiv-Zustand */
#filterBtn.filter-active {
    background: var(--info-light);
    color: var(--info);
    border-color: var(--info-border);
}

#btnGrid[aria-pressed="true"],
#btnStack[aria-pressed="true"] {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-xs);
    border-color: var(--border-strong);
}

/* ══════════════════════════════════════════════════════════════════════════════
   GLOBALE DASHBOARD KOMPONENTEN (Lightbox & Collapsible Sections)
   ═════════════════════════════════════════════════════════════════════════════ */

/* Zusätzliche Root-Variable für Dashboard-Akzente */
:root {
    --accent-blue: var(--info);
    --warning-orange: #f97316;
}

/* ── Add-Form (Formular-Elemente in Modals & Sidebars) ──────────────────── */
.add-form select,
.add-form input[type="text"],
.add-form input[type="date"],
.add-form textarea {
    width: 100%;
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--r-sm);
    border: 1.5px solid var(--border-solid);
    background: var(--surface);
    font-family: var(--font);
    font-size: var(--fz-sm);
    color: var(--text-primary);
    transition: var(--trans);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    display: block;
    margin-bottom: var(--sp-2);
}

.add-form select:focus,
.add-form input:focus,
.add-form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .1);
    background: var(--surface);
}

.add-form label {
    display: block;
    font-size: var(--fz-sm);
    font-weight: var(--fw-bold);
    color: var(--text-secondary);
    margin-bottom: var(--sp-1);
    margin-top: var(--sp-2);
}

.add-form textarea {
    resize: vertical;
    min-height: 80px;
}

/* Sections für Links & Dateien im Formular */
.add-form-section {
    margin-top: var(--sp-3);
    border: 1px solid var(--border-solid);
    border-radius: var(--r-sm);
    padding: var(--sp-3);
}

.add-form-section-label {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--fz-sm);
    font-weight: var(--fw-bold);
    color: var(--text-secondary);
    margin-bottom: var(--sp-2);
}

.add-form-section-label .material-symbols-outlined {
    font-size: var(--icon-sm);
}

/* ── Collapsible Sections (Files & Links) ──────────────────────────────────── */
.collapsible-section {
    margin-top: 14px;
    border-radius: var(--r);
    overflow: hidden;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.collapsible-section.expanded {
    background: var(--surface);
    border-color: var(--border-solid);
    box-shadow: var(--shadow-sm);
}

.section-header {
    display: flex;
    align-items: center;
    padding: 0 14px;
    height: 44px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.section-header:hover {
    background: var(--surface-hover);
}

.section-header .material-symbols-outlined {
    font-size: var(--icon-md-sm);
    margin-right: 10px;
    color: var(--text-muted);
}

.section-header .section-title-text {
    flex: 1;
    font-size: var(--fz-btn-sm);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: var(--fw-bold);
    color: var(--text-muted);
    text-align: left;
}

.section-header .expand-icon {
    font-size: var(--icon-sm);
    color: var(--text-muted);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.collapsible-section.expanded .expand-icon {
    transform: rotate(180deg);
    color: var(--primary);
}

.section-content-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-top: 1px solid transparent;
}

.collapsible-section.expanded .section-content-wrapper {
    grid-template-rows: 1fr;
    border-top-color: var(--border);
}

.section-content {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ── Item Rows (File/Link Einträge) ────────────────────────────────────────── */
.item-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: var(--fz-sm);
    border-bottom: 1px solid var(--border);
    transition: background 0.3s ease, color 0.2s;
    text-align: left;
    position: relative;
}

.item-row:last-child {
    border-bottom: none;
}

.item-row:hover {
    background: var(--surface-hover);
    color: var(--primary);
}

.item-row .type-icon {
    color: var(--text-muted);
    font-size: var(--icon-md-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.item-row .item-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: var(--fw-medium);
    color: var(--text-secondary);
    text-align: left;
    margin-right: 12px;
    transition: color 0.2s;
}

.item-row:hover .item-text {
    color: var(--text-primary);
}

.item-row .hover-arrow {
    opacity: 0;
    color: var(--primary);
    font-size: var(--icon-sm);
    transition: var(--trans-cubic);
    transform: translateX(-5px);
    margin-left: auto;
}

.item-row:hover .hover-arrow {
    opacity: 1;
    transform: translateX(0);
}

.item-actions {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.action-btn {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0;
    border-radius: var(--r-full);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: var(--trans);
    box-sizing: border-box;
    vertical-align: middle;
    -webkit-appearance: none;
    appearance: none;
}

.action-btn:hover {
    background: var(--primary-lighter);
    color: var(--primary);
}

.action-btn.download:hover {
    background: var(--success-light);
    color: var(--success);
}

.action-btn .material-symbols-outlined {
    font-size: var(--icon-md-sm);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    margin: 0;
    padding: 0;
}

/* ── Lightbox ──────────────────────────────────────────────────────────────── */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    z-index: var(--z-lightbox);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 80%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--r);
    box-shadow: var(--shadow-xl);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox-overlay.active .lightbox-image {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-inverse);
    border-radius: var(--r-full);
    cursor: pointer;
    z-index: var(--z-lightbox-ui);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-inverse);
    border-radius: var(--r-full);
    cursor: pointer;
    z-index: var(--z-lightbox-ui);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 40px;
}

.lightbox-next {
    right: 40px;
}

.lightbox-toolbar {
    position: absolute;
    bottom: 40px;
    display: flex;
    gap: 16px;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 24px;
    border-radius: var(--r-full);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.lightbox-info {
    color: var(--text-inverse);
    font-size: var(--fz-body-sm);
    font-weight: var(--fw-medium);
}

.lightbox-btn {
    background: var(--primary);
    color: var(--text-inverse);
    border: none;
    padding: 8px 20px;
    border-radius: var(--r-full);
    cursor: pointer;
    font-size: var(--fz-btn-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: var(--trans);
    font-weight: var(--fw-semibold);
}

.lightbox-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.lightbox-filename {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-inverse);
    font-size: var(--fz-label);
    font-weight: var(--fw-semibold);
    background: rgba(0, 0, 0, 0.4);
    padding: var(--sp-2) var(--sp-6);
    border-radius: var(--r-full);
    backdrop-filter: blur(5px);
    max-width: 80%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: var(--z-lightbox-ui);
}

@media (max-width: 720px) {
    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-nav {
        width: 40px;
        height: 40px;
        padding: 0;
    }

    .lightbox-image {
        max-height: 70vh;
    }

    .lightbox-toolbar {
        bottom: 20px;
        padding: 8px 16px;
    }

    .lightbox-filename {
        font-size: var(--fz-body-sm);
        max-width: 90%;
        padding: 8px 16px;
    }
}

/* Effort Badge */
.effort-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 0.5rem 1rem;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    font-size: var(--fz-btn-sm);
    font-weight: var(--fw-semibold);
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.effort-icon {
    font-size: var(--icon-md);
}

.effort-extreme {
    color: var(--effort-extreme);
}

.effort-high {
    color: var(--effort-high);
}

.effort-medium {
    color: var(--effort-medium);
}

.effort-low {
    color: var(--effort-low);
}

/* Type Badges */
.type-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.85rem;
    border-radius: var(--r-full);
    font-size: var(--fz-xs);
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.badge-default {
    background: var(--surface-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-strong);
}

.badge-SA {
    background: var(--badge-sa-bg);
    color: var(--badge-sa-text);
    border: 1px solid var(--badge-sa-border);
}

.badge-Test {
    background: var(--badge-test-bg);
    color: var(--badge-test-text);
    border: 1px solid var(--badge-test-border);
}

.badge-MAK {
    background: var(--badge-mak-bg);
    color: var(--badge-mak-text);
    border: 1px solid var(--badge-mak-border);
}

/* WiHÜ / HÜ - Blau */
.badge-WiHÜ,
.badge-wihu,
.badge-HÜ,
.badge-hu {
    background: var(--badge-hu-bg);
    color: var(--badge-hu-text);
    border-color: var(--badge-hu-border);
}

/* PLF - Rot/Orange (wie SA) */
.badge-PLF,
.badge-plf {
    background: var(--badge-plf-bg);
    color: var(--badge-plf-text);
    border-color: var(--badge-plf-border);
}

/* Quiz - Gelb/Orange (wie Test) */
.badge-Quiz,
.badge-quiz {
    background: var(--badge-quiz-bg);
    color: var(--badge-quiz-text);
    border-color: var(--badge-quiz-border);
}

/* ── Toast Container & Animation (wie Admin-Panel) ── */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    min-width: 300px;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transition: var(--trans-cubic);
}

.toast.out {
    opacity: 0;
    transform: translateX(100%);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Lightbox — Dark Mode fixes */
body.dark-mode .lightbox-close,
body.dark-mode .lightbox-nav {
    color: #ffffff;
}

body.dark-mode .lightbox-info,
body.dark-mode .lightbox-filename {
    color: #ffffff;
}

body.dark-mode .lightbox-btn {
    color: #ffffff;
}

body.dark-mode .lightbox-btn:hover {
    color: #ffffff;
}

.lightbox-btn:hover {
    background: var(--primary-dark);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}