/* @font-face-Bloecke fuer Inter ausgelagert nach
   assets/css/fonts.css am 28.04.2026 (Etappe 0 Token-Migration). */

/* =========================
   DESIGN TOKENS
   =========================
   Komplettes Token-Set in assets/css/design-tokens.css.
   Bisheriger :root-Block hier entfernt am 28.04.2026 (Etappe 7
   Brand-Doppel-Aufloesung) — alle Brand-/Hover-/Text-/Radius-
   Tokens sind in design-tokens.css definiert, der lokale Block
   war nach Etappen 1-6 redundant.
   ========================= */

/* =========================
   BASE RESET — Form-Controls
   ========================= */

/* Einheitliches Sizing-Modell für alle Formular-Controls.
   Verhindert die häufigste Layout-Falle: Padding/Border sprengen
   eine width:100%-Zelle und überlaufen in die Nachbarspalte.
   Alle anderen visuellen Properties werden NICHT global gesetzt —
   die übernehmen die Form-Klassen (.user-form-control, .input-sm,
   .select-sm, .overlay-search-input, .ccb-search-input etc.). */
input,
select,
textarea,
button {
    box-sizing: border-box;
}

/* =========================
   BASE RESET — Links (Etappe 8 final, 29.04.2026)
   =========================
   Software-Feeling statt Web-Dokument: alle Links sehen gleich aus,
   egal ob besucht oder nicht. Kein Klick-Historie-Indikator ueber
   :visited, weil IT-CCS eine Software ist und jeder Klick eine Aktion
   (kein Wissens-Status). Siehe `_context/ui_konzept.md` Sektion 3.

   WICHTIG: Browser ignorieren bei :visited Privacy-bedingt nicht-
   explizite Werte (inherit, currentColor, transparent) und fallen auf
   das User-Agent-Default-Lila zurueck. Deshalb hier expliziter Token-
   Wert fuer beide Zustaende — und genau derselbe.

   Default-Stil: Kein Underline (Software-Look), Hover bekommt Underline
   als Affordance. Ausnahmen via spezifischere Regeln (z.B. .main-nav,
   .admin-sidebar) ueberschreiben den Reset wo noetig.

   Falls jemals echte externe Web-Links eingebaut werden (Help-Center,
   Partner-Seiten), kann eine Klasse `.external-link` mit klassischem
   Visited-Verhalten ergaenzt werden. */
a,
a:visited {
    color: var(--link-color);
    text-decoration: none;
}

a:hover,
a:visited:hover {
    color: var(--link-color-hover);
    text-decoration: underline;
}

/* =========================
   UTILITY CLASSES
   Ersatz fuer Inline-Styles (CSP M4).
   Namenskonvention: Property-Kurzname + Wert in px.
   ========================= */

/* --- Margin-Top --- */
.mt-0  { margin-top: 0; }
.mt-4  { margin-top: var(--space-xs); }
.mt-6  { margin-top: var(--space-xs-plus); }
.mt-8  { margin-top: var(--space-sm); }
.mt-10 { margin-top: var(--space-sm-plus); }
.mt-12 { margin-top: var(--space-md); }
.mt-14 { margin-top: var(--space-md-plus); }
.mt-15 { margin-top: 15px; }
.mt-16 { margin-top: var(--space-lg); }
.mt-18 { margin-top: var(--space-lg-plus); }
.mt-20 { margin-top: var(--space-xl); }
.mt-22 { margin-top: 22px; }
.mt-24 { margin-top: var(--space-2xl); }

/* --- Margin-Bottom --- */
.mb-0  { margin-bottom: 0; }
.mb-4  { margin-bottom: var(--space-xs); }
.mb-6  { margin-bottom: var(--space-xs-plus); }
.mb-8  { margin-bottom: var(--space-sm); }
.mb-10 { margin-bottom: var(--space-sm-plus); }
.mb-12 { margin-bottom: var(--space-md); }
.mb-14 { margin-bottom: var(--space-md-plus); }
.mb-16 { margin-bottom: var(--space-lg); }
.mb-18 { margin-bottom: var(--space-lg-plus); }
.mb-20 { margin-bottom: var(--space-xl); }
.mb-24 { margin-bottom: var(--space-2xl); }
.mb-28 { margin-bottom: var(--space-3xl-minus); }

/* --- Margin-Left --- */
.ml-4  { margin-left: var(--space-xs); }
.ml-8  { margin-left: var(--space-sm); }

/* --- Margin shorthands --- */
.m-0      { margin: 0; }
.m-0-0-10 { margin: 0 0 var(--space-sm-plus); }

/* --- Display --- */
.d-inline       { display: inline; }
.d-inline-block { display: inline-block; }
.d-inline-flex  { display: inline-flex; }
.d-flex         { display: flex; }
.d-block        { display: block; }
.d-none         { display: none !important; }
.cursor-pointer { cursor: pointer; }

/* --- Code-Block (z.B. Cron-Kommando) --- */
.code-block     { word-break: break-all; background: var(--bg-hover); padding: var(--space-sm); border-radius: var(--radius-sm); font-size: 13px; }

/* --- Flex helpers --- */
.flex-center    { display: flex; align-items: center; }
.flex-wrap      { flex-wrap: wrap; }
.justify-end     { justify-content: flex-end; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.align-end      { align-items: flex-end; }
.align-start    { align-items: flex-start; }
.align-center   { align-items: center; }
.gap-4  { gap: var(--space-xs); }
.gap-6  { gap: var(--space-xs-plus); }
.gap-8  { gap: var(--space-sm); }
.gap-10 { gap: var(--space-sm-plus); }
.gap-12 { gap: var(--space-md); }
.gap-14 { gap: var(--space-md-plus); }
.gap-16 { gap: var(--space-lg); }
.gap-20 { gap: var(--space-xl); }

/* --- Text colors --- */
.text-muted   { color: var(--text-muted); }
.text-subtle  { color: var(--text-subtle); }
.text-ghost   { color: var(--text-subtle); }
.text-muted-2 { color: var(--text-muted); }
.text-danger  { color: var(--color-error); }
.text-success { color: var(--color-success); }
.text-mono    { font-family: var(--font-family-mono, ui-monospace, SFMono-Regular, Menlo, monospace); }

/* --- Text sizes --- */
.text-xs   { font-size: 11px; }
.text-sm   { font-size: 12px; }
.text-md   { font-size: 13px; }
.text-base { font-size: 14px; }
.text-lg   { font-size: 16px; }

/* --- Text styles --- */
.text-bold      { font-weight: 600; }
.text-normal    { font-weight: 400; }
.text-italic    { font-style: italic; }
.text-center    { text-align: center; }
.text-right     { text-align: right; }

/* --- Width (fuer Tabellen-Spalten etc.) ---
   !important, damit Utility-Breiten zuverlässig gegen breitere Defaults
   aus Form-Klassen (z.B. .user-form-control { width:100% }) greifen.
   Kombination .user-form-control + .w-72 ergibt dann 72px. */
.w-40  { width: 40px  !important; }
.w-50  { width: 50px  !important; }
.w-56  { width: 56px  !important; }
.w-60  { width: 60px  !important; }
.w-72  { width: 72px  !important; }
.w-76  { width: 76px  !important; }
.w-80  { width: 80px  !important; }
.w-90  { width: 90px  !important; }
.w-100 { width: 100px !important; }
.w-120 { width: 120px !important; }
.w-140 { width: 140px !important; }
.w-150 { width: 150px !important; }
.w-160 { width: 160px !important; }
.w-180 { width: 180px !important; }
.w-200 { width: 200px !important; }
.w-220 { width: 220px !important; }
.w-240 { width: 240px !important; }
.w-400 { width: 400px !important; }
.w-auto { width: auto  !important; }
.w-100p { width: 100% !important; max-width: none !important; }

/* --- Min-width --- */
.min-w-220 { min-width: 220px; }

/* --- Max-width --- */
.mw-80  { max-width: 80px; }
.mw-120 { max-width: 120px; }
.mw-300 { max-width: 300px; }

/* Doppelklasse-Override: die generische .user-form-control-Regel (siehe
   weiter unten) setzt max-width:420px und gewinnt aufgrund spaeterer
   Position im CSS bei gleicher Spezifitaet (0,1,0 vs 0,1,0). Damit die
   Utility-Klassen .mw-* zusammen mit .user-form-control greifen, erhoehen
   wir hier die Spezifitaet auf 0,2,0 — sauber und lokal, kein !important,
   kein Verschieben des Original-Blocks. */
.user-form-control.mw-80  { max-width: 80px; }
.user-form-control.mw-120 { max-width: 120px; }
.user-form-control.mw-300 { max-width: 300px; }

/* --- Table Row Highlights --- */
.tr-error { background: color-mix(in srgb, var(--color-error) 12%, transparent); }

/* --- Compact form elements (Admin-Tabellen) --- */
.input-sm  { width: 70px; padding: var(--space-xs) var(--space-xs-plus); font-size: 13px; }
.select-sm { width: 100%; padding: var(--space-xs) var(--space-xs-plus); font-size: 13px; }

/* Form-Optik fuer .input-sm/.select-sm (Border + Theme-Farben).
   Padding und Font-Size bleiben absichtlich klein (eigene Werte oben),
   nur die Optik wird angeglichen — sonst haben die Admin-Tabellen-
   Inputs Browser-Default-Border und sehen unfertig aus. */
.input-sm,
.select-sm {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    box-sizing: border-box;
}

/* <input type="time">.input-sm: 70px schneidet HH:MM + Spinner-Buttons
   ab. Time-Picker brauchen mindestens ~110px fuer voll lesbare Werte. */
input.input-sm[type="time"] {
    width: 110px;
}

/* Status-Name-Input (admin/statuses + admin/surcharge_rules). RM-44-Block
   gibt bereits Theme-Farben (background/color) — hier die Form-Optik. */
input.status-name {
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-sm-plus);
    box-sizing: border-box;
    width: 100%;
    font-size: var(--font-size-base);
}

/* RM-36: Praefix-Input fuer Artikelkategorien — Eingabe sieht nach
   Konvention immer uppercase aus, server-Sanitize zwingt's ohnehin. */
input.prefix-input {
    text-transform: uppercase;
    font-family: var(--font-family-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
    letter-spacing: 0.5px;
}

/* RM-36: Split-Anzeige der Artikelnummer im Create-Form.
   Badge (Praefix) links + readonly Suffix-Input rechts, beides
   visuell als zusammenhaengendes Feld (Badge sitzt im Input-Rahmen-Stil).
   max-width 420px matcht die spaetere Override-Regel
   `.user-form-grid input[type="text"]` damit Badge+Suffix zusammen
   genauso breit sind wie die anderen Form-Inputs in der Spalte. */
.number-split {
    display: flex;
    align-items: stretch;
    gap: 0;
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
}
.prefix-badge {
    display: inline-flex;
    align-items: center;
    padding: 0 var(--space-sm-plus);
    background: var(--surface-soft, var(--bg-soft));
    border: 1px solid var(--border-strong);
    border-right: 0;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    font-family: var(--font-family-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
    font-weight: 600;
    color: var(--text-strong, var(--text));
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex: 0 0 auto;
    min-width: 56px;
    justify-content: center;
}
.prefix-badge--empty {
    color: var(--text-muted);
    font-weight: 400;
}
/* Suffix-Input innerhalb .number-split: das .user-form-control darunter
   zieht width:100% + max-width:400px — wir override beides damit der
   Input flex-shrinkbar wird und mit dem Badge zusammen die 400px nicht
   ueberschreitet. */
.number-split .suffix-input {
    border-radius: 0 var(--radius-md) var(--radius-md) 0 !important;
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    max-width: none;
    font-family: var(--font-family-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
}

/* (Visited-Reset siehe oben am Anfang der Datei — Etappe 8 final.
   Doppelte Bloecke hier entfernt am 29.04.2026.) */

/* Utility: einzeilig gekappt mit Ellipsis. Voraussetzung: Elternzelle hat
   eine definierte Breite (z.B. Tabellenspalte mit w-XXX oder table-layout:fixed). */
.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Utility: einzeilig erzwingen ohne Ellipsis (z.B. Tabellen-Header,
   die nicht umbrechen sollen, auch wenn die Spalte schmal wird). */
.text-nowrap { white-space: nowrap; }

/* Artikel-Liste: Suchfeld volle Breite, eine Zeile mit angedocktem Button */
.article-search-form,
.contracts-search-form {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: var(--space-sm-plus);
}
.article-search-form .user-form-control,
.article-search-form .input-with-clear,
.contracts-search-form .user-form-control,
.contracts-search-form .input-with-clear {
    flex: 1 1 auto;
    min-width: 0;
}
.article-search-form .filter-search-btn,
.contracts-search-form .filter-search-btn {
    flex: 0 0 auto;
}

/* Wiederverwendbares Pattern: Eingabefeld mit eingebautem Loeschen-Button (X
   visuell innen rechts). Globale Utility — bei Bedarf in customers/index.php,
   tickets/list.php etc. einsetzbar. Eingefuehrt 29.04.2026 (RM-17 B13 Folge).

   Architektur: das X ist ein flex-Geschwister NACH dem Input mit negativem
   margin-left, das es ins padding-right des Inputs reinrueckt. Funktioniert
   robust unabhaengig von max-width des Inputs (im Gegensatz zum vorherigen
   absolute-Position-Ansatz, der bei max-width-Begrenzung das X visuell
   ausserhalb des Inputs platzierte). */
.input-with-clear {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
}
.input-with-clear .user-form-control {
    flex: 1 1 auto;
    min-width: 0;
    /* Platz fuer X-Icon innen rechts: 22px Icon-Container + 2x space-sm Abstand */
    padding-right: calc(var(--space-sm) + 22px + var(--space-sm));
    box-sizing: border-box;
}
.input-clear-btn {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    /* Negativ-margin schiebt das X ins padding-right des Inputs hinein —
       Distanz = Icon-Breite + Abstand = 22px + space-sm (mit minus). */
    margin-left: calc(-22px - var(--space-sm));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;     /* Icon-Container — bewusst klein, kein Token noetig */
    height: 22px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-full);
    cursor: pointer;
    text-decoration: none;
    transition: color var(--transition-fast), background var(--transition-fast);
}
.input-clear-btn:hover {
    color: var(--text-secondary);
    background: var(--bg-overlay-soft);
}
.input-clear-btn:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 1px;
}

/* Kategorie-Filter-Buttons (Artikel-Liste und ggf. andere Stammdaten-Listen).
   Linksbündig, gedeckte Grautöne, aktiver Button in Primär-Blau. */
.category-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs-plus);
    justify-content: flex-start;
}
.category-filter-btn {
    display: inline-block;
    padding: var(--space-xs-plus) var(--space-md-plus);
    border-radius: var(--radius-sm);
    background: var(--bg-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    font-size: 13px;
    text-decoration: none;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
/* Hover wirkt auf die ganze Pille, nicht nur auf den Text. Vorher
   liefen --bg-hover-Default und --bg-hover-Hover gegeneinander
   (kein sichtbarer BG-Wechsel) plus globaler a:hover-underline kam
   durch — User-Befund 02.05.2026 'wirkt nicht typisch
   schaltflaechen-like'. Jetzt: dezenter Blau-Tint via
   info-soft-Tokens (theme-aware), expliziter
   text-decoration:none-Override. */
.category-filter-btn:hover {
    background: var(--color-info-soft);
    color: var(--color-info-dark);
    border-color: var(--color-info-soft-border);
    text-decoration: none;
}

/* Dark-Mode: Hover-Text auf hellweiss statt --color-info-dark
   (Brand-primary-Dark = #66ADF7 — User empfand das als 'dunkelblau'
   gegen den dunkelblauen Pastell-BG). Maximale Lesbarkeit auf
   --color-info-soft Dark (#1A2D3D). */
:root[data-theme="dark"] .category-filter-btn:hover {
    color: var(--color-light);
}
.category-filter-btn.active {
    background: var(--color-primary);
    color: var(--color-light);
    border-color: var(--color-primary);
}
.category-filter-btn.active:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    color: var(--color-light);
}

/* Segmented Control — fuer Modus-Schalter wie „Nur dieser Kunde / Alle".
   Eine zusammengewachsene Pille mit klar abgesetztem Active-Segment.
   Wird in /contracts/ fuer den Kunden-Filter genutzt; absichtlich
   eigenstaendige Klasse (kein .category-filter-btn-Re-Use), damit der
   Schalter optisch eine andere Hierarchie hat als Filter-Chips. */
.segmented-control {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
    line-height: 1;
}
.segmented-control-btn,
.segmented-control-btn:visited {
    padding: var(--space-sm-plus) var(--space-lg);
    text-decoration: none;
    color: var(--text-secondary);
    background: transparent;
    transition: background var(--transition-fast), color var(--transition-fast);
    border-right: 1px solid var(--border-color);
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    white-space: nowrap;
}
.segmented-control-btn:last-child {
    border-right: none;
}
.segmented-control-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    text-decoration: none;
}
.segmented-control-btn.active,
.segmented-control-btn.active:hover {
    background: var(--color-primary);
    color: var(--color-text-on-nav);
    cursor: default;
}

/* Confirm-Dialog-Nachricht: Zeilenumbrüche (\n aus data-confirm) als Absätze */
#global-confirm-message {
    white-space: pre-line;
}

/* Archivierte Artikel-Option im Komponenten-Dropdown (RM-17 v2.1 Block 3+).
   Browser-Styling von <option> ist limitiert — das disabled-Attribut sorgt
   meist schon für graue Darstellung, font-style wirkt aber zuverlässig. */
option.option-archived {
    color: var(--text-muted);
    font-style: italic;
}

/* Preisentwicklungs-Chart (article_edit.php, RM-17 v2.1 Block 3) */
.price-chart {
    display: block;
    width: 100%;
    max-width: 900px;
    height: auto;
    margin: 0 auto;
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

/* --- Projekt-Standard für Formular-Felder ---
   user-form-control ist die Projekt-Standardklasse für Inputs/Selects/
   Textareas in Formularen. Definiert das visuelle Verhalten zentral,
   damit NICHT mehr auf die globalen Element-Selectors (input { ... } /
   input[type="text"] { ... }) zurückgegriffen werden muss.

   Reset-Charakter:
   - box-sizing: border-box  → Padding/Border werden in die Breite einberechnet
   - width: 100%             → füllt den Parent-Container (Grid-Zelle, Flex-Kind etc.)
   - max-width: 400px        → kappt auf 400px in breiten Containern, behält den
                               optischen Charakter der bisherigen globalen Regel
   - padding: var(--space-sm) var(--space-sm-plus)       → einheitliche Innenabstände
   - font-size: 14px         → Projekt-Standard (CLAUDE.md: 14px Standard, 13px Minimum)
   - margin: 0               → Layout-Abstände kommen über Parent-Grid/Flex, nicht Input-Margin

   In breiten Tabellenzellen (z.B. .data-table.table-full) überschreibt
   .w-100p die max-width. */
.user-form-control {
    box-sizing: border-box;
    width: 100%;
    max-width: 400px;
    padding: var(--space-sm) var(--space-sm-plus);
    font-size: 14px;
    margin: 0;
    background: var(--bg-input);
    color: var(--text-primary);
}

/* RM-44 Cluster 3: Inputs/Selects, die in HTML mit Width-Utility-
   Klassen (.w-XX) statt .user-form-control angelegt wurden, plus
   einzelne komponentenspezifische Sonderklassen (Status-Name in
   admin/statuses+pools, Color-Picker-Numerik-Inputs, .ts-input von
   Tom-Select). Loesung uebers CSS statt HTML-Klassen-Refactoring,
   weil ~10 Pages und ~25 Inputs sonst angefasst werden muessten.
   Identifiziert via Phase-A-Vollsichtung (Audit-Skript Computed-
   Style-Scan ueber 19 Pages, 30.04.2026). */
input.w-40, input.w-50, input.w-56, input.w-60,
input.w-72, input.w-76, input.w-80, input.w-90, input.w-100,
input.w-120, input.w-140, input.w-150, input.w-160, input.w-180,
input.w-200, input.w-220, input.w-240, input.w-400,
select.w-40, select.w-50, select.w-56, select.w-60,
select.w-72, select.w-76, select.w-80, select.w-90, select.w-100,
select.w-120, select.w-140, select.w-150, select.w-160, select.w-180,
select.w-200, select.w-220, select.w-240, select.w-400,
textarea.w-40, textarea.w-50, textarea.w-56, textarea.w-60,
textarea.w-72, textarea.w-76, textarea.w-80, textarea.w-90, textarea.w-100,
textarea.w-120, textarea.w-140, textarea.w-150, textarea.w-160, textarea.w-180,
textarea.w-200, textarea.w-220, textarea.w-240, textarea.w-400,
input.status-name,
input.picker-input,
input#picker-hex, input#picker-r, input#picker-g, input#picker-b {
    background: var(--bg-input);
    color: var(--text-primary);
}

/* RM-44 Cluster 3 Folgesatz: .w-XX-Inputs bekommen zusaetzlich die
   Form-Optik (Padding, Border, Border-Radius), damit sie nicht
   Browser-Default aussehen. Vorher griffen nur die Theme-Farben.
   Beispiel: profile/index.php Geburtstag (drei Number-Inputs).
   Color-Picker- und Status-Name-Inputs sind hier bewusst NICHT
   gelistet — die haben eigene Layouts, die nicht ueberschrieben
   werden duerfen. */
