/* =====================================================================
   Design-Tokens (Light Mode = Standardwerte)
   Phase 1 der Dark-Mode-Umstellung: app.css nutzt nur noch diese
   semantischen Variablen statt hartcodierter Hex-Farben.
   Dark Mode (Phase 2) ueberschreibt die Werte via [data-theme="dark"].
   ===================================================================== */
:root {
  /* Markenfarbe DRK */
  --drk-accent: #e60005;
  --drk-accent-border: #cc0004;
  --drk-accent-rgb: 230, 0, 5;
  --drk-accent-contrast: #ffffff;

  /* Flaechen */
  --surface: #fff;            /* Karten, Modals, Inputs */
  --surface-2: #f8f9fa;       /* Seitenhintergrund, Tabellenkoepfe */
  --surface-3: #f1f3f5;       /* abgesetzte Bereiche, Chips */
  --surface-hover: #e9ecef;   /* Hover-Zustaende neutraler Elemente */

  /* Linien */
  --border: #dee2e6;          /* Standard-Rahmen */
  --border-light: #e9ecef;    /* feine Trennlinien */
  --border-strong: #ced4da;   /* Form-Controls, Scrollbars */

  /* Text */
  --text-heading: #000;       /* Ueberschriften */
  --text: #2d3436;            /* Fliesstext */
  --text-secondary: #495057;  /* sekundaerer Text */
  --text-muted: #6c757d;      /* gedaempfter Text, Labels */
  --text-faint: #9ca3af;      /* Platzhalter, Meta-Angaben */
  --text-on-accent: #fff;     /* Text auf farbigen Flaechen */

  /* Status: Fehler / Loeschen (UI-Rot, getrennt vom Markenrot) */
  --danger: #dc3545;
  --danger-text: #991b1b;
  --danger-bg: #fff0f0;
  --danger-border: #fecaca;

  /* Status: Erfolg */
  --success: #198754;
  --success-text: #0f5132;
  --success-bg: #d1e7dd;

  /* Status: Warnung */
  --warning: #f59e0b;
  --warning-text: #856404;
  --warning-bg: #fff3cd;

  /* Status: Info */
  --info: #3b82f6;
  --info-text: #1e40af;
  --info-bg: #dbeafe;
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: var(--drk-accent);
}

.btn-primary {
    color: var(--drk-accent-contrast);
    background-color: var(--drk-accent);
    border-color: var(--drk-accent-border);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--drk-accent);
  border-color: var(--drk-accent);
}

/* Outline-Variante in DRK-Rot (u.a. "Etikett drucken" in den Artikel-Modals).
   Die Klasse wurde bisher nirgends definiert -- der Button erbte nur den
   Bootstrap-Basis-Style und war im Dark Mode unsichtbar. */
.btn-outline-drk {
    color: var(--drk-accent);
    border: 1px solid var(--drk-accent);
    background: transparent;
}
.btn-outline-drk:hover, .btn-outline-drk:focus {
    color: var(--drk-accent-contrast);
    background: var(--drk-accent);
    border-color: var(--drk-accent);
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--success);
}

.invalid {
    outline: 1px solid var(--drk-accent);
}

.validation-message {
    color: var(--drk-accent);
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

@media print {

    /* Alles ausblenden */
    body * {
        visibility: hidden;
    }

    /* Druck-Kopfzeile mit Logo */
    .print-only,
    .print-only * {
        visibility: visible;
    }

    .print-only {
        position: absolute;
        left: 0;
    }

    .print-header-bar {
        top: 0;
        display: flex !important;
        align-items: center;
        gap: 12px;
        padding-bottom: 6px;
        border-bottom: 2px solid var(--drk-accent);
        width: 100%;
    }

    .print-logo {
        height: 52px;
        width: auto;
    }

    .print-erp-title {
        font-size: 1.2rem;
        font-weight: 700;
        color: var(--drk-accent);
    }

    .print-sub {
        font-size: 0.8rem;
        color: var(--text-secondary);
    }

    .print-report-meta {
        top: 72px;
        font-size: 0.85rem;
        color: var(--text);
        width: 100%;
        padding-bottom: 6px;
    }

    /* Tabelle anzeigen */
    #printarea,
    #printarea * {
        visibility: visible;
    }

    #printarea {
        position: absolute;
        left: 0;
        top: 90px;
        width: 100%;
    }

    .table-secondary { background-color: var(--surface-hover) !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }

    /* Elemente nur am Bildschirm */
    .no-print {
        display: none !important;
    }

    /* Tabelle beim Drucken immer anzeigen, Mobile-Cards immer verstecken */
    .desktop-table {
        display: block !important;
    }
    .mobile-card-list {
        display: none !important;
    }

    /* Badges lesbar im Druck */
    .badge {
        border: 1px solid #333 !important;
        color: var(--text-heading) !important;
        background-color: transparent !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    /* Tabellen-Farben im Druck */
    .table-warning { background-color: var(--warning-bg) !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .table-success { background-color: var(--success-bg) !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .table-dark th { background-color: #333 !important; color: var(--text-on-accent) !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }

    /* DRK-roter Tabellen-Header beim Druck beibehalten */
    thead[style*="e60005"] { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    thead[style*="e60005"] th { color: white !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }

    @page {
        margin: 1cm;
        size: A4 landscape;
    }
}

/* Elemente die nur im Druck erscheinen sollen am Bildschirm verstecken */
.print-only {
    display: none;
}


/* DRK Farben - Custom Styles:
   DRK-Rot: #e60005
   Weiß: #ffffff
   Schwarz: #000000
   Grau: #7c7c7c
*/

/* ===== SIDEBAR ===== */

/* Sidebar: fixed on left, main content gets margin-left */
.app-main {
    margin-left: 260px;
    min-height: 100vh;
    background-color: var(--surface-2);
}

.sidebar-wrapper {
    /* No layout space needed - sidebar is position: fixed */
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    height: 100dvh; /* dvh: korrekte Hoehe auf iOS trotz dynamischer Safari-Leisten */
    background-color: #131a26;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.25);
    z-index: 100;
    /* Safe-Area: Sidebar-Inhalt im PWA-Standalone-Modus unterhalb der iOS-Statusleiste beginnen lassen */
    padding-top: env(safe-area-inset-top, 0px);
}

/* Brand */
.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 1rem;
    gap: 0.3rem;
    background-color: var(--drk-accent);
    text-align: center;
}

.brand-logo-wrapper {
    background: #fff; /* Logo-Platte bleibt auch im Dark Mode weiss (Mandanten-Logos) */
    border-radius: 6px;
    padding: 0.45rem 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* Klickbares Mandanten-Logo (leitet auf die Startseite) */
.brand-logo-link {
    text-decoration: none;
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.15s;
}
.brand-logo-link:hover {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.45);
    transform: translateY(-1px);
}

.brand-logo {
    width: 100%;
    max-width: 190px;
    height: auto;
    display: block;
}

.brand-subtitle {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.2;
}

.sidebar-divider {
    border-color: rgba(255, 255, 255, 0.09);
    margin: 0.35rem 1rem;
}

/* Nav list */
.sidebar-nav {
    flex: 1;
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    overflow-y: auto;
}

.sidebar-nav li {
    list-style: none;
}

/* Links */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 1rem;
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: none !important;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    margin: 2px 8px;
    transition: background-color 0.15s ease, color 0.15s ease;
    cursor: pointer;
    border: none;
    background: transparent;
    width: calc(100% - 16px);
    box-sizing: border-box;
}

.sidebar-link:hover {
    background-color: rgba(255, 255, 255, 0.07) !important;
    color: var(--text-on-accent) !important;
}

.sidebar-link.active {
    background-color: rgba(var(--drk-accent-rgb), 0.16) !important;
    color: var(--text-on-accent) !important;
    font-weight: 600;
    position: relative;
}

.sidebar-link.active::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 7px;
    bottom: 7px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--drk-accent);
}

.sidebar-link.active .nav-icon {
    color: var(--drk-accent);
}

.nav-icon {
    font-size: 1.05rem;
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

/* Toggle buttons (Module) */
.sidebar-toggle-btn {
    text-align: left;
    font-weight: 500;
    font-size: 0.9rem;
}

.sidebar-toggle-btn .nav-icon {
    color: inherit !important;
}

.chevron-icon {
    font-size: 0.75rem;
    margin-left: auto;
}

/* Submenu */
.sidebar-submenu {
    list-style: none;
    padding: 0;
    margin: 1px 8px 4px 8px;
    border-radius: 6px;
}

.sidebar-submenu li {
    list-style: none;
}

.sidebar-sublink {
    padding-left: 2.35rem !important;
    padding-top: 0.38rem !important;
    padding-bottom: 0.38rem !important;
    font-size: 0.83rem !important;
    margin: 1px 0 !important;
    width: 100% !important;
    color: rgba(255, 255, 255, 0.72) !important;
}

.sidebar-sublink.active {
    background-color: rgba(255, 255, 255, 0.09) !important;
}

.sidebar-sublink.active::before {
    display: none;
}

/* Footer */
.sidebar-footer {
    padding-bottom: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding-top: 0.35rem;
}

/* Mobile toggle button */
.sidebar-mobile-toggle {
    position: fixed;
    /* Safe-Area: im PWA-Standalone-Modus (viewport-fit=cover) nicht unter die iOS-Statusleiste rutschen */
    top: calc(10px + env(safe-area-inset-top, 0px));
    left: calc(10px + env(safe-area-inset-left, 0px));
    z-index: 200;
    background-color: var(--drk-accent);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 1.25rem;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Bei geoeffneter Sidebar den Toggle ausblenden — er laege sonst sichtbar hinter/neben dem Menue */
.sidebar-mobile-toggle.toggle-hidden {
    opacity: 0;
    transform: scale(0.85);
    pointer-events: none;
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 150;
}

/* Mobile responsiveness */
@media (max-width: 991.98px) {
    .sidebar {
        left: -260px;
        transition: left 0.3s ease;
        z-index: 160;
    }

    .sidebar-wrapper.sidebar-open .sidebar {
        left: 0;
    }

    .app-main {
        margin-left: 0;
        padding-top: 50px;
    }

    /* Die fixe BottomNav (z-index 1050) ueberdeckt das untere Ende der
       Sidebar. Der Footer (User/Logout) sitzt ausserhalb des scrollbaren
       Nav-Bereichs am unteren Rand und wird sonst verdeckt -- daher Platz
       fuer BottomNav-Hoehe + Safe-Area reservieren. So bleibt auch der
       letzte Nav-Eintrag ("Entwickler") sichtbar/scrollbar. */
    .sidebar-footer {
        padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    }
}

/* Blazor error UI */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ===== AUTH / LOGIN LAYOUT ===== */
/* Helle, zweigeteilte Karte auf dunklem Blaulicht-Hintergrund: links die Marke,
   rechts der Seiteninhalt. Gilt fuer alle Seiten mit AccountLayout
   (Anmelden, Registrieren, Passwort vergessen, 2FA, Bestaetigungsseiten). */

.auth-layout {
    min-height: 100vh;
    background:
        radial-gradient(900px 500px at 88% 92%, rgba(230, 0, 5, 0.42) 0%, transparent 62%),
        radial-gradient(1000px 520px at 12% 8%, rgba(72, 140, 255, 0.30) 0%, transparent 62%),
        linear-gradient(160deg, #070d1c 0%, #0d1b3e 62%, #131f42 100%);
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    width: 100%;
    max-width: 900px;
    background: var(--surface);
    border-radius: 20px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    color: var(--text);
}

/* Einige Seiten setzen fuer breitere Inhalte auth-card-wide - im Split-Layout
   bedeutet das nur etwas mehr Gesamtbreite. */
.auth-card.auth-card-wide {
    max-width: 980px;
}

/* --- linke Haelfte: Marke --- */
.auth-brand-pane {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1.6rem;
    padding: 2.75rem 2.5rem;
    background: var(--surface);
}

.auth-logo-icon {
    width: 275px;
    max-width: 100%;
    height: auto;
    display: block;
}

.auth-points {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.75rem;
    justify-items: start;
    text-align: left;
}

.auth-points li {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.87rem;
    color: var(--text-secondary);
}

.auth-points i {
    font-size: 1.05rem;
    color: var(--drk-accent);
}

/* --- rechte Haelfte: Seiteninhalt --- */
.auth-card-body {
    padding: 2.75rem 2.75rem;
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* --- Typografie --- */
.auth-card h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.auth-card h2 {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.auth-card h3 {
    font-size: 1.05rem;
}

/* --- Formularfelder --- */
.auth-card .form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.auth-card .form-control,
.auth-card .form-select {
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-card .form-control::placeholder {
    color: var(--text-faint);
}

.auth-card .form-control:focus,
.auth-card .form-select:focus {
    border-color: #132a5e;
    box-shadow: 0 0 0 3px rgba(19, 42, 94, 0.13);
}

.auth-card .form-check-input:checked {
    background-color: #132a5e;
    border-color: #132a5e;
}

.auth-card .form-check-input:focus {
    border-color: #132a5e;
    box-shadow: 0 0 0 3px rgba(19, 42, 94, 0.13);
}

.auth-card a {
    color: #132a5e;
    text-decoration: none;
    font-weight: 600;
}

.auth-card a:hover {
    text-decoration: underline;
}

/* Zeile mit "Angemeldet bleiben" und "Passwort vergessen?" */
.auth-card .auth-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.auth-card .auth-form-row .form-check {
    margin-bottom: 0;
}

/* Trenner zwischen Passwort-Anmeldung und externer Anmeldung */
.auth-card .auth-sep {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin: 1.35rem 0;
    color: var(--text-faint);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.auth-card .auth-sep::before,
.auth-card .auth-sep::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--surface-hover);
}

/* --- Buttons --- */
.auth-card .btn {
    border-radius: 10px;
    font-weight: 650;
    padding: 0.8rem 1.1rem;
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.08s;
}

.auth-card .btn:active {
    transform: translateY(1px);
}

/* Anmelde-Button im Navy des Logos - Rot bleibt Akzent (Logo, dezenter SSO-Hover) */
.auth-card .btn-primary {
    background-color: #0d1b3e;
    border-color: #0d1b3e;
    color: var(--text-on-accent);
    box-shadow: 0 8px 20px rgba(13, 27, 62, 0.26);
}

.auth-card .btn-primary:hover,
.auth-card .btn-primary:focus {
    background-color: #132a5e;
    border-color: #132a5e;
}

/* Externe Anmeldung (SSO) und sekundaere Aktionen: heller Umriss-Button,
   der beim Hover nur dezent rot getoent wird statt vollflaechig zu leuchten. */
.auth-card .btn-drk,
.auth-card .btn-secondary,
.auth-card .btn-outline-secondary,
.auth-card .btn-ghost {
    background: var(--surface);
    border: 1.5px solid var(--border);
    color: #0d1b3e;
}

.auth-card .btn-drk:hover,
.auth-card .btn-drk:focus-visible,
.auth-card .btn-secondary:hover,
.auth-card .btn-outline-secondary:hover,
.auth-card .btn-ghost:hover {
    background: rgba(var(--drk-accent-rgb), 0.07);
    border-color: rgba(var(--drk-accent-rgb), 0.45);
    color: var(--drk-accent-border);
    box-shadow: none;
}

/* --- Altlasten der noch nicht ueberarbeiteten Identity-Seiten --- */
/* Ihr Formular liegt in einem schmalen Bootstrap-Grid und soll die Karte fuellen */
.auth-card .row > [class^="col-"],
.auth-card .row > [class*=" col-"] {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
}

/* Bootstrap-Floating-Labels brauchen ihr eigenes Innenabstands-Mass */
.auth-card .form-floating > .form-control {
    height: calc(3.5rem + 2px);
    padding: 1.625rem 0.9rem 0.5rem;
}

.auth-card .form-floating > label {
    padding: 1rem 0.9rem;
}

.auth-card .form-floating > .form-control::placeholder {
    color: transparent;
}

@media (max-width: 880px) {
    .auth-card,
    .auth-card.auth-card-wide {
        grid-template-columns: 1fr;
        max-width: 440px;
    }

    .auth-brand-pane {
        padding: 1.9rem 1.5rem 1.4rem;
        gap: 1rem;
    }

    .auth-logo-icon {
        width: 210px;
    }

    .auth-points {
        display: none;
    }

    .auth-card-body {
        padding: 1.6rem 1.5rem 1.9rem;
        border-left: 0;
        border-top: 1px solid var(--border);
    }
}

@media (max-width: 400px) {
    .auth-layout {
        padding: 1.25rem 0.85rem;
    }

    .auth-card .auth-form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Card Headers */
.card-header {
    background-color: var(--drk-accent);
    color: var(--text-on-accent);
}

/* Page Headers */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-heading);
}

/* Table Headers */
.table thead th {
    background-color: #7c7c7c;
    color: var(--text-on-accent);
    border-color: #666666 !important;
}

/* Badges */
.badge.bg-primary {
    background-color: var(--drk-accent) !important;
}

/* Pagination */
.page-link {
    color: var(--drk-accent);
}

.page-item.active .page-link {
    background-color: var(--drk-accent);
    border-color: var(--drk-accent);
    color: var(--text-on-accent);
}

/* Form Focus */
.form-control:focus {
    border-color: var(--drk-accent);
    box-shadow: 0 0 0 0.2rem rgba(230, 0, 5, 0.25);
}

/* Form Labels - only for specific pages */
.login-page .form-label,
.manage-page .form-label {
    color: var(--text-heading) !important;
}

/* Green Button for Add Actions */
.btn-success-custom {
    color: var(--text-on-accent);
    background-color: var(--success);
    border-color: var(--success);
}

.btn-success-custom:hover {
    color: var(--text-on-accent);
    background-color: var(--success);
    border-color: var(--success);
}

.btn-success-custom:focus,
.btn-success-custom:active:focus {
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.5);
}

/* Links Hover */
a:hover {
    color: var(--drk-accent-border);
}

/* ===== MANAGE NAV (Account/Manage sidebar) ===== */
.manage-nav {
    gap: 2px;
}

.manage-nav-link {
    display: flex;
    align-items: center;
    padding: 0.55rem 0.85rem;
    color: var(--text) !important;
    text-decoration: none !important;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.manage-nav-link:hover {
    background-color: var(--surface-3) !important;
    color: var(--text-heading) !important;
}

.manage-nav-link.active {
    background-color: var(--drk-accent) !important;
    color: var(--text-on-accent) !important;
    font-weight: 600;
}

.manage-nav-link.active i {
    color: var(--text-on-accent) !important;
}

/* ===== PROFILE PAGE (Modern Card Design) ===== */
.profile-sidebar {
    background: var(--surface);
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    overflow: hidden;
}

.profile-sidebar-nav {
    padding: 12px 0;
    display: flex;
    flex-direction: column;
}

.profile-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    color: var(--text-secondary) !important;
    font-size: 0.9rem;
    text-decoration: none !important;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.profile-nav-link:hover {
    background: var(--danger-bg) !important;
    color: var(--drk-accent) !important;
    border-left-color: var(--drk-accent);
}

.profile-nav-link.active {
    background: var(--danger-bg) !important;
    color: var(--drk-accent) !important;
    font-weight: 600;
    border-left-color: var(--drk-accent);
}

.profile-nav-link i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}

/* Section cards */
.profile-section-card {
    background: var(--surface);
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    margin-bottom: 24px;
    overflow: hidden;
}

.profile-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 24px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    border-left: 4px solid var(--drk-accent);
    border-bottom: 1px solid var(--border-light);
    margin: 0;
}

.profile-section-title i {
    color: var(--drk-accent);
    font-size: 1.15rem;
}

.profile-section-body {
    padding: 0;
}

/* Data rows */
.profile-data-row {
    display: flex;
    padding: 13px 24px;
    border-bottom: 1px solid var(--border-light);
    align-items: center;
}

.profile-data-row:last-child {
    border-bottom: none;
}

.profile-data-label {
    flex: 0 0 160px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.profile-data-value {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 500;
}

.profile-data-value.empty {
    color: #ccc;
}

/* Size badges */
.profile-size-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 20px 24px;
}

.profile-size-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--danger-bg);
    border: 1px solid rgba(var(--drk-accent-rgb),0.12);
    border-radius: 10px;
    padding: 10px 16px;
    min-width: 80px;
}

