/* ============================================================
   OrgaPlus – Design System
   ============================================================ */

/* --- Design Tokens ----------------------------------------- */
:root {
    /* Colors */
    --bg:              #f5f7fb;
    --card:            #FFFFFF;
    --text:            #1F2937;
    --text-secondary:  #6B7280;
    --text-tertiary:   #9CA3AF;
    --primary:         #F97316;
    --primary-hover:   #EA580C;
    --primary-light:   #FFF7ED;
    --structure:       #111827;
    
    --chrome-bg:       #17233a;
    --sidebar-bg:      linear-gradient(180deg, #17233a 0%, #151f34 55%, #17233a 100%);
    --sidebar-text:    #E2E8F0;
    --sidebar-active:  #F97316;
    --sidebar-hover:   rgba(255,255,255,0.08);
    --border:          #E5E7EB;
    --border-light:    #F3F4F6;

    /* Status */
    --success:         #22C55E;
    --success-light:   #F0FDF4;
    --danger:          #EF4444;
    --danger-light:    #FEF2F2;
    --warning:         #F59E0B;
    --warning-light:   #FFFBEB;
    --info:            #3B82F6;
    --info-light:      #EFF6FF;

    /* 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,.05);
    --shadow-card:     0 2px 8px rgba(0,0,0,0.06), 0 0 1px rgba(0,0,0,0.04);
    --shadow-md:       0 8px 24px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
    --shadow-lg:       0 16px 40px rgba(0,0,0,0.10), 0 4px 10px rgba(0,0,0,0.05);

    /* 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
   ============================================================ */

/* 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: 768px) {
    /* 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: Dialoge nehmen mobil fast die volle Höhe und Breite ein */
    .modal-overlay {
        align-items: stretch;
        padding: 10px;
    }

    /* Dialoginhalt: Dialograhmen bleibt im sichtbaren Bereich und überlässt Scrollen dem Inhalt */
    .modal-box,
    .modal-box.modal-lg {
        max-width: 100%;
        max-height: calc(100dvh - 20px);
        border-radius: 20px;
    }

    /* Flächenregel: Dialogkopf bleibt kompakt und der Titel kann umbrechen */
    .modal-header {
        align-items: flex-start;
        gap: 12px;
        padding: 16px 18px 12px;
    }

    /* Dialoginhalt: reduziert Seitenabstände in langen Formularen */
    .modal-body {
        padding: 16px 18px;
    }

    /* Flächenregel: Dialogaktionen umbrechen auf schmalen Bildschirmen */
    .modal-footer {
        align-items: stretch;
        flex-wrap: wrap;
        padding: 14px 18px 16px;
    }

    /* Formular- und Aktionsregel: Dialogbuttons bleiben mobil bequem antippbar */
    .modal-footer .btn,
    .confirm-actions .btn {
        flex: 1 1 140px;
        justify-content: center;
    }

    /* Flächenregel: Bestätigungsdialoge behalten sichere Ränder im Viewport */
    .confirm-box {
        max-width: calc(100vw - 28px);
        padding: 24px 20px 20px;
    }

    /* Flächenregel: Reservierungskarten stapeln Aktionen unter dem Inhalt */
    .reserv-card {
        grid-template-columns: 4px minmax(0, 1fr);
        gap: 0 12px;
        padding: 14px 16px;
    }

    /* Flächenregel: Reservierungsaktionen nutzen mobil die Inhaltsbreite */
    .reserv-card-actions {
        grid-column: 2;
        justify-content: flex-start;
        margin-top: 10px;
        flex-wrap: wrap;
    }

    /* UI-Regel: Reservierungsmetadaten dürfen mobil in mehrere Zeilen laufen */
    .reserv-card-meta-item {
        min-width: 0;
        flex-wrap: wrap;
    }

    /* 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 verwenden minimale Außenränder */
    .modal-overlay {
        left: 0;
        padding: 6px;
    }

    /* Dialoginhalt: Dialoge wirken mobil wie Panels und vermeiden abgeschnittene Ecken */
    .modal-box,
    .modal-box.modal-lg {
        max-height: calc(100dvh - 12px);
        border-radius: 18px;
    }

    /* Flächenregel: Dialogtitel bleibt lesbar neben dem Schließen-Button */
    .modal-title {
        font-size: var(--text-base);
        line-height: 1.35;
    }

    /* Flächenregel: Bestätigungsaktionen stapeln sich auf sehr kleinen Displays */
    .confirm-actions {
        flex-direction: column;
    }

    /* Formular- und Aktionsregel: Bestätigungsbuttons bekommen volle Breite */
    .confirm-actions .btn {
        width: 100%;
    }

    /* Layoutregel: Kalenderkopf stapelt Monat und Aktionen bei wenig Breite */
    .cal-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    /* 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(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 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; }
/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.badge-info    { background: #2563eb; 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: #fff1e6;
    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 -------------------------------------------------- */
.card {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(0,0,0,0.05);
    transition:
        transform var(--transition),
        box-shadow var(--transition-md),
        border-color var(--transition);
}

/* Zustandsregel: macht Interaktion und aktuellen UI-Zustand visuell erkennbar */
.info-card:hover {
    border-color: rgba(0,0,0,0.08);
    box-shadow: var(--shadow-md);
}

/* Karteninhalt: ordnet Text und Metadaten innerhalb der Kartenfläche */
.card-body {
    padding: 22px 24px;
}

/* Flächenregel: strukturiert Inhalte als eigenständigen visuellen Bereich */
.card-header {
    padding: 18px 24px 14px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #ffffff;
}

/* Flächenregel: strukturiert Inhalte als eigenständigen visuellen Bereich */
.card-title {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--text);
}

/* 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);
}

/* 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: var(--radius);
    color: var(--sidebar-text);
    font-size: var(--text-sm);
    font-weight: 500;
    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(2px);
    text-decoration: none;
}

/* Zustandsregel: aktiver Eintrag klar hervorgehoben – kräftiger Orange-Hintergrund */
.nav-item.active {
    background: linear-gradient(90deg, rgba(249,115,22,0.38), rgba(249,115,22,0.14));
    color: #F97316;
    font-weight: 700;
}

/* 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: orangener linker Balken für aktiven Eintrag – breiter und markanter */
.nav-item.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    border-radius: var(--radius) 0 0 var(--radius);
    background: var(--sidebar-active);
    box-shadow: 0 0 8px rgba(249,115,22,.6);
}