input.w-40, input.w-50, input.w-56, input.w-60,
input.w-72, input.w-76, input.w-80, input.w-90, input.w-100,
input.w-120, input.w-140, input.w-150, input.w-160, input.w-180,
input.w-200, input.w-220, input.w-240, input.w-400,
select.w-40, select.w-50, select.w-56, select.w-60,
select.w-72, select.w-76, select.w-80, select.w-90, select.w-100,
select.w-120, select.w-140, select.w-150, select.w-160, select.w-180,
select.w-200, select.w-220, select.w-240, select.w-400,
textarea.w-40, textarea.w-50, textarea.w-56, textarea.w-60,
textarea.w-72, textarea.w-76, textarea.w-80, textarea.w-90, textarea.w-100,
textarea.w-120, textarea.w-140, textarea.w-150, textarea.w-160, textarea.w-180,
textarea.w-200, textarea.w-220, textarea.w-240, textarea.w-400 {
    box-sizing: border-box;
    padding: var(--space-sm) var(--space-sm-plus);
    font-size: var(--font-size-lg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
}

/* --- Weekday-Picker (Zuschlagsregeln) --- */
.weekday-picker { display: flex; gap: var(--space-2xs); }
.weekday-toggle { cursor: pointer; }
.weekday-toggle input { display: none; }
.weekday-toggle span {
    display: inline-block; width: 28px; height: 26px; line-height: 26px;
    text-align: center; font-size: 11px; font-weight: 600;
    border: 1px solid var(--border-color); border-radius: var(--radius-sm);
    color: var(--text-subtle); background: var(--bg-hover); transition: all var(--transition-fast);
}
.weekday-toggle input:checked + span {
    background: var(--surface-dark); color: var(--color-light); border-color: var(--surface-dark);
}

/* --- Workspace Sub-Nav (horizontal, unterhalb Top-Nav) ---
   RM-62 Follow-Up (13.05.2026 abends, Vereinheitlichung): Frontend- und
   Admin-Sub-Nav teilen sich jetzt dieses Pattern. Aus dem urspruenglichen
   Admin-Design uebernommen: Item-Optik (14px, normal weight, BG-Pill als
   Active) — Hendrik mag den klaren Pill-Indikator. Aus dem Frontend-
   Pattern behalten: weisse/dunkle Container-Surface (--bg-nav-secondary),
   linker Inset (Item-Text fluchtet mit Service-Desk-Icon der Top-Nav),
   44px Touch-Targets. Vorher .admin-topnav-Block (Z. 2959-3005) wurde
   ersatzlos geloescht — die admin_nav.php nutzt jetzt diese Klassen
   direkt mit den Modifiern .is-end und .is-danger. */
.workspace-subnav {
    display: flex;
    align-items: center;
    gap: var(--space-xs-plus);
    background: var(--bg-nav-secondary);
    box-shadow: 0 1px 0 var(--border-color);
    padding: 0 var(--space-xl) 0 var(--nav-content-offset);
    /* Container 52px, Items 44px (Touch) -> 4px Atemraum oben/unten,
       sodass Active-/Hover-Pills nicht an Top-Nav (oben) und CCB/Body
       (unten) kleben. Container-Surface --bg-nav-secondary bleibt
       sichtbar als Rahmen um die Pills. */
    min-height: 52px;
}
.workspace-subnav-item,
.workspace-subnav-item:visited {
    padding: 0 var(--space-md-plus);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    /* --radius-sm (4px) wie Top-Nav-Workspace-Tab, fuer einheitliche
       Rundung in der gesamten Navigations-Familie (Hendrik 13.05.2026). */
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: normal;
    text-decoration: none;
    transition: all var(--transition-fast);
}
/* Inactive Hover: 15%-Brand-Blau-Mix als Pastell-BG statt grauer
   --bg-tile-soft. Vorher war der Effekt im Light kaum wahrnehmbar
   (Hendrik 13.05.2026: "darf etwas konkreter sein"). color-mix mit
   var(--color-primary) ergibt theme-aware ein Pastell-Brand-Blau in
   beiden Themes:
     Light: ~#dae8f7 effektiv (Container #fff + 15% #1f6cc4)
     Dark:  ~#323f51 effektiv (Container #252525 + 15% #66ADF7)
   Color geht auf --text-primary fuer zusaetzliche Hover-Affordance. */
.workspace-subnav-item:hover,
.workspace-subnav-item:visited:hover {
    background: color-mix(in srgb, var(--color-primary) 15%, transparent);
    color: var(--text-primary);
    text-decoration: none;
}
.workspace-subnav-item.active {
    background: var(--color-primary);
    /* --text-inverse statt --color-light: theme-stabil weiss im Light,
       dunkel #121210 im Dark — fixt WCAG-Fail bei Active-Pill im Dark
       (war 2.32:1 mit weissem Text, jetzt 8.2:1 AAA mit dunklem Text auf
       hellem Brand-Cyan). Path A 13.05.2026, Inverse-Pattern wie Linear. */
    color: var(--text-inverse);
}
/* Active-Hover: Brand-Pill bleibt erhalten, aber 1 Stufe dunkler (Light)
   bzw. heller (Dark) via --color-primary-hover. Eigene Regel zwingend
   notwendig wegen Spezifitaets-Falle: .workspace-subnav-item:visited:hover
   ist (0,3,0), .workspace-subnav-item.active ist (0,2,0) — ohne diese
   spezifischere Regel wuerde der Inactive-Hover den Active-Pill bei
   visited Links (= immer, sobald man dort war) ueberschreiben. Mit
   (0,4,0) zieht diese Regel an :visited:hover vorbei. */
.workspace-subnav-item.active:hover,
.workspace-subnav-item.active:visited:hover {
    background: var(--color-primary-hover);
    color: var(--text-inverse);
}

/* Modifier: Item rechts ans Ende der Sub-Nav schieben (z.B. Test-Tools im Admin). */
.workspace-subnav-item.is-end {
    margin-left: auto;
}

/* Modifier: Danger-Item (Test-Tools im Admin). Rote Schrift im Default,
   Pastell-rot im Hover, voller roter Pill im Active — analog zur Brand-
   Familie, aber mit --color-error statt --color-primary. */
.workspace-subnav-item.is-danger,
.workspace-subnav-item.is-danger:visited {
    color: var(--color-error);
}
.workspace-subnav-item.is-danger:hover,
.workspace-subnav-item.is-danger:visited:hover {
    background: var(--color-error-soft);
    color: var(--color-error);
}
.workspace-subnav-item.is-danger.active {
    background: var(--color-error);
    /* --text-inverse fuer WCAG-konformen Text auf dem Danger-Pill, analog
       zur Active-Regel oben (Light: 5.59:1 mit weiss bleibt; Dark wechselt
       von 3.06:1 weiss auf 6.24:1 mit dunklem Text). */
    color: var(--text-inverse);
}
/* Active-Hover fuer is-danger: roter Pill bleibt, 1 Stufe dunkler (Light
   #a80016) bzw. heller (Dark #FF7B7B) via --color-error-hover. Spezifitaet
   (0,5,0) schlaegt is-danger:visited:hover (0,4,0) — gleiche Spezifitaets-
   Logik wie bei .active:hover oben. */
.workspace-subnav-item.is-danger.active:hover,
.workspace-subnav-item.is-danger.active:visited:hover {
    background: var(--color-error-hover);
    color: var(--text-inverse);
}

/* --- Contract State Badge --- */
/* =========================
   STATE-INDICATOR (wiederverwendbar)
   Pastelliger Badge fuer State-Anzeige — Varianten pro Zustand,
   keine Inline-Farben, keine data-css-background-Gymnastik.
   Grundform nach dem .ccb-active-indicator-Vorbild.
   ========================= */
.state-indicator {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs-plus);
    font-size: 12px;
    font-weight: 600;
    padding: var(--space-xs) var(--space-sm-plus);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    line-height: 1.4;
    box-sizing: border-box;
    white-space: nowrap;
}
/* -lg: gleiche Familie wie .ccb-active-indicator und .btn-context-set
   (padding xs-plus/md, fs 13, lh 1.4) — Hauptanwendung ist der Header-
   Status auf contracts/edit.php. fw bleibt 600 (Status-Akzent
   gegenueber 500 bei .ccb-active-indicator). Vorher mit padding md-plus
   und ohne Border wirkte der Pill gestreckt + matt. */
.state-indicator-lg {
    font-size: 13px;
    padding: var(--space-xs-plus) var(--space-md);
}
.state-indicator-success {
    background: var(--color-success-soft);
    color: var(--color-success-dark);
    border-color: var(--color-success-soft-border);
}
.state-indicator-warning {
    background: var(--color-warning-soft);
    color: var(--color-warning-dark);
    border-color: var(--color-warning-soft-border);
}
.state-indicator-danger {
    background: var(--color-error-soft);
    color: var(--color-error);
    border-color: var(--color-error-soft-border);
}
.state-indicator-neutral {
    background: var(--color-neutral-soft);
    color: var(--color-neutral-dark);
    border-color: var(--color-neutral-soft-border);
}

/* --- Form Hint (Hilfstext unter Feldern) --- */
.form-hint {
    display: block; margin-top: var(--space-xs);
    font-size: 12px; color: var(--text-muted);
}

/* --- Date Quick-Preset Buttons (z.B. 6M/12M/24M/48M) --- */
.date-presets {
    display: inline-flex; gap: var(--space-xs); margin-left: var(--space-sm); vertical-align: middle;
}
.date-preset-btn {
    display: inline-block; padding: 3px var(--space-sm);
    font-size: 11px; font-weight: 600; line-height: 1.4;
    color: var(--color-primary); background: var(--bg-tile-soft);
    border: 1px solid var(--color-info-soft-border); border-radius: var(--radius-sm);
    cursor: pointer; transition: all var(--transition-fast);
}
.date-preset-btn:hover {
    background: var(--color-primary); color: var(--color-light);
    border-color: var(--color-primary);
}
.date-preset-btn:disabled {
    opacity: 0.35; cursor: not-allowed;
    background: var(--bg-hover); color: var(--text-subtle); border-color: var(--border-color);
}
.date-preset-btn:disabled:hover {
    background: var(--bg-hover); color: var(--text-subtle); border-color: var(--border-color);
}

/* --- Conditional Form Sections (JS ein-/ausgeblendet) --- */
.form-conditional { transition: opacity var(--transition-fast); }
.is-hidden { display: none; }

/* --- Komponenten-Editor --- */
.component-card {
    display: grid; grid-template-columns: 1fr auto;
    gap: var(--space-sm); align-items: start;
    padding: var(--space-md) var(--space-md-plus); border: 1px solid var(--border-color); border-radius: var(--radius-md);
    background: var(--bg-page); margin-bottom: var(--space-sm);
}

/* Component-Card responsive (RM-49b, 02.05.2026): bei < --bp-s (600)
   klappen Info+Actions untereinander statt nebeneinander, sonst
   quetschen sich Action-Buttons ueberm Vertrags-Komponenten-
   Beschreibungstext. */
@media (max-width: 599px) {
    .component-card {
        grid-template-columns: 1fr;
    }
}
.component-card:hover { border-color: var(--border-color); }
.component-card-info { display: flex; flex-direction: column; gap: var(--space-2xs); }
.component-card-title { font-weight: 600; font-size: 14px; color: var(--surface-dark); }
.component-card-type { font-size: 12px; color: var(--text-muted); }
.component-card-params { font-size: 13px; color: var(--text-secondary); margin-top: var(--space-2xs); }
.component-card-actions { display: flex; gap: var(--space-xs); align-items: center; }

/* Generischer kleiner Confirm-/Eingabe-Dialog (HTML5 dialog).
   Wiederverwendbar fuer Dialoge wie Test-Mail-Empfaenger-Eingabe,
   kleine Confirm-Boxen etc. Drei Bereiche: Header / Body / Actions. */
.simple-dialog {
    width: 480px; max-width: 92vw;
    border: none; border-radius: var(--radius-lg); padding: 0;
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
    background: var(--bg-card);
}
.simple-dialog::backdrop { background: var(--bg-overlay-medium); }
.simple-dialog-header {
    padding: var(--space-md-plus) var(--space-xl);
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-table-head);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.simple-dialog-body {
    padding: var(--space-xl);
}
.simple-dialog-actions {
    padding: var(--space-md) var(--space-xl);
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
    background: var(--bg-table-stripe);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Komponenten-Dialog */
.component-dialog {
    width: 860px; max-width: 92vw; max-height: 85vh;
    border: none; border-radius: var(--radius-lg); padding: 0;
    box-shadow: var(--shadow-lg);
}
.component-dialog::backdrop { background: var(--bg-overlay-medium); }
.dialog-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: var(--space-md-plus) var(--space-xl); border-bottom: 1px solid var(--border-color); background: var(--bg-table-head);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.dialog-close {
    background: none; border: none; font-size: 22px; color: var(--text-muted);
    cursor: pointer; padding: 0 var(--space-xs); line-height: 1;
}
.dialog-close:hover { color: var(--text-secondary); }
.dialog-body { padding: var(--space-lg) var(--space-xl); overflow-y: auto; max-height: calc(85vh - 120px); }
.dialog-footer {
    display: flex; justify-content: flex-end; gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl); border-top: 1px solid var(--border-color); background: var(--bg-hover);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Typ-Auswahl-Karten */
.comp-type-cards { display: flex; flex-direction: column; gap: var(--space-xs-plus); }
.comp-type-card {
    display: flex; flex-direction: column; gap: var(--space-2xs);
    padding: var(--space-sm-plus) var(--space-md-plus); border: 2px solid var(--border-color); border-radius: var(--radius-md);
    background: var(--bg-card); cursor: pointer; text-align: left; transition: all var(--transition-fast);
    min-height: 44px; /* Touch-Target */
}
.comp-type-card:hover { border-color: var(--color-primary); background: var(--bg-tile-soft); }
.comp-type-card.selected {
    border-color: var(--color-primary); background: var(--bg-tile-soft);
    box-shadow: 0 0 0 1px var(--color-primary);
}
.comp-type-card.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: var(--bg-hover);
    border-color: var(--border-color);
}
.comp-type-card.is-disabled:hover {
    border-color: var(--border-color);
    background: var(--bg-hover);
}

/* Typografie innerhalb der Karten — Titel eine Stufe groesser als
   .user-form-label (16px), Beschreibung normale Body-Groesse mit muted-Token. */
.comp-type-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}
.comp-type-card-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Wrapper um Karte. Initial: Wrapper ist transparent (Karte sieht aus
   wie bisher). Nach .is-collapsed werden nicht-gewaehlte Wrapper hidden,
   die gewaehlte Karte schrumpft per .is-compact. */
.comp-type-card-wrap { display: flex; flex-direction: column; }
.comp-type-cards.is-collapsed .comp-type-card-wrap:not(.is-selected) { display: none; }

.comp-type-card.is-compact {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: var(--space-sm);
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    min-height: 44px;
}
.comp-type-card.is-compact:hover {
    border-color: var(--color-primary);
    background: var(--bg-tile-soft);
}
.comp-type-card.is-compact::before {
    content: '✓';
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: center;
    color: var(--color-primary);
    font-weight: 700;
    font-size: 18px;
    line-height: 1;
}
.comp-type-card.is-compact .comp-type-card-title {
    grid-column: 2;
    grid-row: 1;
    font-size: 16px;
}
.comp-type-card.is-compact .comp-type-card-desc {
    grid-column: 2;
    grid-row: 2;
}

/* Edit-Modus: compact-Card ist nicht klickbar (kein Typ-Wechsel an
   bestehender Komponente). cursor:default + Hover ohne Highlight. */
.comp-type-cards.is-edit-mode .comp-type-card.is-compact {
    cursor: default;
}
.comp-type-cards.is-edit-mode .comp-type-card.is-compact:hover {
    border-color: var(--color-primary);
    background: var(--bg-tile-soft);
}

/* Param-Felder Abschnitt */
.comp-params-section { margin-top: var(--space-md); padding-top: var(--space-md); border-top: 1px solid var(--border-light); }
.comp-params-section h4 { font-size: 13px; color: var(--text-muted); margin: 0 0 var(--space-sm-plus); font-weight: 600; }

/* Service-Type Checkboxen */
.service-type-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--space-xs-plus);
}
.service-type-grid label { display: flex; align-items: center; gap: var(--space-xs-plus); font-size: 13px; cursor: pointer; }

/* Bucket-Fortschrittsbalken (Quota-Komponenten) */
.comp-bucket { margin-top: var(--space-xs-plus); }
.comp-bucket-bar {
    height: 6px; background: var(--bg-hover); border-radius: var(--radius-sm); overflow: hidden;
}
.comp-bucket-fill { height: 100%; border-radius: var(--radius-sm); transition: width var(--transition-base); }
.comp-bucket-text { font-size: 11px; color: var(--text-muted); margin-top: var(--space-2xs); }

/* Versionshistorie (collapsible unter Komponentenkarte) */
.comp-history {
    grid-column: 1 / -1; /* spannt über beide Grid-Spalten der Karte */
    border-top: 1px solid var(--border-light); padding-top: var(--space-sm); margin-top: var(--space-xs);
}
.comp-version-list { display: flex; flex-direction: column; gap: var(--space-xs-plus); }
.comp-version-item {
    padding: var(--space-xs-plus) var(--space-sm-plus); border-left: 3px solid var(--border-color); background: var(--bg-hover);
    font-size: 12px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.comp-version-item.is-current { border-left-color: var(--color-primary); background: var(--bg-tile-soft); }
.comp-version-header { display: flex; gap: var(--space-sm-plus); align-items: center; flex-wrap: wrap; }
.comp-version-num { font-weight: 700; color: var(--surface-dark); }
.comp-version-range { color: var(--text-muted); }
.comp-version-user { color: var(--text-muted); font-style: italic; }
.comp-version-reason { color: var(--text-muted); font-style: italic; margin-top: var(--space-2xs); }
.comp-version-created { color: var(--text-subtle); font-size: 11.5px; margin-top: var(--space-2xs); }
.comp-version-params { color: var(--text-secondary); margin-top: var(--space-2xs); }
.p-8 { padding: var(--space-sm); }

/* --- Activity-Category Baum (Einrückung) --- */
.ac-child-row td:first-child { padding-left: var(--space-2xl); }
.ac-indent { color: var(--text-subtle); margin-right: var(--space-xs); font-size: 12px; }
.ac-child-input { width: calc(100% - 20px); }

/* --- Misc --- */
.resize-v    { resize: vertical; }
.pre-wrap    { white-space: pre-wrap; }
.input-readonly { background: var(--bg-hover); color: var(--text-muted); cursor: default; }
.create-contact-info { font-size: 15px; color: var(--text-muted); }
.create-contact-overlay { min-width: 380px; max-width: 460px; }
.pool-config-overlay { width: 440px; }
.pool-config-title { font-size: 15px; color: var(--surface-dark); }
.test-tools-table { max-width: 480px; }

.setting-row {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2xl);
    padding: var(--space-lg) 0;
    border-bottom: 1px solid var(--border-light);
}
.setting-info { flex: 1; }
.setting-control { flex-shrink: 0; padding-top: var(--space-2xs); }
.setting-row-compact { padding: var(--space-md) 0; align-items: center; }
.setting-row-border { border-top: 1px solid var(--border-light); }

/* Dateiendungen-Gruppen Grid */
.ext-groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-sm-plus);
}

.ext-group-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-sm-plus) var(--space-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.ext-group-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}

.ext-group-item input[type="checkbox"] {
    margin-top: var(--space-2xs);
    flex-shrink: 0;
}

.ext-group-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 120px;
}

.ext-group-exts {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 14px;
    cursor: pointer;
}

/* Form-Group fuer Side-Forms (z.B. admin/widgets.php "Neues Admin-Widget").
   Label links auf fixer Breite, Input rechts auf moderate Breite gecapped
   und nach rechts gepushed (margin-left: auto). Vermeidet, dass
   Selects/Inputs die volle Spaltenbreite einnehmen. */
.form-group {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.form-group .form-label {
    flex: 0 0 120px;
    color: var(--text-muted);
    font-size: var(--font-size-base);
    margin: 0;
}

.form-group .user-form-control,
.form-group input[type="text"],
.form-group select {
    flex: 0 1 280px;
    max-width: 280px;
    margin-left: auto;
}

/* Vertikale Variante fuer Form-Groups mit mehrzeiligen Inhalten
   (z.B. Checkbox-Gruppen mit Hint-Text darueber). */
.form-group--block {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-xs);
}

.form-group--block .form-label {
    flex: none;
}

/* Radio-Group: vertikal gestapelte Radio-Optionen mit klickbarem Label.
   Generisches Pattern, erstes Use-Case: Theme-Auswahl in profile/index.php. */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}
.radio-option {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 14px;
    cursor: pointer;
}

/* Modifier: horizontale Anordnung, mit Wrap fuer kleine Viewports.
   Use-Case: tickets/create.php Typ-Auswahl (3 kurze Optionen nebeneinander). */
.radio-group--inline {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-md);
}
.cursor-ptr  { cursor: pointer; }
.p-0         { padding: 0; }
.p-16        { padding: var(--space-lg); }
.p-40        { padding: var(--space-4xl); }

/* --- Kombiklassen (haeufig wiederkehrende Patterns) --- */
.hint-sm     { font-size: 13px; color: var(--text-muted); }
.hint-sm-2   { font-size: 13px; color: var(--text-muted); }
.hint-xs     { font-size: 12px; color: var(--text-muted); }
.hint-subtle { font-size: 13px; color: var(--text-subtle); }
.hint-ghost  { font-size: 12px; font-weight: 400; color: var(--text-subtle); }
.label-bold  { font-weight: 600; margin-bottom: var(--space-xs); }
.section-subtitle { font-size: 16px; color: var(--text-muted); margin-bottom: var(--space-lg); }
.empty-state { text-align: center; padding: var(--space-4xl); }

/* =========================
   LOGIN
   ========================= */

.login-page {
    background: var(--bg-hover);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--space-4xl) 48px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.login-logo-img {
    display: block;
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-md);
}

.login-logo-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 2px;
}

.login-logo-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: var(--space-xs);
    letter-spacing: 1px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs-plus);
}

.login-field label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Greift auch in login-wrap/twofa-setup (dort kein .login-card-Wrapper),
   die visuelle Konsistenz bleibt so in allen Auth-Seiten erhalten. */
.login-field input {
    width: 100%;
    box-sizing: border-box;
    padding: var(--space-sm-plus) var(--space-md);
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    outline: none;
    margin: 0;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: border-color var(--transition-fast);
}

.login-field input:focus {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-focus);
}

.login-btn {
    width: 100%;
    padding: var(--space-md);
    background: var(--color-accent);
    color: var(--color-light);
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: var(--space-xs);
    transition: background var(--transition-fast);
}

.login-btn:hover {
    background: var(--color-accent-hover);
}

/* =========================
   BASE
   ========================= */

html {
    scrollbar-gutter: stable;
}

body {
    font-family: 'Inter', Arial, sans-serif;
    background: var(--bg-hover);
    color: var(--text-primary);
    margin: 0;
}

/* (Globale input { padding:var(--space-sm-plus); margin:var(--space-xs) }-Regel entfernt am 23.04.2026 —
   CSS-Tech-Debt-Etappe B. Ersetzt durch scope-spezifische Regeln auf
   .user-form-control + .input-sm etc. Checkboxen/Radios bekommen ihren
   Abstand nun über Parent-Layout (Flex/Grid-Gap), nicht Input-Margin. */

/* (Globale button { padding:var(--space-sm-plus) var(--space-xl) }-Regel bleibt vorerst stehen —
   Etappe C, separate Session.) */
button {
    padding: var(--space-sm-plus) var(--space-xl);
}

/* =========================
   NAVIGATION
   ========================= */

.main-nav {
    background: var(--bg-nav);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
    padding: 0 var(--space-xl);
    position: relative;
    z-index: var(--z-base);
}

.main-nav a:not(.launchpad-back):not(.quickadd-item):not(.user-menu-item):not(.help-btn):not(.workspace-tab):not(.nav-logo-link) {
    color: var(--color-text-on-nav);
    text-decoration: none;
    margin-right: var(--space-sm-plus);
    padding: var(--space-xs-plus) var(--space-md);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs-plus);
}

.nav-icon {
    flex-shrink: 0;
    opacity: 0.8;
}

.icon-ticket {
    transform: rotate(-35deg);
}

.main-nav a:hover .nav-icon,
.main-nav a.active .nav-icon {
    opacity: 1;
}

.main-nav a:hover:not(.launchpad-back):not(.quickadd-item):not(.user-menu-item):not(.workspace-tab):not(.nav-logo-link) {
    background: var(--color-primary-hover);
}

.main-nav a.active {
    background: var(--color-accent);
    color: var(--color-light);
    font-weight: bold;
}