.profile-size-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.profile-size-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--drk-accent);
}

.profile-size-value.empty {
    color: #ccc;
    font-weight: 400;
}

.profile-extra-info {
    padding: 0 24px 20px;
}

.profile-extra-info .profile-data-row {
    padding-left: 0;
    padding-right: 0;
}

/* Absence table */
.profile-absence-section {
    padding: 20px 24px;
}

.profile-absence-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 16px;
}

.profile-absence-table thead th {
    background: var(--surface-2);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 14px;
    border-bottom: 2px solid var(--border-light);
}

.profile-absence-table thead th:first-child {
    border-radius: 8px 0 0 0;
}

.profile-absence-table thead th:last-child {
    border-radius: 0 8px 0 0;
}

.profile-absence-table tbody td {
    padding: 12px 14px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.profile-absence-badge {
    display: inline-block;
    background: var(--success-bg);
    color: var(--success-text);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}

/* Add form */
.profile-add-form {
    background: var(--surface-2);
    border-radius: 10px;
    padding: 18px;
}

.profile-form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.profile-form-input {
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 0.9rem;
}

.profile-form-input:focus {
    border-color: var(--drk-accent);
    box-shadow: 0 0 0 3px rgba(var(--drk-accent-rgb),0.1);
}

/* Buttons */
.profile-btn-drk {
    background: var(--drk-accent);
    color: var(--drk-accent-contrast);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    padding: 8px 20px;
    transition: all 0.2s;
}

.profile-btn-drk:hover {
    filter: brightness(0.9);
    color: var(--text-on-accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--drk-accent-rgb),0.3);
}

.profile-btn-outline {
    border: 2px solid var(--drk-accent);
    color: var(--drk-accent);
    background: transparent;
    border-radius: 8px;
    font-weight: 600;
    padding: 6px 18px;
    transition: all 0.2s;
}

.profile-btn-outline:hover {
    background: var(--drk-accent);
    color: var(--text-on-accent);
}

/* Mobile responsive */
@media (max-width: 991px) {
    .profile-sidebar {
        margin-bottom: 24px;
    }

    .profile-data-row {
        flex-direction: column;
        gap: 2px;
        padding: 10px 18px;
    }

    .profile-data-label {
        flex: none;
        font-size: 0.78rem;
    }

    .profile-data-value {
        font-size: 0.9rem;
    }

    .profile-size-grid {
        gap: 8px;
        padding: 16px 18px;
    }

    .profile-size-badge {
        min-width: 70px;
        padding: 8px 12px;
    }
}

@media (max-width: 575px) {
    .profile-absence-table thead {
        display: none;
    }

    .profile-absence-table tbody tr {
        display: block;
        background: var(--surface-2);
        border-radius: 10px;
        padding: 12px;
        margin-bottom: 10px;
    }

    .profile-absence-table tbody td {
        display: flex;
        justify-content: space-between;
        padding: 4px 0;
        border: none;
    }

    .profile-absence-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        font-size: 0.8rem;
    }
}

/* ===== STATUS DOTS ===== */
.status-dot {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    position: relative;
    top: -1px;
    flex-shrink: 0;
}

.status-green {
    background-color: var(--success);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2), 0 0 7px 2px rgba(34, 197, 94, 0.45);
}

.status-yellow {
    background-color: var(--warning);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2), 0 0 7px 2px rgba(245, 158, 11, 0.45);
}

.status-gray {
    background-color: #9ca3af;
    box-shadow: 0 0 0 2px rgba(156, 163, 175, 0.2), 0 0 7px 2px rgba(156, 163, 175, 0.35);
}

.status-red {
    background-color: var(--danger);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2), 0 0 7px 2px rgba(239, 68, 68, 0.45);
}

.ql-tile {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ql-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

/* ===== Bottom Navigation (Mobile) ===== */
.bottom-navbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 6px 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.7rem;
    transition: color 0.2s;
    background: none;
    border: none;
    cursor: pointer;
}

.bottom-nav-item i {
    font-size: 1.3rem;
    margin-bottom: 2px;
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
    color: var(--drk-accent);
    text-decoration: none;
}

/* Ungelesen-Badge ueber dem Icon (Chat, BottomNavbar) */
.bottom-nav-icon-wrap {
    position: relative;
    display: inline-flex;
}

.bottom-nav-badge {
    position: absolute;
    top: -6px;
    right: -10px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--drk-accent);
    color: var(--drk-accent-contrast);
    border-radius: 8px;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

/* "Mehr" Overlay */
.bottom-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1049;
}

.bottom-nav-more-menu {
    position: fixed;
    bottom: calc(56px + env(safe-area-inset-bottom, 0));
    left: 0;
    right: 0;
    z-index: 1051;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 16px rgba(0,0,0,0.15);
    padding: 8px 0;
    border-radius: 12px 12px 0 0;
}

.bottom-nav-more-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.95rem;
    transition: background-color 0.15s;
}

.bottom-nav-more-item i {
    font-size: 1.2rem;
    width: 1.5rem;
    text-align: center;
    color: var(--text-muted);
}

.bottom-nav-more-item:hover {
    background-color: var(--surface-2);
    color: var(--drk-accent);
    text-decoration: none;
}

.bottom-nav-more-item:hover i {
    color: var(--drk-accent);
}

/* Padding am Body-Ende damit Content nicht hinter der BottomNav verschwindet.
   calc() rechnet die iOS Safe-Area (Home-Indicator) mit ein. */
@media (max-width: 767.98px) {
    .app-main {
        padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    }
    /* Der Footer ("Über die Entwickler") wuerde sonst unter der fixen
       BottomNav durchscheinen -- auf Mobile ist der Link ueber das
       "Mehr"-Menue bzw. die Sidebar erreichbar. */
    .app-footer {
        display: none;
    }
}

/* ===== Mobile Card Views ===== */
.mobile-card-list {
    display: none;
}

@media (max-width: 767.98px) {
    .desktop-table {
        display: none !important;
    }
    .mobile-card-list {
        display: block;
    }
}

.mobile-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.mobile-card-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
}

.mobile-card-badge {
    flex-shrink: 0;
}

.mobile-card-details {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.mobile-card-details dt {
    font-weight: 500;
    color: var(--text-secondary);
    display: inline;
}

.mobile-card-details dd {
    display: inline;
    margin-left: 0.25rem;
    margin-bottom: 0.25rem;
}

.mobile-card-details dd::after {
    content: "";
    display: block;
}

.mobile-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
}

/* Buttons fuellen die Reihe und brechen bei 4+ Aktionen in die naechste
   Zeile um, statt rechts aus der Karte heraus abgeschnitten zu werden.
   flex-basis sorgt fuer ~2 Buttons pro Reihe auf schmalen Screens. */
.mobile-card-actions .btn,
.mobile-card-actions .btn-ghost {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 0;
    justify-content: center;
    white-space: nowrap;
    font-size: 0.8rem;
    padding: 0.5rem;
    min-height: 44px;
}

/* ===== Feedback Chat ===== */
.feedback-chat {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-message {
    display: flex;
}

.chat-message-user {
    justify-content: flex-end;
}

.chat-message-ai {
    justify-content: flex-start;
}

.chat-bubble {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    word-wrap: break-word;
    line-height: 1.5;
}

.chat-bubble-user {
    background-color: var(--info);
    color: white;
    border-bottom-right-radius: 0.25rem;
}

.chat-bubble-ai {
    background-color: var(--surface-3);
    color: var(--text);
    border-bottom-left-radius: 0.25rem;
}

.typing-indicator {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    padding: 4px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: #999;
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite both;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

@media (max-width: 768px) {
    .feedback-chat {
        max-height: 300px;
    }
    .chat-bubble {
        max-width: 90%;
        font-size: 0.9rem;
    }
}

/* =====================================================
   EINHEITLICHES DESIGN-SYSTEM (ReDesign 2026)
   Basierend auf Home- und Profil-Seite
   ===================================================== */

/* ===== PAGE HEADER ===== */
/* Breitenbegrenzung fuer formular-/detaillastige Seiten, damit Inhalte auf
   grossen Bildschirmen nicht ueber die volle Breite laufen. Auf Mobile ohne Wirkung. */
.page-narrow {
    max-width: 1080px;
    margin-left: auto;
    margin-right: auto;
}

.page-header-redesign {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
.page-header-redesign .page-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.page-header-redesign .page-header-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
    line-height: 1.2;
}
.page-header-redesign .page-header-sub {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0;
}
.page-header-redesign .page-header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 767.98px) {
    .page-header-redesign .page-header-title { font-size: 1.35rem; }
    .page-header-redesign .page-header-sub { font-size: 0.82rem; }
    .page-header-redesign .page-header-actions { width: 100%; }
}

/* ===== BUTTONS (REDESIGN) ===== */
.btn-drk {
    background: var(--drk-accent);
    color: var(--drk-accent-contrast);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    padding: 9px 20px;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
.btn-drk:hover {
    background: var(--drk-accent);
    filter: brightness(0.9);
    color: var(--drk-accent-contrast);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--drk-accent-rgb),0.3);
    text-decoration: none;
}
.btn-drk.lg { padding: 12px 32px; font-size: 0.95rem; }

