/* ===== Ganztagsplaner Web – Design System =====
   Farbpalette "Ocean Blue" identisch zur Desktop-Anwendung (GTP.Common\AppTheme.cs) */
:root {
    --gtp-primary: #2E9DE6;
    --gtp-primary-dark: #1976D2;
    --gtp-primary-light: #E3F2FD;
    --gtp-accent: #2ACACD;
    --gtp-bg: #ffffff;
    --gtp-surface: #ffffff;
    --gtp-border: #E0E0E0;
    --gtp-text: #212121;
    --gtp-text-muted: #666666;
    --gtp-danger: #F44336;
    --gtp-success: #4CAF50;
    --gtp-warning: #FF9800;
    --gtp-info: #2196F3;
    --gtp-warning-bg: #FFF3E0;
    --gtp-radius: 6px;
    --gtp-shadow: 0 1px 2px rgba(0, 0, 0, .06);
    /* Basisschrift: Browser-Standard 16px (früher 14px) – alle rem-Angaben skalieren mit */
    --gtp-font-size: 16px;
}

/* ===== Farbthemes (Desktop: GTP.Common\AppTheme.cs, ThemeDefinitions) =====
   Auswahl in der Administration; gespeichert per localStorage am <html data-theme>. */
[data-theme="vibrant-purple"] {
    --gtp-primary: #8E44AD;
    --gtp-primary-dark: #6C3483;
    --gtp-primary-light: #F3E9F8;
    --gtp-accent: #1ABC9C;
}

[data-theme="fresh-green"] {
    --gtp-primary: #27AE60;
    --gtp-primary-dark: #1E8B4D;
    --gtp-primary-light: #E7F7EE;
    --gtp-accent: #F39C12;
}

[data-theme="sunset-orange"] {
    --gtp-primary: #E67E22;
    --gtp-primary-dark: #CA6F1E;
    --gtp-primary-light: #FCF0E4;
    --gtp-accent: #1ABC9C;
}

[data-theme="rose-pink"] {
    --gtp-primary: #E91E63;
    --gtp-primary-dark: #C2185B;
    --gtp-primary-light: #FCE4EC;
    --gtp-accent: #FF9800;
}

[data-theme="soft-rose"] {
    --gtp-primary: #FF8A9A;
    --gtp-primary-dark: #E67A8A;
    --gtp-primary-light: #FFEEF1;
    --gtp-accent: #FFB74D;
}

[data-theme="deep-ocean"] {
    --gtp-primary: #006064;
    --gtp-primary-dark: #004D40;
    --gtp-primary-light: #E0F2F3;
    --gtp-accent: #00BCD4;
}

[data-theme="radiant-yellow"] {
    --gtp-primary: #D4A80B;
    --gtp-primary-dark: #B7950B;
    --gtp-primary-light: #FCF6DC;
    --gtp-accent: #E67E22;
}

[data-theme="mystic-indigo"] {
    --gtp-primary: #4B0082;
    --gtp-primary-dark: #2E0854;
    --gtp-primary-light: #EFE6F8;
    --gtp-accent: #7F00FF;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: var(--gtp-font-size);
    line-height: 1.45;
    color: var(--gtp-text);
    background: var(--gtp-bg);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

h1 { font-size: 1.4rem; margin: 0 0 4px 0; line-height: 1.3; }
h2 { font-size: 1.15rem; margin: 0 0 8px 0; line-height: 1.3; }

a { color: var(--gtp-primary); }

/* ===== Shell: Titelzeile + Menüleiste + Statusleiste (wie Desktop-Fenster) ===== */
.gtp-shell { display: flex; flex-direction: column; height: 100vh; overflow: hidden; background: #fff; }

/* Titelzeile (entspricht der Fenster-Titelleiste: "Ganztagsplaner 2.1 - Lizenziert für ...") */
.gtp-titlebar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: #fff;
    border-bottom: 1px solid var(--gtp-border);
    font-size: .875rem;
    color: var(--gtp-text-muted);
}
.gtp-titlebar .gtp-logo { width: 22px; height: 22px; border-radius: 4px; }
.gtp-titlebar .spacer { flex: 1; }
.gtp-username { font-size: .875rem; color: var(--gtp-text-muted); }
.gtp-titlebar-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--gtp-text-muted);
    text-decoration: none;
    border: 1px solid var(--gtp-border);
    background: #fafafa;
}
.gtp-titlebar-link:hover { color: var(--gtp-primary-dark); border-color: var(--gtp-primary); background: #fff; }
.gtp-titlebar-link.active { color: var(--gtp-primary-dark); border-color: var(--gtp-primary); font-weight: 600; }

/* Menüleiste: schlichte Text-Tabs wie im Desktop */
.gtp-menubar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    background: #fff;
    border-bottom: 1px solid var(--gtp-border);
    padding: 0 6px;
}

.gtp-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--gtp-text);
    text-decoration: none;
    padding: 10px 14px 7px 14px;
    border-bottom: 3px solid transparent;
    font-weight: 400;
    font-size: .9375rem;
    white-space: nowrap;
    transition: background .12s;
}

.gtp-tab:hover { background: #F5F5F5; }
.gtp-tab.active { border-bottom-color: var(--gtp-primary); color: var(--gtp-primary-dark); font-weight: 600; }
.gtp-tab .gtp-icon { color: var(--gtp-primary); }

.gtp-main {
    position: relative;
    flex: 1 1 auto;
    min-height: 60vh;
    overflow: auto;
    padding: 8px 10px;
    width: 100%;
}

.gtp-page { min-height: 40vh; }

/* Sofort-Schleier nach Login (vor gtp.js) – verhindert Aufblitzen der Kinder-Seite */
html.gtp-entry-veil-pending::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--gtp-bg, #fff);
    pointer-events: all;
}

/* Willkommen nach Login: zentrierte Karte statt Toast */
.gtp-page-veil.is-welcome {
    z-index: 10001;
    background:
        radial-gradient(ellipse 80% 60% at 50% 40%,
            color-mix(in srgb, var(--gtp-primary-light) 70%, #fff) 0%,
            var(--gtp-bg, #fff) 70%);
}
.gtp-welcome-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    /* Feste Breite – kein Springen bei kurzem/langem Nachrichtentext */
    width: min(440px, 88vw);
    max-width: min(440px, 88vw);
    box-sizing: border-box;
    padding: 36px 32px 32px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid color-mix(in srgb, var(--gtp-primary) 18%, transparent);
    box-shadow:
        0 4px 24px color-mix(in srgb, var(--gtp-primary) 12%, transparent),
        0 20px 48px rgba(15, 23, 42, 0.08);
    opacity: 0;
    transform: translateY(10px); /* kein scale – sonst wirkt die Karte kurz schmaler */
    transition: opacity .45s ease, transform .45s ease;
}
.gtp-page-veil.is-covering .gtp-welcome-card {
    opacity: 1;
    transform: none;
    transition-delay: .08s;
}
.gtp-welcome-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    color: var(--gtp-primary);
    background:
        linear-gradient(145deg,
            color-mix(in srgb, var(--gtp-primary-light) 90%, #fff),
            color-mix(in srgb, var(--gtp-accent) 25%, var(--gtp-primary-light)));
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--gtp-primary) 10%, transparent);
    animation: gtp-welcome-pulse 2.8s ease-in-out infinite;
}
.gtp-welcome-icon svg {
    display: block;
    transform-origin: 50% 50%;
    animation: gtp-welcome-sparkle 2.8s ease-in-out infinite;
}
.gtp-welcome-kicker {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gtp-text);
    letter-spacing: -0.01em;
}
.gtp-welcome-message {
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.45;
    color: var(--gtp-text-muted);
    width: 100%;
    min-height: 2.9em; /* Platz für 2 Zeilen – weniger Höhen-Sprung bei Textwechsel */
}
@keyframes gtp-welcome-pulse {
    0%, 100% {
        transform: translateY(0) scale(1);
        box-shadow: 0 0 0 8px color-mix(in srgb, var(--gtp-primary) 10%, transparent);
    }
    50% {
        transform: translateY(-3px) scale(1.04);
        box-shadow: 0 0 0 14px color-mix(in srgb, var(--gtp-primary) 6%, transparent);
    }
}
@keyframes gtp-welcome-sparkle {
    0%, 100% {
        transform: rotate(-6deg) scale(1);
        opacity: 0.92;
    }
    40% {
        transform: rotate(8deg) scale(1.08);
        opacity: 1;
    }
    70% {
        transform: rotate(-2deg) scale(1.02);
        opacity: 0.96;
    }
}
@media (prefers-reduced-motion: reduce) {
    .gtp-welcome-icon,
    .gtp-welcome-icon svg { animation: none; }
    .gtp-welcome-card { transition: none; }
}

/* ===== Seitenwechsel: Vollbild-Schleier + Lade-Indikator (theme-aware) ===== */
.gtp-page-veil {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: var(--gtp-bg, #fff);
    opacity: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .4s ease;
}
.gtp-page-veil.is-covering {
    opacity: 1;
    pointer-events: auto;
    transition: none; /* sofort deckend – kein Durchscheinen */
}

/* Dünne Top-Fortschrittsleiste */
.gtp-page-veil-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gtp-primary-light);
    overflow: hidden;
}
.gtp-page-veil-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 36%;
    background: linear-gradient(90deg, var(--gtp-primary), var(--gtp-accent));
    border-radius: 0 2px 2px 0;
    animation: gtp-veil-slide 1.1s ease-in-out infinite;
}

.gtp-page-veil-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .35s ease, transform .35s ease;
}
.gtp-page-veil.is-covering .gtp-page-veil-inner {
    opacity: 1;
    transform: none;
    transition-delay: .1s; /* erst Fläche, dann Indikator */
}

.gtp-page-veil-ring {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid var(--gtp-primary-light);
    border-top-color: var(--gtp-primary);
    border-right-color: var(--gtp-accent);
    animation: gtp-veil-spin .8s linear infinite;
    box-shadow: 0 0 0 6px var(--gtp-primary-light);
}

.gtp-page-veil-text {
    font-size: .88rem;
    font-weight: 500;
    color: var(--gtp-text-muted);
    letter-spacing: .01em;
}

@keyframes gtp-veil-spin {
    to { transform: rotate(360deg); }
}
@keyframes gtp-veil-slide {
    0% { left: -40%; }
    100% { left: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .gtp-page-veil,
    .gtp-page-veil.is-covering { transition: none; }
    .gtp-page-veil-inner { transition: none; opacity: 1; transform: none; }
    .gtp-page-veil-ring,
    .gtp-page-veil-progress-fill { animation: none; }
    .gtp-page-veil-ring { border-color: var(--gtp-primary); }
}

/* Globale Statusleiste unten (Desktop: Gradient-Border oben, Badge rechts) */
.gtp-statusbar-global {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    height: 32px;
    padding: 0 12px;
    background: #fff;
    border-top: 2px solid var(--gtp-primary);
    border-image: linear-gradient(90deg, var(--gtp-primary), var(--gtp-accent)) 1;
}
.gtp-statusbar-right {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    min-width: 0;
}
.gtp-statusbar-date {
    font-size: .78rem;
    font-weight: 600;
    color: var(--gtp-text-muted);
    text-transform: capitalize;
}
.gtp-statusbar-image {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 1px 8px;
    border-radius: 4px;
    border: 1px solid var(--gtp-border, #d0d7e2);
    background: #f4f6f8;
    font-size: .72rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--gtp-text-muted);
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
    opacity: 1;
}

.db-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 12px;
    padding: 2px 10px;
    font-size: .75rem;
    font-weight: 600;
    color: var(--gtp-info);
    border: 1px solid rgba(33, 150, 243, .4);
    background: rgba(33, 150, 243, .08);
    white-space: nowrap;
}

/* ===== Ribbon (wie Telerik RadRibbonView im Desktop) ===== */
.gtp-ribbon {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid var(--gtp-border);
    border-radius: 4px 4px 0 0;
    padding: 2px 2px 0 2px;
    /* Kein overflow:auto – das würde die Dropdown-Menüs abschneiden */
}

.ribbon-group {
    display: flex;
    flex-direction: column;
    padding: 0 4px;
    border-right: 1px solid #EEEEEE;
}
.ribbon-group:last-child { border-right: none; }

.ribbon-buttons { display: flex; gap: 4px; flex: 1; align-items: stretch; }
.ribbon-buttons > .dropdown { flex: 0 0 auto; }

