/* ============================================================
   OrgaPlus – Design System
   ============================================================ */

/* --- Design Tokens ----------------------------------------- */
:root {
    /* Colors */
    --bg:              #232325;
    --surface-1:       #141415;
    --surface-2:       #1b1b1d;
    --surface-3:       #232325;
    --card:            var(--surface-2);
    --text:            #f6f8fb;
    --text-secondary:  #b3b3bb;
    --text-tertiary:   #7d7d86;
    --primary:         #F97316;
    --primary-hover:   #EA580C;
    --primary-light:   rgba(249,115,22,0.12);
    --structure:       #0c1117;
    --accent-inventory: #2f6b7a;
    --accent-inventory-soft: rgba(47,107,122,0.14);

    --chrome-bg:       #232325;
    --sidebar-bg:      #0f141b;
    --sidebar-text:    #E2E8F0;
    --sidebar-active:  #F97316;
    --sidebar-hover:   rgba(255,255,255,0.06);
    --border:          #293240;
    --border-light:    #212a36;

    /* Status */
    --success:         #22C55E;
    --success-light:   rgba(34,197,94,0.10);
    --danger:          #EF4444;
    --danger-light:    rgba(239,68,68,0.10);
    --warning:         #F59E0B;
    --warning-light:   rgba(245,158,11,0.10);
    --repair:          #C4AD38;
    --repair-light:    rgba(196,173,56,0.12);
    --info:            var(--accent-inventory);
    --info-light:      var(--accent-inventory-soft);

    /* Layout */
    --sidebar-width:   240px;
    --header-height:   60px;
    --footer-height:   80px;
    --radius:          10px;
    --radius-lg:       14px;
    --radius-xl:       18px;

    /* Shadows */
    --shadow-sm:       0 1px 2px rgba(0,0,0,.16);
    --shadow-card:     0 3px 10px rgba(0,0,0,0.30), 0 0 0 1px rgba(255,255,255,0.04);
    --shadow-md:       0 16px 36px rgba(4,8,14,0.28), 0 4px 12px rgba(4,8,14,0.16);
    --shadow-lg:       0 26px 60px rgba(4,8,14,0.34), 0 8px 18px rgba(4,8,14,0.18);

    /* Typography */
    --font-body:       'DM Sans', system-ui, -apple-system, sans-serif;
    --font-mono:       'DM Mono', 'Fira Code', monospace;
    --text-xs:         0.75rem;
    --text-sm:         0.875rem;
    --text-base:       1rem;
    --text-lg:         1.125rem;
    --text-xl:         1.25rem;
    --text-2xl:        1.5rem;
    --text-3xl:        1.875rem;

    /* Transitions */
    --transition:      170ms cubic-bezier(.2,.8,.2,1);
    --transition-md:   260ms cubic-bezier(.2,.8,.2,1);
}

@media (max-width: 1199px) {
    :root {
        --sidebar-width: 224px;
    }
}

/* ============================================================
   RESPONSIVE BASIS
   ============================================================ */

/* Fokusregel: Outline nur bei Tastatur-Navigation anzeigen (Tab), nicht bei
   programmatischem Fokus (Seitenlade, Blazor-Navigation) oder Mausklick */
:focus:not(:focus-visible) {
    outline: none !important;
}

/* Fokusregel: Blazor setzt nach Navigation programmatisch Fokus auf Überschriften und
   strukturelle Elemente – diese sind nicht interaktiv und brauchen keinen Fokusring */
:is(h1, h2, h3, h4, h5, h6, p, div, section, article, main):focus,
:is(h1, h2, h3, h4, h5, h6, p, div, section, article, main):focus-visible {
    outline: none !important;
}

/* Seitenbasis: dunkler Basiston verhindert weißes Aufblitzen in den Übergangsbereichen
   zwischen fixierten Layout-Elementen (Sidebar, Header, Footer) */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
    background: var(--chrome-bg);
}

/* UI-Regel: hält Medieninhalte innerhalb des verfügbaren Containers */
img,
svg,
video,
canvas {
    max-width: 100%;
}

/* UI-Regel: erlaubt langen Texten kontrollierte Umbrüche statt Seiten-Overflow */
p,
span,
strong,
small,
label,
h1,
h2,
h3,
h4,
h5,
h6,
.card-title,
.modal-title,
.reserv-card-title {
    overflow-wrap: anywhere;
}

/* Tabellenregel: Tabellen bleiben vollständig erreichbar, ohne die ganze Seite horizontal zu scrollen */
.data-table-wrap {
    width: 100%;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

/* Tabellenregel: bewahrt Tabellenspalten und verlagert schmale Ansichten in den Tabellen-Scroller */
.data-table {
    min-width: 760px;
}

/* Tabellenregel: hält Aktionsbuttons in Tabellen kompakt und bedienbar */
.table-actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
}

/* Formular- und Aktionsregel: verhindert zu kleine Touch-Ziele bei Buttons */
.btn,
.btn-icon,
.modal-close,
.cal-nav-btn {
    min-height: 36px;
}

/* Dialoginhalt: trennt Dialograhmen und scrollbaren Inhalt sauber */
.modal-box {
    display: flex;
    flex-direction: column;
}

/* Dialoginhalt: hält Kopf und Inhalt im Viewport und lässt den Inhalt scrollen */
.modal-body {
    min-height: 0;
    overflow-y: auto;
}