/* Breite für Bold reservieren: unsichtbares Bold-Pseudo-Element
   verhindert Layout-Shift beim Seitenwechsel */
.nav-text {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}

.nav-text::after {
    content: attr(data-text);
    font-weight: bold;
    height: 0;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
}

.logo {
    color: var(--color-light);
    font-weight: bold;
    margin-right: var(--space-lg);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 2px;
}

.nav-right {
    display: flex;
    align-items: center;
}

.user-info {
    color: var(--color-text-on-nav);
    margin-right: var(--space-sm-plus);
}

.main-nav a.user-info-link {
    color: var(--color-text-on-nav);
    margin-right: var(--space-xs);
    text-decoration: none;
    padding: var(--space-xs-plus) var(--space-sm-plus);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

/* =========================
   CUSTOMER-CONTEXT-BAR
   ========================= */

.customer-context-bar {
    background: var(--bg-table-head);
    /* RM-62 Follow-Up (13.05.2026): Border auf --border-strong (#ccc Light /
       #444 Dark) statt --border-color (#ddd / #333) — WCAG 1.4.11 verlangt
       3:1 fuer nicht-textuale UI-Indikatoren. #ddd auf #f4f6f8 war 1.25:1.
       #ccc auf #f4f6f8 = ~2.4:1 (knapp unter Schwelle, aber deutlich besser
       wahrnehmbar). Saubere 3:1 wuerde #aaa erfordern, aber das wirkt zu
       hart fuer eine Toolbar-Trennung. */
    border-bottom: 1px solid var(--border-strong);
    padding: var(--space-sm-plus) var(--space-xl);
    display: flex;
    align-items: center;
    gap: var(--space-2xl);
}

.ccb-customer {
    display: flex;
    align-items: center;
    gap: var(--space-md-plus);
    flex: 1 1 0;
    min-width: 200px;
    overflow: hidden;
}

.ccb-cust-no {
    font-weight: 600;
    color: var(--text-primary);
}

.ccb-cust-sep {
    color: var(--text-subtle);
    font-weight: 400;
}

.ccb-cust-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ccb-cust-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hinweis: :visited braucht expliziten Farbwert (Privacy-Lock — inherit
   wuerde ignoriert). #333 entspricht der App-Default-Schriftfarbe auf
   hellem Bar-Hintergrund (var(--bg-table-head)). */
.ccb-cust-link {
    color: inherit;
    text-decoration: none;
}
.ccb-cust-link:visited {
    color: var(--text-secondary);
    text-decoration: none;
}

.ccb-cust-link:hover,
.ccb-cust-link:visited:hover {
    color: inherit;
    text-decoration: underline;
}
.ccb-cust-link:visited:hover {
    color: var(--text-secondary);
}

.ccb-cust-meta {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.3;
    margin-top: var(--space-2xs);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Quick-Actions rechts neben der Kundensuche */
.ccb-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    justify-content: flex-end;
    flex: 1 1 0;
}

.ccb-action-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: color var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
    text-decoration: none;
}

.ccb-action-btn:hover {
    color: var(--color-primary);
    background: var(--bg-tile-soft);
    border-color: var(--color-primary);
    box-shadow: 0 2px 6px color-mix(in srgb, var(--color-primary) 18%, transparent);
}

.ccb-action-badge {
    position: absolute;
    /* 1px Inset bewusst — Badge-Edge bleibt innerhalb der visuellen
       Parent-Grenze, vermeidet Overlap mit Border-Antialiasing. */
    bottom: 1px;
    right: 1px;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    color: var(--color-success);
    stroke: currentColor;
    stroke-width: 2;
}

.ccb-action-btn:hover .ccb-action-badge {
    color: var(--color-primary);
}

.ccb-search {
    position: relative;
    flex: 0 1 400px;
    min-width: 180px;
}

/* Tooltip beim Fokus/Tippen ausblenden — Hilfe nur im Ruhezustand.
   data-tooltip sitzt direkt auf .ccb-search (kein extra Wrapper noetig:
   <input> kann selbst keine ::before/::after-Pseudoelemente tragen,
   .ccb-search ist aber sowieso schon der position:relative-Container). */
.ccb-search:focus-within[data-tooltip]:hover::after,
.ccb-search:focus-within[data-tooltip]:hover::before {
    display: none;
}

/* Explizit verankerte Input-Styles der CCB-Suche (Container-100%, Padding,
   Font-Size). Historisch als Workaround gegen die globalen input-Regeln
   angelegt — die sind seit 23.04.2026 entfernt. Wir belassen die Regeln
   hier trotzdem, weil sie dem Suchfeld eine klare eigene Optik geben. */
.customer-context-bar .ccb-search-input {
    width: 100%;
    margin: 0;
    padding: var(--space-sm);
    font-size: var(--font-size-lg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    box-sizing: border-box;
}

.ccb-search-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: var(--shadow-focus);
}

.ccb-search-results {
    position: absolute;
    top: calc(100% + var(--space-xs));
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    max-height: 360px;
    overflow-y: auto;
    z-index: var(--z-modal);
}

.ccb-result {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
}

.ccb-result:last-child {
    border-bottom: none;
}

.ccb-result:hover,
.ccb-result.active {
    background: var(--color-success-soft);
}
.ccb-result.active:hover {
    background: var(--color-success-soft-border);
}

.ccb-result-no {
    font-size: 12px;
    font-weight: 700;
    color: var(--color-primary);
    min-width: 50px;
}

.ccb-result-info {
    flex: 1;
    min-width: 0;
}

.ccb-result-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ccb-result-meta {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ccb-result-empty {
    padding: var(--space-md-plus) var(--space-md);
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.ccb-section-header {
    padding: var(--space-xs-plus) var(--space-md);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-hover);
    border-bottom: 1px solid var(--border-color);
}

.ccb-section-header:not(:first-child) {
    border-top: 1px solid var(--border-color);
}

.ccb-show-more {
    padding: var(--space-sm) var(--space-md);
    text-align: center;
    font-size: 12px;
    color: var(--color-primary);
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
}

.ccb-show-more:hover {
    background: var(--bg-tile-soft);
}

.ccb-show-all-link {
    display: block;
    padding: var(--space-sm) var(--space-md);
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
    border-top: 1px solid var(--border-color);
    transition: background var(--transition-fast), color var(--transition-fast);
}

.ccb-show-all-link:hover {
    background: var(--bg-tile-soft);
    color: var(--color-primary);
}

.user-info-link:hover {
    background: var(--color-primary-hover);
}

.logout {
    background: var(--color-error);
}

.logout:hover {
    background: var(--color-error-hover);
}

/* =========================
   LAYOUT / CONTAINER
   ========================= */

/* (Globale input[type="text"]-Regel entfernt am 23.04.2026 — CSS-Tech-Debt-
   Etappe A. Formular-Felder nutzen jetzt .user-form-control als Standard,
   Tabellen-spezifische Overrides sind scoped.) */

/* .ticket-container ausgelagert nach pages/tickets.css (28.04.2026). */

/* ---------- Container-Helper (RM-49a, 02.05.2026) ----------
   Globale Wrapper-Klassen fuer Page-Content. Nutzen die
   --container-max-*-Tokens aus design-tokens.css und schrumpfen
   auf schmalen Viewports automatisch ueber width: 100%.

   Verwendung in neuen Pages:
     <div class="container">          Standardseite (1400er)
     <div class="container-wide">     Listen mit vielen Spalten (1600er)
     <div class="container-narrow">   Forms, Login, Profile (960er)
     <div class="container-fluid">    volle Browser-Breite, kein Padding

   Bestehende Klassen (.dashboard-container, .customers-container,
   .page-container-wide, .ticket-container) bleiben separat — sind
   aber jetzt ebenfalls auf die Tokens migriert. RM-49b kann Module
   bei Bedarf auf die generischen Helper umstellen.
   ----------------------------------------------------------- */
.container,
.container-wide,
.container-narrow,
.container-fluid {
    width: 100%;
    margin-inline: auto;
    padding-inline: var(--container-padding-inline);
    box-sizing: border-box;
}
.container        { max-width: var(--container-max-default); }
.container-wide   { max-width: var(--container-max-wide); }
.container-narrow { max-width: var(--container-max-narrow); }
.container-fluid  { max-width: 100%; padding-inline: 0; }

/* ---------- Responsive Grid-Helper (RM-49a, 02.05.2026) ----------
   Generische 2-/3-Spalten-Grids, die auf schmalen Viewports auf
   weniger Spalten schalten. RM-49b kann diese Klassen modulweit
   einsetzen, statt jede Page eigene Media-Queries zu schreiben.

   Breakpoints folgen --bp-s (600) und --bp-m (960) aus
   design-tokens.css Sektion 11 (siehe auch _context/redesign/
   09_responsive_audit.md Sektion 4).
   ----------------------------------------------------------------- */
.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
}
.grid-3col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--space-lg);
}
@media (max-width: 959px) {
    .grid-2col { grid-template-columns: 1fr; }
    .grid-3col { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 599px) {
    .grid-3col { grid-template-columns: 1fr; }
}

.customers-container {
    max-width: var(--container-max-xwide);
    margin: var(--space-xl) auto;
    padding-inline: var(--container-padding-inline);
    box-sizing: border-box;
}

.dashboard-container {
    max-width: var(--container-max-wide);
    margin: var(--space-xl) auto;
    padding-inline: var(--container-padding-inline);
    box-sizing: border-box;
}

.page-container-wide {
    max-width: var(--container-max-wide);
    margin: var(--space-xl) auto;
}

.content-box {
    background: var(--bg-card);
    padding: var(--space-sm-plus) var(--space-sm-plus);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-sm-plus);
    box-shadow: var(--shadow-sm);
}

.content-box.p-0 {
    padding: 0;
}

.content-box--airy {
    padding: var(--space-lg) var(--space-lg);
}

.content-box h3 {
    margin-top: var(--space-xs);
}

/* =========================
   DASHBOARD-Block ausgelagert nach pages/dashboard.css (28.04.2026).
   .dashboard-container bleibt hier (auch profile/index.php nutzt sie).
   ========================= */

/* -------------------------------------------------------
   UNIVERSAL COLLAPSIBLE — wiederverwendbar auf allen Seiten
   Wrapper: .collapsible  |  Header: .collapsible-header
   Body:    .collapsible-body  |  Icon: .collapse-toggle
   Zustand: .collapsed auf dem Wrapper klappt den Body zu.
   ------------------------------------------------------- */
.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm-plus) var(--space-md-plus);
    background: var(--bg-nav);
    color: var(--color-light);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    cursor: pointer;
    user-select: none;
}

.collapsible-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: inherit;
}

.collapse-toggle {
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    width: 24px;
    text-align: center;
}

.collapsible-body {
    max-height: 4000px;
    overflow: hidden;
    transition: max-height var(--transition-base), padding var(--transition-base);
}

.collapsed .collapsible-body {
    max-height: 0;
}

.collapsed .collapsible-header {
    border-radius: var(--radius-lg);
}

/* Flush-Fix: Collapsible bündig in content-box.p-0 */
.content-box.p-0 {
    overflow: hidden;
}

.widget-count {
    background: rgba(255,255,255,0.2);
    padding: var(--space-2xs) var(--space-sm);
    border-radius: var(--radius-xl);
    font-size: 13px;
    font-weight: 500;
}

/* WIDGET TICKET-ROWS + wt-* + Sneak-Preview + widget-empty/birthday/footer
   ausgelagert nach pages/dashboard.css (28.04.2026). */

/* Upload-Overlay — zentraler Spinner + Fortschritt, Seite abgedunkelt */
.upload-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-tooltip);
}
.upload-overlay.hidden {
    display: none;
}
.upload-overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
}
.upload-overlay-text {
    color: var(--color-light);
    font-size: 15px;
    font-weight: 500;
}
.upload-overlay-progress {
    color: var(--color-light);
    font-size: 22px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Schritt-fuer-Schritt-Anleitungen (Admin-Pages mit nummerierter Liste). */
.anleitung-list {
    line-height: 1.8;
    padding-left: var(--space-lg);
}

/* Konditions-Tabelle in customers/view.php Konditions-Tab:
   - td vertical-align top, damit bei mehrzeiligen Werten
     (Sub-Liste pro Anschrift) die Buttons + Datum nicht in der
     vertikalen Mitte schweben
   - max-width-Cap der globalen .data-table.compact-Wert-Spalte
     (400px) wird aufgehoben — die Wert-Spalte soll den Platz
     fuellen, der durch den .customers-container (xwide) frei wird.
     Spalten 1/3/4 haben feste Breiten (180/120/180), der Rest
     gehoert Spalte 2.
   - Spalte 1 (Kondition) ein bisschen mehr Padding-Top, damit
     der Label-Text optisch auf Hoehe der ersten Sub-Listen-Zeile
     bleibt (kompensiert die Sub-Listen-Border-Top). */
.conditions-table td {
    vertical-align: top;
}
/* Globale .data-table.compact-Regel hat width:auto — fuer die
   Konditions-Tabelle wollen wir 100% Container-Breite. Plus margin
   linksbuendig statt zentriert. */
.conditions-table.data-table.compact {
    width: 100%;
    min-width: 0;
    margin-left: 0;
    margin-right: 0;
}
.conditions-table.data-table.compact td:nth-child(2),
.conditions-table.data-table.compact th:nth-child(2) {
    max-width: none;
}

/* Konditions-Tabelle in customers/view.php Konditions-Tab:
   Inline-Detail-Liste pro Anschrift bei Anfahrts-Kondition. */
.condition-sub-list {
    list-style: none;
    margin: var(--space-xs) 0 0 0;
    padding: var(--space-xs) 0 0 0;
    border-top: 1px dashed var(--border-light);
    font-size: 12px;
    line-height: 1.5;
}
.condition-sub-list li {
    padding: 2px 0;
}
.condition-sub-label {
    color: var(--text-secondary);
    font-weight: 500;
    margin-right: var(--space-xs-plus);
}

/* Travel-Pauschale-Tabelle im Anfahrts-Konditions-Dialog
   (customers/view.php, RM-47-Folge 02.05.2026): Liste aller
   Anschriften mit Inline-Eingabe der Pauschale. */
.travel-flat-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: var(--space-xs);
}
.travel-flat-table th,
.travel-flat-table td {
    padding: var(--space-xs) var(--space-sm);
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.travel-flat-table th {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-table-stripe);
}
.travel-flat-table tbody tr:last-child td {
    border-bottom: none;
}
.travel-flat-amount-col {
    width: 140px;
}
.travel-flat-input {
    width: 100%;
    box-sizing: border-box;
    padding: var(--space-xs) var(--space-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--bg-input);
    color: var(--text-primary);
}
.travel-flat-input:focus {
    border-color: var(--color-accent);
    outline: none;
}

/* Progress-Bar (schmaler, gebrandeter Fortschrittsbalken) +
   Live-Log-Pre (gescrollte Status-Box) — wiederverwendbar fuer
   Bulk-Operationen mit Frontend-Schleife (RM-47 Backfill etc.). */
.progress-track {
    height: 8px;
    background: var(--surface-soft);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--color-success);
    transition: width .3s;
}
.log-pre {
    max-height: 240px;
    overflow: auto;
    background: var(--surface-soft);
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    margin: 0;
    scroll-behavior: smooth;
}

/* Inline-Spinner (kleiner Dual-Ring) — passt in Button-Beschriftung
   und neben Form-Felder. Nutzt dieselben Tokens wie .loader. */
.spinner-inline {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: var(--radius-full);
    border: 2px solid;
    border-color: var(--color-loader-track) var(--color-loader-track) var(--color-primary) var(--color-primary);
    box-sizing: border-box;
    animation: rotation 0.8s linear infinite;
    vertical-align: -2px;
    flex: 0 0 auto;
}

/* Loader — globaler Spinner (Dual-Ring, gebrandet)
   Außen + innen: hellgrau (statt #FFF, weil unsichtbar auf hellem Overlay)
   Mitte: brand-blau (statt #FF3D00) */
.loader {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    display: inline-block;
    position: relative;
    border: 3px solid;
    border-color: var(--color-loader-track) var(--color-loader-track) transparent transparent;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    flex: 0 0 auto;
}

.loader::after,
.loader::before {
    content: '';
    box-sizing: border-box;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    margin: auto;
    border: 3px solid;
    border-color: transparent transparent var(--color-primary) var(--color-primary);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    animation: rotationBack 0.5s linear infinite;
    transform-origin: center center;
}

.loader::before {
    width: 32px;
    height: 32px;
    border-color: var(--color-loader-track) var(--color-loader-track) transparent transparent;
    animation: rotation 1.5s linear infinite;
}

@keyframes rotationBack {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(-360deg); }
}

@keyframes rotation {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Fullscreen-Overlay — Seiten-Loader (z.B. Test-Tools, Imports) */
.fullscreen-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay-light);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-tooltip);
}
.fullscreen-overlay-inner {
    text-align: center;
}
.fullscreen-overlay .loader {
    transform: scale(1.5625);
}

/* =========================
   ADMIN / WIDGET-KATALOG
   ========================= */

.widget-admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
}

.widget-admin-col h3 {
    margin: 0 0 var(--space-md) 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-primary);
}

/* =========================
   PROFIL / WIDGET-CONFIG
   ========================= */

.widget-config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
}

/* Profile-Widget-Config 2col -> 1col Schwelle (RM-49b, 02.05.2026).
   Bei < --bp-m (960) klappt die System-/User-Widgets-Doppelspalte um.
   Auf Surface @ 200% (1440) bleibt 2-spaltig. */
@media (max-width: 959px) {
    .widget-config-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
}

.widget-config-col h4 {
    margin: 0 0 var(--space-md) 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-primary);
}

.widget-config-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm-plus);
}

.widget-config-item {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.widget-config-item select {
    flex: 1;
    padding: var(--space-sm) var(--space-sm-plus);
    font-size: 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    outline: none;
}

/* Native-Picker-Items explizit faerben — Browser-Default ist
   schwarz auf weiss und bleibt es auch im Dark-Mode wenn man
   nichts setzt. */
.widget-config-item select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

.widget-config-item select option:disabled {
    color: var(--text-subtle);
}

.widget-config-item select:focus {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-focus);
}

/* .btn-remove-slot wird im Markup IMMER mit .btn-danger kombiniert.
   Der Doppelklassen-Selector erhoeht die Spezifitaet, sodass das
   Square-Layout (32x32, padding 0, flex-center) das spaeter im File
   stehende .btn-danger (padding/display/line-height fuer Standard-
   Buttons) ueberschreibt. */
.btn-remove-slot,
.btn-remove-slot.btn-danger {
    flex-shrink: 0;
    width: var(--space-3xl);
    height: var(--space-3xl);
    font-size: var(--font-size-lg);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.btn-remove-slot:hover {
    border-color: var(--color-error);
    color: var(--color-error);
}

.btn-add-slot {
    background: none;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 13px;
    padding: var(--space-xs-plus) var(--space-md);
    cursor: pointer;
    width: 100%;
    transition: border-color var(--transition-fast), color var(--transition-fast);
}

.btn-add-slot:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* =========================
   OVERLAY
   ========================= */

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* z-index: var(--z-modal) — sonst kann ein gehoverter Trigger
       (z.B. Status-Badge mit data-tooltip → z-index: --z-dropdown beim
       Hover) durch das offene Overlay durchscheinen, bis die Maus den
       Hover-State verlässt. */
    z-index: var(--z-modal);
    background: var(--bg-overlay);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--space-xl);
}

.hidden {
    display: none;
}

/* =========================
   INFO BOXES
   ========================= */

.info-box {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    border-left: 4px solid;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

/* info-box-Familie — Naming-Refactor 02.05.2026 (vorheriger Stand:
   info-box-info war historisch gruen, was den Klassennamen widersprach;
   info-box-danger und -error waren Aliase). Jetzt sauber:
     - info-box-info     → Pastell-Blau   (Hinweis, Erklaer-Box)
     - info-box-success  → Pastell-Gruen  (Erfolgsmeldung)
     - info-box-warning  → Pastell-Gelb   (Achtung, vorsichtige Aktion)
     - info-box-error    → Pastell-Rot    (Fehler, Stoerung)
   info-box-danger ist ABGESCHAFFT — die einzige Live-Verwendung
   (twofa_settings.php) wurde semantisch korrekt auf -warning migriert. */
.info-box-info {
    background: var(--color-info-soft);
    border-color: var(--color-info-soft-border);
}

.info-box-success {
    background: var(--color-success-soft);
    border-color: var(--color-success);
}

.info-box-warning {
    background: var(--color-warning-soft);
    border-color: var(--color-warning);
}

.info-box-error {
    background: var(--color-error-soft);
    border-color: var(--color-error);
}

/* =========================
   UTILITY
   ========================= */

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-actions {
    text-align: right;
}

/* Modifier fuer Form-Action-Zeilen, die direkt unter einem Grid/List stehen
   und visuellen Abstand brauchen (ersetzt bisherige style="margin-top:var(--space-md-plus)"). */
.form-actions-spaced {
    margin-top: var(--space-md-plus);
}

.site-footer {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    padding-bottom: var(--space-xs);
}

.text-muted {
    color: var(--text-muted);
}

.overlay-box {
    background: var(--bg-card);
    padding: var(--space-3xl-minus);
    border-radius: var(--radius-xl);
    min-width: 300px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.overlay-box input[type="text"] {
    box-sizing: border-box;
    padding: var(--space-sm);
    font-size: 14px;
}

.clickable {
    cursor: pointer;
    transition: all var(--transition-fast);
}

.clickable:hover {
    filter: brightness(1.1);
}

/* .status-overlay-box ausgelagert nach pages/tickets.css. */

.overlay-field {
    margin-top: var(--space-lg);
}

.overlay-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-size: 14px;
    color: var(--text-muted);
    text-align: left;
}

.overlay-select {
    width: 100%;
    box-sizing: border-box;
    padding: var(--space-sm-plus) var(--space-md);
    font-size: 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-secondary);
    outline: none;
}

.overlay-select:focus {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-focus);
}

/* RM-53: Faelligkeits-Zeile im Properties-Overlay — Datum-Input
   schmaler + Reset-Button rechts daneben (X-Icon zum Leeren). */
.overlay-due-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}
.overlay-due-row .overlay-due-input {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 220px;
}

.overlay-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm-plus);
    margin-top: var(--space-lg-plus);
}

/* TICKET — DETAIL (Ticket-Header/Meta/Status/QuickStatus/Contact/Title/Desc)
   ausgelagert nach pages/tickets.css (28.04.2026).
   Generische .is-loading-Regel fuer button/btn-save/btn-action bleibt hier. */

button.is-loading,
.btn-save.is-loading,
.btn-action.is-loading {
    opacity: 0.5;
    pointer-events: none;
    cursor: wait;
}

.clickable-value,
.clickable-value:visited {
    color: inherit;
    cursor: pointer;
    text-decoration: none;
    border-bottom: 1px dashed var(--border-strong);
}

.clickable-value:hover,
.clickable-value:visited:hover {
    text-decoration: none;
    border-bottom-color: var(--color-primary);
    color: var(--color-primary);
}