/* Navigationsregel: Icons deutlich sichtbar auf dunklem Hintergrund */
.nav-item .nav-icon {
    display: flex;
    align-items: center;
    color: #94A3B8;
    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.65rem 0.9rem 0.55rem 0.9rem;
    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 8px 18px rgba(0,0,0,0.22));
}

/* 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(15,23,42,.72);
    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, #172033 0%, #111827 100%);
    border: 1px solid rgba(249,115,22,.25);
    box-shadow:
        0 34px 90px rgba(15,23,42,.45),
        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: var(--header-height);
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    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(--card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,0.05);
    width: 100%;
    max-width: 520px;
    max-height: calc(100dvh - var(--header-height) - 32px);
    overflow-y: auto;
    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));
}

/* 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);
}

/* 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;
    border: none;
    background: #fff1e6;
    color: var(--primary);
    border: 1px solid #fdba74;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    flex-shrink: 0;
}

/* Zustandsregel: macht Interaktion und aktuellen UI-Zustand visuell erkennbar */
.modal-close:hover {
    background: #f97316;
    color: #fff;
    border-color: transparent;
    box-shadow: 0 3px 8px rgba(0,0,0,0.12);
}

/* Zustandsregel: Active-Zustand */
.modal-close:active {
    background: #c2410c;
}

/* 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;
}

/* --- 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: #92400E;        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: #166534;        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: #1e40af;        border: 1px solid rgba(59,130,246,.2); }

/* --- Table ------------------------------------------------- */
.data-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--card);
    box-shadow: var(--shadow-card);
}

/* 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: var(--border-light);
    border-bottom: 1px solid var(--border);
}

/* 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 var(--border-light);
    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: #FAFBFC;
}

/* 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: none;
    background: #f97316;
    border-radius: 8px;
    cursor: pointer;
    color: #fff;
    box-shadow: 0 3px 8px rgba(0,0,0,0.12);
    transition: all 0.15s ease;
    padding: 0;
    flex-shrink: 0;
}

/* Zustandsregel: macht Interaktion und aktuellen UI-Zustand visuell erkennbar */
.btn-icon:hover {
    background: #ea580c;
    color: #fff;
    box-shadow: 0 6px 14px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

/* Zustandsregel: Active-Zustand */
.btn-icon:active {
    background: #c2410c;
    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: #ef4444;
    color: #fff;
}

/* --- 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: #f8fafc;
    border: 1px dashed #cbd5e1;
    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(15, 23, 42, 0.55);
    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(--card);
    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 -------------------------------------- */
.reserv-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Flächenregel: strukturiert Inhalte als eigenständigen visuellen Bereich */
.reserv-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 16px 20px;
    display: grid;
    grid-template-columns: 4px 1fr auto;
    gap: 0 16px;
    align-items: start;
    transition: box-shadow var(--transition);
}