/* Responsive Anpassung: kleine Laptops erhalten kompaktere Layoutabstände ohne optisches Redesign */
@media (max-width: 1200px) {
    /* Inhaltsbereich: nutzt die verfügbare Breite ohne starre Desktop-Grenzen */
    .app-content {
        max-width: 100%;
        padding-inline: 28px;
    }

    /* Layoutregel: verhindert zu enge Kalender-Seitenspalten auf kleinen Laptops */
    .cal-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Responsive Anpassung: Tabletbreiten stapeln komplexe Bereiche und reduzieren Randabstände */
@media (max-width: 992px) {
    /* Karteninhalt: reduziert Innenabstände, damit Karten auf Tablets luftiger umbrechen */
    .card-body {
        padding: 18px 20px;
    }

    /* Flächenregel: hält Kartenköpfe auch bei langen Titeln stabil */
    .card-header {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    /* Dialoginhalt: große Dialoge nutzen Tabletbreite kontrolliert aus */
    .modal-box.modal-lg {
        max-width: min(760px, calc(100vw - 28px));
    }
}

/* Responsive Anpassung: Smartphone- und kleine Tabletansichten ohne horizontale Seiten-Scrollbalken */
@media (max-width: 576px) {
    /* Design Tokens: reduziert die Headerhöhe mobil leicht, ohne Navigation neu zu gestalten */
    :root {
        --header-height: 56px;
    }

    /* Inhaltsbereich: gibt mobilen Seiten ausreichend Rand und vermeidet starre Desktopbreiten */
    .app-content {
        padding: 18px 14px 0;
        width: 100%;
        max-width: 100%;
    }

    /* Navigationsregel: Toolbar-Inhalte stapeln sauber statt rechts aus dem Viewport zu laufen */
    .page-toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    /* Navigationsregel: rechte Toolbar-Aktionen bekommen mobil die volle Breite */
    .page-toolbar-right {
        width: 100%;
        margin-left: 0;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    /* Formular- und Aktionsregel: Filterbuttons bleiben bedienbar und scrollen nicht horizontal */
    .inv-filter-group {
        width: 100%;
    }

    /* Tabellenregel: hebt alte Mobile-Spalten-Ausblendung auf und hält alle Daten erreichbar */
    .data-table th:nth-child(2),
    .data-table td:nth-child(2),
    .data-table th:nth-child(4),
    .data-table td:nth-child(4) {
        display: table-cell;
    }

    /* Tabellenregel: Tabellen behalten alle Spalten und bleiben in ihrem eigenen Container scrollbar */
    .data-table {
        min-width: 680px;
    }

    /* Tabellenregel: kleinere Tabellenzellen verbessern die Nutzbarkeit auf Smartphonebreiten */
    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }

    /* Dialoginhalt: Modal beginnt unterhalb des mobilen Headers – analog zur Sidebar-Logik */
    .modal-overlay {
        top: var(--header-height);
        left: 0;
        align-items: stretch;
        padding: 8px 10px;
    }

    /* Dialoginhalt: Box füllt den verbleibenden Platz unterhalb des Headers */
    .modal-box,
    .modal-box.modal-lg {
        max-width: 100%;
        height: calc(100dvh - var(--header-height) - 16px);
        max-height: calc(100dvh - var(--header-height) - 16px);
        border-radius: 18px;
    }

    /* Dialoginhalt: Body nimmt den verbleibenden Platz und scrollt bei langen Formularen */
    .modal-body {
        flex: 1 1 0;
    }

    /* Flächenregel: Dialogkopf bleibt kompakt und der Titel kann umbrechen */
    .modal-header {
        align-items: center;
        gap: 10px;
        padding: 12px 16px;
    }

    /* Dialoginhalt: reduziert Seitenabstände in langen Formularen */
    .modal-body {
        padding: 12px 16px 14px;
    }

    /* Flächenregel: Dialogaktionen umbrechen auf schmalen Bildschirmen */
    .modal-footer {
        align-items: stretch;
        flex-wrap: wrap;
        padding: 11px 16px 14px;
    }

    /* Formular- und Aktionsregel: Dialogbuttons bleiben mobil bequem antippbar */
    .modal-footer .btn {
        flex: 1 1 140px;
        justify-content: center;
    }

    /* Bestätigungsbuttons: kompakt nebeneinander, nicht gestapelt */
    .confirm-actions .btn {
        flex: 1 1 0;
        justify-content: center;
    }

    /* Formular- und Aktionsregel: zweispaltige Formularreihen stapeln sich im Modal einspaltig */
    .modal-box .form-row {
        grid-template-columns: 1fr;
    }

    /* Modal-Formular: kompakte Feldabstände statt der großen mobilen Standardwerte */
    .modal-box .form-group {
        gap: 4px;
        margin-bottom: 10px;
    }

    /* Label klar vom Feld trennen: kleiner, uppercase, gedämpfte Farbe */
    .modal-box .form-label {
        font-size: 0.72rem;
        font-weight: 600;
        color: var(--text-secondary);
        text-transform: uppercase;
        letter-spacing: 0.06em;
    }

    /* Felder kompakter: weniger Padding und Mindesthöhe */
    .modal-box .form-control,
    .modal-box select.form-control,
    .modal-box input.form-control {
        min-height: 40px;
        padding: 8px 12px;
        font-size: var(--text-sm);
    }

    /* Textarea etwas weniger hoch im Modal */
    .modal-box textarea.form-control {
        min-height: 64px;
    }

    /* Hinweistexte noch kleiner */
    .modal-box .form-hint {
        font-size: 0.7rem;
        margin-top: 2px;
    }

    /* Flächenregel: Bestätigungsdialoge behalten sichere Ränder im Viewport */
    .confirm-box {
        max-width: calc(100vw - 28px);
        padding: 24px 20px 20px;
    }

    /* UI-Regel: Konfliktlisten in Formularen stapeln lange Inhalte sauber */
    .conflict-item {
        align-items: flex-start;
        flex-wrap: wrap;
    }
}

/* Responsive Anpassung: kleine Smartphones bekommen einspaltige, touchfreundliche Controls */
@media (max-width: 576px) {
    /* Design Tokens: skaliert Typografie behutsam für sehr kleine Displays */
    :root {
        --text-base: 0.95rem;
        --text-lg: 1.05rem;
        --text-xl: 1.15rem;
        --text-2xl: 1.28rem;
    }

    /* Inhaltsbereich: nutzt auf kleinen Smartphones den Platz maximal, ohne an den Rand zu kleben */
    .app-content {
        padding-inline: 10px;
    }

    /* Karteninhalt: reduziert Kartenabstände auf kleinen Smartphones */
    .card-body {
        padding: 16px;
    }

    /* Flächenregel: leere Zustände bleiben lesbar, aber nicht übermäßig hoch */
    .empty-state {
        padding: 34px 18px;
    }

    /* Formular- und Aktionsregel: Buttons dürfen volle Breite nutzen, wenn sonst Umbruchprobleme entstehen */
    .page-toolbar .btn,
    .empty-state .btn {
        width: 100%;
        justify-content: center;
    }

    /* Tabellenregel: sehr kleine Displays bekommen kompaktere Tabellen im Scrollcontainer */
    .data-table {
        min-width: 620px;
    }

    /* Tabellenregel: Aktionsbuttons bleiben auch bei Scrolltabellen gut erreichbar */
    .btn-icon {
        width: 34px;
        height: 34px;
    }

    /* Dialoginhalt: sehr kleine Displays – minimale Ränder, unterhalb des Headers */
    .modal-overlay {
        top: var(--header-height);
        left: 0;
        padding: 6px;
    }

    /* Dialoginhalt: Höhe = Viewport minus Header minus Padding */
    .modal-box,
    .modal-box.modal-lg {
        height: calc(100dvh - var(--header-height) - 12px);
        max-height: calc(100dvh - var(--header-height) - 12px);
        border-radius: 16px;
    }

    /* Flächenregel: Dialogkopf auf kleinen Displays besonders kompakt */
    .modal-header {
        padding: 12px 14px 10px;
    }

    /* Dialoginhalt: minimierter Innenabstand für kleine Displays */
    .modal-body {
        padding: 12px 14px;
    }

    /* Flächenregel: Aktionen bleiben auf kleinen Displays erreichbar */
    .modal-footer {
        padding: 10px 14px 12px;
    }

    /* Flächenregel: Dialogtitel bleibt lesbar neben dem Schließen-Button */
    .modal-title {
        font-size: var(--text-base);
        line-height: 1.35;
    }

    /* Formular- und Aktionsregel: Bestätigungsbuttons bleiben nebeneinander und teilen die Breite gleichmäßig */
    .confirm-actions .btn {
        flex: 1 1 0;
        justify-content: center;
    }

    /* Layoutregel: Kalenderkopf behält Pfeil-links/rechts-Anordnung auch auf kleinen Displays */
    .cal-header {
        align-items: center;
        padding: 12px 14px;
    }

    /* Layoutregel: Kalenderdetails vermeiden dreispaltige Engstellen */
    .cal-detail-item {
        grid-template-columns: 4px minmax(0, 1fr);
    }
}

/* --- Reset & Base ------------------------------------------ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Seitenbasis: definiert Grundlayout, Schrift und Hintergrund der Anwendung */
html, body {
    height: 100%;
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--text);
    background: var(--chrome-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--chrome-bg);
    pointer-events: none;
    z-index: 200;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
a {
    color: var(--primary);
    text-decoration: none;
}

/* Zustandsregel: macht Interaktion und aktuellen UI-Zustand visuell erkennbar */
a:hover {
    color: var(--primary-hover);
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
}

/* --- Utility Classes --------------------------------------- */
.text-secondary  { color: var(--text-secondary); }
/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.text-tertiary   { color: var(--text-tertiary); }
/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.text-primary    { color: var(--primary); }
/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.text-success    { color: var(--success); }
/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.text-danger     { color: var(--danger); }
/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.text-warning    { color: var(--warning); }
/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.text-info       { color: var(--info); }

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.font-medium     { font-weight: 500; }
/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.font-semibold   { font-weight: 600; }
/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.font-bold       { font-weight: 700; }

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.text-sm         { font-size: var(--text-sm); }
/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.text-xs         { font-size: var(--text-xs); }
/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.text-lg         { font-size: var(--text-lg); }
/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.text-xl         { font-size: var(--text-xl); }
/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.text-2xl        { font-size: var(--text-2xl); }

/* --- Badge ------------------------------------------------- */
/* Status-Chip: kompakt, informativ – kein Button-Charakter */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    min-height: 20px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.02em;
    cursor: default;
    user-select: none;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.badge-success { background: #16a34a; color: #ffffff; }
/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.badge-danger  { background: #dc2626; color: #ffffff; }
/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.badge-warning { background: #d97706; color: #ffffff; }
.badge-repair  { background: var(--repair); color: #ffffff; }
/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.badge-info    { background: var(--info); color: #ffffff; }
/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.badge-neutral { background: #6b7280; color: #ffffff; }
/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.badge-primary { background: #f97316; color: #ffffff; }

/* --- Buttons ----------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: var(--radius);
    font-size: var(--text-sm);
    font-weight: 500;
    font-family: var(--font-body);
    cursor: pointer;
    border: none;
    transition:
        background var(--transition),
        color var(--transition),
        border-color var(--transition),
        box-shadow var(--transition),
        transform var(--transition),
        filter var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:focus-visible,
.nav-item:focus-visible,
.dashboard-card:focus-visible,
/* Zustandsregel: macht Interaktion und aktuellen UI-Zustand visuell erkennbar */
.next-reserv-link:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 3px rgba(255,255,255,.86),
        0 0 0 5px rgba(249,115,22,.32);
}

/* Zustandsregel: macht Interaktion und aktuellen UI-Zustand visuell erkennbar */
.btn:hover { transform: translateY(-1px); }

/* Zustandsregel: macht Interaktion und aktuellen UI-Zustand visuell erkennbar */
.btn:active { transform: translateY(0); }

/* Formular- und Aktionsregel: sorgt für konsistente Bedienbarkeit und Abstände */
.btn-primary {
    background: #f97316;
    color: #fff;
    font-weight: 700;
    border: none;
    box-shadow: 0 3px 8px rgba(0,0,0,0.12);
    transition: all 0.15s ease;
}

/* Zustandsregel: macht Interaktion und aktuellen UI-Zustand visuell erkennbar */
.btn-primary:hover {
    background: #ea580c;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.15);
}

/* Zustandsregel: Active-Zustand */
.btn-primary:active {
    background: #c2410c;
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

/* Formular- und Aktionsregel: sorgt für konsistente Bedienbarkeit und Abstände */
.btn-secondary {
    background: #f97316;
    color: #fff;
    border: none;
    font-weight: 700;
    box-shadow: 0 3px 8px rgba(0,0,0,0.12);
    transition: all 0.15s ease;
}

/* Zustandsregel: macht Interaktion und aktuellen UI-Zustand visuell erkennbar */
.btn-secondary:hover {
    background: #ea580c;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.15);
}

/* Zustandsregel: Active-Zustand */
.btn-secondary:active {
    background: #c2410c;
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

/* Formular- und Aktionsregel: sorgt für konsistente Bedienbarkeit und Abstände */
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

/* Zustandsregel: macht Interaktion und aktuellen UI-Zustand visuell erkennbar */
.btn-ghost:hover {
    background: rgba(249,115,22,0.10);
    color: var(--text);
}

/* Formular- und Aktionsregel: sorgt für konsistente Bedienbarkeit und Abstände */
.btn-sm {
    padding: 5px 12px;
    font-size: var(--text-xs);
}

/* --- Card -------------------------------------------------- */
.main-content-surface .card {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
    min-width: 0;
    transition:
        transform var(--transition),
        box-shadow var(--transition-md),
        border-color var(--transition);
}

.main-content-surface .card,
.main-content-surface .panel,
.main-content-surface .box,
.main-content-surface .content-card {
    background: var(--surface-2) !important;
    border: 1px solid rgba(255,255,255,0.07) !important;
}

/* Zustandsregel: macht Interaktion und aktuellen UI-Zustand visuell erkennbar */
.info-card:hover {
    border-color: rgba(249,115,22,0.12);
    box-shadow: 0 5px 14px rgba(0,0,0,0.34), 0 0 0 1px rgba(255,255,255,0.05);
}

/* Karteninhalt: ordnet Text und Metadaten innerhalb der Kartenfläche */
.card-body {
    padding: 22px 24px;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Flächenregel: strukturiert Inhalte als eigenständigen visuellen Bereich */
.main-content-surface .card-header {
    padding: 18px 24px 14px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    background: rgba(255,255,255,0.015);
}

.main-content-surface .card-header > * {
    min-width: 0;
}

.main-content-surface .card-header > .btn,
.main-content-surface .card-header > .badge {
    max-width: 100%;
}

/* Dashboard-Cards: overflow:hidden damit der Header-Gradient an den Card-Ecken geclippt wird */
.home-dashboard-page .info-card.card {
    overflow: hidden;
}

/* Dashboard-Cards: orangefarbener Gradient im Header für sichtbaren Kontrast zum Body */
.home-dashboard-page .card-header {
    background: linear-gradient(180deg, rgba(249,115,22,0.22) 0%, rgba(255,255,255,0.03) 100%) !important;
}

/* Flächenregel: strukturiert Inhalte als eigenständigen visuellen Bereich */
.card-title {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--text);
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Flächenregel: strukturiert Inhalte als eigenständigen visuellen Bereich */
.info-card {
    min-height: 100%;
}

/* --- Form -------------------------------------------------- */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

/* Formular- und Aktionsregel: sorgt für konsistente Bedienbarkeit und Abstände */
.form-label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text);
}

/* Zeichenzähler rechts im Label – dezent neutral, Warnung ab Schwelle, Limit rot */
.char-counter {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
}

/* Zustandsregel: Warnschwelle – Farbe wechselt auf Gelb */
.char-counter--yellow {
    color: var(--warning);
}

/* Zustandsregel: Limit erreicht – Farbe wechselt auf Rot und wird fetter */
.char-counter--red {
    color: var(--danger);
    font-weight: 700;
}

/* Formular- und Aktionsregel: sorgt für konsistente Bedienbarkeit und Abstände */
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    font-family: var(--font-body);
    color: var(--text);
    background: var(--card);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

/* Zustandsregel: macht Interaktion und aktuellen UI-Zustand visuell erkennbar */
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249,115,22,0.12);
}

/* Formular- und Aktionsregel: sorgt für konsistente Bedienbarkeit und Abstände */
.form-control::placeholder {
    color: var(--text-tertiary);
}

/* --- Status Dot -------------------------------------------- */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.status-dot.online  { background: var(--success); }
/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.status-dot.offline { background: var(--danger); }
/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.status-dot.warning { background: var(--warning); }
/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.status-dot.idle    { background: var(--text-tertiary); }

/* --- Divider ----------------------------------------------- */
.divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}

/* --- Sidebar Navigation Items ------------------------------ */
/* Global (nicht scoped), weil NavLink das Root-Element ist    */
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    padding: 10px 12px 10px 14px;
    border-radius: 12px;
    color: var(--sidebar-text);
    font-size: var(--text-sm);
    font-weight: 550;
    text-decoration: none;
    transition:
        background var(--transition),
        color var(--transition),
        transform var(--transition),
        box-shadow var(--transition);
    margin-bottom: 4px;
}

/* Zustandsregel: Hover mit hellem Hintergrund-Tint und vollem weißem Text */
.nav-item:hover {
    background: var(--sidebar-hover);
    color: #ffffff;
    transform: translateX(1px);
    text-decoration: none;
}

/* Zustandsregel: aktiver Eintrag klar hervorgehoben – kräftiger Orange-Hintergrund */
.nav-item.active {
    background: linear-gradient(90deg, rgba(249,115,22,0.26), rgba(249,115,22,0.08));
    color: #F97316;
    font-weight: 700;
    border-left: 4px solid var(--sidebar-active);
    padding-left: 10px;
}

/* Zustandsregel: macht Interaktion und aktuellen UI-Zustand visuell erkennbar */
.nav-item:focus-visible {
    outline: none;
    background: rgba(255,255,255,.08);
    box-shadow:
        inset 0 0 0 1px rgba(249,115,22,.34),
        0 0 0 3px rgba(249,115,22,.14);
}

/* Zustandsregel: ::before deaktiviert – Akzent erfolgt über border-left am aktiven Element */
.nav-item.active::before {
    content: none;
}

/* Navigationsregel: Icons deutlich sichtbar auf dunklem Hintergrund */
.nav-item .nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    color: rgba(226,232,240,0.78);
    flex-shrink: 0;
    transition: color var(--transition), transform var(--transition);
}

.nav-item:hover .nav-icon,
/* Zustandsregel: macht Interaktion und aktuellen UI-Zustand visuell erkennbar */
.nav-item.active .nav-icon {
    color: var(--sidebar-active);
}

/* Zustandsregel: macht Interaktion und aktuellen UI-Zustand visuell erkennbar */
.nav-item:hover .nav-icon {
    transform: translateX(1px);
}

/* Navigationsregel: hält Orientierung und zentrale Bereiche visuell konsistent */
.nav-item .nav-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Sidebar Brand ----------------------------------------- */
/* Global (nicht scoped), da NavLink das Scope-Attribut nicht zuverlässig
   an die gerenderte <a>-Klasse weitergibt – gleiches Muster wie .nav-item. */

/* Markenbereich: Logo links, Textblock rechts daneben */
.sidebar-brand {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.9rem;
    padding: 0.8rem 1rem 0.7rem 1rem;
    flex-shrink: 0;
    font-size: 16px;
    color: inherit;
    text-decoration: none;
}

/* Logo-Bild: feste Größe, damit es nicht auf natürliche Bildgröße aufbläht */
.sidebar-brand-icon {
    width: 70px;
    height: 70px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.18));
}

/* Textblock: OrgaPlus-Name und INVENTORY untereinander */
.sidebar-brand-text {
    display: flex;
    flex-direction: column;
}

/* Produktname OrgaPlus */
.sidebar-brand-name {
    font-family: "Outfit", var(--font-body);
    font-size: 1.2em;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.1;
}

/* Produktlinie INVENTORY – fest verankert, kein Kunden-Branding */
.sidebar-brand-sub {
    font-family: var(--font-body);
    font-size: 0.72em;
    font-weight: 700;
    color: #F97316;
    letter-spacing: 0.17em;
    text-transform: uppercase;
    margin-top: 0.38rem;
}

@media (max-width: 767px) {
    .sidebar-brand {
        display: none;
    }
}

/* --- Scrollbar --------------------------------------------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
::-webkit-scrollbar-track { background: transparent; }
/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
/* Zustandsregel: macht Interaktion und aktuellen UI-Zustand visuell erkennbar */
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* --- Blazor Validation ------------------------------------- */
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--success); }
/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.invalid { outline: 1px solid var(--danger); }
/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.validation-message { color: var(--danger); font-size: var(--text-sm); margin-top: 4px; }