.ribbon-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    min-width: 72px;
    max-width: 148px;
    padding: 8px 10px 5px 10px;
    background: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: .82rem;
    line-height: 1.2;
    color: var(--gtp-text);
    text-align: center;
    white-space: normal;
    overflow: hidden;
    flex: 0 0 auto;
}
.ribbon-btn > span {
    display: block;
    max-width: 100%;
    overflow-wrap: break-word;
    hyphens: auto;
}
.ribbon-btn .gtp-icon { color: var(--gtp-primary); }
.ribbon-btn:hover { background: var(--gtp-primary-light); }
.ribbon-btn.is-active {
    background: var(--gtp-primary-light);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gtp-primary) 35%, transparent);
    color: var(--gtp-primary-dark);
    font-weight: 600;
}
.ribbon-btn.is-active .gtp-icon { color: var(--gtp-primary-dark); }
.ribbon-btn:disabled { color: #BDBDBD; cursor: default; background: none; }
.ribbon-btn:disabled .gtp-icon { color: #BDBDBD; }
.ribbon-btn .chevron { color: var(--gtp-text-muted); margin-top: -2px; }

.ribbon-group-label {
    text-align: center;
    font-size: .78rem;
    color: var(--gtp-text-muted);
    padding: 2px 2px 3px 2px;
    white-space: nowrap;
}

/* Eingabefelder und Badges in einer Ribbon-Gruppe nicht auf volle Höhe ziehen
   (sonst wirken z. B. <select> und Zähl-Badges klobig/unförmig). */
.ribbon-buttons > select,
.ribbon-buttons > .badge,
.ribbon-buttons > .gtp-progress,
.ribbon-buttons > .badge + .badge {
    align-self: center;
    height: auto;
}
.ribbon-buttons > select {
    padding: 5px 8px;
    font: inherit;
    font-size: .85rem;
    line-height: 1.2;
    border: 1px solid var(--gtp-border);
    border-radius: 4px;
    background: #fff;
    color: var(--gtp-text);
    cursor: pointer;
}
.ribbon-buttons > .badge { white-space: nowrap; }

/* Suchleiste direkt unter dem Ribbon (Desktop: volle Breite, #FAFAFA) */
.gtp-searchbar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #FAFAFA;
    border: 1px solid var(--gtp-border);
    border-top: none;
    padding: 6px 10px;
    margin-bottom: 8px;
}
.gtp-searchbar .search-box { flex: 1; }
.gtp-searchbar .search-box input { width: 100%; }

/* ===== Leer-Hinweis (Empty State): freundlich, mit Icon und Aktion ===== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 36px 20px;
    margin: 12px 0;
    background: #FBFCFD;
    border: 1px dashed var(--gtp-border);
    border-radius: 12px;
    color: var(--gtp-text);
}
.empty-state-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 4px;
}
.empty-state-icon .gtp-icon { color: #fff; }
.empty-state-icon.tone-primary { background: var(--gtp-primary); }
.empty-state-icon.tone-green { background: #2E9E5B; }
.empty-state-icon.tone-orange { background: #E8923C; }
.empty-state-icon.tone-red { background: #D9534F; }
.empty-state-icon.tone-muted { background: #9AA7B4; }
.empty-state-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}
.empty-state-desc {
    margin: 0;
    max-width: 560px;
    font-size: .9rem;
    line-height: 1.45;
    color: var(--gtp-text-muted);
}
.empty-state-action { margin-top: 6px; }

/* Zähler unter dem Grid (Desktop: CountLabel) – klebt immer unten am Viewport,
   auch bei wenigen Datensätzen (flex-Layout der Hauptfläche). */
.gtp-main:has(.gtp-table-wrap) { display: flex; flex-direction: column; }
.gtp-main:has(.gtp-table-wrap) > .gtp-page { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.gtp-main:has(.gtp-table-wrap) .gtp-table-wrap { flex: 1 1 auto; min-height: 0; max-height: none; overflow: auto; }
/* Bei leerer Liste: Tabelle nicht strecken – der Hinweis sitzt direkt über dem Zähler. */
.gtp-main:has(.gtp-table-wrap .empty-state) .gtp-table-wrap { flex: 0 1 auto; min-height: 0; overflow: visible; }

/* ===== Administration: vollbreite, untereinander gestapelte Bereiche ===== */
.admin-stack { display: flex; flex-direction: column; gap: 16px; min-height: 420px; }
.admin-stack > .card { width: 100%; animation: admin-fade-in .18s ease-out; }

/* ===== Administration: sanfter Tab-Wechsel ===== */
@keyframes admin-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}
.admin-intro {
    font-size: .9rem;
    color: var(--gtp-text-muted);
    background: #F7FAFC;
    border: 1px solid var(--gtp-border);
    border-left: 3px solid var(--gtp-primary);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
}

/* ===== Administration: Tab-Navigation ===== */
.admin-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--gtp-border);
    margin-bottom: 16px;
}
.admin-tab {
    appearance: none;
    border: none;
    background: none;
    cursor: pointer;
    font: inherit;
    font-size: .9rem;
    font-weight: 600;
    color: var(--gtp-text-muted);
    padding: 9px 14px;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    border-radius: 6px 6px 0 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.admin-tab:hover { color: var(--gtp-text); background: var(--gtp-bg-alt, #f5f5f5); }
.admin-tab.active { color: var(--gtp-primary); border-bottom-color: var(--gtp-primary); }
.count-label { font-weight: 700; font-size: .85rem; margin: 5px; flex-shrink: 0; }
.gtp-main:has(.gtp-table-wrap) .count-label { margin-top: auto; }

/* ===== Toolbar ===== */
.gtp-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: var(--gtp-surface);
    border: 1px solid var(--gtp-border);
    border-radius: var(--gtp-radius);
    padding: 10px 12px;
    margin-bottom: 12px;
    box-shadow: var(--gtp-shadow);
}

.gtp-toolbar .spacer { flex: 1; }

.gtp-statusbar {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: var(--gtp-radius);
    background: var(--gtp-warning-bg);
    border: 1px solid #ecd9a8;
    font-size: .85rem;
}

/* ===== Buttons & Inputs ===== */
.btn {
    border: 1px solid var(--gtp-border);
    background: var(--gtp-surface);
    color: var(--gtp-text);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: .9375rem;
    font-family: inherit;
    transition: background .12s, border-color .12s;
    white-space: nowrap;
}

.btn:hover { background: var(--gtp-primary-light); border-color: var(--gtp-primary); }
.btn-primary { background: var(--gtp-primary); border-color: var(--gtp-primary); color: #fff; }
.btn-primary:hover { background: var(--gtp-primary-dark); color: #fff; }
.btn-danger { color: var(--gtp-danger); }
.btn-danger:hover { background: #fdecea; border-color: var(--gtp-danger); }
.btn-ghost { background: transparent; border-color: rgba(255, 255, 255, .4); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, .15); border-color: #fff; color: #fff; }
.btn-sm { padding: 5px 11px; font-size: .875rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Datei-Auswahl: Browser-Standardknopf an die .btn-Optik angleichen */
input[type="file"] {
    font-family: inherit;
    font-size: .85rem;
    color: var(--gtp-text-muted);
}

input[type="file"]::file-selector-button {
    border: 1px solid var(--gtp-border);
    background: var(--gtp-surface);
    color: var(--gtp-text);
    padding: 7px 14px;
    margin-right: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: .875rem;
    font-family: inherit;
    box-shadow: var(--gtp-shadow);
    transition: background .12s, border-color .12s;
}

input[type="file"]::file-selector-button:hover {
    background: var(--gtp-primary-light);
    border-color: var(--gtp-primary);
    color: var(--gtp-primary-dark);
}

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], select, textarea {
    border: 1px solid var(--gtp-border);
    border-radius: 6px;
    padding: 7px 10px;
    font-size: .875rem;
    font-family: inherit;
    background: #fff;
    color: var(--gtp-text);
}

input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--gtp-primary);
    outline-offset: -1px;
}

label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; font-weight: 500; }
.checkbox-label { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }

/* ===== Datentabellen ===== */
.gtp-table-wrap {
    background: var(--gtp-surface);
    border: 1px solid var(--gtp-border);
    border-radius: 4px;
    overflow: auto;
    max-height: calc(100vh - 340px);
}

table.gtp-grid { border-collapse: collapse; width: 100%; }

.gtp-grid thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #FAFAFA;
    color: var(--gtp-text);
    text-align: left;
    padding: 7px 10px;
    font-size: .8rem;
    font-weight: 600;
    white-space: nowrap;
    border-bottom: 2px solid var(--gtp-border);
}

/* Sortierbare Tabellenköpfe (Klick sortiert die Spalte) – wirkt in allen Tabellen */
thead th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color .12s ease, color .12s ease;
}
.gtp-grid thead th.sortable:hover { background: #EAF2FB; color: var(--gtp-primary, #1F6FB2); }
thead th.sortable:hover { color: var(--gtp-primary, #1F6FB2); }
thead th.sortable .sort-arrow {
    display: inline-block;
    margin-left: 4px;
    vertical-align: -1px;
    color: var(--gtp-primary, #1F6FB2);
}
thead th.sort-asc, thead th.sort-desc { color: var(--gtp-primary, #1F6FB2); }
thead th.sort-none .sort-arrow { display: none; }

.gtp-grid tbody td {
    padding: 5px 10px;
    border-bottom: 1px solid #EEEEEE;
    vertical-align: middle;
}
.gtp-grid tbody td:has(.empty-state) { padding: 0; border-bottom: none; }

.gtp-grid tbody tr:hover { background: #F0F8FF; }
.gtp-grid tbody tr.row-selected { background: var(--gtp-primary-light); }

/* Nachname als klickbarer Link (Desktop: Online-Ansicht bei Klick) */
.name-link {
    color: var(--gtp-text);
    cursor: pointer;
    text-decoration: none;
    transition: color .12s ease, background-color .12s ease;
    border-radius: 3px;
}

.name-link:hover {
    color: var(--gtp-primary-dark);
    background-color: var(--gtp-primary-light);
}

/* QR-Code-Indikator hinter dem Vornamen: Pfeil nach rechts oben,
   erscheint nur, wenn für das Kind ein Online-Registrierungscode (QR-Code) hinterlegt ist. */
.qr-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    padding: 1px;
    color: var(--gtp-primary);
    vertical-align: middle;
    border-radius: 3px;
    line-height: 0;
    cursor: pointer;
    transition: background-color .12s ease, color .12s ease;
}

.qr-indicator:hover {
    color: var(--gtp-primary-dark);
    background-color: var(--gtp-primary-light);
}

.qr-indicator-active {
    color: var(--gtp-primary-dark);
    background-color: var(--gtp-primary-light);
}

/* Wochentagszellen: Kürzel mit "/" verbunden wie im Desktop-Grid */
.day-codes { font-size: .875rem; white-space: nowrap; }

/* Tageszellen (Mo-Fr) */
.day-cell {
    cursor: pointer;
    min-width: 96px;
    user-select: none;
    border-left: 1px solid #eef2f6;
    vertical-align: middle;
}

.day-cell:hover { outline: 1px dashed var(--gtp-primary); outline-offset: -2px; }

.day-cell.selected {
    outline: 2px solid var(--gtp-primary);
    outline-offset: -2px;
    background: var(--gtp-primary-light) !important;
}

.day-cell.copy-source {
    outline: 2px dashed var(--gtp-accent);
    outline-offset: -2px;
    background: var(--gtp-warning-bg) !important;
}

/* Beim Bearbeiten: Zelle als Anker, Editor schwebt darüber (Spaltenbreite bleibt) */
.day-cell.editing { position: relative; }
.cell-edit-placeholder { visibility: hidden; }

.offering-chip {
    display: inline-block;
    background: var(--gtp-primary-light);
    border: 1px solid #b9cde0;
    color: var(--gtp-primary-dark);
    border-radius: 4px;
    padding: 0 4px;
    margin: 0 2px 0 0;
    font-size: .8rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.offering-chip .chip-x {
    margin-left: 4px;
    cursor: pointer;
    color: var(--gtp-danger);
    font-weight: 700;
}

/* Zellen-Editor: gemeinsame Basis für Grid-Zellen und Wochenplan im Kind-Dialog.
   Wichtig: kein overflow-Clipping, sonst wird die Vorschlagsliste abgeschnitten. */
.cell-editor {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    overflow: visible;
    gap: 3px;
    align-items: center;
    box-sizing: border-box;
}
.cell-editor input { width: 70px; padding: 1px 4px; font-size: .78rem; border-color: var(--gtp-primary); }

/* Grid-Zelleneditor als kleine schwebende Karte über der Zelle: liegt außerhalb
   des Layoutflusses und verändert daher die Spaltenbreite nicht. */
.day-cell .cell-editor {
    position: absolute;
    top: -2px;
    left: -2px;
    z-index: 60;
    background: #fff;
    border: 2px solid var(--gtp-primary);
    border-radius: 9px;
    padding: 5px 6px;
    /* Feste Breite: Chips brechen in die nächste Zeile um, statt den Editor
       mit jeder Auswahl breiter springen zu lassen. */
    width: 280px;
    box-shadow: 0 6px 18px rgba(16, 42, 67, .16);
}
.day-cell .cell-editor input {
    flex: 1 1 60px;
    min-width: 55px;
    width: auto;
    border: none;
    outline: none;
    background: transparent;
    font-size: .8rem;
    padding: 2px 3px;
}
.day-cell .cell-editor .suggestions {
    position: static;
    flex-basis: 100%;
    min-width: 0;
    max-height: 190px;
    margin-top: 3px;
    border: none;
    border-top: 1px solid var(--gtp-border);
    border-radius: 0;
    box-shadow: none;
    padding-top: 4px;
}

/* Wochenplan im Kind-Dialog: kompakt Mo–Fr in einer Zeile je Tag */
.dlg-week-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dlg-day-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 6px;
    align-items: center;
    min-width: 0;
}

.dlg-day-label {
    display: block;
    font-size: .78rem;
    font-weight: 700;
    color: var(--gtp-text-muted);
    text-align: right;
}

.dlg-day-field {
    position: relative;
    display: flex;
    align-items: stretch;
    min-width: 0;
}

.cell-editor.dlg-day-editor {
    flex: 1 1 auto;
    flex-wrap: wrap;
    overflow: visible;
    border: 1px solid var(--gtp-border);
    border-radius: 6px;
    padding: 3px 6px;
    min-height: 30px;
    background: #fff;
    gap: 3px;
    padding-right: 6px;
}

.dlg-day-row:has(.copy-down-btn) .cell-editor.dlg-day-editor {
    padding-right: 32px;
}

.cell-editor.dlg-day-editor:focus-within { border-color: var(--gtp-primary); }
.cell-editor.dlg-day-editor input { flex: 1 1 50px; min-width: 48px; border: none; outline: none; }

.copy-down-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--gtp-primary);
    cursor: pointer;
}

.copy-down-btn:hover {
    background: color-mix(in srgb, var(--gtp-primary) 14%, transparent);
    color: var(--gtp-primary-dark);
}

/* Vorschlagsliste: nach oben öffnen, damit der Modal-Scrollbalken nicht springt */
.dlg-day-editor .suggestions {
    top: auto;
    bottom: calc(100% + 4px);
    left: 0;
    right: auto;
    min-width: 100%;
    width: max(100%, 240px);
    max-width: min(320px, 70vw);
    max-height: 180px;
}

/* Online-Code-Badge im Kind-Dialog (Desktop: QR-Badge, Klick öffnet Online-Ansicht) */
.online-code-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--gtp-primary);
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 5px 10px;
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .03em;
    cursor: pointer;
    margin-top: 4px;
}

.online-code-badge:hover { background: var(--gtp-primary-dark); }

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 2px;
    flex-shrink: 1;
    min-width: 0;
}

.modal-header-actions:empty { display: none; }

.modal-header-actions .online-code-badge {
    margin-top: 0;
    padding: 4px 9px;
    font-size: .78rem;
    max-width: 280px;
}

.modal-header-actions .online-code-badge span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Kennzeichen-Karten (Sonderpäd., Buskind) im Kind-Dialog – eine Zeile, Toggles auf gleicher Höhe */
.flag-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0;
    align-items: stretch;
}