/* Zustandsregel: macht Interaktion und aktuellen UI-Zustand visuell erkennbar */
.reserv-card:hover {
    box-shadow: var(--shadow-md);
}

/* Flächenregel: strukturiert Inhalte als eigenständigen visuellen Bereich */
.reserv-card-accent {
    width: 4px;
    border-radius: 4px;
    align-self: stretch;
    min-height: 40px;
}

/* Karteninhalt: ordnet Text und Metadaten innerhalb der Kartenfläche */
.reserv-card-body { min-width: 0; }

/* Flächenregel: strukturiert Inhalte als eigenständigen visuellen Bereich */
.reserv-card-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Flächenregel: strukturiert Inhalte als eigenständigen visuellen Bereich */
.reserv-card-meta {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 4px;
}

/* Flächenregel: strukturiert Inhalte als eigenständigen visuellen Bereich */
.reserv-card-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Flächenregel: strukturiert Inhalte als eigenständigen visuellen Bereich */
.reserv-card-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 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;
    }

    .reserv-card {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        row-gap: 0.8rem;
        padding: 1rem;
    }

    .reserv-card-accent {
        width: 100%;
        height: 4px;
        min-height: 4px;
    }

    .reserv-card-body {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.45rem;
    }

    .reserv-card-meta {
        justify-content: center;
        gap: 0.5rem 0.9rem;
        margin-top: 0;
    }

    .reserv-card-meta-item,
    .reserv-card-actions {
        justify-content: center;
    }

    .reserv-card-actions {
        gap: 0.5rem;
    }
}

/* --- 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;
    gap: 6px;
    padding: 5px 12px;
    min-height: 34px;
    border-radius: 999px;
    font-size: var(--text-xs);
    font-weight: 600;
    font-family: var(--font-body);
    color: #ffffff;
    background: #f97316;
    border: 1px solid rgba(249,115,22,0.42);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    cursor: pointer;
    transition:
        transform 0.2s ease,
        filter 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: #ea580c;
    border-color: rgba(234,88,12,0.46);
    color: #ffffff;
    transform: translateY(-1px);
}

/* Zustandsregel: macht Interaktion und aktuellen UI-Zustand visuell erkennbar */
.filter-btn.active {
    background: #ea580c;
    border-color: rgba(255,122,24,.44);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.filter-count {
    background: rgba(255,255,255,0.22);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
    min-width: 20px;
    text-align: center;
    line-height: 1;
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.45);
}

/* Zustandsregel: macht Interaktion und aktuellen UI-Zustand visuell erkennbar */
.filter-btn:not(.active) .filter-count {
    background: rgba(255,255,255,0.22);
    color: #ffffff;
}

.filter-btn--all:not(.active) {
    background: #475569;
    border-color: rgba(71,85,105,.3);
    color: #ffffff;
}

.filter-btn--all:not(.active) .filter-count {
    background: rgba(255,255,255,0.22);
    color: #ffffff;
}

.filter-btn--success:not(.active) {
    background: #16a34a;
    border-color: rgba(22,163,74,.3);
    color: #ffffff;
}

.filter-btn--success:not(.active) .filter-count {
    background: rgba(255,255,255,0.22);
    color: #ffffff;
}

.filter-btn--danger:not(.active) {
    background: #dc2626;
    border-color: rgba(220,38,38,.3);
    color: #ffffff;
}

.filter-btn--danger:not(.active) .filter-count {
    background: rgba(255,255,255,0.22);
    color: #ffffff;
}

.filter-btn--info:not(.active) {
    background: #2563eb;
    border-color: rgba(37,99,235,.3);
    color: #ffffff;
}

.filter-btn--info:not(.active) .filter-count {
    background: rgba(255,255,255,0.22);
    color: #ffffff;
}