/* .ticket-title*, .ticket-desc-*, .internal-notes-box ausgelagert
   nach pages/tickets.css. */

@keyframes tooltip-fade-right {
    from { opacity: 0; transform: translateY(-3px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* .ticket-description, #descText ausgelagert nach pages/tickets.css. */

/* #descText.is-expanded, .desc-expand-toggle*
   ausgelagert nach pages/tickets.css. */

/* opacity sitzt bewusst auf dem SVG-Child, NICHT auf dem .edit-icon-
   Container — sonst legt das Container-Element einen opacity-Stacking-
   Context an, in dem auch das Tooltip-Pseudo-Element ::after gerendert
   wird. Im Default-State (60%) waere das Tooltip dann mit-gedimmt; auch
   beim Hover-Wechsel auf 100% kann es subtile Render-Verzoegerungen
   geben. Mit opacity nur auf dem SVG ist das Tooltip immer voll sichtbar. */
.edit-icon,
.edit-icon:visited {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 32px;
    min-height: 32px;
    cursor: pointer;
    margin-left: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.edit-icon svg {
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.edit-icon:hover svg {
    opacity: 1;
}

.table-edit-icon,
.table-edit-icon:visited {
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
    color: var(--text-secondary);
}

.table-edit-icon svg {
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.table-edit-icon:hover svg {
    opacity: 1;
}
button.table-delete-icon {
    background: none;
    border: none;
    padding: 0;
}
.table-delete-icon:hover {
    color: var(--color-error);
}

.editable {
    cursor: pointer;
    transition: background var(--transition-fast);
}

.editable:hover {
    background: rgba(0,0,0,0.05);
}

.inline-input {
    width: 100%;
    padding: var(--space-sm);
    font-size: 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-strong);
}

.inline-textarea {
    width: 100%;
    min-height: 150px;
    padding: var(--space-sm-plus);
    font-size: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-strong);
    resize: vertical;
    line-height: 1.5;
}

.inline-actions {
    margin-top: var(--space-sm);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm-plus);
}

/* =========================
   STATUS BADGE
   ========================= */

.status-badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-sm-plus);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    background: var(--status-color);
    /* Subtiler Border, damit helle Status-Farben auf weissem Card-BG
       als Element erkennbar bleiben (3:1 non-text contrast). 15% Alpha
       wirkt nicht hart, gibt aber die Konturen. Token --border-status-badge
       handhabt Light/Dark-Wechsel automatisch (RM-45 Phase 2). */
    border: 1px solid var(--border-status-badge);
}
.status-badge-success { background: var(--color-success); color: var(--color-light); }
.status-badge-danger  { background: var(--color-error); color: var(--color-light); }
.status-badge-warning { background: var(--color-warning-soft); color: var(--color-warning-dark); }

/* KOMMENTARE, TICKET-TABS-BAR, DOKUMENTE/ATTACHMENTS, UPLOADS
   ausgelagert nach pages/tickets.css (28.04.2026). */

/* =========================
   KUNDEN
   ========================= */

.customer-item {
    padding: var(--space-sm);
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    text-align: left;
}

.customer-item:hover {
    background: var(--bg-hover);
}

.customer-item.is-active {
    background: var(--color-success-soft);
}
.customer-item.is-active:hover {
    background: var(--color-success-soft-border);
}

/* Customer/Contact-Such-Overlay — Such-Input und Hint-Zeilen */
.overlay-search-input {
    padding: var(--space-sm);
    margin-bottom: var(--space-sm-plus);
    width: 100%;
    box-sizing: border-box;
    background: var(--bg-input);
    color: var(--text-primary);
}
.overlay-result-list {
    max-height: 360px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
}
.overlay-actions {
    margin-top: var(--space-sm-plus);
    display: flex;
    gap: var(--space-sm);
}
.customer-search-hint {
    padding: var(--space-sm);
    color: var(--text-muted);
    font-style: italic;
}
.customer-search-noresult {
    padding: var(--space-sm);
    color: var(--text-muted);
}

/* Customer-Typeahead (Ticket-Create) */
.customer-typeahead {
    position: relative;
}
/* Hinweis: Kein Dropdown-Pfeil mehr — das Feld ist ein Typeahead, kein Select.
   Beim Tippen öffnet sich der Ergebnis-Dropdown automatisch. */
.customer-typeahead-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    max-height: 250px;
    overflow-y: auto;
    z-index: var(--z-sticky);
    box-shadow: var(--shadow-md);
}
.customer-typeahead-dropdown.is-open {
    display: block;
}
.customer-typeahead-dropdown .customer-search-hint {
    padding: var(--space-sm-plus) var(--space-md);
    background: var(--color-info-soft);
    color: var(--color-info-dark);
    font-style: normal;
    font-size: 13px;
}
.input-error {
    border-color: var(--color-error) !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-error) 20%, transparent);
}

/* .customer-header*, .btn-context-set, .ccb-active-indicator
   ausgelagert nach pages/customers.css (28.04.2026). */

/* Aktions-Bereich oberhalb von Listen (z.B. customers/index.php) */
.list-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: var(--space-md);
}

.list-actions:last-child {
    margin-bottom: 0;
}

/* =========================
   FILTER-SYSTEM (tickets/list.php, customers/index.php)
   ========================= */

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    align-items: center;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    background: var(--bg-hover);
    color: var(--text-secondary);
    padding: var(--space-xs) var(--space-xs) var(--space-xs) var(--space-sm-plus);
    border-radius: var(--radius-xl);
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

.filter-chip-remove {
    margin-left: var(--space-xs-plus);
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    transition: background var(--transition-fast), color var(--transition-fast);
}

.filter-chip-remove:hover {
    background: var(--color-error);
    color: var(--color-light);
}

/* Filter-Bar (immer offen, kompakt) */
.filter-bar-open {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    padding: var(--space-md) var(--space-md-plus);
    margin-bottom: var(--space-md);
}

.filter-form {
    /* leerer Hook — Form selber hat keine zusätzliche Padding */
}

/* Top-Row: Zeitraum + Volltextsuche prominent */
.filter-top-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-lg);
    align-items: start;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-light);
}

/* Filter-Top-Row responsive (RM-49b, 02.05.2026): bei < --bp-s (600)
   Zeitraum + Volltextsuche untereinander statt nebeneinander, sonst
   quetscht das Datumsfeld die Suche zu eng. */
@media (max-width: 599px) {
    .filter-top-row {
        grid-template-columns: 1fr;
    }
}

.filter-top-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.filter-top-search input[type="text"] {
    width: 100%;
}

.filter-search-row {
    display: flex;
    gap: var(--space-xs-plus);
    align-items: center;
}

.filter-search-row input {
    flex: 1;
    min-width: 0;
}

.filter-search-btn {
    background: var(--color-primary);
    color: var(--color-light);
    border: none;
    border-radius: var(--radius-md);
    padding: var(--space-xs-plus) var(--space-sm-plus);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
}

.filter-search-btn:hover {
    background: var(--color-primary-hover);
}

/* Granulares Filter-Grid (kompakt, label links, input rechts) */
.filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm) var(--space-2xl);
    margin-bottom: var(--space-md);
}

/* Filter-Grid responsive (RM-49b, 02.05.2026): bei < --bp-m (960)
   klappt die 2-Spalten-Filterleiste auf 1-spaltig. Auf Surface @
   1440 bleibt 2-spaltig. */
@media (max-width: 959px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }
}

.filter-col {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs-plus);
}

.filter-row {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: var(--space-sm-plus);
    align-items: center;
}

.filter-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.filter-row .filter-label {
    margin: 0;
    text-align: right;
}

.filter-row select,
.filter-row input {
    width: 100%;
    box-sizing: border-box;
    padding: var(--space-xs) var(--space-sm);
    font-size: 13px;
}

.filter-date-range {
    display: flex;
    align-items: center;
    gap: var(--space-xs-plus);
}

.filter-date-range input[type="date"] {
    width: auto;
    flex: 0 0 auto;
    padding: var(--space-sm) var(--space-sm-plus);
    font-size: 16px;
    box-sizing: border-box;
}

.filter-date-range span {
    font-size: 14px;
    color: var(--text-muted);
}

.filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm-plus);
    align-items: center;
    padding-top: var(--space-xs-plus);
}

/* .ticket-row-ap + .ap-link ausgelagert nach pages/tickets.css. */

/* .ap-link:hover + .ap-popover* ausgelagert nach pages/tickets.css. */

/* Sortier-Links in Tabellen-Headern
   Permanent sichtbarer ↕-Pfeil via ::after signalisiert: Spalte ist sortierbar.
   Bei aktiver Sortierung wird das Icon zu ↑ oder ↓ und farbig hervorgehoben. */
.sort-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs-plus);
    cursor: pointer;
    padding: var(--space-2xs) var(--space-xs-plus);
    margin: calc(var(--space-2xs) * -1) calc(var(--space-xs-plus) * -1);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast), color var(--transition-fast);
    user-select: none;
}

.sort-link::after {
    content: '↕';
    font-size: 11px;
    opacity: 0.35;
    font-weight: 400;
    line-height: 1;
}

.sort-link:hover {
    background: var(--bg-hover);
    color: var(--color-primary);
}

.sort-link:hover::after {
    opacity: 0.7;
}

.sort-link.active {
    color: var(--color-primary);
    font-weight: 700;
}

.sort-link.active::after {
    opacity: 1;
    color: var(--color-primary);
}

.sort-link.active.asc::after  { content: '↑'; }
.sort-link.active.desc::after { content: '↓'; }

.empty-list {
    text-align: center;
    color: var(--text-muted);
    padding: var(--space-2xl);
    font-style: italic;
}

/* .customer-details-2col + .customer-grid ausgelagert nach pages/customers.css. */

#contactList {
    max-height: 250px;
    overflow-y: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: var(--space-sm-plus);
}

.data-table th {
    text-align: left;
    border-bottom: 2px solid var(--border-color);
    padding: var(--space-sm);
}

.data-table td {
    text-align: left;
    padding: var(--space-sm);
    border-bottom: 1px solid var(--border-light);
}

.data-table tr.male td:first-child {
    color: var(--color-primary);
}

.data-table tr.female td:first-child {
    color: var(--color-error);
}

.data-table tr.row-inactive td {
    opacity: 0.55;
}

.data-table tbody tr:nth-child(even) {
    background-color: var(--bg-table-stripe);
}

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

/* Kompakte Tabellenvariante — z.B. admin/pools.php */
.data-table.compact {
    width: auto;
    min-width: 480px;
    margin: var(--space-sm-plus) auto 0;
}

/* Modifier: Tabelle nimmt die volle Containerbreite (erbt aus .data-table).
   table-layout:fixed sorgt dafür, dass w-XXX strikt eingehalten werden
   (im Auto-Layout würden die Spalten über ihre Nennbreite hinaus wachsen).
   Die Spalte OHNE w-XXX bekommt im fixed-Layout den gesamten Rest — das
   ist die Flex-Spalte. Wichtig: Jede Nicht-Flex-Spalte MUSS eine w-XXX
   auf dem TH haben, sonst teilen sich mehrere Nicht-Flex-Spalten den Rest
   gleichmäßig (Symptom: Flex-Spalte zu schmal). */
.data-table.table-full {
    width: 100%;
    margin: var(--space-sm-plus) 0 0;
    table-layout: fixed;
}

/* Inputs in .table-full füllen die Zelle sauber aus.
   min-width:0 ist essenziell: ohne das kann der Browser die intrinsische
   Input-Breite (Browser-Default ~180px) gegen das fixed-Layout ausspielen
   und die Zelle sprengen. Padding/Margin/Font-Size werden bewusst
   feiner als .user-form-control gesetzt (kompakter Tabellen-Look). */
.data-table.table-full input[type="text"],
.data-table.table-full input[type="number"] {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: var(--space-xs-plus) var(--space-sm);
    font-size: 14px;
}

.data-table.compact td:nth-child(2),
.data-table.compact th:nth-child(2) {
    min-width: 200px;
    max-width: 400px;
}

.data-table.compact input[type="text"] {
    width: 220px;
    box-sizing: border-box;
}

.statuses-box {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

/* Statuses-Tabelle (admin/statuses.php) — eigene Override-Klasse */
.statuses-table .col-farbe    { width: 80px; }
.statuses-table .col-tickets  { width: 90px; text-align: right; }
.statuses-table .col-sort     { width: 80px; text-align: center; }
.statuses-table .col-actions  { width: 50px; }
.statuses-table .statuses-col-tickets {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.statuses-table .statuses-col-sort {
    text-align: center;
    white-space: nowrap;
}
.statuses-table .statuses-col-muted { color: var(--text-subtle); }
/* Nach ID-Spalte-Entfernung: Name ist erste Spalte — Override der allgemeinen
   .data-table.compact-Regel die auf nth-child(2) zielt */
.statuses-table td:first-child,
.statuses-table th:first-child {
    min-width: 200px;
    max-width: 400px;
}
.statuses-table .status-name.is-readonly {
    background: var(--bg-hover);
    color: var(--text-secondary);
    cursor: not-allowed;
}
.statuses-save-row { margin-top: var(--space-md-plus); }

/* =========================
   ADMIN
   ========================= */

/* Admin Top-Nav: .admin-topnav* CSS-Block geloescht am 13.05.2026 abends.
   Admin nutzt jetzt das gemeinsame .workspace-subnav-Pattern (siehe Z. ~600)
   mit den Modifiern .is-end und .is-danger fuer den Test-Tools-Sonderfall.
   Markup-Aenderung in app/includes/admin_nav.php. */

/* Admin Layout: Sidebar links angeklebt, Content browser-mittig.
   3-Spalten-Grid: linker Spacer enthaelt die Sidebar (220px, justify-self: start),
   mittlere Spalte ist der Content (max 1380px), rechter Spacer.
   Beide Spacer sind 1fr — symmetrisch, also Content zentriert relativ zum Browser.
   Bei Breiten <~1820px wird Content zwangslaeufig gegen die Sidebar gedrueckt
   (linke Spalte clamped auf min 220), bei <1600px schrumpft Content mit. */
.admin-layout {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(0, var(--container-max-admin)) minmax(0, 1fr);
    min-height: calc(100vh - 200px);
}

.admin-layout.no-sidebar {
    grid-template-columns: 1fr;
    max-width: var(--container-max-wide);
    margin: 0 auto;
}

/* Admin Sidebar — klebt am linken Browserrand */
.admin-sidebar {
    width: 220px;
    justify-self: start;
    border-right: 1px solid var(--border-color);
    background: var(--bg-table-head);
    padding: var(--space-lg) 0;
}

.admin-sidebar nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-2xs);
    padding: 0 var(--space-sm-plus);
}

.admin-sidebar nav a {
    display: block;
    padding: var(--space-sm-plus) var(--space-md-plus);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.admin-sidebar nav a:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
    text-decoration: none;
}

.admin-sidebar nav a.active {
    background: var(--color-primary);
    color: var(--color-light);
    font-weight: 500;
}

/* Eingerueckte Sub-Eintraege (z.B. Mapping pro Monitoring-Quelle).
   Visueller Indikator: linker Border + erhoehtes Padding-Left. */
.admin-sidebar nav a.indented {
    margin-left: var(--space-md);
    padding-left: var(--space-md);
    border-left: 2px solid var(--border-color);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    font-size: 13px;
    color: var(--text-muted);
}

.admin-sidebar nav a.indented:hover {
    color: var(--text-secondary);
}

.admin-sidebar nav a.indented.active {
    color: var(--color-light);
    border-left-color: var(--color-primary);
}

/* Admin Content (innerhalb des Layouts) */
.admin-content,
.contracts-content,
.articles-content,
.timetracking-content {
    padding: var(--space-xl) 30px;
    min-width: 0;
}

/* Admin: .content-box-Untergrenze fuer Lesefluss.
   Unter dieser Box-Breite lieber horizontalen Scroll als unlesbares
   Layout. Nur fuer Admin-Bereich, globale .content-box-Verwendung
   (Tickets, Kunden, Dashboard) bleibt unangetastet. */
.admin-content .content-box {
    min-width: 1100px;
}

/* Admin-Content responsive (RM-49b, 02.05.2026): bei < --bp-m (960)
   wird die min-width-Bremse aufgehoben — Admin auf schmalem
   Tablet/Smartphone ist Notfall-Use-Case, lieber lesbares 1-spaltiges
   Layout als horizontales Scrollen ueberm gesamten Admin-Bereich.
   Ueber 960 (Surface @ 1440 etc.) bleibt die 1100er-Untergrenze. */
@media (max-width: 959px) {
    .admin-content .content-box {
        min-width: 0;
    }
}

/* =========================
   COLOR PICKER
   ========================= */

.color-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.color-preview {
    width: 32px;
    height: 24px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    cursor: pointer;
}

/* =========================
   COLOR PICKER (neu)
   ========================= */

.color-picker-box {
    width: 320px;
    padding: 0;
    overflow: hidden;
}

.color-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md-plus) var(--space-lg-plus);
    border-bottom: 1px solid var(--border-light);
}

.color-picker-header h3 {
    margin: 0;
    font-size: 16px;
}

.color-picker-body {
    padding: var(--space-lg) var(--space-lg-plus);
}

.color-picker-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm-plus);
    padding: var(--space-md) var(--space-lg-plus);
    border-top: 1px solid var(--border-light);
    background: var(--bg-table-stripe);
}

/* Saturation/Value-Quadrat */
.picker-sv {
    position: relative;
    width: 100%;
    height: 180px;
    border-radius: var(--radius-md);
    cursor: crosshair;
    user-select: none;
    background: red;
}

.picker-sv-indicator {
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid var(--bg-card);
    border-radius: var(--radius-full);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.4);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* Hue-Slider */
.picker-hue {
    position: relative;
    margin-top: var(--space-md);
    height: 14px;
    border-radius: var(--radius-md);
    background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
    cursor: pointer;
    user-select: none;
}

.picker-hue-indicator {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 18px;
    border: 2px solid var(--bg-card);
    border-radius: var(--radius-sm);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.4);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* Vorschau + HEX */
.picker-preview-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-top: var(--space-md-plus);
}

.picker-preview {
    width: 56px;
    height: 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-strong);
    flex: 0 0 auto;
}

.picker-preview-meta {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-2xs);
}

.picker-preview-meta label {
    font-size: 11px;
    color: var(--text-muted);
}

.color-picker-box .picker-preview-meta input[type="text"] {
    width: 100%;
    padding: var(--space-xs-plus) var(--space-sm);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 14px;
    text-transform: lowercase;
    box-sizing: border-box;
}

/* RGB-Felder */
.picker-rgb-row {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-sm-plus);
}

.picker-rgb-field {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2xs);
}

.picker-rgb-field label {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
}

.picker-rgb-field input {
    padding: var(--space-xs-plus) var(--space-xs);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 14px;
    text-align: center;
    box-sizing: border-box;
    min-width: 0;
}

/* Presets */
.picker-presets {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--space-xs-plus);
    margin-top: var(--space-md-plus);
}

.picker-preset {
    width: 100%;
    aspect-ratio: 1;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 0;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.picker-preset:hover {
    transform: scale(1.1);
    border-color: var(--color-primary);
}

/* Sortier-Pfeile in Status-Tabelle */
.btn-sort {
    display: inline-block;
    width: 26px;
    height: 24px;
    padding: 0;
    border: 1px solid var(--border-strong);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 11px;
    line-height: 1;
    /* 1px horizontaler Margin bewusst — Micro-Spacing zwischen
       inline-block-Buttons in Status-Tabellen-Sortier-Reihen. */
    margin: 0 1px;
}

.btn-sort:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-sort:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* =========================
   BUTTONS
   ========================= */

.btn-action,
.btn-action:visited {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs-plus);
    background: var(--color-primary);
    color: var(--color-light);
    border: none;
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    box-sizing: border-box;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.btn-action:hover,
.btn-action:visited:hover,
a.btn-action:hover,
a.btn-action:visited:hover {
    background: var(--color-primary-hover);
    color: var(--color-light);
    text-decoration: none;
}

.btn-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
    padding: 0;
}
.btn-icon:hover { background: var(--bg-hover); }
/* btn-disabled: Optik-Dimming auf SVG/Inhalt setzen, NICHT auf den Button
   selbst — sonst erben die ::after/::before-Pseudos (z.B. Tooltips) die
   Opacity und werden unlesbar. */
.btn-icon.btn-disabled { cursor: not-allowed; opacity: 1; }
.btn-icon.btn-disabled > * { opacity: 0.35; }
.btn-icon-warning { color: var(--color-warning); border-color: var(--color-warning); }
.btn-icon-warning:hover { background: var(--color-warning-soft); }
.btn-icon-danger { color: var(--color-error); border-color: var(--color-error); }
.btn-icon-danger:hover { background: var(--color-error-soft); }
.btn-icon-success { color: var(--color-success); border-color: var(--color-success); }
.btn-icon-success:hover { background: var(--color-success-soft); }

/* btn-icon-lg: groessere Variante (40x40 mit 20px-Icon) fuer Card-Layouts,
   wo der Standard-32x32-Button neben prominentem Card-Inhalt zu klein wirkt.
   SVG-Sizing per CSS, damit das width/height-Attribut im SVG nicht
   geaendert werden muss. */
.btn-icon-lg { width: 40px; height: 40px; }
.btn-icon-lg > svg { width: 20px; height: 20px; }

/* btn-action-warning: Pastell-Warning-Variante, Geometrie 1:1 wie
   btn-save / btn-cancel / btn-danger (selbe Hoehe, selber radius,
   selbes padding). Theme-aware via warning-soft / -soft-border /
   -dark Tokens. Verwendet z.B. fuer 'Test-Mail senden' — eine
   neutrale Probe-Action, weder neutral-grau (btn-secondary) noch
   destruktiv (btn-danger). */
.btn-action-warning,
.btn-action-warning:visited {
    background: var(--color-warning-soft);
    border: 1px solid var(--color-warning-soft-border);
    padding: var(--space-xs-plus) var(--space-md);
    border-radius: var(--radius-sm);
    color: var(--color-warning-dark);
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
    font: inherit;
    line-height: 1.5;
    box-sizing: border-box;
}
.btn-action-warning:hover:not(:disabled),
.btn-action-warning:visited:hover:not(:disabled) {
    background: var(--color-warning-soft-border);
    color: var(--color-warning-dark);
    text-decoration: none;
}
.btn-action-warning:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Mail-Settings-spezifisches Side-by-Side-Layout fuer SMTP + Absender.
   Flex statt Grid, damit die Boxen bei schmaler Container-Breite
   sauber umbrechen statt aus dem Container zu ragen (war Bug
   02.05.2026 mit form-grid-2col + verschachtelter user-form-grid). */
.mail-settings-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}
.mail-settings-row > .content-box {
    flex: 1 1 460px;
    min-width: 0;
    margin-bottom: 0;
}
/* Innen-Form-Grid kompakter (140 statt 200 Label-Spalte, kleinere
   Min-Wert), damit zwei Boxen nebeneinander passen ohne Ueberlauf. */
.mail-settings-row .user-form-grid {
    grid-template-columns: 140px minmax(0, 1fr);
    column-gap: var(--space-md);
}

