/*
 * UWC CRM - Stylesheet nach UWC-Design-System v1.0 (~/.claude/uwc-design-system.md).
 * Alle Werte kommen aus Design-Tokens (:root), keine One-off-Werte in Komponenten.
 * Groessen in rem (folgt Browser-Zoom / Nutzer-Schriftgroesse, WCAG 1.4.4).
 * Ziel: helles Apple-Stil-Design, WCAG 2.2 AA. CRM = Desktop-Density (DS Sec. 4.2).
 *
 * Schrift: Inter ist self-hosted vorgesehen (DSGVO), die woff2-Dateien liegen dem
 * Grundgeruest noch nicht bei -> bis dahin greift der System-Fallback-Stack (kein
 * externes CDN, Tabu-konform). Inter nachliefern = reiner Austausch der Fontdatei.
 */

/* ============================================================== Tokens */
:root {
    /* Primaer-Palette */
    --color-accent: #0066D6;
    --color-accent-hover: #0052B3;
    --color-accent-light: #E8F2FF;
    --color-destructive: #FF3B30;
    --color-warning: #FF9500;
    --color-success: #34C759;

    /* Grau-Skala (Apple-neutral) */
    --color-gray-50: #F9FAFB;
    --color-gray-100: #F3F4F6;
    --color-gray-200: #E5E7EB;
    --color-gray-400: #9CA3AF;
    --color-gray-600: #4B5563;
    --color-gray-900: #111827;
    --color-white: #FFFFFF;

    /* Semantische Farb-Tokens */
    --color-bg-page: var(--color-gray-50);
    --color-bg-surface: var(--color-white);
    --color-bg-subtle: var(--color-gray-100);
    --color-text-primary: var(--color-gray-900);
    --color-text-secondary: var(--color-gray-600);
    --color-text-muted: var(--color-gray-400);
    --color-border: var(--color-gray-200);
    --color-border-focus: var(--color-accent);

    /* Status-Chip-Flaechen/Text (DS Sec. 9.1.2, A11y-belegt) */
    --color-status-ok-surface: #E6F4EA;
    --color-status-ok-text: #137333;   /* 5.95:1 auf Weiss */
    --color-status-err-surface: #FDECEA;
    --color-status-err-text: #C5221F;  /* 5.80:1 auf Weiss */

    /* Typografie (Sub-Token-Konvention DS Sec. 2.2.1) */
    --font-family-base: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    --text-xs-size: 0.75rem;   --text-xs-weight: 400;   --text-xs-line: 1.5;
    --text-sm-size: 0.875rem;  --text-sm-weight: 400;   --text-sm-line: 1.5;
    --text-base-size: 1rem;    --text-base-weight: 400; --text-base-line: 1.6;
    --text-lg-size: 1.125rem;  --text-lg-weight: 600;   --text-lg-line: 1.4;
    --text-xl-size: 1.25rem;   --text-xl-weight: 600;   --text-xl-line: 1.3;
    --text-2xl-size: 1.5rem;   --text-2xl-weight: 700;  --text-2xl-line: 1.25;
    --text-3xl-size: 1.875rem; --text-3xl-weight: 700;  --text-3xl-line: 1.2;

    /* Spacing (8px-Grid) */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-12: 3rem;
    --space-16: 4rem;

    /* Border-Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Schatten (Elevation) */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-focus: 0 0 0 3px rgba(0, 102, 214, 0.35);

    /* Motion */
    --duration-fast: 100ms;
    --duration-base: 200ms;
    --easing-default: cubic-bezier(0.4, 0, 0.2, 1);

    --sidebar-width: 240px;
}

/* ============================================================== Reset/Basis */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    font-family: var(--font-family-base);
    font-size: var(--text-base-size);
    font-weight: var(--text-base-weight);
    line-height: var(--text-base-line);
    background: var(--color-bg-page);
    color: var(--color-text-primary);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    color: var(--color-text-primary);
    margin: 0 0 var(--space-4);
}

h1 {
    font-size: var(--text-3xl-size);
    font-weight: var(--text-3xl-weight);
    line-height: var(--text-3xl-line);
}