/* Bestätigungsbutton (Grün) -- für Speichern, Hinzufügen, Bestätigen, Zuweisen */
.btn-confirm {
    background: var(--success);
    color: var(--text-on-accent);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    padding: 9px 20px;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
.btn-confirm:hover {
    background: var(--success);
    color: var(--text-on-accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22,163,74,0.3);
    text-decoration: none;
}
.btn-confirm.lg { padding: 12px 32px; font-size: 0.95rem; }

/* Löschbutton (Rot) -- für Löschen, Entfernen, Stornieren */
.btn-delete {
    background: var(--danger);
    color: var(--text-on-accent);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    padding: 9px 20px;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
.btn-delete:hover {
    background: var(--danger-text);
    color: var(--text-on-accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220,38,38,0.3);
    text-decoration: none;
}

.btn-drk-outline {
    border: 2px solid var(--drk-accent);
    color: var(--drk-accent);
    background: transparent;
    border-radius: 8px;
    font-weight: 600;
    padding: 7px 18px;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
.btn-drk-outline:hover {
    background: var(--drk-accent);
    color: var(--text-on-accent);
    text-decoration: none;
}


.btn-ghost {
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    background: var(--surface);
    border-radius: 8px;
    font-weight: 500;
    padding: 7px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
.btn-ghost:hover {
    border-color: var(--drk-accent);
    color: var(--drk-accent);
    background: var(--danger-bg);
    text-decoration: none;
}

.btn-back {
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    background: var(--surface);
    border-radius: 8px;
    font-weight: 500;
    padding: 7px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: all 0.15s;
}
.btn-back:hover { border-color: #636e72; color: var(--text); text-decoration: none; }

.btn-icon-action {
    border: 1px solid var(--border-light);
    background: var(--surface);
    color: var(--text-muted);
    border-radius: 8px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.15s;
    padding: 0;
}
.btn-icon-action:hover { border-color: var(--drk-accent); color: var(--drk-accent); }
.btn-icon-action.danger:hover { border-color: var(--danger); color: var(--danger); }
.btn-icon-action.warning:hover { border-color: var(--warning); color: var(--warning); }

.btn-cart-redesign {
    position: relative;
    background: var(--surface);
    border: 2px solid var(--drk-accent);
    color: var(--drk-accent);
    border-radius: 8px;
    font-weight: 600;
    padding: 7px 16px;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-cart-redesign:hover { background: var(--drk-accent); color: var(--drk-accent-contrast); text-decoration: none; }
.btn-cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--warning);
    color: var(--text-on-accent);
    font-size: 0.65rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 767.98px) {
    .btn-drk, .btn-drk-outline, .btn-ghost { font-size: 0.78rem; padding: 7px 12px; }
}

/* ===== SECTION CARD (generisch, basierend auf profile-section-card) ===== */
.section-card {
    background: var(--surface);
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    margin-bottom: 20px;
    overflow: hidden;
}
.section-card .section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 24px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    border-left: 4px solid var(--drk-accent);
    border-bottom: 1px solid var(--border-light);
    margin: 0;
    border-top-left-radius: 14px;
}
.section-card .section-title i { color: var(--drk-accent); font-size: 1.1rem; }
/* Icons in Buttons/Links innerhalb section-title nicht rot faerben (sonst rot-auf-rot bei .btn-drk) */
.section-card .section-title button i,
.section-card .section-title a i { color: inherit; font-size: inherit; }
.section-card .section-title .count-badge {
    margin-left: auto;
    background: var(--danger-bg);
    color: var(--drk-accent);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
}
.section-card .section-body { padding: 0; }
.section-card .section-body.padded { padding: 20px 24px; }

@media (max-width: 767.98px) {
    .section-card .section-title { padding: 14px 16px; font-size: 0.95rem; }
    .section-card .section-body.padded { padding: 14px 16px; }

    /* Listen-Seiten (Mitglieder, Einsatzuebersicht, Artikel, Kleidung) wickeln
       ihre Mobile-Kacheln in eine .section-card. Da jede Kachel bereits eine
       eigene weisse Box ist, entstand der Eindruck einer zweiten weissen Box
       dahinter (sichtbar in den Luecken zwischen den Kacheln). Auf Mobile wird
       der Wrapper daher transparent gemacht -- die Kacheln schweben dann wie
       bei den Terminen auf dem grauen Seitenhintergrund. Der Titel behaelt
       seine eigene Karten-Optik als eigenstaendige Leiste. */
    .section-card:has(.mobile-card-list) {
        background: transparent;
        box-shadow: none;
        border-radius: 0;
        overflow: visible;
    }
    .section-card:has(.mobile-card-list) .section-title {
        background: var(--surface);
        border-radius: 14px;
        box-shadow: 0 2px 12px rgba(0,0,0,0.07);
        border-bottom: none;
        margin-bottom: 12px;
    }
}

/* ===== DATA ROWS (generisch, basierend auf profile-data-row) ===== */
.data-row {
    display: flex;
    padding: 13px 24px;
    border-bottom: 1px solid var(--border-light);
    align-items: center;
}
.data-row:last-child { border-bottom: none; }
.data-row .data-label {
    flex: 0 0 170px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}
.data-row .data-value {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 500;
}
.data-row .data-value.empty { color: #ccc; }
.data-row .data-value a { color: var(--drk-accent); text-decoration: none; }
.data-row .data-value a:hover { text-decoration: underline; }

@media (max-width: 991px) {
    .data-row { flex-direction: column; gap: 2px; padding: 10px 18px; }
    .data-row .data-label { flex: none; font-size: 0.78rem; }
    .data-row .data-value { font-size: 0.9rem; }
}

/* ===== DETAIL TABS (Pill-Style) ===== */
.detail-tabs {
    display: flex;
    gap: 4px;
    padding: 0;
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    list-style: none;
}
.detail-tab {
    border: none;
    background: var(--surface);
    color: var(--text-muted);
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    text-decoration: none;
}
.detail-tab:hover { color: var(--drk-accent); background: var(--danger-bg); text-decoration: none; }
.detail-tab.active {
    background: var(--drk-accent);
    color: var(--text-on-accent);
    box-shadow: 0 2px 8px rgba(var(--drk-accent-rgb),0.3);
}
.detail-tab .tab-badge {
    background: rgba(255,255,255,0.25);
    font-size: 0.68rem;
    padding: 2px 7px;
    border-radius: 8px;
    font-weight: 700;
}
.detail-tab:not(.active) .tab-badge {
    background: var(--surface-2);
    color: var(--text-faint);
}

@media (max-width: 767.98px) {
    .detail-tab { padding: 8px 14px; font-size: 0.78rem; }
}

/* ===== FILTER BAR ===== */
.filter-bar {
    padding: 16px 24px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}
.filter-bar .filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 160px;
}
.filter-bar .filter-group.search { flex: 2; min-width: 220px; }
.filter-bar .filter-label {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
}
.filter-bar .filter-input {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.88rem;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.filter-bar .filter-input:focus {
    outline: none;
    border-color: var(--drk-accent);
    box-shadow: 0 0 0 3px rgba(var(--drk-accent-rgb),0.1);
}
.filter-bar .filter-input::placeholder { color: var(--text-faint); }
.filter-bar .filter-actions { display: flex; gap: 6px; align-self: flex-end; }

@media (max-width: 767.98px) {
    .filter-bar { padding: 12px 16px; gap: 10px; }
    .filter-bar .filter-group { min-width: 100%; }
    .filter-bar .filter-group.search { min-width: 100%; }
}

/* ===== STATS ROW ===== */
.stats-row {
    display: flex;
    gap: 8px;
    padding: 0 24px 16px;
    flex-wrap: wrap;
}
.stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-2);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.stat-chip strong { color: var(--text); font-weight: 700; }
.stat-chip.highlight { background: var(--warning-bg); border-color: #fde68a; color: var(--warning-text); }
.stat-chip.danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger-text); }

@media (max-width: 767.98px) {
    .stats-row { padding: 0 16px 12px; }
}

/* ===== STAT CARDS (Dashboard) ===== */
.stat-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.stat-card-item {
    background: var(--surface);
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    padding: 24px;
    text-align: center;
}
.stat-card-number {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
}
.stat-card-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ===== DATA TABLE (generisch) ===== */
.data-table-redesign {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.data-table-redesign thead th {
    background: var(--surface-2);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-light);
    white-space: nowrap;
    text-align: left;
}
.data-table-redesign tbody tr { transition: background 0.15s; }
.data-table-redesign tbody tr:hover { background: var(--surface-2); }
.data-table-redesign tbody td {
    padding: 13px 16px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.data-table-redesign tbody tr:last-child td { border-bottom: none; }
/* Summen-/Fußzeile (z. B. „Gesamt") – gleiche Zellabstände wie der Body, klar abgesetzt */
.data-table-redesign tfoot td {
    padding: 13px 16px;
    font-size: 0.9rem;
    border-top: 2px solid var(--border);
    vertical-align: middle;
}
/* Randzellen bekommen mehr Luft zum Kartenrand, damit v. a. rechtsbündige
   Zahlenspalten nicht an der Box kleben */
.data-table-redesign thead th:first-child,
.data-table-redesign tbody td:first-child,
.data-table-redesign tfoot td:first-child { padding-left: 24px; }
.data-table-redesign thead th:last-child,
.data-table-redesign tbody td:last-child,
.data-table-redesign tfoot td:last-child { padding-right: 24px; }

/* Table cell helpers */
.cell-main { font-weight: 600; color: var(--text); }
.cell-sub { font-size: 0.75rem; color: var(--text-faint); margin-top: 1px; }
.cell-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text-muted);
    margin-right: 10px;
    flex-shrink: 0;
}
.cell-with-icon { display: flex; align-items: center; }
.action-group { display: flex; gap: 4px; }

/* ===== BADGES (ReDesign) ===== */
.badge-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    line-height: 1;
    vertical-align: middle;
}
.badge-status i {
    font-size: 0.72rem;
    line-height: 1;
}
.badge-ok { background: var(--success-bg); color: var(--success-text); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-danger { background: var(--danger-bg); color: var(--danger-text); }
.badge-info { background: var(--info-bg); color: var(--info-text); }
.badge-neutral { background: var(--surface-2); color: var(--text-muted); }
.badge-secondary { background: var(--surface-hover); color: var(--text-secondary); }
.badge-expired { background: var(--warning-bg); color: var(--warning-text); }

.badge-category-redesign {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--danger-bg);
    color: var(--drk-accent);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid rgba(var(--drk-accent-rgb),0.12);
}
.badge-warehouse-redesign {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--surface-3);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
}
.badge-group-redesign {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--danger-bg);
    color: var(--drk-accent);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(var(--drk-accent-rgb),0.12);
}
.badge-qual-redesign {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--surface-3);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

/* ===== QUANTITY BAR ===== */
.qty-bar { display: flex; align-items: center; gap: 8px; }
.qty-track {
    flex: 1; height: 6px; background: var(--surface-3);
    border-radius: 3px; overflow: hidden; max-width: 80px;
}
.qty-fill { height: 100%; border-radius: 3px; }
.qty-fill.ok { background: var(--success); }
.qty-fill.low { background: var(--warning); }
.qty-fill.critical { background: var(--danger); }
.qty-text { font-size: 0.85rem; font-weight: 600; min-width: 30px; }

/* ===== PAGINATION ===== */
.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    border-top: 1px solid var(--border-light);
}
.pagination-info { font-size: 0.78rem; color: var(--text-faint); }
.pagination-nav { display: flex; gap: 4px; }
.pagination-btn {
    border: 1px solid var(--border-light);
    background: var(--surface);
    color: var(--text-muted);
    border-radius: 7px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.15s;
}
.pagination-btn:hover { border-color: var(--drk-accent); color: var(--drk-accent); }
.pagination-btn.active { background: var(--drk-accent); color: var(--text-on-accent); border-color: var(--drk-accent); }

@media (max-width: 767.98px) {
    .pagination-bar { padding: 12px 16px; }
}

/* ===== FORM FIELDS (ReDesign) ===== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; }
.form-grid.single { grid-template-columns: 1fr; }

@media (max-width: 767.98px) {
    .form-grid { grid-template-columns: 1fr; gap: 12px; }
}

.field { display: flex; flex-direction: column; gap: 5px; }
.field.span-2 { grid-column: span 2; }

@media (max-width: 767.98px) {
    .field.span-2 { grid-column: span 1; }
}

.field-label { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); }
.field-label .required { color: var(--drk-accent); margin-left: 2px; }
.field-hint { font-size: 0.72rem; color: var(--text-faint); }
.field-input {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.field-input:focus {
    outline: none;
    border-color: var(--drk-accent);
    box-shadow: 0 0 0 3px rgba(var(--drk-accent-rgb),0.1);
}
.field-input::placeholder { color: var(--text-faint); }
.field-input.textarea { resize: vertical; min-height: 80px; }
.field-error { font-size: 0.72rem; color: var(--danger); font-weight: 500; }

/* Redesign Checkboxes */
.field-check { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.field-check input[type="checkbox"] {
    width: 20px; height: 20px; accent-color: var(--drk-accent); cursor: pointer;
}
.field-check label { font-size: 0.88rem; font-weight: 500; color: var(--text); cursor: pointer; }

/* Inline add form (z.B. Schichten) */
.inline-add-form {
    background: var(--surface-2);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}
.inline-add-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-faint);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Form footer */
.form-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 20px 24px;
    border-top: 1px solid var(--border-light);
}

@media (max-width: 767.98px) {
    .form-footer { flex-direction: column-reverse; padding: 14px 16px; }
    .form-footer .btn-drk, .form-footer .btn-ghost { width: 100%; justify-content: center; }
}

/* ===== QUICK LINKS ROW ===== */
.quick-links-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.quick-link-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.quick-link-item:hover {
    border-color: var(--drk-accent);
    color: var(--drk-accent);
    background: var(--danger-bg);
    transform: translateY(-1px);
    text-decoration: none;
}
.quick-link-item i { font-size: 1rem; }
.quick-link-item.link-danger { border-color: var(--danger-border); color: var(--danger-text); }
.quick-link-item.link-danger:hover { background: var(--danger-bg); }

/* ===== MEMBER HERO (Detail-Seite) ===== */
.member-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
}
.member-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--drk-accent);
    color: var(--text-on-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}
.member-hero-info { flex: 1; min-width: 0; }
.member-hero-name { font-size: 1.2rem; font-weight: 700; color: var(--text); }
.member-hero-email { font-size: 0.82rem; color: var(--text-faint); }
.member-hero-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

@media (max-width: 991px) {
    .member-hero { padding: 16px; gap: 12px; }
    .member-avatar { width: 48px; height: 48px; font-size: 1.1rem; }
    .member-hero-name { font-size: 1rem; }
}

/* ===== TWO COLUMN DETAIL GRID ===== */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 991px) {
    .detail-grid { grid-template-columns: 1fr; gap: 16px; }
}

/* ===== TOGGLE SWITCH (DRK-Rot) ===== */
.toggle-switch-drk {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.toggle-switch-drk input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-switch-drk .toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #ccc;
    border-radius: 24px;
    transition: 0.3s;
}
.toggle-switch-drk .toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: var(--surface);
    border-radius: 50%;
    transition: 0.3s;
}
.toggle-switch-drk input:checked + .toggle-slider { background: var(--drk-accent); }
.toggle-switch-drk input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ===== COLLAPSIBLE GROUP (Admin-Seiten) ===== */
.collapsible-group .collapsible-header {
    cursor: pointer;
    user-select: none;
}
.collapsible-group .collapsible-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.collapsible-group.open .collapsible-body {
    max-height: 2000px;
}

/* ===== MODAL REDESIGN ===== */
.modal-content {
    border: none;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    overflow: hidden;
}

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-light);
    border-left: 4px solid var(--drk-accent);
    background: var(--surface) !important;
    color: var(--text) !important;
    border-top-left-radius: 14px;
}

.modal-header .btn-close {
    filter: none !important;
    opacity: 0.5;
}

.modal-header .btn-close:hover {
    opacity: 1;
}

.modal-header .modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text) !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header .modal-title i {
    color: var(--drk-accent);
}

.modal-body {
    padding: 24px;
}

.modal-body .form-group {
    margin-bottom: 16px;
}

.modal-body .form-group label,
.modal-body label:not(.form-check-label) {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 5px;
    display: block;
}

.modal-body .form-control,
.modal-body .form-select {
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 9px 12px;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-body .form-control:focus,
.modal-body .form-select:focus {
    border-color: var(--drk-accent);
    box-shadow: 0 0 0 3px rgba(var(--drk-accent-rgb),0.1);
}

.modal-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border-light);
    background: var(--surface-2);
}

/* Buttons im Modal */
.modal .btn-drk {
    border-radius: 8px;
    font-weight: 600;
    padding: 9px 20px;
}

.modal .btn-ghost {
    border-radius: 8px;
}

/* ConfirmDelete Modal (cdm) */
.cdm-dialog {
    border-radius: 14px !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2) !important;
}

.cdm-header {
    padding: 18px 24px !important;
    border-left: 4px solid var(--drk-accent) !important;
    background: var(--surface) !important;
    color: var(--text) !important;
    border-top-left-radius: 14px !important;
    border-bottom: 1px solid var(--border-light) !important;
}

.cdm-header i { color: var(--drk-accent); }

.cdm-body {
    padding: 24px !important;
}

.cdm-footer {
    padding: 14px 24px !important;
    background: var(--surface-2) !important;
    border-top: 1px solid var(--border-light) !important;
}

/* ===== MOBILE: MODALS FULLSCREEN + TOUCH-TARGETS ===== */
@media (max-width: 575.98px) {
    /* Modals nutzen auf kleinen Geräten den gesamten Bildschirm */
    .modal-dialog {
        margin: 0;
        max-width: 100%;
        min-height: 100vh;
    }
    .modal-content {
        min-height: 100vh;
        border-radius: 0;
    }
    .modal-body {
        overflow-y: auto;
    }

    /* Touch-Targets: Buttons mindestens 44px hoch (Apple HIG) */
    .btn,
    .btn-drk,
    .btn-ghost,
    .btn-secondary,
    .btn-success,
    .btn-danger {
        min-height: 44px;
    }
}

/* ============================================================
   System Announcements — Banner, Cards, Bell
   ============================================================ */

/* Banner (sticky top, desktop only) */
.announcement-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    border-bottom: 2px solid;
    font-size: 14px;
    line-height: 1.4;
}
.announcement-banner-info {
    background: var(--info-bg);
    border-color: var(--info);
    color: var(--info-text);
}
.announcement-banner-warning {
    background: var(--warning-bg);
    border-color: var(--warning);
    color: var(--warning-text);
}
.announcement-banner-critical {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger-text);
}
.announcement-banner-icon { font-size: 20px; flex-shrink: 0; }
.announcement-banner-text { flex-grow: 1; }
.announcement-banner-count {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(0,0,0,0.1);
    font-weight: 600;
}
.announcement-banner-details-btn {
    background: rgba(0,0,0,0.08);
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    color: inherit;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
}
.announcement-banner-details-btn:hover { background: rgba(0,0,0,0.15); }