.btn-action-light,
.btn-action-light:visited {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs-plus);
    background: rgba(255,255,255,0.15);
    color: var(--color-light);
    border: 1px solid rgba(255,255,255,0.4);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition-fast);
}

.btn-action-light:hover,
.btn-action-light:visited:hover {
    background: rgba(255,255,255,0.3);
    color: var(--color-light);
    text-decoration: none;
}

.btn-action-light.btn-active {
    background: rgba(255,255,255,0.9);
    color: var(--color-primary);
    border-color: rgba(255,255,255,0.9);
    font-weight: 600;
}

/* -------------------------------------------------------
   SCROLL-TO-TOP BUTTON
   ------------------------------------------------------- */
.scroll-to-top {
    position: fixed;
    bottom: var(--space-2xl);
    right: var(--space-2xl);
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-full);
    background: var(--bg-nav);
    color: var(--color-light);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), visibility var(--transition-base);
    z-index: var(--z-sticky);
}

.scroll-to-top svg {
    fill: var(--color-light);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background: var(--color-accent);
}

/* -------------------------------------------------------
   TOGGLE SWITCH — Aktiv/Inaktiv Pill
   ------------------------------------------------------- */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    vertical-align: middle;
}

.toggle-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-track {
    position: relative;
    width: 76px;
    height: 28px;
    background: var(--text-subtle);
    border-radius: var(--radius-xl);
    transition: background var(--transition-base);
}

.toggle-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    transition: transform var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.toggle-label-on,
.toggle-label-off {
    position: absolute;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    top: 50%;
    transform: translateY(-50%);
    transition: opacity var(--transition-fast);
    pointer-events: none;
    line-height: 1;
}

.toggle-label-on {
    left: var(--space-sm);
    color: var(--color-light);
    opacity: 0;
}

.toggle-label-off {
    left: var(--space-3xl-minus);
    color: var(--color-light);
    opacity: 1;
}

.toggle-switch input:checked + .toggle-track {
    background: var(--color-success);
}

.toggle-switch input:checked + .toggle-track .toggle-knob {
    transform: translateX(48px);
}

.toggle-switch input:checked + .toggle-track .toggle-label-on {
    opacity: 1;
}

.toggle-switch input:checked + .toggle-track .toggle-label-off {
    opacity: 0;
}

/* Toolbar-Variante eines Selects mit gleicher Höhe/Padding wie .btn-save —
   für Toolbars, in denen Select + Button nebeneinander stehen sollen
   (z.B. Year-Picker + "neu laden"-Button auf /timetracking/holidays.php).
   Höhen-Match dadurch dass Padding + line-height identisch zu .btn-save sind. */
.toolbar-select {
    padding: var(--space-xs-plus) var(--space-md);
    line-height: 1.5;
    width: auto;
}

/* Outline-Style: heller Hintergrund + etwas dunklere Outline; bei Hover
   wechselt der Hintergrund komplett auf die Outline-Farbe.
   Text-Farbe success-dark (#2d6e0f) liefert auf success-soft (#d4edda)
   ~9:1 Kontrast und auf der Hover-Outline (#a3d3ad) ~5:1 — beides gut
   lesbar. */
.btn-save,
.btn-save:visited {
    background: var(--color-success-soft);
    border: 1px solid var(--color-success-soft-border);
    padding: var(--space-xs-plus) var(--space-md);
    border-radius: var(--radius-sm);
    color: var(--color-success-dark);
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
    font: inherit;
    line-height: 1.5;
    box-sizing: border-box;
}

.btn-save:hover,
.btn-save:visited:hover {
    background: var(--color-success-soft-border);
    color: var(--color-success-dark);
    text-decoration: none;
}

/* btn-cancel + btn-danger: Pastell-Rot, dezent — gleiches Pattern wie
   .btn-save, nur in der Error-Farbpalette. Stand 01.05.2026 (vorher
   Vollton-Rot mit weißer Schrift, vor allem im Dark-Mode zu grell).
   Die Farbe rot bleibt als „Achtung, vorsichtige Aktion".
   Geometrie 1:1 wie .btn-save.

   Beide Klassen sind aktuell visuell identisch — geteilte Regel statt
   Code-Duplikation. Semantisch unterschiedlich verwendet:
   - btn-cancel: Eingaben verwerfen / Dialog abbrechen (neben btn-save).
   - btn-danger: destruktive Aktion (Löschen, Archivieren), oft mit
                 data-confirm-Bestätigung.
   Wenn eine Variante später divergieren soll (z.B. btn-danger mit
   Mülleimer-Icon), gezielt nachdefinieren — die geteilte Basis bleibt. */
.btn-cancel,
.btn-cancel:visited,
.btn-danger,
.btn-danger:visited {
    background: var(--color-error-soft);
    border: 1px solid var(--color-error-soft-border);
    padding: var(--space-xs-plus) var(--space-md);
    border-radius: var(--radius-sm);
    color: var(--color-error);
    cursor: pointer;
    /* Damit Anchor und Button identisch aussehen */
    display: inline-block;
    text-decoration: none;
    font: inherit;
    line-height: 1.5;
    box-sizing: border-box;
}

.btn-cancel:hover:not(:disabled),
.btn-cancel:visited:hover:not(:disabled),
.btn-danger:hover:not(:disabled),
.btn-danger:visited:hover:not(:disabled) {
    background: var(--color-error-soft-border);
    color: var(--color-error);
    text-decoration: none;
}
.btn-cancel:disabled,
.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-disabled {
    background: var(--bg-hover);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    cursor: not-allowed;
}

.btn-disabled:hover {
    background: var(--bg-hover);
}

.btn-secondary,
.btn-secondary:visited {
    background: var(--bg-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: var(--space-xs-plus) var(--space-md);
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font: inherit;
    line-height: 1.5;
    box-sizing: border-box;
}

.btn-secondary:hover,
.btn-secondary:visited:hover {
    background: var(--bg-table-stripe);
    text-decoration: none;
}

.btn-edit-members {
    background: var(--bg-hover);
    color: var(--color-primary);
    border: 1px solid var(--border-color);
    padding: var(--space-xs) var(--space-sm-plus);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 13px;
}

.btn-edit-members:hover {
    background: var(--bg-table-stripe);
}

/* Pool-Overlay Tabs */
/* View-Tabs — Kartei-Reiter die auf der content-box aufsitzen */
.view-tabs-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.view-tabs-bar .view-tabs {
    border-bottom: none;
}

.view-tabs-bar + .view-tab-content {
    border-top: 1px solid var(--border-color);
}

/* Input mit Textbaustein-Button inline (visoma-Pattern) */
.input-wrap-snippet {
    position: relative;
    display: flex;
}

.input-wrap-snippet input,
.input-wrap-snippet textarea {
    flex: 1 1 auto;
    min-width: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.btn-snippet-inline {
    flex: 0 0 auto;
    width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--color-primary);
    border-left: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: var(--bg-card);
    color: var(--color-primary);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.btn-snippet-inline:hover:not(:disabled) {
    background: var(--color-primary);
    color: var(--color-light);
}

.btn-snippet-inline:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.view-tabs-actions {
    display: flex;
    gap: var(--space-sm);
    padding-bottom: var(--space-xs-plus);
}

.required-star {
    color: var(--color-error);
    font-weight: 700;
}

/* Kunden-Tickets-Box in ticket_create (Kunde-Tab) */
.customer-tickets-box {
    margin-top: var(--space-lg);
    padding: var(--space-md-plus) var(--space-lg);
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.customer-tickets-list {
    max-height: 220px;
    overflow-y: auto;
}

.badge-primary {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-primary);
    background: color-mix(in srgb, var(--color-primary) 10%, transparent);
    padding: var(--space-2xs) var(--space-sm);
    border-radius: var(--radius-sm);
    margin-left: var(--space-xs-plus);
}

.view-tabs {
    display: flex;
    gap: 0;
    padding: 0;
    border-bottom: 1px solid var(--border-color);
}

/* View-Tabs auf schmalen Viewports (RM-49b, 02.05.2026): bei < --bp-s
   (600) horizontaler Scroll statt Wrap, Tabs bleiben in einer Zeile.
   Industrie-Pattern fuer mobile Tab-Bars. Auf Surface @ 1440 (oder
   1024 Tablet) bleibt alles wie heute. */
@media (max-width: 599px) {
    .view-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }
}

.view-tab-btn,
.view-tab-btn:visited {
    padding: var(--space-sm-plus) var(--space-2xl);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    box-sizing: border-box;
    color: var(--text-muted);
    text-decoration: none;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    /* border-bottom bleibt bewusst drin (keine Ueberschreibung mit none).
       Damit hat jeder inaktive Tab seine eigene sichtbare Unterkante —
       Hintergrund #e9ecef kann sie nicht ueberdecken, weil die Border
       ausserhalb der Background-Area liegt. Der aktive Tab setzt
       border-bottom: 1px solid var(--bg-card) (siehe .view-tab-btn.active) und
       wirkt dadurch weiterhin "nach unten offen" zum Content-Bereich. */
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin-right: var(--space-xs);
    /* -1px bewusst — zieht inaktive Tabs auf die Oberkante des aktiven
       Tabs (Border-Bottom-Alignment fuer Kartei-Reiter-Effekt). */
    margin-bottom: -1px;
    cursor: pointer;
    font-family: inherit;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.view-tab-btn:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
    text-decoration: none;
}

.view-tab-btn.active,
.view-tab-btn.active:visited {
    color: var(--color-primary);
    font-weight: 600;
    background: var(--bg-card);
    border-bottom: 1px solid var(--bg-card);
}

/* Layout-Shift-Schutz: das ::before-Pseudo-Element reserviert dauerhaft
   die Breite der bold-Variante (active state). Container-Breite ist damit
   konstant — kein "Ruckeln" der Nachbar-Tabs beim Aktivieren, weil der
   font-weight-Wechsel von 500 (inactive) auf 600 (active) sonst die
   Tab-Breite minimal aendert.
   data-label wird per JS aus dem Text-Content gefuellt (siehe app.js). */
.view-tab-btn::before {
    content: attr(data-label);
    display: block;
    font-weight: 600;
    height: 0;
    overflow: hidden;
    visibility: hidden;
}

.view-tab-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: visible;
}

.view-tab-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm-plus) var(--space-lg);
    min-height: 27px;
    background: var(--color-primary);
    color: var(--color-light);
}

.view-tab-section-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: inherit;
}

.view-tab-section-header .widget-count {
    color: var(--color-text-on-nav-soft);
}

.view-tab-body {
    padding: var(--space-xl);
}

.view-tab-panel.hidden {
    display: none;
}

/* ============================================================
   COMPACT VIEW-TABS — kleinere/schmalere Variante
   Nutzung: <div class="view-tabs view-tabs-compact" data-tab-param="...">
   Mechanik (data-tab / data-tab-panel / .active / .hidden) bleibt
   identisch zu .view-tabs — der bestehende JS-Handler greift weiter.
   Nur Geometrie ist kompakter (kleineres Padding, kleinere Schrift,
   kleinere obere Rundung) — sinnvoll bei vielen Tabs in einer Bar
   (z.B. Berechtigungs-Kategorien in admin/group_edit + user_edit).
   ============================================================ */
.view-tabs-compact .view-tab-btn {
    padding: var(--space-xs-plus) var(--space-md);
    font-size: 13px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

/* 2-Spalten Formular-Grid (Ticket-Create, etc.) */
.form-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 var(--space-2xl);
}

/* Form-Grid-2col responsive (RM-49b, 02.05.2026): generisches
   2-Spalten-Form-Grid (tickets/create.php Typ+Prio, Pool+
   Bearbeiter). Bei < --bp-s (600) auf 1-spaltig — sonst
   quetschen sich Selects unter 280 px Spaltenbreite. */
@media (max-width: 599px) {
    .form-grid-2col {
        grid-template-columns: 1fr;
        gap: var(--space-md) 0;
    }
}

.pool-overlay-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: var(--space-md-plus);
    gap: 0;
}

.pool-tab-btn {
    padding: var(--space-sm) var(--space-lg-plus);
    font-size: 13px;
    font-weight: 500;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: calc(var(--space-2xs) * -1);
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.pool-tab-btn:hover {
    color: var(--text-secondary);
}

.pool-tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    font-weight: 600;
}

.pool-tab-content {
    min-height: 80px;
}

.members-checkbox-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-xs);
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
    cursor: pointer;
}

.members-checkbox-row:last-child {
    border-bottom: none;
}

.members-checkbox-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--color-primary);
}

/* =========================
   MESSAGES (Fallback — wird per JS zu Toast konvertiert)
   ========================= */

.msg {
    display: none;
}

/* =========================
   TOAST NOTIFICATIONS
   ========================= */

#toast-container {
    position: fixed;
    top: 64px;
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-tooltip);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm-plus);
    pointer-events: none;
    width: max-content;
    max-width: 90vw;
}

.toast {
    pointer-events: all;
    min-width: 280px;
    max-width: 520px;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: var(--space-sm-plus);
    box-shadow: var(--shadow-md);
    animation: toast-slide-in 0.3s ease forwards;
}

.toast.toast-hiding {
    animation: toast-slide-out 0.3s ease forwards;
}

@keyframes toast-slide-in {
    from { opacity: 0; transform: translateY(-16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes toast-slide-out {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-16px); }
}

/* ============== B7 Stacked-Notification-Toasts ==============
   Container oben rechts, max 3 Toasts visuell sichtbar mit dezentem
   Tiefen-Effekt (Y-Offset, Scale-Down, Opacity-Reduktion fuer hintere
   Karten). Hover faechert auf — alle Karten in voller Hoehe sichtbar.
   Klick = Ticket oeffnen + mark-as-read. Auto-Dismiss 5s, pausiert
   waehrend Hover. */
#notif-toast-stack {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    width: 360px;
    /* Hoehe wird per CSS-State bestimmt — collapsed reicht der vorderste
       Toast + leichter Stack-Offset, expanded faechert auf ~380px auf.
       Container ist nur sichtbar wenn mind. 1 Toast drin (.has-toasts). */
    min-height: 0;
    z-index: var(--z-toast, 11000);
    pointer-events: none;
}
#notif-toast-stack.has-toasts {
    pointer-events: auto;
    min-height: 110px; /* Hover-Area fuer den gestackten Zustand */
}

.notif-toast {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    box-sizing: border-box;
    padding: var(--space-md) var(--space-md-plus);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm-plus);
    pointer-events: all;
    cursor: pointer;
    transform-origin: top center;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                opacity   0.28s ease,
                box-shadow 0.2s ease;
}

/* Slide-In: neuer Toast kommt von rechts rein. */
.notif-toast.is-entering {
    transform: translateX(120%);
    opacity: 0;
}

/* Verlassens-Animation. */
.notif-toast.is-hiding {
    transform: translateX(120%) !important;
    opacity: 0 !important;
}

/* Stack-Positionen — collapsed (default).
   pos-0 = vorderster Toast, voll sichtbar. pos-1/2 = hinten, leicht
   nach hinten/oben und kleiner skaliert (Tiefen-Andeutung). */
.notif-toast.is-pos-0 { transform: translateY(0)   scale(1);    opacity: 1;    z-index: 3; }
.notif-toast.is-pos-1 { transform: translateY(8px) scale(0.96); opacity: 0.85; z-index: 2; }
.notif-toast.is-pos-2 { transform: translateY(16px) scale(0.92); opacity: 0.7; z-index: 1; }
.notif-toast.is-pos-hidden { opacity: 0; pointer-events: none; transform: translateY(20px) scale(0.9); z-index: 0; }

/* Hover: Stack faechert auf — Toasts liegen untereinander, voll lesbar. */
#notif-toast-stack.is-expanded .notif-toast.is-pos-0 { transform: translateY(0)    scale(1); opacity: 1; }
#notif-toast-stack.is-expanded .notif-toast.is-pos-1 { transform: translateY(94px) scale(1); opacity: 1; }
#notif-toast-stack.is-expanded .notif-toast.is-pos-2 { transform: translateY(188px) scale(1); opacity: 1; }
#notif-toast-stack.is-expanded .notif-toast.is-pos-hidden { transform: translateY(282px) scale(0.96); opacity: 0.5; }

/* Hover: leichtes Heben des direkten Items unter Maus. */
.notif-toast:hover { box-shadow: var(--shadow-xl, 0 10px 30px rgba(0,0,0,0.15)); }

/* Aggregator-Toast ("+N weitere") — etwas dezenter visuell. */
.notif-toast-aggregator {
    background: var(--bg-table-stripe, var(--bg-card));
    color: var(--text-secondary);
}
.notif-toast-aggregator .notif-line {
    font-weight: 500;
    color: var(--text-primary);
}
.notif-toast-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Inhaltliche Stile reuse aus dem Notification-Center, hier kompakt. */
.notif-toast .notif-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--color-info-soft);
    color: var(--color-primary);
}
.notif-toast .notif-body { flex: 1; min-width: 0; line-height: 1.4; }
.notif-toast .notif-line { font-size: 13px; color: var(--text-primary); }
.notif-toast .notif-line strong { color: var(--text-primary); }
.notif-toast .notif-ticket {
    margin-top: 2px;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Höhe des Containers fuer Hover-Auffaecher-Modus etwas schaetzen,
   damit der Mouse-Hover-Bereich sich nicht fuehlt wie ein Sprung. */
#notif-toast-stack.is-expanded { min-height: 380px; }
/* ============== /B7 ============== */

.toast-icon {
    font-size: 15px;
    flex-shrink: 0;
    font-weight: bold;
}

.toast-text {
    flex: 1;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    padding: 0 0 0 var(--space-sm);
    flex-shrink: 0;
    opacity: 0.5;
}

.toast-close:hover {
    opacity: 1;
}

.toast-success {
    background: var(--color-success-soft);
    color: var(--color-success-dark);
    border-left: 4px solid var(--color-success);
}

.toast-success .toast-close { color: var(--color-success-dark); }

.toast-error {
    background: var(--color-error-soft);
    color: var(--color-error);
    border-left: 4px solid var(--color-error);
}

.toast-error .toast-close { color: var(--color-error); }

.toast-warning {
    background: var(--color-warning-soft);
    color: var(--color-warning-dark);
    border-left: 4px solid var(--color-warning);
}

.toast-warning .toast-close { color: var(--color-warning-dark); }

.toast-info {
    background: var(--color-info-soft);
    color: var(--color-info-dark);
    border-left: 4px solid var(--color-primary);
}

.toast-info .toast-close { color: var(--color-info-dark); }

/* =========================
   PAGINIERUNG
   ========================= */

.pagination-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-xs-plus) 0;
    font-size: 12px;
}

.pagination-info {
    color: var(--text-muted);
    font-size: 12px;
}

.pagination {
    display: flex;
    gap: var(--space-xs);
    align-items: center;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 var(--space-xs);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 12px;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.page-btn:hover {
    background: var(--bg-hover);
    border-color: var(--text-subtle);
    text-decoration: none;
}

.page-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-light);
    font-weight: 600;
    pointer-events: none;
}

.page-btn.disabled {
    color: var(--text-subtle);
    pointer-events: none;
    background: var(--bg-table-stripe);
}

.page-btn-all {
    margin-left: var(--space-xs);
    font-size: 11px;
    font-weight: 500;
}

.page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    color: var(--text-muted);
    font-size: 12px;
}

/* GRUPPEN & BERECHTIGUNGEN + PERMISSION OVERRIDE TOGGLE
   ausgelagert nach pages/admin.css (28.04.2026). */

/* Bool-Toggle — 2-State-Variante (aktiv/inaktiv) für system_settings */
.bool-toggle {
    display: inline-flex;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    background: var(--bg-hover);
    transition: border-color var(--transition-fast);
}

.bool-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    pointer-events: none;
    transition: transform 0.25s var(--ease-standard), background-color var(--transition-base);
    z-index: 0;
}

.bool-toggle[data-state="1"] .bool-slider {
    transform: translateX(0%);
    background-color: var(--color-success);
}

.bool-toggle[data-state="0"] .bool-slider {
    transform: translateX(100%);
    background-color: var(--text-subtle);
}

.bool-toggle-btn {
    flex: 1 1 0;
    padding: var(--space-xs) var(--space-lg-plus);
    font-size: 13px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-right: 1px solid var(--border-color);
    transition: color var(--transition-fast), border-color var(--transition-base);
    white-space: nowrap;
    text-align: center;
    position: relative;
    z-index: var(--z-base);
}

.bool-toggle-btn:last-of-type {
    border-right: none;
}

.bool-toggle-btn:hover {
    color: var(--text-secondary);
}

.bool-toggle-btn.active {
    color: var(--color-light);
    font-weight: 600;
    border-right-color: transparent;
}

.bool-toggle-btn:has(+ .active) {
    border-right-color: transparent;
}

/* perm-group-indicator + content-box.perm-box ausgelagert nach pages/admin.css. */

/* =========================
   BENUTZER-FORMULAR
   ========================= */

.input-valid {
    border: 1px solid var(--color-success) !important;
    border-radius: var(--radius-md);
}

.input-invalid {
    border: 1px solid var(--color-error) !important;
    border-radius: var(--radius-md);
}

.user-form-grid {
    display: grid;
    /* Min 420px für den Content-Bereich wie bisher, wächst aber bis zur
       Container-Breite mit — verhindert ungewolltes Umbrechen bei langen
       Beschreibungs-Texten neben Inputs (admin/security.php etc.).
       Inputs mit .user-form-control bleiben durch deren max-width:400px
       optisch gleich, auch wenn die Zelle breiter wird. */
    grid-template-columns: 200px minmax(420px, 1fr);
    column-gap: var(--space-xl);
    row-gap: var(--space-md-plus);
    align-items: center;
}

/* Responsive Schwelle (RM-49b, 02.05.2026): unter --bp-s (600) klappt
   das 200+420-Grid (= 620 Mindestbreite) zwangslaeufig — das ganze
   Form auf 1-spaltig stellen, Label kommt ueber den Input. Reicht fuer
   Smartphone-Quer und schmale Tablets. */
@media (max-width: 599px) {
    .user-form-grid {
        grid-template-columns: 1fr;
        row-gap: var(--space-xs);
        align-items: start;
    }
    .user-form-grid .user-form-label {
        margin-top: var(--space-sm);
    }
}

.user-form-label {
    color: var(--text-muted);
    text-align: left;
    margin: 0;
}

.user-form-control,
.user-form-grid select,
.user-form-grid input[type="text"],
.user-form-grid input[type="password"] {
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    margin: 0;
    padding: var(--space-sm) var(--space-sm-plus);
    font-size: 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
}

.user-form-grid select {
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-secondary);
    outline: none;
}

.user-form-grid select:focus {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-focus);
}

.user-form-checkbox-wrap {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    height: 100%;
}

.user-form-checkbox-wrap input[type="checkbox"] {
    margin: 0;
}

.profile-field-readonly {
    background: var(--bg-hover);
    color: var(--text-muted);
    border-color: var(--border-color);
    cursor: not-allowed;
}

.password-input-wrap {
    position: relative;
    width: 420px;
}