h2 {
    font-size: var(--text-2xl-size);
    font-weight: var(--text-2xl-weight);
    line-height: var(--text-2xl-line);
}

a {
    color: var(--color-accent);
    text-decoration: none;
}

a:hover {
    color: var(--color-accent-hover);
    text-decoration: underline;
}

/* Sichtbarer Fokus-Ring auf allem Interaktiven (WCAG 2.4.7) */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
    border-radius: var(--radius-sm);
}

/* ============================================================== App-Shell (angemeldet) */
.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--color-bg-surface);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    padding: var(--space-6) var(--space-4);
    gap: var(--space-6);
}

.brand {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    padding: 0 var(--space-2);
    font-size: var(--text-lg-size);
    font-weight: 700;
    color: var(--color-text-primary);
}

.brand:hover {
    text-decoration: none;
    color: var(--color-text-primary);
}

.brand .brand-uwc {
    color: var(--color-accent);
}

.brand .brand-sub {
    font-size: var(--text-xs-size);
    font-weight: 500;
    color: var(--color-text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.nav-item {
    display: block;
    padding: var(--space-3) var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--text-sm-size);
    font-weight: 500;
    color: var(--color-text-secondary);
}

.nav-item:hover {
    background: var(--color-gray-50);
    color: var(--color-text-primary);
    text-decoration: none;
}

.nav-item.is-active {
    background: var(--color-accent-light);
    color: var(--color-accent);
}

.app-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-4);
    height: 64px;
    padding: 0 var(--space-8);
    background: var(--color-bg-surface);
    border-bottom: 1px solid var(--color-border);
}

.topbar .user {
    font-size: var(--text-sm-size);
    color: var(--color-text-secondary);
}

.topbar .user strong {
    color: var(--color-text-primary);
    font-weight: 600;
}

.content {
    flex-grow: 1;
    padding: var(--space-8);
    width: 100%;
    /* Keine feste Maximalbreite: der Inhalt (v. a. die Liste) orientiert sich an
       der Fensterbreite - bei hoher Aufloesung ist direkt mehr sichtbar. Formulare
       und Detailseiten begrenzen sich selbst ueber die Karten-max-width. */
    min-width: 0;
}

/* ============================================================== Auth-Shell (abgemeldet) */
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    padding: var(--space-8);
}

.auth-card .brand {
    justify-content: center;
    margin-bottom: var(--space-6);
    font-size: var(--text-xl-size);
}

/* ============================================================== Karte (DS Sec. 3.3) */
.card {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-6);
}

.card + .card {
    margin-top: var(--space-6);
}

.lead {
    font-size: var(--text-base-size);
    color: var(--color-text-secondary);
    margin: 0 0 var(--space-6);
}

/* ============================================================== Button (DS Sec. 3.1) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;               /* BFSG Touch-Target */
    padding: var(--space-3) var(--space-6);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: var(--text-sm-size);
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background var(--duration-base) var(--easing-default),
                border-color var(--duration-base) var(--easing-default);
}

.btn-primary {
    background: var(--color-accent);
    color: var(--color-white);
}

.btn-primary:hover {
    background: var(--color-accent-hover);
    text-decoration: none;
    color: var(--color-white);
}

.btn-secondary {
    background: var(--color-bg-surface);
    border-color: var(--color-border);
    color: var(--color-text-primary);
}

.btn-secondary:hover {
    background: var(--color-gray-50);
    text-decoration: none;
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
    padding: var(--space-2) var(--space-3);
    min-height: 40px;
}

.btn-ghost:hover {
    background: var(--color-gray-100);
    color: var(--color-text-primary);
    text-decoration: none;
}

.btn-block {
    width: 100%;
}

/* ============================================================== Formular (DS Sec. 3.2) */
.field {
    margin-bottom: var(--space-4);
}

.field label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--text-sm-size);
    font-weight: 500;
    color: var(--color-text-primary);
}

.field input,
.field textarea,
.field select {
    width: 100%;
    min-height: 44px;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: var(--text-base-size);
    color: var(--color-text-primary);
    background: var(--color-bg-surface);
}