/* --- Blazor Error UI --------------------------------------- */
#blazor-error-ui {
    background: var(--danger-light);
    border-top: 1px solid var(--danger);
    bottom: 0;
    box-shadow: var(--shadow-md);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-size: var(--text-sm);
    color: var(--danger);
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.blazor-error-boundary {
    background: var(--danger-light);
    padding: 1rem 1rem 1rem 3.7rem;
    color: var(--danger);
    border-radius: var(--radius);
}

/* Pseudo-Element: ergänzt dekorative Struktur ohne zusätzliches Markup */
.blazor-error-boundary::after {
    content: "Ein Fehler ist aufgetreten.";
}

/* --- Blazor Reconnect UI ---------------------------------- */
.reconnect-panel {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background:
        radial-gradient(circle at 50% 20%, rgba(249,115,22,.18), transparent 34%),
        rgba(12,14,18,.78);
    backdrop-filter: blur(6px);
}

.reconnect-panel.components-reconnect-show,
.reconnect-panel.components-reconnect-failed,
/* Flächenregel: strukturiert Inhalte als eigenständigen visuellen Bereich */
.reconnect-panel.components-reconnect-rejected {
    display: flex;
}

/* Flächenregel: strukturiert Inhalte als eigenständigen visuellen Bereich */
.reconnect-card {
    width: min(560px, 100%);
    padding: 42px 36px 36px;
    text-align: center;
    border-radius: 30px;
    color: rgba(248,250,252,.78);
    background:
        radial-gradient(circle at 50% 0%, rgba(249,115,22,.18), transparent 42%),
        linear-gradient(180deg, rgba(31,31,33,0.98) 0%, rgba(24,24,26,0.98) 100%);
    border: 1px solid rgba(255,255,255,.08);
    box-shadow:
        0 34px 90px rgba(4,8,14,.42),
        inset 0 1px 0 rgba(255,255,255,.06);
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.orgaplus-status-logo {
    position: relative;
    width: 96px;
    height: 96px;
    display: grid;
    place-items: center;
    margin: 0 auto 28px;
}

/* Flächenregel: strukturiert Inhalte als eigenständigen visuellen Bereich */
.reconnect-card .orgaplus-status-logo {
    margin: 0 auto 28px;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.orgaplus-status-logo svg {
    width: 42px;
    height: 42px;
    color: #fff;
    filter: drop-shadow(0 6px 14px rgba(0,0,0,.28));
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.orgaplus-status-logo svg path {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.status-orbit {
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    border: 1px solid rgba(249,115,22,.28);
}

/* Pseudo-Element: ergänzt dekorative Struktur ohne zusätzliches Markup */
.status-orbit::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -5px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #ffb15c 0%, #f97316 100%);
    box-shadow: 0 0 0 4px rgba(249,115,22,.15), 0 6px 14px rgba(249,115,22,.32);
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.status-orbit-outer {
    animation: orgaplusOrbitClockwise 1.6s linear infinite;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.status-orbit-inner {
    inset: 20px;
    border-color: rgba(251,146,60,.38);
    animation: orgaplusOrbitCounter 1.1s linear infinite;
}

/* Pseudo-Element: ergänzt dekorative Struktur ohne zusätzliches Markup */
.status-orbit-inner::after {
    right: auto;
    left: -4px;
    width: 9px;
    height: 9px;
    background: linear-gradient(135deg, #fed7aa 0%, #fb923c 100%);
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.reconnect-copy {
    display: none;
}

.components-reconnect-show .reconnect-copy-show,
.components-reconnect-failed .reconnect-copy-failed,
/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.components-reconnect-rejected .reconnect-copy-rejected {
    display: block;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.reconnect-copy h2 {
    margin-bottom: 14px;
    color: #fff;
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.03em;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.reconnect-copy p {
    max-width: 320px;
    margin: 0 auto;
    color: rgba(209,215,226,.78);
    font-size: var(--text-sm);
    line-height: 1.7;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.reconnect-copy span {
    display: block;
    margin-top: 18px;
    color: #F97316;
    font-size: var(--text-sm);
    font-weight: 700;
}

/* Formular- und Aktionsregel: sorgt für konsistente Bedienbarkeit und Abstände */
.reconnect-copy .btn {
    margin-top: 22px;
}

/* Animation: beschreibt den Bewegungsablauf für orgaplusOrbitClockwise */
@keyframes orgaplusOrbitClockwise {
    /* Animationsschritt: definiert einen Zwischenzustand der Bewegung */
    to { transform: rotate(360deg); }
}

/* Animation: beschreibt den Bewegungsablauf für orgaplusOrbitCounter */
@keyframes orgaplusOrbitCounter {
    /* Animationsschritt: definiert einen Zwischenzustand der Bewegung */
    to { transform: rotate(-360deg); }
}

/* Responsive Anpassung: begrenzt die folgenden Regeln auf passende Viewportgrößen */
@media (prefers-reduced-motion: reduce) {
    .status-orbit,
    /* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
    .status-orbit-inner {
        animation: none;
    }
}

/* --- Modal ------------------------------------------------- */
/* Overlay beginnt nach der Sidebar, damit das Modal im Content-Bereich zentriert wird */
.modal-overlay {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    background: rgba(9,10,12,0.76);
    backdrop-filter: blur(5px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 150ms ease;
}

/* Animation: beschreibt den Bewegungsablauf für fadeIn */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
/* Animation: beschreibt den Bewegungsablauf für slideUp */
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* Flächenregel: strukturiert Inhalte als eigenständigen visuellen Bereich */
.modal-box {
    background: var(--surface-2);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 520px;
    max-height: calc(100dvh - 32px);
    overflow: hidden;
    animation: slideUp 200ms ease;
}

/* Flächenregel: strukturiert Inhalte als eigenständigen visuellen Bereich */
.modal-box.modal-lg { max-width: 680px; }

.modal-box.user-edit-modal {
    max-width: min(1040px, calc(100vw - 32px));
}

@media (max-width: 798px) {
    .modal-overlay {
        top: var(--header-height);
        left: 0;
        align-items: stretch;
        padding: 10px;
    }

    .modal-box,
    .modal-box.modal-lg,
    .modal-box.user-edit-modal {
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        height: calc(100dvh - var(--header-height) - 20px);
        max-height: calc(100dvh - var(--header-height) - 20px);
    }

    .modal-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
    }

    .modal-body > form {
        min-height: 0;
    }
}

/* Flächenregel: strukturiert Inhalte als eigenständigen visuellen Bereich */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

/* Flächenregel: strukturiert Inhalte als eigenständigen visuellen Bereich */
.modal-title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text);
}

/* Flächenregel: strukturiert Inhalte als eigenständigen visuellen Bereich */
.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(249,115,22,0.12);
    color: var(--primary);
    border: 1px solid rgba(249,115,22,0.28);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    flex-shrink: 0;
}

/* Zustandsregel: macht Interaktion und aktuellen UI-Zustand visuell erkennbar */
.modal-close:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 3px 8px rgba(0,0,0,0.16);
}

/* Zustandsregel: Active-Zustand */
.modal-close:active {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Dialoginhalt: strukturiert den scrollbaren Inhaltsbereich im Modal */
.modal-body {
    padding: 20px 24px;
}

/* Flächenregel: strukturiert Inhalte als eigenständigen visuellen Bereich */
.modal-footer {
    padding: 16px 24px 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

/* --- Alert / Inline error ---------------------------------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius);
    font-size: var(--text-sm);
    margin-bottom: 16px;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.alert-danger  { background: var(--danger-light);  color: var(--danger);   border: 1px solid rgba(239,68,68,.18); }
/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.alert-warning { background: var(--warning-light); color: var(--warning);  border: 1px solid rgba(245,158,11,.2); }
/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.alert-success { background: var(--success-light); color: var(--success);  border: 1px solid rgba(34,197,94,.2); }
/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.alert-info    { background: var(--info-light);    color: var(--info);     border: 1px solid rgba(59,130,246,.2); }
.alert-info    { border: 1px solid rgba(47,107,122,.24); }

/* --- Table ------------------------------------------------- */
.data-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,0.07);
    background: var(--surface-2);
    box-shadow: var(--shadow-card);
}

.main-content-surface .data-table-wrap {
    background: var(--surface-2) !important;
    border: 1px solid rgba(255,255,255,0.07) !important;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.data-table thead tr {
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.data-table th {
    padding: 10px 16px;
    font-weight: 600;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    text-align: left;
    white-space: nowrap;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    color: var(--text);
    vertical-align: middle;
}

/* Tabellenregel: hält Zeilenabstände und Hover-Zustände in Datenlisten konsistent */
.data-table tbody tr:last-child td { border-bottom: none; }

/* Tabellenregel: hält Zeilenabstände und Hover-Zustände in Datenlisten konsistent */
.data-table tbody tr {
    transition: background var(--transition);
}

/* Tabellenregel: hält Zeilenabstände und Hover-Zustände in Datenlisten konsistent */
.data-table tbody tr:hover {
    background: rgba(255,255,255,0.03);
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.table-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Formular- und Aktionsregel: sorgt für konsistente Bedienbarkeit und Abstände */
.btn-icon {
    width: 32px;
    height: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(249,115,22,0.32);
    background: var(--primary);
    border-radius: 10px;
    cursor: pointer;
    color: #ffffff;
    box-shadow: none;
    transition: all 0.15s ease;
    padding: 0;
    flex-shrink: 0;
}

/* Zustandsregel: macht Interaktion und aktuellen UI-Zustand visuell erkennbar */
.btn-icon:hover {
    background: #ff8a2a;
    border-color: #ff9a4d;
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

/* Zustandsregel: Active-Zustand */
.btn-icon:active {
    background: #e5670f;
    border-color: #e5670f;
    color: #ffffff;
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

/* Zustandsregel: Danger-Variante beim Hover */
.btn-icon.btn-icon-danger:hover {
    background: rgba(239,68,68,0.14);
    border-color: rgba(239,68,68,0.24);
    color: #fecaca;
}

/* --- Empty State ------------------------------------------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 52px 24px;
    text-align: center;
    color: var(--text-tertiary);
    background: var(--surface-2);
    border: 1px dashed rgba(255,255,255,0.10);
    border-radius: var(--radius-lg);
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.empty-state-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-secondary);
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.empty-state-text {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    max-width: 300px;
}

/* --- Form row / two columns -------------------------------- */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}

/* Formular- und Aktionsregel: sorgt für konsistente Bedienbarkeit und Abstände */
.form-hint {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* Formular- und Aktionsregel: sorgt für konsistente Bedienbarkeit und Abstände */
textarea.form-control {
    resize: vertical;
    min-height: 72px;
}

/* --- Confirm Dialog ---------------------------------------- */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(9,10,12,0.8);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 120ms ease;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.confirm-box {
    background: var(--surface-2);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 380px;
    padding: 28px 28px 24px;
    animation: slideUp 180ms ease;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.confirm-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--danger-light);
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.confirm-title {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.confirm-text {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Formular- und Aktionsregel: sorgt für konsistente Bedienbarkeit und Abstände */
.btn-danger {
    background: var(--danger);
    color: #fff;
    border: none;
}

/* Zustandsregel: macht Interaktion und aktuellen UI-Zustand visuell erkennbar */
.btn-danger:hover {
    background: #DC2626;
    color: #fff;
}

/* --- Page toolbar ------------------------------------------ */
.page-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.page-toolbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.count-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* --- Reservation card -------------------------------------- */
.status-surface-card,
.reserv-card,
.inventar-card,
.inventory-admin-card,
.card-reference-list .entry-card.event-card {
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(90deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01) 38%, rgba(255,255,255,0) 100%),
        var(--surface-2);
    box-shadow: var(--shadow-card);
    transition:
        background var(--transition),
        border-color var(--transition),
        box-shadow var(--transition-md);
}

.status-surface-card:hover,
.reserv-card:hover,
.inventar-card:hover,
.inventory-admin-card:hover,
.card-reference-list .entry-card.event-card:hover {
    border-color: rgba(255,255,255,0.11);
    box-shadow: 0 5px 14px rgba(0,0,0,0.22), 0 0 0 1px rgba(255,255,255,0.04);
}

.status-surface-card--info,
.reserv-card--reserviert,
.card-reference-list .entry-card.event-card--reserviert {
    background:
        linear-gradient(90deg, rgba(47,107,122,0.24) 0%, rgba(47,107,122,0.10) 28%, rgba(47,107,122,0.03) 56%, rgba(255,255,255,0) 100%),
        var(--surface-2);
    border-color: rgba(93,164,181,0.10);
}

.inventar-card--reparatur,
.inventory-admin-card--reparatur {
    background:
        linear-gradient(90deg, rgba(188,170,72,0.12) 0%, rgba(180,163,70,0.09) 18%, rgba(156,142,63,0.06) 42%, rgba(111,100,47,0.032) 68%, rgba(22,18,8,0.012) 100%),
        var(--surface-2);
    border-color: rgba(234,211,102,0.12);
}

.status-surface-card--warning,
.reserv-card--ausgegeben,
.card-reference-list .entry-card.event-card--ausgegeben {
    background:
        linear-gradient(90deg, rgba(161,98,7,0.24) 0%, rgba(161,98,7,0.10) 28%, rgba(161,98,7,0.03) 56%, rgba(255,255,255,0) 100%),
        var(--surface-2);
    border-color: rgba(251,191,36,0.10);
}

.status-surface-card--danger,
.reserv-card--nochnichtzurueckgegeben,
.card-reference-list .entry-card.event-card--nochnichtzurueckgegeben,
.inventar-card--defekt,
.inventory-admin-card--defekt {
    background:
        linear-gradient(90deg, rgba(145,36,64,0.12) 0%, rgba(136,36,63,0.09) 18%, rgba(118,34,58,0.06) 42%, rgba(84,26,43,0.032) 68%, rgba(24,8,14,0.012) 100%),
        var(--surface-2);
    border-color: rgba(251,113,133,0.10);
}

.status-surface-card--success,
.inventar-card--einsatzbereit,
.inventory-admin-card--einsatzbereit {
    background:
        linear-gradient(90deg, rgba(41,146,77,0.11) 0%, rgba(41,137,77,0.085) 18%, rgba(39,118,71,0.058) 42%, rgba(29,83,54,0.03) 68%, rgba(7,20,12,0.012) 100%),
        var(--surface-2);
    border-color: rgba(74,222,128,0.12);
}

/* DOKUMENT-KATEGORIE-GRADIENTEN */
/* 7 Farbklassen (0–6): Orange, Teal, Lila, Grün, Blau, Amber, Rot */
/* Farbe wird per determiniertem Hash des Kategorienamens in C# zugewiesen */

/* Kategorie-Gradient: Orange */
.card-reference-list .entry-card.doc-cat-0 {
    background:
        linear-gradient(90deg, rgba(249,115,22,0.20) 0%, rgba(249,115,22,0.08) 28%, rgba(249,115,22,0.02) 56%, rgba(255,255,255,0) 100%),
        var(--surface-2);
    border-color: rgba(249,115,22,0.12);
}

/* Kategorie-Gradient: Teal */
.card-reference-list .entry-card.doc-cat-1 {
    background:
        linear-gradient(90deg, rgba(47,107,122,0.24) 0%, rgba(47,107,122,0.10) 28%, rgba(47,107,122,0.03) 56%, rgba(255,255,255,0) 100%),
        var(--surface-2);
    border-color: rgba(93,164,181,0.10);
}

/* Kategorie-Gradient: Lila */
.card-reference-list .entry-card.doc-cat-2 {
    background:
        linear-gradient(90deg, rgba(124,58,237,0.20) 0%, rgba(124,58,237,0.08) 28%, rgba(124,58,237,0.02) 56%, rgba(255,255,255,0) 100%),
        var(--surface-2);
    border-color: rgba(167,139,250,0.12);
}

/* Kategorie-Gradient: Grün */
.card-reference-list .entry-card.doc-cat-3 {
    background:
        linear-gradient(90deg, rgba(22,163,74,0.20) 0%, rgba(22,163,74,0.08) 28%, rgba(22,163,74,0.02) 56%, rgba(255,255,255,0) 100%),
        var(--surface-2);
    border-color: rgba(74,222,128,0.12);
}

/* Kategorie-Gradient: Blau */
.card-reference-list .entry-card.doc-cat-4 {
    background:
        linear-gradient(90deg, rgba(37,99,235,0.22) 0%, rgba(37,99,235,0.09) 28%, rgba(37,99,235,0.03) 56%, rgba(255,255,255,0) 100%),
        var(--surface-2);
    border-color: rgba(96,165,250,0.12);
}

/* Kategorie-Gradient: Amber */
.card-reference-list .entry-card.doc-cat-5 {
    background:
        linear-gradient(90deg, rgba(217,119,6,0.22) 0%, rgba(217,119,6,0.09) 28%, rgba(217,119,6,0.03) 56%, rgba(255,255,255,0) 100%),
        var(--surface-2);
    border-color: rgba(251,191,36,0.12);
}

/* Kategorie-Gradient: Rot */
.card-reference-list .entry-card.doc-cat-6 {
    background:
        linear-gradient(90deg, rgba(220,38,38,0.18) 0%, rgba(220,38,38,0.07) 28%, rgba(220,38,38,0.02) 56%, rgba(255,255,255,0) 100%),
        var(--surface-2);
    border-color: rgba(251,113,133,0.10);
}

.reserv-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.inventar-list,
.inventory-admin-list {
    gap: 0.8rem !important;
}

.reserv-card {
    padding: 16px 20px;
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.5fr) auto;
    gap: 0 1.2rem;
    align-items: center;
    position: relative;
}

.reserv-card .reserv-card-accent,
.reserv-card .reserv-card-actions > .badge {
    display: none !important;
}

.reserv-card-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.reserv-card-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
}

.reserv-card-meta {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 4px;
}

.reserv-card-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    overflow-wrap: anywhere;
}

.reserv-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 0;
}

@media (max-width: 576px) {
    .info-card .card-header {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        gap: 0.55rem;
        padding: 1rem 1rem 0.8rem;
    }

    .info-card .card-body {
        padding: 1rem;
        text-align: center;
    }

    .home-dashboard-page .info-card.card .card-header {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        gap: 12px !important;
        min-height: 60px;
        padding: 16px 18px 12px !important;
        text-align: left !important;
    }

    .home-dashboard-page .info-card.card .card-header > .card-title {
        min-width: 0;
        flex: 1 1 auto;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .home-dashboard-page .info-card.card .card-header > .badge {
        flex: 0 0 auto;
        min-width: 0 !important;
        width: auto !important;
        height: auto !important;
        padding: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        color: rgba(255,255,255,0.9) !important;
        box-shadow: none !important;
        line-height: 1 !important;
    }

    .home-dashboard-page .info-card.card .card-header > .badge::before {
        content: "(";
    }

    .home-dashboard-page .info-card.card .card-header > .badge::after {
        content: ")";
    }

    .home-dashboard-page .info-card.card .latest-doc-link {
        display: flex;
        margin: 18px auto 4px;
    }

}

/* --- Filter Buttons (shared across Inventar, Reservierungen) --- */
.inv-filter-group {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    gap: 0.55rem;
    min-height: 38px;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    font-size: var(--text-xs);
    font-weight: 600;
    font-family: var(--font-body);
    color: var(--text-secondary);
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
    cursor: pointer;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease,
        color 0.2s ease;
    white-space: nowrap;
    line-height: 1;
}

/* Zustandsregel: macht Interaktion und aktuellen UI-Zustand visuell erkennbar */
.filter-btn:hover {
    background: rgba(255,255,255,0.055);
    border-color: rgba(255,255,255,0.12);
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
    transform: translateY(-1px);
}

/* Zustandsregel: macht Interaktion und aktuellen UI-Zustand visuell erkennbar */
.filter-btn.active {
    background: #ea580c;
    border-color: rgba(249,115,22,0.34);
    color: #ffffff;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.10),
        0 10px 22px rgba(0,0,0,0.18);
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.filter-count {
    min-width: 1.55rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.92);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-align: center;
    line-height: 1;
    box-shadow: none;
}

.filter-btn.active .filter-count {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.08);
    color: #ffffff;
}

.filter-btn--all:not(.active),
.filter-btn--info:not(.active),
.filter-btn--success:not(.active),
.filter-btn--warning:not(.active),
.filter-btn--danger:not(.active),
.filter-btn--neutral:not(.active),
.filter-btn--purple:not(.active),
.filter-btn--orange:not(.active) {
    background: rgba(255,255,255,0.035);
    border-color: rgba(255,255,255,0.08);
    color: var(--text-secondary);
}

/* Orangefarbener Count-Badge für Kategorie-Filter (Dokumente) */
.filter-btn--orange:not(.active) .filter-count {
    background: rgba(249,115,22,0.24);
    border-color: rgba(249,115,22,0.28);
    color: #fff7ed;
}

.filter-btn--all:not(.active) .filter-count,
.filter-btn--purple:not(.active) .filter-count {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.92);
}

.filter-btn--info:not(.active) .filter-count {
    background: rgba(47,107,122,0.24);
    border-color: rgba(93,164,181,0.16);
    color: #d5f2f8;
}

.filter-btn--success:not(.active) .filter-count {
    background: rgba(22,163,74,0.24);
    border-color: rgba(74,222,128,0.14);
    color: #dcfce7;
}

.filter-btn--warning:not(.active) .filter-count {
    background: rgba(161,98,7,0.24);
    border-color: rgba(251,191,36,0.24);
    color: #fef3c7;
}

.filter-btn--danger:not(.active) .filter-count {
    background: rgba(159,18,57,0.24);
    border-color: rgba(251,113,133,0.22);
    color: #ffe4e6;
}

.filter-btn--neutral:not(.active) .filter-count {
    background: rgba(75,85,99,0.24);
    border-color: rgba(209,213,219,0.18);
    color: #f3f4f6;
}

/* --- Tabellen-Referenzlayout (opt-in, gescopt) ------------ */
.table-reference-toolbar .filter-btn {
    position: relative;
    gap: 0.55rem;
    min-height: 38px;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    border-color: rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.035);
    color: var(--text-secondary);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.table-reference-toolbar .filter-btn:hover {
    background: rgba(255,255,255,0.055);
    border-color: rgba(255,255,255,0.12);
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.table-reference-toolbar .filter-btn.active {
    background: #ea580c;
    border-color: rgba(249,115,22,0.34);
    color: #ffffff;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.10),
        0 10px 22px rgba(0,0,0,0.18);
}

.table-reference-toolbar .filter-btn .filter-count {
    min-width: 1.55rem;
    padding: 0.2rem 0.5rem;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.92);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: none;
}

.table-reference-toolbar .filter-btn.active .filter-count {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.08);
    color: #ffffff;
}

.table-reference-toolbar .filter-btn--all:not(.active),
.table-reference-toolbar .filter-btn--info:not(.active),
.table-reference-toolbar .filter-btn--success:not(.active),
.table-reference-toolbar .filter-btn--warning:not(.active),
.table-reference-toolbar .filter-btn--danger:not(.active),
.table-reference-toolbar .filter-btn--purple:not(.active),
.table-reference-toolbar .filter-btn--orange:not(.active) {
    background: rgba(255,255,255,0.035);
    border-color: rgba(255,255,255,0.08);
    color: var(--text-secondary);
}

/* Count-Badge: farbneutral für Alle-Filter */
.table-reference-toolbar .filter-btn--all:not(.active) .filter-count {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.92);
}

/* Count-Badge: orange */
.table-reference-toolbar .filter-btn--orange:not(.active) .filter-count {
    background: rgba(249,115,22,0.24);
    border-color: rgba(249,115,22,0.28);
    color: #fff7ed;
}

/* Count-Badge: teal */
.table-reference-toolbar .filter-btn--info:not(.active) .filter-count {
    background: rgba(47,107,122,0.24);
    border-color: rgba(93,164,181,0.16);
    color: #d5f2f8;
}

/* Count-Badge: lila */
.table-reference-toolbar .filter-btn--purple:not(.active) .filter-count {
    background: rgba(124,58,237,0.24);
    border-color: rgba(167,139,250,0.22);
    color: #ede9fe;
}

/* Count-Badge: grün */
.table-reference-toolbar .filter-btn--success:not(.active) .filter-count {
    background: rgba(22,163,74,0.24);
    border-color: rgba(74,222,128,0.14);
    color: #dcfce7;
}

/* Count-Badge: amber */
.table-reference-toolbar .filter-btn--warning:not(.active) .filter-count {
    background: rgba(161,98,7,0.24);
    border-color: rgba(251,191,36,0.24);
    color: #fef3c7;
}

/* Count-Badge: rot */
.table-reference-toolbar .filter-btn--danger:not(.active) .filter-count {
    background: rgba(159,18,57,0.24);
    border-color: rgba(251,113,133,0.22);
    color: #ffe4e6;
}

.table-reference-wrap .data-table td[data-label="Status"] .badge {
    min-height: 1.55rem;
    padding: 0.26rem 0.68rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.69rem;
    font-weight: 700;
    letter-spacing: 0.015em;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.table-reference-wrap .data-table td[data-label="Status"] .badge-primary {
    background: #c85d16;
    border-color: rgba(255,190,124,0.12);
    color: #fff7ed;
}

.table-reference-wrap .data-table td[data-label="Status"] .badge-success {
    background: #177a43;
    border-color: rgba(134,239,172,0.10);
    color: #ecfdf5;
}

.table-reference-wrap .data-table td[data-label="Status"] .badge-neutral {
    background: #5f6673;
    border-color: rgba(255,255,255,0.08);
    color: #f5f7fa;
}

.table-reference-wrap .data-table tbody tr:nth-child(odd) {
    background: rgba(0,0,0,0.00);
}

.table-reference-wrap .data-table tbody tr:nth-child(even) {
    background: rgba(255,255,255,0.03);
}

.table-reference-wrap .data-table tbody tr:hover {
    background: rgba(255,255,255,0.05);
}

/* --- Card-Referenzlayout (opt-in, gescopt) ---------------- */
.card-reference-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-reference-list .entry-card {
    background: var(--surface-2);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 16px 20px;
    display: grid;
    grid-template-columns: 4px minmax(0, 1fr) auto;
    gap: 0 16px;
    align-items: start;
    transition:
        border-color var(--transition),
        background var(--transition),
        box-shadow var(--transition-md);
}

.card-reference-list .entry-card:hover {
    background: rgba(255,255,255,0.02);
    border-color: rgba(255,255,255,0.11);
    box-shadow: 0 5px 14px rgba(0,0,0,0.22), 0 0 0 1px rgba(255,255,255,0.04);
}

.card-reference-list .entry-card.event-card {
    grid-template-columns: minmax(0, 1fr) auto;
}

.card-reference-list .entry-card.event-card.event-card--static {
    grid-template-columns: minmax(0, 1fr);
}

.card-reference-list .entry-card-accent {
    width: 4px;
    min-height: 44px;
    border-radius: 4px;
    align-self: stretch;
}

.card-reference-list .entry-card-accent--primary {
    background: var(--primary);
}

.card-reference-list .entry-card-accent--dynamic {
    background: var(--entry-card-accent, var(--primary));
}

.card-reference-list .entry-card-main {
    min-width: 0;
}

.card-reference-list .entry-card-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.card-reference-list .entry-card-head-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.card-reference-list .entry-card-leading {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.card-reference-list .entry-card-title {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--text);
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.card-reference-list .entry-card-meta {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.card-reference-list .entry-card-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    line-height: 1.4;
}

.card-reference-list .entry-card-meta-item svg {
    flex-shrink: 0;
}

.card-reference-list .entry-card-meta-item--wrap {
    align-items: flex-start;
}

.card-reference-list .entry-card-meta-item--wrap > span,
.card-reference-list .entry-card-meta-item--wrap > a,
.card-reference-list .entry-card-title > span,
.card-reference-list .entry-card-title > button {
    min-width: 0;
}

.card-reference-list .entry-card-side {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 16px;
    flex-shrink: 0;
}

.card-reference-list .entry-card-status {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
}

.card-reference-list .entry-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

@media (max-width: 768px) {
    .card-reference-list .entry-card {
        grid-template-columns: 4px minmax(0, 1fr);
        gap: 0 12px;
        padding: 14px 16px;
    }

    .card-reference-list .entry-card.event-card,
    .card-reference-list .entry-card.event-card.event-card--static {
        grid-template-columns: 1fr;
    }

    .card-reference-list .entry-card.event-card .entry-card-side {
        grid-column: auto;
    }

    .card-reference-list .entry-card-side {
        grid-column: 2;
        margin-left: 0;
        margin-top: 12px;
        width: 100%;
        justify-content: space-between;
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .card-reference-list .entry-card-status,
    .card-reference-list .entry-card-actions {
        justify-content: flex-start;
    }

    .card-reference-list .entry-card-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 576px) {
    .card-reference-list .entry-card {
        grid-template-columns: 4px minmax(0, 1fr);
        gap: 0 12px;
        padding: 14px 16px;
    }

    .card-reference-list .entry-card.event-card,
    .card-reference-list .entry-card.event-card.event-card--static {
        grid-template-columns: 1fr;
    }

    .card-reference-list .entry-card.event-card .entry-card-side {
        grid-column: auto;
    }

    .card-reference-list .entry-card-side {
        grid-column: 2;
        margin-left: 0;
        margin-top: 12px;
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .card-reference-list .entry-card-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .card-reference-list .entry-card-head {
        gap: 10px;
    }

    .card-reference-list .entry-card-leading {
        width: 40px;
        height: 40px;
    }

    .card-reference-list .entry-card-meta {
        gap: 8px 12px;
    }

    .card-reference-list .entry-card-side {
        align-items: flex-start;
        flex-direction: column;
    }

    .card-reference-list .entry-card-status,
    .card-reference-list .entry-card-actions {
        justify-content: flex-start;
    }
}

/* --- Inventar Filter Pills (SaaS-Stil, statusspezifische Farben) --- */

/* Basis-Pill: gemeinsame Struktur für alle Varianten */
.inv-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 38px;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    font-size: var(--text-xs);
    font-weight: 600;
    font-family: var(--font-body);
    border: 1px solid rgba(255,255,255,0.08);
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease,
        color 0.2s ease;
    white-space: nowrap;
    line-height: 1;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.035);
}

.inv-pill:hover {
    background: rgba(255,255,255,0.055);
    border-color: rgba(255,255,255,0.12);
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.inv-pill--active {
    background: #ea580c;
    border-color: rgba(249,115,22,0.34);
    color: #ffffff;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.10),
        0 10px 22px rgba(0,0,0,0.18);
}

.inv-pill--active:hover {
    background: #f97316;
    border-color: rgba(249,115,22,0.38);
    color: #ffffff;
    transform: translateY(-1px);
}

.inv-pill--all,
.inv-pill--einsatzbereit,
.inv-pill--defekt,
.inv-pill--reparatur {
    background: rgba(255,255,255,0.035);
    border-color: rgba(255,255,255,0.08);
    color: var(--text-secondary);
}

.inv-pill-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    line-height: 0;
    color: inherit;
}

/* Count-Badge: kleines Zählabzeichen rechts in der Pill – alle Varianten einheitlich */
.inv-pill-count {
    min-width: 1.55rem;
    height: auto;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.06);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.92);
    box-shadow: none;
}

.inv-pill--active .inv-pill-count {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.08);
    color: #ffffff;
}

.inv-pill--all .inv-pill-count {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.92);
}

.inv-pill--einsatzbereit .inv-pill-count {
    background: rgba(22,163,74,0.24);
    border-color: rgba(74,222,128,0.14);
    color: #dcfce7;
}

.inv-pill--defekt .inv-pill-count {
    background: rgba(185,28,28,0.24);
    border-color: rgba(248,113,113,0.14);
    color: #fee2e2;
}

.inv-pill--reparatur .inv-pill-count {
    background: rgba(196,173,56,0.22);
    border-color: rgba(234,211,102,0.16);
    color: #fef3c7;
}

/* --- Inventar Status Badges -------------------------------- */
/* Status-Chip: deutlich kompakter als Action-Buttons – kein Klick-Charakter */
.inv-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 9px;
    min-height: 20px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.01em;
    border: none;
    vertical-align: middle;
    white-space: nowrap;
    cursor: default;
    user-select: none;
}

.inv-status-badge--einsatzbereit {
    background: #16a34a;
    color: #ffffff;
}

.inv-status-badge--defekt {
    background: #dc2626;
    color: #ffffff;
}

.inv-status-badge--reparatur {
    background: var(--repair);
    color: #ffffff;
}

/* --- Placeholder Page -------------------------------------- */
.placeholder-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 280px;
    text-align: center;
}

/* --- Calendar ---------------------------------------------- */
.calendar-feed-card {
    display: block;
    margin-bottom: 1.25rem;
    background: var(--surface-2);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.main-content-surface .calendar-feed-card {
    background: var(--surface-2) !important;
    border: 1px solid rgba(255,255,255,0.07) !important;
}

.calendar-feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 14px 18px;
    cursor: pointer;
    color: var(--text);
    user-select: none;
    transition: background 0.25s ease;
}

.calendar-feed-header:hover {
    background: rgba(255,255,255,0.04);
}

.calendar-feed-header-copy {
    min-width: 0;
}

.calendar-feed-header-copy .card-title {
    margin: 0;
}

.calendar-feed-header-copy .text-secondary {
    margin-top: 0.15rem;
    line-height: 1.35;
}

.calendar-feed-chevron {
    color: #ffffff;
    transition: transform 0.25s ease;
}

.calendar-feed-card.is-expanded .calendar-feed-chevron {
    transform: rotate(180deg);
}

.calendar-feed-chevron-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--primary);
    border: 1px solid rgba(249,115,22,0.32);
    box-shadow: none;
}