.password-input-wrap input[type="password"] {
    width: 100% !important;
    box-sizing: border-box;
    margin: 0;
    padding: var(--space-sm) 36px var(--space-sm) var(--space-sm-plus);
    font-size: 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
}

.password-input-wrap .password-toggle {
    position: absolute;
    top: 50%;
    right: var(--space-sm);
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    opacity: 0.65;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-base);
}

.password-input-wrap .password-toggle:hover {
    opacity: 1;
}

.password-toggle svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-muted);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.toggle-password {
    cursor: pointer;
    font-size: 16px;
    opacity: 0.6;
}

.toggle-password:hover {
    opacity: 1;
}

/* =========================
   HTML5 DIALOG
   ========================= */

dialog {
    border: none;
    border-radius: var(--radius-xl);
    padding: 0;
    max-width: 680px;
    width: 95vw;
    max-height: calc(100vh - 40px);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: var(--bg-card);
    color: var(--text-primary);
}

/* Dialog als Flex-Container — Header und Footer fixiert oben/unten,
   Body füllt den verbleibenden Platz und scrollt selbst. So sind die
   Buttons IMMER sichtbar, auch auf kleinen Screens (Surface, iPad). */
dialog[open] {
    display: flex;
    flex-direction: column;
}

/* Form innerhalb Dialog ist nur Wrapper für Submit — soll Layout
   nicht beeinflussen, damit body+footer direkte Flex-Kinder bleiben. */
dialog[open] form {
    display: contents;
}

/* Body-Scroll sperren wenn ein Dialog offen ist — verhindert das
   Mit-Scrollen der Hintergrundseite (wirkt sonst unruhig). */
html:has(dialog[open]) body {
    overflow: hidden;
}

dialog::backdrop {
    background: var(--bg-overlay);
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg-plus) var(--space-2xl);
    border-bottom: 1px solid var(--border-light);
    flex: 0 0 auto;
}

.dialog-close-btn {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    padding: 0 var(--space-xs);
}

.dialog-close-btn:hover {
    color: var(--text-primary);
}

/* Browser fokussiert nach <dialog>.showModal() automatisch das erste
   fokussierbare Element (typischerweise diesen ×-Close-Button) — der
   Outline-Ring sah optisch stoerend aus. Bei Maus-Klick (=focus, aber
   nicht :focus-visible) blenden wir den Ring aus, bei Keyboard-Tab
   (=:focus-visible) bleibt er sichtbar (A11y). */
.dialog-close-btn:focus:not(:focus-visible) {
    outline: none;
}

.dialog-body {
    padding: var(--space-xl) var(--space-2xl);
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm-plus);
    padding: var(--space-md-plus) var(--space-2xl);
    border-top: 1px solid var(--border-light);
    background: var(--bg-table-stripe);
    flex: 0 0 auto;
}

.dialog-footer-between {
    justify-content: space-between;
}

.dialog-section {
    margin-bottom: var(--space-2xl);
}

.dialog-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-xs-plus);
    border-bottom: 1px solid var(--border-light);
}

.dialog-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.dialog-grid .full-width {
    grid-column: 1 / -1;
}

.dialog-grid-narrow {
    grid-template-columns: 140px 1fr;
}

/* Dialog-Grids responsive (RM-49b, 02.05.2026): bei < --bp-s (600)
   klappen Modal-Form-Spalten auf 1-spaltig. Greift global fuer alle
   <dialog>-Forms (Customer-Adresse/Kontakt/Bank/Konditionen, ggf.
   Ticket-Properties etc.). Auf Surface @ 1440 Querformat bleibt
   2-spaltig. */
@media (max-width: 599px) {
    .dialog-grid,
    .dialog-grid-narrow {
        grid-template-columns: 1fr;
    }
}

/* RM-18 Quick-Win C — breitere Variante des Standard-Dialogs fuer
   Read-Only Detail-Overlays (Asset-Detail). Erbt sonst alles aus dialog. */
dialog.dialog-wide {
    max-width: 880px;
    width: 90vw;
}

/* Asset-Detail: Definition-Grid (label/value 2-spaltig). */
.kv-grid {
    display: grid;
    grid-template-columns: 180px 1fr;
    row-gap: var(--space-xs-plus);
    column-gap: var(--space-md);
    margin: 0;
}
.kv-grid dt {
    color: var(--text-subtle);
    font-size: 13px;
    margin: 0;
}
.kv-grid dd {
    margin: 0;
    word-break: break-word;
}

/* Verknuepfte Tickets im Asset-Detail */
.asset-ticket-list,
.asset-audit-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.asset-ticket-list li,
.asset-audit-list li {
    padding: var(--space-xs-plus) 0;
    border-bottom: 1px dashed var(--border-light);
}
.asset-ticket-list li:last-child,
.asset-audit-list li:last-child {
    border-bottom: 0;
}

.dialog-field-col {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm-plus);
    justify-content: center;
}

.dialog-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.dialog-field input[type="text"],
.dialog-field input[type="email"],
.dialog-field input[type="number"],
.dialog-field input[type="url"],
.dialog-field input[type="password"],
.dialog-field input[type="tel"],
.dialog-field input[type="search"],
.dialog-field select,
.dialog-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: var(--space-sm) var(--space-sm-plus);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-input);
    transition: border-color var(--transition-fast);
}

.dialog-field input:focus,
.dialog-field select:focus,
.dialog-field textarea:focus {
    border-color: var(--color-accent);
    outline: none;
    box-shadow: var(--shadow-focus);
}

/* Mono-Variante fuer technische Felder (URL, API-Key, Token) — hilft
   beim visuellen Scannen ob sich z.B. ein Slash oder ein Sonderzeichen
   versteckt. Wird per Klasse aktiviert, nicht via type-Selector. */
.dialog-field input.input-mono,
.dialog-field input.input-mono:focus {
    font-family: var(--font-mono, ui-monospace, "SF Mono", Consolas, "Courier New", monospace);
    font-size: 13px;
    letter-spacing: 0;
}

.dialog-checkbox-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 14px;
    cursor: pointer;
}

/* .btn-edit-contact wurde 24.04.2026 entfernt — ersetzt durch
   .btn-icon / .btn-icon-danger Row-Action-Pattern (siehe Buttons-
   Sektion weiter oben). Keine Call-Sites mehr im PHP/JS. */

/* =========================
   GROUP-CHANGE WARNING DIALOG
   ========================= */

.dialog-header--warning {
    background: var(--bg-table-head);
    border-bottom: 1px solid var(--border-color);
    border-left: 4px solid var(--color-warning);
}

.dialog-header--warning h3 {
    color: var(--color-warning);
    margin: 0;
    font-size: 16px;
}

.warning-dialog-intro {
    margin: 0 0 var(--space-md-plus);
    font-size: 14px;
    color: var(--text-secondary);
}

.warning-perm-list {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-md-plus);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.warning-perm-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm-plus);
    padding: var(--space-sm) var(--space-md-plus);
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
}

.warning-perm-item:last-child {
    border-bottom: none;
}

.warning-perm-item.is-grant {
    background: var(--color-success-soft);
}

.warning-perm-item.is-deny {
    background: var(--color-error-soft);
}

.warning-perm-icon {
    font-size: 14px;
    font-weight: 700;
    width: 16px;
    text-align: center;
}

.warning-perm-item.is-grant .warning-perm-icon { color: var(--color-success); }
.warning-perm-item.is-deny  .warning-perm-icon { color: var(--color-error); }

.warning-perm-name {
    flex: 1;
    font-weight: 500;
}

.warning-perm-cat {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.warning-dialog-hint {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
}

.group-edit-divider {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: var(--space-2xl) 0;
}

/* ============================================================
   SHUTTLE / DUAL-LISTBOX (group member management)
   ============================================================ */

.shuttle-container {
    display: flex;
    align-items: stretch;
    gap: var(--space-sm-plus);
}

/* Unsichtbarer Container fuer hidden-Inputs im Shuttle — damit das
   Shuttle-JS die aktuelle rechte Liste an ein umschliessendes Form
   synchronisieren kann, ohne den Flex-Layout zu stoeren. */
.shuttle-sync-box {
    display: none;
}

/* Inherited-Options im rechten Shuttle (z.B. Pool-Zugriff ueber Gruppe
   geerbt): disabled + kursiv + Grauton, damit der User sofort sieht dass
   dieser Eintrag nicht direkt bei diesem User liegt. Tooltip ueber title-
   Attribut auf dem <option> weil CSS-Tooltips an <option> nicht greifen. */
.shuttle-list option:disabled {
    color: var(--text-muted);
    font-style: italic;
}

.shuttle-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.shuttle-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs-plus);
}

.shuttle-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.shuttle-search {
    flex: 1;
    min-width: 0;
    padding: var(--space-xs) var(--space-sm);
    font-size: 13px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    background: var(--bg-card);
}

.shuttle-search:focus {
    outline: none;
    border-color: var(--color-primary);
}

.shuttle-list {
    flex: 1;
    min-height: 200px;
    max-height: 320px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: var(--space-xs);
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-card);
    overflow-y: auto;
}

.shuttle-list option {
    padding: var(--space-xs) var(--space-xs-plus);
    border-radius: var(--radius-sm);
}

.shuttle-list option:checked {
    background: var(--color-info-soft);
    color: var(--text-primary);
}

.shuttle-count {
    margin-top: var(--space-xs);
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
}

.shuttle-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs-plus);
    padding: var(--space-3xl-minus) 0 0;  /* offset for header height */
}

.shuttle-btn {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-hover);
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.shuttle-btn:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-light);
}

.badge-no-group {
    font-size: 18px;
    color: var(--text-subtle);
    line-height: 1;
    cursor: default;
}

/* ============================================================
   UNIVERSAL TOOLTIP  (data-tooltip="…")
   ============================================================ */

[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover {
    z-index: var(--z-dropdown);
}

/* Tooltip-Box */
[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: calc(100% + var(--space-sm));
    background: var(--color-primary);
    color: var(--color-light);
    font-size: 12px;
    padding: var(--space-xs) var(--space-sm-plus);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    z-index: var(--z-dropdown);
    pointer-events: none;
    box-shadow: var(--shadow-md);
    animation: tooltip-fade 0.15s ease;
}

/* Pfeil-Caret */
[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: calc(100% + var(--space-2xs));
    border: 5px solid transparent;
    border-bottom-color: var(--color-primary);
    z-index: var(--z-dropdown);
    pointer-events: none;
    animation: tooltip-fade 0.15s ease;
}

@keyframes tooltip-fade {
    from { opacity: 0; transform: translateX(-50%) translateY(-3px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Tooltips am rechten Seitenrand: rechtsbuendig statt zentriert,
   damit sie nicht aus dem Viewport ragen und Scrollbars erzeugen. */
.nav-right [data-tooltip]:hover::after,
.ccb-actions [data-tooltip]:hover::after,
.pagination [data-tooltip]:hover::after,
.customer-header-actions [data-tooltip]:hover::after,
.ticket-meta [data-tooltip]:hover::after,
.ticket-title-row [data-tooltip]:hover::after,
.pending-banner-actions [data-tooltip]:hover::after,
.bpd-actions [data-tooltip]:hover::after,
.article-search-form [data-tooltip]:hover::after,
.contracts-search-form [data-tooltip]:hover::after,
.input-wrap-snippet [data-tooltip]:hover::after,
.contact-select-wrap [data-tooltip]:hover::after {
    left: auto;
    right: 0;
    transform: none;
    animation: tooltip-fade-right 0.15s ease;
}

.nav-right [data-tooltip]:hover::before,
.ccb-actions [data-tooltip]:hover::before,
.pagination [data-tooltip]:hover::before,
.customer-header-actions [data-tooltip]:hover::before,
.ticket-meta [data-tooltip]:hover::before,
.ticket-title-row [data-tooltip]:hover::before,
.pending-banner-actions [data-tooltip]:hover::before,
.bpd-actions [data-tooltip]:hover::before,
.article-search-form [data-tooltip]:hover::before,
.contracts-search-form [data-tooltip]:hover::before,
.input-wrap-snippet [data-tooltip]:hover::before,
.contact-select-wrap [data-tooltip]:hover::before {
    left: auto;
    right: var(--space-sm-plus);
    transform: none;
    animation: tooltip-fade-right 0.15s ease;
}

@keyframes tooltip-fade-right {
    from { opacity: 0; transform: translateY(-3px); }
    to   { opacity: 1; transform: translateY(0); }
}

.twofa-setup-wrap {
    max-width: 640px;
    margin: var(--space-4xl) auto;
    padding: 0 var(--space-lg);
}

.twofa-page-wrap {
    max-width: 900px;
}

/* ==========================================================================
   2FA (Zwei-Faktor-Authentifizierung)
   ========================================================================== */

.twofa-hint {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin: var(--space-md) 0 var(--space-lg-plus);
}
.twofa-hint-small {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: var(--space-xs-plus);
}
.twofa-trust-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 13px;
    color: var(--text-secondary);
    margin: var(--space-md) 0 var(--space-md-plus);
    cursor: pointer;
}
.twofa-trust-checkbox input {
    width: auto;
    margin: 0;
}
.twofa-backup-toggle {
    margin-top: var(--space-xl);
    padding-top: var(--space-md-plus);
    border-top: 1px solid var(--border-light);
}
.twofa-backup-toggle summary {
    cursor: pointer;
    color: var(--color-primary);
    font-size: 13px;
}
.twofa-logout-link {
    text-align: center;
    margin-top: var(--space-md-plus);
    font-size: 12px;
}
.login-btn-alt {
    background: #6c757d;
}
.login-btn-alt:hover {
    background: #5a6268;
}
.twofa-app-list {
    margin: var(--space-sm-plus) 0 var(--space-lg-plus) var(--space-xl);
    padding: 0;
    color: var(--text-secondary);
}
.twofa-qr-container {
    display: flex;
    justify-content: center;
    padding: var(--space-xl);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    margin: var(--space-lg) 0;
}
.twofa-manual-secret {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}
.twofa-manual-secret code {
    display: inline-block;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    letter-spacing: 1px;
    padding: var(--space-xs-plus) var(--space-sm-plus);
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    margin-top: var(--space-xs);
}
.twofa-backup-codes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm-plus);
    padding: var(--space-lg);
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin: var(--space-md-plus) 0;
}
.twofa-backup-codes code {
    display: block;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: 600;
    padding: var(--space-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    letter-spacing: 1px;
}
.twofa-status {
    display: inline-block;
    padding: var(--space-2xs) var(--space-sm-plus);
    border-radius: var(--radius-xl);
    font-size: 12px;
    font-weight: 600;
}
.twofa-status-on      { background: var(--color-success-soft); color: var(--color-success-dark); }
.twofa-status-off     { background: var(--bg-hover); color: var(--text-muted);    }
.twofa-status-pending { background: var(--color-warning-soft); color: var(--color-warning-dark); }

.twofa-admin-status p {
    margin: var(--space-xs) 0;
}
.twofa-admin-actions form { margin: 0; }

.twofa-bypass-box {
    margin-top: var(--space-md-plus);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
    flex-wrap: wrap;
}
.twofa-bypass-text {
    flex: 1;
    min-width: 260px;
}
.twofa-bypass-revoke-form {
    margin: 0;
}

.twofa-explain {
    margin: var(--space-md-plus) 0 var(--space-sm-plus);
    padding: var(--space-md) var(--space-md-plus);
    background: var(--color-info-soft);
    border-left: 3px solid var(--color-primary);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.twofa-explain strong {
    color: var(--color-info-dark);
}

/* Deaktivierte Buttons (generisch fuer data-enable-when-filled-Logik) */
.btn-danger:disabled,
.btn-save:disabled,
.btn-action:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.twofa-nag-dialog {
    max-width: 520px;
}
.twofa-nag-dialog .dialog-body p {
    margin: 0 0 var(--space-sm-plus);
    color: var(--text-secondary);
}

/* ---- Focus-Modus (nur Logo + Logout, keine Nav, kein Customer-Bar) ---- */
body.focus-mode {
    background: var(--bg-focus-page);
    min-height: 100vh;
}
.focus-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg-plus) var(--space-3xl-minus);
    background: var(--bg-nav);
    color: var(--color-light);
    box-shadow: var(--shadow-sm);
}
.focus-header-brand {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}
.focus-header-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.3px;
}
.focus-header-sub {
    font-size: 12px;
    opacity: 0.85;
    font-weight: 400;
}
.focus-header-logout {
    color: var(--color-light);
    text-decoration: none;
    font-size: 13px;
    padding: var(--space-sm) var(--space-lg);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast), border-color var(--transition-fast);
}
.focus-header-logout:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.7);
}
body.focus-mode .site-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    padding: var(--space-xl);
    background: transparent;
    border: none;
}
body.focus-mode hr {
    display: none;
}

/* ---- Print-only Section fuer 2FA-Backup-Codes ---- */
/* Im normalen Browser unsichtbar, beim Drucken wird die Seite darauf reduziert. */
.twofa-print-only {
    display: none;
}
@media print {
    body * {
        visibility: hidden;
    }
    .twofa-print-only,
    .twofa-print-only * {
        visibility: visible;
    }
    .twofa-print-only {
        display: block !important;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        padding: 48px 56px;
        color: var(--text-primary);
        background: var(--bg-card);
        font-family: 'Inter', Arial, sans-serif;
    }
    .twofa-print-only .print-title {
        font-size: 32px;
        font-weight: 700;
        margin: 0 0 var(--space-xs);
    }
    .twofa-print-only .print-subtitle {
        font-size: 18px;
        color: var(--text-secondary);
        margin: 0 0 var(--space-3xl-minus);
    }
    .twofa-print-only .print-meta {
        font-size: 13px;
        color: var(--text-secondary);
        margin: 0 0 var(--space-2xl);
    }
    .twofa-print-only .print-meta strong {
        color: var(--text-primary);
    }
    .twofa-print-only .print-code {
        font-family: 'Courier New', Courier, monospace;
        font-size: 22px;
        font-weight: 600;
        letter-spacing: 3px;
        padding: var(--space-sm-plus) 0;
        border-bottom: 1px dotted var(--text-subtle);
    }
    .twofa-print-only .print-footer {
        margin-top: 34px;
        font-size: 12px;
        color: var(--text-secondary);
        line-height: 1.5;
        border-top: 1px solid var(--border-color);
        padding-top: var(--space-lg);
    }
    /* Seiten-Umbruch sauber halten */
    @page {
        margin: 1.5cm;
    }
}

.btn-small {
    padding: var(--space-xs) var(--space-sm-plus);
    font-size: 12px;
}

/* =====================================================
   ACTIVITY-STREAM (RM-15 Phase 2 — Ticket-Tab "Aktivitäten")
   ===================================================== */
.activities-container {
    padding: var(--space-xs) var(--space-xs-plus) var(--space-xs) 0;
    max-height: 400px;
    overflow-y: auto;
}

.activity-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
    isolation: isolate;
}

.activity-timeline::before {
    content: "";
    position: absolute;
    left: var(--space-md);
    top: var(--space-xs);
    bottom: var(--space-xs);
    width: 2px;
    background: var(--border-light);
}

.activity-item {
    position: relative;
    display: flex;
    gap: var(--space-sm-plus);
    padding: var(--space-xs) 0;
    align-items: center;
}

.activity-icon {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-base);
}

.activity-icon svg {
    width: 12px;
    height: 12px;
}

.activity-body {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: var(--space-sm-plus);
    flex-wrap: wrap;
}

.activity-line {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.4;
    word-wrap: break-word;
    flex: 1;
    min-width: 0;
}

.activity-line em {
    font-style: normal;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-hover);
    padding: 0 var(--space-xs);
    border-radius: var(--radius-sm);
}

.activity-meta {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Monitoring-Mapping-Tabellen — feste Spaltenbreiten in %, damit die
   Zuordnungs-Spalte (Tom-Select) genug Platz fuer den Inhalt + Lupe-
   Symbol hat. table-layout: fixed lockt die Verteilung, sonst macht
   Browser die Spalten gleichmaessig (kurze Customer-Namen kollidieren
   sonst mit der Tom-Select-Lupe in der 3. Spalte). */
/* Defensive: width: 100% explizit damit's nicht von .compact-Geschwistern
   ueberschrieben wird (table-layout: fixed greift nur bei bekannter Breite). */
.monitoring-mapping-table {
    width: 100%;
    table-layout: fixed;
    margin: var(--space-sm-plus) 0 0;
}

/* Customer-Tab: 3 Spalten — Externer Kunde / Externe ID / Zuordnung */
.monitoring-mapping-table--customers th:nth-child(1),
.monitoring-mapping-table--customers td:nth-child(1) { width: 28%; }
.monitoring-mapping-table--customers th:nth-child(2),
.monitoring-mapping-table--customers td:nth-child(2) { width: 14%; }
.monitoring-mapping-table--customers th:nth-child(3),
.monitoring-mapping-table--customers td:nth-child(3) { width: 58%; }

/* Site-Tab: 4 Spalten — Kunde / Externe Site / Externe ID / Zuordnung */
.monitoring-mapping-table--sites th:nth-child(1),
.monitoring-mapping-table--sites td:nth-child(1) { width: 22%; }
.monitoring-mapping-table--sites th:nth-child(2),
.monitoring-mapping-table--sites td:nth-child(2) { width: 22%; }
.monitoring-mapping-table--sites th:nth-child(3),
.monitoring-mapping-table--sites td:nth-child(3) { width: 11%; }
.monitoring-mapping-table--sites th:nth-child(4),
.monitoring-mapping-table--sites td:nth-child(4) { width: 45%; }

/* Word-Wrap fuer lange Strings in den schmalen Spalten — sonst sprengt
   ein langer Customer-Name die Tabelle. */
.monitoring-mapping-table td {
    word-break: break-word;
}

/* Monitoring-Recovery-Aktivitaet: dezent rot hinterlegt, damit sie
   im Stream heraussticht. Theme-aware ueber --color-error-soft
   (Pastell-Token aus RM-45) + Border-Akzent. */
.activity-item-monitoring {
    background: var(--color-error-soft);
    border-left: 3px solid var(--color-error);
    border-radius: var(--radius-sm);
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
}

.activity-item-monitoring .activity-icon {
    border-color: var(--color-error);
    color: var(--color-error);
}

/* =====================================================
   SEARCHABLE SELECT — Tom Select Overrides (RM-31)
   ===================================================== */

/* Wrapper erbt die Breite des Containers */
.ts-wrapper,
.ts-wrapper.user-form-control {
    width: 100%;
    padding: 0;
}

/* Geschlossener Zustand — angelehnt an .ccb-search-input */
.ts-wrapper .ts-control {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    /* Padding rechts groesser, damit das Lupe+Caret-Symbol Platz hat
       und nicht ueber dem Inhalt liegt. */
    padding: var(--space-xs-plus) calc(var(--space-sm-plus) + 34px) var(--space-xs-plus) var(--space-sm-plus);
    font-size: 13px;
    background: var(--bg-table-head);
    min-height: 0;
    box-shadow: none;
    cursor: pointer;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
    /* Vendor-CSS setzt color: #303030 -> dark-on-dark im Dark-Mode unlesbar.
       Theme-aware Override fuer Control + ausgewaehlte .item-Anzeige + input. */
    color: var(--text-primary);
}

/* Lupe + kleiner Caret rechts im ts-control — signalisiert dass das
   Feld sowohl klick-Auswahl als auch Freitext-Suche unterstuetzt.
   SVG inline als background-image (data-URI). Farbe ist Light-default
   #444 (kraeftig auf hellem BG); Dark-Override via [data-theme=dark]
   weiter unten. */
.ts-wrapper .ts-control::after {
    content: '';
    position: absolute;
    right: var(--space-sm-plus);
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 16px;
    pointer-events: none;
    background-repeat: no-repeat;
    background-position: left center, right center;
    background-size: 14px 14px, 10px 10px;
    background-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23444'><path d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0'/></svg>"),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23444'><path d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708'/></svg>");
}

