/**
 * theme-hh2.css — Design-Test „Real Estate CRM – Complete UI Design System“ v2.0 (Light) / v2.1 (Dark)
 * =====================================================================================================
 * Nur aktiv mit Schalter (includes/design_variant.php: ?design=hh2, Cookie hh_design, HHCRM_DESIGN_DEFAULT).
 * Lädt NACH theme.css und allen Modul-CSS. Modul-CSS nutzt var(--hh2-*, alter Wert) (cli/design-tokenize.py):
 * ohne diese Datei gilt überall der alte Wert.
 *
 * Grundsätze (Spezifikation):
 *   - 90 % neutral: Schwarz/Weiß/Grau. Schwarz nur für Primäraktionen (Dark: Weiß).
 *   - Türkis #14B8A6 nur für eingeschaltete Ja-Schalter. Rot nur für echte Negativ-Zustände.
 *   - Textlinks Blau #2457A6. Statusfarben dezent (Semantic + 28 Vermittlungsphasen).
 *   - Radius: 4 / 6 / 8 / 12 / 16 / 20 / 9999. Inputs & Buttons 8, Cards 12, Modals 16, Badges 6, Counter/Toggle rund.
 *   - Inter, Page Title 24/600, Body 14.
 */

@font-face {
    font-family: "Inter Variable";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter/InterVariable.woff2") format("woff2");
}
@font-face {
    font-family: "Inter Variable";
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter/InterVariable-Italic.woff2") format("woff2");
}

/* ============================================================
   1. TOKENS — LIGHT (Spezifikation §17)
   Selektor auch für Dark-Root: sonst gewinnt theme.css :root[data-theme="dark"] (höhere Spezifität)
   mit den alten Dark-Werten. Der Dark-Block weiter unten setzt danach nur die Dark-Werte.
   ============================================================ */
:root, :root[data-theme="dark"] {
    /* Core */
    --rc-background:     #F8F8F8;
    --rc-sidebar:        #FFFFFF;
    --rc-surface:        #FFFFFF;
    --rc-elevated:       #FFFFFF;
    --rc-text:           #171717;
    --rc-text-2:         #4A4A4A;
    --rc-text-muted:     #666666;   /* a11y: war #6B6B6B (4.37:1 auf Phasen-Rot) → 5.74:1 auf Weiß, 4.71:1 auf #FCE3E3 */
    --rc-label:          #3D3D3D;
    --rc-border:         #D9D9D9;
    --rc-border-strong:  #BDBDBD;
    --rc-hover:          #F0F0F0;
    --rc-selected:       #F5F5F5;
    --rc-focus:          #525252;
    --rc-focus-ring:     0 0 0 3px rgba(0, 0, 0, .06);
    --rc-icon:           #4A4A4A;
    --rc-icon-active:    #171717;

    /* Buttons */
    --rc-btn:            #111111;
    --rc-btn-hover:      #292929;
    --rc-btn-active:     #000000;
    --rc-btn-text:       #FFFFFF;
    --rc-btn-disabled:   #D4D4D4;
    --rc-btn2:           #FFFFFF;
    --rc-btn2-border:    #D4D4D4;
    --rc-btn2-text:      #171717;
    --rc-btn2-hover:     #F5F5F5;
    --rc-ghost-text:     #3D3D3D;
    --rc-ghost-hover:    #F0F0F0;
    --rc-danger:         #DC5555;
    --rc-danger-hover:   #C94444;
    --rc-counter-bg:     #C94444;   /* a11y: Zähler-Badges (weiße Ziffer) – #DC5555 nur 3.84:1, #C94444 4.78:1 */
    --rc-surface-2:      var(--rc-selected); /* Dark-Audit: wurde genutzt, war nie definiert → Fallback #F5F5F5 auch im Dark (helle Summenzeile) */
    --rc-primary:        var(--rc-btn);      /* Dark-Audit: accent-color der Checkboxen, Fallback #171717 war im Dark unsichtbar */

    /* Links */
    --rc-link:           #2457A6;
    --rc-link-hover:     #173F7A;
    --rc-link-active:    #123461;
    --rc-link-visited:   #6941A5;

    /* Toggle */
    --rc-toggle-on:      #16A36A;   /* = Success (User 14.11.: besseres Grün statt Türkis) */
    --rc-toggle-on-text: #0E7A4E;
    --rc-toggle-off:     #D4D4D4;
    --rc-toggle-off-text:#737373;
    --rc-toggle-neg:     #DC5555;

    /* Semantic */
    /* Status-/Feedbackfarben (Spezifikation): nur gezielt einsetzen, Schwarz bleibt dominant.
       -text = gleiche Farbe, dunkler für lesbare Schrift auf hellem Grund */
    --rc-success: #16A36A;  --rc-success-text: #0E7A4E;  --rc-success-bg: #EAF7F0;
    --rc-warning: #D99A32;  --rc-warning-text: #8A5A12;  --rc-warning-bg: #FBF3E4;
    --rc-error:   #DC5555;  --rc-error-text:   #B33A3A;  --rc-error-bg:   #FCEDED;
    --rc-info:    #528BCB;  --rc-info-text:    #2F6299;  --rc-info-bg:    #EBF2FA;
    --rc-neutral: #525252;  --rc-neutral-bg: #F5F5F5;

    /* Phasen-Familien (§11) */
    --rc-ph-blue:   #234D85;  --rc-ph-blue-bg:   #DCE9F8;
    --rc-ph-red:    #A51717;  --rc-ph-red-bg:    #FCE3E3;
    --rc-ph-amber:  #6E4A12;  --rc-ph-amber-bg:  #FBE9CF;
    --rc-ph-purple: #43387D;  --rc-ph-purple-bg: #E5E2F6;
    --rc-ph-teal:   #1E5C53;  --rc-ph-teal-bg:   #D6EEE9;
    --rc-ph-gray:   #404040;  --rc-ph-gray-bg:   #EBEBEB;
    --rc-ph-green:  #116B33;  --rc-ph-green-bg:  #DDF5E5;
    --rc-ph-dred:   #8A1515;  --rc-ph-dred-bg:   #FBD0D0;
    /* Phasen-Fortschritt: Anteil Textfarbe in der Fläche = mix0 + Schritt (0–8) × mixk */
    --rc-ph-mix0: 10%; --rc-ph-mixk: 3%;
    /* Phasen kräftiger (15.11.2026, Hell + Dunkel): Fläche Tailwind 300, Schrift 900, Gruppen-Titel + Zeilenstreifen 400.
       Gilt für Phasen-Flächen im A-Z-Board und Objekt-Status-Badges; die Familien-Töne oben bleiben für alles andere. */
    --rc-ph-blue-fill:   #93C5FD; --rc-ph-blue-ink:   #1E3A8A; --rc-ph-blue-head:   #60A5FA;
    --rc-ph-red-fill:    #FCA5A5; --rc-ph-red-ink:    #7F1D1D; --rc-ph-red-head:    #F87171;
    --rc-ph-amber-fill:  #FCD34D; --rc-ph-amber-ink:  #78350F; --rc-ph-amber-head:  #FBBF24;
    --rc-ph-purple-fill: #C4B5FD; --rc-ph-purple-ink: #4C1D95; --rc-ph-purple-head: #A78BFA;
    --rc-ph-teal-fill:   #5EEAD4; --rc-ph-teal-ink:   #134E4A; --rc-ph-teal-head:   #2DD4BF;
    --rc-ph-gray-fill:   #D4D4D4; --rc-ph-gray-ink:   #171717; --rc-ph-gray-head:   #A3A3A3;
    --rc-ph-green-fill:  #86EFAC; --rc-ph-green-ink:  #14532D; --rc-ph-green-head:  #4ADE80;
    --rc-ph-dred-fill:   #FDA4AF; --rc-ph-dred-ink:   #881337; --rc-ph-dred-head:   #FB7185;
    /* Chart-Töne je Familie (mittlere Sättigung, für Linien/Balken/Torten) */
    --rc-chart-blue: #528BCB; --rc-chart-red: #DC5555; --rc-chart-amber: #D99A32; --rc-chart-purple: #7D6EC6;
    --rc-chart-ink: #3D3D3D; --rc-chart-teal: #2F9A8A; --rc-chart-gray: #9A9A9A; --rc-chart-green: #16A36A; --rc-chart-dred: #9E2B2B;

    /* Radius (§4) */
    --rc-r-xs: 4px; --rc-r-sm: 6px; --rc-r-md: 8px; --rc-r-lg: 12px; --rc-r-xl: 16px; --rc-r-2xl: 20px; --rc-r-full: 9999px;

    /* Schatten: sehr subtil (§7) */
    --rc-shadow-card: 0 1px 2px rgba(0, 0, 0, .04);
    --rc-shadow-pop:  0 8px 24px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .04);
    --rc-shadow-modal:0 20px 48px rgba(0, 0, 0, .12);

    /* Größen */
    --rc-input-h: 42px;
    --rc-search-h: 40px;
    --rc-ctl-h: 36px;       /* Werkzeugleisten-Buttons */
    --rc-pager-h: 36px;   /* auch Pagination: eine gemeinsame Höhe */

    /* ---------- Bestehende CRM-Tokens (theme.css) auf das System gelegt ---------- */
    --gray-50: #FAFAFA; --gray-100: #F5F5F5; --gray-200: #F0F0F0; --gray-300: #E5E5E5; --gray-400: #D4D4D4;
    --gray-500: #707070; /* a11y: war #8C8C8C (3.36:1) → Weiß darauf 4.95:1, als Text auf #F8F8F8 4.66:1 */ --gray-600: #666666; --gray-700: #525252; --gray-800: #171717; --gray-900: #0A0A0A;
    /* ehemals Teal-Marke: jetzt neutral */
    --green-50: #F5F5F5; --green-100: #F0F0F0; --green-400: #D4D4D4; --green-500: #171717;
    --green-600: #111111; --green-700: #000000; --green-800: #000000; --green-900: #000000;
    --red-100: #FEF2F2; --red-500: #DC5555; --red-600: #B91C1C; --red-700: #991B1B;
    --amber-100: #FFFBEB; --amber-400: #F59E0B; --amber-500: #B45309; --amber-600: #B45309; --amber-700: #92400E;
    --blue-100: #EFF6FF; --blue-500: #1D4ED8; --blue-600: #1D4ED8; --blue-700: #1E40AF;
    --success-500: #15803D; --success-700: #166534;
    --link-500: #2457A6; --link-600: #173F7A;
    --purple-500: var(--rc-ph-purple); --purple-400: var(--rc-ph-purple); --purple-100: var(--rc-ph-purple-bg);
    --blue-700: var(--rc-ph-blue); --amber-700: var(--rc-ph-amber);

    --color-background: var(--rc-background);
    --color-surface:    var(--rc-surface);
    --color-surface-2:  var(--rc-selected);
    --color-hover:      var(--rc-hover);
    --color-input-bg:   var(--rc-surface);
    --color-skeleton:   #F0F0F0;
    --color-iconbox-bg: #F5F5F5;
    --color-iconbox-fg: #525252;
    --color-mint:       #F0F0F0;
    --badge-ink:        #171717;
    --scrollbar-thumb:  rgba(0, 0, 0, .18);
    --color-modal:      var(--rc-surface);
    --glass-bg:         var(--rc-sidebar);
    --color-white:      #FFFFFF;
    --color-title:          var(--rc-text);
    --color-text:           var(--rc-text);
    --color-text-secondary: var(--rc-text-2);
    --color-text-muted:     var(--rc-text-muted);
    --color-line:         var(--rc-border);
    --color-border:       var(--rc-border);
    --color-border-light: var(--rc-border);
    --color-primary:      var(--rc-text);
    --color-accent:       var(--rc-text);
    --color-accent-dark:  #000000;
    --color-link:         var(--rc-link);
    --color-on-accent:    #FFFFFF;
    --color-success: var(--rc-success); --color-error: var(--rc-error); --color-danger: var(--rc-danger);
    --color-warning: var(--rc-warning); --color-info: var(--rc-info);
    --presence-online: #16A34A; --presence-away: #D97706; --presence-busy: #DC5555; --presence-offline: #A3A3A3;
    --color-success-bg: var(--rc-success-bg); --color-success-text: var(--rc-success-text);
    --color-error-bg:   var(--rc-error-bg);   --color-error-text:   var(--rc-error-text);
    --color-warning-bg: var(--rc-warning-bg); --color-warning-text: var(--rc-warning-text);
    --color-info-bg:    var(--rc-info-bg);    --color-info-text:    var(--rc-info-text);
    --color-accent-bg:  var(--rc-neutral-bg); --color-accent-text:  var(--rc-neutral);
    --color-neutral-bg: var(--rc-neutral-bg); --color-neutral-text: var(--rc-neutral);
    --color-purple-bg:  var(--rc-ph-purple-bg); --color-purple-text: var(--rc-ph-purple);
    --color-indigo-bg:  var(--rc-ph-blue-bg);   --color-indigo-text: var(--rc-ph-blue);
    --color-pink-bg:    #FDF2F8;               --color-pink-text:   #9D174D;
    --nav-active-bg:   var(--rc-selected);
    --nav-active-text: var(--rc-text);
    --font-family: "Inter Variable", Inter, sans-serif;
    --radius-sm: var(--rc-r-sm); --radius-md: var(--rc-r-md); --radius-lg: var(--rc-r-lg); --radius-xl: var(--rc-r-xl);
    --radius-pill: var(--rc-r-full);
    --shadow-xs: var(--rc-shadow-card); --shadow-sm: var(--rc-shadow-card); --shadow-md: var(--rc-shadow-card);
    --shadow-lg: var(--rc-shadow-pop);  --shadow-xl: var(--rc-shadow-modal);
    --shadow-focus: var(--rc-focus-ring);

    /* ---------- Ziel-Variablen des Tokenizers (Modul-CSS: var(--hh2-*, alter Wert)) ---------- */
    --hh2-r-s:  var(--rc-r-xs);     /* alte 2–4 px  → 4 */
    --hh2-r-m:  var(--rc-r-sm);     /* alte 5–6 px  → 6 */
    --hh2-r-l:  var(--rc-r-md);     /* alte 7–8 px  → 8 */
    --hh2-r-xl: var(--rc-r-lg);     /* alte 9–12 px → 12 */
    --hh2-r:    var(--rc-r-md);
    --hh2-r-2xl: var(--rc-r-xl);    /* alte 14–40 px → 16 (Karten, Modals) */
    --hh2-pill: var(--rc-r-full);   /* Pills, Counter */
    --hh2-ink:     var(--rc-text);
    --hh2-text-2:  var(--rc-text-2);
    --hh2-muted:   var(--rc-text-muted);
    --hh2-surface: var(--rc-surface);
    --hh2-subtle:  var(--rc-selected);
    --hh2-panel:   var(--rc-selected);
    --hh2-inverse: #171717;
    --hh2-line:    var(--rc-border);
    --hh2-hover-bg:   var(--rc-hover);
    --hh2-hover-line: var(--rc-border-strong);
    --hh2-selected-bg: var(--rc-hover);
    --hh2-selected-fg: var(--rc-text);
    --hh2-accent:        var(--rc-text);
    --hh2-accent-strong: var(--rc-text);
    --hh2-accent-deep:   var(--rc-text);
    --hh2-accent-soft:   var(--rc-border);
    --hh2-accent-tint:   var(--rc-selected);
    --hh2-accent-wash:   var(--rc-selected);
    --hh2-accent-fill:   #525252;           /* Fortschritt, Punkte, kleine Akzentflächen: neutral */
    --hh2-accent-line:   var(--rc-border-strong);
    --hh2-action-fill:   var(--rc-btn);     /* Akzent-Buttons = Primary */
    --hh2-on-fill:       var(--rc-toggle-on);/* eingeschaltete Schalter */
    --hh2-accent-mint:   var(--rc-btn);     /* alte Mint-CTAs = Primary */
    --hh2-accent-mint-hover: var(--rc-btn-hover);
    --hh2-chroma: 1;                        /* Statusfarben unverändert */
    --hh2-accent-a0: transparent;
    --hh2-accent-a3: rgba(0,0,0,.02);  --hh2-accent-a5: rgba(0,0,0,.025); --hh2-accent-a6: rgba(0,0,0,.03);
    --hh2-accent-a8: rgba(0,0,0,.035); --hh2-accent-a9: rgba(0,0,0,.04);  --hh2-accent-a10: rgba(0,0,0,.04);
    --hh2-accent-a12: rgba(0,0,0,.05); --hh2-accent-a14: rgba(0,0,0,.055);--hh2-accent-a15: rgba(0,0,0,.06);
    --hh2-accent-a16: rgba(0,0,0,.06); --hh2-accent-a20: rgba(0,0,0,.08); --hh2-accent-a25: rgba(0,0,0,.1);
    --hh2-accent-a30: rgba(0,0,0,.12); --hh2-accent-a35: rgba(0,0,0,.14); --hh2-accent-a40: rgba(0,0,0,.16);
    --hh2-accent-a45: rgba(0,0,0,.18); --hh2-accent-a50: rgba(0,0,0,.2);  --hh2-accent-a55: rgba(0,0,0,.22);
    --hh2-accent-a60: rgba(0,0,0,.24); --hh2-accent-a70: rgba(0,0,0,.28); --hh2-accent-a80: rgba(0,0,0,.32);
    --hh2-accent-a95: rgba(0,0,0,.38);
    --hh2-mint-a0: transparent; --hh2-mint-a8: rgba(0,0,0,.035); --hh2-mint-a10: rgba(0,0,0,.04);
    --hh2-mint-a12: rgba(0,0,0,.05); --hh2-mint-a14: rgba(0,0,0,.055); --hh2-mint-a15: rgba(0,0,0,.06);
    --hh2-mint-a18: rgba(0,0,0,.07); --hh2-mint-a20: rgba(0,0,0,.08); --hh2-mint-a30: rgba(0,0,0,.1);
    --hh2-mint-a35: rgba(0,0,0,.12); --hh2-mint-a45: rgba(0,0,0,.15); --hh2-mint-a50: rgba(0,0,0,.16);
    --hh2-mint-a60: rgba(0,0,0,.2);
}

/* ============================================================
   2. TOKENS — DARK (v2.1: Anthrazit, weiße Primary)
   ============================================================ */