.calendar-feed-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.calendar-feed-card.is-expanded .calendar-feed-content {
    max-height: 560px;
}

.calendar-feed-body {
    border-top: 1px solid rgba(255,255,255,0.07);
    background: rgba(255,255,255,0.02);
}

.calendar-feed-intro {
    padding: 14px 18px 0;
}

.calendar-feed-intro p {
    max-width: 760px;
    margin: 0;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    line-height: 1.55;
}

.calendar-feed-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.9rem;
    padding: 14px 18px 0;
}

.calendar-feed-url-box {
    flex: 1 1 auto;
    min-width: 0;
    display: grid;
    gap: 0.35rem;
    padding: 12px 14px;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
}

.calendar-feed-url-label {
    color: #6b7280;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.calendar-feed-url-value {
    overflow: hidden;
    color: var(--text);
    font-size: var(--text-sm);
    line-height: 1.45;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Layoutregel: hält Kalenderlink, Beschreibung und Aktionen auf großen Ansichten stabil nebeneinander */
.calendar-feed-main {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    padding: 16px 20px 0;
}

/* UI-Regel: erklärt die automatische Aktualisierung ohne visuelle Überladung */
.calendar-feed-main p {
    max-width: 780px;
    margin: 0;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    line-height: 1.55;
}

/* Formular- und Aktionsregel: ordnet Kalenderabo-Aktionen touchfreundlich an */
.calendar-feed-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: flex-end;
    flex: 0 0 auto;
}