/* Wenn Dropdown offen: Caret weg, nur Lupe behalten (Such-Modus). */
.ts-wrapper.dropdown-active .ts-control::after {
    background-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23444'><path d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0'/></svg>");
    background-size: 14px 14px;
    background-position: center;
}

/* Dark-Mode: helle Icons auf dunklem BG (Hex %23ccc statt %23444). */
:root[data-theme="dark"] .ts-wrapper .ts-control::after {
    background-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ccc'><path d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0'/></svg>"),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ccc'><path d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708'/></svg>");
}
:root[data-theme="dark"] .ts-wrapper.dropdown-active .ts-control::after {
    background-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ccc'><path d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0'/></svg>");
}
.ts-wrapper .ts-control .item,
.ts-wrapper .ts-control > input {
    color: var(--text-primary);
}

.ts-wrapper .ts-control > input {
    font-size: 13px;
}

/* Focus-State — wie .ccb-search-input:focus */
.ts-wrapper.focus .ts-control {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-focus);
    background: var(--bg-input);
}

/* Wenn Dropdown offen: nahtloser Uebergang zum Dropdown */
.ts-wrapper.focus.dropdown-active .ts-control {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border-bottom-color: transparent;
    box-shadow: none;
}

/* Dropdown — wie .ccb-search-results */
.ts-dropdown {
    border: 1px solid var(--border-color);
    border-top: 0;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-md);
    box-sizing: border-box;
    z-index: var(--z-sticky);
    margin: 0;
    left: 0;
    right: 0;
    width: auto;
    background: var(--bg-card);
    color: var(--text-primary);
}

.ts-dropdown-content {
    max-height: 250px;
}

/* Options — kein display:flex (zerstoert Whitespace bei Highlight-Spans) */
.ts-dropdown .option {
    padding: var(--space-2xs) var(--space-md);
    min-height: 28px;
    font-size: 13px;
    line-height: 20px;
    color: var(--text-primary);
}

.ts-dropdown .option.active {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.ts-dropdown .option:hover {
    background: var(--bg-hover);
}

/* Optgroup-Labels */
.ts-dropdown .optgroup-header {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: var(--space-sm) var(--space-md) var(--space-xs);
    background: transparent;
}

/* Suchfeld im Dropdown (dropdown_input Plugin) —
   globales input { margin:var(--space-xs); padding:var(--space-sm-plus) } (Z.355) muss ueberschrieben werden */
.plugin-dropdown_input .dropdown-input {
    width: 100%;
    box-sizing: border-box;
    padding: var(--space-sm) var(--space-md);
    margin: 0;
    font-size: 13px;
    border: none;
    border-bottom: 1px solid var(--border-color);
    outline: none;
    box-shadow: none;
    background: var(--bg-table-head);
    width: 100%;
    box-sizing: border-box;
}

/* Keine-Treffer-Meldung */
.ts-dropdown .no-results {
    padding: var(--space-sm-plus) var(--space-md);
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
}

/* Kunden-Suche: Kundennummer dezent — kein flex (Highlight-Whitespace-Bug) */
.ss-customer-nr {
    color: var(--text-muted);
    font-size: 12px;
    display: inline-block;
    min-width: 50px;
    margin-right: var(--space-sm);
}

/* In Filter-Rows: Tom Select und native Selects volle Breite */
.filter-row .ts-wrapper,
.filter-row .ts-wrapper.user-form-control {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0;
}

/* =====================================================
   QUICK-ADD — globaler "+"-Button in der Nav
   ===================================================== */
.quickadd-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: var(--space-sm-plus);
}

.quickadd-btn {
    background: transparent;
    border: none;
    padding: var(--space-xs-plus);
    cursor: pointer;
    color: var(--color-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.quickadd-btn:hover {
    background: var(--color-primary-hover);
}

.quickadd-btn.active {
    background: var(--color-accent);
    border-radius: var(--radius-md);
}

.quickadd-dropdown {
    position: absolute;
    top: calc(100% + var(--space-xs-plus));
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: var(--z-modal);
    min-width: 180px;
    padding: var(--space-xs) 0;
}

.quickadd-dropdown .quickadd-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm-plus);
    padding: var(--space-sm) var(--space-md-plus);
    min-height: 40px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    background: transparent;
}

.quickadd-dropdown .quickadd-item:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.quickadd-dropdown .quickadd-item svg {
    flex-shrink: 0;
    color: var(--color-primary);
    width: 18px;
    height: 18px;
}

/* =====================================================
   NOTIFICATION-CENTER (RM-15 Phase 3 — Header-Glocke + Overlay)
   ===================================================== */
.notif-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: var(--space-sm-plus);
    margin-right: var(--space-xs);
}

.notif-bell {
    background: transparent;
    border: none;
    padding: var(--space-xs-plus);
    cursor: pointer;
    color: var(--color-light);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.notif-bell:hover {
    background: var(--color-primary-hover);
}

.notif-bell.active {
    background: var(--color-accent);
    border-radius: var(--radius-md);
}

.notif-badge {
    position: absolute;
    top: calc(var(--space-2xs) * -1);
    right: calc(var(--space-xs) * -1);
    min-width: 16px;
    height: 16px;
    padding: 0 var(--space-xs);
    border-radius: var(--radius-lg);
    background: var(--color-error);
    color: var(--color-light);
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    pointer-events: none;
    box-sizing: border-box;
}

/* =====================================================
   THEME-TOGGLE-BUTTON (Header — Dark/Light-Switch)
   =====================================================
   sessionStorage-basierter Override fuer Tab-lokales Umschalten.
   DB-Praeferenz greift erst bei naechstem Login wieder. Logik in
   assets/js/theme_bootstrap.js. Optik analog zu .notif-bell. */
.theme-toggle-btn {
    background: transparent;
    border: none;
    padding: var(--space-xs-plus);
    cursor: pointer;
    color: var(--color-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
    margin-left: var(--space-2xs);
    margin-right: var(--space-xs);
}

.theme-toggle-btn:hover {
    background: var(--color-primary-hover);
}

.theme-toggle-btn:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Icon-Sichtbarkeit per Theme-State — kein Flicker, da data-theme
   bereits durch theme_bootstrap.js (sync, im <head>) gesetzt ist
   bevor CSS angewendet wird. */
.theme-toggle-btn .theme-icon-sun {
    display: none;
}
.theme-toggle-btn .theme-icon-moon {
    display: inline-block;
}
:root[data-theme="dark"] .theme-toggle-btn .theme-icon-sun {
    display: inline-block;
}
:root[data-theme="dark"] .theme-toggle-btn .theme-icon-moon {
    display: none;
}

.notif-overlay {
    position: absolute;
    top: calc(100% + var(--space-sm));
    right: calc(var(--space-sm) * -1);
    width: 380px;
    max-height: 480px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-dropdown);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: var(--text-primary);
}

/* .hidden steht global weiter oben — spezifischere Regel noetig, sonst
   gewinnt der spaetere display:flex oben. */
.notif-overlay.hidden {
    display: none;
}

.notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm-plus) var(--space-md-plus);
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-table-head);
}

.notif-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.notif-mark-all {
    background: transparent;
    border: none;
    color: var(--color-accent);
    font-size: 12px;
    cursor: pointer;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
}

.notif-mark-all:hover {
    background: var(--color-success-soft);
}

.notif-list {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.notif-list::-webkit-scrollbar {
    width: 6px;
}
.notif-list::-webkit-scrollbar-track {
    background: transparent;
}
.notif-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-sm);
}
.notif-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.notif-empty {
    padding: var(--space-xl);
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin: 0;
}

.notif-list .notif-item {
    display: flex;
    width: 100%;
    box-sizing: border-box;
    gap: var(--space-sm-plus);
    padding: var(--space-sm-plus) var(--space-md-plus);
    border-bottom: 1px solid var(--border-light);
    border-radius: 0;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: background var(--transition-fast);
    align-items: flex-start;
}

.notif-list .notif-item:last-child {
    border-bottom: none;
}

.notif-list .notif-item:hover {
    background: var(--bg-hover);
    border-radius: 0;
}

.notif-list .notif-item.unread {
    background: var(--color-info-soft);
}

.notif-list .notif-item.unread:hover {
    background: var(--color-info-soft-border);
    border-radius: 0;
}

.notif-icon {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: var(--space-2xs);
}

.notif-icon svg {
    width: 12px;
    height: 12px;
}

.notif-body {
    flex: 1;
    min-width: 0;
}

.notif-line {
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-primary);
    word-wrap: break-word;
}

.notif-line em {
    font-style: normal;
    font-weight: 600;
    color: var(--text-primary);
    background: transparent;
    padding: 0;
}

.notif-ticket {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: var(--space-2xs);
}

.notif-ticket strong {
    color: var(--color-accent);
    font-weight: 600;
}

.notif-time {
    font-size: 11px;
    color: var(--text-subtle);
    margin-top: var(--space-2xs);
}

/* Status-Kreis rechts im Item: gefuellt = ungelesen, offen = gelesen.
   Klickbar zum gezielten Markieren als gelesen. */
.notif-dot {
    flex: 0 0 12px;
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    border: 2px solid var(--color-primary);
    background: transparent;
    margin-top: var(--space-xs-plus);
    margin-left: var(--space-xs);
    cursor: pointer;
    transition: transform var(--transition-fast), background var(--transition-fast);
    box-sizing: border-box;
}

.notif-list .notif-item.unread .notif-dot {
    background: var(--color-primary);
}

.notif-list .notif-item:not(.unread) .notif-dot {
    opacity: 0.45;
}

.notif-list .notif-item .notif-dot:hover {
    transform: scale(1.25);
    opacity: 1;
}

/* =====================================================
   USER-MENU (RM-46 — Header-Bubble + Overlay)
   =====================================================
   Konsolidiert Profil-Link, Theme-Switch und Logout
   in ein gemeinsames Overlay (Pattern wie Notif-Center).
   Trigger ist die Initialen-Bubble rechts. Open/Close-
   Mechanik (ESC, Outside-Click, header-menu:open-Event)
   liegt in app.js. */
.user-menu-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: var(--space-sm);
    margin-right: var(--space-xs);
}

.user-menu-btn {
    background: transparent;
    border: none;
    padding: var(--space-2xs);
    cursor: pointer;
    border-radius: var(--radius-full);
    transition: background var(--transition-fast), box-shadow var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* RM-62 Follow-Up (13.05.2026): Kein Hover-BG mehr auf der User-Bubble.
   Grund: durch die RM-62-Touch-Target-Regel ist der Wrapper 44x44, der
   Avatar innen bleibt 32x32 — ein blauer Wrapper-BG erscheint als sichtbarer
   Ring um den Avatar. Hover-Affordance entfaellt bewusst (Hendriks Wahl),
   die Touch-Hit-Area bleibt durch min-width/min-height erhalten. */
.user-menu-btn:hover {
    background: transparent;
}

.user-menu-btn:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Kein Active-BG mehr auf der User-Bubble. Wenn das User-Menu offen ist
   wird .active gesetzt — der frueher resultierende --color-accent-Ring um
   den Avatar war exakt der gleiche Bug wie der Hover-Ring (Wrapper 44x44
   vs. Avatar 32x32). Konsistent zu :hover bleibt der Wrapper transparent.
   Affordance "Menu offen" kommt durch das eigentliche Overlay (Dropdown
   wird sichtbar) — kein Wrapper-State noetig. */
.user-menu-btn.active {
    background: transparent;
}

.user-menu-bubble {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    /* Theme-aware Slate-Tokens statt --color-accent Indigo: Hendrik
       13.05.2026 — Indigo verschmolz mit Top-Nav-Brand-Blau, Bubble war
       in beiden Themes schwer erkennbar. Slate sticht klar gegen Brand-
       Blau-Nav heraus (Light dunkles Slate, Dark helles Slate). */
    background: var(--bg-avatar-fallback);
    color: var(--text-avatar-fallback);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    user-select: none;
}

.user-menu-bubble--lg {
    width: 44px;
    height: 44px;
    font-size: 15px;
    flex: 0 0 auto;
}

/* XS-Variante fuer Listen-Avatare (Dashboard wt-actions etc.). */
.user-menu-bubble--xs {
    width: 24px;
    height: 24px;
    font-size: 9px;
    letter-spacing: 0;
    flex: 0 0 auto;
}

/* Profilbild-Bubble in XL-Variante (Profile-Page-Vorschau). */
.user-menu-bubble--xl {
    width: 160px;
    height: 160px;
    font-size: 48px;
    flex: 0 0 auto;
}

/* Bild-Variante: <img> wird quadratisch, deckt komplett, ueberfluessige
   Pixel werden vom border-radius abgeschnitten. */
.user-menu-bubble--img {
    background: transparent;
    overflow: hidden;
    padding: 0;
}
.user-menu-bubble--img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Profile-Page: 2-spaltig — links Form-Grid, rechts Avatar-Block.
   Beide Spalten gleich breit (1fr 1fr), der Avatar-Block ist innerhalb
   seiner Spalte selbst mittig (justify-self: center) und auf 220px
   beschraenkt — sonst wuerde er ueber die halbe Container-Breite klatschen. */
.profile-personal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: var(--space-xl);
    align-items: start;
}

@media (max-width: 899px) {
    .profile-personal-grid {
        grid-template-columns: 1fr;
        row-gap: var(--space-lg);
    }
}

.profile-avatar-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    width: 220px;
    justify-self: center;
}

.profile-avatar-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    width: 100%;
}

.profile-avatar-actions button,
.profile-avatar-actions label {
    width: 100%;
    text-align: center;
}

.profile-avatar-hint {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.4;
}

.user-menu-overlay {
    position: absolute;
    top: calc(100% + var(--space-sm));
    right: 0;
    width: 280px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-dropdown);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: var(--text-primary);
}

.user-menu-overlay.hidden {
    display: none;
}

.user-menu-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm-plus);
    padding: var(--space-md) var(--space-md-plus);
    background: var(--bg-table-head);
    border-bottom: 1px solid var(--border-light);
}

.user-menu-identity {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-menu-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu-username {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Standard- und Visited-Farbe identisch (Browser-Defensives-Lock,
   siehe Memory feedback_css_browser_defensives.md) — sonst zeigt der
   Browser besuchte Links in Default-Lila. Hover ueberschreibt die
   globale a:hover-Underline-Regel oben in der Datei. */
.user-menu-item,
.user-menu-item:visited {
    display: flex;
    align-items: center;
    gap: var(--space-sm-plus);
    padding: var(--space-sm-plus) var(--space-md-plus);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 13px;
    transition: background var(--transition-fast);
    cursor: pointer;
}

.user-menu-item:hover,
.user-menu-item:focus-visible,
.user-menu-item:visited:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    text-decoration: none;
    outline: none;
}

.user-menu-item .nav-icon {
    flex: 0 0 16px;
    color: var(--text-secondary);
}

.user-menu-item--danger,
.user-menu-item--danger:visited {
    color: var(--color-error);
}

.user-menu-item--danger:hover,
.user-menu-item--danger:focus-visible,
.user-menu-item--danger:visited:hover {
    background: var(--color-error-soft);
    color: var(--color-error);
    text-decoration: none;
}

.user-menu-item--danger .nav-icon {
    color: var(--color-error);
}

.user-menu-divider {
    height: 1px;
    background: var(--border-light);
    margin: var(--space-2xs) 0;
}

.user-menu-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm-plus);
    padding: var(--space-sm-plus) var(--space-md-plus);
}

.user-menu-row-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm-plus);
    font-size: 13px;
    color: var(--text-primary);
}

.user-menu-row-label .nav-icon {
    color: var(--text-secondary);
}

/* =====================================================
   THEME-SLIDER (User-Menue — 2-Wege Light/Dark)
   =====================================================
   Reuse von .theme-toggle-btn → bestehende Click-Delegation
   in theme_bootstrap.js greift automatisch. Sun/Moon-Icons
   wandern im Knob mit, Knob-Position kommt aus
   :root[data-theme="dark"] (siehe weiter unten). */
.theme-toggle-btn.theme-slider {
    position: relative;
    width: 48px;
    height: 26px;
    padding: 0;
    margin: 0;
    border-radius: 13px;
    flex: 0 0 48px;
    overflow: visible;
}

.theme-toggle-btn.theme-slider:hover {
    background: transparent;
}

.theme-slider-track {
    position: absolute;
    inset: 0;
    background: var(--border-color);
    border-radius: 13px;
    transition: background var(--transition-fast);
}

:root[data-theme="dark"] .theme-slider-track {
    background: var(--color-primary);
}

.theme-slider-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--surface-dark);
    transition: left var(--transition-fast), color var(--transition-fast);
}

:root[data-theme="dark"] .theme-slider-knob {
    left: 24px;
    color: var(--color-warning);
}

/* Sun/Moon-Display im Slider: Icon zeigt das ZIEL des naechsten
   Klicks (Mond im Light = "klick fuer Dark", Sonne im Dark =
   "klick fuer Light"). Greift automatisch ueber die generische
   .theme-toggle-btn-Regel weiter oben. */

/* ===== Audit-Log ===== */
.table-scroll-wrapper {
    overflow-x: auto;
}

/* AUDIT-LOG ausgelagert nach pages/admin.css. */

/* =========================
   LAUNCHPAD-Tile-Block ausgelagert nach pages/launchpad.css (28.04.2026).
   Hier verbleiben nur die Nav-/Slide-Anteile, die jede Seite braucht.
   ========================= */

/* --- Nav: Logo-Icon (Launchpad-Zurueck + Launchpad-Seite) --- */

/* Launchpad-back und -logo: NICHT vom .main-nav a Styling betroffen */

.launchpad-back,
.launchpad-logo {
    all: unset;
    display: inline-flex;
    align-items: center;
    margin-right: var(--space-sm);
    cursor: pointer;
    position: relative;
}

.launchpad-logo {
    cursor: default;
}

.launchpad-back[data-tooltip]:hover::after,
.nav-logo-link[data-tooltip]:hover::after {
    left: 0;
    transform: none;
    animation: tooltip-fade-left 0.15s ease;
}

.launchpad-back[data-tooltip]:hover::before,
.nav-logo-link[data-tooltip]:hover::before {
    left: var(--space-xl);
    transform: none;
    animation: tooltip-fade-left 0.15s ease;
}

@keyframes tooltip-fade-left {
    from { opacity: 0; transform: translateY(-3px); }
    to   { opacity: 1; transform: none; }
}

.nav-logo-icon {
    height: 45px;
    width: 45px;
    border-radius: var(--radius-md);
    display: block;
    transition: transform var(--transition-base) 0.4s;
}

html.is-animating .nav-logo-icon {
    transform: scale(0.6);
    transition: transform var(--transition-base);
}

/* --- Swup Page-Transitions (Workspace <-> Launchpad) --- */

/* Blauer Balken NUR waehrend der Slide-Transition sichtbar.
   Verhindert weissen Flash im Nav-Bereich beim Slide. */
html.is-changing body:not(.focus-mode)::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-nav);
    z-index: 0;
    pointer-events: none;
}

#swup.transition-slide {
    /* Marker fuer Swup animationSelector */
}

/* Slide left: Launchpad → Workspace */
html.is-leaving.to-slide-left #swup {
    animation: swupSlideOutLeft .35s ease .25s forwards;
}
html.is-rendering.to-slide-left #swup {
    animation: swupSlideInRight .35s ease;
}

/* Slide right: Workspace → Launchpad */
html.is-leaving.to-slide-right #swup {
    animation: swupSlideOutRight .35s ease .25s forwards;
}
html.is-rendering.to-slide-right #swup {
    animation: swupSlideInLeft .35s ease;
}

@keyframes swupSlideOutLeft {
    to { transform: translateX(-100%); opacity: 0; }
}
@keyframes swupSlideOutRight {
    to { transform: translateX(100%); opacity: 0; }
}
@keyframes swupSlideInLeft {
    from { transform: translateX(-100%); opacity: 0; }
}
@keyframes swupSlideInRight {
    from { transform: translateX(100%); opacity: 0; }
}

/* -------------------------------------------------------
   INFO-ICON — kleines (i) neben Labels oder im Flieesstext,
   blendet bei Hover ueber data-tooltip technische Details ein.
   Wiederverwendbar ueberall wo der primaere Text fachlich
   bleiben soll und DB-Felder / interne Mechanik nur fuer
   Detail-interessierte Nutzer sichtbar sein sollen.
   ------------------------------------------------------- */
.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    margin-left: var(--space-xs);
    color: var(--color-primary);
    cursor: help;
    vertical-align: middle;
    opacity: 0.55;
    transition: opacity var(--transition-fast);
    /* Anker fuer Tooltip-Positionierung (pseudo-element rendert sonst
       relativ zum naechsten positionierten Vorfahren) */
    position: relative;
}
.info-icon:hover,
.info-icon:focus-visible {
    opacity: 1;
}

/* Override des globalen [data-tooltip]:hover::after fuer .info-icon:
   - echte Zeilenumbrueche per pre-line (data-tooltip darf &#10; nutzen)
   - feste max-width, damit langer Text nicht horizontal aus dem Dialog
     laeuft
   - Tooltip nach links verankert (right:0) statt zentriert — vermeidet
     Abschneiden am rechten Rand, wo das Icon typisch sitzt */
.info-icon[data-tooltip]:hover::after {
    white-space: pre-line;
    max-width: 320px;
    min-width: 220px;
    width: max-content;
    text-align: left;
    line-height: 1.5;
    left: auto;
    right: 0;
    transform: none;
}

/* =====================================================
   RM-17 Block 13 — Batch-Preisaenderungs-Dialog
   ===================================================== */

.batch-price-dialog {
    max-width: 1100px;
    margin: 0 auto;
}

.bpd-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.bpd-header h2 {
    margin: 0 0 var(--space-sm) 0;
    font-size: 22px;
    color: var(--color-primary);
}

.bpd-trigger-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-2xs);
    margin-bottom: var(--space-md);
}

.bpd-trigger-info strong {
    font-size: 16px;
}

.bpd-price-compare {
    display: flex;
    align-items: center;
    gap: var(--space-md-plus);
    font-size: 18px;
    font-weight: 600;
}

.bpd-price-old {
    color: var(--text-muted);
    text-decoration: line-through;
}

.bpd-price-arrow {
    color: var(--color-accent);
    font-size: 20px;
}

.bpd-price-new {
    color: var(--color-success);
}