/* Card (used in Home list + mobile drawer) */
.announcement-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.announcement-card {
    border-radius: 8px;
    padding: 14px;
    border-left: 4px solid;
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.announcement-info     { background: var(--info-bg); border-color: var(--info); }
.announcement-warning  { background: var(--warning-bg); border-color: var(--warning); }
.announcement-critical { background: var(--danger-bg); border-color: var(--danger); }
.announcement-card-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 6px;
}
.announcement-card-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }
.announcement-card-title-wrap { flex-grow: 1; }
.announcement-card-severity-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(0,0,0,0.08);
    margin-right: 6px;
}
.announcement-card-title { margin: 0; font-size: 15px; font-weight: 600; }
.announcement-card-message { margin: 0 0 8px 0; font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.announcement-card-link {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    background: rgba(0,0,0,0.05);
    border-radius: 4px;
    text-decoration: none;
    color: inherit;
}
.announcement-card-link:hover { background: rgba(0,0,0,0.1); }
.announcement-card-ack-btn {
    align-self: flex-start;
    min-height: 44px;
    padding: 6px 14px;
    background: var(--danger-text);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.announcement-card-ack-btn:hover { background: var(--danger-text); }

/* Mobile Bell */
.announcement-bell {
    position: relative;
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    padding: 8px 10px;
    cursor: pointer;
    min-height: 44px;
    min-width: 44px;
}
.announcement-bell-badge {
    position: absolute;
    top: 4px;
    right: 2px;
    background: #fbbf24;
    color: var(--warning-text);
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

/* Drawer (mobile) */
.announcement-drawer-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1050;
}
.announcement-drawer {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    z-index: 1051;
    overflow-y: auto;
    box-shadow: -4px 0 12px rgba(0,0,0,0.2);
}
.announcement-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}
.announcement-drawer-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* App Footer */
.app-footer {
    text-align: center;
    padding: 1rem;
    font-size: 0.8rem;
    color: var(--text-faint);
}
.app-footer .dev-link {
    color: var(--text-muted);
    text-decoration: none;
}
.app-footer .dev-link:hover {
    color: var(--drk-accent);
}

/* ===== Dashboard & Screensaver ===== */

.dashboard-body {
    margin: 0;
    padding: 0;
    background: var(--surface-3);
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

.dashboard-layout-root {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: var(--surface-3);
}

.screensaver-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    background-size: cover;
    background-position: center;
}

.screensaver-dunkel { background-color: #0a0a0a; }

.screensaver-foto-dunkel::after,
.screensaver-foto-hell::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 0;
}

.screensaver-foto-dunkel { filter: brightness(0.4); }
.screensaver-foto-hell   { filter: brightness(0.75); }

/* Wasserzeichen */
.screensaver-watermark {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

/* Bokeh Blaulicht */
.bokeh-left,
.bokeh-right {
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    z-index: 2;
    background: radial-gradient(circle, rgba(30, 100, 255, var(--bl-alpha, 0.32)) 0%, transparent 70%);
}

.bokeh-left  { top: -60px; left: -80px; }
.bokeh-right { top: -60px; right: -80px; }

@keyframes bl-wechsel-left {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.05; }
}
@keyframes bl-wechsel-right {
    0%, 100% { opacity: 0.05; }
    50%      { opacity: 1; }
}
.bl-wechsel.bokeh-left-anim  { animation: bl-wechsel-left  calc(var(--bl-speed) * 2) ease-in-out infinite; }
.bl-wechsel.bokeh-right-anim { animation: bl-wechsel-right calc(var(--bl-speed) * 2) ease-in-out infinite; }

@keyframes bl-puls {
    0%, 100% { opacity: 0.15; }
    50%      { opacity: 1; }
}
.bl-puls.bokeh-left-anim,
.bl-puls.bokeh-right-anim { animation: bl-puls var(--bl-speed) ease-in-out infinite; }

@keyframes bl-ambient {
    0%, 100% { opacity: 0.2; }
    50%      { opacity: 0.55; }
}
.bl-ambient.bokeh-left-anim  { animation: bl-ambient calc(var(--bl-speed) * 3) ease-in-out infinite; }
.bl-ambient.bokeh-right-anim { animation: bl-ambient calc(var(--bl-speed) * 3) ease-in-out infinite; animation-delay: calc(var(--bl-speed) * 1.5); }

/* Inhalt */
.screensaver-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: var(--text-on-accent);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.screensaver-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.screensaver-logo img {
    max-width: clamp(120px, 18vw, 240px);
    max-height: clamp(80px, 12vw, 160px);
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0.95;
}

/* Default ✚ symbol KEEPS the circle */
.screensaver-logo-default {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: var(--drk-accent);
    color: var(--text-on-accent);
    font-size: 70px;
    border: 4px solid rgba(255,255,255,0.18);
}

@keyframes logo-glow-pulse {
    0%, 100% { filter: drop-shadow(0 0 12px rgba(var(--drk-accent-rgb),0.5)); }
    50%      { filter: drop-shadow(0 0 28px rgba(var(--drk-accent-rgb),0.9)); }
}
.screensaver-logo.logo-glow img,
.screensaver-logo.logo-glow .screensaver-logo-default {
    animation: logo-glow-pulse 3s ease-in-out infinite;
}

.screensaver-clock {
    font-size: clamp(4rem, 10vw, 8rem);
    font-weight: 200;
    letter-spacing: 0.05em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.screensaver-date {
    font-size: clamp(1rem, 2.5vw, 1.6rem);
    opacity: 0.7;
    font-weight: 300;
    text-transform: capitalize;
}

.screensaver-tenant {
    font-size: clamp(0.9rem, 2vw, 1.3rem);
    opacity: 0.5;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

@keyframes tap-hint-blink {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 0.9; }
}
.screensaver-tap-hint {
    font-size: 0.85rem;
    opacity: 0.4;
    margin-top: 24px;
    letter-spacing: 0.08em;
}
.screensaver-tap-hint.tap-blink {
    animation: tap-hint-blink 2.5s ease-in-out infinite;
}

/* ===== Dashboard Tab-Inhalte ===== */
.dashboard-tab-content {
    padding: 24px;
    height: calc(100vh - 140px);
    overflow-y: auto;
    color: #e0e0e0;
}

.dashboard-loading,
.dashboard-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 10px;
    color: var(--text-faint);
    text-align: center;
}
.dashboard-empty i { font-size: 2rem; opacity: 0.5; }
.dashboard-empty p { margin: 0; font-size: 0.85rem; }

.dashboard-news-list { display: flex; flex-direction: column; gap: 10px; }
.dashboard-news-card {
    background: var(--surface-2);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 12px 14px;
    border-left: 4px solid var(--drk-accent);
}
.news-title { font-size: 0.95rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.news-body  { color: var(--text-secondary); line-height: 1.4; font-size: 0.85rem; }
.news-date  { font-size: 0.7rem; color: var(--text-faint); margin-top: 6px; }

.dashboard-event-list { display: flex; flex-direction: column; gap: 12px; }
.dashboard-event-card {
    display: flex;
    gap: 20px;
    align-items: center;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 16px 20px;
}
.event-date { text-align: center; min-width: 48px; }
.event-day   { display: block; font-size: 1.8rem; font-weight: 700; line-height: 1; }
.event-month { display: block; font-size: 0.75rem; text-transform: uppercase; opacity: 0.6; }
.event-title { font-size: 1rem; font-weight: 600; }
.event-meta  { font-size: 0.8rem; opacity: 0.6; margin-top: 4px; }

.dashboard-aao-list { display: flex; flex-wrap: wrap; gap: 10px; }
.dashboard-aao-card {
    background: var(--danger-bg);
    border: 1px solid rgba(var(--drk-accent-rgb),0.2);
    border-left: 4px solid var(--drk-accent);
    border-radius: 8px;
    padding: 12px 16px;
    min-width: 160px;
}
.aao-name { font-size: 1rem; font-weight: 700; color: var(--text); }
.aao-desc  { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

.dashboard-order-list { display: flex; flex-direction: column; gap: 10px; }
.dashboard-order-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 14px 20px;
}
.order-id     { font-size: 0.8rem; opacity: 0.4; min-width: 40px; }
.order-info   { flex: 1; }
.order-title  { font-weight: 600; }
.order-meta   { font-size: 0.8rem; opacity: 0.6; }
.order-status { margin-left: auto; font-size: 0.8rem; padding: 4px 12px; border-radius: 20px; }
.status-open      { background: rgba(255,200,0,0.2);  color: #ffc800; }
.status-progress  { background: rgba(0,140,255,0.2);  color: var(--info); }
.status-delivered { background: rgba(0,200,100,0.2);  color: #00c864; }

.dashboard-overview-grid { display: flex; gap: 24px; flex-wrap: wrap; }
.overview-card {
    background: rgba(255,255,255,0.05);
    border-radius: 16px;
    padding: 32px 40px;
    text-align: center;
    min-width: 240px;
    flex: 1;
}
.overview-card i { font-size: 2.5rem; opacity: 0.5; }
.overview-clock { font-size: 3rem; font-weight: 200; font-variant-numeric: tabular-nums; margin-top: 12px; }
.overview-date  { opacity: 0.6; margin-top: 8px; }
.overview-label { font-size: 0.8rem; text-transform: uppercase; opacity: 0.5; margin-top: 8px; }
.overview-value { font-size: 1.4rem; font-weight: 600; margin-top: 4px; }

/* ===== Dashboard Haupt-Layout ===== */
.dashboard-root {
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    background: var(--surface-3);
    color: var(--text);
    overflow: hidden;
}

.dashboard-fullscreen-center {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-3);
    color: var(--text);
}

.dashboard-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 28px;
    background: var(--surface);
    border-bottom: 1px solid var(--border-light);
    height: 56px;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.topbar-left, .topbar-right { display: flex; align-items: center; }
.topbar-tenant {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}
.topbar-clock  {
    font-size: 1.4rem;
    font-weight: 300;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

/* ===== Scene Bar (below topbar) ===== */
.dashboard-scene-bar {
    display: flex;
    gap: 6px;
    padding: 10px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border-light);
    overflow-x: auto;
    flex-shrink: 0;
}
.dashboard-scene-pill {
    flex: 1 1 0;
    min-width: 140px;
    max-width: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border: 2px solid var(--border-light);
    background: var(--surface-2);
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 56px;
    white-space: nowrap;
}
.dashboard-scene-pill:hover {
    border-color: var(--text-faint);
    background: var(--surface);
}
.dashboard-scene-pill.active {
    color: var(--text-on-accent);
    background: var(--drk-accent);
    border-color: var(--drk-accent);
    box-shadow: 0 4px 16px rgba(var(--drk-accent-rgb),0.3);
}
.dashboard-scene-pill .scene-icon { font-size: 1.2rem; }

.dashboard-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 16px 0;
    background: rgba(0,0,0,0.4);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
    overflow-x: auto;
}
.dashboard-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.5);
    font-size: 0.95rem;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
    white-space: nowrap;
}
.dashboard-tab:hover  { color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.05); }
.dashboard-tab.active { color: var(--text-on-accent); background: rgba(229,62,62,0.15); border-bottom: 2px solid var(--danger); }
.tab-icon  { font-size: 1.1rem; }
.tab-label { font-weight: 500; }

.dashboard-progress-bar {
    height: 3px;
    background: rgba(255,255,255,0.08);
    flex-shrink: 0;
}
@keyframes progress-advance {
    from { width: 0%; }
    to   { width: 100%; }
}
.dashboard-progress-fill {
    height: 100%;
    background: var(--danger);
    width: 0%;
    animation: progress-advance linear forwards;
}

.dashboard-content {
    flex: 1;
    overflow: hidden;
}

/* ===== Dashboard Admin Wizard ===== */
.wizard-steps {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 80px;
    cursor: default;
}
.wizard-step.done { cursor: pointer; }
.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.9rem;
}
.wizard-step.active .step-number { border-color: var(--danger); color: var(--danger); }
.wizard-step.done .step-number   { border-color: var(--success); background: var(--success); color: var(--text-on-accent); }
.step-label { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.template-card {
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--surface);
}
.template-card:hover     { border-color: var(--danger); background: rgba(229,62,62,0.04); }
.template-card.selected  { border-color: var(--danger); background: rgba(229,62,62,0.08); }
.template-name { font-weight: 700; margin-bottom: 6px; }
.template-tabs { font-size: 0.8rem; color: var(--text-muted); }

.tab-config-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    flex-wrap: wrap;
}
.tab-icon-preview { font-size: 1.2rem; min-width: 24px; text-align: center; }
.tab-key-label    { min-width: 160px; }
.tab-label-input  { max-width: 220px; }

.dashboard-edit-wizard {
    max-width: 900px;
}
.dashboard-edit-wizard .form-control,
.dashboard-edit-wizard .form-select {
    max-width: 600px;
}
.dashboard-edit-wizard textarea.form-control {
    max-width: 100%;
}

/* ================================================================
   SCREENSAVER CONFIGURATOR  (cfg- prefix to avoid collisions)
   ================================================================ */

/* Expand wizard when configurator is present */
.dashboard-edit-wizard:has(.cfg-configurator) {
    max-width: 1200px;
}
.dashboard-edit-wizard:has(.dle-root) {
    max-width: none;
}
.dashboard-edit-wizard:has(.cfg-configurator) .form-control,
.dashboard-edit-wizard:has(.cfg-configurator) .form-select {
    max-width: 100%;
}

/* Layout */
.cfg-configurator {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    color: var(--text);
}

.cfg-panel {
    width: 290px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cfg-preview-panel {
    flex: 1;
    min-width: 300px;
}

/* Config sections */
.cfg-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    transition: opacity 0.2s;
}

.cfg-section h4 {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    margin-top: 0;
}

.cfg-section--disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* Option buttons (Modus) */
.cfg-option-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cfg-opt-btn {
    padding: 9px 12px;
    border-radius: 8px;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cfg-opt-btn:hover { border-color: var(--text-faint); color: var(--text); }
.cfg-opt-btn.active { border-color: var(--drk-accent); background: rgba(var(--drk-accent-rgb),0.08); color: var(--drk-accent); }

.cfg-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-strong);
    flex-shrink: 0;
}

.cfg-opt-btn.active .cfg-dot {
    background: var(--drk-accent);
    box-shadow: 0 0 6px rgba(var(--drk-accent-rgb),0.4);
}

/* Toggle switch */
.cfg-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
}

.cfg-toggle-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.cfg-toggle {
    width: 40px;
    height: 22px;
    border-radius: 11px;
    background: var(--border-strong);
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.cfg-toggle.on { background: var(--drk-accent); }

.cfg-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff; /* Toggle-Knopf bleibt in beiden Themes weiss */
    transition: transform 0.2s;
}

.cfg-toggle.on::after { transform: translateX(18px); }

/* Chips */
.cfg-chips-group { margin-bottom: 8px; }