.flag-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: #FAFAFA;
    border: 1px solid var(--gtp-border);
    border-radius: var(--gtp-radius);
    min-width: 0;
    min-height: 40px;
}

.flag-item-inline {
    flex-direction: row;
    align-items: center;
}

.flag-item .gtp-switch {
    flex-direction: row !important;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    width: auto;
    margin: 0;
}

.flag-bus-info {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
}

.flag-bus-info:disabled {
    opacity: .55;
    background: #F0F2F5;
    cursor: not-allowed;
}

@media (max-width: 720px) {
    .flag-row { grid-template-columns: 1fr; }
}

.suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 30;
    background: #fff;
    border: 1px solid var(--gtp-border);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(16, 42, 67, .18);
    min-width: 240px;
    max-height: 240px;
    overflow: auto;
    padding: 4px;
}

.suggestion {
    padding: 5px 8px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 9px;
    font-size: .84rem;
    white-space: nowrap;
}

.suggestion > strong {
    background: var(--gtp-primary-light);
    color: var(--gtp-primary-dark);
    border-radius: 4px;
    padding: 0 6px;
    font-size: .75rem;
    line-height: 1.5;
    flex-shrink: 0;
}

.suggestion:hover, .suggestion.active { background: var(--gtp-primary-light); }
.suggestion .sug-detail { color: var(--gtp-text-muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; }
.suggestion.full { color: var(--gtp-danger); }

/* Wochenplan im Kind-Dialog: Vorschläge nur bei Fokus.
   display:none (nicht visibility/opacity) – sonst kann der Klick vor dem
   onmousedown verloren gehen, weil die Liste schon „unsichtbar“ war. */
.dlg-day-editor .suggestions { display: none; }
.dlg-day-editor:focus-within .suggestions { display: block; }

.inline-edit input { width: 100%; padding: 3px 6px; font-size: .85rem; }

/* Badges */
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: .75rem; font-weight: 600; }
.badge-info { background: var(--gtp-primary-light); color: var(--gtp-primary-dark); }
.badge-success { background: #e6f4e6; color: var(--gtp-success); }
.row-unmatched { opacity: .55; }
.badge-muted { background: #eef1f5; color: var(--gtp-text-muted); }
.badge-danger { background: #fdecea; color: var(--gtp-danger); }
.badge-warn { background: var(--gtp-warning-bg); color: #9a6b00; }

.row-actions { white-space: nowrap; text-align: right; }
.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: .95rem;
    padding: 3px 5px;
    border-radius: 4px;
    opacity: .55;
    color: var(--gtp-text);
    display: inline-flex;
    align-items: center;
}
.icon-btn:hover { opacity: 1; background: var(--gtp-primary-light); color: var(--gtp-primary-dark); }
.icon-btn-danger:hover { background: #fdecea; color: var(--gtp-danger); }

/* ===== SVG-Icons ===== */
.gtp-icon { vertical-align: -.15em; flex-shrink: 0; }
.btn .gtp-icon, .gtp-tab .gtp-icon, h2 .gtp-icon { margin-right: 2px; }
.btn { display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
h2 .gtp-icon { color: var(--gtp-primary); vertical-align: -.12em; }

/* ===== Suchfeld mit Icon (+ optional ✕, Platz immer reserviert) ===== */
.search-box {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.search-box > .gtp-icon:first-child {
    position: absolute;
    left: 9px;
    color: var(--gtp-text-muted);
    pointer-events: none;
    z-index: 1;
}
.search-box input {
    padding: 7px 34px 7px 30px;
    width: 100%;
    box-sizing: border-box;
}
.search-box-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--gtp-text-muted);
    cursor: pointer;
}
.search-box-clear:hover {
    background: var(--gtp-primary-light, rgba(31, 111, 178, .12));
    color: var(--gtp-text);
}

/* ===== Dropdown-Menüs (Drucken, Spalten) ===== */
.dropdown { position: relative; display: inline-block; }
.dropdown .chevron { opacity: .6; margin-left: 2px; }
.dropdown-overlay { position: fixed; inset: 0; z-index: 40; }
.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 50;
    background: var(--gtp-surface);
    border: 1px solid var(--gtp-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(16, 42, 67, .16);
    min-width: 230px;
    width: max-content;
    max-width: min(420px, calc(100vw - 16px));
    padding: 5px;
    display: flex;
    flex-direction: column;
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    font: inherit;
    font-size: .86rem;
    padding: 7px 10px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--gtp-text);
    white-space: nowrap;
}
.dropdown-item:hover { background: var(--gtp-primary-light); color: var(--gtp-primary-dark); }
.dropdown-item.is-selected {
    background: var(--gtp-primary-light);
    color: var(--gtp-primary-dark);
    font-weight: 600;
}
.dropdown-item .gtp-icon { color: var(--gtp-text-muted); flex-shrink: 0; }
.dropdown-item:hover .gtp-icon,
.dropdown-item.is-selected .gtp-icon { color: var(--gtp-primary-dark); }
/* Semantik wie Desktop: Grün = Online, Blau = Info/Tageswahl – bleibt auch beim Hover */
.dropdown-item .gtp-icon.icon-green,
.dropdown-item:hover .gtp-icon.icon-green,
.dropdown-item.is-selected .gtp-icon.icon-green { color: var(--gtp-success) !important; }
.dropdown-item .gtp-icon.icon-blue,
.dropdown-item:hover .gtp-icon.icon-blue,
.dropdown-item.is-selected .gtp-icon.icon-blue { color: var(--gtp-info) !important; }
.dropdown-item .gtp-icon.icon-orange,
.dropdown-item:hover .gtp-icon.icon-orange,
.dropdown-item.is-selected .gtp-icon.icon-orange { color: var(--gtp-warning) !important; }
.dropdown-item .gtp-icon.icon-purple,
.dropdown-item:hover .gtp-icon.icon-purple,
.dropdown-item.is-selected .gtp-icon.icon-purple { color: #7370E3 !important; }
.dropdown-item .gtp-icon.icon-red,
.dropdown-item:hover .gtp-icon.icon-red,
.dropdown-item.is-selected .gtp-icon.icon-red { color: var(--gtp-danger) !important; }
.dropdown-divider { height: 1px; background: var(--gtp-border); margin: 4px 6px; }
.dropdown-menu-left { left: 0; right: auto; }

/* Editierbare Combobox (Autocomplete) – ersetzt lange native <select>-Listen */
.gtp-combobox {
    position: relative;
    display: inline-block;
    width: 220px;
    max-width: 100%;
    vertical-align: middle;
    box-sizing: border-box;
}
.gtp-combobox-input {
    width: 100%;
    box-sizing: border-box;
    /* rechts immer Platz für ✕ + Chevron – sonst springt die Breite */
    padding: 7px 48px 7px 10px;
    font: inherit;
    font-size: .86rem;
    color: var(--gtp-text);
    background: var(--gtp-surface);
    border: 1px solid var(--gtp-border);
    border-radius: 6px;
    outline: none;
    position: relative;
    z-index: 45;
    transition: border-color .12s ease, box-shadow .12s ease;
    text-overflow: ellipsis;
}
.gtp-combobox-input:focus,
.gtp-combobox.open .gtp-combobox-input {
    border-color: var(--gtp-primary, #1F6FB2);
    box-shadow: 0 0 0 3px var(--gtp-primary-light, rgba(31, 111, 178, .15));
}
.gtp-combobox-clear {
    position: absolute;
    right: 26px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 46;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--gtp-text-muted);
    cursor: pointer;
}
.gtp-combobox-clear:hover {
    background: var(--gtp-primary-light, rgba(31, 111, 178, .12));
    color: var(--gtp-text);
}
.gtp-combobox-chevron {
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gtp-text-muted);
    pointer-events: none;
    z-index: 45;
    transition: transform .15s ease;
}
.gtp-combobox.open .gtp-combobox-chevron { transform: translateY(-50%) rotate(180deg); }
.gtp-combobox-overlay { position: fixed; inset: 0; z-index: 40; }
.gtp-combobox-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 50;
    min-width: 100%;
    max-height: 280px;
    overflow-y: auto;
    background: var(--gtp-surface);
    border: 1px solid var(--gtp-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(16, 42, 67, .16);
    padding: 5px;
}
.gtp-combobox-option {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: .86rem;
    color: var(--gtp-text);
    white-space: normal;
}
.gtp-combobox-opt-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.gtp-combobox-opt-text {
    font-weight: 700;
    line-height: 1.3;
}
.gtp-combobox-opt-detail {
    font-size: .78rem;
    font-weight: 400;
    color: var(--gtp-text-muted);
    line-height: 1.3;
}
.gtp-combobox-option.highlighted,
.gtp-combobox-option:hover {
    background: var(--gtp-primary-light);
    color: var(--gtp-primary-dark, #14497a);
}
.gtp-combobox-opt-icon { display: inline-flex; }
.gtp-combobox-empty { padding: 10px 12px; font-size: .82rem; color: var(--gtp-text-muted); }
.gtp-combobox-filter { width: 180px; }

/* In Dialogen: Comboboxen füllen die Label-/Zeilenbreite (Massenbearbeitung A/B usw.) */
.modal-body .form-row > label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1 1 240px;
}
.modal-body .form-row > label .field-hint {
    font-size: .78rem;
    color: var(--gtp-text-muted);
    line-height: 1.3;
}
/* ToggleSwitch ist selbst ein <label>: nicht als Spalten-Feld strecken */
.modal-body .form-row > label.gtp-switch {
    flex-direction: row;
    align-items: center;
    flex: 0 1 auto;
    gap: 10px;
}
.modal-body .gtp-combobox:not(.gtp-combobox-filter),
.modal-body .form-row > label .gtp-combobox:not(.gtp-combobox-filter) {
    display: block !important;
    width: 100% !important;
    max-width: 100%;
}
.modal-body .gtp-combobox:not(.gtp-combobox-filter) .gtp-combobox-menu {
    min-width: 100%;
    width: 100%;
    max-width: none;
}
.modal-body .gtp-combobox-option {
    white-space: normal;
}

/* Farbige Ribbon-Icons wie im Desktop (Online grün/blau, Warnungen orange/rot) */
.icon-green { color: var(--gtp-success) !important; }
.icon-orange { color: var(--gtp-warning) !important; }
.icon-red { color: var(--gtp-danger) !important; }
.icon-purple { color: #7370E3 !important; }
.icon-blue { color: var(--gtp-info) !important; }

/* ===== Klassen-Restriktion (Chips) ===== */
.class-restriction { margin-top: 10px; }
.field-label { font-size: .85rem; font-weight: 500; display: block; margin-bottom: 6px; }
.class-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.class-chip {
    flex-direction: row;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--gtp-border);
    border-radius: 14px;
    padding: 3px 10px;
    font-size: .82rem;
    font-weight: 500;
    cursor: pointer;
    background: var(--gtp-surface);
    user-select: none;
}
.class-chip input { accent-color: var(--gtp-primary); margin: 0; }
.class-chip:hover { border-color: var(--gtp-primary); }
.class-chip.selected {
    background: var(--gtp-primary-light);
    border-color: var(--gtp-primary);
    color: var(--gtp-primary-dark);
}

/* ===== Bus-Kennzeichnung ===== */
.bus-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .8rem;
    color: var(--gtp-primary-dark);
    background: var(--gtp-primary-light);
    border-radius: 4px;
    padding: 1px 7px;
    white-space: nowrap;
}

.btn-success { color: var(--gtp-success); border-color: var(--gtp-success); background: #e6f4e6; }
.btn-success:hover { background: #d5ecd5; border-color: var(--gtp-success); }

textarea { resize: vertical; min-height: 60px; }

button:focus-visible, a:focus-visible {
    outline: 2px solid var(--gtp-primary);
    outline-offset: 1px;
}

/* ===== Karten / Kacheln ===== */
.card {
    background: var(--gtp-surface);
    border: 1px solid var(--gtp-border);
    border-radius: var(--gtp-radius);
    box-shadow: var(--gtp-shadow);
    padding: 16px;
}
.card.card-selected {
    border-color: var(--gtp-primary);
    box-shadow: 0 0 0 2px var(--gtp-primary-light), var(--gtp-shadow);
}

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }

.stat-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin: 22px 0 28px;
}
.stat-tile {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 1px solid var(--gtp-border);
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(16, 42, 67, .08);
    padding: 18px 20px 18px 18px;
    min-height: 92px;
    position: relative;
    overflow: hidden;
}
.stat-tile::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 5px;
    background: var(--gtp-primary);
}
.stat-tile.stat-tile-green::before { background: #2FB25E; }
.stat-tile.stat-tile-purple::before { background: #8E44AD; }
.stat-tile.stat-tile-amber::before { background: #E89406; }
.stat-tile.stat-tile-teal::before { background: #0D9488; }
.stat-tile.stat-tile-rose::before { background: #DB2777; }
.stat-tile.stat-tile-red::before { background: #DC2626; }
.stat-tile-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    background: var(--gtp-primary-light);
    color: var(--gtp-primary-dark);
}
.stat-tile.stat-tile-green .stat-tile-icon { background: #E6F6EC; color: #1E9E50; }
.stat-tile.stat-tile-purple .stat-tile-icon { background: #F3E9F8; color: #6C3483; }
.stat-tile.stat-tile-amber .stat-tile-icon { background: #FFF4E0; color: #B7791B; }
.stat-tile.stat-tile-teal .stat-tile-icon { background: #E6F7F5; color: #0F766E; }
.stat-tile.stat-tile-rose .stat-tile-icon { background: #FCE7F3; color: #BE185D; }
.stat-tile.stat-tile-red .stat-tile-icon { background: #FEE2E2; color: #B91C1C; }
.stat-tile-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-tile .stat-value { font-size: 1.85rem; font-weight: 700; color: var(--gtp-text); line-height: 1.15; }
.stat-tile .stat-label { font-size: .82rem; color: var(--gtp-text-muted); line-height: 1.25; }

/* Berichte: Abschnitt-Köpfe wie Desktop */
.report-section-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--gtp-surface);
    border: 1px solid var(--gtp-border);
    border-radius: 8px;
    padding: 14px 16px;
    margin: 8px 0 16px;
}
.report-section-head h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}
.report-section-head p { margin: 4px 0 0; }
.report-section-icon { color: #0078D4; flex-shrink: 0; margin-top: 2px; }

.report-type-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
@media (max-width: 900px) {
    .report-type-grid { grid-template-columns: 1fr; }
}
.report-type-card { margin: 0; }
.report-type-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    font-size: 1rem;
    font-weight: 600;
}
.report-type-learntime .report-type-title { color: #4CAF50; }
.report-type-learntime .report-type-title .gtp-icon { color: #4CAF50; }
.report-type-ag .report-type-title { color: #FF9800; }
.report-type-ag .report-type-title .gtp-icon { color: #FF9800; }
.report-type-lunch .report-type-title { color: #E91E63; }
.report-type-lunch .report-type-title .gtp-icon { color: #E91E63; }
.report-type-group .report-type-title { color: #2196F3; }
.report-type-group .report-type-title .gtp-icon { color: #2196F3; }
.report-type-table th,
.report-type-table td { white-space: nowrap; }
.report-type-table th:first-child,
.report-type-table td:first-child { white-space: normal; min-width: 140px; }
.text-center { text-align: center; }

.report-table-grow {
    max-height: none !important;
    overflow: visible !important;
    flex: none !important;
}

.report-class-legend-grid {
    grid-template-columns: 1.4fr 1fr;
    align-items: start;
    margin-bottom: 16px;
}
@media (max-width: 1000px) {
    .report-class-legend-grid { grid-template-columns: 1fr; }
}
.gtp-grid tr.row-grade td {
    background: #F0F0F0;
    font-weight: 600;
}
.gtp-grid tr.row-class td:first-child {
    padding-left: 1.5rem;
}
.report-legend-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.report-legend-list li {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: .86rem;
    color: var(--gtp-text-muted);
}
.report-legend-list strong { display: inline; margin-right: 4px; }
.report-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}
.report-legend-sep {
    border: none;
    border-top: 1px solid var(--gtp-border);
    margin: 14px 0;
}
.report-legend-print li { display: block; }

/* Berichte: Diagramm-Box */
.chart-box { position: relative; width: 100%; height: 320px; }
.report-subhead { font-size: .95rem; font-weight: 600; color: var(--gtp-text); margin: 14px 0 4px; }
.report-subhead:first-of-type { margin-top: 0; }

.report-card-wide { width: 100%; margin-bottom: 16px; }
.report-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.report-card-head h2 { margin: 0; }
.report-occupancy-table { width: 100%; }
.report-occupancy-table .gtp-grid { width: 100%; table-layout: auto; }
.report-occupancy-table .gtp-grid th:last-child,
.report-occupancy-table .gtp-grid td:last-child { min-width: 220px; }

.occupancy-meter {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
}
.occupancy-meter-track {
    flex: 1 1 auto;
    min-width: 80px;
    height: 12px;
    border-radius: 999px;
    background: #E8EEF4;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(16, 42, 67, .08);
}
.occupancy-meter-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    min-width: 0;
    transition: width .25s ease;
    background: linear-gradient(90deg, #5BB8E8, #2E9DE6);
}
.occupancy-meter-fill.is-low { background: linear-gradient(90deg, #6BCB8A, #2FB25E); }
.occupancy-meter-fill.is-mid { background: linear-gradient(90deg, #5BB8E8, #2E9DE6); }
.occupancy-meter-fill.is-high { background: linear-gradient(90deg, #F0C14A, #E89406); }
.occupancy-meter-fill.is-full { background: linear-gradient(90deg, #F0A04A, #E07A00); }
.occupancy-meter-fill.is-over { background: linear-gradient(90deg, #F07171, #D32F2F); }
.occupancy-meter-fill.is-open {
    background: repeating-linear-gradient(
        -45deg,
        #D5DEE7,
        #D5DEE7 6px,
        #E8EEF4 6px,
        #E8EEF4 12px
    );
    opacity: .85;
}
.occupancy-meter-label {
    flex: 0 0 auto;
    font-size: .82rem;
    font-weight: 600;
    color: var(--gtp-text);
    font-variant-numeric: tabular-nums;
    min-width: 3.6rem;
    text-align: right;
}
.occupancy-meter-open .occupancy-meter-label { color: var(--gtp-text-muted); font-weight: 500; }

.gtp-grid .text-right { text-align: right; }
.gtp-grid tr.row-total td {
    background: var(--gtp-primary-light, #E8F1F8);
    font-weight: 600;
}

/* Desktop-Umstieg: Analyse-Zusammenfassung (Vertrauen + Transparenz) */
.import-summary {
    border: 1px solid var(--gtp-border);
    border-radius: 12px;
    background: #FBFCFD;
    overflow: hidden;
    margin-top: 10px;
}
.import-summary-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--gtp-primary-light), #fff);
    border-bottom: 1px solid var(--gtp-border);
}
.import-summary-head .gtp-icon { color: var(--gtp-primary-dark); flex-shrink: 0; }
.import-summary-title { font-size: 1.05rem; font-weight: 700; color: var(--gtp-text); }
.import-summary-sub { font-size: .82rem; color: var(--gtp-text-muted); margin-top: 2px; }
.import-stats {
    display: grid;
    /* auto-fit (nicht auto-fill): leere Spuren kollabieren – sonst bleibt rechts eine leere graue Zelle */
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1px;
    background: var(--gtp-border);
    margin: 1px;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
}
.import-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #fff;
    font-size: .9rem;
}
.import-stat .gtp-icon { color: var(--gtp-primary); flex-shrink: 0; }
.import-stat strong { font-size: 1.15rem; color: var(--gtp-text); margin-right: 2px; }

/* ===== Modal (Dialoge im Desktop-Look: Icon-Kopfzeile, weiche Schatten, Animation) ===== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(13, 28, 44, .44);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
    animation: gtp-fade-in .16s ease-out;
}

.modal-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(9, 30, 50, .30), 0 4px 16px rgba(9, 30, 50, .14);
    width: 100%;
    max-width: 560px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    outline: none;
    animation: gtp-modal-pop .22s cubic-bezier(.2, .9, .3, 1.12);
}

.modal-card.modal-wide { max-width: 980px; }
.modal-card.modal-xl {
    max-width: min(1200px, 96vw);
    width: 96vw;
}
.modal-card.modal-footer-split .modal-footer {
    justify-content: flex-start;
}
.modal-card.modal-footer-split .modal-footer > :first-child { margin-right: auto; }

/* ===== Tageswahl ansehen (Desktop-Parität: Mo–Fr-Wochenplan) ===== */
.daily-sel-intro {
    font-size: .88rem;
    color: var(--gtp-text-muted);
    margin: 0 0 12px;
    line-height: 1.45;
}
.daily-sel-error {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
    border-radius: 8px;
    background: #FFEBEE;
    border: 1px solid #EF9A9A;
    color: #C62828;
}
.daily-sel-error .gtp-icon { flex-shrink: 0; margin-top: 2px; color: var(--gtp-danger); }
.daily-sel-error-text { flex: 1; font-size: .9rem; line-height: 1.45; white-space: pre-line; }
.daily-sel-error .btn-danger { flex-shrink: 0; align-self: center; }
.daily-sel-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    align-items: center;
    padding: 12px 14px;
    margin-bottom: 12px;
    border: 1px solid var(--gtp-border);
    border-radius: 8px;
    background: #fff;
    font-size: .86rem;
}
.daily-sel-stat { display: inline-flex; align-items: center; gap: 6px; color: var(--gtp-text); }
.daily-sel-stat strong { font-weight: 700; }
.daily-sel-stat .text-success { color: var(--gtp-success, #43A047); }
.daily-sel-stat .text-info { color: var(--gtp-primary); }
.daily-sel-stat .text-warn { color: #FF9800; }
.daily-sel-stat-muted { color: var(--gtp-text-muted); font-size: .82rem; }
.daily-sel-sep {
    width: 1px;
    height: 18px;
    background: var(--gtp-border);
}
.daily-sel-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    border: 1px solid var(--gtp-border);
    border-radius: 8px;
    overflow: auto;
    min-height: 220px;
    max-height: min(58vh, 640px);
    background: var(--gtp-border);
    align-items: start;
}
.daily-sel-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #fff;
}
.daily-sel-col + .daily-sel-col { border-left: 1px solid var(--gtp-border); }
.daily-sel-day-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    background: var(--gtp-primary);
    color: #fff;
    font-weight: 700;
    font-size: .9rem;
    position: sticky;
    top: 0;
    z-index: 1;
}
.daily-sel-day-head.is-today { background: var(--gtp-primary-dark, #1565C0); }
.daily-sel-day-body {
    padding: 8px;
    flex: 1;
    min-height: 180px;
    background: #fff;
}
.daily-sel-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 8px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #F0F4F8;
}
.daily-sel-item:last-child { border-bottom: none; margin-bottom: 0; }
.daily-sel-name {
    font-weight: 700;
    font-size: .84rem;
    color: var(--gtp-primary-dark, var(--gtp-primary));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.daily-sel-detail {
    grid-column: 1 / -1;
    font-size: .8rem;
    color: var(--gtp-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.daily-sel-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    padding: 3px 8px;
    border-radius: 4px;
    color: #fff;
    font-weight: 700;
    font-size: .78rem;
    cursor: default;
}
.daily-sel-badge-0 { background: #9E9E9E; }
.daily-sel-badge-low { background: #FF9800; }
.daily-sel-badge-mid { background: #43A047; }
.daily-sel-badge-high { background: #2196F3; }
.daily-sel-badge-full { background: #D32F2F; }

@media (max-width: 900px) {
    .daily-sel-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        background: transparent;
        border: none;
    }
    .daily-sel-col + .daily-sel-col { border-left: none; }
    .daily-sel-col {
        border: 1px solid var(--gtp-border);
        border-radius: 8px;
        overflow: hidden;
    }
}

/* ===== PDF-Druckvorschau (Desktop-ähnliches Modal) ===== */
.pdf-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(13, 28, 44, .52);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 220;
    padding: 16px;
    animation: gtp-fade-in .16s ease-out;
}

.pdf-modal {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 28px 80px rgba(9, 30, 50, .34), 0 4px 16px rgba(9, 30, 50, .16);
    width: min(1180px, 96vw);
    height: min(92vh, 960px);
    max-width: 96vw;
    max-height: 96vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    outline: none;
    animation: gtp-modal-pop .22s cubic-bezier(.2, .9, .3, 1.12);
    transition: width .18s ease, height .18s ease, max-width .18s ease, max-height .18s ease, border-radius .18s ease;
}

.pdf-modal.pdf-modal-maximized {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
}

.pdf-backdrop.pdf-backdrop-maximized {
    padding: 0;
}

.pdf-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px 12px;
    border-bottom: 1px solid var(--gtp-border);
    background: linear-gradient(180deg, #FAFCFE, #fff);
    flex-shrink: 0;
}

.pdf-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
}

.pdf-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px 18px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--gtp-border);
    background: #F7FAFC;
    flex-shrink: 0;
}

.pdf-toolbar-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #fff;
    border: 1px solid var(--gtp-border);
    border-radius: 10px;
}

.pdf-page-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .88rem;
    color: var(--gtp-text);
    margin: 0 4px;
    white-space: nowrap;
}

.pdf-page-input {
    width: 52px;
    height: 32px;
    text-align: center;
    border: 1px solid var(--gtp-border);
    border-radius: 6px;
    font-size: .95rem;
    font-weight: 600;
}

.pdf-zoom-label {
    min-width: 52px;
    text-align: center;
    font-size: .88rem;
    font-weight: 650;
    color: var(--gtp-text);
    user-select: none;
}

.pdf-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    /* safe center: bei Übergröße (Zoom) oben/links ausrichten,
       damit man zur abgeschnittenen Seite hoch/seitlich scrollen kann */
    display: flex;
    align-items: safe center;
    justify-content: safe center;
    background:
        linear-gradient(180deg, #E8EEF4 0%, #F3F6F9 100%);
    position: relative;
    padding: 16px;
}

.pdf-canvas {
    display: none;
    /* Kein max-width: Zoom soll die echte Pixelgröße behalten */
    flex: 0 0 auto;
    background: #fff;
    box-shadow: 0 8px 28px rgba(16, 42, 67, .18);
    border-radius: 2px;
}

.pdf-canvas.is-visible { display: block; }

/* Fallback, falls "safe" nicht unterstützt wird: Wrapper zentriert per margin,
   der Scroll-Container selbst startet oben links */
@supports not (justify-content: safe center) {
    .pdf-body {
        display: block;
        text-align: center;
    }
    .pdf-canvas.is-visible {
        display: inline-block;
        vertical-align: top;
        margin: 0 auto;
    }
}

.pdf-loading, .pdf-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--gtp-text-muted);
    font-weight: 600;
    font-size: .95rem;
    padding: 40px 24px;
    text-align: center;
}

.pdf-error { color: var(--gtp-danger); }

.pdf-js-loading .nav-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(46, 157, 230, .2);
    border-top-color: var(--gtp-primary);
    border-radius: 50%;
    animation: batch-spin .85s linear infinite;
}

.pdf-backdrop .modal-close {
    font-size: 1.25rem;
    line-height: 1;
}

.pdf-backdrop .pdf-js-maximize {
    font-size: 1.05rem;
    color: var(--gtp-text-muted);
}

.pdf-backdrop .pdf-js-maximize:hover {
    background: var(--gtp-primary-light, #E8F4FC);
    color: var(--gtp-primary-dark, #1a6fa3);
}

@media (max-width: 720px) {
    .pdf-modal { width: 100%; height: 96vh; border-radius: 12px; }
    .pdf-toolbar { justify-content: stretch; }
    .pdf-toolbar-group { flex: 1 1 auto; justify-content: center; }
}

@keyframes gtp-fade-in { from { opacity: 0; } }
@keyframes gtp-modal-pop { from { opacity: 0; transform: translateY(16px) scale(.965); } }

@media (prefers-reduced-motion: reduce) {
    .modal-backdrop, .modal-card { animation: none; }
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px 13px;
    border-bottom: 1px solid var(--gtp-border);
    background: linear-gradient(180deg, #FAFCFE, #fff);
    flex-shrink: 0;
}

/* Rundes Icon wie Desktop-Dialogköpfe (48px Kreis) */
.modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--gtp-primary-light);
    color: var(--gtp-primary-dark);
}

.modal-icon-danger { background: #FDECEA; color: #C0392B; }
.modal-icon-success { background: #E6F4E6; color: #2E7D32; }
.modal-icon-warning { background: #FFF3CD; color: #856404; }
.modal-icon-info { background: #E3F2FD; color: #1976D2; }

.modal-heading { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.modal-title { font-weight: 650; font-size: 1.15rem; color: var(--gtp-text); }
.modal-subtitle { font-size: .85rem; color: var(--gtp-text-muted); }

.modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    background: none;
    color: var(--gtp-text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: background .12s ease, color .12s ease;
}

.modal-close:hover { background: #FDECEA; color: var(--gtp-danger); }

.modal-body {
    padding: 16px 20px 18px;
    overflow-x: hidden;
    overflow-y: auto;
    /* Platz für Scrollbar immer reservieren – sonst springt das Layout,
       wenn z. B. die Angebots-Vorschlagsliste den Scrollbalken auslöst. */
    scrollbar-gutter: stable;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1 1 auto;
    min-height: 0;
}

.modal-body:has(.student-dialog) {
    gap: 0;
    padding: 12px 16px 14px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 13px 20px;
    border-top: 1px solid var(--gtp-border);
    background: #F7FAFC;
    flex-shrink: 0;
}

/* Buttons in Dialog-Footern: etwas kräftiger, mit sanftem Druck-Effekt */
.modal-footer .btn { min-width: 96px; font-weight: 500; transition: background .12s ease, border-color .12s ease, transform .06s ease, box-shadow .12s ease; }
.modal-footer .btn:active { transform: translateY(1px); }
.modal-footer .btn-primary { box-shadow: 0 2px 8px rgba(46, 157, 230, .35); }
.modal-footer .btn-danger { color: #fff; background: var(--gtp-danger); border-color: var(--gtp-danger); box-shadow: 0 2px 8px rgba(244, 67, 54, .30); }
.modal-footer .btn-danger:hover { background: #D32F2F; border-color: #D32F2F; color: #fff; }
.modal-footer .btn-danger:disabled { color: #fff; }

/* ===== Toggle-Switch (wie RadToggleSwitchButton der Desktop-Dialoge) ===== */
.gtp-switch {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-weight: 400;
}

.gtp-switch input { position: absolute; opacity: 0; pointer-events: none; }

.gtp-switch-track {
    position: relative;
    width: 38px;
    height: 21px;
    border-radius: 11px;
    background: #C4CFD8;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .10);
    transition: background .18s ease;
    flex-shrink: 0;
}

.gtp-switch-thumb {
    position: absolute;
    top: 2.5px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .30);
    transition: left .18s cubic-bezier(.2, .9, .3, 1.2);
}

.gtp-switch input:checked + .gtp-switch-track { background: var(--gtp-primary); }
.gtp-switch input:checked + .gtp-switch-track .gtp-switch-thumb { left: 19px; }
.gtp-switch input:focus-visible + .gtp-switch-track { outline: 2px solid var(--gtp-primary); outline-offset: 2px; }
.gtp-switch:hover .gtp-switch-track { box-shadow: inset 0 1px 2px rgba(0, 0, 0, .10), 0 0 0 3px var(--gtp-primary-light); }
.gtp-switch.disabled { opacity: .55; cursor: default; }
.gtp-switch.disabled:hover .gtp-switch-track { box-shadow: inset 0 1px 2px rgba(0, 0, 0, .10); }
.gtp-switch-label { font-size: .9rem; }

/* ===== Auswahllisten in Dialogen (Druckauswahl – Desktop: SelectStudents/ClassesDialog) ===== */
input[type="checkbox"], input[type="radio"] { accent-color: var(--gtp-primary); }

.pick-lead {
    margin: 0 0 14px;
    font-size: 1rem;
    color: var(--gtp-text);
    line-height: 1.45;
}
.pick-mark-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}
.pick-mark-btn {
    width: 100%;
    justify-content: center;
    padding: 10px 12px;
    border-radius: 8px;
    font-weight: 500;
}
.pick-filter-label {
    display: block;
    margin: 0 0 8px;
    font-size: .9rem;
    color: var(--gtp-text-muted);
}

.pick-list {
    /* Feste Höhe (Size-Varianten): leere Trefferliste darf den Dialog nicht schrumpfen */
    --pick-list-h: 280px;
    height: var(--pick-list-h);
    min-height: var(--pick-list-h);
    max-height: var(--pick-list-h);
    overflow-y: auto;
    border: 1px solid var(--gtp-border);
    border-radius: 8px;
    background: var(--gtp-primary-light);
    background: color-mix(in srgb, var(--gtp-primary-light) 35%, #fff);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-sizing: border-box;
    margin-bottom: 4px;
}
.pick-list-sm { --pick-list-h: 220px; }
.pick-list-md { --pick-list-h: 280px; }
.pick-list-lg { --pick-list-h: 360px; }

.pick-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 400;
    font-size: .95rem;
    color: var(--gtp-text);
    transition: background .12s ease;
    white-space: nowrap;
}

.pick-row:hover { background: rgba(255, 255, 255, .85); }
.pick-row.selected {
    background: #fff;
    box-shadow: 0 0 0 1px var(--gtp-primary);
    font-weight: 500;
}

.pick-row input[type="checkbox"], .pick-row input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    flex-shrink: 0;
}

.pick-row .pick-side { margin-left: auto; flex-shrink: 0; }
.pick-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    color: var(--gtp-text-muted);
    font-size: .9rem;
    text-align: center;
}
.pick-count { font-size: .85rem; color: var(--gtp-text-muted); margin: 8px 2px 0; }
.pick-count strong { color: var(--gtp-primary-dark); }

/* Schlanke Scrollbar in Auswahllisten */
.pick-list::-webkit-scrollbar { width: 10px; }
.pick-list::-webkit-scrollbar-thumb { background: #C9D4DD; border-radius: 5px; border: 2px solid #FBFCFD; }
.pick-list::-webkit-scrollbar-thumb:hover { background: #AEBECB; }

/* Buttons im Dialog-Body nicht auf volle Breite strecken (Flex-Column-Stretch) */
.modal-body > .btn { align-self: flex-start; }

/* ===== Online-Ansicht: Auswahlkarten (wie Desktop OnlineViewChoiceDialog) ===== */
.online-choice-head { margin-bottom: 6px; }
.online-choice-title { display: block; font-size: 1.05rem; font-weight: 600; color: var(--gtp-text); margin-bottom: 3px; }
.online-choice-sub { font-size: .85rem; color: var(--gtp-text-muted); }
.online-choice-sub strong { color: var(--gtp-text); }

.choice-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
    text-align: left;
    background: #FBFCFD;
    border: 2px solid var(--gtp-border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-top: 10px;
    cursor: pointer;
    font: inherit;
    transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}
.choice-card:hover { border-color: var(--gtp-primary); background: #fff; box-shadow: 0 6px 18px rgba(16, 42, 67, .12); }
.choice-card:active { transform: translateY(1px); }

.choice-card-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.choice-card-icon-blue { background: var(--gtp-primary-light); color: var(--gtp-primary-dark); }
.choice-card-icon-green { background: #E8F5E9; color: #4CAF50; }

.choice-card-body { display: flex; flex-direction: column; min-width: 0; }
.choice-card-title { font-size: .95rem; font-weight: 600; color: var(--gtp-text); margin-bottom: 3px; }
.choice-card-desc { font-size: .82rem; color: var(--gtp-text-muted); line-height: 1.4; }

/* ===== Formular-Karte (strukturierte Eingabebereiche wie in Desktop-Dialogen) ===== */
.form-card {
    border: 1px solid var(--gtp-border);
    border-radius: 10px;
    background: #FBFCFD;
    padding: 14px 16px 16px;
    margin-top: 4px;
}
.form-card-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--gtp-text-muted);
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-bottom: 10px;
}
.form-card-title .gtp-icon { color: var(--gtp-primary); }
.form-card .form-row { margin-bottom: 10px; }
.form-card label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; color: var(--gtp-text); }
.form-card textarea { resize: vertical; }

/* ===== Emoji-Picker (Popup mit Suche und Kategorien) ===== */
.emoji-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border: 1px solid var(--gtp-border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font: inherit;
    transition: border-color .12s ease, box-shadow .12s ease;
}

.emoji-trigger:hover { border-color: var(--gtp-primary); box-shadow: 0 1px 5px rgba(46, 157, 230, .22); }
.emoji-trigger .emoji-current { font-size: 20px; line-height: 1; }

.emoji-backdrop {
    position: fixed;
    inset: 0;
    z-index: 150; /* über den Modal-Dialogen (100), unter Batch-Fortschritt (200) */
    background: rgba(13, 28, 44, .18);
}

.emoji-pop {
    position: fixed;
    z-index: 151;
    left: 50%;
    top: 12vh;
    transform: translateX(-50%);
    width: min(440px, 94vw);
    height: min(520px, 62vh);
    max-height: 62vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 22px 60px rgba(9, 30, 50, .30), 0 4px 14px rgba(9, 30, 50, .14);
    animation: gtp-modal-pop .18s ease;
    overflow: hidden;
}

.emoji-pop-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--gtp-border);
    background: linear-gradient(180deg, #FAFCFE, #fff);
    color: var(--gtp-text-muted);
    flex-shrink: 0;
}
.emoji-pop-head .search-box { flex: 1; min-width: 0; }
.emoji-pop-head .search-box input {
    border: 1px solid var(--gtp-border);
    border-radius: 6px;
    background: #fff;
    padding-top: 6px;
    padding-bottom: 6px;
}

.emoji-clear {
    border: 1px solid var(--gtp-border);
    border-radius: 6px;
    background: #fff;
    padding: 3px 9px;
    font-size: 12px;
    cursor: pointer;
    color: var(--gtp-text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.emoji-clear:hover { border-color: var(--gtp-danger); color: var(--gtp-danger); }

.emoji-pop-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 12px 12px;
}

.emoji-cat {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--gtp-text-muted);
    margin: 10px 2px 4px;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 2px;
}

.emoji-item {
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    font-size: 21px;
    line-height: 1;
    padding: 6px 0;
    cursor: pointer;
    transition: background .1s ease, transform .08s ease;
}

.emoji-item:hover { background: var(--gtp-primary-soft, #E8F4FD); transform: scale(1.15); }
.emoji-item.active { border-color: var(--gtp-primary); background: var(--gtp-primary-soft, #E8F4FD); }

.emoji-empty {
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 6px;
    color: var(--gtp-text-muted);
    text-align: center;
}

/* ===== Batch-Fortschritt (Tabellen-Ansicht: Status/Datensatz/Nachricht + Balken) ===== */
.batch-overlay {
    position: fixed;
    inset: 0;
    z-index: 200; /* über den Modal-Dialogen (z-index 100) */
    background: rgba(13, 28, 44, .42);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: gtp-fade-in .15s ease;
}

.batch-card-wide {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(9, 30, 50, .35);
    width: min(620px, calc(100vw - 32px));
    /* Feste Höhe: Dialog springt nicht, wenn Zeilen nach und nach dazukommen */
    height: min(520px, 86vh);
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: gtp-modal-pop .18s ease;
}

/* Kopf mit Titel + Untertitel */
.batch-head {
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--gtp-border);
    background: linear-gradient(180deg, #FAFCFE, #fff);
}
.batch-head-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--gtp-text);
}
.batch-head-icon { color: var(--gtp-primary); display: inline-flex; }
.batch-head-icon.done { color: #1E9E50; }
.batch-head-spinner { color: var(--gtp-primary); display: inline-flex; animation: batch-spin 1s linear infinite; }
.batch-head-sub { margin-top: 3px; margin-left: 30px; font-size: .82rem; color: var(--gtp-text-muted); }

/* Übersichts-Leiste (hellgelb/orange wie im Desktop) */
.batch-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    background: #FFF8E6;
    border-top: 2px solid #F5A623;
    border-bottom: 1px solid #F2DFA6;
    font-size: .84rem;
    color: #6B5A1E;
}
.batch-summary .gtp-icon { color: #E89406; flex-shrink: 0; }
.batch-summary b { color: #C77711; }

/* Tabelle: füllt den Platz zwischen Kopf und Fuß, scrollt bei vielen Zeilen */
.batch-table-wrap {
    overflow: auto;
    flex: 1 1 auto;
    min-height: 220px;
}
.batch-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}
.batch-table thead th {
    text-align: left;
    font-weight: 600;
    color: var(--gtp-text);
    background: #FBF4E8;
    border-bottom: 1px solid #F0E4C8;
    padding: 8px 12px;
    position: sticky;
    top: 0;
    z-index: 1;
}
.batch-table tbody tr { border-bottom: 1px solid #EEF2F6; }
.batch-table tbody tr:last-child { border-bottom: none; }
.batch-table td { padding: 8px 12px; vertical-align: middle; }
.batch-table .col-status { width: 56px; text-align: center; }
.batch-table .col-label { font-weight: 500; }
.batch-table .col-msg { color: var(--gtp-text-muted); }
.batch-table tr.is-busy .col-msg,
.batch-table tr.is-pending .col-msg { color: #B07A1E; font-style: italic; }
.batch-table tr.is-done .col-msg { color: #1E9E50; }
.batch-table tr.is-error .col-msg { color: var(--gtp-danger); font-weight: 500; }

.batch-row-icon { display: inline-flex; align-items: center; justify-content: center; }
.batch-row-icon.done { color: #1E9E50; }
.batch-row-icon.error { color: var(--gtp-danger); }
.batch-row-icon.busy { color: #E89406; animation: batch-pulse 1s ease-in-out infinite; }
.batch-row-icon.pending { color: #C9A24A; }

@keyframes batch-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes batch-spin { to { transform: rotate(360deg); } }

/* Fuß mit dickem Fortschrittsbalken */
.batch-foot {
    padding: 12px 20px 16px;
    border-top: 1px solid var(--gtp-border);
    background: #F7FAFC;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.batch-foot-text { font-weight: 600; font-size: .88rem; color: var(--gtp-text); }
.batch-foot-count { font-size: .78rem; color: var(--gtp-text-muted); }
.batch-foot-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.batch-close-btn { align-self: flex-end; margin-top: 8px; min-width: 120px; }
.batch-bar-thick {
    width: 100%;
    height: 14px;
    border-radius: 8px;
    background: #E2E8EE;
    overflow: hidden;
    margin-top: 2px;
}
.batch-bar-fill {
    height: 100%;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--gtp-primary), var(--gtp-primary-dark));
    transition: width .12s linear;
}
.batch-bar-fill.done { background: linear-gradient(90deg, #34C766, #1E9E50); }
.batch-bar-fill.error { background: linear-gradient(90deg, #F44336, #C62828); }
.batch-bar-fill.indeterminate {
    animation: batch-slide 1.1s ease-in-out infinite;
    width: 40% !important;
}

@keyframes batch-slide {
    0% { margin-left: -40%; }
    100% { margin-left: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .batch-bar-fill.indeterminate, .batch-row-icon.busy, .batch-head-spinner { animation-duration: 2s; }
}

/* ===== Massenbearbeitung: stabile Dialoghöhe beim Tab-Wechsel ===== */
.mass-edit-panel {
    height: 420px;
    min-height: 420px;
    max-height: 420px;
    overflow: hidden; /* kein Gesamt-Scroll – Listen scrollen selbst */
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.mass-edit-panel > .btn,
.mass-edit-panel > .mt-2 { align-self: flex-start; flex-shrink: 0; }

/* Wochenplan: zwei Spalten füllen die Höhe, Listen scrollen unabhängig */
.mass-edit-week {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.mass-edit-week-intro { margin: 0; flex-shrink: 0; }
.mass-edit-week-row {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    align-items: stretch;
}
.mass-edit-col {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.mass-edit-col > .field-label,
.mass-edit-col > .search-box,
.mass-edit-col > .pick-count { flex-shrink: 0; }
.mass-edit-pick {
    flex: 1 1 auto;
    min-height: 0 !important;
    height: auto !important; /* füllt Spalte im Massenbearbeitungs-Dialog */
    max-height: none !important;
    --pick-list-h: auto;
    overflow-x: hidden;
    overflow-y: auto;
}
.mass-edit-pick-top { margin-top: 4px; }
.mass-edit-week-actions {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding-top: 2px;
    border-top: 1px solid var(--gtp-border);
}

.mass-edit-table {
    flex: 1 1 auto;
    min-height: 140px;
    max-height: none !important;
    overflow: auto;
}
.mass-edit-hint { margin: 4px 0 0; flex-shrink: 0; }
.send-mail-panel { overflow-y: auto; } /* Vorschau-Liste darf im Panel scrollen */
.send-mail-panel .gtp-grid tr.row-muted td { color: var(--gtp-text-muted); }

/* ===== Segment-Tabs (Modus-Umschalter, z. B. Massenbearbeitung) ===== */
.seg-tabs {
    display: flex;
    gap: 4px;
    background: #EEF3F8;
    border: 1px solid var(--gtp-border);
    border-radius: 11px;
    padding: 4px;
    flex-shrink: 0;
}

.seg-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: none;
    background: transparent;
    color: var(--gtp-text-muted);
    font: inherit;
    font-size: .85rem;
    font-weight: 500;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .12s ease, color .12s ease, box-shadow .12s ease;
}

.seg-tab:hover { color: var(--gtp-primary-dark); }
.seg-tab.active {
    background: #fff;
    color: var(--gtp-primary-dark);
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(16, 42, 67, .16);
}
.seg-tab .gtp-icon { color: inherit; }

.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row > label { flex: 1; }
.form-row > label.full-width { flex-basis: 100%; }
.form-row > label.full-width textarea { width: 100%; }

/* ===== Options-Karten (z. B. Anzeigeoptionen der Online-Anmeldung) ===== */
.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 10px;
    margin: 8px 0 14px;
}

.option-card {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: #FAFAFA;
    border: 1px solid var(--gtp-border);
    border-radius: var(--gtp-radius);
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.option-card:hover {
    border-color: var(--gtp-primary);
    box-shadow: var(--gtp-shadow);
}

.option-card:has(input:checked) {
    border-color: var(--gtp-primary);
    background: var(--gtp-primary-light);
}

.option-card input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--gtp-primary);
}

.option-title {
    display: block;
    font-weight: 600;
    font-size: .85rem;
    color: var(--gtp-text);
}

.option-desc {
    display: block;
    font-size: .75rem;
    color: var(--gtp-text-muted);
    margin-top: 2px;
}

/* ===== App-Design: Theme-Auswahl (Desktop: "App-Design auswählen") ===== */
/* Farbeinstellungen für Ausdrucke (Desktop-Parität) */
.print-color-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 10px;
}
.print-color-table {
    display: grid;
    gap: 8px;
    max-width: 420px;
}
.print-color-table-head,
.print-color-table-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 10px;
    align-items: center;
}
.print-color-table-head {
    font-size: .8rem;
    font-weight: 600;
    color: var(--gtp-text-muted);
    text-align: center;
}
.print-color-table-head span:first-child { text-align: left; }
.print-color-table-row span { font-size: .9rem; }
.print-color-table-row input[type="color"],
.print-report-colors input[type="color"] {
    width: 100%;
    height: 36px;
    padding: 2px;
    border: 1px solid var(--gtp-border);
    border-radius: 6px;
    background: var(--gtp-surface);
    cursor: pointer;
}
.print-report-colors {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 20px;
    max-width: 520px;
}
.print-report-colors label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: .9rem;
}
@media (max-width: 560px) {
    .print-report-colors { grid-template-columns: 1fr; }
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}

.theme-swatch {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--gtp-surface);
    border: 1px solid var(--gtp-border);
    border-radius: var(--gtp-radius);
    cursor: pointer;
    font: inherit;
    font-size: .82rem;
    color: var(--gtp-text);
    text-align: left;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.theme-swatch:hover {
    border-color: var(--gtp-primary);
    box-shadow: var(--gtp-shadow);
}

.theme-swatch.active {
    border-color: var(--gtp-primary);
    background: var(--gtp-primary-light);
    font-weight: 600;
}

.theme-dots {
    display: inline-flex;
    gap: 3px;
    flex-shrink: 0;
}

.theme-dots > span {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, .12);
}

/* Hervorgehobene Synchronisieren-Leiste (Desktop: grüner Sync-Kasten) */
.sync-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    background: #E8F5E9;
    border: 1px solid var(--gtp-success);
    border-radius: var(--gtp-radius);
    margin-top: 4px;
}

.sync-bar .btn {
    flex-shrink: 0;
}

/* ===== Abholberechtigte / Wochenplan im Kind-Dialog ===== */
.student-dialog {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.student-dialog .form-row {
    gap: 8px;
}

.student-dialog .label-with-hint {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.student-dialog .field-hint-inline {
    font-size: .7rem;
    font-weight: 500;
    color: var(--gtp-text-muted);
}

.student-dialog-bottom {
    display: grid;
    grid-template-columns: minmax(220px, 0.85fr) minmax(280px, 1.2fr);
    gap: 10px;
    align-items: start;
    margin-top: 0;
}

.pickup-section,
.week-section {
    margin-top: 0;
    padding: 8px 10px;
    background: #FAFAFA;
    border: 1px solid var(--gtp-border);
    border-radius: var(--gtp-radius);
    min-width: 0;
}

.week-section {
    border-color: color-mix(in srgb, var(--gtp-primary) 35%, var(--gtp-border));
    background: color-mix(in srgb, var(--gtp-primary-light) 55%, #FAFAFA);
    overflow: visible;
    position: relative;
    z-index: 1;
}

.pickup-header,
.week-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 6px;
}

.pickup-header > span:first-child,
.week-header > span:not(.week-header-hint) {
    font-weight: 700;
    font-size: .9rem;
    color: var(--gtp-text);
}

.pickup-header-hint {
    font-size: .68rem;
    font-weight: 500;
    color: var(--gtp-text-muted);
    margin-right: auto;
}

.pickup-empty {
    font-size: .8rem;
    margin: 2px 0;
}

.week-header {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.week-header .gtp-icon {
    color: var(--gtp-primary);
    flex-shrink: 0;
}

.week-header-hint {
    margin-left: auto;
    font-size: .68rem;
    font-weight: 500;
    color: var(--gtp-text-muted);
    line-height: 1.2;
    max-width: 100%;
}

.student-dialog-bottom .pickup-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    grid-template-rows: auto auto;
    gap: 4px;
    align-items: center;
    margin-bottom: 6px;
}

.student-dialog-bottom .pickup-row input:nth-child(1) { grid-column: 1; grid-row: 1; }
.student-dialog-bottom .pickup-row input:nth-child(2) { grid-column: 2; grid-row: 1; }
.student-dialog-bottom .pickup-row input:nth-child(3) { grid-column: 1; grid-row: 2; }
.student-dialog-bottom .pickup-row input:nth-child(4) { grid-column: 2; grid-row: 2; }
.student-dialog-bottom .pickup-row .icon-btn {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
}

.pickup-row {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr 1.2fr auto;
    gap: 6px;
    align-items: center;
    margin-bottom: 6px;
}

.pickup-row input {
    width: 100%;
    min-width: 0;
}

@media (max-width: 900px) {
    .student-dialog-bottom {
        grid-template-columns: 1fr;
    }

    .student-dialog-bottom .pickup-row {
        grid-template-columns: 1.3fr 1fr 1fr 1.2fr auto;
        grid-template-rows: none;
    }

    .student-dialog-bottom .pickup-row input:nth-child(1),
    .student-dialog-bottom .pickup-row input:nth-child(2),
    .student-dialog-bottom .pickup-row input:nth-child(3),
    .student-dialog-bottom .pickup-row input:nth-child(4),
    .student-dialog-bottom .pickup-row .icon-btn {
        grid-column: auto;
        grid-row: auto;
    }
}

/* ===== EmptyLayout (Login / Registrierung): Datum unten ===== */
.empty-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.empty-layout-datebar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 32px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.92);
    border-top: 1px solid var(--gtp-border);
    color: var(--gtp-text-muted);
    font-size: .78rem;
    font-weight: 600;
}
.empty-layout-datebar .gtp-statusbar-date {
    text-transform: capitalize;
}

/* ===== Login (theme-aware: Farben folgen data-theme / localStorage) ===== */
.login-wrap {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(
        circle at 30% 20%,
        #FFFFFF 0%,
        var(--gtp-primary-light) 55%,
        color-mix(in srgb, var(--gtp-primary-light) 75%, var(--gtp-accent) 25%) 100%
    );
    padding: 20px;
}

/* ===== Navigations-Lade-Indikator (sanfter Reiter-Wechsel) ===== */
.nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 300; /* über allem (auch Modalen) */
    background: rgba(255, 255, 255, .62);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
}

.nav-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Dünne Top-Bar (unbestimmter Fortschritt) */
.nav-bar-top {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: rgba(46, 157, 230, .15);
    overflow: hidden;
    z-index: 301;
}
.nav-bar-fill {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, var(--gtp-primary), var(--gtp-primary-dark));
    animation: nav-slide 1.1s ease-in-out infinite;
}
@keyframes nav-slide {
    0% { left: -40%; }
    100% { left: 100%; }
}

/* Zentrale Spinner-Karte */
.nav-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(16, 42, 67, .22);
    padding: 28px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    min-width: 180px;
    animation: gtp-modal-pop .22s cubic-bezier(.2, .9, .3, 1.12);
}
.nav-spinner { color: var(--gtp-primary); }
.nav-spinner .gtp-icon { animation: batch-spin .85s linear infinite; }
@keyframes batch-spin { to { transform: rotate(360deg); } }
.nav-card-text { font-size: .95rem; font-weight: 650; color: var(--gtp-text); }

.login-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 18px 60px rgba(40, 50, 90, .22), 0 2px 8px rgba(40, 50, 90, .12);
    padding: 30px 34px 26px;
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-brand { display: flex; align-items: center; gap: 12px; text-align: left; margin-bottom: 22px; }
.login-brand-logo { width: 48px; height: 48px; flex-shrink: 0; }
.login-brand-text { display: flex; flex-direction: column; }
.login-brand-title { font-size: 1.2rem; font-weight: 700; color: var(--gtp-text); }
.login-brand-sub { font-size: .82rem; color: var(--gtp-text-muted); }

.login-logo { display: none; }
.login-card h1 { display: none; }
.login-sub { display: none; }

.login-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }

.login-field { display: flex; flex-direction: column; gap: 5px; }
.login-field-label { font-size: .8rem; font-weight: 600; color: var(--gtp-text); }
.login-field-input {
    display: flex; align-items: center; gap: 8px;
    border: 1px solid var(--gtp-border);
    border-radius: 9px;
    padding: 0 10px;
    background: #fff;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.login-field-input:focus-within {
    border-color: var(--gtp-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--gtp-primary) 20%, transparent);
}
.login-field-input .gtp-icon { color: var(--gtp-text-muted); flex-shrink: 0; }
.login-field-input input {
    border: none; outline: none; background: transparent;
    font: inherit; font-size: .9rem; padding: 9px 0; width: 100%; color: var(--gtp-text);
}
/* Browser-Autofill: Standard-Blau entfernen, weiß wie das Feld (füllt den Input vollständig) */
.login-field-input input:-webkit-autofill,
.login-field-input input:-webkit-autofill:hover,
.login-field-input input:-webkit-autofill:focus,
.login-field-input input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--gtp-text);
    caret-color: var(--gtp-text);
    box-shadow: inset 0 0 0 1000px #fff;
    transition: background-color 99999s ease-out;
}

.login-submit {
    font-size: .95rem;
    font-weight: 600;
    padding: 10px;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--gtp-primary) 35%, transparent);
}

.login-foot { margin-top: 18px; font-size: .76rem; color: var(--gtp-text-muted); line-height: 1.4; }

/* ===== Selbstregistrierung (oeffentliche Seite, 2-spaltig) ===== */
.register-card {
    max-width: 920px;
    width: min(920px, 100%);
}

.register-intro {
    background: var(--gtp-primary-light);
    border: 1px solid var(--gtp-primary);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 18px;
    text-align: left;
}
.register-intro p { margin: 0; font-size: .88rem; color: var(--gtp-text); line-height: 1.45; }

.register-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    align-items: stretch;
}
.register-col { min-width: 0; }
.register-col .register-step {
    height: 100%;
    margin-bottom: 0;
}

.register-step {
    border: 1px solid var(--gtp-border);
    border-radius: 8px;
    padding: 14px 16px 16px;
    margin-bottom: 14px;
    position: relative;
}
.register-step-num {
    position: absolute;
    top: -10px;
    left: 12px;
    background: var(--gtp-primary);
    color: #fff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 700;
}
.register-step label { display: block; font-size: .85rem; }
.register-field-gap { margin-top: 12px; }
.register-hint {
    margin: 6px 0 0;
    font-size: .78rem;
    color: var(--gtp-text-muted);
    line-height: 1.4;
}
/* Auch Inputs ohne type-Attribut (Blazor InputText) – sonst fehlen Rahmen/Radius */
.register-step input,
.register-step textarea {
    margin-top: 4px;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--gtp-border);
    border-radius: 6px;
    padding: 7px 10px;
    font-size: .875rem;
    font-family: inherit;
    background: #fff;
    color: var(--gtp-text);
}
.register-step textarea { resize: vertical; min-height: 110px; }

/* Erkannter Schulname – Platz reserviert */
.register-school-slot {
    margin-top: 14px;
    min-height: 4.5rem;
}
.register-school-ok,
.register-school-warn,
.register-school-pending {
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.register-school-ok {
    background: #e6f4e6;
    border: 1px solid #bfe3bf;
    color: var(--gtp-success);
}
.register-school-warn {
    background: #FFF3CD;
    border: 1px solid #FFEAA7;
    color: #856404;
}
.register-school-pending {
    background: #f5f7fa;
    border: 1px dashed var(--gtp-border);
    color: var(--gtp-text-muted);
}
.register-school-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    opacity: .85;
}
.register-school-name {
    font-size: 1.05rem;
    color: var(--gtp-text);
    font-weight: 700;
    line-height: 1.3;
}
.register-school-meta {
    font-size: .78rem;
    color: var(--gtp-text-muted);
    margin-top: 2px;
}
.register-school-placeholder {
    font-size: .88rem;
    line-height: 1.35;
}

.register-actions {
    margin-top: 16px;
}

/* Fehlerplatz direkt über dem Absenden-Button – Höhe reserviert, kein Layout-Sprung */
.register-error-slot {
    min-height: 3.25rem;
    margin: 0 0 10px;
    display: flex;
    align-items: flex-end;
}
.register-error-slot .register-error {
    width: 100%;
    margin: 0;
}

.register-footer { margin-top: 18px; text-align: left; }
.register-link {
    color: var(--gtp-primary-dark);
    font-weight: 600;
    text-decoration: none;
}
.register-link:hover { text-decoration: underline; }

@media (max-width: 760px) {
    .register-card { max-width: 560px; }
    .register-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .register-col .register-step { height: auto; }
}

/* Hinweis-Boxen wie in den Desktop-Dialogen (gelbe Warnung, rote Achtung, blaue Info) */
.alert { padding: 12px 14px; border-radius: 10px; font-size: .85rem; margin-bottom: 14px; line-height: 1.45; }
.alert-error { background: #fdecea; color: var(--gtp-danger); border: 1px solid #f3c1bb; }
.alert-success { background: #e6f4e6; color: var(--gtp-success); border: 1px solid #bfe3bf; }
.alert-warn { background: #FFF3CD; color: #856404; border: 1px solid #FFEAA7; }
.alert-danger { background: #F8D7DA; color: #721C24; border: 1px solid #F5C6CB; }
.alert-info { background: #E3F2FD; color: #1565C0; border: 1px solid #BBDEFB; }
.alert > .gtp-icon { vertical-align: -.22em; margin-right: 7px; }
.alert .alert-title { display: flex; align-items: center; gap: 7px; font-weight: 700; margin-bottom: 4px; }
.alert p { margin: 0 0 4px; }
.alert p:last-child { margin-bottom: 0; }

/* ===== Visuelle Effekte: Spinner, Lade-Overlay, Fortschritt, Status (wie Desktop) ===== */
.gtp-icon.spin { animation: gtp-spin 0.9s linear infinite; }
@keyframes gtp-spin { to { transform: rotate(360deg); } }

/* Lade-Overlay "Verarbeitung läuft" (Desktop: ProgressWindow) */
.busy-overlay {
    position: fixed;
    inset: 0;
    background: rgba(33, 33, 33, .35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.busy-card {
    width: 360px;
    max-width: calc(100vw - 32px);
    background: var(--gtp-surface);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .25);
    padding: 22px 24px;
}

.busy-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }

.busy-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--gtp-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gtp-primary);
}

.busy-title { font-size: 1.15rem; font-weight: 600; color: var(--gtp-text); }
.busy-text { text-align: center; color: var(--gtp-text-muted); margin-bottom: 14px; font-size: .9rem; }

/* Fortschrittsbalken (Desktop: RadProgressBar) */
.gtp-progress {
    height: 22px;
    background: var(--gtp-bg-alt, #f5f5f5);
    border: 1px solid var(--gtp-border);
    border-radius: 11px;
    overflow: hidden;
}
.gtp-progress > span {
    display: block;
    height: 100%;
    background: var(--gtp-primary);
    border-radius: 11px;
    transition: width .2s ease;
}
.gtp-progress.thin { height: 6px; border: none; border-radius: 3px; }
.gtp-progress.thin > span { border-radius: 3px; }
.gtp-progress.indeterminate > span {
    width: 35% !important;
    animation: gtp-indeterminate 1.3s ease-in-out infinite;
}

/* Codes-anmelden: prominente Zählung + dicker Balken */
.code-progress-count {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 10px 0 8px;
}
.code-progress-num { font-size: 1.5rem; font-weight: 700; color: var(--gtp-primary-dark); }
.code-progress-sep { font-size: 1.2rem; color: var(--gtp-text-muted); }
.code-progress-total { font-size: 1.1rem; font-weight: 600; color: var(--gtp-text-muted); }
.code-progress-label { font-size: .85rem; color: var(--gtp-text-muted); margin-left: 4px; }
.code-progress-bar { height: 14px; border-radius: 8px; }
.code-progress-bar > span { border-radius: 8px; }
.code-progress-bar.done > span { background: linear-gradient(90deg, #34C766, #1E9E50); }
@keyframes gtp-indeterminate {
    0% { margin-left: -35%; }
    100% { margin-left: 100%; }
}

/* Pro-Zeilen-Status im Import-Dialog (Desktop: Waiting/Processing/Success/Error) */
.status-cell { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; }
.status-cell .gtp-icon { flex-shrink: 0; }
.status-waiting { color: var(--gtp-text-muted); }
.status-processing { color: var(--gtp-primary); }
.status-success { color: var(--gtp-success); }
.status-error { color: var(--gtp-danger); }

/* Abschluss-Panel "Import abgeschlossen!" (Desktop: grünes SummaryPanel) */
.summary-panel {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #e6f4e6;
    border: 1px solid var(--gtp-success);
    border-radius: 8px;
    padding: 14px 16px;
    margin-top: 12px;
}
.summary-panel .gtp-icon { color: var(--gtp-success); flex-shrink: 0; margin-top: 2px; }
.summary-panel .summary-title { font-weight: 700; font-size: 1rem; color: #1b5e20; }
.summary-panel .summary-text { color: var(--gtp-text); font-size: .88rem; margin-top: 2px; }

/* Inline-Spinner neben Buttons */
.btn .gtp-icon.spin { margin-right: 2px; }

/* ===== Dashboard: Tab-Bereich, Anwesenheits-Segmente, Status-Punkte ===== */
.tab-bar { display: flex; gap: 4px; }
.tab-bar .tab {
    border: 1px solid var(--gtp-border);
    border-bottom: none;
    background: var(--gtp-bg-alt, #f7f7f7);
    color: var(--gtp-text-muted);
    padding: 6px 12px;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-size: .82rem;
}
.tab-bar .tab.active {
    background: var(--gtp-surface);
    color: var(--gtp-primary-dark);
    font-weight: 600;
    border-bottom: 2px solid var(--gtp-primary);
}

.status-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #d0d0d0;
    border: 1px solid #b0b0b0;
}
.status-dot.present { background: var(--gtp-success); border-color: #3d8b40; }
.status-dot.absent { background: var(--gtp-danger); border-color: #c0392b; }
.status-dot.picked { background: var(--gtp-warning); border-color: #c87f0a; }
.status-dot.none { background: #e8e8e8; }

.seg { display: inline-flex; border: 1px solid var(--gtp-border); border-radius: 6px; overflow: hidden; }
.seg-btn {
    border: none;
    background: var(--gtp-surface);
    color: var(--gtp-text-muted);
    padding: 4px 10px;
    font-size: .78rem;
    cursor: pointer;
    border-right: 1px solid var(--gtp-border);
}
.seg-btn:last-child { border-right: none; }
.seg-btn:hover { background: var(--gtp-bg-alt, #f5f5f5); }
.seg-btn.active.present { background: var(--gtp-success); color: #fff; }
.seg-btn.active.absent { background: var(--gtp-danger); color: #fff; }
.seg-btn.active.picked { background: var(--gtp-warning); color: #fff; }

/* ===== Toast-Notification (motivierende Startnachricht nach Anmeldung) ===== */
.toast-stack {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 2100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 360px;
    pointer-events: none;
}

.gtp-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--gtp-surface);
    border: 1px solid var(--gtp-border);
    border-left: 4px solid var(--gtp-primary);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
    padding: 14px 16px;
    animation: toast-in .35s cubic-bezier(.2, .8, .25, 1);
}

.gtp-toast.leaving { animation: toast-out .3s ease forwards; }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
    to { opacity: 0; transform: translateY(8px); }
}

.gtp-toast .toast-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--gtp-primary-light);
    color: var(--gtp-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gtp-toast .toast-body { min-width: 0; }
.gtp-toast .toast-title { font-weight: 600; font-size: .9rem; color: var(--gtp-text); margin-bottom: 2px; }
.gtp-toast .toast-text { font-size: .85rem; color: var(--gtp-text-muted); line-height: 1.35; }

.gtp-toast .toast-close {
    flex-shrink: 0;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--gtp-text-muted);
    padding: 0;
    line-height: 1;
    font-size: 1.1rem;
}
.gtp-toast .toast-close:hover { color: var(--gtp-text); }

/* ===== Hilfe (Handbuch + Videos) ===== */
.help-handbook { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.help-chapter-nav { position: sticky; top: 16px; max-height: calc(100vh - 120px); overflow-y: auto; }
.help-chapter-link { display: block; width: 100%; text-align: left; padding: 8px 10px; border: none; background: none;
    border-radius: 6px; cursor: pointer; font-size: .88rem; color: var(--gtp-text); }
.help-chapter-link:hover { background: var(--gtp-hover, #f0f4f8); }
.help-chapter-link.active { background: var(--gtp-primary, #2c5f8a); color: #fff; }
.help-chapter-content { min-width: 0; overflow-x: auto; }
.help-chapter-content h1 { font-size: 1.4rem; margin-top: 0; }
.help-chapter-content h2 { font-size: 1.15rem; margin-top: 24px; }
.help-chapter-content h3 { font-size: 1rem; margin-top: 18px; }
.help-chapter-content table { border-collapse: collapse; margin: 12px 0; font-size: .85rem; }
.help-chapter-content th, .help-chapter-content td { border: 1px solid var(--gtp-border, #d8dee5); padding: 6px 10px; text-align: left; }
.help-chapter-content th { background: var(--gtp-hover, #f0f4f8); }
.help-chapter-content code { background: var(--gtp-hover, #f0f4f8); padding: 1px 5px; border-radius: 4px; font-size: .82rem; }
.help-chapter-content pre { background: var(--gtp-hover, #f0f4f8); padding: 10px 12px; border-radius: 6px; overflow-x: auto; }
.help-chapter-content img { max-width: 100%; border: 1px solid var(--gtp-border, #d8dee5); border-radius: 6px; }
.help-chapter-content blockquote { border-left: 3px solid var(--gtp-primary, #2c5f8a); margin: 12px 0; padding: 4px 14px; color: var(--gtp-text-muted); }
.help-search-hit { display: block; width: 100%; text-align: left; border: 1px solid var(--gtp-border, #d8dee5);
    background: none; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
.help-search-hit:hover { background: var(--gtp-hover, #f0f4f8); }
.help-search-hit strong { margin-right: 8px; }
.help-search-hit .text-muted { display: block; margin-top: 4px; font-size: .82rem; }
.help-video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; }
.help-video-card { padding: 0; overflow: hidden; }
.help-video-thumb { position: relative; display: block; width: 100%; border: none; padding: 0; cursor: pointer; background: #000; }
.help-video-thumb img { width: 100%; display: block; aspect-ratio: 16 / 9; object-fit: cover; opacity: .92; }
.help-video-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff;
    background: rgba(0,0,0,.25); transition: background .15s; }
.help-video-thumb:hover .help-video-play { background: rgba(0,0,0,.45); }
.help-video-frame { aspect-ratio: 16 / 9; }
.help-video-frame iframe { width: 100%; height: 100%; border: none; display: block; }
.help-video-body { padding: 12px 16px 16px; }
.help-video-body h3 { margin: 4px 0 6px; font-size: 1rem; }
.help-video-body p { margin: 0; font-size: .85rem; }
@media (max-width: 900px) { .help-handbook { grid-template-columns: 1fr; } .help-chapter-nav { position: static; max-height: none; } }

/* ===== Utility ===== */
.text-muted { color: var(--gtp-text-muted); }
.text-danger { color: var(--gtp-danger); }
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; }
.mb-2 { margin-bottom: 8px; }

.color-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-right: 6px; vertical-align: -2px; border: 1px solid rgba(0,0,0,.15); }

#blazor-error-ui {
    background: var(--gtp-warning-bg);
    bottom: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, .2);
    display: none;
    left: 0;
    padding: .6rem 1.25rem .7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