.calendar-feed-actions .btn {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    box-shadow: none;
    font-size: 12px;
}

.calendar-feed-action-primary {
    background: var(--primary);
    border-color: transparent;
}

.calendar-feed-action-primary:hover {
    background: var(--primary-hover);
    border-color: transparent;
}

.calendar-feed-action-secondary {
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
    border: 1px solid rgba(255,255,255,0.08);
}

.calendar-feed-action-secondary:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.12);
}

/* Formular- und Aktionsregel: verbindet Feed-URL und Kopierhinweis ohne Überlauf */
/* UI-Regel: zeigt den Kopierstatus unaufdringlich direkt unter der Feed-URL */
.calendar-feed-copy {
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 600;
}

/* UI-Regel: macht Kalenderclient-Hinweise scanbar und umbrechbar */
.calendar-feed-help {
    display: grid;
    gap: 0.6rem;
    padding: 14px 18px 18px;
    border-top: 1px solid rgba(255,255,255,0.07);
    color: var(--text-tertiary);
    font-size: 12px;
    line-height: 1.5;
}

.calendar-feed-help-item {
    display: grid;
    gap: 0.1rem;
}

.calendar-feed-help-item strong {
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

.calendar-feed-help-item span {
    color: var(--text-tertiary);
    font-size: 12px;
}

@media (max-width: 768px) {
    .calendar-feed-header {
        align-items: flex-start;
    }

    .calendar-feed-row {
        flex-direction: column;
    }

    .calendar-feed-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .calendar-feed-actions .btn {
        flex: 1 1 200px;
        justify-content: center;
    }
}

/* Responsive Anpassung: stapelt Kalenderfeed-Aktionen auf Tablet- und Smartphonebreite */
@media (max-width: 576px) {
    /* Layoutregel: Kalenderfeed-Beschreibung und Aktionen erhalten eigene Zeilen */
    .calendar-feed-intro,
    .calendar-feed-row,
    .calendar-feed-help {
        padding-left: 16px;
        padding-right: 16px;
    }

    .calendar-feed-header {
        padding: 16px;
    }

    .calendar-feed-row {
        flex-direction: column;
    }

    /* Formular- und Aktionsregel: Kalenderfeed-Aktionen nutzen mobil die verfügbare Breite */
    .calendar-feed-actions,
    .calendar-feed-actions .btn {
        width: 100%;
    }

    /* Formular- und Aktionsregel: Abo-Buttons bleiben mobil gut antippbar */
    .calendar-feed-actions .btn {
        justify-content: center;
    }

}

.cal-layout {
    display: grid;
    grid-template-columns: 1fr 290px;
    gap: 20px;
    align-items: start;
}

/* Navigationsregel: hält Orientierung und zentrale Bereiche visuell konsistent */
.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

/* Navigationsregel: hält Orientierung und zentrale Bereiche visuell konsistent */
.cal-month-nav {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.cal-month-title {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text);
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.cal-year {
    font-size: var(--text-base);
    font-weight: 400;
    color: var(--text-secondary);
}

/* Navigationsregel: hält Orientierung und zentrale Bereiche visuell konsistent */
.cal-nav-btn {
    width: 34px;
    height: 34px;
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #f97316;
    border-radius: var(--radius);
    cursor: pointer;
    color: #ffffff;
    box-shadow: 0 3px 8px rgba(0,0,0,0.12);
    transition: all 0.15s ease;
    padding: 0;
}

/* Zustandsregel: macht Interaktion und aktuellen UI-Zustand visuell erkennbar */
.cal-nav-btn:hover {
    background: #ea580c;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.15);
}

/* Zustandsregel: Active-Zustand */
.cal-nav-btn:active {
    background: #c2410c;
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--border-light);
    border-bottom: 1px solid var(--border);
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.cal-weekday {
    padding: 8px 4px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Layoutregel: feste Reihenhöhe verhindert, dass Events aus Zellen herauslaufen */
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: 96px;
}

/* UI-Regel: Zelle hat feste Höhe und schneidet überlaufenden Inhalt sauber ab */
.cal-day {
    width: 100%;
    height: 100%;
    appearance: none;
    background: transparent;
    padding: 6px 5px;
    border-right: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    border-top: 0;
    border-left: 0;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition);
    position: relative;
    font: inherit;
    overflow: hidden;
}

/* Zustandsregel: macht Interaktion und aktuellen UI-Zustand visuell erkennbar */
.cal-day:hover {
    background: rgba(255,255,255,0.04);
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.cal-day:nth-child(7n)   { border-right: none; }
/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.cal-day:nth-last-child(-n+7) { border-bottom: none; }

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.cal-day-other { opacity: 0.4; pointer-events: none; }

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.cal-day-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text);
    border-radius: 50%;
    margin-bottom: 3px;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.cal-day-today .cal-day-num {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
}

/* Formular- und Aktionsregel: sorgt für konsistente Bedienbarkeit und Abstände */
.cal-day-selected {
    background: var(--primary-light) !important;
}

/* Formular- und Aktionsregel: sorgt für konsistente Bedienbarkeit und Abstände */
.cal-day-selected .cal-day-num {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.cal-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Farbbalken ohne Text – Breite füllt die Zelle, Höhe wie ein schmaler Streifen */
.cal-event {
    height: 10px;
    border-radius: 3px;
    font-size: 0;
    overflow: hidden;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.cal-event-more {
    font-size: 10px;
    color: var(--text-tertiary);
    padding: 0 4px;
}

/* Punkt-Indikatoren auf Mobil – auf Desktop ausgeblendet */
.cal-dots { display: none; }

/* Einzelner farbiger Punkt */
.cal-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Überlauf-Zähler bei mehr als 5 Reservierungen */
.cal-dot-more {
    font-size: 9px;
    line-height: 7px;
    color: var(--text-tertiary);
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.cal-legend {
    display: flex;
    gap: 16px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.cal-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.cal-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Calendar detail panel */
.cal-detail {
    position: sticky;
    top: 20px;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.cal-detail-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 24px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: var(--text-sm);
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.cal-detail-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.cal-detail-item {
    display: grid;
    grid-template-columns: 4px 1fr auto;
    gap: 10px;
    align-items: start;
    padding: 10px;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.cal-detail-accent {
    width: 4px;
    border-radius: 4px;
    align-self: stretch;
    min-height: 32px;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.cal-detail-info { min-width: 0; }

/* --- Conflict preview in Reservation form ------------------ */
.conflict-preview {
    background: var(--warning-light);
    border: 1px solid rgba(245,158,11,.25);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 16px;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.conflict-preview-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--warning);
    margin-bottom: 8px;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.conflict-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-top: 1px solid rgba(245,158,11,.15);
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.conflict-item:first-child { border-top: none; }

/* --- Inventar next-booking info ---------------------------- */
.inv-next-booking {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.inv-next-date {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    white-space: nowrap;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.inv-next-member {
    font-size: 10px;
    color: var(--text-tertiary);
}

/* --- Responsive -------------------------------------------- */
@media (max-width: 1100px) {
    /* Layoutregel: ordnet Inhalte stabil im verfügbaren Raum an */
    .cal-layout {
        grid-template-columns: 1fr;
    }

    /* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
    .cal-detail {
        position: static;
    }
}

/* Sidebar-Breite auf 0 setzen ab Handy – alle Elemente die var(--sidebar-width) nutzen passen sich automatisch an */
@media (max-width: 767px) {
    :root {
        --sidebar-width: 0px;
    }
}

/* Responsive Anpassung: begrenzt die folgenden Regeln auf passende Viewportgrößen */
@media (max-width: 576px) {
    /* Layoutregel: Kalendergitter auf Mobil mit kleineren Zeilen für Punkte */
    .cal-grid { grid-auto-rows: 56px; }

    /* Layoutregel: Zelle füllt die Grid-Zeile vollständig */
    .cal-day { height: 100%; }

    /* Text-Badges auf Mobil verstecken */
    .cal-events { display: none; }

    /* Farbpunkte auf Mobil einblenden */
    .cal-dots {
        display: flex;
        flex-wrap: wrap;
        gap: 3px;
        margin-top: 4px;
    }

    /* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
    .cal-day-num { font-size: var(--text-xs); }

    /* Formular- und Aktionsregel: sorgt für konsistente Bedienbarkeit und Abstände */
    .form-row {
        grid-template-columns: 1fr;
    }

    .data-table th:nth-child(2),
    .data-table td:nth-child(2),
    .data-table th:nth-child(4),
    /* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
    .data-table td:nth-child(4) {
        display: table-cell;
    }
}

/* Responsive Schlussregel: gewinnt gegen ältere Mobile-Tabellenregeln und hält alle Tabelleninhalte erreichbar */
@media (max-width: 576px) {
    /* Tabellenregel: Tabellen werden mobil scrollbar statt Spalten unsichtbar zu machen */
    .data-table th:nth-child(2),
    .data-table td:nth-child(2),
    .data-table th:nth-child(4),
    .data-table td:nth-child(4) {
        display: table-cell;
    }

    /* Tabellenregel: begrenzt Tabellen auf ihren Container und erlaubt gezieltes horizontales Scrollen */
    .data-table-wrap {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Tabellenregel: erhält lesbare Spaltenbreiten ohne Seitenscrollbalken */
    .data-table {
        min-width: 680px;
    }

    /* Dialoginhalt: hält Modals in der sichtbaren Smartphone-Höhe und scrollt nur den Inhalt */
    .modal-box,
    .modal-box.modal-lg {
        display: flex;
        flex-direction: column;
        width: min(100%, calc(100vw - 20px));
        max-width: min(100%, calc(100vw - 20px));
        max-height: calc(100dvh - 20px);
    }

    /* Dialoginhalt: macht lange Formular- und Vorschaubereiche im Dialog erreichbar */
    .modal-body {
        min-height: 0;
        overflow-y: auto;
    }

    /* Flächenregel: mobile Dialogaktionen bleiben sichtbar und umbrechbar */
    .modal-footer {
        flex-wrap: wrap;
    }
}

/* Responsive Schlussregel: verdichtet kritische UI-Elemente für kleine Smartphones */
@media (max-width: 576px) {
    /* Tabellenregel: kleinere Geräte bekommen kompaktere, aber weiterhin bedienbare Tabellen */
    .data-table {
        min-width: 620px;
    }

    /* Formular- und Aktionsregel: Icon-Aktionen bekommen auf Touch-Geräten eine sichere Zielgröße */
    .btn-icon {
        min-width: 40px;
        min-height: 40px;
    }

    /* Formular- und Aktionsregel: Filterchips werden auf Smartphones besser antippbar und brechen sauber um */
    .filter-btn {
        flex: 1 1 calc(50% - 4px);
        justify-content: center;
        min-height: 38px;
        white-space: normal;
    }

    /* Formular- und Aktionsregel: Toolbar-Aktionen nutzen auf Smartphones die volle Breite */
    .page-toolbar .btn,
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }

    /* Dialoginhalt: der Dialograhmen bleibt stehen, nur der Inhalt scrollt bei langen Formularen */
    .modal-box,
    .modal-box.modal-lg {
        overflow: hidden;
    }

    /* Dialoginhalt: lange Inhalte bleiben erreichbar, ohne Kopf und Aktionen aus dem Viewport zu drücken */
    .modal-body {
        overflow-y: auto;
    }

    /* Flächenregel: Reservierungstitel werden mobil nicht abgeschnitten, sondern umbrechen sauber */
    .reserv-card-title {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    /* UI-Regel: lange Datums- und Namenangaben dürfen in mobilen Detailbereichen umbrechen */
    .inv-next-date,
    .cal-detail-item .badge {
        max-width: 100%;
        white-space: normal !important;
        overflow-wrap: anywhere;
    }

    /* Tabellenregel: Lizenz- und Infotabellen bleiben im eigenen Container scrollbar */
    .info-license-table-wrap {
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
    }

    /* Tabellenregel: Lizenzspalten behalten lesbare Breiten ohne Seiten-Overflow */
    .info-license-table {
        min-width: 520px;
    }
}

/* Responsive Schlussregel: sehr schmale Smartphones bekommen einspaltige Filter statt gedrängter Chips */
@media (max-width: 380px) {
    /* Formular- und Aktionsregel: Filteraktionen bleiben auch bei langen Labels voll antippbar */
    .filter-btn {
        flex-basis: 100%;
    }
}

/* ============================================================
   RESPONSIVE OVERHAUL
   ============================================================ */

:root {
    --content-max-width: 1480px;
}

.btn {
    min-height: 40px;
}

.btn-sm {
    min-height: 36px;
}

.form-control,
select.form-control,
input.form-control {
    min-height: 44px;
}

.page-toolbar {
    align-items: flex-start;
}

.page-toolbar-right {
    min-width: 0;
    flex-wrap: wrap;
}

.count-label {
    max-width: 100%;
}

.filter-btn,
.inv-pill {
    min-height: 38px;
}

.data-table-wrap {
    width: 100%;
    max-width: 100%;
}

.data-table th,
.data-table td {
    min-width: 0;
}

.table-actions {
    flex-wrap: nowrap;
    gap: 4px;
}

.table-actions .btn {
    white-space: normal;
}

.modal-box {
    width: min(100%, calc(100vw - 32px));
}

.modal-box.modal-lg {
    max-width: min(920px, calc(100vw - 32px));
}

@media (max-width: 1199px) {
    .page-toolbar {
        gap: 10px 12px;
    }

    .filter-btn,
    .inv-pill {
        white-space: normal;
    }
}

@media (max-width: 992px) {
    .empty-state {
        padding: 40px 20px;
    }

    .page-toolbar-right {
        width: 100%;
        margin-left: 0;
        justify-content: space-between;
    }

    .data-table th,
    .data-table td {
        padding-inline: 14px;
    }

    .table-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 993px) {
    .page-toolbar:has(> .inv-filter-group > :nth-child(4):last-child) {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .page-toolbar:has(> .inv-filter-group > :nth-child(4):last-child) > .inv-filter-group {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    .page-toolbar:has(> .inv-filter-group > :nth-child(4):last-child) > .inv-filter-group > .inv-pill,
    .page-toolbar:has(> .inv-filter-group > :nth-child(4):last-child) > .inv-filter-group > .filter-btn {
        justify-content: center;
        min-width: 0;
        white-space: nowrap;
    }

    .page-toolbar:has(> .inv-filter-group > :nth-child(4):last-child) > .page-toolbar-right {
        width: 100%;
        margin-left: 0;
        justify-content: flex-end;
    }

    .page-toolbar:has(> .inv-filter-group > :nth-child(4):last-child) .count-label {
        display: block;
        width: 100%;
        text-align: right;
        white-space: nowrap;
    }
}

@media (max-width: 767px) {
    .page-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .inv-filter-group {
        width: 100%;
        gap: 6px;
    }

    .filter-btn,
    .inv-pill {
        flex: 1 1 calc(50% - 6px);
        justify-content: center;
    }

    .page-toolbar-right {
        align-items: center;
        gap: 8px;
    }

    .data-table {
        min-width: 640px;
    }

    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }

    .table-actions {
        min-width: 132px;
    }

    .modal-overlay {
        top: var(--header-height);
        left: 0;
        padding: 10px;
    }

    .modal-box,
    .modal-box.modal-lg {
        width: 100%;
        max-width: 100%;
        height: calc(100dvh - var(--header-height) - 20px);
        max-height: calc(100dvh - var(--header-height) - 20px);
    }

    .modal-footer {
        justify-content: stretch;
    }

    .modal-footer .btn {
        flex: 1 1 180px;
    }
}

@media (max-width: 576px) {
    .empty-state {
        padding: 32px 16px;
        border-radius: 18px;
    }

    .empty-state-text {
        max-width: 100%;
    }

    .filter-btn,
    .inv-pill {
        flex-basis: 100%;
    }

    .page-toolbar .btn,
    .page-header-actions .btn,
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }

    /* Bestätigungsbuttons bleiben nebeneinander – kein Vollbreiten-Override */
    .confirm-actions .btn {
        flex: 1 1 0;
        justify-content: center;
    }

    .btn-icon {
        width: 38px;
        height: 38px;
    }

    .data-table-wrap {
        border: none;
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }

    .data-table {
        width: 100%;
        min-width: 0;
        display: block;
        border-collapse: separate;
    }

    .data-table thead {
        display: none;
    }

    .data-table tbody {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .data-table tbody tr {
        display: block;
        padding: 14px 16px;
        border: 1px solid var(--border);
        border-radius: 18px;
        background: var(--card);
        box-shadow: var(--shadow-card);
    }

    .data-table tbody tr:hover {
        background: var(--card);
    }

    .data-table td {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.28rem;
        padding: 0.45rem 0;
        border-bottom: none;
        text-align: left;
    }

    .data-table td::before {
        content: attr(data-label);
        font-size: var(--text-xs);
        font-weight: 700;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        color: var(--text-tertiary);
    }

    .data-table td:first-child {
        padding-top: 0;
    }

    .data-table td:last-child {
        padding-bottom: 0;
    }

    .data-table td[data-label="Aktionen"] {
        align-items: center;
        padding-top: 0.8rem;
        margin-top: 0.2rem;
        border-top: 1px solid var(--border-light);
    }

    .data-table td[data-label="Aktionen"]::before {
        display: none;
    }

    .data-table td > * {
        max-width: 100%;
    }

    .table-actions {
        justify-content: center;
        flex-wrap: wrap;
        width: 100%;
    }

    .modal-overlay {
        top: var(--header-height);
        left: 0;
        padding: 6px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-inline: 16px;
    }

}

@media (max-width: 430px) {
    .app-content {
        padding-inline: 10px;
    }

    .page-toolbar-right {
        align-items: stretch;
        justify-content: flex-start;
    }

    .count-label {
        width: 100%;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-inline: 14px;
    }
}

@media (max-width: 390px) {
    .btn,
    .btn-sm {
        white-space: normal;
    }

    .header-logout .btn {
        min-width: 0;
        padding-inline: 6px;
    }

    .modal-title,
    .page-title {
        overflow-wrap: anywhere;
    }
}

@media (max-width: 576px) {
    .app-content {
        width: 100%;
        max-width: 100%;
        padding: 22px 16px 24px;
    }

    .btn,
    .btn-icon,
    .modal-close,
    .cal-nav-btn {
        min-height: 48px;
    }

    .btn {
        padding: 10px 18px;
        font-size: 0.95rem;
    }

    .btn-sm {
        min-height: 44px;
        padding: 8px 14px;
        font-size: 0.88rem;
    }

    .btn-icon,
    .modal-close,
    .cal-nav-btn {
        min-width: 48px;
    }

    .form-group {
        gap: 8px;
        margin-bottom: 18px;
    }

    .form-label {
        font-size: 0.92rem;
    }

    .form-control,
    select.form-control,
    input.form-control {
        min-height: 52px;
        padding: 12px 16px;
        font-size: 1rem;
    }

    .card-header {
        padding: 18px 18px 14px;
    }

    .card-body {
        padding: 20px 18px;
    }

    .badge {
        min-height: 28px;
        padding: 4px 10px;
        font-size: 0.78rem;
    }
}

@media (max-width: 430px) {
    html {
        font-size: 17px;
    }

    .app-content {
        padding: 18px 12px 22px;
    }
}

@media (max-width: 375px) {
    .page-toolbar:has(> .inv-filter-group > :nth-child(4):last-child) > .inv-filter-group {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .page-toolbar:has(> .inv-filter-group > :nth-child(4):last-child) > .inv-filter-group > .inv-pill,
    .page-toolbar:has(> .inv-filter-group > :nth-child(4):last-child) > .inv-filter-group > .filter-btn {
        width: min(70%, 240px);
        min-width: 210px;
    }
}

/* ============================================================
   DASHBOARD-SPEZIFISCH
   Gilt ausschließlich wenn body.page-dashboard gesetzt ist.
   Wird von Home.razor via JS-Interop gesetzt und beim
   Verlassen der Seite wieder entfernt.
   Keine anderen Seiten betroffen.
   ============================================================ */

/* Sidebar auf dem Dashboard: Verlauf entfernen, Fläche angleichen, sichtbarer Übergang rechts */
body.page-dashboard .nav-sidebar {
    background: #232325;
    border-right: none;
    box-shadow: 2px 0 8px rgba(0,0,0,0.22), inset -1px 0 0 rgba(255,255,255,0.06);
}

/* ============================================================
   PAGE FEEDBACK
   Globale Feedback-Banner-Klasse – ersetzt seiten-spezifische
   Varianten wie .inventory-feedback, .user-feedback, etc.
   ============================================================ */

/* Basis-Feedback-Banner: neutrales Gehäuse für Erfolgs- und Fehlermeldungen */
.page-feedback {
    margin: 1rem 0;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    font-size: 0.92rem;
}

/* Zustandsregel: Erfolgsmeldung – grüner Hintergrund */
.page-feedback.is-success {
    background: rgba(34, 197, 94, 0.10);
    color: var(--success);
}

/* Zustandsregel: Fehlermeldung – roter Hintergrund */
.page-feedback.is-error {
    background: rgba(239, 68, 68, 0.10);
    color: var(--danger);
}

/* ============================================================
   FILE UPLOAD – Wiederverwendbare Upload-UI-Elemente
   ============================================================ */

/* Upload-Karte: visuelle Hülle für Upload-Bereiche in Formularen */
.upload-card {
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 22px;
    background: var(--surface-2);
    padding: 1rem;
    margin-top: 1rem;
}

/* Hinweistext unter Upload-Controls */
.upload-hint {
    margin: 0.55rem 0 0;
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

/* Chip für eine ausstehende Datei vor dem Upload – Dateiname als Pill */
.pending-file-chip {
    display: inline-flex;
    max-width: 100%;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(249, 115, 22, 0.10);
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

/* ============================================================
   LIGHTBOX
   Vollbild-Bildansicht – genutzt von Inventar (Admin + Verwaltung)
   ============================================================ */

/* Overlay: verdunkelt den Hintergrund und zentriert den Dialog */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(9,10,12,0.82);
    backdrop-filter: blur(4px);
}

/* Dialog: Rahmen und Hintergrund des sichtbaren Lightbox-Fensters */
.lightbox-dialog {
    position: relative;
    width: min(980px, 100%);
    padding: 1.25rem 1.25rem 1rem;
    border-radius: 28px;
    background: var(--surface-2);
    border: 1px solid rgba(255,255,255,0.08);
    color: #fff;
}

/* Hauptanzeigebereich: zentriert das aktive Bild vertikal und horizontal */
.lightbox-main {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 360px;
}

/* Aktives Bild: begrenzt Größe damit es vollständig sichtbar bleibt */
.lightbox-main-image {
    max-width: 100%;
    max-height: 72vh;
    border-radius: 22px;
    display: block;
    object-fit: cover;
}

/* Schließen- und Navigationsbuttons teilen Basis-Stil */
.lightbox-close,
.lightbox-nav {
    position: absolute;
    border: 0;
    border-radius: 999px;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: #fff;
    background: rgba(255,255,255,0.08);
}

/* Schließen-Button oben rechts */
.lightbox-close {
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    font-size: 1rem;
}

/* Navigationspfeile vertikal mittig – links/rechts durch Modifier positioniert */
.lightbox-nav {
    top: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    transform: translateY(-50%);
}

/* Linker Navigationspfeil */
.lightbox-nav-left {
    left: 1rem;
}

/* Rechter Navigationspfeil */
.lightbox-nav-right {
    right: 1rem;
}

/* Zustandsregel: deaktivierter Pfeil am Rand der Bildliste */
.lightbox-nav:disabled {
    opacity: 0.35;
    cursor: default;
}

/* Thumbnail-Leiste unterhalb des Hauptbilds */
.lightbox-thumbnails {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    margin-top: 1rem;
    padding-top: 0.25rem;
}

/* Einzelnes Thumbnail – feste Größe, aktives wird farbig umrandet */
.lightbox-thumbnail {
    flex: 0 0 auto;
    width: 78px;
    height: 78px;
    border-radius: 18px;
    overflow: hidden;
    border: 2px solid transparent;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

/* Zustandsregel: aktives Thumbnail erhält hellen Rahmen */
.lightbox-thumbnail.active {
    border-color: rgba(191, 219, 254, 0.95);
}

/* Thumbnail-Bild füllt den Container */
.lightbox-thumbnail img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* Responsive: Navigation wandert auf kleinen Displays nach unten */
@media (max-width: 900px) {
    .lightbox-dialog {
        padding: 1rem;
    }

    .lightbox-nav {
        bottom: 1rem;
        top: auto;
        transform: none;
    }

    .lightbox-nav-left {
        left: 1rem;
    }

    .lightbox-nav-right {
        right: 1rem;
    }

    .lightbox-main {
        min-height: 280px;
    }
}

/* Responsive: Vollflächige Darstellung auf kleinen Smartphones */
@media (max-width: 640px) {
    .lightbox-overlay {
        padding: 0.75rem;
    }

    .lightbox-dialog {
        border-radius: 22px;
        max-height: calc(100dvh - 1.5rem);
        overflow-y: auto;
    }

    .lightbox-thumbnail {
        width: 64px;
        height: 64px;
    }

    .lightbox-main {
        min-height: 220px;
    }
}

/* ============================================================
   USER MENU – Geteilte Klassen für Header- und Sidebar-Dropdown
   Positionierung und Animation bleiben komponentenspezifisch
   in AppHeader.razor.css und NavSidebar.razor.css.
   ============================================================ */

/* Interne Sektion: stapelt Menüeinträge mit minimalem Abstand */
.user-menu-section {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Profilkopf: zeigt Name und Rolle zurückhaltend im Dropdown-Kopf */
.user-menu-profile {
    padding: 12px 8px 8px;
}

/* Benutzername im Dropdown-Kopf */
.user-menu-name {
    color: #fff;
    font-size: 0.94rem;
    font-weight: 700;
    line-height: 1.2;
}

/* Rollenzeile im Dropdown-Kopf */
.user-menu-role {
    color: rgba(203, 213, 225, 0.68);
    font-size: var(--text-xs);
    margin-top: 3px;
}

/* Trennlinie zwischen Menübereichen – weicher Verlauf statt harter Linie */
.user-menu-divider {
    height: 1px;
    margin: 8px 2px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.10), transparent);
}

/* Einheitlicher Menüeintrag für Links und Buttons */
.user-menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 42px;
    padding: 0 10px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: #E2E8F0;
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition:
        background var(--transition),
        color var(--transition),
        transform var(--transition);
}

/* Hover-Zustand: leichte Aufhellung und minimale Verschiebung */
.user-menu-link:hover {
    background: rgba(255,255,255,0.07);
    color: #fff;
    text-decoration: none;
    transform: translateX(1px);
}

/* Aktiver Menüeintrag: orangener Hintergrund für die aktuelle Seite */
.user-menu-link.active {
    background: rgba(249,115,22,0.12);
    color: #F97316;
}

/* Aktiver Bullet erhält vollere Farbe */
.user-menu-link.active .user-menu-icon {
    background: rgba(249,115,22,0.9);
    box-shadow: 0 0 0 2px rgba(249,115,22,0.22);
}

/* Hover auf aktivem Eintrag bleibt im Orange-Ton */
.user-menu-link.active:hover {
    background: rgba(249,115,22,0.18);
    color: #fb923c;
}

/* Fokus-Ring für Tastaturnavigation */
.user-menu-link:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 2px rgba(255,255,255,.14),
        0 0 0 4px rgba(249,115,22,.24);
}

/* Kleiner Bullet-Punkt als visueller Anker vor jedem Menüeintrag */
.user-menu-icon {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(249,115,22,0.74);
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(249,115,22,0.08);
}

/* Logout-Wrapper: kein extra Abstand notwendig */
.user-menu-logout {
    margin: 0;
}

/* Logout-Eintrag: akzentuiert ohne aggressiv zu wirken */
.user-menu-link-danger {
    color: #f3c1b0;
}

/* Logout-Bullet: warmer Rot-Ton statt hartem Danger-Rot */
.user-menu-link-danger .user-menu-icon,
.user-menu-icon-danger {
    background: rgba(242, 122, 92, 0.88);
    box-shadow: 0 0 0 2px rgba(242, 122, 92, 0.12);
}

/* Logout-Hover: weiche Unterlegung, Text hellt auf */
.user-menu-link-danger:hover {
    background: rgba(242,122,92,0.10);
    color: #ffd8cb;
}

/* Animation für Header-Dropdown: öffnet von oben nach unten */
@keyframes user-menu-enter-down {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation für Sidebar-Dropdown: öffnet von unten nach oben */
@keyframes user-menu-enter-up {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   INVENTAR CHEVRON ANIMATION
   Schwebender Pfeil in zusammengeklappten Inventar-Cards
   (ab 1330px Viewport – zwei-Spalten-Layout)
   ============================================================ */

/* Chevron-Opacity im Ruhezustand */
.inventory-card-overlay-icon {
    opacity: 0.92;
}

/* Schwebende Animation des Chevrons – weist nach unten auf ausklappbare Details */
@keyframes inventoryChevronFloat {
    0%,
    100% {
        transform: translateY(0);
        opacity: 0.82;
    }

    50% {
        transform: translateY(4px);
        opacity: 1;
    }
}