.cfg-chips-label {
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.cfg-chips-row {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.cfg-chip {
    padding: 6px 11px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 600;
    background: var(--surface);
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.cfg-chip:hover { border-color: var(--text-faint); color: var(--text-secondary); }
.cfg-chip.active { border-color: var(--drk-accent); background: rgba(var(--drk-accent-rgb),0.08); color: var(--drk-accent); }

/* Custom timeout input */
.cfg-custom-timeout {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.cfg-number-input {
    width: 80px;
    padding: 5px 8px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 7px;
    color: var(--text);
    font-size: 13px;
}

.cfg-number-input:focus {
    outline: none;
    border-color: var(--drk-accent);
}

/* Blaulicht picker */
.cfg-blau-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.cfg-blau-opt {
    border-radius: 9px;
    border: 2px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.15s;
}

.cfg-blau-opt:hover { border-color: var(--text-faint); }
.cfg-blau-opt.active { border-color: var(--info); background: rgba(37,99,235,0.08); }

.cfg-blau-mini {
    height: 52px;
    position: relative;
    background: #050a12;
    overflow: hidden;
}

.cfg-blau-label {
    padding: 5px 7px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
}

.cfg-blau-opt.active .cfg-blau-label { color: var(--info); }

/* mini bokeh dots */
.cfg-mb {
    position: absolute;
    border-radius: 50%;
}

/* Pattern chips */
.cfg-pattern-chips {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.cfg-pat-chip {
    flex: 1;
    min-width: 55px;
    padding: 7px 5px;
    border-radius: 8px;
    border: 2px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.cfg-pat-chip:hover { border-color: var(--text-faint); }
.cfg-pat-chip.active { border-color: var(--drk-accent); background: rgba(var(--drk-accent-rgb),0.08); }

.cfg-pat-preview {
    height: 28px;
    border-radius: 4px;
    margin-bottom: 4px;
    overflow: hidden;
}

.cfg-pat-label {
    font-size: 9px;
    color: var(--text-muted);
    font-weight: 600;
}

.cfg-pat-chip.active .cfg-pat-label { color: var(--drk-accent); }

/* Direction chips */
.cfg-dir-group { margin-top: 4px; transition: opacity 0.2s; }
.cfg-dir-group--disabled { opacity: 0.3; pointer-events: none; }

.cfg-dir-chips {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.cfg-dir-chip {
    padding: 8px 6px;
    border-radius: 8px;
    border: 2px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    font-size: 18px;
    color: var(--text-secondary);
}

.cfg-dir-chip:hover { border-color: var(--text-faint); }
.cfg-dir-chip.active { border-color: var(--drk-accent); background: rgba(var(--drk-accent-rgb),0.08); }

.cfg-dir-chip span {
    display: block;
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 600;
}

.cfg-dir-chip.active span { color: var(--drk-accent); }

/* Preview panel */
.cfg-preview-title {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cfg-screen-frame {
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #334155;
    height: 440px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Background classes */
.cfg-bg-dunkel      { background: #050a12; }
.cfg-bg-foto-dunkel { background: linear-gradient(160deg,#0d1f3c,#0a1628 60%,#050a12); }
.cfg-bg-foto-hell   { background: linear-gradient(160deg,#e2e8f0,#cbd5e1 60%,#94a3b8); }
.cfg-bg-deaktiviert { background: #111827; }

/* Watermark layer */
.cfg-watermark-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

/* Blaulicht layer */
.cfg-blau-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
    overflow: hidden;
}

/* Idle content */
.cfg-idle-content {
    position: relative;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Logo styles */
.cfg-logo {
    margin-bottom: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cfg-logo img {
    max-width: 120px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.logo-normal-preview {
    /* plain: no glow */
}

@keyframes cfg-glow-pulse {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(var(--drk-accent-rgb),0.45)); }
    50%      { filter: drop-shadow(0 0 18px rgba(var(--drk-accent-rgb),0.85)); }
}
.logo-glow-preview img,
.logo-glow-preview .cfg-logo-default {
    animation: cfg-glow-pulse 2.5s ease-in-out infinite;
}

/* Clock / date / org */
.cfg-clock-dark  { font-size: 48px; font-weight: 700; color: #f1f5f9; letter-spacing: 4px; line-height: 1; text-shadow: 0 2px 16px rgba(0,0,0,0.9); }
.cfg-clock-light { font-size: 48px; font-weight: 700; color: var(--text); letter-spacing: 4px; line-height: 1; }
.cfg-date-dark   { font-size: 10px; color: var(--text-secondary); margin-top: 8px; letter-spacing: 2px; text-transform: uppercase; }
.cfg-date-light  { font-size: 10px; color: var(--text-muted); margin-top: 8px; letter-spacing: 2px; text-transform: uppercase; }
.cfg-org-dark    { font-size: 9px; color: var(--text-faint); margin-top: 6px; }
.cfg-org-light   { font-size: 9px; color: var(--text); margin-top: 6px; opacity: 0.5; }

/* Tap hint */
.cfg-tap-hint {
    position: absolute;
    bottom: 16px;
    font-size: 9px;
    letter-spacing: 2px;
    animation: cfg-blink 2.5s ease-in-out infinite;
    z-index: 5;
}

.cfg-tap-light { color: #cbd5e1; }
.cfg-tap-dark  { color: var(--text); }

/* Always-active badge */
.cfg-always-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--success);
    color: var(--text-on-accent);
    font-size: 9px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 99px;
    z-index: 6;
}

/* Mini dashboard (for "off" mode) */
.cfg-dashboard-mini {
    width: 80%;
    border-radius: 8px;
    border: 1px solid #334155;
    overflow: hidden;
}

.cfg-dm-bar {
    background: #1e293b;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cfg-dm-clock {
    font-size: 16px;
    font-weight: 700;
    color: #60a5fa;
}

.cfg-dm-name {
    font-size: 9px;
    color: var(--text-muted);
    margin-left: auto;
}

.cfg-dm-tabs {
    display: flex;
    gap: 3px;
    padding: 5px 8px;
    background: #0f172a;
}

.cfg-dm-tab {
    flex: 1;
    height: 12px;
    border-radius: 3px;
}

.cfg-dm-tab.on  { background: var(--danger); }
.cfg-dm-tab.off { background: #334155; }

.cfg-dm-body {
    height: 80px;
    background: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 11px;
}

/* ── Keyframes ────────────────────────────────────────────────── */

/* Mini bokeh in blaulicht picker */
@keyframes cfg-mpa { 0%,44%{opacity:1} 50%,94%{opacity:0} 100%{opacity:1} }
@keyframes cfg-mpb { 0%,44%{opacity:0} 50%,94%{opacity:1} 100%{opacity:0} }
@keyframes cfg-mpp { 0%,100%{opacity:0.05} 50%{opacity:1} }

/* Preview bokeh */
@keyframes cfg-bokeh-a { 0%,44%{opacity:1} 50%,94%{opacity:0} 100%{opacity:1} }
@keyframes cfg-bokeh-b { 0%,44%{opacity:0} 50%,94%{opacity:1} 100%{opacity:0} }
@keyframes cfg-bokeh-p { 0%,100%{opacity:0.04} 50%{opacity:1} }

/* Glow pulse for logo */
@keyframes cfg-glow-pulse {
    0%,100% { filter: drop-shadow(0 0 8px rgba(229,62,62,0.4)) drop-shadow(0 0 20px rgba(229,62,62,0.25)); }
    50%      { filter: drop-shadow(0 0 18px rgba(229,62,62,0.7)) drop-shadow(0 0 45px rgba(229,62,62,0.55)); }
}

/* Blink for tap hint */
@keyframes cfg-blink { 0%,100%{opacity:0.35} 50%{opacity:0.9} }

/* ── Mobile responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
    .cfg-configurator { flex-direction: column; }
    .cfg-panel { width: 100%; }
    .cfg-screen-frame { height: 320px; }
    .cfg-clock-dark, .cfg-clock-light { font-size: 36px; }
}

/* ===== Dashboard Widget Styles wurden nach css/dashboard.css migriert ===== */
/* Das Glassmorphism-Design uebernimmt jetzt vollstaendig dashboard.css. */
.dw-container { container-type: inline-size; }

/* TenantInfo widget */
.dw-tenant-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    padding: 16px;
}
.dw-tenant-logo {
    max-width: 70%;
    max-height: 60%;
    object-fit: contain;
    opacity: 0.9;
}
.dw-tenant-name {
    font-size: clamp(0.9rem, 2.5cqw, 1.4rem);
    font-weight: 600;
    color: var(--text);
}
.dw-tenant-city {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== Dashboard Kiosk: Gridstack overrides ===== */
.dashboard-grid.grid-stack {
    background: transparent;
    padding: 12px;
    height: 100%;
}
.dashboard-grid .grid-stack-item-content {
    inset: 0 !important;
    overflow: hidden !important;
    border-radius: 10px;
}

/* Scene tabs (replacing old dashboard-tabs) */
.dashboard-scene-tabs {
    display: inline-flex;
    gap: 4px;
    background: rgba(255,255,255,0.04);
    padding: 4px;
    border-radius: 8px;
}
.dashboard-scene-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.55);
    font-size: 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 36px;
}
.dashboard-scene-tab:hover { color: rgba(255,255,255,0.85); }
.dashboard-scene-tab.active {
    color: var(--text-on-accent);
    background: rgba(229,62,62,0.25);
}
.scene-icon { font-size: 1rem; }
.scene-label { font-weight: 500; }

/* Empty-scene placeholder */
.dashboard-empty-scene {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-faint);
    gap: 12px;
}
.dashboard-empty-scene i { font-size: 4rem; }
.dashboard-empty-scene p { font-size: 1.1rem; }

/* Error state */
.dashboard-error {
    color: var(--text-secondary);
    text-align: center;
}
.dashboard-error i { font-size: 3rem; display: block; margin-bottom: 12px; color: var(--drk-accent); }

/* ===== Dashboard Layout Editor (restructured) ===== */
.dle-root {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 600px;
}

.dle-bottom {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 12px;
    flex: 1;
    min-height: 0;
}

/* Top tab bar — visually mirrors the kiosk dashboard-scene-bar */
.dle-tabs-bar {
    display: flex;
    gap: 6px;
    padding: 8px;
    background: var(--surface);
    border-radius: 10px;
    overflow-x: auto;
    flex-shrink: 0;
    border: 1px solid var(--border-light);
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.dle-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--surface-2);
    color: var(--text-secondary);
    border: 2px solid var(--border-light);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    min-height: 44px;
    flex-shrink: 0;
}
.dle-tab:hover {
    background: var(--surface);
    border-color: var(--text-faint);
}
.dle-tab.active {
    background: var(--drk-accent);
    color: var(--text-on-accent);
    border-color: var(--drk-accent);
    box-shadow: 0 4px 12px rgba(var(--drk-accent-rgb),0.3);
}
.dle-tab-icon { font-size: 1rem; flex-shrink: 0; }
.dle-tab-name {
    border: none;
    background: transparent;
    color: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    outline: none;
    min-width: 60px;
    width: auto;
    padding: 0;
}
.dle-tab.active .dle-tab-name { color: var(--text-on-accent); font-weight: 600; }
.dle-tab-name:focus { background: rgba(0,0,0,0.05); border-radius: 4px; padding: 0 4px; }
.dle-tab.active .dle-tab-name:focus { background: rgba(255,255,255,0.15); }
.dle-tab-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    background: rgba(0,0,0,0.05);
    color: var(--text-muted);
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.8rem;
    margin-left: 4px;
    transition: all 0.15s;
}
.dle-tab-delete:hover { background: var(--drk-accent); color: var(--text-on-accent); }
.dle-tab.active .dle-tab-delete { background: rgba(255,255,255,0.25); color: var(--text-on-accent); }
.dle-tab.active .dle-tab-delete:hover { background: rgba(0,0,0,0.3); }
.dle-tab-add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--surface-2);
    color: var(--text-muted);
    border: 2px dashed var(--border-strong);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s;
    flex-shrink: 0;
}
.dle-tab-add:hover {
    border-color: var(--drk-accent);
    color: var(--drk-accent);
    background: rgba(var(--drk-accent-rgb),0.04);
    border-style: solid;
}

/* Old sidebar styles — unused but kept for reference */
.dle-scenes-panel {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.dle-palette-panel,
.dle-canvas-panel {
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.dle-canvas-panel { min-width: 0; }
.dle-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}
.dle-canvas-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: normal;
}

/* Scene list */
.dle-scenes-list { padding: 8px; flex: 1; overflow-y: auto; }
.dle-scene-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
}
.dle-scene-item:hover { background: rgba(229,62,62,0.04); }
.dle-scene-item.active { border-color: var(--drk-accent); background: rgba(229,62,62,0.08); }
.dle-scene-name {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.85rem;
    padding: 4px 6px;
    outline: none;
    min-width: 0;
}
.dle-empty { color: var(--text-faint); font-size: 0.8rem; padding: 12px; text-align: center; }

/* Canvas */
.dle-canvas-wrapper {
    flex: 1;
    overflow: auto;
    padding: 8px;
    background: repeating-linear-gradient(0deg, transparent 0, transparent 59px, rgba(0,0,0,0.03) 59px, rgba(0,0,0,0.03) 60px),
                repeating-linear-gradient(90deg, transparent 0, transparent calc((100% - 8px*11) / 12 - 1px), rgba(0,0,0,0.03) calc((100% - 8px*11) / 12 - 1px), rgba(0,0,0,0.03) calc((100% - 8px*11) / 12));
}
.dle-canvas.grid-stack { background: transparent; }
.dle-canvas .grid-stack-item-content {
    inset: 0 !important;
    overflow: hidden !important;
    border-radius: 8px;
}
/* .dle-widget-card, .dle-widget-icon, .dle-widget-label, and unscoped .dle-widget-remove
   were removed — dead code from the v1 placeholder-card approach.
   The live-preview approach uses .dle-widget-frame/.dle-widget-render/.dle-widget-overlay. */
.dle-empty-canvas {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-faint);
    gap: 12px;
}
.dle-empty-canvas i { font-size: 3rem; }

/* Alte .dle-inspector-Styles wurden nach css/dashboard.css migriert und
   ueberschrieben das neue Fullscreen-Layout (max-height:50%) -- deshalb
   ENTFERNT. Spezifische Inspector-Header-Styles bleiben unten erhalten. */
.dle-inspector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: linear-gradient(180deg, var(--danger-bg) 0%, var(--surface) 100%);
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    position: sticky;
    top: 0;
    z-index: 1;
}
.dle-inspector-header > span:first-child::before {
    content: "✏️";
    margin-right: 6px;
}
.dle-inspector-body { padding: 12px 14px; }
.dle-gallery-inspector h6 {
    color: var(--drk-accent);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

/* Palette */
.dle-palette-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.dle-palette-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
}
.dle-palette-item:hover:not(:disabled) { border-color: var(--drk-accent); background: rgba(229,62,62,0.04); }
.dle-palette-item:disabled { opacity: 0.5; cursor: not-allowed; }
.dle-palette-icon { font-size: 1.4rem; flex-shrink: 0; }
.dle-palette-info { flex: 1; min-width: 0; }
.dle-palette-name { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.dle-palette-size { font-size: 0.7rem; color: var(--text-faint); }
.dle-palette-item i.bi-plus-lg { color: var(--text-muted); }

/* Responsive */
@media (max-width: 1100px) {
    .dle-bottom { grid-template-columns: 1fr; }
}

/* ===== Template Thumbnails ===== */
.dt-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--surface-3);
    border-radius: 6px;
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
}
.dt-thumb-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: 1fr;
    gap: 2px;
    padding: 4px;
    height: 100%;
}
.dt-thumb-tile {
    background: var(--drk-accent);
    opacity: 0.85;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-on-accent);
    font-size: 0.7rem;
    overflow: hidden;
}
.dt-thumb-icon { font-size: 0.75rem; }
.dt-thumb-empty {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-faint);
    font-size: 0.85rem;
}
.dt-thumb-multi-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.7);
    color: var(--text-on-accent);
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

/* ===== Configurator Logo Upload ===== */
.cfg-logo-upload-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}
.cfg-logo-preview {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border: 1px dashed var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    overflow: hidden;
}
.cfg-logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.cfg-logo-placeholder {
    font-size: 0.7rem;
    color: var(--text-faint);
    text-align: center;
}
.cfg-logo-upload-actions { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cfg-logo-input { display: none; }
.cfg-btn-upload {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--drk-accent);
    color: var(--text-on-accent);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: background 0.15s;
}
.cfg-btn-upload:hover { filter: brightness(0.9); }
.cfg-btn-remove {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    align-self: flex-start;
}
.cfg-btn-remove:hover { border-color: var(--drk-accent); color: var(--drk-accent); }
.cfg-logo-hint { font-size: 0.7rem; color: var(--text-faint); }
.cfg-logo-default {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--drk-accent);
    color: var(--text-on-accent);
    font-size: 44px;
    border: 3px solid rgba(255,255,255,0.15);
}

/* ============================================================
   Dashboard Layout Editor — Live-Preview overlay styles
   ============================================================ */
.dle-widget-frame {
    /* NOTE: this class is on the same element as .grid-stack-item-content,
       which gridstack styles with position:absolute; inset:0. Do NOT set position
       here — that would break gridstack's sizing. Children with position:absolute
       resolve against this element correctly because absolute is a positioning context. */
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.dle-widget-frame:hover {
    border-color: rgba(var(--drk-accent-rgb),0.3);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.dle-widget-frame.selected {
    border-color: var(--drk-accent);
    box-shadow: 0 0 0 3px rgba(var(--drk-accent-rgb),0.15);
}
.dle-widget-render {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.dle-widget-overlay {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: transparent;
    z-index: 2;
}
.dle-widget-overlay-label {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0,0,0,0.75);
    color: var(--text-on-accent);
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
}
.dle-widget-frame:hover .dle-widget-overlay-label,
.dle-widget-frame.selected .dle-widget-overlay-label {
    opacity: 1;
}
.dle-widget-frame .dle-widget-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.75);
    color: var(--text-on-accent);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
    z-index: 3;
}
.dle-widget-frame:hover .dle-widget-remove,
.dle-widget-frame.selected .dle-widget-remove {
    opacity: 1;
}
.dle-widget-frame .dle-widget-remove:hover { background: var(--drk-accent); }