.field textarea {
    min-height: 96px;
    resize: vertical;
}

.field input:disabled {
    background: var(--color-gray-50);
    color: var(--color-text-secondary);
}

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

/* Fehlermeldung (DS Sec. 3.2 / 5 Understandable) */
.form-error {
    display: block;
    margin-bottom: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--color-status-err-surface);
    color: var(--color-status-err-text);
    font-size: var(--text-sm-size);
}

/* ============================================================== Tabelle (DS Sec. 3.6) */
.table-wrap {
    /* Beidseitig scrollbarer Grid-Bereich mit begrenzter Hoehe: so bleibt der
       horizontale Scrollbalken immer am unteren Rand sichtbar (nicht erst hinter
       50 Zeilen erreichbar) und die Kopfzeile bleibt beim Scrollen oben. */
    overflow: auto;
    max-height: calc(100vh - 230px);
}

.table {
    /* Waechst mit dem Inhalt (Querscrollen bei vielen Spalten), fuellt aber
       mindestens die Breite des scrollbaren Containers. */
    width: max-content;
    min-width: 100%;
    border-collapse: separate;   /* fuer sticky-Kopf ohne Rahmen-Luecken */
    border-spacing: 0;
    font-size: var(--text-sm-size);
}

.table td, .table th {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;   /* greift nur, wenn eine Spaltenbreite gesetzt ist */
}

/* Kopfzeile bleibt beim vertikalen Scrollen oben. */
.table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--color-gray-50);
}
/* Aktions-Spalte (Chevron) links UND (im Kopf) oben fixiert. */
.table thead .spalte-oeffnen { z-index: 3; }

/* Spaltenkopf: umsortierbar (Drag) + Breite ziehbar (Trenner am rechten Rand). */
.table th.th-spalte { position: sticky; }   /* sticky bildet den Bezug fuer den Trenner */
.table th.th-spalte[draggable="true"] { cursor: grab; }
.table th.th-dragging { opacity: 0.45; }
.table th.th-drop-links { box-shadow: inset 3px 0 0 var(--color-accent); }
.table th.th-drop-rechts { box-shadow: inset -3px 0 0 var(--color-accent); }
.th-inhalt { display: inline-block; pointer-events: auto; }
.col-resize {
    position: absolute;
    top: 0;
    right: 0;
    width: 7px;
    height: 100%;
    cursor: col-resize;
    user-select: none;
}
.col-resize:hover { background: var(--color-accent); opacity: 0.4; }

/* Sidebar ein-/ausklappen (voller Arbeitsbereich) */
.app.nav-aus .sidebar { display: none; }
.nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin-right: auto;   /* schiebt Nutzer/Abmelden nach rechts */
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-surface);
    color: var(--color-text-secondary);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}
.nav-toggle:hover { background: var(--color-gray-50); color: var(--color-text-primary); }

/* Aktions-Spalte ("Oeffnen") bleibt beim Querscrollen links fixiert und immer
   erreichbar. */
.spalte-oeffnen {
    position: sticky;
    left: 0;
    z-index: 1;
    width: 1%;
    padding-left: var(--space-2);
    padding-right: var(--space-2);
    background: var(--color-bg-surface);
}
.table thead .spalte-oeffnen {
    background: var(--color-gray-50);
}
.table tbody tr:hover .spalte-oeffnen {
    background: var(--color-gray-50);
}
.oeffnen-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
}
.oeffnen-link:hover {
    background: var(--color-accent-light);
    color: var(--color-accent);
}

/* Inline-Bearbeitung: fokussierte Zelle + Zell-Editor */
.zelle-edit { cursor: pointer; }
.zelle-edit:hover { background: var(--color-gray-50); }
.zelle-fokus {
    box-shadow: inset 0 0 0 2px var(--color-accent);
    background: var(--color-accent-light);
}
.zelle-editor {
    width: 100%;
    box-sizing: border-box;
    min-width: 140px;
    padding: var(--space-1) var(--space-2);
    border: 1px solid var(--color-accent);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm-size);
    font-family: inherit;
    background: var(--color-bg-surface);
    color: var(--color-text-primary);
}