.filter-btn--warning:not(.active) {
    background: #d97706;
    border-color: rgba(217,119,6,.3);
    color: #ffffff;
}

.filter-btn--warning:not(.active) .filter-count {
    background: rgba(255,255,255,0.22);
    color: #ffffff;
}

.filter-btn--neutral:not(.active) {
    background: #6b7280;
    border-color: rgba(107,114,128,.3);
    color: #ffffff;
}

.filter-btn--neutral:not(.active) .filter-count {
    background: rgba(255,255,255,0.22);
    color: #ffffff;
}

.filter-btn--purple:not(.active) {
    background: #7c3aed;
    border-color: rgba(124,58,237,.3);
    color: #ffffff;
}

.filter-btn--purple:not(.active) .filter-count {
    background: rgba(255,255,255,0.22);
    color: #ffffff;
}

/* --- Inventar Filter Pills (SaaS-Stil, statusspezifische Farben) --- */

/* Basis-Pill: gemeinsame Struktur für alle Varianten */
.inv-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 13px;
    border-radius: 999px;
    font-size: var(--text-xs);
    font-weight: 600;
    font-family: var(--font-body);
    border: 1px solid transparent;
    cursor: pointer;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.4),
        0 2px 6px rgba(0,0,0,0.12);
    transition:
        transform 0.2s ease,
        filter 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease;
    white-space: nowrap;
    line-height: 1;
}

/* Zustandsregel: aktive Pill erhält oranges Haupt-Styling */
.inv-pill--active {
    background: #ea580c;
    border-color: rgba(255,122,24,.4);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Hover-Zustand: leichte Aufhellung des aktiven Zustands */
.inv-pill--active:hover {
    filter: brightness(1.03);
    transform: translateY(-1px);
}

/* Inaktiver Alle-Filter: neutrales Blaugrau – wird vom aktiven Zustand überschrieben */
.inv-pill--all {
    background: #475569;
    border-color: rgba(71,85,105,.3);
    color: #fff;
}

/* Hover: Alle-Filter */
.inv-pill--all:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
}

/* Inaktiver Einsatzbereit-Filter: kräftiges Grün */
.inv-pill--einsatzbereit {
    background: #16a34a;
    border-color: rgba(22,163,74,.3);
    color: #fff;
}

/* Hover: Einsatzbereit-Filter */
.inv-pill--einsatzbereit:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
}

/* Inaktiver Defekt-Filter: kräftiges Rot */
.inv-pill--defekt {
    background: #dc2626;
    border-color: rgba(220,38,38,.3);
    color: #fff;
}

/* Hover: Defekt-Filter */
.inv-pill--defekt:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
}

/* Inaktiver Reparatur-Filter: kräftiges Blau */
.inv-pill--reparatur {
    background: #2563eb;
    border-color: rgba(37,99,235,.3);
    color: #fff;
}

/* Hover: Reparatur-Filter */
.inv-pill--reparatur:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
}

/* Inaktiver Nicht-verfügbar-Filter: gedämpftes Grau mit gutem Kontrast */
.inv-pill--nichtverfuegbar {
    background: #6b7280;
    border-color: rgba(107,114,128,.3);
    color: #fff;
}

/* Hover: Nicht-verfügbar-Filter */
.inv-pill--nichtverfuegbar:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
}

/* Icon-Wrapper: zentriert das SVG vertikal, erbt die Textfarbe */
.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 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    background: #ffffff;
    color: #f97316;
    box-shadow: inset 0 1px 0 #ffffff;
    transition:
        background 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

/* Count-Badge im aktiven Zustand: identisches Overlay-Prinzip */
.inv-pill--active .inv-pill-count {
    background: #ffffff;
    color: #f97316;
}