/* ============================================================
   Dashboard Widget: Termine — timeline mirroring Home's UpcomingEventsWidget
   ============================================================ */
.dwt-body { padding: 12px 14px !important; }

.dwt-timeline {
    position: relative;
    padding-left: 28px;
}
.dwt-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--surface-hover);
    border-radius: 1px;
}

.dwt-tl-item {
    position: relative;
    display: flex;
    gap: 0.65rem;
    padding: 0.5rem 0;
    color: inherit;
}
.dwt-tl-item:hover .dwt-tl-content {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.dwt-tl-dot-wrap {
    position: absolute;
    left: -22px;
    top: 0.65rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
}
.dwt-tl-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dwt-tl-date {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 60px;
    flex-shrink: 0;
    padding-top: 0.15rem;
}
.dwt-tl-date span {
    display: block;
    font-size: 0.6rem;
    font-weight: 400;
    color: var(--text-faint);
    text-transform: capitalize;
}

.dwt-tl-content {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    min-width: 0;
    transition: box-shadow 0.15s, transform 0.15s;
}
.dwt-tl-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dwt-tl-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
}
.dwt-tl-meta i { font-size: 0.72rem; }

.dwt-tl-foot {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.3rem;
}
.dwt-tl-type {
    font-size: 0.6rem;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 600;
    color: var(--text-on-accent);
    letter-spacing: 0.03em;
}

/* ============================================================
   Dashboard Widget: Bestellungen — light card style
   ============================================================ */
.dwb-body { padding: 10px 12px !important; }
.dwb-list { display: flex; flex-direction: column; gap: 8px; }
.dwb-card {
    background: var(--surface-2);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--text-muted);
    border-radius: 6px;
    padding: 10px 12px;
    transition: transform 0.15s, box-shadow 0.15s;
    position: relative;
}
.dwb-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.dwb-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    padding-right: 70px;
}
.dwb-id {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 600;
    background: var(--surface-hover);
    padding: 1px 6px;
    border-radius: 4px;
    white-space: nowrap;
}
.dwb-title {
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}
.dwb-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.7rem;
    color: var(--text-muted);
}
.dwb-meta i { font-size: 0.7rem; }
.dwb-status {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}
.dwb-status.status-open      { background: var(--warning-bg); color: var(--warning-text); }
.dwb-status.status-approved  { background: var(--info-bg); color: var(--info-text); }
.dwb-status.status-progress  { background: var(--info-bg); color: var(--info-text); }
.dwb-status.status-delivered { background: var(--success-bg); color: var(--success-text); }
.dwb-status.status-cancelled { background: var(--danger-bg); color: var(--danger-text); }

/* ============================================================
   Dashboard Widget: Raumbuchungen — Wochen-Kalender
   ============================================================ */
.dwr-body { padding: 0 !important; overflow: hidden; }
.dwr-week-label {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
}
.dwr-cal {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: auto;
}
.dwr-cal-grid {
    display: grid;
    grid-template-columns: 48px repeat(7, 1fr);
    grid-auto-rows: 30px;
    min-width: 540px;
}
.dwr-cal-corner {
    grid-column: 1;
    grid-row: 1;
    background: var(--surface-2);
    border-right: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    left: 0;
    z-index: 4;
}
.dwr-cal-dayhead {
    grid-row: 1;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border-light);
    border-right: 1px solid var(--border-light);
    padding: 4px 6px;
    text-align: center;
    font-size: 0.7rem;
    line-height: 1.2;
    position: sticky;
    top: 0;
    z-index: 3;
}
.dwr-cal-dayhead.today { background: rgba(var(--drk-accent-rgb),0.08); color: var(--drk-accent); }
.dwr-cal-dayhead .dwr-cal-dayname { display: block; font-weight: 700; }
.dwr-cal-dayhead .dwr-cal-daydate { display: block; font-size: 0.6rem; color: var(--text-faint); }
.dwr-cal-dayhead.today .dwr-cal-daydate { color: var(--drk-accent); opacity: 0.8; }
.dwr-cal-hour {
    grid-column: 1;
    background: var(--surface-2);
    border-right: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    font-size: 0.6rem;
    color: var(--text-faint);
    text-align: center;
    padding-top: 2px;
    font-variant-numeric: tabular-nums;
    position: sticky;
    left: 0;
    z-index: 2;
}
.dwr-cal-slot {
    border-right: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    background: var(--surface);
}
.dwr-cal-slot.today { background: rgba(var(--drk-accent-rgb),0.025); }

/* Booking blocks layered over the slots — overlay uses same grid */
.dwr-cal-overlay {
    position: absolute;
    top: 30px; /* skip the header row */
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    display: grid;
    grid-template-columns: 48px repeat(7, 1fr);
}
.dwr-block {
    position: absolute;
    grid-row: 1;
    margin: 1px 2px;
    width: calc(100% - 4px);
    border-radius: 3px;
    color: var(--text-on-accent);
    padding: 2px 4px;
    font-size: 0.65rem;
    line-height: 1.15;
    overflow: hidden;
    pointer-events: auto;
    cursor: default;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.dwr-block-time { display: block; font-weight: 700; font-variant-numeric: tabular-nums; }
.dwr-block-room { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dwr-block-booker { display: block; opacity: 0.85; font-size: 0.6rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Admin gallery grid */
.gallery-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}
.gallery-admin-card {
    background: var(--surface-2);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.gallery-admin-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}
.gallery-admin-info { padding: 10px; }

/* Dashboard widget: Bilder slideshow */
.dwg-body { padding: 0 !important; position: relative; }
.dwg-stage {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.dwg-stage img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: dwg-fadein 0.5s ease;
}
@keyframes dwg-fadein {
    from { opacity: 0; }
    to { opacity: 1; }
}
.dwg-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
    color: var(--text-on-accent);
    padding: 16px 14px 10px;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
}
.dwg-dots {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
}
.dwg-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
}
.dwg-dot.active {
    background: var(--surface);
    box-shadow: 0 0 4px rgba(255,255,255,0.6);
}

/* Dashboard Layout Editor — Gallery Inspector */
.dle-gallery-inspector h6 { font-size: 0.85rem; font-weight: 600; margin-bottom: 8px; }
.dle-gallery-list { display: flex; flex-direction: column; gap: 10px; }
.dle-gallery-item {
    background: var(--surface-2);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 8px;
}
.dle-gallery-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 6px;
}

/* ============================================================
   Dashboard Widget: Werkstatt
   ============================================================ */
.dwk-body { padding: 12px 14px !important; }
.dwk-list { display: flex; flex-direction: column; gap: 10px; }
.dwk-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--text-muted);
    border-radius: 6px;
    padding: 10px 12px;
    transition: box-shadow 0.15s, transform 0.15s;
    position: relative;
}
.dwk-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.dwk-date {
    min-width: 64px;
    flex-shrink: 0;
    font-size: 0.75rem;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
}
.dwk-day { display: block; font-weight: 700; color: var(--text-secondary); }
.dwk-time { display: block; color: var(--text-muted); }
.dwk-info { flex: 1; min-width: 0; padding-right: 70px; }
.dwk-vehicle {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}
.dwk-vehicle i { font-size: 0.85rem; color: var(--text-muted); }
.dwk-title { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }
.dwk-workshop {
    font-size: 0.7rem;
    color: var(--text-faint);
    margin-top: 2px;
}
.dwk-type {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 0.6rem;
    padding: 2px 8px;
    border-radius: 3px;
    color: var(--text-on-accent);
    font-weight: 600;
    letter-spacing: 0.03em;
}

/* ============================================================
   Container queries: widgets adapt to grid cell size
   ============================================================ */

@container (max-width: 320px) {
    /* Compact mode for small cells (e.g. 2x2, 3x2) */
    .dw-header { padding: 5px 10px; font-size: 0.7rem; }
    .dw-header i { font-size: 0.85rem; }
    .dw-body { padding: 8px 10px !important; }

    /* Termine: drop weekday line, smaller paddings */
    .dwt-tl-date span { display: none; }
    .dwt-tl-date { min-width: 48px; font-size: 0.65rem; }
    .dwt-tl-content { padding: 0.4rem 0.55rem; }
    .dwt-tl-title { font-size: 0.78rem; }
    .dwt-tl-meta { font-size: 0.65rem; }
    .dwt-tl-foot { display: none; }
    .dwt-timeline { padding-left: 22px; }
    .dwt-timeline::before { left: 8px; }
    .dwt-tl-dot-wrap { left: -18px; width: 12px; height: 12px; }
    .dwt-tl-dot { width: 8px; height: 8px; }

    /* Bestellungen: hide meta row, keep only title + status */
    .dwb-meta { display: none; }
    .dwb-card { padding: 8px 10px; }
    .dwb-title { font-size: 0.8rem; }
    .dwb-status { font-size: 0.6rem; padding: 1px 6px; }

    /* Werkstatt: hide workshop, smaller */
    .dwk-workshop { display: none; }
    .dwk-card { padding: 8px 10px; gap: 8px; }
    .dwk-vehicle { font-size: 0.78rem; }
    .dwk-title { font-size: 0.7rem; }
    .dwk-date { min-width: 50px; font-size: 0.68rem; }
    .dwk-type { font-size: 0.55rem; padding: 1px 5px; }
    .dwk-info { padding-right: 50px; }

    /* Raumbuchungen: hide booker, keep room+time */
    .dwr-booker { display: none; }
    .dwr-card { padding: 8px 10px; }
    .dwr-room { font-size: 0.78rem; }

    /* AAO: hide description */
    .aao-desc { display: none; }
    .dashboard-aao-card { padding: 8px 12px; min-width: auto; }
    .aao-name { font-size: 0.85rem; }

    /* News: smaller text and tighter cards */
    .dashboard-news-card { padding: 8px 10px; }
    .news-title { font-size: 0.85rem; }
    .news-body { font-size: 0.75rem; }
    .news-date { font-size: 0.65rem; }
}

@container (min-width: 600px) {
    /* Expanded mode for large cells (6xN or wider) */
    .dw-header { padding: 12px 18px; font-size: 0.85rem; }
    .dw-body { padding: 16px 20px !important; }

    .dwt-tl-content { padding: 0.7rem 0.9rem; }
    .dwt-tl-title { font-size: 1rem; }
    .dwt-tl-meta { font-size: 0.8rem; }
    .dwt-tl-date { font-size: 0.8rem; min-width: 70px; }

    .dwb-card { padding: 14px 16px; }
    .dwb-title { font-size: 1rem; }

    .dwk-card { padding: 14px 16px; }
    .dwk-vehicle { font-size: 1rem; }
    .dwk-title { font-size: 0.9rem; }

    .dwr-card { padding: 14px 16px; }
    .dwr-room { font-size: 1rem; }

    .news-title { font-size: 1.05rem; }
    .news-body { font-size: 0.9rem; }
}

/* ============================================================
   Container queries — WIDE-SHORT mode (e.g. 12×2 cell)
   List widgets become horizontal carousels with scroll.
   ============================================================ */

@container (min-width: 600px) and (max-height: 320px) {

    /* Termine: timeline → horizontal row of cards */
    .dwt-timeline {
        display: flex;
        flex-direction: row;
        gap: 10px;
        padding-left: 0;
        overflow-x: auto;
        overflow-y: hidden;
    }
    .dwt-timeline::before { display: none; }
    .dwt-tl-item {
        flex-direction: column;
        flex: 0 0 220px;
        gap: 4px;
        padding: 0;
        align-items: flex-start;
    }
    .dwt-tl-dot-wrap {
        position: static;
        margin: 0 0 2px 0;
    }
    .dwt-tl-date {
        min-width: 0;
        padding-top: 0;
    }
    .dwt-tl-content {
        width: 100%;
    }
    .dwt-tl-foot { display: none; }

    /* Bestellungen: vertical list → horizontal */
    .dwb-list {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 10px;
        padding-bottom: 4px;
    }
    .dwb-card {
        flex: 0 0 240px;
        min-height: 0;
    }
    .dwb-meta { display: none; }

    /* Werkstatt: vertical → horizontal */
    .dwk-list {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 10px;
        padding-bottom: 4px;
    }
    .dwk-card {
        flex: 0 0 240px;
        min-height: 0;
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }
    .dwk-info { padding-right: 0; }
    .dwk-workshop { display: none; }
    .dwk-type {
        position: static;
        align-self: flex-start;
    }

    /* Raumbuchungen: vertical → horizontal */
    .dwr-list {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 10px;
        padding-bottom: 4px;
    }
    .dwr-card {
        flex: 0 0 220px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .dwr-time { min-width: 0; }
    .dwr-status { align-self: flex-start; }

    /* News: vertical → horizontal */
    .dashboard-news-list {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 10px;
    }
    .dashboard-news-card {
        flex: 0 0 280px;
        min-height: 0;
    }

    /* AAO: stays wrapping, but constrain card height */
    .dashboard-aao-list {
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    .dashboard-aao-card { flex: 0 0 auto; }
}

/* ============================================================
   Dashboard Widget: Fahrzeugstatus
   ============================================================ */
.dwf-body { padding: 10px 12px !important; }
.dwf-list { display: flex; flex-direction: column; gap: 8px; }
.dwf-card {
    background: var(--surface-2);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--success);
    border-radius: 6px;
    padding: 10px 12px;
    transition: box-shadow 0.15s, transform 0.15s;
}
.dwf-card:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.dwf-card.in-workshop { border-left-color: var(--warning); background: var(--warning-bg); }
.dwf-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}
.dwf-name > i { color: var(--text-muted); }
.dwf-name > span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dwf-badge {
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    flex-shrink: 0;
}
.dwf-badge-ok       { background: var(--success-bg); color: var(--success-text); }
.dwf-badge-workshop { background: var(--warning-bg); color: var(--warning-text); }
.dwf-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}
.dwf-meta i { font-size: 0.75rem; }
.dwf-tuv-soon    { color: var(--warning); font-weight: 600; }
.dwf-tuv-expired { color: var(--danger); font-weight: 700; }


/* ===== Stärkemeldung (Einsatz) ===== */

/* F/U/M Kategorie-Badges */
.badge-kat {
  display: inline-block;
  min-width: 22px;
  text-align: center;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.badge-kat-f { background: var(--danger); color: var(--text-on-accent); }
.badge-kat-u { background: var(--warning); color: #212529; }
.badge-kat-m { background: #6b7280; color: var(--text-on-accent); }

/* F/U/M-Gesamt-Badge (monospace, schwarz) */
.crew-fum-badge {
  display: inline-block;
  font-family: 'Courier New', ui-monospace, monospace;
  font-weight: 700;
  font-size: 0.8rem;
  background: #1d1d1f;
  color: var(--text-on-accent);
  padding: 3px 10px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* Fahrzeug-Karte (IncidentCrewList) */
.crew-vehicle-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--drk-accent);
  border-radius: 8px;
  overflow: hidden;
}
.crew-vehicle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

/* ============================================================
   Neuigkeiten (News) — Startseiten-Kachel + /news Seite
   ============================================================ */

/* Kategorie-Badges (gemeinsam fuer Kachel und Seite) */
.home-news-badge {
  margin-left: auto;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  flex-shrink: 0;
}
.home-news-badge--termin { background: var(--info-bg); color: var(--info-text); }
.home-news-badge--info { background: var(--success-bg); color: var(--success-text); }
.home-news-badge--wichtig { background: var(--danger-bg); color: var(--drk-accent, var(--drk-accent)); }
.home-news-badge--danke { background: var(--warning-bg); color: var(--warning-text); }

/* ── Startseiten-Kachel ── */
.home-news-card {
  display: flex;
  flex-direction: column;
}
.home-news-title-icon { color: var(--drk-accent, var(--drk-accent)); }
.home-news-count {
  margin-left: auto;
  background: var(--danger-bg);
  color: var(--drk-accent, var(--drk-accent));
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: none;
  letter-spacing: 0;
}
.home-news-list {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.home-news-item {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
}
.home-news-item:last-of-type { border-bottom: none; }
.home-news-item--pinned {
  background: var(--danger-bg);
  border: 1px solid rgba(230, 0, 5, 0.15);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  margin-bottom: 0.35rem;
}
.home-news-item-top {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
}
.home-news-item-top b {
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.3;
  margin-right: auto;
}
.home-news-pin {
  color: var(--drk-accent, var(--drk-accent));
  font-size: 0.72rem;
  flex-shrink: 0;
}
.home-news-item p {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0 0 0.3rem 0;
}
.home-news-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.64rem;
  color: var(--text-faint);
}
.home-news-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--drk-accent, var(--drk-accent));
  color: var(--text-on-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5rem;
  font-weight: 700;
  flex-shrink: 0;
}
.home-news-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1.2rem 0;
  color: var(--text-faint);
  font-size: 0.78rem;
  flex: 1;
  justify-content: center;
}
.home-news-empty i { font-size: 1.4rem; }
.home-news-foot {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-light);
}
.home-news-all-btn,
.home-news-new-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  text-decoration: none;
  min-height: 30px;
}
.home-news-all-btn { color: var(--text-secondary); background: var(--surface-3); }
.home-news-all-btn:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.home-news-new-btn { color: var(--text-on-accent); background: var(--drk-accent, var(--drk-accent)); margin-left: auto; }
.home-news-new-btn:hover { background: var(--drk-accent-border); color: var(--text-on-accent); text-decoration: none; }