/* Differenz-Anzeige (in rot bei Erhoehung, gruenlich bei Senkung) */
.bpd-price-delta {
    margin-top: var(--space-xs-plus);
    padding: var(--space-xs-plus) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    display: inline-block;
}
.bpd-price-delta-up {
    color: var(--color-error);
    background: color-mix(in srgb, var(--color-error) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-error) 30%, transparent);
}
.bpd-price-delta-down {
    color: var(--color-success);
    background: color-mix(in srgb, var(--color-success) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-success) 30%, transparent);
}

/* Done-State (Zusammenfassung nach Submit) */
.bpd-done {
    text-align: left;
    max-width: 600px;
    margin: 0 auto;
}
.bpd-done-title {
    margin: 0 0 var(--space-lg) 0;
    color: var(--color-success);
}
.bpd-done-list {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-2xl) 0;
}
.bpd-done-list li {
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-light);
}
.bpd-done-list li:last-child { border-bottom: none; }
.bpd-done-list strong {
    display: inline-block;
    min-width: 32px;
    color: var(--color-primary);
}
.bpd-done-skipped { color: var(--color-warning-dark); }

/* "Neu"-Spalte: Defer-State */
.bpd-col-newval-defer {
    color: var(--text-subtle);
    font-style: italic;
}

/* Pending-Resolve-Page: Liste eindeutiger Trigger im Header */
.bpd-triggers-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-top: var(--space-md-plus);
    padding-top: var(--space-md-plus);
    border-top: 1px dashed var(--border-color);
}
.bpd-trigger-row {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
}
.bpd-trigger-row-label {
    flex: 1;
    min-width: 220px;
    font-size: 14px;
    font-weight: 500;
}
.bpd-trigger-row .bpd-price-compare {
    font-size: 15px;
}
.bpd-trigger-row .bpd-price-delta {
    font-size: 13px;
    padding: 3px var(--space-sm);
}

/* Empty-State */
.bpd-empty {
    padding: 30px var(--space-xl);
    text-align: center;
}

.bpd-empty-text {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: var(--space-2xl);
}

/* Tabs */
.view-tabs.bpd-tabs {
    margin-top: var(--space-sm);
}

.bpd-tab-count {
    color: var(--text-subtle);
    font-weight: normal;
    margin-left: var(--space-xs);
}

.view-tab-btn.active .bpd-tab-count {
    color: var(--color-text-on-nav-soft);
}

.bpd-tab-content {
    padding: var(--space-lg);
}

.bpd-tab-empty {
    margin: var(--space-2xl) 0;
    text-align: center;
}

/* Bulk-Bar */
.bpd-bulk-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm-plus);
    padding: var(--space-sm-plus) var(--space-md);
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}

.bpd-bulk-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
}

.bpd-bulk-bar .bpd-bulk-action {
    max-width: 280px;
    margin: 0;
}

/* Tabelle */
.bpd-table {
    width: 100%;
}

.bpd-col-check {
    width: 36px;
    text-align: center;
}

.bpd-col-value {
    width: 130px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.bpd-col-newval {
    color: var(--color-success);
    font-weight: 600;
}

.bpd-col-action {
    width: 230px;
}

.bpd-col-action select {
    margin: 0;
    width: 100%;
}

.bpd-context {
    font-size: 12px;
    margin-left: var(--space-xs);
}

/* Pending-Hervorhebung (Aktion = defer) */
.bpd-row-deferred {
    background: color-mix(in srgb, var(--color-warning) 8%, transparent);
}

.bpd-row-deferred td {
    border-color: color-mix(in srgb, var(--color-warning) 30%, transparent);
}

/* Footer */
.bpd-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-color);
}

.bpd-footer-status {
    font-size: 14px;
    color: var(--text-secondary);
}

.bpd-footer-status #bpdSelectedCount,
.bpd-footer-status #bpdDeferredCount {
    font-weight: 600;
    color: var(--color-primary);
}

.bpd-actions {
    display: flex;
    gap: var(--space-sm-plus);
}

/* Pending-Banner (Workspace Verwaltung) */
.pending-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
    margin: 0 0 var(--space-md-plus) 0;
}

.pending-banner-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-2xs);
}

.pending-banner-content strong {
    font-size: 15px;
}

.pending-banner-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm-plus);
}

.pending-banner-close {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.15);
    color: inherit;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: var(--radius-sm);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.pending-banner-close:hover {
    background: var(--bg-overlay-soft);
}

/* Pill am Kundenkopf bei offenen Preisentscheidungen */
.pending-customer-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm-plus);
    background: color-mix(in srgb, var(--color-warning) 14%, transparent);
    color: var(--color-warning-dark);
    border: 1px solid color-mix(in srgb, var(--color-warning) 40%, transparent);
    border-radius: var(--radius-xl);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.3;
}

.pending-customer-pill:hover {
    background: color-mix(in srgb, var(--color-warning) 24%, transparent);
    text-decoration: none;
}

/* ===== Maintenance-Mode Warnbalken (RM-22) ===== */
.maintenance-warning {
    position: relative;
    width: 100%;
    z-index: var(--z-sticky);
    user-select: none;
    box-shadow: var(--shadow-md);
}

/* Diagonale Streifenbaender mit Glanz: Streifen-Layer unten + halb-
   transparenter Vertikal-Gradient drueber (Highlight oben, Schatten
   unten), damit das Band wie laminiertes Absperrband wirkt. */
.maintenance-warning__stripe {
    position: relative;
    height: 14px;
    background:
        repeating-linear-gradient(
            -45deg,
            var(--color-maintenance-stripe-dark) 0 14px,
            var(--color-maintenance-yellow) 14px 28px
        );
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.5);
}

.maintenance-warning__stripe::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.35) 0%,
        rgba(255, 255, 255, 0.05) 40%,
        rgba(0, 0, 0, 0.0) 55%,
        rgba(0, 0, 0, 0.4) 100%
    );
    pointer-events: none;
}

.maintenance-warning__bar {
    background:
        linear-gradient(
            to bottom,
            #2a2a2a 0%,
            #1a1a1a 50%,
            #0d0d0d 100%
        );
    color: var(--color-maintenance-yellow);
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.6px;
    line-height: 1.3;
    padding: var(--space-md) var(--space-lg);
    text-transform: uppercase;
    text-shadow:
        0 1px 0 rgba(0, 0, 0, 0.7),
        0 0 8px rgba(255, 212, 0, 0.25);
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.6),
        inset 0 -2px 4px rgba(0, 0, 0, 0.6);
}

/* Login-Page Wartungshinweis + Admin-Login-Toggle */
.maintenance-notice {
    background: var(--color-warning-soft);
    border: 1px solid var(--color-maintenance-yellow);
    border-radius: var(--radius-lg);
    padding: var(--space-lg) var(--space-xl);
    margin-bottom: var(--space-xl);
    color: var(--color-warning-dark);
}

.maintenance-notice h3 {
    margin: 0 0 var(--space-sm) 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--surface-dark);
}

.maintenance-notice p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.maintenance-admin-toggle {
    display: inline-block;
    margin-top: var(--space-md);
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.maintenance-admin-toggle:hover {
    color: var(--surface-dark);
    text-decoration: underline;
}

/* =========================
   ADMIN DASHBOARD (admin/index.php)
   ========================= */

.admin-dashboard {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

/* --- Hero --- */
.dash-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
    padding: var(--space-xl) var(--space-2xl);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    color: var(--color-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    flex-wrap: wrap;
}
.dash-hero-greeting {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.2px;
}
.dash-hero-sub {
    font-size: 14px;
    opacity: 0.85;
    margin-top: 2px;
}
.dash-hero-meta {
    text-align: right;
    line-height: 1.1;
}
.dash-hero-time {
    font-size: 28px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}
.dash-hero-tz {
    font-size: 12px;
    opacity: 0.75;
    margin-top: 4px;
}

/* --- KPI-Grid --- */
.dash-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-md);
}
.dash-kpi-tile,
.dash-kpi-tile:visited {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    color: var(--text-primary);
    text-decoration: none;
    transition: transform var(--transition-fast),
                box-shadow var(--transition-fast),
                border-color var(--transition-fast);
}
.dash-kpi-tile:hover,
.dash-kpi-tile:visited:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
    text-decoration: none;
}
.dash-kpi-tile.is-ok      { border-left-color: var(--color-success); }
.dash-kpi-tile.is-warning { border-left-color: var(--color-warning); }
.dash-kpi-tile.is-danger  { border-left-color: var(--color-error); }
.dash-kpi-tile.is-info    { border-left-color: var(--color-accent); }

.dash-kpi-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--bg-hover);
    color: var(--text-muted);
}
.dash-kpi-tile.is-ok      .dash-kpi-icon { color: var(--color-success); background: var(--color-success-soft); }
.dash-kpi-tile.is-warning .dash-kpi-icon { color: var(--color-warning-dark); background: var(--color-warning-soft); }
.dash-kpi-tile.is-danger  .dash-kpi-icon { color: var(--color-error); background: var(--color-error-soft); }

.dash-kpi-body { min-width: 0; flex: 1; }
.dash-kpi-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}
.dash-kpi-value {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}
.dash-kpi-of {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-muted);
}
.dash-kpi-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}
.dash-kpi-bar {
    height: 4px;
    background: var(--bg-hover);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}
.dash-kpi-bar-fill {
    height: 100%;
    background: var(--color-accent);
    transition: width 400ms ease;
}
.dash-kpi-tile.is-ok      .dash-kpi-bar-fill { background: var(--color-success); }
.dash-kpi-tile.is-warning .dash-kpi-bar-fill { background: var(--color-warning); }
.dash-kpi-tile.is-danger  .dash-kpi-bar-fill { background: var(--color-error); }

/* --- 2-Spalten-Layout --- */
.dash-2col {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-lg);
}
/* Default min-width: auto auf Grid-Items wuerde sie auf den breitesten
   intrinsischen Inhalt strecken (z.B. lange .dash-activity-detail ohne
   forced wrap) -> Spalten wachsen ueber 2fr/1fr hinaus, Layout ueberlauft
   nach rechts. min-width: 0 macht sie schrumpfbar. */
.dash-2col > *  { min-width: 0; }
.dash-2col > * > .content-box { overflow: hidden; }

/* Override fuer die globale Admin-Regel `.admin-content .content-box {
   min-width: 1100px }` (siehe oben in der Admin-Sektion). Im Dashboard
   wollen wir flexibles Schrumpfen, sonst sprengen die content-boxes das
   2fr/1fr-Grid und das Layout laeuft nach rechts raus. */
.admin-dashboard .content-box { min-width: 0; }

/* Dashboard 2col -> 1col Schwelle: an die Audit-Skala angepasst (RM-49b).
   Bei < --bp-m (960) klappt das 2fr/1fr-Grid auf eine Spalte um. Auf
   Surface @ 200% (1440 CSS-px) bleibt das 2-spaltige Layout, auf
   schmalem Tablet/Hochformat schaltet es um. Vorher hardcoded 1100px. */
@media (max-width: 959px) {
    .dash-2col { grid-template-columns: 1fr; }
}
.dash-side-col {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    min-width: 0;
}

.dash-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}
.dash-section-more,
.dash-section-more:visited {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}
.dash-section-more:hover {
    color: var(--color-accent);
    text-decoration: none;
}
.dash-section-count {
    background: var(--color-warning-soft);
    color: var(--color-warning-dark);
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    line-height: 1.4;
}

/* --- Activity-Liste --- */
.dash-activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.dash-activity-item {
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-color);
}
.dash-activity-item:last-child  { border-bottom: none; padding-bottom: 0; }
.dash-activity-item:first-child { padding-top: 0; }
.dash-activity-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 2px;
}
.dash-activity-time { font-variant-numeric: tabular-nums; }
.dash-activity-actor {
    color: var(--text-secondary);
    font-weight: 500;
}
.dash-activity-actor::before {
    content: "·";
    margin-right: var(--space-sm);
    color: var(--text-muted);
}
.dash-activity-action {
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
    font-size: 14px;
}
.dash-activity-resource {
    font-weight: 600;
    color: var(--text-primary);
}
.dash-activity-verb {
    color: var(--text-secondary);
    font-family: var(--font-mono, monospace);
    font-size: 12px;
    background: var(--bg-hover);
    padding: 1px 6px;
    border-radius: 3px;
}
.dash-activity-detail {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* --- Counts-Grid --- */
.dash-counts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
}

/* Dash-Counts 2col -> 1col Schwelle (RM-49b, 02.05.2026):
   bei < --bp-s (600) klappt das Counter-Pair (z.B. Tickets-/
   Pool-Stats im Admin-Dashboard) auf 1-spaltig. */
@media (max-width: 599px) {
    .dash-counts-grid {
        grid-template-columns: 1fr;
    }
}
.dash-count,
.dash-count:visited {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-md);
    background: var(--bg-hover);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    transition: background var(--transition-fast), border-color var(--transition-fast);
    border-left: 3px solid transparent;
}
.dash-count:hover {
    background: var(--bg-table-stripe);
    color: var(--text-primary);
    border-left-color: var(--color-accent);
    text-decoration: none;
}
.dash-count-num {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-primary);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.dash-count-num-sm { font-size: 15px; line-height: 1.3; }
.dash-count-of {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}
.dash-count-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 500;
}
.dash-count-static { cursor: default; }
.dash-count-static:hover { background: var(--bg-hover); border-left-color: transparent; }
.dash-count-static.is-success .dash-count-num { color: var(--color-success-dark); }
.dash-count-static.is-warning .dash-count-num { color: var(--color-warning-dark); }
.dash-count-static.is-danger  .dash-count-num { color: var(--color-error); }

/* --- Pending-Liste --- */
.dash-pending-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}
.dash-pending-item,
.dash-pending-item:visited {
    display: flex;
    align-items: center;
    gap: var(--space-sm-plus);
    padding: var(--space-sm-plus) var(--space-md);
    background: var(--bg-hover);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    transition: background var(--transition-fast), transform var(--transition-fast);
}
.dash-pending-item:hover {
    background: var(--bg-table-stripe);
    color: var(--text-primary);
    text-decoration: none;
    transform: translateX(2px);
}
.dash-pending-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--color-accent);
}
.dash-pending-item.is-warning .dash-pending-dot { background: var(--color-warning); }
.dash-pending-item.is-danger  .dash-pending-dot { background: var(--color-error); }
.dash-pending-item.is-info    .dash-pending-dot { background: var(--color-accent); }
.dash-pending-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.dash-pending-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}
.dash-pending-hint {
    font-size: 12px;
    color: var(--text-muted);
}
.dash-pending-arrow {
    color: var(--text-muted);
    font-size: 16px;
    transition: transform var(--transition-fast), color var(--transition-fast);
}
.dash-pending-item:hover .dash-pending-arrow {
    color: var(--color-accent);
    transform: translateX(2px);
}

/* --- System-Info Footer --- */
.dash-system-footer {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 12px;
    color: var(--text-muted);
    flex-wrap: wrap;
}
.dash-system-footer span { font-variant-numeric: tabular-nums; }
.dash-footer-link,
.dash-footer-link:visited {
    margin-left: auto;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}
.dash-footer-link:hover { color: var(--color-accent); text-decoration: none; }

/* ---------------------------------------------------------------
   RM-47c — HERE Autosuggest Dropdown
   --------------------------------------------------------------- */
.here-autosuggest {
    position: relative;
    display: block;
}
.here-autosuggest-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: var(--z-dropdown);
    margin-top: 2px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    max-height: 320px;
    overflow-y: auto;
}
.here-autosuggest-note {
    padding: var(--space-sm) var(--space-md);
    color: var(--text-muted);
    font-size: 12px;
    font-style: italic;
}
.here-autosuggest-item {
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}
.here-autosuggest-item:last-child { border-bottom: none; }
.here-autosuggest-item:hover,
.here-autosuggest-item.active {
    background: var(--bg-hover);
}
.here-autosuggest-main {
    color: var(--text-color);
    font-size: 14px;
    font-weight: 500;
}
.here-autosuggest-sub {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 2px;
}

/* =====================================================
   RM-18 Quick-Win B — Inventar-Filter-Bar
   Client-seitiger Typ-Filter im Inventar-Tab; Buttons
   benutzen .btn-action btn-action-light btn-small +
   die btn-active-Markierung (gleiche Konvention wie
   die Ticket-Filter im Kunden-Detail).
===================================================== */
.inventory-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs-plus);
    margin-bottom: var(--space-md);
}
.inventory-filter-bar .filter-count {
    display: inline-block;
    margin-left: var(--space-2xs);
    padding: 0 6px;
    border-radius: var(--radius-pill, 999px);
    background: var(--bg-hover);
    color: var(--text-subtle);
    font-size: 11px;
    font-weight: 500;
    min-width: 18px;
    text-align: center;
}
.inventory-filter-bar .btn-active .filter-count {
    background: rgba(255,255,255,0.85);
    color: var(--color-primary);
}

/* Asset-Zeile: Hostname/Bezeichnung als klickbarer Link in den
   Detail-Dialog. Look soll nicht „Link" schreien — dezent unterstrichen
   beim Hover, sonst wie normaler Tabellentext. */
.asset-row-link {
    color: inherit;
    text-decoration: none;
}
.asset-row-link:hover {
    color: var(--color-primary);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}
.asset-row-link:visited {
    color: inherit;
}

/* =====================================================
   RM-62 — Top-Nav Workspace-Tabs + Help-Btn + Touch-Targets
   ===================================================== */

/* Logo als Link (RM-62) — fuehrt zum Launchpad. Auf der Launchpad-Seite
   selbst bleibt es ein <span class="launchpad-logo"> ohne Click-Handler.
   Spezifitaet ueber .main-nav .nav-logo-link, damit die globale
   .main-nav a:not(...)-Regel (Padding/Margin) ueberschrieben wird —
   sonst sitzt das Logo nicht auf gleicher Position wie auf dem Launchpad. */
.main-nav .nav-logo-link,
.main-nav .nav-logo-link:visited {
    display: inline-flex;
    align-items: center;
    padding: 0;
    margin: 0;
    margin-right: var(--space-sm);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
    text-decoration: none;
    color: inherit;
    background: transparent;
}
.main-nav .nav-logo-link:hover {
    background: transparent;
    text-decoration: none;
}

/* Workspace-Tabs (RM-62) — alle Workspaces als Top-Nav-Items.
   Spezifitaet ueber .main-nav .workspace-tab, damit auch disabled-Spans
   konsistent gestylt sind ohne von der existing .main-nav a:not(...)-Regel
   nur fuer Anchors getroffen zu werden.

   RM-62 Follow-Up (13.05.2026 abends) — Active/Hover-Sanierung:
   - Hover-BG von --color-primary-hover auf --bg-nav-hover umgestellt
     (fix Dark-WCAG-Bug 1.79:1 -> 4.55:1)
   - Active-BG von --color-accent (Indigo Hue 237°) auf --bg-nav-active
     (Brand-Blau Hue 210°) — bleibt in der Hue-Familie
   - Active-Affordance NUR ueber BG-Wechsel + font-weight (Underline-Strich
     wurde verworfen, Hendrik 13.05.2026: BG-Hervorhebung reicht, Strich
     wirkte abgesetzt und stoerend) */
.main-nav .workspace-tab,
.main-nav .workspace-tab:visited {
    color: var(--color-text-on-nav);
    text-decoration: none;
    margin-right: 0;
    padding: var(--space-xs) var(--space-sm-plus);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    min-height: 32px;
    font-weight: normal;
    cursor: pointer;
}
.main-nav .workspace-tab:hover {
    background: var(--bg-nav-hover);
    text-decoration: none;
    color: var(--color-text-on-nav);
}
.main-nav .workspace-tab.active {
    background: var(--bg-nav-active);
    color: var(--color-light);
    font-weight: 600;
}
.main-nav .workspace-tab:hover .nav-icon,
.main-nav .workspace-tab.active .nav-icon {
    opacity: 1;
}

/* Disabled-Workspace-Tab (faktura, receivables — in Entwicklung) */
.main-nav .workspace-tab--disabled,
.main-nav .workspace-tab--disabled:hover {
    color: var(--color-text-on-nav-soft);
    opacity: 0.5;
    cursor: not-allowed;
    user-select: none;
    background: transparent;
}

/* Help-Btn (Manual) im nav-right — analog .notif-bell mit Touch-Target.
   :not(.help-btn) in der globalen .main-nav a-Regel sorgt dafuer, dass
   die hier definierten Styles nicht ueberschrieben werden. */
.help-btn,
.help-btn:visited {
    background: transparent;
    border: none;
    padding: var(--space-xs-plus);
    cursor: pointer;
    color: var(--color-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
    margin-left: var(--space-xs);
    text-decoration: none;
}
/* RM-62 Follow-Up (13.05.2026): Help-Btn-Hover angleichen an Notif-Bell und
   Quick-Add. Help-Btn ist <a>, Notif/Quick-Add sind <button>. Mehrere
   Probleme entstehen aus dieser Asymmetrie:

   (a) Globale .main-nav a:hover .nav-icon { opacity: 1 } greift nur fuer
       <a>-Elemente — wuerde Help-Btn-Icon ueberhellen waehrend die
       anderen ihre 0.8 behalten.
   (b) Chrome hat eine Privacy-Restriction gegen :visited-CSS-Vars:
       sobald ein <a> als :visited markiert ist (User hat /manual/
       schon mal besucht), werden 'color: var(...)' und damit auch
       'fill: currentColor' der enthaltenen SVGs nicht mehr durch
       das Author-Stylesheet gesetzt — UA-Default-:visited-Color greift,
       im Dark cyan/violett. Edge ist da weniger streng — Hendriks
       Edge-vs-Chrome-Unterschied. Bug, den <button>-Elemente nicht haben.

   Fix: SVG-fill DIREKT auf das Icon setzen (umgeht currentColor-
   Inheritance vom <a> und damit Chrome's :visited-Restriction).
   Plus opacity 0.8 erzwingen. So verhaelt sich .help-btn beim Hover
   in BEIDEN Browsern identisch zu .notif-bell. */
.help-btn:hover {
    background: var(--color-primary-hover);
    color: var(--color-light);
}
.main-nav .help-btn .nav-icon,
.main-nav .help-btn:hover .nav-icon,
.main-nav .help-btn:visited .nav-icon,
.main-nav .help-btn:visited:hover .nav-icon {
    fill: var(--color-light);
    opacity: 0.8;
}
.help-btn:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Touch-Targets (RM-62 Phase 6) — 44x44 fuer alle nav-right Icons.
   Apple HIG / Material Design Richtwert; Icon-Groesse bleibt unveraendert,
   nur der klickbare Bereich vergroessert sich durch min-width/min-height.
   box-sizing: border-box wichtig fuer .help-btn (Anchor-Element) — sonst
   addiert sich das Padding ON TOP der 44px-Mindestgroesse und der Hover-
   Bereich wird ueber die volle Top-Nav-Hoehe (56px) gestreckt. */
.main-nav .quickadd-btn,
.main-nav .notif-bell,
.main-nav .help-btn,
.main-nav .user-menu-btn {
    box-sizing: border-box;
    min-width: 44px;
    min-height: 44px;
}