/* ============================================================== Listen-Engine (Prospects) */
.listen-layout {
    display: flex;
    gap: var(--space-6);
    align-items: flex-start;
}

/* Linkes Ansichten-Panel (ein-/ausklappbar) */
.ansichten-panel {
    width: 220px;
    flex-shrink: 0;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-3);
}
.ansichten-panel > summary {
    list-style: none;
    cursor: pointer;
    font-weight: 600;
    padding: var(--space-2) var(--space-3);
    color: var(--color-text-primary);
    white-space: nowrap;
}
.ansichten-panel > summary::-webkit-details-marker { display: none; }
/* Offen: Pfeil nach links (zum seitlichen Einklappen). Zu: Pfeil nach rechts
   (zum Aufklappen); das Panel schrumpft dann auf einen schmalen Streifen, die
   Liste wird breiter. */
.ansichten-panel[open] > summary::before { content: "‹ "; color: var(--color-text-muted); }
.ansichten-panel:not([open]) > summary::before { content: "›"; color: var(--color-text-muted); }
.ansichten-panel:not([open]) {
    width: auto;
}
.ansichten-panel:not([open]) .ansichten-label {
    display: none;
}
.ansichten-liste { margin-top: var(--space-2); }
.ansichten-liste a {
    display: block;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--text-sm-size);
    color: var(--color-text-secondary);
}
.ansichten-liste a:hover {
    background: var(--color-gray-50);
    color: var(--color-text-primary);
    text-decoration: none;
}
.ansichten-liste a.is-active {
    background: var(--color-accent-light);
    color: var(--color-accent);
    font-weight: 500;
}
.ansichten-titel {
    margin: var(--space-4) 0 var(--space-1);
    padding: 0 var(--space-3);
    font-size: var(--text-xs-size);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
}
.ansichten-aktionen {
    margin-top: var(--space-4);
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-2);
}

.listen-main {
    flex-grow: 1;
    min-width: 0; /* erlaubt der Tabelle das Querscrollen im Flex-Kind */
}
.listen-kopf {
    display: flex;
    align-items: baseline;
    gap: var(--space-4);
    flex-wrap: wrap;
}
.listen-kopf h1 { margin: 0; }

/* Schlanke Toolbar mit Menue-Knoepfen */
.toolbar {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    flex-wrap: wrap;
    margin: var(--space-4) 0;
}
.dd { position: relative; }
.dd > summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    min-height: 40px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-surface);
    font-size: var(--text-sm-size);
    font-weight: 500;
    color: var(--color-text-primary);
}
.dd > summary::-webkit-details-marker { display: none; }
.dd[open] > summary {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-focus);
}
.dd-badge {
    display: inline-block;
    min-width: 18px;
    text-align: center;
    padding: 0 var(--space-1);
    border-radius: var(--radius-full);
    background: var(--color-accent-light);
    color: var(--color-accent);
    font-size: var(--text-xs-size);
    font-weight: 600;
}
.dd-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 20;
    min-width: 260px;
    max-height: 70vh;
    overflow: auto;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--space-4);
}
/* Lange Feld-Auswahl scrollt fuer sich; der Aktionsknopf darunter bleibt sichtbar. */
.dd-feldliste {
    max-height: 42vh;
    overflow-y: auto;
    margin-bottom: var(--space-2);
}
.dd-fuss {
    position: sticky;
    bottom: calc(-1 * var(--space-4));
    margin: var(--space-2) calc(-1 * var(--space-4)) calc(-1 * var(--space-4));
    padding: var(--space-3) var(--space-4);
    background: var(--color-bg-surface);
    border-top: 1px solid var(--color-border);
}
.dd-fuss .btn { width: 100%; }

@media (max-width: 900px) {
    .listen-layout { flex-direction: column; }
    .ansichten-panel { width: 100%; }
}

/* ============================================================== Detailansicht (zweigeteilt) */
.detail-layout {
    display: flex;
    gap: var(--space-6);
    align-items: flex-start;
}
.detail-haupt {
    flex-grow: 1;
    min-width: 0;
}
.detail-historie {
    width: 380px;
    flex-shrink: 0;
}
.feld-grid {
    display: grid;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}