/* ── /news Seite ── */
.news-page { max-width: 860px; }
.news-page-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.news-page-head h3 {
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  margin-right: auto;
}
.news-page-head h3 i { color: var(--drk-accent, var(--drk-accent)); }
.news-create-btn {
  background: var(--drk-accent, var(--drk-accent));
  color: var(--text-on-accent);
  border: none;
  border-radius: 8px;
  padding: 8px 15px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
}
.news-create-btn:hover { background: var(--drk-accent-border); }
.news-filter {
  display: flex;
  gap: 6px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.news-chip {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 500;
  min-height: 34px;
}
.news-chip.active { background: #212529; color: var(--text-on-accent); border-color: #212529; }
.news-post-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 0.75rem;
}
.news-post-card--pinned {
  border-color: rgba(230, 0, 5, 0.3);
  box-shadow: 0 2px 10px rgba(230, 0, 5, 0.08);
}
.news-pin-flag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--danger-bg);
  color: var(--drk-accent, var(--drk-accent));
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.news-post-top {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
}
.news-post-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--drk-accent, var(--drk-accent));
  color: var(--text-on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.news-post-who { min-width: 0; }
.news-post-who b { font-size: 0.86rem; display: block; }
.news-post-who span { font-size: 0.7rem; color: var(--text-muted); }
.news-edited { font-size: 0.66rem; color: var(--text-faint); }
.news-post-card h5 { font-size: 1rem; margin-bottom: 4px; }
.news-post-content {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
  white-space: pre-line;
}
.news-post-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--border-light);
}
.news-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}
.news-icon-btn:hover { background: var(--surface-2); color: var(--text); }
.news-icon-btn--danger:hover { background: var(--danger-bg); color: var(--drk-accent, var(--drk-accent)); }
.news-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-faint);
}
.news-empty i { font-size: 2rem; margin-bottom: 0.5rem; display: block; }
.news-empty p { font-size: 0.9rem; margin-bottom: 1rem; }
.news-cat-pick {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.news-cat-opt {
  border: 1.5px solid var(--border-light);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
}
.news-cat-opt.sel {
  border-color: var(--drk-accent, var(--drk-accent));
  color: var(--drk-accent, var(--drk-accent));
  background: var(--danger-bg);
}

/* Entwickler-Seite: Changelog-Button */
.entwickler-changelog-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 2px solid var(--drk-accent, var(--drk-accent));
  border-radius: 10px;
  padding: 14px 18px;
  background: var(--danger-bg);
  text-decoration: none;
  margin: 1.25rem auto 0;
  max-width: 420px;
  transition: box-shadow 0.15s, transform 0.15s;
}
.entwickler-changelog-tile:hover {
  box-shadow: 0 4px 14px rgba(230, 0, 5, 0.2);
  transform: translateY(-1px);
  text-decoration: none;
}
.entwickler-changelog-tile i {
  font-size: 1.35rem;
  color: var(--drk-accent, var(--drk-accent));
}
.entwickler-changelog-tile b {
  font-size: 0.9rem;
  color: var(--drk-accent, var(--drk-accent));
  display: block;
}
.entwickler-changelog-tile span {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.crew-vehicle-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text);
  min-width: 0;
}
.crew-vehicle-title i { color: var(--drk-accent); font-size: 1.1rem; }
.crew-vehicle-title span { overflow: hidden; text-overflow: ellipsis; }
.crew-vehicle-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.crew-empty {
  padding: 14px;
  color: var(--text-muted);
  font-size: 0.875rem;
  text-align: center;
}

.crew-member-list { padding: 4px 0; }
.crew-member-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
}
.crew-member-row:last-child { border-bottom: none; }
.crew-member-row:hover { background: var(--surface-2); }

.crew-member-info { min-width: 0; flex: 1; }
.crew-member-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.95rem;
  margin-bottom: 2px;
}
.crew-member-name strong { color: var(--text); }
.crew-member-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}
.crew-member-meta a {
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
}
.crew-member-meta a:hover { color: var(--info-text); text-decoration: underline; }
.crew-member-meta i { color: var(--text-faint); margin-right: 2px; }

.crew-member-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.crew-kat-select {
  width: auto;
  min-width: 56px;
  font-weight: 600;
}