:root[data-theme="dark"] {
    --rc-background:     #111214;
    --rc-sidebar:        #151619;
    --rc-surface:        #191A1D;
    --rc-elevated:       #222429;
    --rc-text:           #F5F5F5;
    --rc-text-2:         #BDBDC4;
    --rc-text-muted:     #9C9CA5;   /* a11y: war #8E8E97 (4.36:1 auf Hover) → 5.20:1 auf #292B30, 4.62:1 auf #552429 */
    --rc-label:          #C4C4CB;
    --rc-border:         #34373D;
    --rc-border-strong:  #4A4D55;
    --rc-hover:          #292B30;
    --rc-selected:       #292B30;
    --rc-focus:          #8C8C8C;
    --rc-focus-ring:     0 0 0 3px rgba(255, 255, 255, .08);
    --rc-icon:           #AEB1B7;
    --rc-icon-active:    #F5F5F5;

    --rc-btn:            #F5F5F5;
    --rc-btn-hover:      #E4E4E7;
    --rc-btn-active:     #FFFFFF;
    --rc-btn-text:       #171717;
    --rc-btn-disabled:   #3A3D44;
    --rc-btn2:           #222429;
    --rc-btn2-border:    #44474F;
    --rc-btn2-text:      #F5F5F5;
    --rc-btn2-hover:     #292B30;
    --rc-ghost-text:     #D4D4D8;
    --rc-ghost-hover:    #292B30;
    --rc-danger:         #B91C1C;
    --rc-danger-hover:   #991B1B;

    --rc-link:           #75A7F7;
    --rc-link-hover:     #A4C5FF;
    --rc-link-active:    #C3D8FF;
    --rc-link-visited:   #B69BEE;

    --rc-toggle-on:      #3FBF85;
    --rc-toggle-on-text: #7FD8AE;
    --rc-toggle-off:     #3A3D44;
    --rc-toggle-off-text:#A1A1AA;
    --rc-toggle-neg:     #DC5555;

    --rc-success: #3FBF85;  --rc-success-text: #7FD8AE;  --rc-success-bg: #173A2A;
    --rc-warning: #E0AE55;  --rc-warning-text: #EDC57E;  --rc-warning-bg: #3D2F17;
    --rc-error:   #E57373;  --rc-error-text:   #F0A0A0;  --rc-error-bg:   #432024;
    --rc-info:    #6C9FD8;  --rc-info-text:    #9DC0EA;  --rc-info-bg:    #1B2E45;
    --rc-neutral: #B4B4BC;  --rc-neutral-bg: #303136;

    --rc-ph-blue:   #A4C6F2;  --rc-ph-blue-bg:   #21395A;
    --rc-ph-red:    #F49393;  --rc-ph-red-bg:    #552429;
    --rc-ph-amber:  #F0C886;  --rc-ph-amber-bg:  #533C20;
    --rc-ph-purple: #C2B7F4;  --rc-ph-purple-bg: #3A335C;
    --rc-ph-teal:   #80D3C2;  --rc-ph-teal-bg:   #1D4A42;
    --rc-ph-gray:   #C4C4CB;  --rc-ph-gray-bg:   #393A40;
    --rc-ph-green:  #7DD6A0;  --rc-ph-green-bg:  #1E4731;
    --rc-ph-dred:   #FDB5B5;  --rc-ph-dred-bg:   #62222C;
    --rc-ph-mix0: 6%; --rc-ph-mixk: 2%;
    /* Dunkel: gleiche Phasen-Töne wie Hell, Fläche zu 85 % deckend; Schrift (900) und Titel/Streifen (400) wie Hell */
    --rc-ph-blue-fill: #93C5FDD9; --rc-ph-blue-ink: #1E3A8A; --rc-ph-blue-head: #60A5FA;
    --rc-ph-red-fill: #FCA5A5D9; --rc-ph-red-ink: #7F1D1D; --rc-ph-red-head: #F87171;
    --rc-ph-amber-fill: #FCD34DD9; --rc-ph-amber-ink: #78350F; --rc-ph-amber-head: #FBBF24;
    --rc-ph-purple-fill: #C4B5FDD9; --rc-ph-purple-ink: #4C1D95; --rc-ph-purple-head: #A78BFA;
    --rc-ph-teal-fill: #5EEAD4D9; --rc-ph-teal-ink: #134E4A; --rc-ph-teal-head: #2DD4BF;
    --rc-ph-gray-fill: #D4D4D4D9; --rc-ph-gray-ink: #171717; --rc-ph-gray-head: #A3A3A3;
    --rc-ph-green-fill: #86EFACD9; --rc-ph-green-ink: #14532D; --rc-ph-green-head: #4ADE80;
    --rc-ph-dred-fill: #FDA4AFD9; --rc-ph-dred-ink: #881337; --rc-ph-dred-head: #FB7185;
    --rc-chart-blue: #6C9FD8; --rc-chart-red: #E57373; --rc-chart-amber: #E0AE55; --rc-chart-purple: #9A8CDB;
    --rc-chart-ink: #D4D4D8; --rc-chart-teal: #4FB5A5; --rc-chart-gray: #8E8E97; --rc-chart-green: #3FBF85; --rc-chart-dred: #C04848;

    --rc-shadow-card: none;
    --rc-shadow-pop:  0 8px 24px rgba(0, 0, 0, .45);
    --rc-shadow-modal:0 20px 48px rgba(0, 0, 0, .55);

    --gray-50: #151619; --gray-100: #191A1D; --gray-200: #222429; --gray-300: #2A2C31; --gray-400: #3A3D44;
    --gray-500: #8A8A93; /* a11y: war #71717A (3.71:1) → #171717 darauf 5.24:1, als Text auf #111214 5.48:1 */ --gray-600: #A1A1AA; --gray-700: #D4D4D8; --gray-800: #F5F5F5; --gray-900: #FAFAFA;
    --green-50: #222429; --green-100: #292B30; --green-400: #3A3D44; --green-500: #F5F5F5;
    --green-600: #E4E4E7; --green-700: #FFFFFF; --green-800: #FFFFFF; --green-900: #FFFFFF;
    --link-500: #75A7F7; --link-600: #A4C5FF;

    --color-skeleton:   #222429;
    --color-iconbox-bg: #222429;
    --color-iconbox-fg: #D4D4D8;
    --badge-ink:        #F5F5F5;
    --scrollbar-thumb:  rgba(255, 255, 255, .18);
    --color-modal:      var(--rc-surface);
    --color-white:      var(--rc-surface);
    --color-text:       #E4E4E7;
    --color-accent-dark: #FFFFFF;
    --color-on-accent:  #171717;
    --presence-online: #4ADE80; --presence-away: #FBBF24; --presence-busy: #F08080; --presence-offline: #71717A;
    --color-pink-bg: #3B1F2C; --color-pink-text: #F5B4D0;

    --hh2-inverse: #0E0F11;
    --hh2-accent-soft: var(--rc-text-2); /* Dark-Audit: war #34373D (= Rahmen) und wird im Dark als Schriftfarbe genutzt (Badges, MyOffice) → #BDBDC4 */
    --hh2-accent-fill: #A1A1AA;
    --hh2-accent-a3: rgba(255,255,255,.02);  --hh2-accent-a5: rgba(255,255,255,.03); --hh2-accent-a6: rgba(255,255,255,.035);
    --hh2-accent-a8: rgba(255,255,255,.04);  --hh2-accent-a9: rgba(255,255,255,.045);--hh2-accent-a10: rgba(255,255,255,.05);
    --hh2-accent-a12: rgba(255,255,255,.06); --hh2-accent-a14: rgba(255,255,255,.065);--hh2-accent-a15: rgba(255,255,255,.07);
    --hh2-accent-a16: rgba(255,255,255,.07); --hh2-accent-a20: rgba(255,255,255,.09);--hh2-accent-a25: rgba(255,255,255,.11);
    --hh2-accent-a30: rgba(255,255,255,.13); --hh2-accent-a35: rgba(255,255,255,.15);--hh2-accent-a40: rgba(255,255,255,.17);
    --hh2-accent-a45: rgba(255,255,255,.19); --hh2-accent-a50: rgba(255,255,255,.2); --hh2-accent-a55: rgba(255,255,255,.22);
    --hh2-accent-a60: rgba(255,255,255,.24); --hh2-accent-a70: rgba(255,255,255,.28);--hh2-accent-a80: rgba(255,255,255,.32);
    --hh2-accent-a95: rgba(255,255,255,.38);
    --hh2-mint-a8: rgba(255,255,255,.04); --hh2-mint-a10: rgba(255,255,255,.05); --hh2-mint-a12: rgba(255,255,255,.06);
    --hh2-mint-a14: rgba(255,255,255,.065); --hh2-mint-a15: rgba(255,255,255,.07); --hh2-mint-a18: rgba(255,255,255,.08);
    --hh2-mint-a20: rgba(255,255,255,.09); --hh2-mint-a30: rgba(255,255,255,.12); --hh2-mint-a35: rgba(255,255,255,.14);
    --hh2-mint-a45: rgba(255,255,255,.17); --hh2-mint-a50: rgba(255,255,255,.18); --hh2-mint-a60: rgba(255,255,255,.22);
    color-scheme: dark;
}

/* ============================================================
   3. GRUNDLAGEN & TYPOGRAFIE (§13)
   ============================================================ */