.feld-grid-1 { grid-template-columns: 1fr; }
.feld-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.feld-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.feld-grid .field { margin: 0; }
.feld-breit { grid-column: 1 / -1; }
.abschnitt-titel {
    margin: var(--space-5) 0 var(--space-2);
    padding-bottom: var(--space-1);
    border-bottom: 1px solid var(--color-border);
    font-size: var(--text-lg-size);
}

/* Layout-Designer (Drag&Drop) */
.layout-liste {
    list-style: none;
    margin: 0;
    padding: 0;
    max-width: 640px;
}
.ll-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    margin-bottom: var(--space-2);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}
.ll-item.ll-drag { opacity: 0.5; }
.ll-trenner {
    background: var(--color-surface-subtle, #f5f7fa);
    border-style: dashed;
    flex-wrap: wrap;
}
.ll-mark {
    font-weight: 600;
    font-size: var(--text-sm-size);
    color: var(--color-text-secondary);
}
.ll-label { flex-grow: 1; }
.griff {
    cursor: grab;
    color: var(--color-text-secondary);
    font-size: var(--text-lg-size);
    user-select: none;
}
.ll-trenner .tr-titel { flex-grow: 1; min-width: 140px; }

/* E-Mail/Telefon: Eingabefeld + Klick-Symbol (Mail/Dialer) nebeneinander */
.feld-mit-launch {
    display: flex;
    align-items: stretch;
    gap: var(--space-2);
}
.feld-mit-launch input { flex: 1 1 auto; min-width: 0; }
.feld-launch {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-surface);
    color: var(--color-accent);
    font-size: 18px;
    text-decoration: none;
}
.feld-launch:hover { background: var(--color-accent-light); text-decoration: none; }

.historie-eintrag {
    border-top: 1px solid var(--color-border);
    padding: var(--space-3) 0;
}
.historie-kopf {
    font-size: var(--text-xs-size);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-1);
}

@media (max-width: 1000px) {
    .detail-layout { flex-direction: column; }
    .detail-historie { width: 100%; }
    .feld-grid-2, .feld-grid-3 { grid-template-columns: 1fr; }
}

.table th {
    text-align: left;
    padding: var(--space-3) var(--space-4);
    background: var(--color-gray-50);
    border-bottom: 1px solid var(--color-border);
    font-size: var(--text-xs-size);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-primary);
    vertical-align: middle;
}

.table tbody tr:hover {
    background: var(--color-gray-50);
}

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

/* ============================================================== Badge/Status-Chip (DS Sec. 3.7) */
.badge {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs-size);
    font-weight: 500;
    white-space: nowrap;
}

.badge-neutral {
    background: var(--color-gray-100);
    color: var(--color-text-secondary);
}

.badge-ok {
    background: var(--color-status-ok-surface);
    color: var(--color-status-ok-text);
}

.badge-err {
    background: var(--color-status-err-surface);
    color: var(--color-status-err-text);
}

/* ============================================================== Empty-State (DS Sec. 3.9) */
.empty {
    text-align: center;
    padding: var(--space-12) var(--space-6);
    color: var(--color-text-secondary);
}

.empty h2 {
    font-size: var(--text-xl-size);
    font-weight: var(--text-xl-weight);
    color: var(--color-text-primary);
    margin-bottom: var(--space-2);
}

.empty p {
    font-size: var(--text-base-size);
    margin: 0 auto;
    max-width: 42ch;
}

/* ============================================================== Responsiv (CRM bis 1024px, dann Nav oben) */
@media (max-width: 768px) {
    .app {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        padding: var(--space-3) var(--space-4);
        gap: var(--space-4);
    }

    .nav {
        flex-direction: row;
    }

    .content {
        padding: var(--space-6) var(--space-4);
    }

    .topbar {
        padding: 0 var(--space-4);
    }
}

/* ============================================================== reduced-motion (DS Sec. 2.6) */
@media (prefers-reduced-motion: reduce) {
    * {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