/* Stärkemeldungs-Tab Hero-Block */
.staerke-hero {
  background: linear-gradient(135deg, #1d1d1f 0%, #2d2d2f 100%);
  color: var(--text-on-accent);
  border-radius: 12px;
  padding: 24px 20px;
  margin-bottom: 16px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.staerke-hero-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.6;
  margin-bottom: 6px;
}
.staerke-hero-number {
  font-family: 'Courier New', ui-monospace, monospace;
  font-weight: 700;
  font-size: clamp(32px, 9vw, 52px);
  line-height: 1;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.staerke-num-f { color: var(--danger-border); }
.staerke-num-u { color: #fcd34d; }
.staerke-num-m { color: #d1d5db; }
.staerke-num-total { color: var(--text-on-accent); font-weight: 800; }
.staerke-num-sep { color: var(--text-secondary); margin: 0 4px; }

.staerke-hero-legend {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.75rem;
  opacity: 0.85;
  margin-bottom: 8px;
}
.staerke-hero-legend .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.staerke-hero-legend .dot-f { background: var(--danger-border); }
.staerke-hero-legend .dot-u { background: #fcd34d; }
.staerke-hero-legend .dot-m { background: #d1d5db; }

.staerke-hero-time {
  font-size: 0.75rem;
  opacity: 0.6;
  margin-bottom: 10px;
}
.staerke-hero-time i { margin-right: 4px; }

.staerke-hero-fachlich {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.fachlich-chip {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
}
.fachlich-chip strong { color: #fcd34d; margin-right: 3px; }

/* Stärkemeldungs-Tab Vehicle-Liste */
.staerke-vehicle-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.staerke-vehicle-list-header {
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text);
}
.staerke-vehicle-list-header i { color: var(--drk-accent); margin-right: 6px; }

.staerke-vehicle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.15s;
  gap: 12px;
}
.staerke-vehicle-row:last-child { border-bottom: none; }
.staerke-vehicle-row:hover { background: var(--surface-3); }
.staerke-vehicle-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  min-width: 0;
}
.staerke-vehicle-left i { color: var(--text-muted); }
.staerke-vehicle-left span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staerke-vehicle-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.staerke-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Mobile-Anpassungen */
@media (max-width: 576px) {
  .crew-vehicle-header { flex-wrap: wrap; }
  .crew-vehicle-actions { width: 100%; justify-content: flex-end; }
  .crew-member-row { flex-direction: column; gap: 6px; }
  .crew-member-controls { width: 100%; justify-content: flex-end; }
  .crew-member-meta { gap: 4px 10px; }
}

/* Pro-Mandant-Aufschluesselung im Staerkemeldungs-Hero */
.staerke-tenant-list {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.15);
}
.staerke-tenant-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  padding: 3px 0;
}
.staerke-tenant-name { opacity: 0.9; }
.staerke-tenant-fum {
  font-family: 'Courier New', ui-monospace, monospace;
  font-weight: 600;
  opacity: 0.85;
}

/* Einsatz-Sharing-Badges */
.share-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.share-badge-shared { background: var(--info-bg); color: var(--info-text); }
.share-badge-received { background: #ede9fe; color: #6d28d9; }

/* --- Custom Modal (Kursverwaltung Termine etc.) --- */
.modal-backdrop-custom {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1040;
}
.modal-custom {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: var(--surface); border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    z-index: 1050; max-width: 600px; width: 92vw; max-height: 90vh; overflow-y: auto;
    display: flex; flex-direction: column;
}
.modal-custom-sm { max-width: 420px; }
.modal-custom-header {
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.modal-custom-header h4 { margin: 0; font-size: 1.1rem; }
.modal-custom-body { padding: 20px; flex: 1; }
.modal-custom-footer {
    padding: 12px 20px; border-top: 1px solid var(--border);
    display: flex; justify-content: flex-end; gap: 8px;
}

/* ===== Ausbildung: Anwesenheits-Modus (Tablet) ===== */
.attendance-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
@media (max-width: 768px) {
    .attendance-grid { grid-template-columns: 1fr; }
}
.attendance-tile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    min-height: 72px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    text-align: left;
    cursor: pointer;
    width: 100%;
}
.attendance-tile.signed {
    border-color: var(--success);
    background: var(--success-bg);
    cursor: default;
}
.attendance-avatar {
    width: 46px; height: 46px;
    border-radius: 50%;
    background: var(--border-strong);
    color: var(--text-secondary);
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.attendance-tile.signed .attendance-avatar { background: var(--success); color: var(--text-on-accent); }
.attendance-info { flex: 1; display: flex; flex-direction: column; }
.attendance-name { font-size: 17px; font-weight: 600; }
.attendance-meta { font-size: 13px; color: var(--text-muted); }
.attendance-state { font-size: 14px; font-weight: 600; color: var(--text-muted); }
.attendance-tile.signed .attendance-state { color: var(--success); font-size: 22px; }

/* Tag-Auswahl bei mehrtaegigen Kursterminen */
.attendance-day-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.attendance-day-chip {
    min-height: 44px;
    padding: 8px 18px;
    border: 2px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
}
.attendance-day-chip:hover { border-color: var(--text-faint); }
.attendance-day-chip.active {
    border-color: var(--drk-accent);
    background: rgba(var(--drk-accent-rgb),0.08);
    color: var(--drk-accent);
}

.signature-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 1080; padding: 16px;
}
.signature-panel {
    background: var(--surface); border-radius: 14px;
    width: 100%; max-width: 680px;
    padding: 22px;
}
.signature-head strong { font-size: 18px; }
.signature-hint { font-size: 14px; color: var(--text-secondary); margin: 10px 0; }
.signature-canvas-wrap {
    border: 2px solid var(--bs-danger, var(--drk-accent));
    border-radius: 10px;
}
.signature-actions {
    display: flex; gap: 12px; margin-top: 16px;
}
.signature-actions .btn { flex: 1; padding: 14px; font-size: 16px; }

/* ===== Ankündigungs-Popups (interruptive Ebene) ===== */

/* Schweregrad-Farben (zentral, auch von der Editor-Vorschau genutzt) */
.ann-pop--info    { --ann-color: #3b82f6; }
.ann-pop--warning { --ann-color: #f59e0b; }
.ann-pop--critical{ --ann-color: #dc2626; }

/* Modal */
.announcement-modal-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(15, 23, 42, 0.5);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.announcement-modal-box {
    background: var(--surface); width: 100%; max-width: 480px; max-height: 90vh;
    border-radius: 14px; overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35);
}
.announcement-modal-head {
    background: var(--ann-color); color: var(--text-on-accent);
    padding: 14px 18px; font-weight: 700; font-size: 15px;
    display: flex; align-items: center; gap: 8px;
}
.announcement-modal-body { padding: 18px; color: var(--text-secondary); }
.announcement-modal-body .ann-title { font-weight: 700; font-size: 15px; color: var(--text); margin-bottom: 8px; }
.announcement-modal-body .ann-message { font-size: 14px; line-height: 1.55; color: var(--text-secondary); white-space: pre-wrap; }
.announcement-modal-btn {
    margin-top: 16px; min-height: 44px; padding: 10px 22px;
    background: var(--ann-color); color: var(--text-on-accent); border: none;
    border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer;
}

/* Toast */
.announcement-toast {
    position: fixed; bottom: 18px; right: 18px; z-index: 2000;
    width: 340px; max-width: calc(100vw - 36px);
    background: var(--surface); border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
    border-left: 5px solid var(--ann-color);
    padding: 14px; display: flex; gap: 12px;
}
.announcement-toast-icon {
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(59, 130, 246, 0.15);
    background: color-mix(in srgb, var(--ann-color) 15%, white);
    color: var(--ann-color); flex: none;
    display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.announcement-toast .ann-title { font-weight: 700; font-size: 14px; color: var(--text); margin-bottom: 3px; }
.announcement-toast .ann-message { font-size: 13px; color: var(--text-muted); line-height: 1.45; }
.announcement-toast-close {
    position: absolute; top: 8px; right: 10px;
    background: none; border: none; color: #cbd5e1; font-size: 16px; cursor: pointer;
    min-width: 44px; min-height: 44px;
}

/* Vollbild */
.announcement-fullscreen {
    position: fixed; inset: 0; z-index: 2100;
    background: var(--ann-color);
    background: linear-gradient(135deg, color-mix(in srgb, var(--ann-color) 85%, black), var(--ann-color));
    color: var(--text-on-accent); display: flex; flex-direction: column;
    align-items: center; justify-content: center; text-align: center; gap: 14px; padding: 28px;
}
.announcement-fullscreen .ann-icon { font-size: 44px; }
.announcement-fullscreen .ann-title { font-size: 20px; font-weight: 700; }
.announcement-fullscreen .ann-message { font-size: 15px; opacity: 0.9; max-width: 600px; line-height: 1.5; white-space: pre-wrap; }
.announcement-fullscreen .announcement-modal-btn { background: rgba(255, 255, 255, 0.95); color: var(--ann-color); }

/* Toast/Modal mobile */
@media (max-width: 600px) {
    .announcement-toast { left: 12px; right: 12px; width: auto; bottom: 12px; }
}

/* Editor-Live-Vorschau */
.ann-preview-stage {
    position: relative; height: 280px; background: var(--surface-3);
    border-radius: 12px; overflow: hidden; border: 1px solid var(--border);
}
.ann-preview-label {
    font-size: 12px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px;
}
.ann-preview-hint { font-size: 12px; color: var(--text-faint); margin-top: 10px; line-height: 1.5; }

/* Darstellungs-Auswahl als Kacheln (statt Dropdown) */
.ann-style-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}
.ann-style-tile {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    text-align: center;
    padding: 14px 8px; min-height: 88px;
    background: var(--surface); border: 2px solid var(--border); border-radius: 10px;
    cursor: pointer; transition: border-color .12s, background .12s, transform .12s;
}
.ann-style-tile:hover { border-color: #94a3b8; transform: translateY(-1px); }
.ann-style-tile--active { border-color: var(--drk-accent); background: var(--danger-bg); }
.ann-style-tile-icon { font-size: 24px; color: var(--text-secondary); }
.ann-style-tile--active .ann-style-tile-icon { color: var(--drk-accent); }
.ann-style-tile-label { font-size: 13px; font-weight: 600; color: var(--text); }
.ann-style-tile-desc { font-size: 11px; color: var(--text-faint); line-height: 1.3; }

/* ===== Bestellstatus-Pipeline (OrderStatusPipeline.razor) ===== */
.order-pipeline {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 12px 24px 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.op-step {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    font-size: .82rem;
    color: var(--text-faint);
    white-space: nowrap;
}
.op-circle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid var(--border-strong);
    background: var(--surface);
    display: grid;
    place-items: center;
    font-size: .72rem;
    font-weight: 700;
    flex-shrink: 0;
}
.op-step.done { color: var(--text-secondary); }
.op-step.done .op-circle {
    background: var(--success);
    border-color: var(--success);
    color: var(--text-on-accent);
}
.op-step.current { color: var(--text); font-weight: 600; }
.op-step.current .op-circle {
    border-color: var(--drk-accent);
    color: var(--drk-accent);
    box-shadow: 0 0 0 4px rgba(var(--drk-accent-rgb), .12);
}
.op-step.cancelled { color: var(--drk-accent); font-weight: 600; }
.op-step.cancelled .op-circle {
    background: var(--drk-accent);
    border-color: var(--drk-accent);
    color: var(--text-on-accent);
}
.op-line {
    flex: 1;
    height: 2px;
    background: var(--surface-hover);
    margin: 0 10px;
    min-width: 18px;
}
.op-line.done { background: var(--success); }
.op-line.cancelled { background: var(--drk-accent); }
@media (max-width: 767px) {
    .order-pipeline { padding: 10px 16px 12px; }
    .op-step { font-size: .74rem; }
    .op-circle { width: 22px; height: 22px; font-size: .64rem; }
    .op-line { min-width: 12px; margin: 0 6px; }
}

/* =====================================================================
   DARK MODE (Phase 2)
   Aktiv bei data-theme="dark" auf <html>. Ueberschreibt nur die
   Design-Tokens vom Dateianfang plus gezielte Bootstrap-5.1-Overrides
   (Bootstrap 5.1 kennt noch kein data-bs-theme).
   Umschalter: Sidebar-Footer (TopNavbar.razor), Persistenz via
   localStorage + Cookie "ims_theme" (SSR rendert das Attribut serverseitig,
   dadurch kein weisses Aufblitzen auf Login & Co.).
   ===================================================================== */

[data-theme="dark"] {
    color-scheme: dark;

    /* Bootstrap-Root-Variablen mitziehen (werden u.a. als
       var(--bs-body-color)-Fallbacks in Seiten-Styles benutzt) */
    --bs-body-color: #dbe2ea;
    --bs-body-bg: #151c28;

    /* Flaechen */
    --surface: #1e2735;
    --surface-2: #151c28;
    --surface-3: #253044;
    --surface-hover: #2c3850;

    /* Linien */
    --border: #313d52;
    --border-light: #2a3549;
    --border-strong: #41506a;

    /* Text */
    --text-heading: #f3f6fa;
    --text: #dbe2ea;
    --text-secondary: #b9c3d0;
    --text-muted: #93a1b3;
    --text-faint: #6b7a8f;
    --text-on-accent: #fff;

    /* Status: Fehler / Loeschen */
    --danger: #f0565b;
    --danger-text: #f1a8aa;
    --danger-bg: #35181b;
    --danger-border: #5c2226;

    /* Status: Erfolg */
    --success: #34b873;
    --success-text: #8fd8b2;
    --success-bg: #142b1f;

    /* Status: Warnung */
    --warning: #f5a623;
    --warning-text: #f0c674;
    --warning-bg: #2e2410;

    /* Status: Info */
    --info: #5b9df5;
    --info-text: #a7c6f4;
    --info-bg: #182742;
}

/* --- Grundflaechen --- */
[data-theme="dark"] body {
    background-color: var(--surface-2);
    color: var(--text);
}

/* --- Bootstrap: Karten --- */
[data-theme="dark"] .card {
    background-color: var(--surface);
    border-color: var(--border);
    color: var(--text);
}
[data-theme="dark"] .card-header,
[data-theme="dark"] .card-footer {
    background-color: rgba(255, 255, 255, 0.03);
    border-color: var(--border);
}

/* --- Bootstrap: Modals --- */
[data-theme="dark"] .modal-content {
    background-color: var(--surface);
    border-color: var(--border);
    color: var(--text);
}
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    border-color: var(--border);
}
[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(180%);
}

/* --- Bootstrap: Formulare --- */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background-color: var(--surface-3);
    border-color: var(--border-strong);
    color: var(--text);
}
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background-color: var(--surface-3);
    color: var(--text);
}
[data-theme="dark"] .form-control::placeholder {
    color: var(--text-faint);
}
[data-theme="dark"] .form-control:disabled,
[data-theme="dark"] .form-control[readonly],
[data-theme="dark"] .form-select:disabled {
    background-color: var(--surface-2);
    color: var(--text-muted);
}
[data-theme="dark"] .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23b9c3d0' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    /* Repeat/Position/Groesse explizit setzen: Klassen wie .field-input nutzen
       ein background-Shorthand, das Bootstraps no-repeat zuruecksetzt --
       sonst kachelt der Pfeil ueber die ganze Feldbreite. */
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}
[data-theme="dark"] .form-check-input:not(:checked) {
    background-color: var(--surface-3);
    border-color: var(--border-strong);
}
[data-theme="dark"] .input-group-text {
    background-color: var(--surface-2);
    border-color: var(--border-strong);
    color: var(--text-secondary);
}
[data-theme="dark"] .form-control.is-invalid,
[data-theme="dark"] .invalid {
    border-color: var(--danger);
}

/* --- Bootstrap: Tabellen --- */
[data-theme="dark"] .table {
    color: var(--text);
    border-color: var(--border);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
    --bs-table-striped-color: var(--text);
    --bs-table-hover-bg: var(--surface-hover);
    --bs-table-hover-color: var(--text);
}
[data-theme="dark"] .table > :not(caption) > * > * {
    border-bottom-color: var(--border);
}
[data-theme="dark"] .table-light {
    --bs-table-bg: var(--surface-2);
    color: var(--text);
    border-color: var(--border);
}
[data-theme="dark"] .table-secondary {
    --bs-table-bg: var(--surface-3);
    color: var(--text);
}
[data-theme="dark"] .table-warning {
    --bs-table-bg: var(--warning-bg);
    color: var(--warning-text);
}
[data-theme="dark"] .table-success {
    --bs-table-bg: var(--success-bg);
    color: var(--success-text);
}
[data-theme="dark"] .table-danger {
    --bs-table-bg: var(--danger-bg);
    color: var(--danger-text);
}
[data-theme="dark"] .table-info {
    --bs-table-bg: var(--info-bg);
    color: var(--info-text);
    border-color: var(--border);
}

/* --- Bootstrap: Alerts --- */
[data-theme="dark"] .alert-success {
    background-color: var(--success-bg);
    border-color: var(--success);
    color: var(--success-text);
}
[data-theme="dark"] .alert-danger {
    background-color: var(--danger-bg);
    border-color: var(--danger-border);
    color: var(--danger-text);
}
[data-theme="dark"] .alert-warning {
    background-color: var(--warning-bg);
    border-color: var(--warning);
    color: var(--warning-text);
}
[data-theme="dark"] .alert-info {
    background-color: var(--info-bg);
    border-color: var(--info);
    color: var(--info-text);
}
[data-theme="dark"] .alert-secondary,
[data-theme="dark"] .alert-light {
    background-color: var(--surface-3);
    border-color: var(--border);
    color: var(--text-secondary);
}

/* --- Bootstrap: Listen, Dropdowns, Tabs, Pagination --- */
[data-theme="dark"] .list-group-item {
    background-color: var(--surface);
    border-color: var(--border);
    color: var(--text);
}
[data-theme="dark"] .list-group-item-action:hover {
    background-color: var(--surface-hover);
    color: var(--text);
}
[data-theme="dark"] .dropdown-menu {
    background-color: var(--surface);
    border-color: var(--border);
}
[data-theme="dark"] .dropdown-item {
    color: var(--text);
}
[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
    background-color: var(--surface-hover);
    color: var(--text);
}
[data-theme="dark"] .dropdown-divider {
    border-color: var(--border);
}
[data-theme="dark"] .nav-tabs {
    border-color: var(--border);
}
[data-theme="dark"] .nav-tabs .nav-link:hover {
    border-color: var(--border);
}
[data-theme="dark"] .nav-tabs .nav-link.active {
    background-color: var(--surface);
    color: var(--text);
    border-color: var(--border) var(--border) var(--surface);
}
[data-theme="dark"] .page-link {
    background-color: var(--surface);
    border-color: var(--border);
}
[data-theme="dark"] .page-item.disabled .page-link {
    background-color: var(--surface-2);
    border-color: var(--border);
    color: var(--text-faint);
}

/* --- Bootstrap: Buttons --- */
[data-theme="dark"] .btn-light {
    background-color: var(--surface-3);
    border-color: var(--border);
    color: var(--text);
}
[data-theme="dark"] .btn-light:hover {
    background-color: var(--surface-hover);
    border-color: var(--border-strong);
    color: var(--text);
}
[data-theme="dark"] .btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border-strong);
}
[data-theme="dark"] .btn-outline-secondary:hover {
    background-color: var(--surface-hover);
    border-color: var(--border-strong);
    color: var(--text);
}
[data-theme="dark"] .btn-outline-dark {
    color: var(--text);
    border-color: var(--border-strong);
}
[data-theme="dark"] .btn-outline-dark:hover {
    background-color: var(--surface-hover);
    border-color: var(--border-strong);
    color: var(--text);
}

/* --- Bootstrap: Utilities --- */
[data-theme="dark"] .text-muted {
    color: var(--text-muted) !important;
}
[data-theme="dark"] .text-secondary {
    color: var(--text-secondary) !important;
}
[data-theme="dark"] .text-dark,
[data-theme="dark"] .text-body,
[data-theme="dark"] .text-black {
    color: var(--text) !important;
}
[data-theme="dark"] .bg-light {
    background-color: var(--surface-3) !important;
}
[data-theme="dark"] .bg-white {
    background-color: var(--surface) !important;
}
[data-theme="dark"] .border,
[data-theme="dark"] .border-top,
[data-theme="dark"] .border-bottom,
[data-theme="dark"] .border-start,
[data-theme="dark"] .border-end {
    border-color: var(--border) !important;
}
[data-theme="dark"] .badge.bg-light {
    background-color: var(--surface-3) !important;
    color: var(--text) !important;
}
[data-theme="dark"] .toast {
    background-color: var(--surface);
    color: var(--text);
}
[data-theme="dark"] .toast-header {
    background-color: var(--surface-2);
    color: var(--text-secondary);
}
[data-theme="dark"] .progress {
    background-color: var(--surface-3);
}
[data-theme="dark"] hr {
    border-color: var(--border);
}

/* --- Fokus-Ring: weisser Innenring stoert auf dunklen Flaechen --- */
[data-theme="dark"] .btn:focus,
[data-theme="dark"] .btn:active:focus,
[data-theme="dark"] .btn-link.nav-link:focus,
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem var(--surface), 0 0 0 0.25rem var(--drk-accent);
}

/* =====================================================================
   Druck: immer Light-Werte, egal welches Theme aktiv ist
   ===================================================================== */
@media print {
    [data-theme="dark"] {
        color-scheme: light;
        --surface: #fff;
        --surface-2: #f8f9fa;
        --surface-3: #f1f3f5;
        --surface-hover: #e9ecef;
        --border: #dee2e6;
        --border-light: #e9ecef;
        --border-strong: #ced4da;
        --text-heading: #000;
        --text: #2d3436;
        --text-secondary: #495057;
        --text-muted: #6c757d;
        --text-faint: #9ca3af;
        --text-on-accent: #fff;
        --danger: #dc3545;
        --danger-text: #991b1b;
        --danger-bg: #fff0f0;
        --danger-border: #fecaca;
        --success: #198754;
        --success-text: #0f5132;
        --success-bg: #d1e7dd;
        --warning: #f59e0b;
        --warning-text: #856404;
        --warning-bg: #fff3cd;
        --info: #3b82f6;
        --info-text: #1e40af;
        --info-bg: #dbeafe;
    }
}

/* --- Auth-Seiten (Login etc.): Karte behaelt bewusst das helle Design ---
   Das Marken-Logo und die Navy-Buttons sind fuer die weisse Karte gestaltet;
   der Seitenhintergrund (Navy-Gradient) ist ohnehin dunkel. */
[data-theme="dark"] .auth-layout {
    color-scheme: light;
    --surface: #fff;
    --surface-2: #f8f9fa;
    --surface-3: #f1f3f5;
    --surface-hover: #e9ecef;
    --border: #dee2e6;
    --border-light: #e9ecef;
    --border-strong: #ced4da;
    --text-heading: #000;
    --text: #2d3436;
    --text-secondary: #495057;
    --text-muted: #6c757d;
    --text-faint: #9ca3af;
    --text-on-accent: #fff;
}
[data-theme="dark"] .auth-layout .form-control {
    background-color: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

/* --- Nachtraege aus dem Kontrast-Sweep --- */
[data-theme="dark"] .alert-info .alert-link { color: var(--info-text); }
[data-theme="dark"] .alert-success .alert-link { color: var(--success-text); }
[data-theme="dark"] .alert-warning .alert-link { color: var(--warning-text); }
[data-theme="dark"] .alert-danger .alert-link { color: var(--danger-text); }
[data-theme="dark"] code { color: #f77fab; }
:root { --code-pink: #be123c; }
[data-theme="dark"] { --code-pink: #f77fab; }

/* --- Wachenaufgaben: Kategorie-Pills/-Icons bekommen ihre Farben inline
   aus C# (helle Pastell-Hintergruende). Im Dark Mode stattdessen eine
   getoente Flaeche aus der Kategoriefarbe (currentColor = inline color). --- */
[data-theme="dark"] .hist-cat-pill,
[data-theme="dark"] .tpl-icon,
[data-theme="dark"] .cat-icon-big,
[data-theme="dark"] .wa-status-badge {
    background: color-mix(in srgb, currentColor 16%, transparent) !important;
}
[data-theme="dark"] .wa-status-badge {
    border-color: color-mix(in srgb, currentColor 35%, transparent) !important;
}

/* --- Zuweisungs-Listen (Benutzer-Modal: Mandanten-Zuweisungen + NFC-Tags) ---
   Moderne Zeilen-Cards statt Bootstrap-Tabellen. Rein Token-basiert,
   funktioniert daher automatisch im Dark Mode. --- */
.assign-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.assign-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    transition: border-color .15s ease, background-color .15s ease;
}
.assign-item:hover {
    border-color: var(--border-strong);
}
.assign-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(var(--drk-accent-rgb), .08);
    color: var(--drk-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.assign-item-main {
    flex: 1 1 auto;
    min-width: 0;
}
.assign-item-title {
    font-weight: 600;
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.assign-item-sub {
    font-size: .78rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.assign-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.assign-role-select {
    min-width: 150px;
    width: auto;
}
/* "Primaer"-Pill: klickbar statt nackter Radio-Button */
.assign-primary-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .72rem;
    font-weight: 600;
    padding: 5px 11px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    transition: all .15s ease;
    white-space: nowrap;
    min-height: 30px;
}
.assign-primary-pill:hover {
    border-color: var(--drk-accent);
    color: var(--drk-accent);
}
.assign-primary-pill.active {
    background: rgba(var(--drk-accent-rgb), .1);
    border-color: rgba(var(--drk-accent-rgb), .45);
    color: var(--drk-accent);
    cursor: default;
}
/* Runder Ghost-Button zum Entfernen */
.assign-remove-btn {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .15s ease;
    flex-shrink: 0;
}
.assign-remove-btn:hover:not(:disabled) {
    background: var(--danger-bg);
    color: var(--danger-text);
}
.assign-remove-btn:disabled { opacity: .5; }
/* UID-Chip (Monospace) */
.assign-uid-chip {
    font-family: var(--bs-font-monospace, monospace);
    font-size: .8rem;
    background: var(--surface-3);
    border: 1px solid var(--border-light);
    border-radius: 7px;
    padding: 2px 8px;
    color: var(--code-pink);
}
/* Leerer Zustand */
.assign-empty {
    padding: 14px 12px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    color: var(--text-muted);
    font-size: .85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
/* Hinzufuegen-Zeile */
.assign-add-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
@media (max-width: 575.98px) {
    .assign-item {
        flex-wrap: wrap;
    }
    .assign-item-actions {
        width: 100%;
        justify-content: flex-end;
    }
    .assign-role-select {
        flex: 1 1 auto;
    }
}