/* Count-Badge: Alle (inaktiv) – kein Override nötig, Basis gilt */
.inv-pill--all .inv-pill-count { background: #dbeafe; color: #475569; }

/* Count-Badge: Einsatzbereit (inaktiv) */
.inv-pill--einsatzbereit .inv-pill-count { background: #dcfce7; color: #15803d; }

/* Count-Badge: Defekt (inaktiv) */
.inv-pill--defekt .inv-pill-count { background: #fee2e2; color: #b91c1c; }

/* Count-Badge: Reparatur (inaktiv) */
.inv-pill--reparatur .inv-pill-count { background: #dbeafe; color: #1d4ed8; }

/* Count-Badge: Nicht verfügbar (inaktiv) */
.inv-pill--nichtverfuegbar .inv-pill-count { background: #e5e7eb; color: #374151; }

/* --- 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: #2563eb;
    color: #ffffff;
}

.inv-status-badge--nichtverfuegbar {
    background: #6b7280;
    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: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.06);
    overflow: hidden;
}

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

.calendar-feed-header:hover {
    background: #f9fafb;
}

.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: #ff7a1a;
    box-shadow: 0 8px 18px rgba(255, 122, 26, 0.22);
}

.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 #eef2f7;
    background: #fcfcfd;
}

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

.calendar-feed-intro p {
    max-width: 760px;
    margin: 0;
    color: #667085;
    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 #e5e7eb;
    border-radius: 12px;
    background: #f8fafc;
}

.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: #1f2937;
    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: #ff7a1a;
    border-color: #ff7a1a;
}

.calendar-feed-action-primary:hover {
    background: #f06d0f;
    border-color: #f06d0f;
}

.calendar-feed-action-secondary {
    background: #ffffff;
    color: #475467;
    border: 1px solid #d0d5dd;
}

.calendar-feed-action-secondary:hover {
    background: #f9fafb;
    border-color: #c7ced8;
}

/* 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: #667085;
    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 #f1f5f9;
    color: #667085;
    font-size: 12px;
    line-height: 1.5;
}

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

.calendar-feed-help-item strong {
    color: #344054;
    font-size: 12px;
    font-weight: 700;
}

.calendar-feed-help-item span {
    color: #667085;
    font-size: 12px;
}

/* Responsive Anpassung: stapelt Kalenderfeed-Aktionen auf Tablet- und Smartphonebreite */
@media (max-width: 768px) {
    /* 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: ordnet Inhalte stabil im verfügbaren Raum an */
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.cal-day {
    min-height: 88px;
    padding: 6px 5px;
    border-right: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background var(--transition);
    position: relative;
}

/* Zustandsregel: macht Interaktion und aktuellen UI-Zustand visuell erkennbar */
.cal-day:hover {
    background: #FAFBFD;
}

/* 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;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.cal-event {
    font-size: 10px;
    font-weight: 500;
    padding: 2px 5px;
    border-radius: 3px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

/* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
.cal-event-more {
    font-size: 10px;
    color: var(--text-tertiary);
    padding: 0 4px;
}

/* 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: #92400E;
    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: #78350F;
}

/* 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;
    }
}

/* Responsive Anpassung: begrenzt die folgenden Regeln auf passende Viewportgrößen */
@media (max-width: 768px) {
    /* Design Tokens: stellt globale Variablen für Farben, Typografie und Layout bereit */
    :root {
        --sidebar-width: 0px;
    }

    /* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
    .cal-day { min-height: 60px; }
    /* UI-Regel: beschreibt Darstellung und Kontext dieses Selektorblocks im Designsystem */
    .cal-event { display: none; }
    /* 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: 768px) {
    /* 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: 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 {
        left: 0;
        padding: 10px;
    }

    .modal-box,
    .modal-box.modal-lg {
        width: 100%;
        max-width: 100%;
        max-height: calc(100dvh - 20px);
    }

    .modal-footer {
        justify-content: stretch;
    }

    .modal-footer .btn,
    .confirm-actions .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,
    .confirm-actions .btn {
        width: 100%;
        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 {
        left: 0;
        padding: 6px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-inline: 16px;
    }

    .confirm-actions {
        flex-direction: column;
    }
}

@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: 768px) {
    html {
        font-size: 18px;
    }

    :root {
        --header-height: 72px;
        --text-xs: 0.78rem;
        --text-sm: 0.94rem;
        --text-base: 1rem;
        --text-lg: 1.14rem;
        --text-xl: 1.36rem;
        --text-2xl: 1.9rem;
        --text-3xl: 2.35rem;
        --radius: 14px;
        --radius-lg: 20px;
        --radius-xl: 24px;
    }

    p {
        font-size: 1rem;
        line-height: 1.6;
    }

    h1,
    .page-title {
        font-size: clamp(2rem, 6vw, 2.5rem);
        line-height: 1.12;
    }

    h2,
    .card-title,
    .modal-title {
        font-size: clamp(1.3rem, 4vw, 1.6rem);
        line-height: 1.2;
    }

    .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;
    }
}