html, body, button, input, select, textarea { font-family: var(--font-family); }
body {
    background-color: var(--rc-background);
    color: var(--rc-text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    font-optical-sizing: auto;
}
h1, h2, h3, h4, .page-title, .board-title, .card-title, .section-title { color: var(--rc-text); line-height: 1.3; }
:root .board-title { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; }
:root .welcome-title { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
:root .card-title, :root .card-header h3, :root .widget-title { font-size: 16px; font-weight: 600; }
:root .section-title, :root .settings-section h2, :root .form-section-title { font-size: 18px; font-weight: 600; }
/* tabellarische Ziffern nur für Zahlenwerte: Inter macht mit tnum auch Bindestriche ziffernbreit („Hans - Werner“) */
:is(.kpi-value, .stat-value, .tabular, .amount, .price, .num, .text-right, td.text-end, [class*="-amount"], [class*="-price"], [class*="-sum"], [class*="-total"]) { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--rc-focus); outline-offset: 2px; }
::selection { background: rgba(36, 87, 166, .18); }
:root[data-theme="dark"] ::selection { background: rgba(117, 167, 247, .28); }
:root .main-content { background-color: var(--rc-background); }
:root .board-header { background-color: var(--rc-surface); border-bottom: 1px solid var(--rc-border); }

/* Textlinks (§10): nur Links ohne eigene Klasse und ausdrückliche Link-Klassen – keine Buttons.
   Links übernehmen die Textfarbe des Umfelds (kein Blau) und werden NIE unterstrichen (User-Entscheid 22.11.2026);
   erkennbar über Schriftstärke 500, Hover leicht abgedunkelt. Besuchte Links bleiben unverändert (nicht lila).
   Nur .text-link/.link sind ausdrücklich blau. */
:root a:not([class]), :root td a:not([class*="btn"]):not([class*="badge"]) {
    color: inherit;
    font-weight: 500;
    text-decoration: none;
}
:root a:not([class]):hover, :root td a:not([class*="btn"]):not([class*="badge"]):hover {
    color: inherit;
    text-decoration: none;
    opacity: 0.75;
}
/* Navigation, Fußzeilen, Überschriften: Link ist durch Position erkennbar, Schrift nicht fetter */
:root :is(nav, footer, header, h1, h2, h3, h4, h5, h6, [role="navigation"]) a:not([class]) {
    text-decoration: none;
    font-weight: inherit;
}
:root .text-link, :root .link {
    color: var(--rc-link);
    font-weight: 500;
    text-decoration: none;
}
:root .text-link:hover, :root .link:hover { color: var(--rc-link-hover); text-decoration: none; }
:root .text-link:active { color: var(--rc-link-active); }
:root a:not([class]):focus-visible, :root .text-link:focus-visible { border-radius: 2px; }

/* ============================================================
   4. BUTTONS (§3) — Primary schwarz (Dark: weiß), Secondary weiß/Linie, Ghost, Destructive
   ============================================================ */
:root .btn, :root .btn-primary, :root .btn-secondary, :root .btn-green, :root .btn-danger,
:root .btn-save, :root .btn-cancel, :root .btn-modal, :root .btn-filter, :root .toolbar-btn,
:root .btn-add-entry, :root .btn-new-board, :root .btn-compose,
:root .btn-action, :root .btn-add-filter, :root .btn-generate,
:root .azb-tool-btn, :root .filter-toggle, :root .re-quick-filter-btn, :root .ctrl-period-btn,
:root .ctrl-toggle, :root .nav-btn, :root .btn-outline,
:root .ctrl-role-select, :root .ctrl-divisionsleiter-select {
    border-radius: var(--rc-r-md);
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
:root .board-header .btn-primary, :root .board-header .btn-new-board, :root .board-header .btn-compose,
:root .board-header .btn-add-entry, :root .board-header .btn-save,
:root .btn-filter, :root .toolbar-btn, :root .azb-tool-btn, :root .filter-toggle,
:root .re-quick-filter-btn, :root .ctrl-period-btn, :root .ctrl-toggle, :root .nav-btn,
:root .btn-outline, :root .ctrl-role-select, :root .ctrl-divisionsleiter-select {
    min-height: var(--rc-ctl-h);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
:root .board-header .btn-primary, :root .board-header .btn-new-board, :root .board-header .btn-compose,
:root .board-header .btn-add-entry, :root .board-header .btn-save { height: var(--rc-ctl-h); padding: 0 16px; }

/* Primary */
:root .btn-primary, :root .btn-save, :root .btn-new-board, :root .btn-compose,
:root .btn-add-entry, :root .btn-generate, :root .btn-green, :root .btn-login {
    background-color: var(--rc-btn);
    color: var(--rc-btn-text);
    border: 1px solid var(--rc-btn);
    opacity: 1;
    box-shadow: none;
}
:root .btn-primary:hover, :root .btn-save:hover, :root .btn-new-board:hover, :root .btn-compose:hover,
:root .btn-add-entry:hover, :root .btn-generate:hover, :root .btn-green:hover, :root .btn-login:hover {
    background-color: var(--rc-btn-hover);
    border-color: var(--rc-btn-hover);
    color: var(--rc-btn-text);
    opacity: 1;
    box-shadow: none;
    transform: none;
}
:root .btn-primary:active, :root .btn-save:active, :root .btn-login:active { background-color: var(--rc-btn-active); }
:root .btn-primary:disabled, :root .btn-save:disabled, :root .btn-login:disabled {
    background-color: var(--rc-btn-disabled); border-color: var(--rc-btn-disabled); color: var(--rc-btn-text);
}
/* Secondary */
:root .btn-secondary, :root .btn-cancel, :root .btn-filter, :root .toolbar-btn,
:root .btn-add-filter, :root .btn-action, :root .azb-tool-btn,
:root .filter-toggle, :root .re-quick-filter-btn, :root .ctrl-period-btn, :root .ctrl-toggle,
:root .nav-btn, :root .btn-outline, :root .ctrl-role-select, :root .ctrl-divisionsleiter-select,
:root .btn-modal:not(.btn-primary):not(.btn-danger) {
    background-color: var(--rc-btn2);
    color: var(--rc-btn2-text);
    border: 1px solid var(--rc-btn2-border);
    box-shadow: none;
}
:root .btn-secondary:hover, :root .btn-cancel:hover, :root .btn-filter:hover, :root .toolbar-btn:hover,
:root .btn-add-filter:hover, :root .btn-action:hover, :root .azb-tool-btn:hover,
:root .filter-toggle:hover, :root .re-quick-filter-btn:hover, :root .ctrl-period-btn:hover,
:root .ctrl-toggle:hover, :root .nav-btn:hover, :root .btn-outline:hover, :root .ctrl-role-select:hover {
    background-color: var(--rc-btn2-hover);
    border-color: var(--rc-border-strong);
    opacity: 1;
}
:root .filter-toggle, :root .re-quick-filter-btn, :root .ctrl-period-btn { font-size: 13px; padding: 0 12px; }
/* Aktiver Zustand (Filter, Segment, Ansicht): ausgewählt, neutral */
:root .toolbar-btn.active, :root .btn-filter.active,
:root .filter-toggle.is-active, :root .filter-toggle:has(input:checked),
:root .re-quick-filter-btn.active, :root .ctrl-period-btn.active, :root .ctrl-toggle:has(input:checked) {
    background-color: var(--rc-hover);
    border-color: var(--rc-border-strong);
    color: var(--rc-text);
    font-weight: 600;
}
/* Destructive */
:root .btn-danger { background-color: var(--rc-danger); color: #FFFFFF; border: 1px solid var(--rc-danger); }
:root .btn-danger:hover { background-color: var(--rc-danger-hover); border-color: var(--rc-danger-hover); }
/* Segment-Gruppen */
/* Segment-Gruppen (Ansicht, Umfang, Status): EIN Rahmen, 36 px, innere Trennlinien, aktiv = ausgewählt */
:root :is(.azb-seg, .view-switcher, .scope-switcher) {
    display: inline-flex; align-items: stretch;
    height: var(--rc-ctl-h); box-sizing: border-box;
    border: 1px solid var(--rc-btn2-border); border-radius: var(--rc-r-md);
    background: var(--rc-btn2); overflow: hidden; padding: 0; gap: 0;
}
:root :is(.azb-seg, .view-switcher, .scope-switcher) > button {
    height: 100%; min-height: 0; margin: 0;
    padding: 0 12px; min-width: 36px;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: 0; border-radius: 0; box-shadow: none;
    background: transparent; color: var(--rc-text-2); font-size: 14px; font-weight: 500;
}
:root :is(.azb-seg, .view-switcher, .scope-switcher) > button + button { border-left: 1px solid var(--rc-btn2-border); }
:root :is(.azb-seg, .view-switcher, .scope-switcher) > button:hover { background: var(--rc-btn2-hover); color: var(--rc-text); }
:root :is(.azb-seg, .view-switcher, .scope-switcher) > button:is(.active, .is-on, [aria-pressed="true"]) {
    background: var(--rc-hover); color: var(--rc-text); font-weight: 600;
}
:root .scope-switcher { overflow: visible; }
:root .scope-switcher > button, :root .scope-switcher .user-filter-wrapper > .scope-btn { padding: 0; width: 36px; height: 100%; border: 0; border-radius: 0; background: transparent; color: var(--rc-text-2); }
:root .scope-switcher .user-filter-wrapper { display: flex; border-left: 1px solid var(--rc-btn2-border); }
:root .scope-switcher > button:first-child { border-radius: 7px 0 0 7px; }
:root .scope-switcher .user-filter-wrapper > .scope-btn { border-radius: 0 7px 7px 0; }
:root .scope-switcher .scope-btn:is(.active, [aria-pressed="true"]) { background: var(--rc-hover); color: var(--rc-text); }
:root .scope-switcher .scope-btn:hover { background: var(--rc-btn2-hover); color: var(--rc-text); }


/* ============================================================
   4b. EINHEITLICHE HÖHE (36 px) für ALLE Bedienelemente in Seitenkopf und Werkzeugleisten
   Feste Höhe statt Mindesthöhe, damit Innenabstände/Rahmen nichts mehr verschieben.
   ============================================================ */
:root :is(.board-header .btn-primary, .board-header .btn-new-board, .board-header .btn-compose, .board-header .btn-add-entry,
  .board-header .btn-save, .btn-filter, .toolbar-btn, .azb-tool-btn, .filter-toggle, .re-quick-filter-btn, .ctrl-period-btn,
  .ctrl-toggle, .nav-btn, .btn-outline, .ctrl-role-select, .ctrl-divisionsleiter-select, .cat-filter-display,
  .wf-btn, .rt-btn, .dk-refresh-btn, .notes-view-btn, .btn-column-picker, .btn-bulk-actions, .btn-icon-only,
  .board-header .btn-icon, .board-header .btn-action) {
    height: var(--rc-ctl-h); min-height: var(--rc-ctl-h); box-sizing: border-box;
    padding-top: 0; padding-bottom: 0; line-height: 1;
    display: inline-flex; align-items: center;
}
:root :is(.wf-btn, .rt-btn, .cat-filter-display, .dk-refresh-btn) { border-radius: var(--rc-r-md); }
/* Segmentgruppen weiterer Module */
:root :is(.dk-mode-switch, .notes-view-toggle) {
    display: inline-flex; height: var(--rc-ctl-h); box-sizing: border-box; border: 1px solid var(--rc-btn2-border);
    border-radius: var(--rc-r-md); overflow: hidden; background: var(--rc-btn2); padding: 0; gap: 0;
}
:root :is(.dk-mode-btn, .notes-view-btn) {
    height: 100%; min-height: 0; padding: 0 12px; border: 0; border-radius: 0; background: transparent;
    color: var(--rc-text-2); font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px;
}
:root :is(.dk-mode-btn, .notes-view-btn) + :is(.dk-mode-btn, .notes-view-btn) { border-left: 1px solid var(--rc-btn2-border); }
:root :is(.dk-mode-btn, .notes-view-btn):is(.active, .is-on) { background: var(--rc-hover); color: var(--rc-text); font-weight: 600; }
/* Felder in Werkzeugleisten (unabhängig vom Modul) */
:root :is(.board-header-2, .calendar-controls, .azb-toolbar, .filter-bar, .toolbar, .notes-toolbar, .wf-toolbar, .rt-toolbar,
  .dk-toolbar, .tickets-toolbar, .ticket-filters, .re-toolbar, .ctrl-toolbar, [class$="-toolbar"], [class*="-toolbar "],
  [class*="-bar"], [class*="-tools"], [class*="subheader"], [class*="filter-section"], [class*="-controls"])
  :is(input[type="text"], input[type="search"], input:not([type]), select, .search-input, .form-select, .wf-input):not(:is(.modal-content, .modal-body, form, .side-panel, .sidebar) *) {
    height: var(--rc-ctl-h); min-height: var(--rc-ctl-h); box-sizing: border-box; padding-top: 0; padding-bottom: 0;
}
/* Tab-Leisten überall gleich hoch: 44 px */
:root :is(.tab-btn, .ticket-tab, .wf-tab, .rt-tab, .settings-nav-btn, .filter-tab) {
    height: 44px; min-height: 44px; box-sizing: border-box; padding-top: 0; padding-bottom: 0;
    display: inline-flex; align-items: center; gap: 6px;
}


/* Buttons im ganzen System eine Höhe (36 px): Inhalte, Karten, Modals, Formulare */
:root :is(.btn, .btn-primary, .btn-secondary, .btn-danger, .btn-green, .btn-save, .btn-cancel, .btn-modal,
  .btn-action, .btn-add-filter, .btn-generate, .btn-outline, .wf-btn, .rt-btn, .btn-submit, .btn-confirm, .btn-delete,
  .btn-close-modal, .ai-expose-btn, .btn-link-action):not(.btn-sm):not(.btn-icon):not(.btn-icon-only):not(.btn-mini) {
    height: var(--rc-ctl-h); min-height: var(--rc-ctl-h); box-sizing: border-box;
    padding-top: 0; padding-bottom: 0; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
:root :is(.btn-sm, .btn-mini) { height: 30px; min-height: 30px; box-sizing: border-box; padding-top: 0; padding-bottom: 0; display: inline-flex; align-items: center; gap: 6px; border-radius: var(--rc-r-md); }
:root .btn-block { width: 100%; }


/* Weitere Bausteine auf die gemeinsamen Höhen (Audit heights2.js) */
:root :is(.btn-action-black, .btn-submit-note, .banner-insert-btn, .dk-load-more, .vote-button, .idea-action-btn,
  .drive-view-toggle, .news .view-btn, .view-btn) {
    height: var(--rc-ctl-h); min-height: var(--rc-ctl-h); box-sizing: border-box; padding-top: 0; padding-bottom: 0;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: var(--rc-r-md);
}
/* …aber Knöpfe IN einer Segment-Gruppe (Kalender T/Woche/M/L) bleiben eckig und füllen die Gruppe (sonst runde Innenkanten) */
:root :is(.azb-seg, .view-switcher, .scope-switcher) > button.view-btn { height: 100%; min-height: 0; border-radius: 0; }
:root .ticket-search, :root :is(.tickets-panel, .ticket-filters) :is(input, select) { height: var(--rc-ctl-h); min-height: var(--rc-ctl-h); box-sizing: border-box; }
:root .property-nav-link { min-height: 36px; height: auto; padding-top: 8px; padding-bottom: 8px; box-sizing: border-box; display: flex; align-items: center; border-radius: var(--rc-r-md); line-height: 1.3; }
:root :is(.form-input, .form-input-panel, .form-control, .form-select):not(:is([class*="-toolbar"], [class*="-bar"], [class*="subheader"], [class*="-controls"], [class*="filter-section"]) *) {
    min-height: var(--rc-input-h); box-sizing: border-box;
}
:root :is(input.form-input, input.form-input-panel, input.form-control, select.form-select, select.form-input):not(:is([class*="-toolbar"], [class*="-bar"], [class*="subheader"], [class*="-controls"], [class*="filter-section"]) *) {
    height: var(--rc-input-h);
}
/* kleine Segmente in Karten/Diagrammen: 30 px (= btn-sm) */
:root :is(.range-btn, .address-map-layer-btn) { height: 30px; min-height: 30px; box-sizing: border-box; padding: 0 10px; display: inline-flex; align-items: center; font-size: 13px; }

/* Ghost / Icon-Buttons (§3 Tertiary, §16 Icons): ohne Rahmen, Icon grau, Hover-Fläche */
:root .board-header .header-right { gap: 6px; }
:root .board-header .btn-icon, :root .board-header .btn-icon-small, :root .board-header .btn-action:not(:has(span)),
:root .btn-icon-only, :root .btn-column-picker, :root .btn-bulk-actions {
    width: var(--rc-ctl-h); min-width: var(--rc-ctl-h); height: var(--rc-ctl-h); padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    /* sichtbare Knopf-Fläche (Secondary-Stil): ohne Rahmen waren die Icons schwer als Knöpfe erkennbar */
    background: var(--rc-btn2);
    border: 1px solid var(--rc-btn2-border);
    border-radius: var(--rc-r-md);
    box-shadow: var(--rc-shadow-card);
    color: var(--rc-label);
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
:root .btn-bulk-actions { width: auto; padding: 0 8px; }
:root .board-header .btn-icon:hover, :root .board-header .btn-icon-small:hover, :root .board-header .btn-action:not(:has(span)):hover,
:root .btn-icon-only:hover, :root .btn-column-picker:hover, :root .btn-bulk-actions:not(.disabled):hover {
    background: var(--rc-btn2-hover);
    border-color: var(--rc-border-strong);
    color: var(--rc-icon-active);
    opacity: 1;
}
:root .board-header .header-right > * { margin-left: 0; margin-right: 0; }

/* Counter (§9): 22 px, rund, #F0F0F0 / #525252, 600 */
:root .counter, :root .wf-tab-count, :root .tab-count, :root .ticket-tab .count, :root .ticket-tab-count, :root .nav-badge {
    min-width: 22px; height: 22px; padding: 0 7px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--rc-r-full);
    background: var(--rc-hover);
    color: var(--rc-label);
    font-size: 12px; font-weight: 600; line-height: 1;
}
:root[data-theme="dark"] .counter, :root[data-theme="dark"] .wf-tab-count { background: #292B30; color: #D4D4D8; }

/* ============================================================
   5. TABS — Text, aktive Lasche mit 2 px Unterstrich in Textfarbe
   ============================================================ */
:root .tab-btn, :root .ticket-tab, :root .wf-tab, :root .rt-tab, :root .settings-nav-btn, :root .filter-tab {
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    color: var(--rc-text-2);
    font-weight: 500;
    box-shadow: none;
}
:root .tab-btn:hover, :root .ticket-tab:hover, :root .wf-tab:hover, :root .rt-tab:hover,
:root .settings-nav-btn:hover, :root .filter-tab:hover { background: transparent; color: var(--rc-text); }
:root .tab-btn.active, :root .ticket-tab.active, :root .wf-tab.is-on, :root .rt-tab.is-on,
:root .settings-nav-btn.active, :root .filter-tab.active, :root [role="tab"][aria-selected="true"] {
    background: transparent;
    color: var(--rc-text);
    border-bottom-color: var(--rc-text);
    font-weight: 600;
}

/* ============================================================
   6. FORMULARE (§5)
   ============================================================ */
:root input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="file"]),
:root select,
:root textarea {
    border-radius: var(--rc-r-md);
    border-color: var(--rc-border);
    background-color: var(--rc-surface);
    color: var(--rc-text);
    font-size: 14px;
}
/* Höhe 42 px in Formularen (nicht in dichten Tabellen-Zellen) */
:root :is(.form-group, .form-row, .form-field, .modal-body, .modal-content form, .settings-section, .detail-section, .login-container, .login-box, .auth-card, .field)
  :is(input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="password"], input[type="date"], input[type="datetime-local"], input[type="time"], input[type="url"], input:not([type]), select) {
    min-height: var(--rc-input-h);
    padding-left: 12px;
    padding-right: 12px;
}
:root .board-header input[type="text"], :root .board-header input[type="search"], :root .azb-search input,
:root .search-input, :root .filter-select, :root input[type="search"], :root [class*="search"] > input[type="text"] {
    min-height: var(--rc-search-h);
}
/* In Werkzeugleisten (Zeile unter dem Seitenkopf) alles auf eine Linie: 36 px */
:root :is(.board-header-2, .calendar-controls, .calendar-controls-left, .calendar-controls-right, .azb-toolbar, .filter-bar, .toolbar, .tasks-toolbar, .contacts-toolbar)
  :is(input[type="text"], input[type="search"], input:not([type]), select) {
    height: var(--rc-ctl-h); min-height: var(--rc-ctl-h); box-sizing: border-box; padding-top: 0; padding-bottom: 0;
}
/* Mehrzeilige Felder nur in Formularen mit Mindesthöhe; Chat-/Hugo-/Kommentar-Eingaben (rows=1, wachsen mit)
   behalten ihre eigene Höhe – globale min-height machte sie 100 px hoch */
:root :is(.form-group, .form-row, .form-field, .modal-body, .settings-section, .detail-section, .field) textarea:not([rows="1"]):not([rows="2"]) {
    min-height: 96px; padding: 10px 12px; resize: vertical;
}
:root input::placeholder, :root textarea::placeholder { color: var(--rc-text-muted); }
:root input:not([type="checkbox"]):not([type="radio"]):hover, :root select:hover, :root textarea:hover { border-color: var(--rc-border-strong); }
:root input:not([type="checkbox"]):not([type="radio"]):focus, :root select:focus, :root textarea:focus {
    border-color: var(--rc-focus);
    box-shadow: var(--rc-focus-ring);
    outline: none;
}
:root input:disabled, :root select:disabled, :root textarea:disabled { background-color: var(--rc-selected); border-color: var(--rc-border); color: var(--rc-text-muted); }
:root input.error, :root input.is-invalid, :root .has-error input, :root input[aria-invalid="true"] { border-color: #DC5555; }
:root label, :root .form-label, :root .form-group > label { color: var(--rc-label); font-size: 13px; font-weight: 500; }
:root .help-text, :root .form-hint, :root .helper-text, :root small.hint { color: var(--rc-text-muted); font-size: 12px; }
:root input[type="checkbox"], :root input[type="radio"] { accent-color: #171717; }
:root[data-theme="dark"] input[type="checkbox"], :root[data-theme="dark"] input[type="radio"] { accent-color: #F5F5F5; }

/* ============================================================
   7. FLÄCHEN: Cards 12, Dropdown 8, Popover 12, Modal 16 (§7)
   ============================================================ */
:root .card, :root .kpi-card, :root .stat-card, :root .panel, :root .table-container,
:root .filter-panel, :root .dashboard-card, :root .widget, :root .contacts-table, :root .tickets-panel {
    background-color: var(--rc-surface);
    border: 1px solid var(--rc-border);
    border-radius: var(--rc-r-lg);
    box-shadow: var(--rc-shadow-card);
}
:root .kpi-icon, :root .stat-icon, :root .card-icon, :root .icon-circle { border-radius: var(--rc-r-md); }
:root .kpi-value { font-weight: 600; color: var(--rc-text); }
:root .kpi-label { color: var(--rc-text-2); }
:root .modal-content, :root .modal-container, :root .modal-panel, :root .modal-box,
:root .modal-dialog, :root .modal-compose-content, :root .modal-wide, :root .modal-large {
    background-color: var(--rc-surface);
    border: 1px solid var(--rc-border);
    border-radius: var(--rc-r-xl);
    box-shadow: var(--rc-shadow-modal);
}
:root[data-theme="dark"] :is(.modal-content, .modal-container, .modal-panel, .modal-box, .modal-dialog) { border-color: var(--rc-border-strong); }
:root .dropdown-menu, :root .context-menu, :root .user-dropdown-menu, :root .property-dropdown-menu, :root .property-dropdown, :root .notification-panel, :root .quick-actions-menu {
    background-color: var(--rc-elevated);
    border: 1px solid var(--rc-border);
    border-radius: var(--rc-r-md);
    box-shadow: var(--rc-shadow-pop);
}
:root[data-theme="dark"] :is(.dropdown-menu, .context-menu, .user-dropdown-menu, .property-dropdown-menu, .property-dropdown, .notification-panel, .quick-actions-menu) { border-color: var(--rc-border-strong); }
/* Bilder (§8) */
:root .property-image, :root .gallery-image, :root .property-main-image img { border-radius: var(--rc-r-lg); }
:root .property-thumb, :root .property-card-thumb, :root .thumbnail img { border-radius: var(--rc-r-md); }

/* ============================================================
   8. TABELLEN (§15) — Kopf #F8F8F8, Zeilen-Hover, 48–56 px Zeilen
   ============================================================ */
:root:root table th, :root:root thead th, :root:root .header-cell, :root:root .table-header > *,
:root:root .azb-hcell, :root:root .azb-colhead, :root:root .sortable-th, :root:root .mo-table-head > * {
    font-family: var(--font-family);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: 0;
    text-transform: none;
    color: var(--rc-text-2);
    background-color: var(--rc-background);
    border-top: 0;
    border-bottom: 1px solid var(--rc-border);
    box-shadow: none;
}
:root[data-theme="dark"]:root table th, :root[data-theme="dark"]:root thead th, :root[data-theme="dark"]:root .header-cell,
:root[data-theme="dark"]:root .table-header > * { background-color: var(--rc-surface); color: var(--rc-text-2); }
:root:root .table-header, :root:root .mo-table-head, :root:root thead, :root:root thead tr {
    background-color: var(--rc-background); border-top: 0; box-shadow: none;
}
:root[data-theme="dark"]:root :is(.table-header, thead, thead tr) { background-color: var(--rc-surface); }
:root:root td { padding-top: 12px; padding-bottom: 12px; border-bottom-color: var(--rc-border); font-size: 14px; }
:root:root tbody tr:hover > td { background-color: var(--rc-background); }
:root[data-theme="dark"]:root tbody tr:hover > td { background-color: var(--rc-elevated); }
:root:root th.sortable:hover, :root:root .sortable-th:hover, :root:root .header-cell.sortable:hover { color: var(--rc-text); }
:root:root th:is(.sort-active, .sorted, .sorted-asc, .sorted-desc, .sort-asc, .sort-desc),
:root:root .header-cell:is(.sort-active, .sorted-asc, .sorted-desc) { color: var(--rc-text); }
:root:root :is(.sort-icon, .ctrl-sort-icon, .mt-sort-arrow, .header-sort-indicator, .sort-indicator, .sort-arrow) {
    font-size: 10px; color: var(--rc-text-muted); margin-left: 4px; vertical-align: 1px;
}

/* ============================================================
   9. PAGINATION — flache Leiste, bündig, 32 px
   ============================================================ */
:root:root :is(.pagination-container, .akt-pagination, .email-pagination, .ud-pagination, .export-pagination,
  .pa-pagination, .re-pagination, .report-pagination, .xqm-pagination, .news-pagination, .fa-pager, .is24m-pager,
  .wf-pager, .rt-pager, .lxs-pager, .team-list-pager, .efu-pager, .pagination) {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
    gap: 8px 16px; min-height: 0; padding: 10px 16px; margin: 0;
    background: transparent; border: 0; border-top: 1px solid var(--rc-border); border-radius: 0; box-shadow: none;
    font-size: 13px; color: var(--rc-text-2);
}
:root:root .main-content > :is(.pagination-container, .pagination, .akt-pagination, .email-pagination, .ud-pagination) {
    padding: 14px 20px 18px; border-top: 0;
}
:root:root :is(.pagination-info, .pa-pagination-info, .re-pagination-info, .report-pagination-info, .xqm-page-info, .fa-pager-info) {
    font-size: 13px; color: var(--rc-text-2); padding: 0; margin: 0;
}
:root:root :is(.pagination-controls, .pagination-buttons, .pa-pagination-controls, .pa-pagination-buttons, .is24m-pager-buttons, .fa-pager-nav) {
    display: flex; align-items: center; gap: 6px; margin: 0; padding: 0;
}
:root:root :is(.pagination-select, .pa-pagination-select, .fa-pager-size) {
    height: var(--rc-pager-h); min-height: var(--rc-pager-h); padding: 0 26px 0 10px; font-size: 13px;
    border: 1px solid var(--rc-border); border-radius: var(--rc-r-md); background-color: var(--rc-surface);
}
:root:root :is(.btn-pagination, .pagination-btn, .re-pagination-btn, .report-pagination-btn, .team-list-pager-btn,
  .btn-pagination-pa, .fa-pager-page, .is24m-pager-buttons button, .wf-pager button, .rt-pager button,
  .lxs-pager button, .efu-pager button, .news-pagination a, .news-pagination button, .pagination a, .pagination button) {
    height: var(--rc-pager-h); min-height: var(--rc-pager-h); min-width: var(--rc-pager-h); padding: 0 10px;
    font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    background: var(--rc-btn2); color: var(--rc-btn2-text); border: 1px solid var(--rc-btn2-border);
    border-radius: var(--rc-r-md); box-shadow: none;
}
:root:root :is(.btn-pagination, .pagination-btn, .re-pagination-btn, .report-pagination-btn, .team-list-pager-btn, .btn-pagination-pa, .fa-pager-page):hover:not(:disabled) {
    background: var(--rc-btn2-hover);
}
:root:root :is(.btn-pagination, .pagination-btn, .re-pagination-btn, .report-pagination-btn, .team-list-pager-btn, .btn-pagination-pa, .fa-pager-page):disabled {
    opacity: .5; background: var(--rc-btn2);
}
:root:root :is(.btn-pagination, .pagination-btn, .re-pagination-btn, .report-pagination-btn, .team-list-pager-btn, .btn-pagination-pa, .fa-pager-page):is(.active, .current, .is-on, [aria-current="page"]) {
    background: var(--rc-btn); border-color: var(--rc-btn); color: var(--rc-btn-text);
}

/* ============================================================
   10. BADGES & LABELS (§9, §12) — 12/500, 6 px, 4 × 8 px
   ============================================================ */
:root .twb, :root .badge, :root .status-badge, :root .chip, :root .filter-chip,
:root .property-status-badge, :root .inquiry-status-label, :root .contact-type-badge,
:root .deal-status-badge, :root .role-badge {
    border-radius: var(--rc-r-sm);
    font-size: 12px;
    font-weight: 500;
}
:root .twb, :root .property-status-badge, :root .status-badge, :root .inquiry-status-label, :root .deal-status-badge { padding: 4px 8px; border: 0; line-height: 1.35; }
/* Tailwind-Soft-Badges → System-Familien (gilt für Status, Typen, Phasen-Badges) */
:root .twb:is(.twb-blue, .twb-sky, .twb-indigo, .twb-cyan)      { color: var(--rc-ph-blue);   background: var(--rc-ph-blue-bg); }
:root .twb:is(.twb-red, .twb-rose)                              { color: var(--rc-ph-red);    background: var(--rc-ph-red-bg); }
:root .twb:is(.twb-orange, .twb-amber, .twb-yellow)             { color: var(--rc-ph-amber);  background: var(--rc-ph-amber-bg); }
:root .twb:is(.twb-violet, .twb-purple, .twb-fuchsia, .twb-pink) { color: var(--rc-ph-purple); background: var(--rc-ph-purple-bg); }
:root .twb:is(.twb-teal, .twb-emerald)                          { color: var(--rc-ph-teal);   background: var(--rc-ph-teal-bg); }
:root .twb:is(.twb-green, .twb-lime)                            { color: var(--rc-ph-green);  background: var(--rc-ph-green-bg); }
:root .twb:is(.twb-slate, .twb-gray, .twb-zinc, .twb-stone, .twb-neutral) { color: var(--rc-ph-gray); background: var(--rc-ph-gray-bg); }


/* Vermittlungsphasen (§11): Familien-Klassen + Objekt-Status-Badges (Klasse = Status-Slug) */
:root .twb.twb-ph-blue,
:root .property-status-badge.ersttermin,
:root .property-status-badge.om24-vertragstermin,
:root .property-status-badge.telefontermin,
:root .property-status-badge.zweittermin,
:root .property-status-badge.kaufabsichtserklärung,
:root .property-status-badge.notartermin,
:root .property-status-badge.rechnung-erstellt { color: var(--rc-ph-blue-ink, var(--rc-ph-blue)); background: var(--rc-ph-blue-fill, var(--rc-ph-blue-bg)); border-color: transparent; }
:root .twb.twb-ph-red,
:root .property-status-badge.nicht-stattgefunden,
:root .property-status-badge.kein-auftrag,
:root .property-status-badge.nicht-verkauft,
:root .property-status-badge.widerruf { color: var(--rc-ph-red-ink, var(--rc-ph-red)); background: var(--rc-ph-red-fill, var(--rc-ph-red-bg)); border-color: transparent; }
:root .twb.twb-ph-amber,
:root .property-status-badge.terminabsage-et,
:root .property-status-badge.terminabsage-makler,
:root .property-status-badge.reserviert { color: var(--rc-ph-amber-ink, var(--rc-ph-amber)); background: var(--rc-ph-amber-fill, var(--rc-ph-amber-bg)); border-color: transparent; }
:root .twb.twb-ph-purple,
:root .property-status-badge.wiedervorlage,
:root .property-status-badge.vorbereitung { color: var(--rc-ph-purple-ink, var(--rc-ph-purple)); background: var(--rc-ph-purple-fill, var(--rc-ph-purple-bg)); border-color: transparent; }
:root .twb.twb-ph-teal,
:root .property-status-badge.auftrag-comfort,
:root .property-status-badge.auftrag-performance,
:root .property-status-badge.auftrag-corsa,
:root .property-status-badge.auftrag-om24,
:root .property-status-badge.auftrag-datenbank,
:root .property-status-badge.auftrag-vermietung,
:root .property-status-badge.vermarktung-datenbank,
:root .property-status-badge.vermarktung-portale,
:root .property-status-badge.vermarktung { color: var(--rc-ph-teal-ink, var(--rc-ph-teal)); background: var(--rc-ph-teal-fill, var(--rc-ph-teal-bg)); border-color: transparent; }
:root .twb.twb-ph-gray,
:root .property-status-badge.pausiert,
:root .property-status-badge.akquise { color: var(--rc-ph-gray-ink, var(--rc-ph-gray)); background: var(--rc-ph-gray-fill, var(--rc-ph-gray-bg)); border-color: transparent; }
:root .twb.twb-ph-green,
:root .property-status-badge.beurkundet,
:root .property-status-badge.rechnung-bezahlt,
:root .property-status-badge.verkauft { color: var(--rc-ph-green-ink, var(--rc-ph-green)); background: var(--rc-ph-green-fill, var(--rc-ph-green-bg)); border-color: transparent; }
:root .twb.twb-ph-dred,
:root .property-status-badge.rechtstreit,
:root .property-status-badge.rechtsstreit { color: var(--rc-ph-dred-ink, var(--rc-ph-dred)); background: var(--rc-ph-dred-fill, var(--rc-ph-dred-bg)); border-color: transparent; }

/* ============================================================
   11. SIDEBAR (Sidebar-Spezifikation §2–§7)
   ============================================================ */
:root {
    --sidebar-bg: #FFFFFF;          --sidebar-border: #D9D9D9;
    --sidebar-text: #3D3D3D;        --sidebar-text-hover: #0A0A0A;
    --sidebar-icon: #4A4A4A;        --sidebar-icon-hover: #0A0A0A;
    --sidebar-hover-bg: #F5F5F5;
    --sidebar-active-bg: #F0F0F0;   --sidebar-active-text: #171717; --sidebar-active-icon: #171717;
    --sidebar-section: #6B6B6B;     --sidebar-group-label: #999999;     --sidebar-disabled: #B4B4B4;
    --sidebar-width: 240px;         --sidebar-width-collapsed: 68px;
    --sidebar-item-height: 36px;    --sidebar-item-radius: 8px;
    --sidebar-icon-size: 18px;      --sidebar-icon-gap: 12px;
    --icon-default: #4A4A4A; --icon-hover: #0A0A0A; --icon-active: #171717; --icon-disabled: #B4B4B4;
    --tooltip-bg: #171717; --tooltip-text: #FFFFFF; --notify-dot: #DC5555;
}
:root[data-theme="dark"] {
    --sidebar-bg: #151619;          --sidebar-border: #34373D;
    --sidebar-text: #C4C4CB;        --sidebar-text-hover: #FFFFFF;
    --sidebar-icon: #AEB1B7;        --sidebar-icon-hover: #FFFFFF;
    --sidebar-hover-bg: #222429;
    --sidebar-active-bg: #292B30;   --sidebar-active-text: #FFFFFF; --sidebar-active-icon: #FFFFFF;
    --sidebar-section: #8E8E97;     --sidebar-group-label: #71717A;     --sidebar-disabled: #52525B;
    --icon-default: #AEB1B7; --icon-hover: #FFFFFF; --icon-active: #FFFFFF; --icon-disabled: #52525B;
    --tooltip-bg: #F5F5F5; --tooltip-text: #171717; --notify-dot: #F08080;
}
:root .sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    padding-bottom: 12px;
}
:root .sidebar.collapsed { width: var(--sidebar-width-collapsed); }
/* Eingeklappt: gleicher Rhythmus wie aufgeklappt (style.css gibt 5px+4px extra) */
:root .sidebar.collapsed .nav-item, :root .sidebar.collapsed .nav-item.has-submenu { margin: 0 12px 2px; padding: 0; }
:root .sidebar.collapsed .nav-item > .nav-link, :root .sidebar.collapsed .nav-item.has-submenu > .nav-link { padding: 0; gap: 0; justify-content: center; }
:root .logo, :root .sidebar-logo-sticky { background-color: var(--sidebar-bg); padding-left: 24px; padding-right: 12px; }
:root .global-search { padding-left: 12px; padding-right: 12px; }
/* Gruppenlabels (Spez. Sidebar-Gruppen): 11/600/16, 0.6 px, UPPERCASE, oben 20, unten 8,
   12 px Einzug ab Item-Kante (= 12 Rand + 12) – reine Orientierung, kein Hover/Active */
:root .nav-section { margin-bottom: 0; }
:root .nav-section-title {
    margin: 20px 0 8px; padding: 0 24px;
    color: var(--sidebar-group-label);
    font-size: 11px; font-weight: 600; line-height: 16px; letter-spacing: .6px; text-transform: uppercase;
    user-select: none; -webkit-user-select: none; pointer-events: none;
}
:root .nav-section:first-of-type .nav-section-title { margin-top: 8px; }
:root .nav-item, :root .nav-item:hover, :root .nav-item.active, :root .nav-item.has-submenu {
    margin: 0 12px 2px;
    padding: 0;
    border-radius: var(--sidebar-item-radius);
    box-shadow: none;
}
:root .nav-item { color: var(--sidebar-text); font-size: 14px; font-weight: 500; transition: background-color .15s ease, color .15s ease; }
:root .nav-item > .nav-link, :root .nav-item.has-submenu > .nav-link, :root .objekte-nav .nav-link-main {
    box-sizing: border-box;
    min-height: var(--sidebar-item-height);
    height: var(--sidebar-item-height);
    padding-top: 0; padding-bottom: 0;
    padding: 0 12px;
    gap: var(--sidebar-icon-gap);
    border-radius: var(--sidebar-item-radius);
    color: inherit;
}
:root .nav-item svg, :root .nav-item .icon, :root .nav-item img {
    width: var(--sidebar-icon-size); height: var(--sidebar-icon-size); flex: 0 0 var(--sidebar-icon-size);
    color: var(--sidebar-icon); opacity: 1; transition: color .15s ease;
}
:root .nav-item:not(.has-submenu):hover:not(.active), :root .nav-item.has-submenu > .nav-link:hover {
    background-color: var(--sidebar-hover-bg);
    color: var(--sidebar-text-hover);
}
:root .nav-item:hover:not(.active) > .nav-link svg, :root .nav-item:hover:not(.active) > .nav-link .icon,
:root .nav-item.has-submenu > .nav-link:hover svg { color: var(--sidebar-icon-hover); }
:root .nav-item.active, :root .nav-item.active:hover {
    background-color: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 600;
}
:root .nav-item.active svg, :root .nav-item.active .icon { color: var(--sidebar-active-icon); }
:root .nav-item.disabled, :root .nav-item.disabled svg { color: var(--sidebar-disabled); }
:root .nav-item.objekte-nav > .nav-link-split { padding: 0; gap: 0; }
:root .objekte-nav .nav-link-main { padding: 0 8px 0 12px; }
:root .objekte-nav .nav-link-main:hover { background-color: var(--sidebar-hover-bg); color: var(--sidebar-text-hover); }
:root .objekte-item { display: flex; align-items: center; }
:root .objekte-item .objekte-link {
    display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px;
    min-height: 40px; height: auto; padding: 4px 8px 4px 42px; text-align: left;
    color: var(--sidebar-text); border-radius: var(--sidebar-item-radius);
}
:root .objekte-item .objekte-link:hover { background-color: var(--sidebar-hover-bg); color: var(--sidebar-text-hover); }
:root .objekte-title { font-size: 13px; font-weight: 500; color: inherit; text-align: left; }
:root .objekte-sub { font-size: 12px; color: var(--sidebar-section); text-align: left; }
/* lange Orte/Titel kürzen statt unter den Pin zu laufen (align-items: flex-start begrenzt die Breite sonst nicht) */
:root .objekte-item .objekte-link { flex: 1 1 auto; min-width: 0; }
:root .objekte-item :is(.objekte-title, .objekte-sub) { display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:root .objekte-group-label { padding: 8px 8px 4px 42px; text-align: left; }
:root .objekte-group-label span { display: block; padding: 0; margin: 0; width: auto; text-align: left; white-space: nowrap; color: var(--sidebar-section); font-size: 11px; font-weight: 600; letter-spacing: .06em; }
:root .objekte-pin { width: 32px; height: 32px; padding: 0; margin-right: 4px; border-radius: var(--sidebar-item-radius); color: var(--sidebar-disabled); opacity: 1; }
/* Lesezeichen: angepinnt dunkel, sonst hell */
:root .objekte-item.is-pinned .objekte-pin { color: var(--sidebar-text-hover); opacity: 1; }
:root .objekte-pin:hover { background: var(--sidebar-hover-bg); color: var(--sidebar-icon-hover); }
:root .objekte-pin svg { width: 16px; height: 16px; }
/* „.nav-item svg“ färbt jedes Icon der Seitenleiste direkt – das Lesezeichen soll die Farbe des Knopfs übernehmen */
:root .objekte-item .objekte-pin :is(svg, .icon) { color: inherit; }
:root .nav-subitem a { padding: 0 12px 0 42px; min-height: 36px; display: flex; align-items: center; color: var(--sidebar-text); font-size: 13px; border-radius: var(--sidebar-item-radius); }
:root .nav-subitem a:hover { background-color: var(--sidebar-hover-bg); color: var(--sidebar-text-hover); }
:root .nav-subitem a.active, :root .nav-subitem.active a { background-color: var(--sidebar-active-bg); color: var(--sidebar-active-text); font-weight: 600; }
:root .sidebar :is(.unread-badge, .nav-badge, .nav-count, .tracking-badge) {
    min-width: 22px; height: 22px; padding: 0 7px; border-radius: 9999px;
    background: var(--rc-hover); color: var(--rc-label); font-size: 12px; font-weight: 600;
    display: inline-flex; align-items: center; justify-content: center; margin-left: auto;
}
/* Ungelesen-Zähler der Seitenleiste: rot mit weißer Ziffer wie im Header (17.11.2026) */
:root .sidebar :is(.unread-badge, .notification-dot) { background: var(--notify-dot); color: #FFFFFF; }
:root .sidebar hr, :root .sidebar .divider { border-color: var(--sidebar-border); }
:root .global-search input, :root .search-input-wrapper { border-radius: var(--rc-r-md); }

/* Icons (§16 + Icon-Spezifikation): Lucide-Set, Größen nach Verwendung, Farbe = Text */
:root .board-header .btn-icon svg, :root .board-header .btn-icon .icon, :root .header-right svg.icon { width: 18px; height: 18px; }
:root .btn svg.icon, :root .btn-primary svg.icon, :root .btn-secondary svg.icon, :root .btn-filter svg.icon,
:root .toolbar-btn svg.icon, :root .azb-tool-btn svg.icon, :root td svg.icon, :root .btn-icon-only svg.icon { width: 16px; height: 16px; }
:root svg.icon { color: inherit; }

/* Seitentitel (§13): 24 / 600 */
:root .board-title, :root .board-title-main { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }

/* ============================================================
   12. SCHALTER: systemweit EINE Größe – 36 × 20, Knopf 16 weiß, Ja Türkis / Nein Grau
   (48 × 26 aus der Spez. war im CRM zu wuchtig). Alle Bauformen auf dieselben Tokens:
   A Spur = Element nach dem Input, Knopf ::before   B dito, Knopf ::after
   C Spur = Input selbst (appearance:none), Knopf ::after   D Zustand per .active
   ============================================================ */
:root {
    --rc-toggle-w: 36px; --rc-toggle-h: 20px; --rc-toggle-knob: 16px;
    --rc-toggle-pad: 2px;
    --rc-toggle-move: calc(var(--rc-toggle-w) - var(--rc-toggle-knob) - 2 * var(--rc-toggle-pad));
}
/* Hüllen */
/* .orgnet-toggle / .post-archive-toggle / .dk-toggle sind Label-Hüllen MIT Text → nicht auf Spurbreite zwingen (nur ihre Slider) */
:root:root :is(.toggle, .akquise-toggle, .toggle-switch, .azb-au-switch, .video-gen-toggle):has(> input[type="checkbox"]) {
    width: var(--rc-toggle-w); min-width: var(--rc-toggle-w); height: var(--rc-toggle-h);
}
/* Spuren (A + B) */
:root:root :is(.toggle-slider, .toggle-me-slider, .dk-toggle-slider, .azb-au-slider, .orgnet-toggle-slider, .post-archive-slider,
               .hugo-toggle-schiene, .pf-switch-track, .poll-switch-slider, .pfeed-switch-track, .video-gen-toggle-slider),
:root:root .unique-contacts-switch {
    width: var(--rc-toggle-w); min-width: var(--rc-toggle-w); height: var(--rc-toggle-h); flex: 0 0 auto;
    border-radius: 9999px; border: 0; box-sizing: border-box;
    background: var(--rc-toggle-off);
    transition: background-color .18s ease;
}
/* Knopf */
:root:root :is(.toggle-slider, .toggle-me-slider, .dk-toggle-slider, .azb-au-slider, .post-archive-slider,
               .hugo-toggle-schiene, .pf-switch-track, .poll-switch-slider, .video-gen-toggle-slider)::before,
:root:root :is(.orgnet-toggle-slider, .pfeed-switch-track, .unique-contacts-switch)::after,
:root:root :is(.azb-toggle, .office-switch, .mo-switch) input::after {
    width: var(--rc-toggle-knob); height: var(--rc-toggle-knob);
    top: var(--rc-toggle-pad); left: var(--rc-toggle-pad); bottom: auto;
    background: #FFFFFF; border-radius: 9999px; box-shadow: 0 1px 2px rgba(0,0,0,.2);
    transition: transform .18s ease;
}
/* An */
:root:root input:checked + :is(.toggle-slider, .toggle-me-slider, .dk-toggle-slider, .azb-au-slider, .orgnet-toggle-slider, .post-archive-slider,
               .hugo-toggle-schiene, .pf-switch-track, .poll-switch-slider, .pfeed-switch-track, .video-gen-toggle-slider),
:root:root .unique-contacts-toggle.active .unique-contacts-switch {
    background: var(--rc-toggle-on);
}
:root:root input:checked + :is(.toggle-slider, .toggle-me-slider, .dk-toggle-slider, .azb-au-slider, .post-archive-slider,
               .hugo-toggle-schiene, .pf-switch-track, .poll-switch-slider, .video-gen-toggle-slider)::before,
:root:root input:checked + :is(.orgnet-toggle-slider, .pfeed-switch-track)::after,
:root:root .unique-contacts-toggle.active .unique-contacts-switch::after,
:root:root :is(.azb-toggle, .office-switch, .mo-switch) input:checked::after {
    transform: translateX(var(--rc-toggle-move));
}
:root:root input:disabled + :is(.toggle-slider, .toggle-me-slider, .dk-toggle-slider, .pf-switch-track, .poll-switch-slider, .pfeed-switch-track) { opacity: .5; }
/* C: Spur = Input */
:root:root :is(.azb-toggle, .office-switch, .mo-switch) input {
    width: var(--rc-toggle-w); min-width: var(--rc-toggle-w); height: var(--rc-toggle-h);
    border-radius: 9999px; border: 0; background: var(--rc-toggle-off); transition: background-color .18s ease;
}
:root:root :is(.azb-toggle, .office-switch, .mo-switch) input:checked { background: var(--rc-toggle-on); }
:root .toggle-red-off input:not(:checked) + .toggle-slider { background-color: var(--rc-toggle-neg); }
/* Beschriftung Ja/Nein (steht neben der Spur) */
:root:root .toggle-switch input:checked + .toggle-slider::after,
:root:root .video-gen-toggle input:checked + .video-gen-toggle-slider::after { color: var(--rc-toggle-on-text); }
:root .toggle-label-on, :root .toggle-text-on { color: var(--rc-toggle-on-text); }
:root .toggle-label-off, :root .toggle-text-off { color: var(--rc-toggle-off-text); }

/* ============================================================
   13. EINZELBAUSTEINE
   ============================================================ */
/* Heutiger Tag im Kalender: neutral ausgewählt */
:root .week-day-header.today, :root .month-day.today, :root .date-slider-item.today {
    background-color: var(--rc-hover);
    color: var(--rc-text);
    font-weight: 600;
}
:root .week-day-header.today * { color: var(--rc-text); }
/* Systembanner in der Sidebar: neutrale Fläche, Farbe nur als Kante */
:root .sidebar-banner {
    background: var(--rc-surface) !important;
    color: var(--rc-text) !important;
    border: 1px solid var(--rc-border) !important;
    border-left: 3px solid var(--hh-banner, var(--rc-error)) !important;
    border-radius: var(--rc-r-md) !important;
    text-align: left;
}
:root .sidebar-banner--orange, :root .sidebar-banner--yellow { --hh-banner: var(--rc-warning); }
:root .sidebar-banner--green { --hh-banner: var(--rc-success); }
/* „Ultimate Question“ */
:root .uq-label { background: var(--rc-elevated); color: var(--rc-text); border-radius: var(--rc-r-md); box-shadow: 0 0 0 1px var(--rc-border), var(--rc-shadow-pop); }
:root .uq-label-kicker, :root .uq-popover-kicker { color: var(--rc-text-2); font-size: 11px; }
:root .uq-label-dismiss { background: var(--rc-elevated); color: var(--rc-text-2); border-color: var(--rc-border); }
:root .uq-label-dot { background: var(--rc-toggle-on); }
:root .uq-label-title { color: var(--rc-text); }
:root .uq-popover-header { background: var(--rc-selected); color: var(--rc-text); }
:root .uq-popover-desc { color: var(--rc-text-2); }
/* Zähler-Punkte in der Kopfzeile */
:root .board-header .notification-badge, :root .board-header .unread-badge, :root .board-header [class*="badge-count"] {
    background: #DC5555; color: #FFFFFF; border-radius: var(--rc-r-full); box-shadow: 0 0 0 2px var(--rc-surface); font-weight: 600;
}
/* Login & Portal: Primary (Mint-CTA) */
:root .btn-login { border-radius: var(--rc-r-md); }
/* Avatare rund */
:root .avatar, :root [class*="avatar"] img { border-radius: var(--rc-r-full); }


/* ============================================================
   13b. AUDIT-NACHZÜGLER (Einzelbausteine auf die Skala)
   ============================================================ */
:root :is(.range-btn, .scope-btn, .wf-seg-btn, .page-btn, .action-btn, .folder-create-btn, .chat-rooms-add, .chat-msg-action-btn,
  .ctrl-yellow-bubble, .ctrl-not-sold-bubble) { border-radius: var(--rc-r-md); }
:root :is(.chart-range-switch, .scope-switch) { border-radius: var(--rc-r-md); }
:root :is(.chat-room-unread, .ticket-tab-count, .tab-badge) {
    min-width: 22px; height: 22px; padding: 0 7px; border-radius: 9999px;
    display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600;
}
:root .ticket-tab.active .ticket-tab-count { background: var(--rc-btn); color: var(--rc-btn-text); }   /* aktiver Counter */
:root .btn-action-black { background: var(--rc-btn); color: var(--rc-btn-text); border-color: var(--rc-btn); border-radius: var(--rc-r-md); }
:root .btn-action-black:hover { background: var(--rc-btn-hover); }
:root :is(.property-issues-title, .property-issue-link) { color: var(--rc-error); }
:root .property-issues-content { border-color: var(--rc-error); background: var(--rc-error-bg); border-radius: var(--rc-r-lg); }
:root :is(.widget-card, .properties-container, .contacts-container, .deals-container, .onboarding-card) {
    border: 1px solid var(--rc-border); border-radius: var(--rc-r-lg); box-shadow: var(--rc-shadow-card); background-color: var(--rc-surface);
}
:root h3 { font-size: 16px; }
:root .ki-briefing-title { font-size: 15px; font-weight: 600; }
:root :is(.sort-icon, .visit-time, .risk-item-score-label, .mcp-scope-badge) { font-size: 11px; }
:root .required-star { color: var(--rc-error); }
:root .group-toggle:not(.re-board-container .group-toggle) { border-color: var(--rc-border-strong); }

/* ============================================================
   14. TEST-HINWEIS
   ============================================================ */
.hh2-design-flag {
    position: fixed; left: 12px; bottom: 12px; z-index: 99999;
    padding: 6px 10px; font: 500 12px/1.2 var(--font-family);
    background: var(--rc-surface); color: var(--rc-text); text-decoration: none;
    border: 1px solid var(--rc-border-strong); border-radius: var(--rc-r-md); box-shadow: var(--rc-shadow-pop);
}
.hh2-design-flag:hover { background: var(--rc-hover); }
:root:root input.ticket-search { height: var(--rc-ctl-h); min-height: var(--rc-ctl-h); }
:root .azb-gtitle { color: var(--g-fg, var(--g)); }
:root :is(.azb-row, .azb-colhead, .azb-foot) .azb-c-chk { box-shadow: inset var(--azb-stripe) 0 0 var(--g-line, var(--g)); }

/* ============================================================
   Kopfzeile: Text-Knöpfe + Icon-Gruppe (Desktop)
   Reihenfolge: Primär (Speichern/Neu…) · Text-Knöpfe · Icons · Avatar
   ============================================================ */
:root .hh2-lbl { display: none; }
@media (min-width: 1101px) {
    :root .board-header .header-right > * { order: 2; }
    :root .board-header .header-right > :is(.btn-save, .primary-action, button:not(.btn-icon):not(.fab-save):not(.fab-create)) { order: 0; }
    :root .board-header .header-right > :is(.hh2-txt, :has(> .hh2-txt)) { order: 1; }
    :root .board-header .header-right > .user-dropdown { order: 3; }

    :root:root .board-header .hh2-txt {
        width: auto; min-width: 0; height: var(--rc-ctl-h);
        padding: 0 12px; gap: 6px;
        font-size: 13px; font-weight: 500; line-height: 1;
        color: var(--rc-text);
        white-space: nowrap;
    }
    :root:root .board-header .hh2-txt > svg, :root:root .board-header .hh2-txt > .icon { display: none; }
    :root:root .board-header .hh2-txt .hh2-lbl { display: inline; }
    /* Titel würde abgeschnitten (hh2-harmonize.js) → Text-Knöpfe wieder als Icons */
    :root:root:root .board-header.hh2-hdr-compact .hh2-txt { width: var(--rc-ctl-h); padding: 0; gap: 0; }
    :root:root:root .board-header.hh2-hdr-compact .hh2-txt > :is(svg, .icon) { display: inline-block; }
    :root:root:root .board-header.hh2-hdr-compact .hh2-txt .hh2-lbl { display: none; }
    /* Zähler im Text-Knopf inline statt als Ecken-Badge */
    :root:root .board-header .hh2-txt .notification-badge {
        position: static; transform: none; margin: 0 -4px 0 2px;
        min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; line-height: 18px;
    }
}


/* ============================================================
   Suchfelder mit Rahmen am Wrapper (Icon + Input): Input selbst randlos,
   sonst „Feld im Feld“ (A-Z-Suche, Ticket-/Kontakt-Suche …)
   ============================================================ */
:root:root .azb-search > input {
    border: 0; box-shadow: none; background: transparent; outline: 0;
    height: 100%; min-height: 0; padding-left: 0;
}
:root:root .azb-search { height: var(--rc-ctl-h); border-color: var(--rc-border); background: var(--rc-surface); }
:root:root .azb-search:focus-within { border-color: var(--rc-focus); box-shadow: var(--rc-focus-ring); }

/* A-Z Status-Popover: Suche wie alle Felder, aktuelle Option = Ring in Phasenfarbe statt schwarz */
:root:root .azb-pop-search { height: var(--rc-ctl-h); border: 1px solid var(--rc-border); border-radius: var(--rc-r-md); background: var(--rc-surface); }
:root:root .azb-pop-search:focus { border-color: var(--rc-focus); box-shadow: var(--rc-focus-ring); }
:root:root .azb-opt.is-current { box-shadow: none; }
:root:root .azb-opt.is-current .azb-opt-fill { box-shadow: inset 0 0 0 1.5px currentColor; font-weight: 600; }


/* ============================================================
   Rundgang 14.11. – systemweite Korrekturen
   ============================================================ */
/* Selects: überall derselbe Lucide-Chevron (statt nativem ▼ / gar keinem Pfeil) */
:root { --rc-select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B6B6B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] { --rc-select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23AEB1B7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
:root:root select:not([multiple]):not([size]):not([class*="flatpickr"]) {
    -webkit-appearance: none; appearance: none;
    background-image: var(--rc-select-chevron);
    background-repeat: no-repeat; background-position: right 10px center; background-size: 16px 16px;
    padding-right: 34px;
}
/* Native Steuerelemente (Datums-Icon, Scrollbars) im Dunkelmodus hell */
:root[data-theme="dark"] :is(input, select, textarea) { color-scheme: dark; }
/* Datumsfelder in Werkzeugleisten wie die Nachbarn 36 px */
:root :is(.board-header-2, .calendar-controls, .azb-toolbar, .filter-bar, .toolbar, [class*="-toolbar"], [class*="-filters"], [class*="filter-row"], [class*="-controls"]) input:is([type="date"], [type="datetime-local"], [type="month"]) {
    height: var(--rc-ctl-h); min-height: var(--rc-ctl-h); box-sizing: border-box; padding-top: 0; padding-bottom: 0;
}
/* Deaktivierte Primär-Buttons lesbar (vorher weiß auf hellgrau) */
:root:root :is(.btn-primary, .btn-save, .btn-login, .btn-apply-filter, button[class*="primary"]):disabled {
    background-color: var(--rc-selected); border-color: var(--rc-border); color: var(--rc-text-muted); opacity: 1; cursor: not-allowed;
}
/* Leere Zähler nicht als leere Kreise zeigen */
:root:root :is(.tab-count, .counter, .wf-tab-count, .ticket-tab-count, .nav-badge, [class*="tab-count"], [class*="filter-count"]):empty { display: none; }
/* Monospace: ruhiger System-Stack statt Courier */
:root :is(code, kbd, samp, pre, tt, [class*="mono"]), :root [style*="monospace"] {
    font-family: "SF Mono", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace !important;
}
/* Checkboxen/Radios: überall dieselbe Akzentfarbe (kein Türkis) */
:root:root input:is([type="checkbox"], [type="radio"]) { accent-color: var(--rc-primary, #171717); }
:root:root[data-theme="dark"] input:is([type="checkbox"], [type="radio"]) { accent-color: #F5F5F5; }
/* Weitere Schalter-Bauformen: Tour-Sprecher, Portal-Status */
:root:root .tour-menu-switch, :root:root .status-toggle {
    width: var(--rc-toggle-w); height: var(--rc-toggle-h); border-radius: 9999px; background: var(--rc-toggle-off); border: 0;
}
:root:root :is(.tour-menu-switch, .status-toggle)::after {
    width: var(--rc-toggle-knob); height: var(--rc-toggle-knob); top: var(--rc-toggle-pad); left: var(--rc-toggle-pad);
    background: #FFFFFF; border-radius: 9999px; box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
:root:root :is(.tour-menu-switch.is-on, .status-toggle.active) { background: var(--rc-toggle-on); }
:root:root :is(.tour-menu-switch.is-on, .status-toggle.active)::after { transform: translateX(var(--rc-toggle-move)); }
/* User-Menü darf nicht aus dem Bildschirm laufen */
:root .user-dropdown-menu { max-height: calc(100vh - 80px); overflow-y: auto; }
/* Breite Tabellen: horizontal scrollen statt abschneiden */
:root :is(.table-container, .table-wrapper, .table-responsive, [class*="table-wrap"], [class*="table-container"]) { overflow-x: auto; }
/* Wortumbruch nur an sinnvollen Stellen (Systemseite brach „Berl/in“) */
:root :is(.card, .info-card, .stat-card, [class*="-card"]) { word-break: normal; overflow-wrap: break-word; }

/* Seiten mit eigenen Weiß-Tokens: auf Systemflächen (Dunkelmodus hatte weiße Kästen) */
:root:root {
    --color-surface-1: var(--rc-surface);
    --fin-bg-card: var(--rc-surface);
    --fin-neutral: var(--rc-border); --fin-neutral-light: var(--rc-selected);
    --fin-faellig: var(--rc-chart-amber); --fin-generiert: var(--rc-ph-amber-bg);
    --fin-ausbezahlt: var(--rc-chart-green); --fin-rech-erhalt: var(--rc-ph-blue-bg);
    --fin-danger: var(--rc-chart-red); --fin-warning: var(--rc-chart-amber);
}
:root .page-rechnungen-finanzen .main-content { background: var(--rc-background); }
/* Superadmin-KPIs: ruhige Karten ohne Farbverlauf-Icons und dicke Farbränder */
:root:root :is(.sa-kpi-1, .sa-kpi-2, .sa-kpi-3, .sa-kpi-4) { border-left: 1px solid var(--rc-border); }
:root:root :is(.sa-kpi-1, .sa-kpi-2, .sa-kpi-3, .sa-kpi-4) .sa-kpi-icon { background: var(--rc-selected); color: var(--rc-icon); }
/* Doku-Kategorien: neutrale Icon-Kachel statt Vollfarben (Inline-Farbe aus PHP überschreiben) */
:root:root .doc-category-icon { background: var(--rc-selected) !important; color: var(--rc-icon); }
:root:root .doc-category-icon .icon, :root:root .doc-category-icon svg { fill: none; stroke: currentColor; color: var(--rc-icon); }
/* Umfragen: „Ultimate“-Badge als Badge der Familie Teal */
:root:root .poll-ultimate-badge { background: var(--rc-ph-teal-bg); color: var(--rc-ph-teal); border-radius: var(--rc-r-sm); font-weight: 600; }

/* Kennzahl-Karten ruhig: keine farbigen Deko-Streifen/Verläufe (Mein Team, Research, Lexoffice) */
:root:root :is(.mt-kpi, .stat-kpi-card)::before { background: transparent !important; }
:root:root .mt-kpi[data-tone="warning"] { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc-ph-amber) 30%, transparent); }
:root:root .lxs-kpi-hero { border-left: 1px solid var(--rc-border); background: var(--rc-surface); }
:root:root #vTable tr { border-left-width: 1px; border-left-color: var(--rc-border); background: var(--rc-surface); }
/* Leistungspunkte (Controlling u. a.) in Chart-Tönen statt Signal-Orange */
:root:root .perf-good { --perf-on: var(--rc-chart-green); }
:root:root .perf-mid  { --perf-on: var(--rc-chart-amber); }
:root:root .perf-bad  { --perf-on: var(--rc-chart-red); }
/* Kalender „Meet“: Badge der Familie Blau statt roter Vollfläche */
:root:root :is(.meet-link, .meet-link-compact) { background: var(--rc-ph-blue-bg); color: var(--rc-ph-blue); border-radius: var(--rc-r-sm); font-weight: 600; }
:root:root :is(.meet-link, .meet-link-compact):hover { background: color-mix(in srgb, var(--rc-ph-blue) 18%, var(--rc-ph-blue-bg)); }
/* Chat: Senden-Knopf normale Höhe (stand auf voller Leistenhöhe ~100 px) */
:root:root .chat-btn-send { align-self: flex-end; height: var(--rc-input-h); padding: 0 16px; margin-bottom: 0; background: var(--rc-btn); color: var(--rc-btn-text); }
/* Kanban: „Nur meine“ nicht umbrechen */
:root:root .dk-toggle-text { white-space: nowrap; }

/* Filter-Dialoge: UND/ODER überall als Segment-Umschalter (wie A-Z-Board), Radios unsichtbar */
:root:root [class$="filter-logic"]:has([class*="filter-logic-option"]) {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0; margin-bottom: 12px;
}
:root:root [class$="filter-logic"] > [class*="filter-logic-label"] {
    flex: 1 0 100%; margin-bottom: 6px; font-size: 12px; color: var(--rc-text-muted);
}
:root:root [class*="filter-logic-option"] {
    position: relative; display: inline-flex; align-items: center; height: 32px; padding: 0 12px; margin: 0;
    border: 1px solid var(--rc-border); background: var(--rc-surface); color: var(--rc-text-2);
    font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
:root:root [class*="filter-logic-option"] + [class*="filter-logic-option"] { border-left: 0; }
:root:root [class$="filter-logic"] > [class*="filter-logic-option"]:first-of-type { border-radius: var(--rc-r-md) 0 0 var(--rc-r-md); }
:root:root [class$="filter-logic"] > [class*="filter-logic-option"]:last-of-type { border-radius: 0 var(--rc-r-md) var(--rc-r-md) 0; }
:root:root [class*="filter-logic-option"] > input[type="radio"] { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
:root:root [class*="filter-logic-option"]:has(> input:checked) { background: var(--rc-hover); color: var(--rc-text); font-weight: 600; }
:root:root [class*="filter-logic-option"]:has(> input:focus-visible) { outline: 2px solid var(--rc-focus); outline-offset: 1px; }

/* Filterzeilen außerhalb von Formularen: alle Felder und Knöpfe 36 px (Rundgang: 42 neben 36) */
:root:root :is(.filters .filter-group, .assignees-add, .ec-filters, .lxs-filters, [class*="-filterbar"], [class*="filter-row"])
  :is(select, input:not([type="checkbox"]):not([type="radio"]), button) {
    height: var(--rc-ctl-h); min-height: var(--rc-ctl-h); box-sizing: border-box; padding-top: 0; padding-bottom: 0;
}
:root:root .filters { align-items: flex-end; }
/* Ticket-Vorlagen: Bearbeiten/Löschen gleich hoch */
:root:root .template-actions :is(.btn-edit, .btn-delete) { height: 30px; min-height: 30px; padding: 0 10px; display: inline-flex; align-items: center; box-sizing: border-box; font-size: 13px; }

/* Badges/Pills/Tags einheitlich still: ohne Umrandung (Absprache 14.11.) – nur Anzeige-Elemente,
   klickbare Chips/Filter behalten den Rand für den Aus-Zustand */
:root:root :is([class*="badge"], [class*="pill"], [class*="-tag"], .tag, [class*="chip"], .twb, .status-badge, .counter):not(button):not(a):not(label):not(input):not([role="button"]):not([onclick]) {
    border-color: transparent !important;
}
:root:root .ctrl-grade2-badge { border-color: transparent !important; }

/* Qualitäts-Score (Ring, Text, Balken): Ampel in Familien-Tönen statt Akzent-Schwarz */
:root:root .qs-green .quality-score-ring { stroke: var(--rc-chart-green); }
:root:root .qs-green .quality-score-text { fill: var(--rc-ph-green); }
:root:root .qs-green .qs-summary-bar-fill { background: var(--rc-chart-green); }
:root:root .qs-orange .quality-score-ring { stroke: var(--rc-chart-amber); }
:root:root .qs-orange .quality-score-text { fill: var(--rc-ph-amber); }
:root:root .qs-orange .qs-summary-bar-fill { background: var(--rc-chart-amber); }
:root:root .qs-red .quality-score-ring { stroke: var(--rc-chart-red); }
:root:root .qs-red .quality-score-text { fill: var(--rc-ph-red); }
:root:root .qs-red .qs-summary-bar-fill { background: var(--rc-chart-red); }


/* ============================================================
   Hinweis-Boxen (Callouts) einheitlich: Fläche leicht getönt, Rand 30 %, Icon-Kachel in Statusfläche,
   Titel in Statusschrift. Farben nur aus den Status-Tokens (Success/Warning/Error/Info).
   ============================================================ */
:root:root:root .ki-briefing .ki-briefing-content {
    border: 1px solid var(--rc-border); background: var(--rc-surface);
}
:root:root .ki-briefing-icon { background: var(--rc-selected); color: var(--rc-icon); }
:root:root .ki-briefing-title { color: var(--rc-text); font-size: 13px; font-weight: 600; letter-spacing: .04em; }
/* KI-Briefing „Handlungsbedarf" = rot (Error), wie ursprünglich vorgesehen */
:root:root:root .ki-briefing[data-state="warning"] .ki-briefing-content {
    border-color: color-mix(in srgb, var(--rc-error) 35%, transparent); background: color-mix(in srgb, var(--rc-error-bg) 70%, var(--rc-surface));
}
:root:root .ki-briefing[data-state="warning"] .ki-briefing-icon { background: var(--rc-error-bg); color: var(--rc-error); }
:root:root .ki-briefing[data-state="warning"] .ki-briefing-title { color: var(--rc-error-text); }
:root:root .ki-briefing[data-state="warning"] .ki-briefing-text { color: var(--rc-error-text); }

:root:root .property-issues { --issue-color: var(--rc-error); --issue-text: var(--rc-error-text); --issue-bg: var(--rc-error-bg); }
:root:root .property-issues[data-state="warning"] { --issue-color: var(--rc-warning); --issue-text: var(--rc-warning-text); --issue-bg: var(--rc-warning-bg); }
:root:root:root .property-issues .property-issues-content {
    border: 1px solid color-mix(in srgb, var(--issue-color) 35%, transparent);
    background: color-mix(in srgb, var(--issue-bg) 70%, var(--rc-surface));
}
:root:root .property-issues-icon { background: var(--issue-bg); color: var(--issue-color); }
:root:root .property-issues-title { color: var(--issue-text); font-size: 13px; font-weight: 600; letter-spacing: .04em; }
:root:root .property-issue, :root:root .property-issue-link { color: var(--issue-text); }
:root:root .property-issue::marker { color: var(--issue-color); }
/* Sidebar Admin-Trenner + Anpassen im System-Stil */
:root:root .nav-area-divider { margin: 24px 24px 0; color: var(--sidebar-group-label); font-size: 11px; font-weight: 600; letter-spacing: .6px; }
:root:root .nav-area-divider::after { background: var(--rc-border); }
:root:root .nav-customize { padding: 16px 24px 8px; }
:root:root .nav-customize-done { background: var(--rc-btn); border-color: var(--rc-btn); color: var(--rc-btn-text); }
:root:root .nav-customize-reset { background: var(--rc-btn2); border-color: var(--rc-btn2-border); color: var(--rc-text); }
:root:root .is-nav-editing li[data-nav-key] { outline-color: var(--rc-border-strong); }
:root:root .is-nav-editing > .nav-customize { background: var(--sidebar-bg, var(--rc-surface)); padding: 10px 24px; }

/* Finder: neue Anzeigen nicht mit grauer Zeilenfläche (bei Filter „Neu“ war alles grau),
   sondern ruhig über den Punkt links in Info-Blau; aktive Zeile = Auswahl-Fläche */
:root:root .finder-table tbody tr.is-new { background-color: transparent; }
:root:root .finder-table tbody tr.is-new:hover { background-color: var(--rc-hover); }
:root:root .finder-table tbody tr.is-active,
:root:root .finder-table tbody tr.is-active.is-new { background-color: var(--rc-selected); box-shadow: inset 3px 0 0 0 var(--rc-text); }
:root:root .finder-table tbody tr.is-active:hover { background-color: var(--rc-hover); }
:root:root .new-indicator { background: var(--rc-border); }
:root:root .new-indicator.active { background: var(--rc-info); }
:root:root .finder-card.is-new { border-left-color: var(--rc-info); }
/* Dubletten-Hinweis wie alle Badges: Fläche ohne Rand */
:root:root .finder-dup-flag .dup-link { border-color: transparent; font-weight: 600; }
/* User-Menü kompakt im System-Stil */
:root:root #userDropdownMenu .dropdown-item { min-height: 34px; font-size: 13.5px; }
:root:root .dd-presence .status-option { border-color: var(--rc-border); background: var(--rc-surface); color: var(--rc-text-2); }
:root:root .dd-presence .status-option.active { background: var(--rc-hover); color: var(--rc-text); }
:root:root .dd-group[open] > summary { color: var(--rc-text); font-weight: 600; }
:root:root .dd-group-body { border-left: 1px solid var(--rc-border); margin-left: 20px; padding-left: 4px; }
:root:root .dd-presence .status-options { display: flex; flex-direction: row; gap: 0; }
:root:root .dd-presence .status-option { flex: 1 1 0; width: auto; min-width: 0; margin: 0; height: 30px; border-radius: 0; }
:root:root .dd-presence .status-option + .status-option { border-left: 0; }
:root:root .dd-presence .status-option:first-child { border-radius: var(--rc-r-md) 0 0 var(--rc-r-md); }
:root:root .dd-presence .status-option:last-child { border-radius: 0 var(--rc-r-md) var(--rc-r-md) 0; }
:root:root .dd-presence .status-options { margin: 0 !important; padding: 0 !important; width: 100%; }
:root:root .dd-presence .status-option { justify-content: center; padding: 0 4px !important; gap: 5px; font-size: 12px; white-space: nowrap; }
:root:root #userDropdownMenu { width: 320px; }

/* Hugo-Eingaben: kein Feld im Feld. Haupt-Composer: Rahmen nur am Wrapper, Textarea randlos.
   Seitenpanel: Textarea ist selbst das Feld (Verlaufsrand beim Fokus) – ohne zusätzlichen Fokus-Ring. */
:root:root .mcp-input-wrap .mcp-input,
:root:root .mcp-input-wrap .mcp-input:hover,
:root:root .mcp-input-wrap .mcp-input:focus {
    border: 0; background: transparent; box-shadow: none; outline: 0; border-radius: 0; min-height: 0; padding-left: 0; padding-right: 0;
}
:root:root .mcp-chat-foot .mcp-input:focus, :root:root .mcp-chat-foot .mcp-input:hover { box-shadow: none; outline: 0; }
:root:root .mcp-chat-foot .mcp-input:not(:focus) { border-color: var(--rc-border); }

/* User-Menü Fußzeile: App-Pills links, Abmelden als ruhiger Knopf rechts – alles 28 px, mit Innenabstand */
:root:root .dd-foot { display: flex; align-items: center; gap: 6px; padding: 8px 12px; }
:root:root .dd-foot-link {
    display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
    border: 1px solid var(--rc-border); border-radius: var(--rc-r-sm); background: var(--rc-surface);
    color: var(--rc-text-2); font-size: 12px; font-weight: 500; text-decoration: none;
}
:root:root .dd-foot-link + .dd-foot-link { padding-left: 10px; }
:root:root .dd-foot-link svg { width: 13px; height: 13px; }
:root:root .dd-foot-link:hover { background: var(--rc-hover); color: var(--rc-text); border-color: var(--rc-border-strong); }
:root:root #userDropdownMenu .dd-foot .dropdown-item.danger {
    margin-left: auto; width: auto; min-height: 28px; height: 28px; padding: 0 10px; gap: 6px;
    border-radius: var(--rc-r-sm); font-size: 12.5px; font-weight: 500;
    /* Abmelden immer rot: Text und Symbol in derselben Farbe, heller roter Grund */
    color: var(--rc-error-text); background: var(--rc-error-bg);
    border: 1px solid color-mix(in srgb, var(--rc-error-text) 18%, transparent);
}
:root:root #userDropdownMenu .dd-foot .dropdown-item.danger svg { width: 14px; height: 14px; color: currentColor; }
:root:root #userDropdownMenu .dd-foot .dropdown-item.danger:hover { background: color-mix(in srgb, var(--rc-error-bg) 70%, var(--rc-error-text) 12%); color: var(--rc-error-text); }
/* filter aus header.css (alter roter Icon-Filter) aus → Symbol exakt in Textfarbe */
:root:root #userDropdownMenu .dd-foot .dropdown-item.danger :is(svg, .icon, img) { color: currentColor !important; stroke: currentColor; filter: none !important; }

/* Anwesenheit: Farben = Status-Palette (Online Success, Abwesend Warning, Beschäftigt Error) systemweit
   (Avatar-Punkt, Sidebar, Chat, Team); im User-Menü kein Häkchen (verschob die Leiste) */
:root:root { --presence-online: var(--rc-success); --presence-away: var(--rc-warning); --presence-busy: var(--rc-error); }
:root:root .board-header .dropdown-menu .dd-presence .status-option.active::after { content: none; display: none; }
:root:root .dd-presence .status-option.active { font-weight: 600; background: var(--rc-hover); }
:root:root .dd-presence .status-dot { width: 8px; height: 8px; flex: 0 0 8px; }
/* A-Z-Suche: Input wirklich randlos/transparent (globale Feldregel hat höhere Spezifität), Feld breiter */
:root:root .azb-search > input { background: transparent !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important; }
:root:root .azb-search { min-width: 280px; flex: 1 1 320px; max-width: 420px; }

/* Filter-Chips / Segment-Knöpfe in Filterleisten systemweit 32 px (wie A-Z-Popover-Felder), ohne Ausreißer 27–30 */
:root:root :is(.upd-chip, .polls-filter-btn, .is24m-chip, .filter-btn, .wv-filter, .period-btn, .ctrl-period-btn) {
    height: 32px; min-height: 32px; padding: 0 12px; box-sizing: border-box; display: inline-flex; align-items: center;
    font-size: 13px; border-radius: var(--rc-r-md);
}
:root:root :is(.btn-add-cart, .updates-mark-all, .wv-pg-btn) { height: 32px; min-height: 32px; box-sizing: border-box; display: inline-flex; align-items: center; }
/* Tabellen-Container dürfen nie über den Seitenrand: horizontal scrollen */
:root :is(.widerrufe-table, .partners-table, .portals-table, .risk-table, .ki-staging-table, .viewings-table, .videos-table) { min-width: 0; }
:root :is(.wv-table-wrap, .partners-table-wrap, .table-scroll, [class$="-table-wrap"], [class$="-table-container"], [class$="table-scroll"]) { overflow-x: auto; max-width: 100%; }
:root .wv-wrap { overflow-x: auto; }

/* ============================================================
   Rundgang 2 – systemweit
   ============================================================ */
/* Checkboxen + Radios: ein Stil (16 px, Radius 4, Haken weiß auf Schwarz; dunkel invertiert) */
:root:root input[type="checkbox"]:not([role="switch"]):not(.toggle-input):not([class*="toggle"]):not([class*="switch"]):not(:has(+ :is([class*="slider"], [class*="track"], [class*="schiene"], [class*="knob"], [class*="toggle"]))):not(:is(.toggle, .toggle-switch, .akquise-toggle, .dk-toggle, .azb-toggle, .office-switch, .mo-switch, .pf-switch, .pfeed-switch, .poll-switch, .orgnet-toggle, .post-archive-toggle, .video-gen-toggle, [class*="switch"]) input),
:root:root input[type="radio"] {
    -webkit-appearance: none; appearance: none; flex: 0 0 auto;
    width: 16px; height: 16px; margin: 0; vertical-align: -3px; cursor: pointer;
    border: 1.5px solid var(--rc-border-strong); border-radius: 4px; background: var(--rc-surface);
    display: inline-grid; place-content: center; transition: background-color .12s ease, border-color .12s ease;
}
:root:root input[type="radio"] { border-radius: 50%; }
:root:root input[type="checkbox"]:checked:not([role="switch"]):not(.toggle-input):not(:is(.toggle, .toggle-switch, .akquise-toggle, .dk-toggle, .azb-toggle, .office-switch, .mo-switch, .pf-switch, .pfeed-switch, .poll-switch, .orgnet-toggle, .post-archive-toggle, .video-gen-toggle, [class*="switch"]) input) {
    background: var(--rc-btn) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E") center / 12px 12px no-repeat !important; border-color: var(--rc-btn) !important;
}
:root:root input[type="radio"]:checked { border-color: var(--rc-btn); background: radial-gradient(var(--rc-btn) 0 4px, var(--rc-surface) 4.5px); }
:root:root[data-theme="dark"] input[type="checkbox"]:checked:not([role="switch"]):not(.toggle-input):not(:is(.toggle, .toggle-switch, .akquise-toggle, .dk-toggle, .azb-toggle, .office-switch, .mo-switch, .pf-switch, .pfeed-switch, .poll-switch, .orgnet-toggle, .post-archive-toggle, .video-gen-toggle, [class*="switch"]) input) {
    background: #F5F5F5 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23171717' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E") center / 12px 12px no-repeat !important; border-color: #F5F5F5 !important;
}
:root:root input:is([type="checkbox"], [type="radio"]):focus-visible { outline: 2px solid var(--rc-focus); outline-offset: 2px; }
:root:root input:is([type="checkbox"], [type="radio"]):disabled { opacity: .45; cursor: not-allowed; }

/* Filter-Dialoge: Bedingungszeile ohne grauen Kasten (kein Feld im Feld) */
:root:root .modal :is(.filter-item, .filter-condition, [class*="filter-condition"], [class*="filter-chip-row"]) {
    background: transparent; border: 0; padding-left: 0; padding-right: 0; box-shadow: none;
}
/* Gefährliche Aktionen ruhig: Outline-/Zeilen-Löschknöpfe neutral, Rot nur als Schrift; Hover dezent rot */
:root:root :is(.btn-danger-outline, .btn-outline-danger, .btn-delete, .btn-reset-portal, .doc-delete, .doc-card .btn-danger, td .btn-danger, .row-actions .btn-danger) {
    background: var(--rc-btn2); border: 1px solid var(--rc-btn2-border); color: var(--rc-error-text); box-shadow: none;
}
:root:root :is(.btn-danger-outline, .btn-outline-danger, .btn-delete, .btn-reset-portal, .doc-delete, .doc-card .btn-danger, td .btn-danger, .row-actions .btn-danger):hover {
    background: var(--rc-error-bg); border-color: color-mix(in srgb, var(--rc-error) 35%, transparent); color: var(--rc-error-text);
}
:root:root :is(.btn-outline-success, .btn-success-outline) { background: var(--rc-btn2); border: 1px solid var(--rc-btn2-border); color: var(--rc-success-text); }
/* Icon-Knöpfe in Tabellen/Aktionsspalten: im Dunkelmodus sichtbar */
:root:root[data-theme="dark"] :is(td, [class*="actions"]) :is(button, a):not([class*="primary"]):not(.btn-save) { color: var(--rc-icon); }
:root:root[data-theme="dark"] :is(td, [class*="actions"]) :is(button, a):not([class*="primary"]) :is(svg, .icon) { color: currentColor; }
/* Kennzahlen: große Zahlen bleiben in der Karte */
:root:root :is([class*="kpi"], [class*="stat-card"]) :is([class*="value"], [class*="number"]) { min-width: 0; overflow-wrap: anywhere; font-size: clamp(18px, 2vw, 26px); }
/* Feldsets in Karten ohne eigenen Rahmen (Karte in Karte) */
:root:root .card fieldset, :root:root [class*="-card"] fieldset { border: 0; padding: 0; margin: 0 0 16px; }
:root:root .card legend, :root:root [class*="-card"] legend { padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--rc-label); }

/* A-Z: Ladezeit („308 ms“) nicht dauerhaft zeigen – nur kurze Meldungen („Lädt …“) */
:root:root .azb-status:not(.is-msg):not(.azb-status-admin) { display: none; }  /* Ladezeit nur für Admins */
:root:root .azb-status.azb-status-admin:not(.is-msg) { color: var(--rc-text-muted); font-size: 12px; }

/* Mehrfachauswahl (Objekt-Ausstattung u. a.): gewählte Zeilen nicht grün, Häkchen wie alle Checkboxen */
:root:root .spt-option.selected { background: transparent; }
:root:root .spt-option:hover { background: var(--rc-hover); }
:root:root .spt-option::before { width: 16px; height: 16px; border: 1.5px solid var(--rc-border-strong); border-radius: 4px; background-color: var(--rc-surface); box-sizing: border-box; }
:root:root .spt-option.selected::before { background: var(--rc-btn) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E") center / 12px 12px no-repeat !important; border-color: var(--rc-btn); }
:root:root[data-theme="dark"] .spt-option.selected::before { background: #F5F5F5 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E") center / 12px 12px no-repeat !important; border-color: #F5F5F5; }
/* Auswahl-Karten/-Optionen allgemein: gewählt = neutrale Fläche + dunkler Rand statt Grün */
:root:root :is(.approve-modal-option, .batch-style-option).selected { background: var(--rc-selected); border-color: var(--rc-text); }
/* Ausstattung-Kacheln: weiß wie Felder, Hover grau, gewählt mit dunklerem Rand */
:root:root .ausstattung-item { background: var(--rc-surface); border-color: var(--rc-border); border-radius: var(--rc-r-md); }
:root:root .ausstattung-item:hover { background: var(--rc-hover); }
:root:root .ausstattung-item:has(input:checked) { border-color: var(--rc-border-strong); background: var(--rc-selected); }
/* Tickets: Tabs laufen nicht in die Knöpfe – Tab-Leiste schrumpft/scrollt, Knöpfe fest; bei wenig Platz nur Icons */
:root:root .ticket-tabs { flex: 1 1 auto; min-width: 0; }
:root:root .ticket-tabs-actions { flex: 0 0 auto; }
:root:root .ticket-tab { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 1500px) {
    :root:root .ticket-tabs-actions .btn-outline { font-size: 0; gap: 0; width: 36px; padding: 0; justify-content: center; }
    :root:root .ticket-tabs-actions .btn-outline svg { width: 16px; height: 16px; }
}
/* Kopfzeile + ihre Menüs immer über Seiteninhalten (Karte: Panel hatte gleichen z-index 110 → „Neu“-Menü dahinter) */
:root:root .board-header { z-index: 300; }
/* Icons statt Text-Zeichen in Knöpfen (hh2-harmonize.js) */
:root .hh2-glyph { display: inline-flex; align-items: center; vertical-align: -2px; }
:root .hh2-glyph:first-child { margin-right: 6px; }
:root .hh2-glyph:last-child { margin-left: 6px; }
:root .hh2-glyph:only-child { margin: 0; }
/* Doppelte Seitentitel (Kopfzeile + eigene H1/H2 im Inhalt) und Text-Breadcrumbs ausblenden; Beschreibung bleibt ruhig */
:root:root :is(.sr-page-title, .tools-intro > h1, .ec-head h1, .smp-head h2, .efu-head > div > h2, .sr-breadcrumb, .ec-breadcrumb) { display: none; }
:root:root :is(.sr-page-sub, .tools-intro > p, .ec-head p, .smp-head p, .efu-head p) { margin-top: 0; color: var(--rc-text-2); font-size: 14px; max-width: 880px; }

/* ============================================================
   Rechnungen › Finanzen: ruhig wie der Rest (keine Schraffur, keine Versalien-Kästen, kein Durchstreichen)
   ============================================================ */
:root:root .fin-calc-label { color: var(--rc-text); text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 600; }
:root:root .fin-calc-label.is-ein, :root:root .fin-calc-label.is-aus { color: var(--rc-text); }
:root:root .fin-calc-sum.is-positive { color: var(--rc-success-text); }
:root:root .fin-calc-sum.is-negative { color: var(--rc-error-text); }
:root:root .fin-calc-soll { color: var(--rc-text-muted); }
:root:root .fin-calc-bar { border-radius: var(--rc-r-md); overflow: hidden; border: 1px solid var(--rc-border); box-shadow: none; }
:root:root .fin-calc-segment.is-vorsicht, :root:root .fin-calc-segment.is-nein { background-image: none !important; border-top: 0; border-bottom: 0; }
:root:root .fin-calc-segment.is-vorsicht .fin-calc-seg-label { font-style: italic; }
:root:root .fin-calc-segment.is-inactive { opacity: .35; filter: none; }
:root:root .fin-calc-segment.is-inactive:hover { opacity: .6; filter: none; }
:root:root .fin-calc-segment + .fin-calc-segment { box-shadow: inset 1px 0 0 var(--rc-surface); }
:root:root .fin-calc-seg-label { font-weight: 600; }
:root:root .fin-calc-seg-check { display: none; }
:root:root .fin-calc-legend { gap: 6px 14px; font-size: 12px; color: var(--rc-text-2); }
:root:root .fin-calc-legend-group-label {
    text-transform: none; letter-spacing: 0; background: transparent; padding: 0; font-size: 12px; font-weight: 600; color: var(--rc-text);
}
:root:root .fin-calc-legend-group-label:hover { background: transparent; text-decoration: underline; }
:root:root .fin-calc-legend-item.is-inactive { opacity: .45; text-decoration: none; }
:root:root .fin-calc-legend-dot { border-radius: 50%; width: 8px; height: 8px; }
:root:root :is(.fin-calc-gewinn-title, .fin-calc-presets-label, .fin-filter-group label) { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; color: var(--rc-label); }
:root:root .fin-calc-gewinn { border: 1px solid var(--rc-border); border-radius: var(--rc-r-lg); background: var(--rc-surface); }
:root:root .fin-calc-divider { border-top: 1px solid var(--rc-border); }
:root:root .fin-calc-result-label { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 600; color: var(--rc-text); }


/* ============================================================
   Rechnungen-Board wie A-Z-Board: Gruppenkopf (Chevron, Titel, Zähler), Zellen ohne Statusfläche
   ============================================================ */
:root:root .re-board-container .group-header { height: 44px; display: flex; align-items: center; padding: 0 4px; background: transparent; border: 0; }
:root:root .re-board-container .group-header > div { display: flex; align-items: center; gap: 10px; }
:root:root .re-board-container .group-toggle {
    width: 8px; height: 8px; margin: 0 4px 0 6px; border: 0; border-right: 1.75px solid var(--rc-icon); border-bottom: 1.75px solid var(--rc-icon);
    transform: rotate(45deg) translate(-2px, -2px); border-radius: 1px; background: transparent;
}
:root:root .re-board-container .group.collapsed .group-toggle { transform: rotate(-45deg); }
:root:root .re-board-container .group-title { font-size: 16px; font-weight: 600; color: var(--rc-text); }
:root:root .re-board-container .group-count {
    font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px;
    border-radius: 9999px; background: var(--rc-hover); color: var(--rc-label);
}
/* Adress-Vollständigkeit: statt grüner/roter Zellfläche ein Punkt vor dem Namen (grün = vollständig, rot = fehlt) */
:root:root .re-address-complete, :root:root .re-address-incomplete { background-color: transparent !important; }
:root:root :is(.re-address-complete, .re-address-incomplete) .re-cell-contact-link::before {
    content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; flex: 0 0 7px;
}
:root:root .re-address-complete .re-cell-contact-link::before { background: var(--rc-success); }
:root:root .re-address-incomplete .re-cell-contact-link::before { background: var(--rc-error); }
:root:root .re-address-incomplete .re-cell-contact-link { color: var(--rc-error-text); }
:root:root :is(.re-user-avatar, .re-user-initials).re-billing-incomplete { border: 2px solid var(--rc-error); }

/* Funktionen-Menü (Objekt u. a.): bei vielen Einträgen zweispaltig statt meterlanger Liste;
   „NEW“ als dezentes Info-Badge; Trenner entfallen (Abschnittstitel gliedern) */
@media (min-width: 1100px) {
    :root:root .property-dropdown:is(:has(> :nth-child(14)), [data-hh2-grouped]) {
        width: 560px; max-width: calc(100vw - 280px); columns: 2; column-gap: 4px; column-rule: 1px solid var(--rc-border);
        padding: 6px; max-height: calc(100vh - 90px);
    }
    :root:root .property-dropdown:is(:has(> :nth-child(14)), [data-hh2-grouped]) > * { break-inside: avoid; }
    :root:root .property-dropdown:has(> :nth-child(14)) > .property-dropdown-section { break-after: avoid; }
    :root:root .property-dropdown:has(> :nth-child(14)) > .property-dropdown-divider { display: none; }
}
:root:root .property-dropdown-section { font-size: 11px; font-weight: 600; letter-spacing: .6px; color: var(--sidebar-group-label, var(--rc-text-muted)); padding: 10px 10px 4px; }
:root:root .property-dropdown-item { border-radius: var(--rc-r-sm); min-height: 32px; padding: 6px 10px; gap: 10px; font-size: 13.5px; }
:root:root .property-dropdown-badge {
    margin-left: auto; background: var(--rc-info-bg); color: var(--rc-info-text); border: 0;
    font-size: 10.5px; font-weight: 600; letter-spacing: .02em; padding: 2px 6px; border-radius: var(--rc-r-xs, 4px); text-transform: none;
}
:root:root .property-dropdown-item-muted { color: var(--rc-text-muted); font-style: normal; }
/* Funktionen-Menü: Suchfeld oben und Löschen abgesetzt, jeweils über beide Spalten */
:root:root .property-dropdown .hh2-dd-search {
    column-span: all; display: flex; align-items: center; gap: 8px; height: 36px; margin: 2px 2px 6px; padding: 0 10px;
    border: 1px solid var(--rc-border); border-radius: var(--rc-r-md); background: var(--rc-surface); color: var(--rc-text-muted);
}
:root:root .property-dropdown .hh2-dd-search:focus-within { border-color: var(--rc-focus); box-shadow: var(--rc-focus-ring); }
:root:root .property-dropdown .hh2-dd-search input { flex: 1; min-width: 0; height: 100%; border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0 !important; outline: 0; font-size: 13.5px; color: var(--rc-text); }
:root:root .property-dropdown .hh2-dd-danger { column-span: all; border-top: 1px solid var(--rc-border); margin-top: 6px; padding-top: 4px; }
:root:root .property-dropdown.hh2-dd-filtering { columns: 1; width: 320px; }
:root:root .hh2-dd-search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }

/* A-Z: Gruppen-Chevron in Icon-Grau statt (heller) Gruppenfarbe */
:root:root .azb-gtoggle { color: var(--rc-icon); }
:root:root .azb-gtoggle:hover { color: var(--rc-text); }
/* Rechnungen-Board: Kopfzellen alle gleich hoch (Griff-/Checkbox-Spalte war 1 px hoch → Lücke neben „Rolle“) */
:root:root .re-board-container .table-header { align-items: stretch; }
:root:root .re-board-container .table-header > .header-cell { align-self: stretch; min-height: 36px; box-sizing: border-box; }

/* ============================================================
   Postfach ruhig
   ============================================================ */
/* Liste: ungelesen = fett + blauer Punkt statt grüner Zeile; geöffnet = Auswahlfläche ohne Streifen; markiert (Checkbox) = Hover-Grau */
:root:root .email-item.unread:not(.active):not(.selected):not(:hover) { background: transparent !important; }
:root:root .email-item { position: relative; }
/* Ungelesen: nur der vorhandene Punkt vor dem Absender, in Grün (kein zweiter Punkt, keine Zeilenfläche) */
:root:root .email-unread-dot { background-color: var(--rc-success); width: 7px; height: 7px; }
:root:root .email-list--compact .email-unread-dot { width: 6px; height: 6px; }
:root:root .email-item.active { background: var(--rc-selected); border-left: 0; box-shadow: inset 2px 0 0 var(--rc-text); }
:root:root :is(.email-item.selected, .email-item:has(.email-item-checkbox input:checked)) { background: var(--rc-hover); }
:root:root .email-item:hover { background: var(--rc-hover); }
/* Ordner-Zähler wie überall: ungelesen als Pill, sonst leise Zahl */
:root:root .folder-count { font-size: 12px; font-weight: 500; color: var(--rc-text-muted); font-variant-numeric: tabular-nums; }
:root:root .folder-count.has-unread {
    min-width: 22px; height: 20px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 9999px; background: var(--rc-hover); color: var(--rc-label); font-weight: 600;
}
/* Filter in der Suchleiste als Filter-Chips (32 px) statt großer Knöpfe */
:root:root .search-filter-section .filter-toggle { height: 32px; min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9999px; }
:root:root .search-filter-section .filter-toggle:has(input:checked), :root:root .search-filter-section .filter-toggle.is-active { background: var(--rc-text); border-color: var(--rc-text); color: var(--rc-surface); }
:root:root .search-filter-section .filter-toggle input[type="checkbox"] { display: none; }
/* Zuordnungen (Kontakt/Objekt) ohne graues Band */
:root:root .email-assignments { background: transparent; border-bottom: 1px solid var(--rc-border); padding: 8px 24px; }
/* Absender immer kräftig; ungelesen zusätzlich Betreff fett + grüner Punkt */
:root:root .email-item .email-item-from { font-weight: 600; color: var(--rc-text); }
:root:root .email-item:not(.unread) .email-item-subject { font-weight: 400; color: var(--rc-text-2); }
:root:root .email-item.unread .email-item-subject { font-weight: 600; color: var(--rc-text); }
/* Ungelesen: 2-px-Streifen links in Punktfarbe + Absender 700 (schneller erfassbar) */
:root:root:root .email-item.unread:not(.active) { box-shadow: inset 2px 0 0 var(--rc-success); }
:root:root:root .email-item.unread .email-item-from { font-weight: 700; }
/* Datum vollständig („12.11.2026 16:13") – nicht abschneiden */
:root:root .email-item-time { white-space: nowrap; flex: 0 0 auto; overflow: visible; text-overflow: clip; font-size: 12px; color: var(--rc-text-muted); }

/* Antworten-/Neue-Mail-Fenster als Seitenpanel: ohne Rundung */
:root:root .modal-compose .modal-compose-content { border-radius: 0; }
:root:root .email-item-time { width: auto !important; min-width: max-content !important; max-width: none !important; }
/* Komfort-Liste: Datum in der Absenderzeile, Betreff + Vorschau über die volle Breite */
:root:root .email-list:not(.email-list--compact) .email-item {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 10px; row-gap: 2px; align-items: center;
}
:root:root .email-list:not(.email-list--compact) .email-item > .email-item-checkbox { grid-column: 1; grid-row: 1 / span 2; align-self: start; }
:root:root .email-list:not(.email-list--compact) .email-item > .email-item-content { display: contents; }
:root:root .email-list:not(.email-list--compact) .email-item .email-item-header { grid-column: 2; grid-row: 1; min-width: 0; }
:root:root .email-list:not(.email-list--compact) .email-item > .email-item-time { grid-column: 3; grid-row: 1; align-self: center; }
:root:root .email-list:not(.email-list--compact) .email-item .email-item-subject-wrap { grid-column: 2 / 4; grid-row: 2; min-width: 0; }

/* A-Z Detail-Panel-Kopf: Name groß, Phase + DISG als kleine Pills, Kontaktdaten leise grau */
:root:root .azb-up-head { gap: 6px; }
:root:root .azb-up-head-name { font-size: 18px; font-weight: 600; color: var(--rc-text); letter-spacing: -0.01em; }
:root:root .azb-up-head-top { gap: 6px 8px; }
:root:root .azb-up-phase { line-height: 22px; border-radius: var(--rc-r-sm); font-size: 11.5px; }
:root:root .azb-up-head .cp-header-disg .disg-card { border: 0; background: var(--rc-selected); border-radius: 9999px; height: 22px; padding: 0 8px 0 3px; }
:root:root .azb-up-disg-add { border-color: var(--rc-border-strong); color: var(--rc-text-muted); }
:root:root .azb-up-head-info { gap: 4px 14px; font-size: 12.5px; }
:root:root .azb-up-head-info :is(a, span) { color: var(--rc-text-2); text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
:root:root .azb-up-head-info a:hover { color: var(--rc-text); text-decoration: underline; }
:root:root .azb-up-head-info svg { color: var(--rc-icon); width: 14px; height: 14px; }

/* Initialen-Avatare (kein Foto): Buchstaben IMMER mittig – horizontal + vertikal.
   Zeilenhöhe/Buchstabenabstand von außen verschoben die Initialen bei Inter optisch. */
:root:root :is(.azb-user, .avatar-initials, .user-initials, .re-user-initials, [class*="avatar"]:not(img):not(:has(img)):not([class*="with-avatar"]):not([class*="avatar-group"]):not([class*="avatars"]), [class*="initials"]) {
    /* Container wie .name-with-avatar / Avatar-Gruppen nicht anfassen */
    display: inline-grid !important; place-items: center; text-align: center;
    line-height: 1 !important; letter-spacing: 0 !important; padding: 0 !important; text-indent: 0;
    font-variant-numeric: normal;
}
:root:root :is(.azb-user, .avatar-initials, .user-initials, .re-user-initials) > :not(img) { line-height: 1; }
/* Großbuchstaben optisch exakt mittig: Textbox auf Versalhöhe zuschneiden (wo unterstützt) */
@supports (text-box: trim-both cap alphabetic) {
    :root:root :is(.azb-user, .avatar-initials, .user-initials, .re-user-initials, [class*="initials"]) { text-box: trim-both cap alphabetic; }
}

/* ============================================================
   Deals-Kanban: offene Spalten statt Kasten-in-Kasten.
   Spalten ohne Rahmen/Fläche, feste Trennlinie zwischen den Spalten, Karten mit dezentem Rand.
   ============================================================ */
:root:root .dk-board { gap: 0; padding: 0 8px; align-items: stretch; background: var(--rc-background); }
:root:root .dk-column {
    background: transparent; border: 0; border-radius: 0;
    border-right: 1px solid var(--rc-border);
    padding: 0 12px; max-height: 100%;
}
:root:root .dk-column:last-child { border-right: 0; }
:root:root .dk-column-header {
    border-bottom: 0; padding: 16px 2px 10px; background: var(--rc-background); z-index: 2;
}
:root:root .dk-column-title { font-size: 14px; font-weight: 600; color: var(--rc-text); }
:root:root .dk-column-count { border: 0; background: var(--rc-hover); color: var(--rc-label); font-weight: 600; font-size: 12px; height: 22px; display: inline-flex; align-items: center; justify-content: center; padding: 0 7px; }
:root:root .dk-cards { padding: 2px 0 12px; gap: 8px; }
:root:root .dk-cards.dk-drop-hover { background: var(--rc-hover); border-radius: var(--rc-r-md); }
:root:root .dk-card { border: 1px solid var(--rc-border); border-left-width: 1px; box-shadow: none; border-radius: var(--rc-r-lg); background: var(--rc-surface); }
:root:root .dk-card:hover { border-color: var(--rc-border-strong); box-shadow: 0 2px 8px rgba(0,0,0,.05); }
:root:root .dk-load-more { margin: 0 0 12px; border: 0; background: transparent; color: var(--rc-text-2); font-weight: 500; height: 32px; padding: 0; }
:root:root .dk-load-more:hover { background: var(--rc-hover); color: var(--rc-text); }
/* Bestätigungsseiten: angehakte Zustimmungen grün statt schwarz (positiver Zustand) */
:root:root .confirm-page input[type="checkbox"]:checked:not([class*="toggle"]):not([class*="switch"]) {
    background: var(--rc-success) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E") center / 12px 12px no-repeat !important; border-color: var(--rc-success) !important;
}
:root:root .confirm-page .ic-proof::before { background: var(--rc-success); }

/* Bild-Merkmale (Portale/Exposé/Grundriss …): aktiv klar sichtbar = schwarz gefüllt + weiß, inaktiv = leise Kontur */
:root:root .merkmal-tag {
    background: var(--rc-surface); color: var(--rc-text-muted); border: 1px solid var(--rc-border);
    border-radius: var(--rc-r-sm); font-weight: 500; cursor: pointer; transition: background-color .12s, color .12s, border-color .12s;
}
:root:root .merkmal-tag:hover { border-color: var(--rc-border-strong); color: var(--rc-text); }
:root:root .merkmal-tag.active { background: var(--rc-btn); border-color: var(--rc-btn); color: var(--rc-btn-text); font-weight: 600; }
:root:root .merkmal-tag.active:hover { background: var(--rc-btn-hover, #2A2A2A); }

/* ============================================================
   Objekt › Portale: Liste mit einer Zeile pro Portal statt Kachelraster
   [Schalter] [Logo Name Status] [Tage online] [Veröffentlicht] [Aktualisiert] [Aktion]
   ============================================================ */
:root:root .portal-cards-grid {
    display: flex; flex-direction: column; gap: 0;
    border: 1px solid var(--rc-border); border-radius: var(--rc-r-lg); background: var(--rc-surface); overflow: hidden;
}
:root:root .portal-cards-grid > .portal-card {
    display: grid; grid-template-columns: 84px minmax(220px, 1.4fr) repeat(3, minmax(96px, .55fr)) minmax(140px, auto);
    grid-template-rows: auto; grid-auto-rows: auto; height: auto !important; min-height: 56px !important;
    grid-template-areas: "tog head m1 m2 m3 act";
    align-items: center; column-gap: 12px; padding: 10px 16px; min-height: 56px;
    border: 0; border-bottom: 1px solid var(--rc-border); border-radius: 0; box-shadow: none; background: transparent;
}
:root:root .portal-cards-grid > .portal-card:last-child { border-bottom: 0; }
:root:root .portal-cards-grid > .portal-card:hover { background: var(--rc-hover); }
:root:root .portal-card .portal-card-actions { display: contents; }
:root:root .portal-card .portal-card-actions-start { grid-area: tog; display: flex; align-items: center; gap: 6px; margin: 0; }
:root:root .portal-card .portal-card-actions > button, :root:root .portal-card .portal-card-actions > .btn { grid-area: act; justify-self: end; }
:root:root .portal-card .portal-card-header { grid-area: head; display: flex; align-items: center; justify-content: flex-start; gap: 10px; padding: 0; border: 0; margin: 0; min-width: 0; }
:root:root .portal-card .portal-card-title { flex: 0 1 auto; min-width: 0; }
:root:root .portal-card .portal-card-actions-start { flex-wrap: nowrap; }
:root:root .portal-card .portal-card-delete { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; border-radius: 6px; color: var(--rc-icon); }
:root:root .portal-card .portal-card-delete:hover { background: var(--rc-error-bg); color: var(--rc-error-text); }
:root:root .portal-card .portal-card-metrics, :root:root .portal-card .portal-card-header { margin: 0 !important; padding: 0 !important; border: 0 !important; }
:root:root .portal-card .portal-card-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:root:root .portal-card .portal-card-metrics { display: contents; }
:root:root .portal-card .portal-metric { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 0; border: 0; }
:root:root .portal-card .portal-metric:nth-child(1) { grid-area: m1; }
:root:root .portal-card .portal-metric:nth-child(2) { grid-area: m2; }
:root:root .portal-card .portal-metric:nth-child(3) { grid-area: m3; }
:root:root .portal-card .portal-metric-value { font-size: 13.5px; font-weight: 600; color: var(--rc-text); }
:root:root .portal-card .portal-metric-label { font-size: 11px; color: var(--rc-text-muted); }
:root:root .portal-card .toggle-field > span:not(.toggle-slider), :root:root .portal-card .toggle-switch .toggle-slider::after { display: none !important; } /* „Ja/Nein“ neben dem Schalter entfällt in der Zeile */
:root:root .portal-card > :not(.portal-card-header):not(.portal-card-metrics):not(.portal-card-actions) { grid-column: 2 / -1; font-size: 12px; margin: 0 0 2px; }
/* Status-Badges in Familien */
:root:root .portal-status { border: 0; border-radius: var(--rc-r-sm); font-size: 11px; font-weight: 600; letter-spacing: .02em; padding: 2px 7px; text-transform: none; }
:root:root .portal-status--online { background: var(--rc-ph-green-bg); color: var(--rc-ph-green); }
:root:root .portal-status--offline { background: var(--rc-ph-gray-bg); color: var(--rc-ph-gray); }
:root:root .portal-status--draft { background: transparent; color: var(--rc-text-muted); padding-left: 0; }
:root:root .portal-status--outdated { background: var(--rc-ph-amber-bg); color: var(--rc-ph-amber); }
:root:root .portal-status:is(.portal-status--queued, .portal-status--exporting) { background: var(--rc-ph-blue-bg); color: var(--rc-ph-blue); }
/* Ohne Export: Zeile leiser */
:root:root .portal-card:has(.portal-status--draft) :is(.portal-card-name, .portal-metric-value) { color: var(--rc-text-muted); font-weight: 500; }
@media (max-width: 1100px) {
    :root:root .portal-cards-grid > .portal-card { grid-template-columns: 84px 1fr auto; grid-template-areas: "tog head act"; }
    :root:root .portal-card .portal-metric { display: none; }
}
:root:root .portal-card .portal-card-notices:not(:has(*:not(:empty))) { display: none !important; }
:root:root .portal-card .portal-card-notices { min-height: 0 !important; padding: 0 !important; margin: 0 0 2px !important; }
:root:root .portal-card .portal-card-actions-start .toggle-field { width: auto !important; min-width: 0 !important; flex: 0 0 auto; }
:root:root .portal-card .portal-card-actions-start :is(.toggle-field, .toggle-switch) { width: var(--rc-toggle-w) !important; min-width: var(--rc-toggle-w) !important; max-width: var(--rc-toggle-w) !important; }
/* Portal-Zeilen: Aktions-Zustände auch in der Liste sichtbar (Hintergrund/Balken statt Kachelrand) */
:root:root .portal-cards-grid > .portal-card.portal-card--exporting { background: var(--pa-bg) !important; border-color: var(--rc-border) !important; }
:root:root .portal-cards-grid > .portal-card { --pa-bg: var(--rc-info-bg); --pa: var(--rc-info); }
:root:root .portal-cards-grid > .portal-card[data-portal-action="publish"] { --pa-bg: var(--rc-success-bg); --pa: var(--rc-success); }
:root:root .portal-cards-grid > .portal-card[data-portal-action="remove"] { --pa-bg: var(--rc-selected); --pa: var(--rc-text-muted); }
:root:root .portal-cards-grid > .portal-card.portal-card--export-error { --pa-bg: var(--rc-error-bg); --pa: var(--rc-error); }
:root:root .portal-card .portal-status--exporting { background: var(--pa-bg); color: var(--pa); }
:root:root .portal-card .portal-card-delete--text { width: auto; height: auto; color: var(--rc-error-text); background: transparent; } :root:root .portal-card .portal-card-delete--text:hover { color: var(--rc-error); background: transparent; }

/* ============================================================
   Exposé-Landingpage (lp/exposee): ruhig, professionell, ein Guss
   ============================================================ */
/* Signal-Chips: neutral, Farbe nur im kleinen Icon */
:root:root .signal-badge { background: var(--rc-surface); border: 1px solid var(--rc-border); color: var(--rc-text); box-shadow: none; font-weight: 500; }
:root:root .signal-badge:hover { border-color: var(--rc-border-strong); }
:root:root .signal-badge .signal-badge-icon { background: transparent !important; box-shadow: none !important; width: 18px; height: 18px; }
:root:root .signal-badge.signal-hot .signal-badge-icon { color: var(--rc-error); }
:root:root .signal-badge.signal-views .signal-badge-icon { color: var(--rc-info); }
:root:root .signal-badge.signal-new .signal-badge-icon { color: var(--rc-success); }
:root:root .signal-badge.signal-seal .signal-badge-icon { color: var(--rc-icon); }
:root:root .signal-badge.signal-hot .signal-badge-text { color: var(--rc-text); }
/* Merkmal-Chips + Typ-Badge neutral (Grün bleibt „positiv“ vorbehalten) */
:root:root .usp-chip { background: var(--rc-selected); color: var(--rc-text-2); font-weight: 500; }
:root:root .lp-badges .landing-badge { background: var(--rc-ph-blue-bg); color: var(--rc-ph-blue); }
/* Ausstattung: positive Punkte grün */
:root:root .ausstattung-item::before { color: var(--rc-success); }
/* Energieskala: A+ dunkelgrün (nicht Akzent-Schwarz) */
:root:root .energy-Aplus { background: #0B6E3A !important; color: #FFFFFF; }
/* Ansprechpartner: eine Hauptaktion (Besichtigung schwarz), WhatsApp sekundär; Name/Rolle enger */
:root:root .contact-btn-wa, :root:root .contact-btn-wa:hover, :root:root .contact-btn-wa:focus {
    background: var(--rc-surface); color: var(--rc-text); border: 1px solid var(--rc-border); filter: none;
}
:root:root .contact-btn-wa:hover { background: var(--rc-hover); border-color: var(--rc-border-strong); }
:root:root .contact-info { gap: 4px; }
:root:root .contact-info .contact-name { margin-bottom: 0; }
/* Handy-Leiste: nur Termin schwarz, Anrufen/E-Mail neutral */
:root:root .landing-sticky-btn-call, :root:root .landing-sticky-btn-call:hover, :root:root .landing-sticky-btn-call:focus {
    background: var(--rc-surface); color: var(--rc-text); border: 1px solid var(--rc-border); filter: none;
}
/* Wunschtermin: keine Box in der Karte, „Weiteren Termin“ als ruhiger Knopf */
:root:root .lvr-row { background: transparent; border: 0; border-top: 1px solid var(--rc-border); border-radius: 0; padding-left: 0; padding-right: 0; }
:root:root .lvr-add { border: 1px solid var(--rc-border); border-style: solid; background: var(--rc-surface); color: var(--rc-text); border-radius: var(--rc-r-md); }
:root:root .lvr-add:hover { background: var(--rc-hover); border-color: var(--rc-border-strong); }
/* KI-Hinweis: dezente Info-Fläche ohne Streifen */
:root:root .ai-image-notice { border-left: 0; background: var(--rc-selected); border-radius: var(--rc-r-lg); color: var(--rc-text-2); }
/* Energieskala: deutlich unterscheidbare, ruhige Stufung (A+ dunkelgrün → H dunkelrot) */
:root:root .energy-Aplus { background: #0B6E3A !important; color: #FFFFFF; }
:root:root .energy-A { background: #16A36A !important; color: #FFFFFF; }
:root:root .energy-B { background: #6DB84A !important; color: #FFFFFF; }
:root:root .energy-C { background: #C9C23A !important; color: #2B2B12; }
:root:root .energy-D { background: #E7B23F !important; color: #3B2A08; }
:root:root .energy-E { background: #E08A3C !important; color: #3B1F08; }
:root:root .energy-F { background: #DC5555 !important; color: #FFFFFF; }
:root:root .energy-G { background: #B33A3A !important; color: #FFFFFF; }
:root:root .energy-H { background: #8A1515 !important; color: #FFFFFF; }

/* ============================================================
   Pitch-Deck (Investoren): ruhige Markenfarbe Grün als Akzent statt Schwarz,
   lesbarer Hero, Kacheln 12 px ohne Farbstreifen, neutrale Icon-Kacheln
   ============================================================ */
:root:root:has(body.page-pitch-deck) {
    --color-accent: #16A36A; --color-accent-dark: #0E7A4E; --green-900: #0B2A1F;
}
:root:root .page-pitch-deck .pitch {
    --pd-mint: #16A36A; --pd-mint2: #3FB37D; --pd-mint3: #0E7A4E; --pd-mint4: #0B5E3D; --pd-mint5: #0B3D2A;
    --pd-dark: #0F1512; --pd-bg: var(--rc-background); --pd-text: var(--rc-text); --pd-muted: var(--rc-text-2);
    --pd-border: var(--rc-border); --pd-radius: 12px; --pd-shadow: none; --pd-shadow-lg: 0 8px 24px rgba(0,0,0,.06);
    font-family: inherit;
}
/* Hero: dunkel, ruhig, alles lesbar */
:root:root .page-pitch-deck .pitch-hero { background: linear-gradient(135deg, #0F1512 0%, #10241B 60%, #0B3D2A 100%) !important; color: #FFFFFF; border-radius: 0 0 12px 12px; }
:root:root .page-pitch-deck .pitch-hero :is(h1, h2, .pitch-hero-title, .pitch-title) { color: #FFFFFF !important; }
:root:root .page-pitch-deck .pitch-hero .pitch-hero-sub { color: rgba(255,255,255,.78) !important; }
:root:root .page-pitch-deck .pitch-hero .pitch-hero-sub strong, :root:root .page-pitch-deck .pitch-hero-brand-tag { color: #7FD8AE !important; }
:root:root .page-pitch-deck .pitch-hero-brand { background: rgba(255,255,255,.08); color: #FFFFFF; border-radius: 9999px; }
:root:root .page-pitch-deck .pitch-hero-brand-meta { color: rgba(255,255,255,.75) !important; }
:root:root .page-pitch-deck .pitch-kpi { border-radius: 12px !important; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.10); }
:root:root .page-pitch-deck .pitch-kpi:hover { background: rgba(255,255,255,.10); transform: none; }
:root:root .page-pitch-deck .pitch-kpi :is(.pitch-kpi-label, .pitch-kpi-sub) { color: rgba(255,255,255,.7) !important; }
:root:root .page-pitch-deck .pitch-kpi .pitch-kpi-value { color: #FFFFFF !important; }
/* Kennzahl-Karten: keine Farbstreifen, gleicher Radius, ruhiger Rand */
:root:root .page-pitch-deck :is(.pd-stat, .pd-card, .pd-tech-card, .pd-leader-card) { border-radius: 12px !important; border: 1px solid var(--rc-border); box-shadow: none; }
:root:root .page-pitch-deck .pd-stat::before { display: none !important; }
:root:root .page-pitch-deck .pd-stat-value { color: var(--rc-text); }
:root:root .page-pitch-deck .pitch-eyebrow { color: #0E7A4E; }
/* Plattform-Kacheln: neutrale Icon-Kachel, Icon grün */
:root:root .page-pitch-deck .pd-tech-icon { background: #EAF7F0 !important; color: #0E7A4E !important; border-radius: 8px !important; box-shadow: none !important; }
:root:root .page-pitch-deck .pd-tech-icon :is(svg, .icon) { color: #0E7A4E !important; fill: none; }
/* Datenbank-Banner: dunkel, Zahlen lesbar in Hellgrün */
:root:root .page-pitch-deck .pd-mega { background: linear-gradient(135deg, #0F1512 0%, #0B3D2A 100%) !important; border-radius: 12px; }
:root:root .page-pitch-deck .pd-mega :is(.pd-mega-text) { color: #FFFFFF; }
:root:root .page-pitch-deck .pd-mega .pd-mega-stat-num { color: #7FD8AE !important; }
:root:root .page-pitch-deck .pd-mega .pd-mega-stat-lbl { color: rgba(255,255,255,.75) !important; opacity: 1; }
:root:root .page-pitch-deck .pd-bar-fill { background: #16A36A !important; }

/* ⌘K-Suche: Eingabe randlos in der Zeile (Zeile hat schon die Trennlinie) – kein Feld-Rahmen/Fokus-Ring */
:root:root .gsearch-input, :root:root .gsearch-input:hover, :root:root .gsearch-input:focus, :root:root .gsearch-input:focus-visible {
    border: 0 !important; box-shadow: none !important; outline: none !important; background: transparent !important;
}

/* A-Z-Updates-Composer: ein dünner Rahmen, Fokus dezent grau statt schwarz + Ring; Textfeld selbst randlos */
:root:root .azb-cmp { border: 1px solid var(--rc-border); border-radius: 12px; background: var(--rc-surface, #fff); transition: border-color .15s ease, box-shadow .15s ease; }
:root:root .azb-cmp:hover { border-color: var(--rc-border-strong); }
:root:root .azb-cmp:focus-within { border-color: var(--rc-focus); box-shadow: var(--rc-focus-ring); }
:root:root .azb-cmp textarea, :root:root .azb-cmp textarea:hover, :root:root .azb-cmp textarea:focus, :root:root .azb-cmp textarea:focus-visible {
    border: 0 !important; box-shadow: none !important; outline: none !important; background: transparent !important;
}
:root:root .azb-cmp textarea::placeholder { color: var(--rc-text-muted, #8C8C8C); }
:root:root .azb-cmp-bar { padding: 4px 8px 8px; }

/* Statistik-Heatmaps (Anfragen nach Monatstag, Portal & Monat): eine grüne Stufenleiter statt Grün→Schwarz */
:root:root :is(.heatmap-cell, .heatmap-legend-cell, .portal-month-table td.pm-cell):is(.level-1, .level-2, .level-3, .level-4, .level-5) { font-weight: 600; }
:root:root :is(.heatmap-cell, .heatmap-legend-cell, .portal-month-table td.pm-cell).level-1 { background: color-mix(in srgb, var(--rc-chart-green) 12%, var(--rc-surface)); color: var(--rc-text-2, #3D3D3D); }
:root:root :is(.heatmap-cell, .heatmap-legend-cell, .portal-month-table td.pm-cell).level-2 { background: color-mix(in srgb, var(--rc-chart-green) 28%, var(--rc-surface)); color: var(--rc-text, #171717); }
:root:root :is(.heatmap-cell, .heatmap-legend-cell, .portal-month-table td.pm-cell).level-3 { background: color-mix(in srgb, var(--rc-chart-green) 50%, var(--rc-surface)); color: var(--rc-text, #171717); }
:root:root :is(.heatmap-cell, .heatmap-legend-cell, .portal-month-table td.pm-cell).level-4 { background: color-mix(in srgb, var(--rc-chart-green) 78%, #000); color: #fff; }
:root:root :is(.heatmap-cell, .heatmap-legend-cell, .portal-month-table td.pm-cell).level-5 { background: color-mix(in srgb, var(--rc-chart-green) 55%, #000); color: #fff; }

/* Statistik „Anfragen pro Portal & Monat“: kompakt (die globale Tabellen-Regel gab 45 px Zeilen
   → 50 Portale = 2.400 px). Box höchstens 560 px, Kopf + Summenzeile bleiben beim Scrollen stehen. */
:root:root .portal-month-container { max-height: 560px; overflow: auto; padding: 0 0 4px; margin-top: 12px; }
:root:root .portal-month-table { border-spacing: 2px; font-size: 12px; }
:root:root .portal-month-table :is(th, td) { height: 28px; padding: 0 8px; font-size: 12px; line-height: 28px; }
:root:root .portal-month-table th { font-size: 11px; color: var(--rc-text-muted); }
:root:root .portal-month-table thead th { position: sticky; top: 0; z-index: 3; background: var(--rc-surface); }
:root:root .portal-month-table thead th.pm-portal { z-index: 4; }
:root:root .portal-month-table tfoot td { position: sticky; bottom: 0; z-index: 3; background: var(--rc-surface-2, #F5F5F5); }
:root:root .portal-month-table tfoot td.pm-portal { z-index: 4; }
:root:root .portal-month-table td.pm-portal { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:root:root .portal-month-table tfoot td.pm-grand { background: var(--rc-text, #171717); color: var(--rc-surface, #fff); }

/* ============================================================
   Barrierefreiheit (a11y)
   Kontrast-Korrekturen außerhalb des Token-Blocks (Sidebar-Tokens stehen weiter oben
   mit gleicher Spezifität), sichtbarer Tastatur-Fokus, Skip-Link (assets/js/hh-a11y.js).
   ============================================================ */
/* Sidebar-Gruppenlabels: hell #999999 (2.85:1) → #757575 (4.61:1 auf #FFFFFF);
   dunkel #71717A (3.74:1) → #85858E (4.95:1 auf #151619) */
:root:root { --sidebar-group-label: #757575; }
:root:root[data-theme="dark"] { --sidebar-group-label: #85858E; }

/* Zähler-Badges mit weißer Ziffer: #DC5555 → var(--rc-counter-bg) #C94444 (4.78:1) */
:root:root .board-header .notification-badge,
:root:root .board-header .unread-badge,
:root:root .board-header [class*="badge-count"],
:root:root .sidebar :is(.unread-badge, .notification-dot),
:root:root .risk-dash-badge { background: var(--rc-counter-bg); }

/* Statusfarben als Schrift: die dunklere -text-Variante (Success #16A36A 3.24:1 → #0E7A4E 5.37:1,
   Error #DC5555 3.83:1 → #B33A3A 5.86:1) */
:root:root .kpi-change.positive { color: var(--rc-success-text); }
:root:root .kpi-change.negative { color: var(--rc-error-text); }
:root:root .rt-badge-warn { color: var(--rc-warning-text); }
/* Transparenz auf farbiger Schrift drückt den Kontrast unter 4.5:1 (Dashboard Risiko-Widget) */
:root:root :is(.risk-item-meta, .risk-item-score-label) { opacity: 1; }

/* Tastatur-Fokus: nur :focus-visible (nicht bei Maus-Klick). Texteingaben behalten ihren eigenen Rahmen-Fokus. */
:root:root:root :is(a[href], button, summary, [role="button"], [role="link"], [role="tab"], [role="menuitem"],
    [role="option"], [role="switch"], [role="checkbox"], [tabindex]:not([tabindex="-1"]),
    input:is([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"], [type="button"], [type="submit"], [type="reset"])):focus-visible {
    outline: 2px solid var(--rc-focus);
    outline-offset: 2px;
}
:root:root:root :is(a[href], button, [role="button"], [tabindex]):focus:not(:focus-visible) { outline: none; }
/* Programmatisch fokussierter Hauptinhalt (Skip-Link) ohne Rahmen */
:root:root [data-hh-skip-target]:focus { outline: none; }

/* „Zum Inhalt springen“: Styles stehen global in hh-states.css (auch ohne hh2) */

/* a11y – Nachtrag (axe auf 20 weiteren Seiten) */
:root:root .ctrl-sp-none { color: var(--rc-error-text); }                        /* #DC5555 auf #F8F8F8 3.61:1 → #B33A3A 5.5:1 */
:root:root .chat-pins-preview { opacity: 1; }                                    /* Opacity drückte Warnton auf 3.96:1 */
:root:root[data-theme="dark"] .newsletter-optin-badge:is(.is-missing, .is-revoked) { color: var(--rc-error-text); border-color: var(--rc-error); } /* #A04040 auf #292B30 2.22:1 */

/* ============================================================
   Dark Mode – Nachzügler
   Ergebnis des Dark-Audits über alle Seiten (Desktop 1512 + mobil 390).
   Nur Dark, nur gezielte Selektoren; Tokens siehe „Dark-Audit“ im Token-Block.
   ============================================================ */
/* Seiten mit eigenen, festen Hell-Tokens: Karten blieben weiß, Text wurde hell */
:root:root[data-theme="dark"] .page-team-detail {
    --td-bg: var(--rc-background); --td-card: var(--rc-surface); --td-text: var(--rc-text);
    --td-muted: var(--rc-text-muted); --td-border: var(--rc-border); --td-shadow: none; --td-shadow-lg: var(--rc-shadow-pop);
}
:root:root[data-theme="dark"] .page-pitch-deck .pitch { --pd-card: var(--rc-surface); --pd-muted: var(--rc-text-muted); }
:root:root[data-theme="dark"] .page-pitch-deck .pitch-eyebrow { color: var(--rc-success-text); }  /* #0E7A4E auf #111214 3.49:1 */

/* Helle Primärflächen (Dark: #F5F5F5) mit weißer/heller Schrift → Primär-Schrift */
:root:root[data-theme="dark"] :is(.ctrl-note-bubble, .addendum-tab.active, .btn-icon-small.primary, .fin-filter-apply,
    .btn-generate, .btn-create, .btn-massenmail-send, .btn-join, .phase-chip.active, .version-badge,
    .bday-item-today .bday-countdown, .page-projekte .filter-badge, .btn-apply-filter) { color: var(--rc-btn-text); }
:root:root[data-theme="dark"] .ac-range-btn.is-active { color: var(--rc-text); }  /* #171717 auf #292B30 1.26:1 */
:root:root[data-theme="dark"] .anrufe-tab.active .anrufe-tab-count { background: rgba(0, 0, 0, .10); color: var(--rc-btn-text); }
:root:root[data-theme="dark"] .anrufe-dir-in { color: var(--rc-success-text); background: var(--rc-success-bg); }

/* Summenzeile Portal-Monatstabelle: Hintergrund aus --rc-surface-2 (jetzt definiert); Gesamtzelle bleibt invertiert */
:root:root[data-theme="dark"] .portal-month-table tfoot td:not(.pm-grand) { color: var(--rc-text); }

/* Rot als Schrift: Dark-Danger #B91C1C ist eine Button-Fläche, als Text nur 2.2–2.7:1 → #F0A0A0 */
:root:root[data-theme="dark"] :is(.post-deadline, .btn-portal-action.danger, .lxs-kpi-warn .lxs-kpi-value, .lxs-kpi-value.neg,
    .eps-diag-warn .eps-diag-title, .xqm-error-msg, .summary-pill.pill-missing, .summary-pill.pill-missing strong,
    .stat-card.danger .stat-value) { color: var(--rc-error-text); }
:root:root[data-theme="dark"] .geocoding-actions .btn-danger { color: #FFFFFF; }   /* #AEB1B7 auf #B91C1C 3.01:1 */
:root:root[data-theme="dark"] .xqm-info-title { color: var(--rc-warning-text); }       /* #B45309 2.58:1 */

/* Farbige Segmentbalken (Rechnungen/Finanzen): helle Schrift auf hellen Segmenten → dunkle Schrift */
:root:root[data-theme="dark"] .fin-pipeline-segment :is(.seg-count, .seg-sum) { color: #171717; }
:root:root[data-theme="dark"] :is(.fin-calc-seg-label, .fin-calc-seg-value) {
    color: #171717; background: rgba(255, 255, 255, .72); border-radius: var(--rc-r-xs); padding: 1px 4px; opacity: 1;
}

/* „In Entwicklung“-Kacheln (Intranet/Vereinbarungen): Opacity .5 → 3.25:1 */
:root:root[data-theme="dark"] .tool-card.disabled { opacity: .75; }
:root:root[data-theme="dark"] .tool-card[style*="pointer-events: none"] { opacity: .75 !important; }  /* Inline-Opacity .5 (intranet.php) */

/* Trenner (|, ·) im Dark kaum sichtbar (1.6:1) */
:root:root[data-theme="dark"] :is(.divider-pipe, .bday-sep, .drive-breadcrumb-sep) { color: var(--rc-text-muted); }

/* E-Mail-Signatur-Editor zeigt die Mail so, wie sie beim Empfänger ankommt (Inline-Farben für weißes Papier) */
:root:root[data-theme="dark"] .signatur-editor-wrapper .legal-content-editor { background: #FFFFFF; color: #171717; }
/* Die Dark-Regel „Icon-Knöpfe in Aktionsspalten → var(--rc-icon)“ (weiter oben, Spezifität 0,6,1) traf auch
   gefüllte Buttons: hellgrauer Text auf heller Primär- bzw. roter Danger-Fläche (1.97:1 / 3.01:1). Gleiche Spezifität, später → gewinnt. */
:root:root:root[data-theme="dark"] :is(td, [class*="actions"]) :is(button, a):is(.btn-generate, .btn-green, .btn-add-entry, .btn-new-board,
    .btn-compose, .btn-login, .btn-create, .btn-massenmail-send, .btn-join, .btn-apply-filter, .fin-filter-apply) { color: var(--rc-btn-text); }
:root:root:root[data-theme="dark"] [class*="actions"]:not(.row-actions) :is(button, a):is(.btn-danger):not(:is(.btn-danger-outline, .btn-outline-danger, td *, .doc-card *)) { color: #FFFFFF; }

/* Test-Badge „Design-Test hh2 · aus“: nicht über Dialogen/Toasts, mobil nicht über Bedienelementen */
body.modal-open .hh2-design-flag { display: none; }
/* KEIN body:has(.modal[style*=…]) – in Firefox teurer DOM-Durchlauf bei jeder Style-Änderung (siehe header.css) */
