/* =========================================
   1. GLOBALE STRUKTUR & VARIABLEN
   ========================================= */
:root {
    --bg-dark: #111111;
    --panel-bg: #1c1c1c;
    --panel-border: #2a2a2a;
    --text-main: #ffffff;
    --text-muted: #888888;
    --brand-primary: #333333;
    --brand-accent: #e0e0e0;
    --brand-accent-rgb: 224, 224, 224;
    --btn-text: #000000;
    
    --danger-red: #ff4444;
    --danger-bg: rgba(255, 68, 68, 0.1);
    --success-green: #00C851;
    --ai-purple: #b15cff;
    
    --zoom-scale: 1;

    /* Kalender-Tab (Lead-Controlling): Farben für Termin-Typ/Geburtstag, siehe .lc-cal-dot-* und
       .lc-cal-wrap – im :root definiert, damit sie auch außerhalb von .lc-cal-wrap (z.B. in der
       Legende) verfügbar sind. */
    --lc-cal-vor-ort: var(--accent-gold);
    --lc-cal-remote: #5b8dd9;
    --lc-cal-birthday: #d96b9a;
    --lc-cal-event: #8b6fd9;
    --lc-cal-vacation: #e0913f;

    /* Intern verwendete Farben (für Theme-Unterstützung) */
    --input-bg: #151515;
    --scrollbar-track: rgba(255,255,255,0.05);
    --scrollbar-border: rgba(17,17,17,0.55);
    --switcher-trigger-bg: rgba(0,0,0,0.3);
    --switcher-trigger-hover-bg: rgba(0,0,0,0.42);
    --switcher-menu-bg: rgba(20,20,20,0.96);
    --switcher-menu-shadow: rgba(0,0,0,0.45);
    --glass-panel-bg: rgba(28,28,28,0.85);
    --stat-row-bg: rgba(255,255,255,0.05);
}

/* Helles Theme */
html[data-theme="light"] {
    --bg-dark: #f0f0f2;
    --panel-bg: #ffffff;
    --panel-border: #e2e2e6;
    --text-main: #18181b;
    --text-muted: #6b7280;
    --brand-accent: #2d2d2d;
    --brand-accent-rgb: 45, 45, 45;
    --btn-text: #ffffff;
    --danger-bg: rgba(220, 38, 38, 0.08);

    --input-bg: #f5f5f7;
    --scrollbar-track: rgba(0,0,0,0.06);
    --scrollbar-border: rgba(240,240,242,0.7);
    --switcher-trigger-bg: rgba(0,0,0,0.04);
    --switcher-trigger-hover-bg: rgba(0,0,0,0.07);
    --switcher-menu-bg: rgba(252,252,254,0.98);
    --switcher-menu-shadow: rgba(0,0,0,0.12);
    --glass-panel-bg: rgba(245,245,248,0.92);
    --stat-row-bg: rgba(0,0,0,0.04);
}

/* Helles Theme: Brand-Farben wiederherstellen (liegen auf body, daher höhere Spezifität) */
html[data-theme="light"] body[data-brand="fischerhaus"] {
    --brand-accent: #c5a47e;
    --brand-accent-rgb: 197, 164, 126;
    --btn-text: #000000;
}
html[data-theme="light"] body[data-brand="naturholzhaus"] {
    --brand-accent: #4d680f;
    --brand-accent-rgb: 77, 104, 15;
    --btn-text: #f4f7ea;
}
html[data-theme="light"] body[data-brand="hbb"] {
    --brand-accent: #2d2d2d;
    --brand-accent-rgb: 45, 45, 45;
    --btn-text: #ffffff;
}
html[data-theme="light"] body[data-brand="objektbau"],
html[data-theme="light"] body[data-brand="wohnungsbau"] {
    --brand-accent: #2d2d2d;
    --brand-accent-rgb: 45, 45, 45;
    --btn-text: #ffffff;
}

/* Dynamisches Branding */
[data-brand="fischerhaus"] {
    --brand-primary: #003056; 
    --brand-accent: #c5a47e;  
    --brand-accent-rgb: 197, 164, 126;
    --btn-text: #000000;
}
[data-brand="naturholzhaus"] {
    --brand-primary: #1b4d2e; 
    --brand-accent: #4d680f;  
    --brand-accent-rgb: 77, 104, 15;
    --btn-text: #f4f7ea;
}
[data-brand="hbb"] {
    --brand-primary: #333333; 
    --brand-accent: #E0E0E0;  
    --brand-accent-rgb: 224, 224, 224;
    --btn-text: #000000;
}
/* Objektbau/Wohnungsbau: neue Marken ohne eigenes Logo/eigene Farbe, nutzen bewusst dieselbe
   neutrale Holzbau-Bayern-Graufarbe wie [data-brand="hbb"] (siehe brand_registry.php). */
[data-brand="objektbau"],
[data-brand="wohnungsbau"] {
    --brand-primary: #333333;
    --brand-accent: #E0E0E0;
    --brand-accent-rgb: 224, 224, 224;
    --btn-text: #000000;
}

/* Hinweis-Badge "Entwicklungsumgebung" (Sidebar/Mobile-Header, admin.php) — sichtbar auf jedem
   System, das nicht PROJECT_ENV=production meldet, siehe hbbIsProductionEnv() in auth_helpers.php. */
.hbb-env-badge {
    display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
    margin-top: 10px;
    padding: 5px 12px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--danger-red) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--danger-red) 45%, transparent);
    color: var(--danger-red);
    font-size: 11px; font-weight: 700; letter-spacing: .3px;
    text-transform: uppercase; white-space: nowrap;
    animation: hbbEnvBadgePulse 2.4s ease-in-out infinite;
}
.hbb-env-badge svg { flex-shrink: 0; width: 13px; height: 13px; }
@keyframes hbbEnvBadgePulse {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger-red) 35%, transparent); }
    50%      { box-shadow: 0 0 0 5px color-mix(in srgb, var(--danger-red) 0%, transparent); }
}
.hbb-env-badge.is-compact { margin-top: 0; padding: 3px 8px; font-size: 9.5px; gap: 4px; }
.hbb-env-badge.is-compact svg { width: 11px; height: 11px; }

/* =========================================
   2. APP SHELL BEHAVIOR
   ========================================= */
html, body {
    margin: 0; padding: 0;
    background-color: var(--bg-dark); color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    height: 100vh; width: 100vw;
    overflow: hidden;
    -webkit-user-select: none; user-select: none;
    -webkit-tap-highlight-color: transparent;
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--brand-accent-rgb), 0.55) transparent;
}

/* Scrollbar dauerhaft einklammern → kein Layout-Shift beim Ein-/Ausblenden */
html {
    scrollbar-gutter: stable;
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(var(--brand-accent-rgb), 0.72), rgba(var(--brand-accent-rgb), 0.48));
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(var(--brand-accent-rgb), 0.88), rgba(var(--brand-accent-rgb), 0.62));
}

/* Header */
.app-header {
    height: 70px;
    padding: env(safe-area-inset-top) 20px 0 20px;
    background: var(--panel-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--panel-border);
    z-index: 100;
}

.header-left { display: flex; align-items: center; height: 100%; min-width: 0; }
.header-brand-logo { height: 35px; width: auto; max-width: min(180px, 26vw); object-fit: contain; display: block; }

.header-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; margin-left: auto; }

/* Projekt Wechsler im Header */
.project-switcher-shell {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 0 1 clamp(150px, 18vw, 210px);
    min-width: 0;
    max-width: 210px;
    padding: 4px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
    box-sizing: border-box;
}
.project-switcher {
    background: rgba(0,0,0,0.3); color: var(--text-main);
    border: 1px solid rgba(var(--brand-accent-rgb), 0.28); border-radius: 10px;
    padding: 8px 10px; font-size: 13px; outline: none; cursor: pointer;
    width: 100%; min-width: 0; text-overflow: ellipsis; font-weight: 600;
    box-sizing: border-box;
}
.project-switcher:focus { border-color: var(--brand-accent); }
.project-switcher-static { box-sizing: border-box; }
.project-switcher-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    text-align: left;
    background: var(--switcher-trigger-bg);
    color: var(--text-main);
    border: 1px solid rgba(var(--brand-accent-rgb), 0.28);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 600;
    width: 100%;
    min-width: 0;
    cursor: pointer;
    box-sizing: border-box;
}
.project-switcher-trigger:hover,
.project-switcher-shell.is-open .project-switcher-trigger {
    border-color: rgba(var(--brand-accent-rgb), 0.55);
    background: var(--switcher-trigger-hover-bg);
}
.project-switcher-trigger-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.project-switcher-trigger-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--brand-accent);
    transition: transform 0.2s ease;
}
.project-switcher-shell.is-open .project-switcher-trigger-icon {
    transform: rotate(180deg);
}
.project-switcher-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: max-content;
    min-width: 100%;
    max-width: min(320px, 72vw);
    padding: 8px;
    border-radius: 14px;
    border: 1px solid var(--panel-border);
    background: var(--switcher-menu-bg);
    box-shadow: 0 20px 40px var(--switcher-menu-shadow);
    backdrop-filter: blur(16px);
    display: none;
    z-index: 250;
    box-sizing: border-box;
}
.project-switcher-shell.is-open .project-switcher-menu {
    display: block;
}
.project-switcher-option {
    width: 100%;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-main);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    text-align: left;
    padding: 10px 12px;
    cursor: pointer;
}
.project-switcher-option:hover {
    background: rgba(255,255,255,0.05);
}
.project-switcher-option.is-active {
    background: rgba(var(--brand-accent-rgb), 0.16);
}
.project-switcher-option-main {
    min-width: 0;
}
.project-switcher-option-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 700;
}
.project-switcher-option-meta {
    margin-top: 2px;
    font-size: 11px;
    color: var(--text-muted);
}
.project-switcher-option-badge {
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    color: var(--brand-accent);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.project-switcher-meta,
.project-switcher-label { display: none; }
.project-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }

.icon-btn-header {
    background: none; border: none; color: var(--text-main); cursor: pointer;
    padding: 6px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; transition: 0.2s;
}
.icon-btn-header:hover { color: var(--brand-accent); background: rgba(255,255,255,0.05); }
.icon-btn-header svg { width: 22px; height: 22px; }

@media (max-width: 860px) {
    .app-header { gap: 10px; }
    .header-right { gap: 10px; }
    .project-switcher-shell { flex-basis: min(42vw, 200px); max-width: min(42vw, 200px); }
}

@media (max-width: 640px) {
    .app-header { padding-left: 12px; padding-right: 12px; }
    .header-right { gap: 8px; }
    .project-switcher-shell { flex-basis: min(48vw, 180px); max-width: min(48vw, 180px); }
    .project-switcher-trigger { font-size: 12px; padding: 8px 10px; }
    .project-switcher-menu { max-width: min(280px, 78vw); }
    .icon-btn-header { padding: 4px; }
    .icon-btn-header svg { width: 20px; height: 20px; }
}

/* Content Area */
.app-content {
    height: calc(100vh - 70px - env(safe-area-inset-bottom) - env(safe-area-inset-top));
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    box-sizing: border-box;
    position: relative;
}

.app-content input, .app-content textarea { -webkit-user-select: text; user-select: text; }

/* =========================================
   3. GLOBALE UI ELEMENTE & FORMS
   ========================================= */
.btn-brand {
    background: var(--brand-accent); color: var(--btn-text);
    border: none; padding: 14px; border-radius: 8px; font-weight: 600; font-size: 15px; width: 100%;
    cursor: pointer; transition: filter 0.2s;
}
.btn-brand:hover { filter: brightness(1.1); }

.input-app {
    width: 100%; padding: 14px; background: var(--input-bg); border: 1px solid var(--panel-border);
    color: var(--text-main); border-radius: 8px; margin-bottom: 15px; box-sizing: border-box;
    font-size: 16px;
}
.input-app:focus { border-color: var(--brand-accent); outline: none; }

.spin { animation: spin 1s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* ── Verbindliche Glas-Optik für ALLE Hover-/Popup-Elemente der App (Kontakt-Popovers,
   Avatar-Hover-Menüs, Kalender-/Termin-Flyouts, Tooltips, Dropdown-artige Flyouts — NICHT für
   große Modals, dafür bleibt .modal-overlay/.modal-content zuständig). GILT AB SOFORT für
   bestehende UND jeden künftigen neuen Hover-/Popup-Baustein: einfach zusätzlich zur eigenen
   Layout-Klasse (Position/Breite/Padding) die Klasse `hbb-glass-pop` ansetzen; Hintergrundfarbe/
   Border/Box-Shadow NICHT mehr in der modul-eigenen Klasse definieren, das übernimmt diese Regel.
   Referenz-Umsetzung inkl. Sprechblasen-Spitze: .ipr-contact-pop in ipr_projects.php. */
.hbb-glass-pop {
    background: linear-gradient(155deg, rgba(255,255,255,.22), rgba(255,255,255,.05) 65%);
    backdrop-filter: blur(28px) saturate(190%); -webkit-backdrop-filter: blur(28px) saturate(190%);
    border: 1px solid rgba(255,255,255,.28); border-radius: 20px;
    box-shadow: 0 22px 50px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.45), inset 0 0 24px rgba(255,255,255,.04);
}
html[data-theme="light"] .hbb-glass-pop {
    background:
        radial-gradient(120% 100% at 20% -10%, rgba(255,255,255,.95), transparent 55%),
        linear-gradient(155deg, rgba(255,255,255,.58), rgba(214,224,238,.4) 55%, rgba(255,255,255,.55) 100%);
    backdrop-filter: blur(24px) saturate(220%) brightness(1.06); -webkit-backdrop-filter: blur(24px) saturate(220%) brightness(1.06);
    border-color: rgba(255,255,255,.85);
    box-shadow: 0 24px 55px rgba(15,23,42,.2), 0 0 0 1px rgba(15,23,42,.05), inset 0 1px 0 rgba(255,255,255,1), inset 0 -14px 22px -16px rgba(15,23,42,.1);
}
/* Optionale Sprechblasen-Spitze: zusätzlich Klasse `hbb-glass-pop-arrow` ansetzen und die
   Ausrichtung per `data-placement="top"` (Spitze zeigt nach unten, Blase liegt über dem Trigger)
   bzw. `data-placement="bottom"` (Spitze zeigt nach oben) steuern; horizontale Position per JS
   über die CSS-Variable `--hbb-glass-arrow-x` (px, relativ zur linken Kante) setzen. */
.hbb-glass-pop-arrow { --hbb-glass-arrow-x: 50%; }
.hbb-glass-pop-arrow::before {
    content: ''; position: absolute; left: var(--hbb-glass-arrow-x); margin-left: -7px;
    width: 14px; height: 14px; background: inherit;
    backdrop-filter: inherit; -webkit-backdrop-filter: inherit;
    transform: rotate(45deg);
}
.hbb-glass-pop-arrow[data-placement="bottom"]::before { top: -7px; border-left: 1px solid rgba(255,255,255,.28); border-top: 1px solid rgba(255,255,255,.28); border-radius: 4px 0 0 0; }
.hbb-glass-pop-arrow[data-placement="top"]::before { bottom: -7px; border-right: 1px solid rgba(255,255,255,.28); border-bottom: 1px solid rgba(255,255,255,.28); border-radius: 0 0 4px 0; }
html[data-theme="light"] .hbb-glass-pop-arrow[data-placement="bottom"]::before,
html[data-theme="light"] .hbb-glass-pop-arrow[data-placement="top"]::before { border-color: rgba(255,255,255,.75); }

/* ── Modal-Overlay & -Fenster (Bearbeiten/Anlegen-Dialoge — Basis-Optik, in
   jedem Modul mit Personendaten wiederverwendet). Abweichende Werte
   (z-index, max-width, padding, backdrop-filter-Stärke) werden je Modul über
   die Wrapper-ID des jeweiligen Modals überschrieben — siehe Abschnitt 5. ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
}
html[data-theme="light"] .modal-overlay { background: rgba(0,0,0,0.45); }
.modal-content {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    width: 95%;
    max-width: 480px;
    box-sizing: border-box;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

/* ── Basis-Pagination (hbb_pager.js) — Grundfunktion für ALLE Tabellen: Seiten-
   nummern, Vor/Zurück, Sprung zu Seite, Ergebnisse-pro-Seite. Wird per JS über
   data-hbb-page/-perpage-Attribute gesteuert (Event-Delegation), Markup daher
   modulübergreifend identisch verwendbar. ── */
.hbb-pager { display: flex; align-items: center; gap: 4px; padding: 8px 0; flex-wrap: wrap; }
.hbb-pager-btn {
    background: rgba(255,255,255,.04); border: 1px solid var(--panel-border); border-radius: 6px;
    color: var(--text-main); font-size: 11px; padding: 5px 9px; min-width: 26px; cursor: pointer;
    transition: .12s; display: inline-flex; align-items: center; justify-content: center;
}
.hbb-pager-btn:hover:not(:disabled) { border-color: var(--brand-accent); color: var(--brand-accent); background: rgba(197,164,126,.08); }
.hbb-pager-btn:disabled { opacity: .3; cursor: default; }
.hbb-pager-btn.active { background: var(--brand-accent); border-color: var(--brand-accent); color: #fff; font-weight: 600; }
.hbb-pager-ellipsis { font-size: 11px; color: var(--text-muted); padding: 0 4px; }
.hbb-pager-info { font-size: 11px; color: var(--text-muted); margin-left: 6px; white-space: nowrap; }
.hbb-pager-sep { flex: 1; }
.hbb-pager-jump { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted); margin-left: 8px; white-space: nowrap; }
.hbb-pager-jump-input {
    width: 46px; background: var(--input-bg); border: 1px solid var(--panel-border); border-radius: 6px;
    color: var(--text-main); font-size: 11px; padding: 4px 6px; text-align: center; box-sizing: border-box;
}
.hbb-pager-jump-input:focus { border-color: var(--brand-accent); outline: none; }
.hbb-perpage-group { display: inline-flex; align-items: center; border: 1px solid var(--panel-border); border-radius: 6px; overflow: hidden; flex-shrink: 0; margin-left: 8px; }
.hbb-perpage-btn { background: none; border: none; border-right: 1px solid var(--panel-border); padding: 4px 9px; font-size: 11px; color: var(--text-muted); cursor: pointer; transition: .12s; line-height: 1.4; white-space: nowrap; }
.hbb-perpage-btn:last-child { border-right: none; }
.hbb-perpage-btn:hover { background: rgba(197,164,126,.08); color: var(--brand-accent); }
.hbb-perpage-btn.active { background: var(--brand-accent); color: #fff; font-weight: 600; }

/* =========================================
   4. ELEKTRO PLANER MODUL (is-planner)
   ========================================= */
body.is-planner .app-content { overflow: hidden; padding: 0; }

#floorplan-container { width: 100%; height: 100%; position: relative; background-color: var(--bg-dark); cursor: grab; overflow: hidden; }
#floorplan-container:active { cursor: grabbing; }

#drop-layer { position: absolute; top: 0; left: 0; transform-origin: 0 0; z-index: 1; background-repeat: no-repeat; }

.is-planner .glass-panel {
    background: var(--glass-panel-bg); backdrop-filter: blur(10px);
    border: 1px solid var(--panel-border); border-radius: 12px;
    position: absolute; z-index: 100; box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

#panel-stats { top: 20px; left: 20px; width: 220px; padding: 20px; }
#panel-tools { top: 20px; right: 20px; display: flex; flex-direction: column; gap: 12px; padding: 15px; }

#panel-stats h3 { margin: 0 0 10px 0; font-size: 16px; color: var(--text-muted); }
.stat-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; padding: 8px 12px; background: var(--stat-row-bg); border-radius: 8px; font-size: 13px; }
.stat-count { font-family: 'Courier New', monospace; font-weight: bold; color: var(--brand-accent); }
.counter-limit-exceeded { color: var(--danger-red) !important; text-shadow: 0 0 5px rgba(255, 68, 68, 0.5); }
#switch-floor { margin-top: 10px; }

.drag-source, .placed-item {
    min-width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.08); border: 1px solid var(--panel-border); border-radius: 8px;
    cursor: grab; transition: background 0.2s; box-sizing: border-box;
}
.drag-source:hover { background: rgba(255, 255, 255, 0.15); border-color: var(--brand-accent); }
.placed-item {
    position: absolute; width: auto; padding: 4px; background: rgba(197, 164, 126, 0.2);
    border-color: rgba(197, 164, 126, 0.5); transform: scale(calc(1.2 / var(--zoom-scale))); transform-origin: center; z-index: 10;
}
.icon-group { display: flex; flex-direction: row; gap: 4px; align-items: center; justify-content: center; }
.drag-source svg, .placed-item svg { width: 20px; height: 20px; stroke: var(--text-main); flex-shrink: 0; pointer-events: none; }
.placed-item.item-pending { opacity: 0.6; outline: 2px dashed #f59e0b; outline-offset: 2px; animation: hbb-pending-pulse 1.4s ease-in-out infinite; }
@keyframes hbb-pending-pulse { 0%,100% { opacity: 0.6; } 50% { opacity: 1; } }

#trash-can {
    margin-top: 20px; width: 100%; height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: var(--danger-bg); border: 2px dashed rgba(255, 68, 68, 0.3); border-radius: 10px; color: var(--danger-red); font-size: 12px; transition: all 0.3s; position: relative; z-index: 101; 
}
#trash-can svg { width: 24px; height: 24px; stroke: currentColor; margin-bottom: 4px; }
#trash-can.ui-droppable-hover { background: rgba(255, 68, 68, 0.2); border-color: var(--danger-red); transform: scale(1.05); }

.poof-out { animation: poof 0.4s ease-out forwards; pointer-events: none; }
@keyframes poof { 0% { transform: scale(1.2); opacity: 1; } 100% { transform: scale(2); opacity: 0; filter: blur(10px); } }

/* =========================================
   5. ADMIN-MODULE (zentralisiert statt Modul-eigenem <style>)
   Neue Module bringen KEIN eigenes <style>-Element mehr mit — alle Klassen
   werden hier ergänzt, damit langfristig ein einheitliches Designsystem
   entsteht (siehe /memories/repo/css-konventionen.md).
   ========================================= */

.bv-workspace { max-width: 1540px; margin-inline: auto; color: var(--text-main); }
.bv-heading { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 8px 0 25px; border-bottom: 1px solid var(--panel-border); }
.bv-heading h1 { font-size: clamp(29px, 3.4vw, 46px); line-height: 1.12; font-weight: 720; letter-spacing: -.035em; margin: 0 0 7px; }
.bv-heading p, .bv-file header p { margin: 0; color: var(--text-muted); line-height: 1.5; }
.bv-layout, .bv-file-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .39fr); gap: clamp(20px, 3vw, 42px); align-items: start; padding-top: 21px; }
.bv-register { min-width: 0; }
.bv-search { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; padding: 15px; background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 10px; }
.bv-search label { display: grid; gap: 5px; font-size: .79rem; font-weight: 600; min-width: 0; }
.bv-search-main { flex: 1 1 235px; }
.bv-search input, .bv-search select, .bv-button { min-height: 44px; padding: 8px 11px; border: 1px solid var(--panel-border); border-radius: 6px; background: var(--input-bg); color: var(--text-main); font: inherit; }
.bv-search input, .bv-search select { width: 100%; font-size: .9rem; }
.bv-button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-size: .85rem; font-weight: 650; cursor: pointer; }
.bv-button-primary { background: var(--text-main); color: var(--panel-bg); }
.bv-button:hover, .bv-record:hover { border-color: var(--brand-accent); }
.bv-workspace :focus-visible, .bv-file :focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 3px; }
.bv-register-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 5px 12px; margin: 26px 0 11px; }
.bv-register-head h2, .bv-agenda h2, .bv-file h2 { font-size: 1.13rem; margin: 0; font-weight: 700; }
.bv-register-head a, .bv-register-head span, .bv-pagination, .bv-source { font-size: .8rem; color: var(--text-muted); }
.bv-register-labels, .bv-record { display: grid; grid-template-columns: minmax(0, 1fr) minmax(102px, .35fr) minmax(86px, .23fr) 16px; align-items: center; gap: 10px; padding-inline: 10px; }
.bv-register-labels { color: var(--text-muted); font-size: .76rem; padding-block: 8px; border-bottom: 1px solid var(--panel-border); }
.bv-register-list, .bv-agenda-list { padding: 0; margin: 0; list-style: none; }
.bv-record { min-height: 60px; padding-block: 8px; text-decoration: none; color: inherit; font-size: .86rem; border-bottom: 1px solid var(--panel-border); }
.bv-record:hover { background: var(--panel-bg); }
.bv-record-name, .bv-record-brand, .bv-agenda-list li > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.bv-record small, .bv-agenda-list small, .bv-file small { display: block; color: var(--text-muted); margin-top: 3px; font-size: .77rem; }
.bv-record-date, .bv-agenda-list time, .bv-agenda-deadline { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bv-record svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.bv-pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-block: 12px; }
.bv-pagination > div { display: flex; gap: 8px; }
.bv-workrail { display: grid; gap: 14px; min-width: 0; }
.bv-agenda { background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 10px; padding: 15px; scroll-margin-top: 20px; }
.bv-agenda > p { margin: 5px 0 8px; font-size: .8rem; color: var(--text-muted); line-height: 1.45; }
.bv-agenda-list li { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 9px; align-items: start; padding: 9px 0; border-top: 1px solid var(--panel-border); font-size: .84rem; }
.bv-agenda-list li:last-child { padding-bottom: 1px; }
.bv-agenda-list a { display: inline-block; line-height: 1.35; color: var(--text-main); text-underline-offset: .17em; }
.bv-agenda-list time, .bv-agenda-deadline { font-weight: 700; color: var(--text-main); }
.bv-agenda-list .bv-overdue { color: var(--danger-red); }
.bv-empty { color: var(--text-muted); padding-block: 10px; }
.bv-source { margin: 0 2px; }
.bv-file { margin: 0 0 18px; padding: clamp(14px, 2.4vw, 24px); background: var(--panel-bg); border-radius: 10px; border: 1px solid var(--panel-border); }
.bv-file header p { margin-top: 5px; white-space: pre-line; overflow-wrap: anywhere; }
.bv-file-grid:has(> :only-child) { grid-template-columns: 1fr; }
.bv-file-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 14px 22px; min-width: 0; }
.bv-file-facts h3 { margin: 0 0 5px; font-size: .92rem; }
.bv-file-facts dl { margin: 0; font-size: .83rem; }
.bv-file-facts dl > div { display: grid; grid-template-columns: 1fr 1fr; align-items: baseline; gap: 7px; padding-block: 6px; border-top: 1px solid var(--panel-border); overflow-wrap: anywhere; }
.bv-file-facts dt { color: var(--text-muted); }
.bv-file-facts dd { margin: 0; }
/* Einstellungen: DOCUframe-Sync */
.as-df-sync { max-width: 74rem; container: docuframe-sync / inline-size; }
.as-df-sync-heading { margin: 8px 0 22px; }
.as-df-sync-heading h2 { margin: 0 0 7px; font-size: clamp(1.35rem, 3cqi, 1.8rem); line-height: 1.2; letter-spacing: -.025em; }
.as-df-sync-heading p { max-width: 65ch; margin: 0; color: var(--text-muted); font-size: .94rem; line-height: 1.55; }
.as-df-sync-list { background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 8px; }
.as-df-sync-row + .as-df-sync-row { border-top: 1px solid var(--panel-border); }
.as-df-sync-summary { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, .74fr) minmax(0, 1fr) minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 19px 22px; cursor: pointer; list-style: none; }
.as-df-sync-summary::-webkit-details-marker { display: none; }
.as-df-sync-summary:hover, .as-df-sync-row[open] > summary { background: color-mix(in srgb, var(--brand-accent) 6%, var(--panel-bg)); }
.as-df-sync-row:first-child > summary { border-radius: 7px 7px 0 0; }
.as-df-sync-row:last-child:not([open]) > summary { border-end-start-radius: 7px; border-end-end-radius: 7px; }
.as-df-sync-service, .as-df-sync-meta { display: grid; justify-items: start; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.as-df-sync-service strong { font-size: 1.05rem; font-weight: 700; line-height: 1.25; }
.as-df-sync-service small, .as-df-sync-meta > span { color: var(--text-muted); font-size: .8rem; line-height: 1.4; }
.as-df-sync-meta strong { font-size: .88rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.as-df-sync-badge { border-radius: 4px; padding: 3px 8px; color: var(--text-main); background: var(--input-bg); }
.as-df-sync-badge[data-sync-state=on] { color: var(--text-main); background: color-mix(in srgb, var(--success-green) 24%, var(--panel-bg)); }
.as-df-sync-disclosure { display: inline-flex; align-items: center; justify-self: end; gap: 10px; min-height: 44px; padding-inline: 12px; border: 1px solid var(--panel-border); border-radius: 6px; font-size: .85rem; font-weight: 650; }
.as-df-sync-disclosure::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.as-df-sync-row[open] .as-df-sync-disclosure::after { transform: translateY(2px) rotate(225deg); }
.as-df-sync-row[open] .as-df-sync-open, .as-df-sync-row:not([open]) .as-df-sync-close, .as-df-sync [hidden] { display: none; }
/* Bemusterung */
.bem-page { max-width: 1600px; margin: 0 auto; padding: 8px 0 48px; color: var(--text-main); }
@font-face {
    font-family: HbbLabelRoboto;
    src: url("vendor/fonts/roboto/Roboto-Variable.ttf") format("truetype");
    font-style: normal;
    font-weight: 100 900;
}
.bem-page [hidden] { display: none !important; }
.bem-heading { margin-bottom: 24px; }
.bem-heading h1 { margin: 3px 0 6px; font-size: clamp(1.7rem, 3vw, 2.3rem); letter-spacing: -.025em; }
.bem-eyebrow { margin: 0; color: var(--brand-accent); font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.bem-muted { color: var(--text-muted); line-height: 1.5; }
.bem-heading .bem-muted { margin: 0; }
.bem-actions, .bem-pagination { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.bem-actions { align-items: center; }
.bem-button { min-height: 40px; padding: 8px 14px; border: 1px solid var(--panel-border); border-radius: 7px; color: var(--text-main); background: var(--panel-bg); font: inherit; cursor: pointer; }
.bem-button:hover { border-color: var(--brand-accent); }
.bem-button:disabled { opacity: .5; cursor: not-allowed; }
.bem-button-primary { border-color: var(--brand-accent); background: var(--brand-accent); color: var(--btn-text); font-weight: 700; }
.bem-button-link { border: 0; background: none; padding: 2px 0; min-height: auto; color: var(--brand-accent); text-align: left; }
.bem-card { margin: 18px 0; padding: 22px; border: 1px solid var(--panel-border); border-radius: 12px; background: var(--panel-bg); }
.bem-card h2, .bem-card h3 { margin: 0 0 8px; }
.bem-card > .bem-muted { margin-top: 0; }
.bem-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 16px; }
.bem-company-new-fields { grid-column: 1 / -1; min-width: 0; margin: 0; padding: 16px; border: 1px solid var(--panel-border); border-radius: 8px; }
.bem-company-new-fields[hidden] { display: none; }
.bem-company-new-fields legend { padding: 0 6px; font-weight: 600; }
.bem-company-new-fields > .bem-muted { margin: 0 0 16px; }
.bem-field { display: grid; min-width: 0; gap: 6px; font-size: .85rem; font-weight: 600; }
.bem-field input:not([type=checkbox]), .bem-field select, .bem-field textarea { width: 100%; min-width: 0; min-height: 40px; padding: 8px 10px; border: 1px solid var(--panel-border); border-radius: 6px; color: var(--text-main); background: var(--input-bg); font: inherit; }
.bem-editor-layout { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 20px; margin-top: 20px; }
.bem-editor-palette { display: grid; align-content: start; gap: 6px; }
.bem-editor-palette h3 { margin: 12px 0 4px; font-size: .9rem; }
.bem-editor-palette .bem-muted { font-size: .85rem; }
.bem-editor-tool { min-height: 40px; padding: 8px 10px; text-align: left; border: 1px solid var(--panel-border); border-radius: 6px; background: var(--panel-bg); color: var(--text-main); font: inherit; cursor: grab; }
.bem-editor-tool:hover, .bem-editor-tool:focus-visible { border-color: var(--brand-accent); }
.bem-editor-graphic { padding: 6px; }
.bem-editor-graphic img { display: block; width: 100%; height: 80px; object-fit: contain; pointer-events: none; background-color: #fff; background-image: linear-gradient(45deg, #e5e5e5 25%, transparent 25%, transparent 75%, #e5e5e5 75%), linear-gradient(45deg, #e5e5e5 25%, transparent 25%, transparent 75%, #e5e5e5 75%); background-position: 0 0, 6px 6px; background-size: 12px 12px; }
.bem-editor-work { display: grid; grid-template-columns: minmax(0, 1fr) minmax(210px, 270px); gap: 20px; }
.bem-editor-stage { display: flex; align-items: center; justify-content: center; min-width: 0; height: clamp(360px, 65vh, 700px); padding: 20px; background: var(--input-bg); border: 1px solid var(--panel-border); overflow: hidden; }
.bem-label-canvas { max-width: 100%; max-height: 100%; width: auto; height: auto; border: 1px solid var(--panel-border); touch-action: none; cursor: grab; }
.bem-label-canvas:active { cursor: grabbing; }
.bem-editor-controls { display: grid; align-content: start; gap: 12px; }
.bem-editor-controls .bem-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.bem-label-tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.bem-label-chip { min-height: 36px; padding: 5px 9px; font-size: .82rem; }
.bem-label-tools button[aria-pressed=true], .bem-icon-option[aria-pressed=true] { border-color: var(--brand-accent); background: var(--input-bg); font-weight: 700; }
.bem-color-picker { min-width: 0; }
.bem-color-picker[hidden] { display: none; }
.bem-color-picker summary { display: flex; align-items: center; gap: 8px; list-style: none; }
.bem-color-picker summary::-webkit-details-marker { display: none; }
.bem-color-picker summary::after { content: ""; width: 7px; height: 7px; margin-left: 2px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.bem-color-picker summary:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.bem-color-picker summary > span:first-child { margin-right: auto; }
.bem-color-value { color: var(--text-muted); font-size: .82rem; }
.bem-color-menu { display: grid; gap: 10px; padding-top: 10px; }
.bem-color-presets { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.bem-color-presets[hidden] { display: none; }
.bem-color-preset { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 5px 8px; font-size: .82rem; text-align: left; }
.bem-color-preset[aria-pressed=true] { border-color: var(--brand-accent); background: var(--input-bg); font-weight: 700; }
.bem-color-preset:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.bem-color-swatch { flex: 0 0 16px; width: 16px; height: 16px; border: 1px solid var(--panel-border); border-radius: 3px; }
.bem-text-editor { display: grid; gap: 10px; min-width: 0; }
.bem-text-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bem-text-toolbar-label { font-size: .85rem; font-weight: 600; }
.bem-text-toolbar-label:first-child { margin-right: auto; }
.bem-text-format { width: 40px; padding: 6px; font-size: 1rem; }
.bem-text-format[aria-pressed=true] { border-color: var(--brand-accent); background: var(--input-bg); }
.bem-text-bold { font-weight: 700; }
.bem-text-italic { font-style: italic; }
.bem-text-underline { text-decoration: underline; text-underline-offset: 2px; }
.bem-text-help { margin: 0; color: var(--text-muted); font-size: .8rem; line-height: 1.4; }
.bem-text-placeholders .bem-label-tools { margin: 6px 0 0; }
.bem-stroke-error { margin: 0; color: var(--danger-red); font-size: .85rem; line-height: 1.4; }
.bem-icon-picker summary { display: flex; align-items: center; gap: 8px; list-style: none; }
.bem-icon-picker summary::-webkit-details-marker { display: none; }
.bem-icon-picker summary::after { content: ""; width: 7px; height: 7px; margin-left: auto; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.bem-icon-search { margin-top: 8px; }
.bem-icon-options { display: grid; gap: 4px; max-height: 270px; margin-top: 6px; overflow-y: auto; }
.bem-icon-option { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 7px 10px; border: 1px solid var(--panel-border); border-radius: 6px; color: var(--text-main); background: var(--panel-bg); font: inherit; text-align: left; cursor: pointer; }
.bem-icon-option:hover { border-color: var(--brand-accent); }
.bem-icon-option svg, .bem-icon-picker summary svg { flex: 0 0 auto; }
.bem-label-thumbnail { display: block; width: 100px; height: 65px; flex: 0 0 auto; object-fit: contain; background: #fff; border: 1px solid var(--panel-border); }
.bem-label-preview { display: inline-grid; gap: 4px; max-width: 180px; }
.bem-label-preview-warning { color: var(--text-main); font-size: .75rem; font-weight: 600; }
.bem-label-no-preview { display: block; color: var(--text-muted); font-size: .8rem; font-weight: 400; }
.bem-icon-picker small { display: block; color: var(--text-muted); font-weight: 400; }
.bem-settings-row .bem-label-thumbnail, .bem-settings-row .bem-label-no-preview { margin-top: 8px; }
@media (max-width: 1100px) { .bem-editor-work { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .bem-editor-layout { grid-template-columns: 1fr; } .bem-editor-palette { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); } .bem-editor-palette h3, .bem-editor-palette .bem-muted { grid-column: 1 / -1; } .bem-editor-stage { height: 55vh; } }
.bem-public { margin: 0; background: #f3f5f2; color: #172019; font-family: system-ui, sans-serif; }
.bem-public-main { max-width: 1000px; margin: 0 auto; padding: 40px 24px; }
.bem-public-caption { color: #496735; font-weight: 600; }
.bem-public-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 16px; }
.bem-public-gallery img { width: 100%; height: 280px; object-fit: contain; background: #fff; }
.bem-public-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; margin-top: 28px; }
.bem-public-details dt { font-size: .85rem; color: #4a594d; }
.bem-public-details dd { margin: 4px 0 0; font-weight: 600; }
.bem-gallery-list { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.bem-gallery-list > div { display: grid; align-content: start; gap: 6px; }
.bem-field input[type=color] { padding: 3px; }
.bem-check { display: flex; align-items: center; gap: 8px; min-height: 40px; font-size: .9rem; }
.bem-check input { width: 18px; height: 18px; accent-color: var(--brand-accent); }
.bem-room-icon { width: 24px; height: 24px; flex: 0 0 24px; object-fit: contain; }
.bem-article-price { display: grid; align-content: start; gap: 8px; }
.bem-tax-choice { display: flex; gap: 4px; min-width: 0; margin: 0; padding: 0; border: 0; }
.bem-tax-choice legend { margin-bottom: 4px; font-size: .8rem; font-weight: 600; }
.bem-tax-option { position: relative; cursor: pointer; }
.bem-tax-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.bem-tax-option span { display: block; min-width: 70px; padding: 8px 10px; border: 1px solid var(--panel-border); border-radius: 6px; text-align: center; }
.bem-tax-option input:checked + span { border-color: var(--brand-accent); background: var(--brand-accent); color: var(--btn-text); font-weight: 700; }
.bem-tax-option input:focus-visible + span { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.bem-tax-option input:disabled + span { cursor: default; opacity: .7; }
.bem-table-wrap { overflow-x: auto; border: 1px solid var(--panel-border); border-radius: 10px; background: var(--panel-bg); }
.bem-table { width: 100%; border-collapse: collapse; text-align: left; font-size: .88rem; }
.bem-table th, .bem-table td { padding: 12px; border-bottom: 1px solid var(--panel-border); vertical-align: middle; }
.bem-table th { color: var(--text-muted); font-size: .75rem; font-weight: 700; white-space: nowrap; }
.bem-inventory-search { margin: 24px 0 0; }
.bem-inventory-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.bem-inventory-bar > .bem-field { flex: 1 1 260px; max-width: 460px; }
.bem-filter-panel { margin-top: 16px; padding: 18px; border: 1px solid var(--panel-border); border-radius: 8px; background: var(--panel-bg); }
.bem-filter-panel > .bem-actions { margin-top: 16px; }
.bem-inventory-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 24px 0 12px; color: var(--text-muted); font-size: .9rem; }
.bem-select-all { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; cursor: pointer; }
.bem-inventory-empty { padding: 52px 24px; border: 1px solid var(--panel-border); border-radius: 10px; background: var(--panel-bg); text-align: center; }
.bem-inventory-empty strong { font-size: 1.05rem; }
.bem-inventory-empty p { margin: 8px 0 0; color: var(--text-muted); }
.bem-inventory-empty .bem-button { margin-top: 18px; }
.bem-selection-actions { margin: 0 0 14px; padding: 14px 16px; border: 1px solid var(--panel-border); border-radius: 8px; background: var(--panel-bg); }
.bem-selection-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; font-size: .88rem; }
.bem-selection-heading span { color: var(--text-muted); }
.bem-selection-actions #bem-bulk { margin: 0; }
.bem-article-table th:first-child, .bem-article-check { width: 44px; }
.bem-article-name { min-width: 175px; }
.bem-article-name strong { font-size: .95rem; }
.bem-article-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bem-article-identity > div { min-width: 0; }
.bem-article-photo { flex: 0 0 56px; width: 56px; height: 56px; object-fit: contain; border: 1px solid var(--panel-border); border-radius: 6px; background: #fff; }
.bem-price-name, .bem-price-locked { display: inline-flex; align-items: center; gap: 7px; }
.bem-company-heading, .bem-setting-heading { display: flex; align-items: center; gap: 10px; }
.bem-setting-swatch { width: 24px; height: 24px; flex: 0 0 24px; border: 1px solid var(--panel-border); border-radius: 4px; }
.bem-price-swatch { flex: 0 0 16px; width: 16px; height: 16px; border: 1px solid var(--panel-border); border-radius: 50%; }
.bem-price-locked { min-height: 40px; }
.bem-price-name .bem-brand-logo { margin-right: 0; }
.bem-cell { display: inline-block; max-width: 100%; }
.bem-cell-trigger { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 4px; margin: -3px -4px; border: 0; border-radius: 4px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.bem-cell-trigger:hover, .bem-cell-trigger:focus-visible { background: var(--input-bg); }
.bem-cell-trigger > svg { flex: 0 0 14px; width: 14px; height: 14px; opacity: 0; color: var(--text-muted); }
.bem-cell-trigger:hover > svg, .bem-cell-trigger:focus-visible > svg { opacity: 1; }
.bem-cell.is-editing { min-width: 150px; }
.bem-cell.is-editing > input, .bem-cell.is-editing > select { box-sizing: border-box; width: 100%; min-height: 36px; padding: 6px; border: 1px solid var(--brand-accent); border-radius: 6px; background: var(--input-bg); color: var(--text-main); font: inherit; }
.bem-inline-rooms, .bem-inline-room-options { display: grid; gap: 8px; }
.bem-inline-room-options { max-height: 180px; overflow-y: auto; }
.bem-inline-room-options label { display: flex; align-items: center; gap: 6px; }
.bem-article-table th[draggable=true] { cursor: grab; color: var(--brand-accent); }
.bem-columns { margin-left: auto; position: relative; }
.bem-columns summary { list-style: none; }
.bem-columns summary::-webkit-details-marker { display: none; }
.bem-columns-menu { position: absolute; z-index: 20; right: 0; width: min(360px, 85vw); max-height: min(70vh, 550px); overflow-y: auto; padding: 14px; border-radius: 8px; }
.bem-columns-menu > p { margin: 0 0 10px; }
.bem-column-option { display: flex; align-items: center; gap: 6px; padding: 3px 0; }
.bem-column-option label { display: flex; align-items: center; gap: 8px; flex: 1; min-height: 36px; }
.bem-column-option input { width: 17px; height: 17px; accent-color: var(--brand-accent); }
.bem-column-move { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--panel-border); border-radius: 5px; background: var(--panel-bg); color: var(--text-main); cursor: pointer; }
.bem-column-move:disabled { opacity: .4; cursor: not-allowed; }
.bem-column-move svg { width: 16px; height: 16px; }
.bem-column-actions { display: grid; gap: 6px; margin-top: 12px; }
.bem-status { display: inline-block; padding: 4px 9px; border: 1px solid var(--panel-border); border-radius: 99px; white-space: nowrap; font-size: .8rem; }
.bem-row-select { width: 18px; height: 18px; accent-color: var(--brand-accent); }
.bem-row-select-all { width: 18px; height: 18px; accent-color: var(--brand-accent); }
.bem-table tr:last-child td { border-bottom: 0; }
.bem-table small { display: block; margin-top: 4px; color: var(--text-muted); }
.bem-pagination { justify-content: space-between; margin: 14px 0; }
.bem-empty { padding: 30px 18px; text-align: center; color: var(--text-muted); }
.bem-message:not(:empty) { margin: 12px 0; padding: 12px 14px; border: 1px solid var(--panel-border); border-left: 3px solid var(--brand-accent); border-radius: 6px; background: var(--panel-bg); }
.bem-form-nav { margin: 18px 0 0; }
.bem-price-brand { margin: 20px 0 8px; font-size: 1rem; }
.bem-brand-logo { max-width: 115px; max-height: 34px; object-fit: contain; object-position: left center; vertical-align: middle; margin-right: 10px; }
.bem-brand-logo-light { display: none; }
[data-theme=light] .bem-brand-logo-light { display: inline-block; }
[data-theme=light] .bem-brand-logo-dark { display: none; }
.bem-price-row { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(130px, 200px); align-items: center; gap: 16px; padding: 10px 0; border-top: 1px solid var(--panel-border); }
.bem-accessory { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) auto auto 90px auto; align-items: end; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--panel-border); }
.bem-settings-list { display: grid; gap: 8px; margin: 18px 0; }
.bem-settings-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 12px; border: 1px solid var(--panel-border); border-radius: 7px; }
.bem-company-rights-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; }
.bem-company-role { font-size: .85rem; font-weight: 600; }
.bem-company-rights { display: inline-flex; align-items: center; gap: 6px; white-space: normal; color: var(--text-main); font-weight: 600; }
.bem-company-rights::before { content: ""; flex: 0 0 8px; height: 8px; border-radius: 50%; }
.bem-company-rights.is-present { border-color: #318152; background: rgba(49, 129, 82, .15); }
.bem-company-rights.is-present::before { background: #318152; }
.bem-company-rights.is-missing { border-color: #c65a51; background: rgba(198, 90, 81, .13); }
.bem-company-rights.is-missing::before { background: #c65a51; }
.bem-company-contract { white-space: normal; color: var(--text-main); }
.bem-company-contract.is-warning { border-color: #bd8038; background: rgba(189, 128, 56, .15); font-weight: 600; }
.bem-file { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--panel-border); }
.bem-file h3 { margin: 0 0 10px; }
.bem-file-preview { display: block; max-width: min(100%, 300px); max-height: 200px; object-fit: contain; margin: 0 0 14px; }
.bem-file-thumbnail { display: block; max-width: 90px; max-height: 60px; object-fit: contain; margin-top: 8px; }
.bem-file-link { display: inline-block; margin: 8px 0; color: var(--brand-accent); text-decoration: underline; }
.bem-warning { color: var(--danger-red); font-weight: 600; }
.bem-page :focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 3px; }
@media (max-width: 700px) {
    .bem-card { padding: 16px; }
    .bem-accessory { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bem-price-row { grid-template-columns: 1fr; gap: 6px; }
    .bem-inventory-bar > .bem-field { flex-basis: 100%; max-width: none; }
    .bem-inventory-create { margin-left: 0; }
    .bem-article-table, .bem-article-table tbody { display: block; }
    .bem-article-table thead { display: none; }
    .bem-article-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px 10px; padding: 16px; border-bottom: 1px solid var(--panel-border); }
    .bem-article-table .bem-article-row td { min-width: 0; width: auto; padding: 0; border: 0; }
    .bem-article-check { grid-column: 1; grid-row: 1; }
    .bem-article-name { grid-column: 2; grid-row: 1; }
    .bem-article-column, .bem-article-actions { grid-column: 2 / -1; }
    .bem-article-column::before { content: attr(data-label) ": "; color: var(--text-muted); }
}
@media (hover: none) { .bem-cell-trigger > svg { opacity: 1; } }

.as-df-sync-form { padding: 22px; border-top: 1px solid var(--panel-border); }
.as-df-sync-form fieldset { display: grid; justify-items: start; gap: 14px; min-width: 0; margin: 0; padding: 0; border: 0; }
.as-df-sync-form legend { padding: 0; margin-bottom: 7px; font-size: 1rem; font-weight: 650; }
.as-df-sync-check { display: flex; align-items: center; min-height: 44px; gap: 9px; font-size: .92rem; }
.as-df-sync-check input { flex: 0 0 19px; height: 19px; margin: 0; accent-color: var(--brand-accent); }
.as-df-sync-controls { display: flex; flex-wrap: wrap; align-items: start; gap: 16px 24px; width: 100%; }
.as-df-sync-field:not([hidden]) { display: grid; justify-items: start; gap: 7px; min-width: 0; max-width: 100%; font-size: .88rem; font-weight: 600; }
.as-df-sync-form input[type=time], .as-df-sync-form select { min-height: 44px; max-width: 100%; padding: 8px 12px; border: 1px solid var(--panel-border); border-radius: 6px; background: var(--input-bg); color: var(--text-main); font: inherit; font-variant-numeric: tabular-nums; }
[data-theme=dark] .as-df-sync-form { color-scheme: dark; }
.as-df-sync-times, .as-df-sync-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.as-df-sync-times:empty, .as-df-sync-actions p:empty { display: none; }
.as-df-sync-time { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.as-df-sync-actions { margin-top: 3px; }
.as-df-sync-actions p, .as-df-sync-run-result { margin: 0; color: var(--text-muted); font-size: .88rem; line-height: 1.5; }
.as-df-sync-run-result, .as-df-sync-form [data-sync-retry] { margin-top: 12px; }
.as-df-sync :focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 3px; }
.as-df-sync-summary:focus-visible { outline-offset: -3px; }
@container docuframe-sync (max-width: 52rem) {
    .as-df-sync-summary { grid-template-columns: minmax(0, .75fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px 16px; }
    .as-df-sync-service { grid-column: 1 / 3; }
    .as-df-sync-disclosure { grid-column: 3; grid-row: 1; }
}
@container docuframe-sync (max-width: 27rem) {
    .as-df-sync-summary, .as-df-sync-form { padding: 14px; }
    .as-df-sync-summary { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .as-df-sync-service { grid-column: 1 / -1; }
    .as-df-sync-disclosure { grid-column: 2; grid-row: auto; }
}
@media (max-width: 1040px) {
    .bv-layout, .bv-file-grid { grid-template-columns: 1fr; }
    .bv-workrail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bv-source { grid-column: 1 / -1; }
}
@media (max-width: 590px) {
    .bv-heading { padding-bottom: 16px; }
    .bv-search { padding: 10px; }
    .bv-search-main { flex-basis: 100%; }
    .bv-search label:not(.bv-search-main) { flex: 1 1 125px; }
    .bv-register-labels { display: none; }
    .bv-register-list { border-top: 1px solid var(--panel-border); }
    .bv-record { grid-template-columns: minmax(0, 1fr) auto 16px; gap: 5px 8px; padding: 9px 4px; }
    .bv-record-name { grid-row: 1; grid-column: 1 / 3; }
    .bv-record-brand { grid-row: 2; grid-column: 1; font-size: .78rem; }
    .bv-record-brand small { display: inline; margin-left: 4px; }
    .bv-record-date { grid-row: 2; grid-column: 2; font-size: .78rem; }
    .bv-record svg { grid-area: 1 / 3 / span 2; }
    .bv-workrail { grid-template-columns: 1fr; }
}

.ap-page-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; padding-block: 12px; color: var(--text-muted); font-size: .85rem; }
.ap-page-nav[hidden] { display: none; }
.ap-page-nav button { min-height: 36px; }
.ap-page-nav button:disabled { opacity: .48; cursor: default; }
.ap-page-empty { padding: 32px 12px; text-align: center; color: var(--text-muted); font-size: .85rem; }
.ap-bv-title {
    margin: 0;
    color: var(--text-main);
    font-weight: 500;
    font-size: 22px;
}
.as-bv-table-description {
    margin: 0 0 16px;
    color: var(--text-muted);
    font-size: 12px;
}

/* Hubert SSH: inventory, explicit approvals and local-only output. */
/* DOCUframe-Payload-Debugger im Admin-Einstellungsbereich. */
.as-df-payload-tool { margin-bottom: 16px; }
.as-df-payload-controls {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}
.as-df-payload-field { flex: 1 1 280px; min-width: 0; }
.as-df-payload-select {
    box-sizing: border-box;
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-main);
    font: inherit;
}
.as-df-payload-select:focus-visible,
.as-df-payload-tool button:focus-visible {
    outline: 2px solid var(--accent-gold);
    outline-offset: 2px;
}
.as-df-payload-status {
    flex: 1 1 100%;
    min-height: 18px;
    color: var(--text-muted);
    font-size: 12px;
}
.as-df-payload-status.is-success,
.as-df-payload-result h3.is-success { color: var(--success-green); }
.as-df-payload-status.is-error,
.as-df-payload-result h3.is-error { color: var(--danger-red); }
.as-df-payload-output { margin-top: 18px; }
.as-df-payload-result + .as-df-payload-result { margin-top: 16px; }
.as-df-payload-result h3 {
    margin: 0 0 8px;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
}
.as-df-payload-pre {
    max-height: 520px;
    margin: 0;
    overflow: auto;
    padding: 14px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: var(--bg-dark);
    color: var(--text-main);
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.as-df-payload-empty { margin: 0; color: var(--text-muted); font-size: 12px; }

/* Kundendienst: Einsatzplanung */
.kd-dispatch-view[hidden] { display: none !important; }
.kd-dispatch-view { color: var(--text-main); }
.kd-dispatch-header, .kd-dispatch-board-heading, .kd-dispatch-employee-head,
.kd-dispatch-dialog-head, .kd-dispatch-dialog-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.kd-dispatch-header { margin: 24px 0 16px; flex-wrap: wrap; }
.kd-dispatch-header h2, .kd-dispatch-dialog-head h2 { margin: 0 0 5px; font-size: 22px; font-weight: 650; color: var(--text-main); }
.kd-dispatch-header p, .kd-dispatch-dialog-head p { margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.kd-dispatch-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: 1 1 640px; min-width: 0; }
.kd-dispatch-date-nav, .kd-dispatch-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; min-width: 0; }
.kd-dispatch-date-nav input[type=date] { width: 170px; }
.kd-dispatch-date-label, .kd-dispatch-search-label { color: var(--text-muted); font-size: 12px; font-weight: 600; }
.kd-dispatch-toolbar input, .kd-dispatch-form-grid input:not([type=checkbox]),
.kd-dispatch-form-grid select, .kd-dispatch-form-grid textarea,
.kd-dispatch-settings-section input:not([type=checkbox]), .kd-dispatch-settings-section select,
.kd-dispatch-tour-form input {
    box-sizing: border-box; min-width: 0; border: 1px solid var(--panel-border); border-radius: 7px;
    background: var(--input-bg); color: var(--text-main); padding: 9px 10px; font: inherit;
}
.kd-dispatch-toolbar input { min-height: 36px; }
.kd-dispatch-view :focus-visible, .kd-dispatch-settings-section :focus-visible,
.kd-dispatch-dialog :focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 2px; }
.kd-dispatch-layout { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 16px; }
.kd-dispatch-main, .kd-dispatch-backlog-panel { min-width: 0; }
.kd-dispatch-board-heading { margin: 0 0 12px; align-items: center; }
.kd-dispatch-board-heading h3 { margin: 0; color: var(--text-main); font-size: 16px; font-weight: 650; }
.kd-dispatch-board-heading p { margin: 3px 0 0; color: var(--text-muted); font-size: 12px; }
.kd-dispatch-summary { display: block; margin-top: 4px; color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.kd-dispatch-board-hint { color: var(--text-muted); font-size: 11px; }
.kd-dispatch-employees { min-width: 0; }
.kd-dispatch-timeline-scroll { max-width: 100%; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--panel-border); border-radius: 9px; background: var(--panel-bg); }
.kd-dispatch-timeline { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.kd-dispatch-timeline .kd-dispatch-staff-column { width: 200px; }
.kd-dispatch-timeline .kd-dispatch-time-column { width: 56px; }
.kd-dispatch-timeline th, .kd-dispatch-timeline td { border-bottom: 1px solid var(--panel-border); }
.kd-dispatch-timeline thead th { position: sticky; top: 0; z-index: 2; height: 38px; min-width: 56px; padding: 0 7px; background: var(--panel-bg); color: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; text-align: left; }
.kd-dispatch-timeline .kd-dispatch-timeline-corner { left: 0; z-index: 4; width: 200px; min-width: 200px; border-right: 1px solid var(--panel-border); }
.kd-dispatch-timeline-row:last-child th, .kd-dispatch-timeline-row:last-child td { border-bottom: 0; }
.kd-dispatch-employee-cell { position: sticky; left: 0; z-index: 1; width: 200px; min-width: 200px; padding: 12px; border-right: 1px solid var(--panel-border); background: var(--panel-bg); text-align: left; vertical-align: top; }
.kd-dispatch-employee-cell > strong, .kd-dispatch-employee-cell > span { display: block; overflow-wrap: anywhere; }
.kd-dispatch-employee-cell > strong { color: var(--text-main); font-size: 13px; font-weight: 650; }
.kd-dispatch-employee-cell > span { margin-top: 4px; color: var(--text-muted); font-size: 11px; line-height: 1.4; }
.kd-dispatch-employee-actions { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.kd-dispatch-time-cell { width: 56px; min-width: 56px; padding: 6px; vertical-align: top; }
.kd-dispatch-time-gap { padding: 0; background: color-mix(in srgb, var(--bg-dark) 45%, transparent); }
.kd-dispatch-time-empty { min-width: 260px; padding: 14px; color: var(--text-muted); font-size: 12px; text-align: center; }
.kd-dispatch-time-empty .kd-btn { display: block; margin: 8px auto 0; }
.kd-dispatch-stop { display: grid; align-content: start; gap: 5px; min-width: 0; height: 100%; padding: 8px; border: 1px solid var(--panel-border); border-radius: 7px; background: var(--bg-dark); }
.kd-dispatch-stop-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; color: var(--text-muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.kd-dispatch-stop-top strong { color: var(--text-main); font-size: 11px; white-space: nowrap; }
.kd-dispatch-stop-title { display: block; width: 100%; min-height: 40px; padding: 0; border: 0; background: transparent; color: var(--text-main); font: inherit; font-size: 12px; font-weight: 650; line-height: 1.35; text-align: left; overflow-wrap: anywhere; }
h4.kd-dispatch-stop-title { margin: 0; }
.kd-dispatch-stop-meta, .kd-dispatch-stop-flags { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 6px; color: var(--text-muted); font-size: 11px; }
.kd-dispatch-stop-flags { gap: 5px; }
.kd-dispatch-badge { display: inline-flex; align-items: center; min-height: 21px; padding: 2px 7px; border: 1px solid var(--panel-border); border-radius: 99px; color: var(--text-muted); font-size: 10px; line-height: 1.25; }
.kd-dispatch-badge.is-safe, .kd-dispatch-badge.is-ready { color: var(--success-green); border-color: color-mix(in srgb, var(--success-green) 38%, var(--panel-border)); }
.kd-dispatch-badge.is-angefragt { color: var(--accent-gold); }
.kd-dispatch-badge.is-warning { color: var(--danger-red); border-color: color-mix(in srgb, var(--danger-red) 40%, var(--panel-border)); }
.kd-dispatch-todo-note { margin: 2px 0; color: var(--text-main); font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.kd-dispatch-stop-unassign { justify-self: start; min-height: 44px; padding: 4px 7px; border: 1px solid var(--panel-border); border-radius: 5px; background: transparent; color: var(--text-muted); font: inherit; font-size: 10px; cursor: pointer; }
.kd-dispatch-tour-settings { margin-top: 11px; border-top: 1px solid var(--panel-border); padding-top: 9px; color: var(--text-muted); font-size: 12px; }
.kd-dispatch-tour-settings summary, .kd-dispatch-materials summary { cursor: pointer; min-height: 30px; display: flex; align-items: center; }
.kd-dispatch-tour-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-top: 8px; }
.kd-dispatch-tour-form label, .kd-dispatch-form-grid label, .kd-dispatch-settings-section label {
    display: flex; flex-direction: column; gap: 5px; min-width: 0; color: var(--text-muted); font-size: 12px; font-weight: 550;
}
.kd-dispatch-tour-form button { justify-self: start; }
.kd-dispatch-route-result { margin: 8px 0 0; color: var(--accent-gold); font-size: 12px; font-variant-numeric: tabular-nums; }
.kd-dispatch-backlog-panel { border-top: 1px solid var(--panel-border); }
.kd-dispatch-backlog-panel > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; cursor: pointer; color: var(--text-main); font-size: 14px; font-weight: 650; list-style: none; }
.kd-dispatch-backlog-panel > summary::-webkit-details-marker { display: none; }
.kd-dispatch-backlog-panel > summary::after { content: '+'; color: var(--text-muted); font-size: 18px; font-weight: 400; }
.kd-dispatch-backlog-panel[open] > summary::after { content: '−'; }
.kd-dispatch-backlog-summary-count { margin-left: auto; color: var(--text-muted); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.kd-dispatch-backlog-content { padding: 0 0 12px; }
.kd-dispatch-search-label { display: block; margin: 0 0 5px; }
.kd-dispatch-backlog-content .kd-search { width: 100%; box-sizing: border-box; margin-bottom: 10px; }
.kd-dispatch-backlog-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 9px; max-height: min(68vh, 760px); overflow: auto; overscroll-behavior: contain; padding: 2px; }
.kd-dispatch-backlog-item { min-width: 0; padding: 11px; border: 1px solid var(--panel-border); border-radius: 8px; background: var(--bg-dark); }
.kd-dispatch-backlog-item.is-blocked { border-style: dashed; }
.kd-dispatch-backlog-item-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.kd-dispatch-backlog-item-head p { margin: 4px 0 0; color: var(--text-muted); font-size: 11px; overflow-wrap: anywhere; }
.kd-dispatch-backlog-item h4 { margin: 0; overflow-wrap: anywhere; color: var(--text-main); font-size: 13px; font-weight: 650; }
.kd-dispatch-backlog-note { margin: 8px 0 0; color: var(--text-main); font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.kd-dispatch-backlog-note strong { color: var(--text-muted); font-size: 10px; }
.kd-dispatch-due { flex: 0 0 auto; color: var(--accent-gold); font-size: 11px; font-variant-numeric: tabular-nums; }
.kd-dispatch-backlog-item > .kd-btn { margin-top: 10px; }
.kd-dispatch-readonly { display: inline-block; margin-top: 9px; color: var(--text-muted); font-size: 11px; }
.kd-dispatch-materials { margin-top: 8px; border-top: 1px solid var(--panel-border); color: var(--text-muted); font-size: 11px; }
.kd-dispatch-material-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 7px 0; border-top: 1px solid var(--panel-border); }
.kd-dispatch-material-item strong { min-width: 0; overflow-wrap: anywhere; color: var(--text-main); font-weight: 550; }
.kd-dispatch-material-item label { display: flex; align-items: center; gap: 5px; font-size: 10px; }
.kd-dispatch-material-item select, .kd-dispatch-material-item input[type=date] { max-width: 130px; min-width: 0; background: var(--input-bg); color: var(--text-main); border: 1px solid var(--panel-border); border-radius: 5px; padding: 5px; font: inherit; }
.kd-dispatch-material-item input[type=checkbox], .kd-dispatch-check input { accent-color: var(--accent-gold); }
.kd-dispatch-message { display: none; margin: 8px 0; color: var(--success-green); font-size: 12px; line-height: 1.5; }
.kd-dispatch-message.is-visible { display: block; }
.kd-warranty-badge {
    display: inline-block;
    max-width: 100%;
    padding: 2px 8px;
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    background: var(--input-bg);
    color: color-mix(in srgb, var(--text-main) 75%, var(--text-muted));
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
}
.kd-warranty-badge.is-active {
    border-color: color-mix(in srgb, var(--success-green) 38%, var(--panel-border));
    background: color-mix(in srgb, var(--success-green) 9%, var(--panel-bg));
    color: color-mix(in srgb, var(--success-green) 42%, var(--text-main));
}
.kd-expand-location > .kd-warranty-badge,
.kd-dispatch-backlog-item > .kd-warranty-badge, .kd-dispatch-suggestion header > .kd-warranty-badge { margin-top: 6px; }
.kd-dispatch-message.is-error, .kd-dispatch-form-error { color: var(--danger-red); }
.kd-dispatch-empty { margin: 0; padding: 12px; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.kd-dispatch-loading { display: flex; gap: 6px; min-height: 72px; align-items: center; justify-content: center; }
.kd-dispatch-loading span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-gold); animation: kd-dispatch-pulse 1.1s ease-in-out infinite; }
.kd-dispatch-loading span:nth-child(2) { animation-delay: 120ms; }
.kd-dispatch-loading span:nth-child(3) { animation-delay: 240ms; }
@keyframes kd-dispatch-pulse { 50% { opacity: .35; transform: scale(.8); } }
.kd-dispatch-dialog { width: min(860px, calc(100vw - 24px)); max-width: 860px; max-height: min(92vh, 900px); padding: 0; overflow: auto; border: 1px solid var(--panel-border); border-radius: 12px; background: var(--panel-bg); color: var(--text-main); box-shadow: 0 20px 70px rgba(0,0,0,.4); }
.kd-dispatch-dialog::backdrop { background: rgba(0,0,0,.58); }
.kd-dispatch-dialog-form { padding: 20px; }
.kd-dispatch-dialog-head { align-items: flex-start; margin-bottom: 17px; }
.kd-dispatch-dialog-close { flex: 0 0 auto; width: 36px; height: 36px; border: 1px solid var(--panel-border); border-radius: 7px; background: transparent; color: var(--text-main); font-size: 22px; cursor: pointer; }
.kd-dispatch-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kd-dispatch-form-grid select[multiple] { min-height: 94px; }
.kd-dispatch-span-2 { grid-column: span 2; }
.kd-dispatch-check { display: flex !important; flex-direction: row !important; align-items: center; gap: 8px !important; min-height: 36px; }
.kd-dispatch-check input { width: 16px; height: 16px; }
.kd-dispatch-dialog-foot { justify-content: flex-end; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--panel-border); }
.kd-dispatch-form-error { margin-top: 10px; font-size: 12px; }
.kd-btn.kd-dispatch-hubert, .kd-dispatch-suggestions {
    --kd-dispatch-ai-ink: color-mix(in srgb, var(--ai-purple) 55%, var(--text-main));
    --kd-dispatch-ai-border: color-mix(in srgb, var(--ai-purple) 40%, var(--panel-border));
}
.kd-btn.kd-dispatch-hubert { min-height: 44px; color: var(--kd-dispatch-ai-ink); border-color: var(--kd-dispatch-ai-border); background: color-mix(in srgb, var(--ai-purple) 7%, var(--panel-bg)); }
.kd-btn.kd-dispatch-hubert:not(:disabled):hover { border-color: var(--ai-purple); background: color-mix(in srgb, var(--ai-purple) 13%, var(--panel-bg)); }
.kd-dispatch-suggestions { max-width: 720px; border-color: var(--kd-dispatch-ai-border); }
.kd-dispatch-suggestions h2 { display: flex; align-items: center; gap: 8px; }
.kd-dispatch-suggestions h2 svg { flex: none; color: var(--kd-dispatch-ai-ink); }
.kd-dispatch-suggestions .kd-dispatch-dialog-close { width: 44px; height: 44px; }
.kd-dispatch-hubert:focus-visible, .kd-dispatch-suggestions button:focus-visible { outline: 2px solid var(--kd-dispatch-ai-ink); outline-offset: 2px; }
.kd-dispatch-suggestion-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.kd-dispatch-suggestion { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--panel-border); border-radius: 8px; background: var(--panel-bg); overflow-wrap: anywhere; }
.kd-dispatch-suggestion h3 { margin: 0; font-size: 16px; }
.kd-dispatch-suggestion-context { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 4px 0 0; padding: 0; list-style: none; color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.kd-dispatch-suggestion p { margin: 0; font-size: 13px; line-height: 1.5; }
.kd-dispatch-suggestion .kd-dispatch-suggestion-description { font-size: 14px; white-space: pre-line; }
.kd-dispatch-suggestion-description strong, .kd-dispatch-suggestion-slot strong { display: block; margin-bottom: 2px; }
.kd-dispatch-suggestion-reason { padding: 8px 10px; border-radius: 6px; background: color-mix(in srgb, var(--ai-purple) 7%, var(--panel-bg)); }
.kd-dispatch-suggestion-reason strong { color: var(--kd-dispatch-ai-ink); }
.kd-dispatch-suggestion-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; padding-top: 10px; border-top: 1px solid var(--panel-border); }
.kd-dispatch-suggestion-slot { font-variant-numeric: tabular-nums; }
.kd-dispatch-suggestion-footer .kd-btn { flex: none; min-height: 44px; }
.kd-dispatch-import { max-width: 980px; }
.kd-dispatch-import-notice { margin-bottom: 12px; padding: 10px 12px; border-left: 3px solid var(--accent-gold); background: var(--bg-dark); color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.kd-dispatch-import-list { display: grid; gap: 8px; max-height: min(58vh, 620px); overflow: auto; overscroll-behavior: contain; padding: 2px; }
.kd-dispatch-import-item { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 12px; padding: 11px; border: 1px solid var(--panel-border); border-radius: 8px; background: var(--bg-dark); }
.kd-dispatch-import-item.is-imported { opacity: .68; }
.kd-dispatch-import-select { display: flex; align-items: flex-start; gap: 8px; color: var(--text-main); font-size: 12px; font-weight: 600; }
.kd-dispatch-import-select input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent-gold); }
.kd-dispatch-import-details { min-width: 0; }
.kd-dispatch-import-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; }
.kd-dispatch-import-heading strong { color: var(--text-main); font-size: 13px; overflow-wrap: anywhere; }
.kd-dispatch-import-heading span, .kd-dispatch-import-details > p, .kd-dispatch-import-details > small { color: var(--text-muted); font-size: 11px; line-height: 1.45; }
.kd-dispatch-import-details > p { margin: 4px 0 8px; overflow-wrap: anywhere; }
.kd-dispatch-import-project { color: var(--text-main) !important; }
.kd-dispatch-import-material-note { margin: 3px 0 8px; color: var(--text-muted); font-size: 11px; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.kd-dispatch-import-todo-note { margin: 5px 0 8px; color: var(--text-main); font-size: 12px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.kd-dispatch-import-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.kd-dispatch-import-fields label { display: grid; gap: 4px; color: var(--text-muted); font-size: 11px; }
.kd-dispatch-import-fields select, .kd-dispatch-import-fields input { min-width: 0; width: 100%; }
.kd-dispatch-import-no-mangel { grid-column: 1 / -1; margin: 0; color: var(--text-muted); font-size: 10px; line-height: 1.4; }
.kd-dispatch-import-warnings { margin: 7px 0 4px; padding-left: 18px; color: var(--accent-gold); font-size: 11px; line-height: 1.45; }
.kd-dispatch-import-count { margin-right: auto; color: var(--text-muted); font-size: 12px; }
.kd-dispatch-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.kd-dispatch-settings-section { min-width: 0; padding: 14px; border: 1px solid var(--panel-border); border-radius: 9px; background: var(--bg-dark); }
.kd-dispatch-settings-section h4 { margin: 0 0 10px; color: var(--text-main); font-size: 14px; }
.kd-dispatch-settings-section p { margin: 0 0 10px; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.kd-dispatch-settings-wide { grid-column: 1 / -1; }
.kd-dispatch-config-form { display: grid; gap: 10px; }
.kd-dispatch-config-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kd-dispatch-config-fields label { min-width: 0; }
.kd-dispatch-config-fields input { width: 100%; }
.kd-dispatch-config-fields:nth-of-type(2) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kd-dispatch-inline-form { display: flex; align-items: center; gap: 7px; }
.kd-dispatch-inline-form input { flex: 1; min-width: 0; }
.kd-dispatch-skills-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.kd-dispatch-skill-chip { padding: 5px 9px; border: 1px solid var(--panel-border); border-radius: 99px; color: var(--text-main); font-size: 11px; }
.kd-dispatch-employees-settings { display: grid; gap: 10px; }
.kd-dispatch-employee-settings { padding: 12px; border: 1px solid var(--panel-border); border-radius: 8px; background: var(--panel-bg); }
.kd-dispatch-employee-settings > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.kd-dispatch-employee-settings h5 { margin: 0 0 5px; font-size: 13px; color: var(--text-main); }
.kd-dispatch-employee-fields { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
.kd-dispatch-employee-fields select, .kd-dispatch-employee-fields input { width: 100%; }
.kd-dispatch-employee-fields .kd-dispatch-skills-label { grid-column: 1 / -1; }
.kd-dispatch-absence-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; align-items: end; }
.kd-dispatch-absence-form button { justify-self: start; }
.kd-dispatch-absences-list { display: grid; gap: 6px; margin-top: 12px; }
.kd-dispatch-absence { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--panel-border); color: var(--text-muted); font-size: 11px; }
.kd-dispatch-absence strong { color: var(--text-main); }
@media (max-width: 1050px) {
    .kd-dispatch-employee-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .kd-dispatch-layout, .kd-dispatch-settings-grid { grid-template-columns: minmax(0, 1fr); }
    .kd-dispatch-settings-wide { grid-column: auto; }
    .kd-dispatch-backlog-list { max-height: none; }
    .kd-dispatch-toolbar { flex-basis: 100%; }
    .kd-dispatch-board-heading { align-items: flex-start; }
}
@media (max-width: 560px) {
    .kd-dispatch-header { align-items: flex-start; }
    .kd-dispatch-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; }
    .kd-dispatch-date-nav { display: grid; grid-template-columns: 40px auto minmax(0, 1fr) 40px; gap: 6px; }
    .kd-dispatch-date-nav input[type=date] { width: 100%; }
    .kd-dispatch-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kd-dispatch-toolbar > * { min-width: 0; }
    .kd-dispatch-timeline .kd-dispatch-staff-column { width: 156px; }
    .kd-dispatch-timeline .kd-dispatch-timeline-corner, .kd-dispatch-employee-cell { width: 156px; min-width: 156px; }
    .kd-dispatch-board-hint { display: none; }
    .kd-dispatch-tour-form, .kd-dispatch-form-grid, .kd-dispatch-config-fields, .kd-dispatch-employee-fields,
    .kd-dispatch-absence-form { grid-template-columns: minmax(0, 1fr); }
    .kd-dispatch-span-2, .kd-dispatch-employee-fields .kd-dispatch-skills-label { grid-column: auto; }
    .kd-dispatch-material-item { grid-template-columns: minmax(0, 1fr); }
    .kd-dispatch-material-item select, .kd-dispatch-material-item input[type=date] { max-width: none; width: 100%; }
    .kd-dispatch-suggestions .kd-dispatch-dialog-form { padding: 14px; }
    .kd-dispatch-suggestion { padding: 12px; }
    .kd-dispatch-suggestion-footer { align-items: stretch; flex-direction: column; }
    .kd-dispatch-import-item { grid-template-columns: minmax(0, 1fr); }
    .kd-dispatch-import-select { align-items: center; }
    .kd-dispatch-import-fields { grid-template-columns: minmax(0, 1fr); }
    .kd-dispatch-import .kd-dispatch-dialog-foot { align-items: stretch; flex-wrap: wrap; }
    .kd-dispatch-import-count { flex-basis: 100%; }
    .kd-dispatch-employee-settings > header, .kd-dispatch-absence { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
    .kd-dispatch-loading span { animation: none; }
}

/* Kundendienst: Arbeitsauftraege */
.kd-ao-view[hidden], .kd-ao-dialog [hidden] { display: none !important; }
.kd-ao-origin-action { margin-bottom: 20px; }
.kd-ao-origin-action p { margin: 8px 0 0; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.kd-ao-view { color: var(--text-main); }
.kd-ao-heading, .kd-ao-toolbar, .kd-ao-section-head, .kd-ao-dialog-head, .kd-ao-dialog-foot { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.kd-ao-heading { margin: 24px 0; align-items: flex-start; }
.kd-ao-heading h2, .kd-ao-dialog h2 { margin: 0 0 8px; font-size: 22px; font-weight: 650; color: var(--text-main); }
.kd-ao-heading p, .kd-ao-dialog-head p { margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.6; }
.kd-ao-toolbar { margin-bottom: 20px; align-items: flex-end; flex-wrap: wrap; }
.kd-ao-search { flex: 1; max-width: 580px; min-width: 220px; }
.kd-ao-view label, .kd-ao-dialog label { display: flex; flex-direction: column; gap: 7px; color: var(--text-main); font-size: 13px; font-weight: 550; }
.kd-ao-view input, .kd-ao-dialog input:not([type=checkbox]):not([type=radio]), .kd-ao-dialog select, .kd-ao-dialog textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--panel-border); border-radius: 7px; background: var(--input-bg); color: var(--text-main); padding: 11px 12px; font: inherit; line-height: 1.45; caret-color: var(--accent-gold); }
.kd-ao-dialog textarea { resize: vertical; }
.kd-ao-dialog input[type=checkbox], .kd-ao-dialog input[type=radio] { accent-color: var(--accent-gold); width: 18px; height: 18px; flex-shrink: 0; }
.kd-ao-view :focus-visible, .kd-ao-dialog :focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 3px; }
.kd-ao-dialog textarea:disabled { opacity: 0.55; }
.kd-ao-muted, .kd-ao-optional, .kd-ao-footnote { color: var(--text-muted); font-size: 13px; line-height: 1.6; font-weight: 400; }
.kd-ao-footnote { margin: 18px 0; max-width: 85ch; }
.kd-ao-message, .kd-ao-notice, .kd-ao-review { background: var(--panel-bg); border: 1px solid var(--panel-border); padding: 14px 16px; border-radius: 8px; line-height: 1.6; font-size: 13px; overflow-wrap: anywhere; }
.kd-ao-error { color: var(--danger-red); border-color: var(--danger-red); }
.kd-ao-review { margin-top: 24px; font-weight: 600; }
.kd-ao-table-wrap { overflow-x: auto; border: 1px solid var(--panel-border); border-radius: 10px; background: var(--panel-bg); }
.kd-ao-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.kd-ao-table th { background: var(--table-th-bg); color: var(--text-muted); font-size: 12px; font-weight: 600; }
.kd-ao-table th, .kd-ao-table td { padding: 16px; border-bottom: 1px solid var(--panel-border); vertical-align: top; }
.kd-ao-table tr:last-child td { border-bottom: 0; }
.kd-ao-table td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.kd-ao-table tbody tr:hover { background: var(--table-row-hover); }
.kd-ao-secondary { display: block; color: var(--text-muted); font-size: 12px; line-height: 1.55; margin-top: 5px; }
.kd-ao-row-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; white-space: nowrap; }
.kd-ao-status { display: inline-block; padding: 4px 8px; border: 1px solid var(--panel-border); border-radius: 5px; font-size: 12px; white-space: nowrap; }
.kd-ao-text-button { background: transparent; color: var(--accent-gold); border: 0; padding: 8px 0; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.kd-ao-empty { padding: 56px 24px; text-align: center; background: var(--panel-bg); border: 1px dashed var(--panel-border); border-radius: 10px; }
.kd-ao-empty h3 { margin: 0 0 10px; font-size: 18px; }
.kd-ao-empty p { max-width: 62ch; margin: auto; color: var(--text-muted); font-size: 13px; line-height: 1.7; }
.kd-ao-dialog { width: min(940px, calc(100vw - 32px)); max-height: 92vh; padding: 0; border: 1px solid var(--panel-border); border-radius: 12px; background: var(--panel-bg); color: var(--text-main); box-shadow: 0 24px 80px rgba(0,0,0,0.28); }
.kd-ao-dialog::backdrop { background: rgba(0,0,0,0.65); }
.kd-ao-dialog form { display: flex; flex-direction: column; max-height: 92vh; }
.kd-ao-dialog-head { padding: 22px 28px; border-bottom: 1px solid var(--panel-border); flex-shrink: 0; }
.kd-ao-close { display: grid; place-items: center; background: none; border: 1px solid var(--panel-border); color: var(--text-main); border-radius: 7px; width: 44px; height: 44px; cursor: pointer; flex-shrink: 0; }
.kd-ao-dialog-body { padding: 26px 28px; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: var(--panel-border) var(--panel-bg); }
.kd-ao-dialog fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.kd-ao-dialog legend { font-size: 17px; font-weight: 650; margin-bottom: 10px; }
.kd-ao-dialog h3 { margin: 0; font-size: 15px; }
.kd-ao-dialog .kd-ao-muted { max-width: 72ch; margin: 6px 0 18px; }
.kd-ao-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 24px; }
.kd-ao-wide { grid-column: 1 / -1; }
.kd-ao-field-note { display: flex; flex-direction: column; gap: 7px; font-size: 13px; line-height: 1.6; }
.kd-ao-field-note span { color: var(--text-muted); }
.kd-ao-section-head { margin: 24px 0 12px; align-items: flex-start; }
.kd-ao-section-head .kd-btn { flex-shrink: 0; }
.kd-ao-dialog .kd-ao-check { flex-direction: row; align-items: center; gap: 10px; min-height: 44px; font-weight: 500; }
.kd-ao-section-head .kd-ao-check { white-space: nowrap; }
.kd-ao-item { padding: 12px 0 18px; border-bottom: 1px solid var(--panel-border); }
.kd-ao-dialog .kd-ao-parking { border-top: 1px solid var(--panel-border); margin: 28px 0; padding-top: 20px; }
.kd-ao-dialog .kd-ao-parking legend { font-size: 14px; padding-top: 22px; }
.kd-ao-dialog-foot { padding: 18px 28px; border-top: 1px solid var(--panel-border); flex-shrink: 0; }
.kd-ao-dialog-foot #kd-ao-step-label { margin-right: auto; }
.kd-ao-view .kd-btn, .kd-ao-dialog .kd-btn { min-height: 44px; justify-content: center; }
.kd-ao-view button:disabled, .kd-ao-dialog button:disabled { opacity: 0.55; cursor: wait; }
.kd-ao-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 640px) {
    .kd-ao-heading { flex-direction: column; gap: 16px; }
    .kd-ao-heading > .kd-btn { width: 100%; }
    .kd-ao-fields { grid-template-columns: 1fr; }
    .kd-ao-dialog { width: calc(100vw - 16px); max-height: 96dvh; }
    .kd-ao-dialog form { max-height: 96dvh; }
    .kd-ao-dialog-head, .kd-ao-dialog-body, .kd-ao-dialog-foot { padding: 18px; }
    .kd-ao-dialog h2 { font-size: 18px; }
    .kd-ao-section-head { flex-direction: column; gap: 8px; }
    .kd-ao-dialog-foot { flex-wrap: wrap; gap: 12px; }
    .kd-ao-dialog-foot .kd-btn-primary { flex: 1; }
    .kd-ao-search { min-width: 100%; max-width: none; }
}

.hub-layout[hidden], .hub-ssh-panel[hidden], .hub-ssh-editor[hidden], .hub-ssh-job-link[hidden] { display: none; }
.hub-ssh-panel { --text-muted: color-mix(in srgb, var(--text-main) 70%, var(--panel-bg)); --hub-ssh-error: color-mix(in srgb, var(--danger-red) 70%, var(--text-main)); color: var(--text-main); background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 16px; padding: 28px; }
.hub-ssh-head, .hub-ssh-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.hub-ssh-head h2 { margin: 0 0 8px; font-size: 24px; }
.hub-ssh-panel p { margin: 6px 0 12px; line-height: 1.6; }
.hub-ssh-head p, .hub-ssh-hint, .hub-ssh-section-head p { color: var(--text-muted); font-size: 13px; max-width: 75ch; }
.hub-ssh-policy { display: flex; align-items: flex-start; gap: 14px; padding: 18px 0; margin: 18px 0; border-top: 1px solid var(--panel-border); border-bottom: 1px solid var(--panel-border); }
.hub-ssh-policy svg { flex: 0 0 20px; margin-top: 5px; color: var(--accent-gold); }
.hub-ssh-policy p { margin: 0; font-size: 13px; max-width: 100ch; }
.hub-ssh-toolbar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 14px; }
.hub-ssh-panel label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 600; }
.hub-ssh-search { flex: 1 1 240px; }
.hub-ssh-panel :is(input:not([type="checkbox"]), select, textarea) { box-sizing: border-box; width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid var(--panel-border); border-radius: 8px; background: var(--input-bg); color: var(--text-main); font: inherit; font-weight: 400; caret-color: var(--accent-gold); }
.hub-ssh-panel :is(input,textarea)::placeholder { color: var(--text-muted); opacity: 1; }
.hub-ssh-panel :is(button,input,select,textarea,summary,pre):focus-visible, .hub-ssh-job-link:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 3px; }
.hub-ssh-panel .btn { min-height: 44px; }
.hub-ssh-panel button:disabled { opacity: .55; cursor: wait; }
.hub-ssh-feedback { min-height: 24px; font-size: 13px; color: var(--text-muted); padding: 10px 0; }
.hub-ssh-workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.hub-ssh-workspace:has(.hub-ssh-editor:not([hidden])) { grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr); }
.hub-ssh-device { display: flex; justify-content: space-between; gap: 20px; padding: 20px 0; border-top: 1px solid var(--panel-border); }
.hub-ssh-device-main { min-width: 0; }
.hub-ssh-device h3 { font-size: 16px; margin: 0 0 8px; overflow-wrap: anywhere; }
.hub-ssh-device p { font-size: 13px; color: var(--text-muted); overflow-wrap: anywhere; }
.hub-ssh-device code { font-size: 12px; overflow-wrap: anywhere; }
.hub-ssh-device-actions { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.hub-ssh-tags { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-muted); }
.hub-ssh-tags span { padding: 3px 0; }
.hub-ssh-empty { padding: 32px 0; max-width: 62ch; }
.hub-ssh-empty h3 { font-size: 19px; margin: 0 0 10px; }
.hub-ssh-empty p { font-size: 14px; color: var(--text-muted); }
.hub-ssh-editor { padding: 22px; background: var(--bg-dark); border: 1px solid var(--panel-border); border-radius: 12px; min-width: 0; align-self: start; }
.hub-ssh-editor h3, .hub-ssh-jobs h3 { font-size: 18px; margin: 0 0 12px; }
.hub-ssh-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.hub-ssh-full { grid-column: 1 / -1; }
.hub-ssh-trust { margin: 24px 0 16px; padding: 16px; border: 1px solid var(--panel-border); border-radius: 8px; min-width: 0; }
.hub-ssh-trust legend { font-weight: 600; font-size: 14px; padding: 0 6px; }
.hub-ssh-trust p { font-size: 12px; color: var(--text-muted); }
.hub-ssh-trust code { overflow-wrap: anywhere; }
.hub-ssh-trust output { display: block; font-family: monospace; font-size: 12px; overflow-wrap: anywhere; padding: 16px 0; }
.hub-ssh-panel .hub-ssh-check { display: flex; flex-direction: row; align-items: flex-start; line-height: 1.6; font-weight: 400; }
.hub-ssh-check input { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent-gold); }
.hub-ssh-error { color: var(--hub-ssh-error); font-size: 13px; overflow-wrap: anywhere; }
.hub-ssh-jobs { border-top: 1px solid var(--panel-border); margin-top: 36px; padding-top: 28px; }
.hub-ssh-job { padding: 24px 0; border-top: 1px solid var(--panel-border); }
.hub-ssh-job h4 { margin: 0; font-size: 16px; }
.hub-ssh-status { font-size: 12px; font-weight: 600; text-align: right; }
.hub-ssh-panel pre { font-size: 13px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg-dark); border: 1px solid var(--panel-border); border-radius: 8px; padding: 16px; margin: 14px 0; max-height: 360px; overflow-y: auto; tab-size: 4; }
.hub-ssh-targets { list-style: none; margin: 0; padding: 0; }
.hub-ssh-targets li { padding: 14px 0; border-bottom: 1px solid var(--panel-border); }
.hub-ssh-targets strong { display: block; font-size: 14px; }
.hub-ssh-targets code { font-size: 12px; overflow-wrap: anywhere; }
.hub-ssh-target-status { display: block; font-size: 12px; color: var(--text-muted); margin: 6px 0; }
.hub-ssh-result summary { cursor: pointer; min-height: 44px; padding-top: 12px; box-sizing: border-box; font-size: 13px; font-weight: 600; }
.hub-ssh-job-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-top: 14px; }
.hub-ssh-job-actions p { width: 100%; font-size: 13px; }
.hub-ssh-job-link { margin: 0 20px 8px; padding: 12px; border: 1px solid var(--panel-border); border-radius: 8px; background: var(--panel-bg); color: var(--text-main); cursor: pointer; text-align: left; font: inherit; font-size: 13px; }
@media (max-width: 1150px) {
    .hub-ssh-workspace:has(.hub-ssh-editor:not([hidden])) { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
    .hub-ssh-panel { padding: 18px; }
    .hub-ssh-head, .hub-ssh-section-head { flex-wrap: wrap; gap: 12px; }
    .hub-ssh-toolbar > label, .hub-ssh-toolbar > button { width: 100%; }
    .hub-ssh-fields { grid-template-columns: minmax(0, 1fr); }
    .hub-ssh-editor { padding: 16px; }
    .hub-ssh-device { flex-direction: column; gap: 12px; }
    .hub-ssh-device-actions { flex-direction: row; flex-wrap: wrap; }
    .hub-ssh-status { text-align: left; }
}

/* Lead-Zuordnungsklaerung: gemeinsame Teamaufgabe, kein Vertriebsstatus. */
.lc-assignment-queue, .lc-assignment-dialog, .lc-assignment-dashboard-task,
.lc-assignment-badge, .lc-assignment-row-pending {
    --lc-assignment-ink: #ffafb6;
    --lc-assignment-fill: color-mix(in srgb, var(--panel-bg) 92%, #bf4051);
    --lc-assignment-border: color-mix(in srgb, var(--panel-border) 55%, #bf4051);
}
html[data-theme="light"] :is(.lc-assignment-queue, .lc-assignment-dialog,
.lc-assignment-dashboard-task, .lc-assignment-badge, .lc-assignment-row-pending) {
    --lc-assignment-ink: #972b3d;
    --lc-assignment-fill: #fff3f4;
    --lc-assignment-border: #e8bbc2;
}
.lc-assignment-queue[hidden], .lc-assignment-dialog [hidden] { display: none !important; }
.lc-assignment-queue {
    margin-bottom: 24px; padding: 18px 20px; border: 1px solid var(--lc-assignment-border);
    border-radius: 12px; background: var(--lc-assignment-fill); color: var(--text-main);
}
.lc-assignment-queue-head, .lc-assignment-queue-head h3 { display: flex; align-items: center; gap: 10px; }
.lc-assignment-queue-head { justify-content: space-between; flex-wrap: wrap; }
.lc-assignment-queue-head h3 { margin: 0; font-size: 15px; color: var(--lc-assignment-ink); }
.lc-assignment-queue-head h3 > span { font-variant-numeric: tabular-nums; }
.lc-assignment-queue-head > span, .lc-assignment-help, .lc-assignment-meta {
    font-size: 12px; line-height: 1.6; color: color-mix(in srgb, var(--text-main) 75%, var(--panel-bg));
}
.lc-assignment-queue > .lc-assignment-help { margin: 6px 0 12px; }
.lc-assignment-queue-list { max-height: 28rem; overflow-y: auto; scrollbar-gutter: stable; }
.lc-assignment-queue-row {
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    padding: 14px 0; border-top: 1px solid var(--lc-assignment-border);
}
.lc-assignment-queue-row > div { min-width: 0; }
.lc-assignment-lead-link {
    display: inline-block; padding: 6px 0; background: none; border: none; color: var(--text-main);
    font: inherit; font-size: 14px; font-weight: 650; text-align: left; cursor: pointer;
    text-decoration: underline; text-decoration-color: var(--lc-assignment-border); text-underline-offset: 4px;
}
.lc-assignment-lead-link:hover { color: var(--lc-assignment-ink); }
.lc-assignment-meta { display: block; overflow-wrap: anywhere; }
.lc-assignment-note { margin: 5px 0 0; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.lc-assignment-review { flex-shrink: 0; min-height: 44px; }
.lc-assignment-badge {
    display: inline-flex; align-items: center; gap: 5px; max-width: 100%; margin-top: 6px;
    color: var(--lc-assignment-ink); background: var(--lc-assignment-fill);
    border: 1px solid var(--lc-assignment-border); border-radius: 5px; padding: 3px 6px;
    font-size: 12px; line-height: 1.4; font-weight: 600; white-space: normal;
}
.lc-assignment-badge svg { flex-shrink: 0; }
.lc-table tr.lc-assignment-row-pending > td { background: var(--lc-assignment-fill); }
.lc-assignment-detail:empty { display: none; }
.lc-assignment-detail { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.lc-assignment-actions { min-width: 32px; min-height: 32px; flex-shrink: 0; }
.lc-kanban-card > .lc-assignment-actions { margin-top: 8px; }
.adash-task.lc-assignment-dashboard-task {
    margin-bottom: 16px; padding: 16px; border: 1px solid var(--lc-assignment-border);
    border-radius: 10px; background: var(--lc-assignment-fill);
}
.lc-assignment-dashboard-task .adash-task-copy strong { color: var(--lc-assignment-ink); }
.lc-assignment-dialog {
    box-sizing: border-box; width: min(540px, calc(100vw - 32px)); max-height: calc(100dvh - 40px);
    margin: auto; padding: 0; overflow-y: auto; border: 1px solid var(--panel-border);
    border-radius: 14px; color: var(--text-main); background: var(--panel-bg);
    box-shadow: 0 18px 64px rgba(0,0,0,.28); font-family: inherit;
}
.lc-assignment-dialog::backdrop { background: rgba(0,0,0,.55); }
.lc-assignment-dialog-head, .lc-assignment-dialog-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px;
}
.lc-assignment-dialog-head { border-bottom: 1px solid var(--panel-border); }
.lc-assignment-dialog-head h2 { margin: 0; font-size: 19px; line-height: 1.4; }
.lc-assignment-dialog-head .lc-action-btn { min-width: 44px; min-height: 44px; }
.lc-assignment-dialog-body { padding: 20px 24px; }
.lc-assignment-dialog-body > strong { display: block; font-size: 16px; overflow-wrap: anywhere; }
.lc-assignment-dialog-body > .lc-assignment-help { margin: 8px 0 20px; font-size: 14px; }
.lc-assignment-dialog-foot { justify-content: flex-end; border-top: 1px solid var(--panel-border); flex-wrap: wrap; }
.lc-assignment-dialog-foot button { min-height: 44px; white-space: normal; }
.lc-assignment-field { display: flex; flex-direction: column; gap: 7px; margin-top: 18px; }
.lc-assignment-field label { font-size: 13px; font-weight: 600; }
.lc-assignment-field :is(select, textarea) {
    box-sizing: border-box; width: 100%; min-height: 44px; font: inherit; font-size: 14px;
    color: var(--text-main); background: var(--input-bg); border: 1px solid var(--panel-border);
    border-radius: 7px; padding: 10px 12px;
}
.lc-assignment-field textarea { resize: vertical; }
.lc-assignment-report-context {
    padding: 12px; border: 1px solid var(--lc-assignment-border); border-radius: 7px;
    background: var(--lc-assignment-fill); font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere;
}
.lc-assignment-error { color: var(--lc-assignment-ink); font-size: 14px; line-height: 1.6; }
.lc-assignment-dialog button:disabled { opacity: .6; cursor: wait; }
:is(.lc-assignment-queue, .lc-assignment-dialog) :is(button, select, textarea):focus-visible,
.lc-assignment-actions:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 3px; }
@media (max-width: 600px) {
    .lc-assignment-queue { padding: 14px; }
    .lc-assignment-queue-row { align-items: flex-start; flex-direction: column; gap: 10px; }
    .lc-assignment-review { align-self: flex-end; }
    .lc-assignment-dialog-head, .lc-assignment-dialog-body, .lc-assignment-dialog-foot { padding: 16px; }
    .lc-assignment-dialog-foot { flex-direction: column-reverse; align-items: stretch; }
    .lc-assignment-actions { min-width: 44px; min-height: 44px; }
}

/* -- Login und Auswahl aktiver Geraete -- */
html.lb-document { height: auto; min-height: 100%; width: 100%; overflow: auto; scrollbar-gutter: auto; }
.lb-page {
    --lb-bg: #0a0a0b; --lb-panel: #141416; --lb-border: #36363b;
    --lb-input-bg: #0a0a0b; --lb-input-brd: #55555d;
    --lb-text: #e0e0e0; --lb-muted: #b0b0b6; --lb-gold: #c5a47e; --lb-error: #ff9a9f;
    --input-bg: var(--lb-input-bg); --panel-border: var(--lb-input-brd); --text-main: var(--lb-text);
    background: var(--lb-bg); color: var(--lb-text);
    display: flex; justify-content: center; align-items: center;
    box-sizing: border-box; min-height: 100dvh; height: auto; width: 100%; overflow: visible;
    margin: 0; padding: 24px 16px; font-size: 15px; line-height: 1.5;
    -webkit-user-select: text; user-select: text;
}
html[data-theme="light"] .lb-page {
    --lb-bg: #f0f0f2; --lb-panel: #fff; --lb-border: #d1d1d6;
    --lb-input-bg: #f5f5f7; --lb-input-brd: #a4a4ab;
    --lb-text: #18181b; --lb-muted: #595963; --lb-gold: #b8905e; --lb-error: #b52e35;
}
.lb-page *, .lb-page *::before, .lb-page *::after { box-sizing: border-box; }
.lb-page [hidden] { display: none !important; }
.lb-page ::selection { background: var(--lb-gold); color: #141416; }
.lb-page :is(input, button, a):focus-visible { outline: 2px solid var(--lb-gold); outline-offset: 3px; }
.lb-page .lb-box { background: var(--lb-panel); border: 1px solid var(--lb-border); padding: 40px; border-radius: 16px; width: 100%; max-width: 400px; text-align: center; box-shadow: 0 8px 32px rgba(0,0,0,.18); }
.lb-page .lb-box-devices { max-width: 580px; text-align: left; }
.lb-page h2 { margin: 0 0 8px; color: var(--lb-text); font-size: 24px; line-height: 1.3; }
.lb-page .lb-sub { color: var(--lb-muted); font-size: 15px; margin: 0 0 22px; }
.lb-page .lb-error { color: var(--lb-error); font-size: 14px; margin: 0 0 18px; }
.lb-page .lb-input { width: 100%; padding: 12px 14px; margin-bottom: 14px; background: var(--lb-input-bg); border: 1px solid var(--lb-input-brd); color: var(--lb-text); border-radius: 8px; font: inherit; font-size: 16px; caret-color: var(--lb-gold); }
.lb-page .lb-input::placeholder { color: var(--lb-muted); }
.lb-page .lb-btn { width: 100%; min-height: 46px; padding: 12px 16px; background: var(--lb-gold); color: #141416; border: 0; border-radius: 8px; font: inherit; font-weight: 700; cursor: pointer; transition: opacity .15s ease-out; }
.lb-page .lb-btn:hover { opacity: .88; }
.lb-page .lb-btn:disabled { opacity: .6; cursor: wait; }
.lb-page .lb-link { background: none; border: 0; color: var(--lb-muted); font: inherit; font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; margin-top: 16px; padding: 8px 0; display: block; width: 100%; text-align: center; }
.lb-page .lb-remember { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; text-align: left; color: var(--lb-muted); font-size: 14px; cursor: pointer; }
.lb-page .lb-remember input { width: 18px; height: 18px; margin: 0; flex-shrink: 0; accent-color: var(--lb-gold); }
.lb-page .lb-env-badge { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 18px; padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, var(--lb-error) 8%, var(--lb-panel)); border: 1px solid var(--lb-error); color: var(--lb-error); font-size: 11px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; }
.lb-page .lb-env-badge svg { flex-shrink: 0; width: 13px; height: 13px; }
.lb-page .lb-device-list { min-width: 0; padding: 0; margin: 0 0 20px; border: 0; }
.lb-page .lb-device-list legend { padding: 0; margin-bottom: 12px; font-size: 16px; font-weight: 600; }
.lb-page .lb-device-option { display: flex; align-items: flex-start; gap: 12px; padding: 16px; margin-bottom: 10px; border: 1px solid var(--lb-border); border-radius: 10px; cursor: pointer; transition: border-color .2s ease-out, background .2s ease-out; }
.lb-page .lb-device-option:hover, .lb-page .lb-device-option:has(input:checked) { border-color: var(--lb-gold); background: color-mix(in srgb, var(--lb-gold) 8%, var(--lb-panel)); }
.lb-page .lb-device-option input { width: 20px; height: 20px; margin: 2px 0 0; flex-shrink: 0; accent-color: var(--lb-gold); }
.lb-page .lb-device-details { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.lb-page .lb-device-details strong { font-size: 16px; }
.lb-page .lb-device-details > span { color: var(--lb-muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.lb-page .lb-device-hint { font-size: 14px; }
.lb-page .lb-otp { --hbb-otp-accent: var(--lb-gold); margin-bottom: 18px; max-width: 100%; }
.lb-page .lb-otp input.hbb-otp-box { min-width: 0; width: min(44px, 10vw); }
@media (max-width: 480px) {
    .lb-page .lb-box { padding: 28px 20px; }
    .lb-page .lb-device-option { padding: 14px 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .lb-page *, .lb-page *::before, .lb-page *::after { animation: none !important; transition: none !important; }
}

/* -- Mein Profil: Daten, Sicherheit, Geraete und Einstellungen -- */
wrap {
    --up-accent: var(--brand-accent);
    --up-muted: color-mix(in srgb, var(--text-main) 76%, var(--panel-bg));
    --up-good: #197246;
    --up-error: #b52e35;
    max-width: 1080px; margin: 0 auto; padding: 8px 0 40px; color: var(--text-main);
    font-size: 15px; line-height: 1.55;
}
.up-wrap.up-admin { --up-accent: var(--accent-gold); }
:root:not([data-theme="light"]) .up-wrap { --up-good: #86d6ac; --up-error: #ff9a9f; }
.up-wrap *, .up-wrap *::before, .up-wrap *::after { box-sizing: border-box; }
.up-wrap [hidden] { display: none !important; }
.up-wrap ::selection { background: var(--up-accent); color: var(--bg-dark); }
.up-header { margin-bottom: 24px; }
.up-header h2 { margin: 0 0 6px; font-size: 28px; line-height: 1.25; color: var(--text-main); }
.up-header > p { margin: 0; color: var(--up-muted); font-size: 16px; }
.up-identity { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 20px; overflow-wrap: anywhere; }
.up-identity > span:not(.up-badge) { color: var(--up-muted); }
.up-badge { display: inline-flex; align-items: center; padding: 4px 10px; border: 1px solid var(--panel-border); border-radius: 999px; font-size: 13px; font-weight: 600; }
.up-wrap .up-state-good { color: var(--up-good); background: color-mix(in srgb, var(--up-good) 8%, var(--panel-bg)); }
.up-tabs { margin-bottom: 28px; }
.up-tab-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.up-panel { display: none; }
.up-panel.active { display: block; animation: upPanelReveal .2s ease-out; }
@keyframes upPanelReveal { from { opacity: .7; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
.up-section-intro { margin-bottom: 20px; }
.up-section-intro h3 { margin: 0 0 4px; font-size: 20px; }
.up-section-intro p { margin: 0; max-width: 72ch; color: var(--up-muted); }
.up-grid, .up-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.up-profile-content { max-width: 760px; }
.up-card { min-width: 0; padding: 26px; background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 16px; }
.up-card h3 { display: flex; align-items: center; gap: 10px; font-size: 17px; line-height: 1.4; margin: 0 0 18px; }
.up-card h3 svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--up-accent); }
.up-description { color: var(--up-muted); margin: 0 0 18px; max-width: 72ch; }
.up-field { display: block; min-width: 0; margin-bottom: 18px; }
.up-field > label, label.up-field { font-size: 14px; font-weight: 600; color: var(--text-main); }
.up-field > label { display: block; margin-bottom: 7px; }
.up-wrap .up-input { display: block; width: 100%; min-width: 0; min-height: 46px; padding: 11px 12px; font: inherit; color: var(--text-main); background: var(--bg-dark); border: 1px solid var(--panel-border); border-radius: 9px; caret-color: var(--up-accent); }
label.up-field .up-input { margin-top: 7px; font-weight: 400; }
.up-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.up-address-grid { grid-template-columns: minmax(90px, 1fr) minmax(0, 3fr); }
.up-wrap .btn, .up-wrap .btn-brand { min-height: 44px; padding: 10px 16px; font-size: 14px; line-height: 1.4; white-space: normal; }
.up-action { width: 100%; }
.up-wrap .up-secondary { background: transparent; color: var(--text-main); border: 1px solid var(--panel-border); }
.up-wrap button:disabled { opacity: .55; cursor: not-allowed; }
.up-wrap :is(button, input, a, [tabindex]):focus-visible { outline: 2px solid var(--up-accent); outline-offset: 3px; }
.up-wrap .up-panel:focus-visible { outline-offset: 6px; }
.up-help, .up-hint { font-size: 13px; color: var(--up-muted); line-height: 1.5; margin: 7px 0 0; }
.up-hint:empty { display: none; }
.up-status { padding: 12px 14px; border: 1px solid var(--panel-border); border-radius: 9px; margin-bottom: 18px; color: var(--up-muted); font-size: 14px; }
.up-msg { margin-top: 14px; padding: 10px 12px; background: var(--bg-dark); border-radius: 8px; font-size: 14px; overflow-wrap: anywhere; }
.up-wrap [data-state="good"] { color: var(--up-good); }
.up-wrap [data-state="error"] { color: var(--up-error); }
.up-pw-meter { display: flex; gap: 5px; margin-top: 10px; }
.up-pw-seg { flex: 1; height: 5px; border-radius: 999px; background: var(--panel-border); transition: background .2s ease-out; }
.up-pw-meter[data-level="1"] .up-pw-seg:first-child { background: var(--up-error); }
.up-pw-meter[data-level="2"] .up-pw-seg:nth-child(-n+2) { background: var(--up-accent); }
.up-pw-meter[data-level="3"] .up-pw-seg:nth-child(-n+3), .up-pw-meter[data-level="4"] .up-pw-seg { background: var(--up-good); }
.up-pw-reqs { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.up-pw-reqs li { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; color: var(--up-muted); }
.up-pw-reqs svg { flex-shrink: 0; margin-top: 3px; }
.up-pw-reqs .up-pw-req-met { color: var(--up-good); }
.up-bar-track { height: 4px; border-radius: 999px; background: var(--panel-border); margin-top: 8px; overflow: hidden; }
.up-bar-fill { height: 100%; width: 0; transition: width .2s ease-out; }
.up-bar-fill[data-state="good"] { width: 100%; background: var(--up-good); }
.up-bar-fill[data-state="error"] { width: 100%; background: var(--up-error); }
.up-pwned-alert { display: none; gap: 8px; font-size: 14px; line-height: 1.5; margin-top: 12px; padding: 12px; border: 1px solid var(--up-error); border-radius: 9px; color: var(--up-error); }
.up-pwned-visible { display: flex; }
.up-pwned-alert svg { flex-shrink: 0; margin-top: 3px; }
.up-totp-setup { margin-top: 20px; text-align: center; }
.up-wrap .hbb-otp-wrap { --hbb-otp-accent: var(--up-accent); max-width: 100%; }
.up-wrap .hbb-otp-wrap input.hbb-otp-box { min-width: 0; width: min(44px, 11vw); }
.up-qr { width: 175px; height: 175px; border-radius: 8px; padding: 8px; background: #fff; }
#up-totp-secret { display: block; user-select: all; overflow-wrap: anywhere; font-size: 14px; color: var(--text-main); margin-bottom: 18px; }
.up-avatar-section { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.up-avatar-wrap { flex-shrink: 0; }
.up-avatar-big { display: flex; align-items: center; justify-content: center; width: 76px; height: 76px; padding: 0; border: 2px solid var(--up-accent); border-radius: 50%; overflow: hidden; color: #141414; font: inherit; font-size: 24px; font-weight: 700; cursor: pointer; }
.up-avatar-big img { width: 100%; height: 100%; object-fit: cover; }
.up-avatar-color-0 { background: #c9a35a; } .up-avatar-color-1 { background: #5a96dc; }
.up-avatar-color-2 { background: #66a24d; } .up-avatar-color-3 { background: #b06fd1; }
.up-avatar-color-4 { background: #dc8c3c; } .up-avatar-color-5 { background: #4bb3a6; }
.up-avatar-color-6 { background: #d95f7a; } .up-avatar-color-7 { background: #7a8bd9; }
.up-avatar-menu { display: flex; justify-content: center; gap: 4px; margin-top: 8px; }
.up-avatar-menu-btn { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 9px; padding: 0; background: var(--bg-dark); border: 1px solid var(--panel-border); color: var(--text-main); cursor: pointer; }
.up-avatar-menu-btn:hover { border-color: var(--up-accent); }
.up-avatar-menu-btn.danger:hover { color: var(--up-error); border-color: var(--up-error); }
.up-avatar-hint { color: var(--up-muted); font-size: 14px; max-width: 48ch; }
.up-theme-group { display: flex; gap: 8px; }
.up-theme-btn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px; border: 1px solid var(--panel-border); border-radius: 10px; background: var(--bg-dark); color: var(--text-main); font: inherit; font-size: 14px; cursor: pointer; }
.up-theme-btn:hover, .up-theme-btn.up-theme-active { border-color: var(--up-accent); background: color-mix(in srgb, var(--up-accent) 10%, var(--panel-bg)); }
.up-theme-btn.up-theme-active { font-weight: 700; }
.up-topic-list { display: flex; flex-direction: column; }
.up-topic-row, .up-notif-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; padding: 12px 0; border-bottom: 1px solid var(--panel-border); font-size: 15px; cursor: pointer; }
.up-topic-row:last-child, .up-notif-row:last-child { border-bottom: 0; }
.up-tgl { display: inline-flex; position: relative; width: 44px; height: 26px; flex-shrink: 0; }
.up-tgl input { position: absolute; width: 100%; height: 100%; margin: 0; opacity: 0; }
.up-tgl-track { position: absolute; inset: 0; border: 1px solid var(--up-muted); background: var(--bg-dark); border-radius: 999px; pointer-events: none; transition: background .2s ease-out; }
.up-tgl-track::after { content: ''; position: absolute; width: 18px; height: 18px; top: 3px; left: 3px; border-radius: 50%; background: var(--text-main); transition: transform .2s ease-out; }
.up-tgl input:checked + .up-tgl-track { background: var(--up-accent); border-color: var(--up-accent); }
.up-tgl input:checked + .up-tgl-track::after { transform: translateX(18px); background: var(--bg-dark); }
.up-tgl input:focus-visible + .up-tgl-track { outline: 2px solid var(--up-accent); outline-offset: 3px; }
.up-notif-types { margin-bottom: 18px; }
.up-notif-title { font-weight: 600; font-size: 14px; }
.up-notif-enabled-badge { display: none; color: var(--up-good); font-size: 13px; margin-left: 6px; }
.up-notif-row:has(input:checked) .up-notif-enabled-badge { display: inline; }
.up-actions, .up-options { display: grid; gap: 10px; }
.up-options { margin-bottom: 18px; }
.up-radio-option { display: flex; gap: 10px; padding: 12px; border: 1px solid var(--panel-border); border-radius: 9px; cursor: pointer; }
.up-signout { margin-top: 24px; }
.up-signout a { color: var(--up-error); text-underline-offset: 4px; }
.up-card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.up-card-head h3 { margin: 0; }
.up-device-list { border-top: 1px solid var(--panel-border); }
.up-device-list[aria-busy="true"] { opacity: .6; pointer-events: none; }
.up-device-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--panel-border); }
.up-device-details { min-width: 0; }
.up-device-details h4 { display: inline; margin: 0 12px 0 0; font-size: 16px; }
.up-device-details > .up-badge { margin: 4px 6px 0 0; }
.up-device-details dl { display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 14px 0 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.up-device-details dt { color: var(--up-muted); font-size: 13px; margin-bottom: 3px; }
.up-device-details dd { margin: 0; }
.up-device-rename-editor { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px 12px; margin-top: 14px; }
.up-device-name-label { display: grid; gap: 5px; color: var(--up-muted); font-size: 13px; }
.up-wrap .up-device-name-input { min-height: 42px; }
.up-device-rename-editor > .up-help { grid-column: 1 / -1; margin-top: 0; }
.up-device-editor-actions, .up-device-actions { display: flex; flex-shrink: 0; flex-wrap: wrap; align-items: center; gap: 8px; }
.up-wrap .up-device-revoke { flex-shrink: 0; color: var(--up-error); border-color: color-mix(in srgb, var(--up-error) 50%, var(--panel-border)); }
.up-device-revoke:hover { background: color-mix(in srgb, var(--up-error) 8%, var(--panel-bg)); }
@media (max-width: 900px) {
    .up-grid { grid-template-columns: 1fr; }
    .up-device-row { align-items: flex-start; }
}
@media (max-width: 640px) {
    .up-wrap { padding-top: 0; }
    .up-header h2 { font-size: 25px; }
    .up-card { padding: 20px 16px; }
    .up-settings-grid, .up-form-grid:not(.up-address-grid) { grid-template-columns: 1fr; gap: 0; }
    .up-settings-grid { gap: 18px; }
    .up-device-row { flex-direction: column; gap: 16px; }
    .up-device-revoke { width: 100%; }
    .up-device-actions { width: 100%; }
    .up-device-actions > button { flex: 1; }
    .up-device-rename-editor { grid-template-columns: 1fr; }
    .up-device-rename-editor > .up-help { grid-column: auto; }
    .up-device-editor-actions > button { flex: 1; }
    .up-card-head { flex-wrap: wrap; }
    .up-pw-reqs { grid-template-columns: 1fr; }
    .up-avatar-section { gap: 14px; }
}
@media (prefers-reduced-motion: reduce) {
    .up-wrap *, .up-wrap *::before, .up-wrap *::after { animation: none !important; transition: none !important; }
}

/* -- System-Dashboard (html/modules/admin_system_dashboard.php) -- */
.sysdash-shell { padding: 4px 2px 24px; max-width: 1600px; }
.sysdash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.sysdash-head h1 { margin: 4px 0 0; font-size: 24px; color: var(--text-main); }
.sysdash-sub { margin: 8px 0 0; color: var(--text-muted); font-size: 13px; max-width: 62ch; line-height: 1.6; }
.sysdash-updated { font-size: 12px; color: var(--text-muted); text-align: right; padding-top: 6px; }
.sysdash-updated b { color: var(--brand-accent); }

.sysdash-head-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.sysdash-migrate-btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 10px;
    border: 1px solid var(--panel-border); background: var(--panel-bg); color: var(--text-main);
    font-size: 12.5px; font-weight: 600; cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.sysdash-migrate-btn:hover { border-color: var(--brand-accent); }
.sysdash-migrate-btn:disabled, .sysdash-migrate-btn.is-loading { opacity: .65; cursor: progress; }
.sysdash-migrate-btn svg { flex-shrink: 0; }

.sysdash-banner {
    display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin-bottom: 18px;
    background: rgba(198,40,40,0.08); border: 1px solid rgba(198,40,40,0.35); border-radius: 10px;
    color: var(--danger-red); font-size: 13px; line-height: 1.5;
}
.sysdash-banner svg { flex-shrink: 0; }

.sysdash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.sysdash-card { background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 16px; padding: 16px 18px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.sysdash-card-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 8px; }
.sysdash-card-val { font-size: 26px; font-weight: 700; color: var(--text-main); line-height: 1.1; }
.sysdash-card-val small { font-size: 13px; font-weight: 500; color: var(--text-muted); margin-left: 4px; }
.sysdash-card-meta { margin-top: 8px; font-size: 11.5px; color: var(--text-muted); }
/* Halbkreis-Gauge (CPU/RAM/Swap/Festplatte) statt linearer Balken -- Bogenlänge wird zur Laufzeit
   per SVG getTotalLength() ermittelt (sysdashSetGauge), daher ist der Radius im "d"-Pfad frei wählbar. */
.sysdash-card-gauge { text-align: center; }
.sysdash-gauge-wrap { position: relative; width: 100%; max-width: 180px; margin: 2px auto 0; }
.sysdash-gauge { display: block; width: 100%; height: auto; overflow: visible; }
.sysdash-gauge-track { fill: none; stroke: var(--bg-dark); stroke-width: 14; stroke-linecap: round; }
html[data-theme="light"] .sysdash-gauge-track { stroke: rgba(0,0,0,0.12); }
.sysdash-gauge-value { fill: none; stroke: var(--brand-accent); stroke-width: 14; stroke-linecap: round; transition: stroke-dashoffset .6s cubic-bezier(.22,1,.36,1), stroke .4s ease; }
.sysdash-gauge-center {
    position: absolute; left: 0; right: 0; bottom: 2px; display: flex; align-items: baseline;
    justify-content: center; gap: 2px; font-size: 25px; font-weight: 700; color: var(--text-main);
}
.sysdash-gauge-center small { font-size: 13px; font-weight: 500; color: var(--text-muted); }

.sysdash-panel { background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 14px; padding: 18px 20px; margin-bottom: 20px; }
.sysdash-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.sysdash-panel-head h2 { margin: 0; font-size: 15px; color: var(--text-main); }
.sysdash-range-switch { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255,255,255,0.04); border: 1px solid var(--panel-border); }
html[data-theme="light"] .sysdash-range-switch { background: rgba(0,0,0,0.03); }
.sysdash-range-btn { border: none; background: transparent; color: var(--text-muted); font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em; padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.sysdash-range-btn.is-active { background: var(--brand-accent); color: var(--btn-text); }

.sysdash-chart-wrap { position: relative; width: 100%; }
#sysdash-chart { width: 100%; height: 220px; display: block; }
.sysdash-legend { display: flex; gap: 18px; margin-top: 10px; flex-wrap: wrap; }
.sysdash-legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.sysdash-legend-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

.sysdash-proc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 20px; }
.sysdash-proc-table-wrap table { font-size: 12.5px; }
.sysdash-proc-table-wrap th, .sysdash-proc-table-wrap td { padding: 9px 12px; }
.sysdash-proc-name { font-weight: 600; color: var(--text-main); }
.sysdash-proc-meta { color: var(--text-muted); font-size: 11px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sysdash-empty-row td { text-align: center; color: var(--text-muted); padding: 24px 12px; }

@media (max-width: 720px) {
    .sysdash-head { flex-direction: column; }
    .sysdash-updated { text-align: left; }
}

/* -- Benutzerverwaltung (html/modules/admin_users.php) -- */
#modal-create-user .modal-content, #modal-edit-user .modal-content { padding: 35px; max-width: 560px; max-height: 90vh; overflow-y: auto; }
.role-badge { text-transform: uppercase; font-size: 10px; letter-spacing: 0.5px; border: 1px solid; padding: 4px 10px; border-radius: 4px; font-weight: 600; }
.role-admin { color: #D45D2A; border-color: rgba(212, 93, 42, 0.4); background: rgba(212, 93, 42, 0.05); }
.role-mitarbeiter { color: var(--brand-accent); border-color: rgba(197, 164, 126, 0.4); background: rgba(197, 164, 126, 0.05); }
.role-fachberater { color: #6B8CAE; border-color: rgba(107, 140, 174, 0.4); background: rgba(107, 140, 174, 0.08); }
.role-kunde { color: #aaa; border-color: #333; background: transparent; }
.role-dienstleister { color: #9333ea; border-color: rgba(147, 51, 234, 0.4); background: rgba(147, 51, 234, 0.08); }
.au-perm-badge { display:inline-block; font-size:10px; padding:2px 7px; border-radius:4px; border:1px solid rgba(167,139,250,0.4); background:rgba(167,139,250,0.08); color:#a78bfa; white-space:nowrap; margin:1px 2px 1px 0; }
.au-perm-check-list { display:flex; flex-direction:column; border:1px solid var(--panel-border); border-radius:10px; overflow:hidden; margin-bottom:18px; }
.au-perm-check-row { display:flex; align-items:center; gap:11px; padding:9px 12px; }
.au-perm-check-row + .au-perm-check-row { border-top:1px solid var(--panel-border); }
.au-perm-check-icon { flex-shrink:0; width:26px; height:26px; border-radius:7px; background:rgba(167,139,250,0.1); color:#a78bfa; display:flex; align-items:center; justify-content:center; }
.au-perm-check-text { flex:1; min-width:0; }
.au-perm-check-label { font-size:13px; color:var(--text-main); font-weight:500; display:block; }
.au-perm-check-desc { font-size:11px; color:var(--text-muted); margin-top:1px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.au-section-label { font-size:11px; text-transform:uppercase; letter-spacing:0.6px; color:var(--text-muted); margin:0 0 8px; }
.au-section-hint { font-size:11px; color:var(--text-muted); margin:0 0 10px; }
.au-brand-badge { display:inline-block; font-size:10px; padding:2px 7px; border-radius:4px; border:1px solid rgba(56,189,248,0.4); background:rgba(56,189,248,0.08); color:#38bdf8; white-space:nowrap; margin:1px 2px 1px 0; }
.au-brand-check-list { display:flex; flex-direction:column; border:1px solid var(--panel-border); border-radius:10px; overflow:hidden; margin-bottom:18px; }
.au-brand-check-row { display:flex; align-items:center; gap:11px; padding:9px 12px; }
.au-brand-check-row + .au-brand-check-row { border-top:1px solid var(--panel-border); }
.au-brand-check-icon { flex-shrink:0; width:26px; height:26px; border-radius:7px; background:rgba(56,189,248,0.1); color:#38bdf8; display:flex; align-items:center; justify-content:center; }
.au-brand-check-label { flex:1; min-width:0; font-size:13px; color:var(--text-main); font-weight:500; }
.au-tgl { position:relative; display:inline-block; width:38px; height:22px; flex-shrink:0; }
.au-tgl input { opacity:0; width:0; height:0; position:absolute; }
.au-tgl-track { position:absolute; inset:0; background:var(--panel-border); border-radius:999px; cursor:pointer; transition:background 0.2s; }
.au-tgl input:checked + .au-tgl-track { background:var(--brand-accent); }
.au-tgl-track::after { content:''; position:absolute; width:16px; height:16px; left:3px; top:3px; background:#fff; border-radius:50%; transition:transform 0.2s; box-shadow:0 1px 3px rgba(0,0,0,0.3); }
.au-tgl input:checked + .au-tgl-track::after { transform:translateX(16px); }
.user-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; margin-top: 10px; }
.user-table th { padding: 12px 20px; color: var(--text-muted); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.user-table td { background: var(--panel-bg); padding: 18px 20px; border-top: 1px solid var(--panel-border); border-bottom: 1px solid var(--panel-border); }
.user-table td:first-child { border-left: 1px solid var(--panel-border); border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
.user-table td:last-child { border-right: 1px solid var(--panel-border); border-top-right-radius: 8px; border-bottom-right-radius: 8px; text-align: right; }
.icon-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 8px; border-radius: 6px; transition: 0.2s; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: rgba(255,255,255,0.05); color: var(--brand-accent); }
.icon-btn.danger:hover { background: rgba(198, 40, 40, 0.1); color: var(--danger-red); }
.icon-btn.is-disabled { opacity: 0.35; cursor: not-allowed; }
.pw-reset-section { border-top: 1px solid var(--panel-border); margin-top: 25px; padding-top: 20px; }
.au-tbl-controls { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:10px; }
.au-tbl-search-wrap { position:relative; flex:1; min-width:180px; }
.au-tbl-search-wrap svg { position:absolute; left:10px; top:50%; transform:translateY(-50%); color:var(--text-muted); pointer-events:none; }
.au-tbl-search { width:100%; box-sizing:border-box; padding:7px 10px 7px 33px; border:1px solid var(--panel-border); border-radius:8px; background:var(--input-bg); color:var(--text-main); font-size:13px; outline:none; transition:0.15s; }
.au-tbl-search:focus { border-color:var(--brand-accent); box-shadow:0 0 0 2px rgba(197,164,126,0.12); }
.au-ctrl-btn { background:var(--panel-bg); border:1px solid var(--panel-border); border-radius:8px; padding:6px 12px; color:var(--text-muted); cursor:pointer; font-size:12px; display:inline-flex; align-items:center; gap:6px; transition:0.15s; white-space:nowrap; }
.au-ctrl-btn:hover, .au-ctrl-btn.active { border-color:var(--brand-accent); color:var(--brand-accent); background:rgba(197,164,126,0.06); }
.au-tbl-vis-count { font-size:11px; color:var(--text-muted); margin-left:auto; white-space:nowrap; }
.au-mod-badge { display:inline-block; font-size:10px; padding:2px 7px; border-radius:4px; border:1px solid rgba(102,157,36,0.35); background:rgba(102,157,36,0.07); color:var(--brand-accent); white-space:nowrap; margin:1px 2px 1px 0; }
.au-df-badge { display:inline-flex; align-items:center; gap:3px; color:#d6975a; font-size:10px; background:rgba(214,151,90,0.1); border:1px solid rgba(214,151,90,0.3); border-radius:4px; padding:1px 6px; }
.au-gf-badge { display:inline-flex; align-items:center; gap:3px; color:var(--accent-gold); font-size:10px; background:rgba(201,162,39,0.12); border:1px solid rgba(201,162,39,0.35); border-radius:4px; padding:1px 6px; }
.au-df-section { border-top:1px solid var(--panel-border); margin-top:18px; padding-top:18px; }
.au-df-row { display:flex; gap:15px; }
.au-df-col { flex:1; }
.au-report { border:1px solid rgba(214,151,90,0.4); background:rgba(214,151,90,0.08); border-radius:10px; padding:12px 14px; margin:0 0 14px; }
.au-report-title { color:#d6975a; font-weight:600; font-size:13px; margin:0 0 6px; }
.au-report-meta { font-size:12px; color:var(--text-muted); margin:0; }
.au-report-list { margin:8px 0 0; padding-left:18px; color:var(--text-main); font-size:12px; }
.au-report-list li { margin:4px 0; }
@media (max-width: 767px) {
    .user-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .user-table { min-width: 720px; }
}

/* -- Benutzerverwaltung: Filter, Rechtegruppen und Dialoge -- */
.au-hidden { display: none !important; }
.au-sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.au-page-header {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
    margin-bottom: 20px;
}
.au-page-title { margin: 0; color: var(--text-main); font-size: 24px; line-height: 1.3; }
.au-page-description { margin: 6px 0 0; max-width: 62ch; color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.au-create-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; white-space: nowrap; }
.au-tbl-controls { align-items: flex-start; }
.au-tbl-search-wrap { flex: 1 1 240px; }
.au-tbl-search { min-height: 40px; }
.au-group-filter { flex: 0 1 230px; min-width: 190px; }
.au-group-filter select {
    width: 100%; min-height: 40px; padding: 8px 32px 8px 11px; border: 1px solid var(--panel-border);
    border-radius: 8px; background: var(--input-bg); color: var(--text-main); font: inherit; font-size: 13px;
}
.au-role-filters { display: flex; flex: 1 1 100%; flex-wrap: wrap; gap: 6px; }
.au-ctrl-btn { min-height: 36px; }
.au-filter-count {
    display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px;
    padding: 0 5px; border-radius: 6px; background: rgba(127, 127, 127, .14); font-variant-numeric: tabular-nums;
}
.au-ctrl-btn.active .au-filter-count { background: color-mix(in srgb, var(--brand-accent) 18%, transparent); }
.au-tbl-vis-count { flex: 1 0 100%; margin: 0; text-align: right; }
.au-user-table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.au-user-table { width: 100%; min-width: 900px; border-collapse: separate; border-spacing: 0; margin: 8px 0 0; }
.au-user-table th {
    padding: 11px 14px; border-bottom: 1px solid var(--panel-border); color: var(--text-muted);
    font-size: 11px; font-weight: 600; letter-spacing: .04em; text-align: left; text-transform: uppercase;
    white-space: nowrap;
}
.au-user-table td {
    padding: 13px 14px; border-bottom: 1px solid var(--panel-border); color: var(--text-main);
    font-size: 13px; vertical-align: middle;
}
.au-user-table tbody tr { transition: background .15s ease-out; }
.au-user-table tbody tr:hover { background: color-mix(in srgb, var(--panel-bg) 65%, var(--brand-accent) 5%); }
.au-user-name { font-weight: 600; }
.au-user-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 4px; color: var(--text-muted); font-size: 11px; }
.au-user-email { overflow-wrap: anywhere; }
.au-user-department-cell { max-width: 230px; }
.au-department-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 3px; }
.au-department-count { margin-right: 3px; color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.au-department-badge { display: inline-block; max-width: 145px; overflow: hidden; text-overflow: ellipsis; font-size: 10px; padding: 2px 7px; border-radius: 4px; border: 1px solid color-mix(in srgb, var(--brand-accent) 42%, transparent); background: color-mix(in srgb, var(--brand-accent) 10%, transparent); color: var(--brand-accent); white-space: nowrap; }
.au-department-more { color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.au-user-permissions { min-width: 180px; }
.au-group-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 3px; }
.au-perm-count { margin-right: 3px; color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.au-perm-more { color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.au-perm-badge { max-width: 135px; overflow: hidden; text-overflow: ellipsis; }
.au-status-badge { display: inline-flex; align-items: center; gap: 3px; padding: 2px 5px; border-radius: 4px; font-weight: 600; }
.au-status-2fa { color: #77c99a; background: rgba(56, 161, 105, .12); }
.au-status-ai { color: #8db4e0; background: rgba(80, 135, 195, .13); }
.au-status-push { color: var(--brand-accent); background: color-mix(in srgb, var(--brand-accent) 12%, transparent); }
.au-action-btn { min-width: 38px; min-height: 38px; }
.au-page-header :focus-visible, .au-tbl-controls :focus-visible, .au-user-table :focus-visible {
    outline: 2px solid var(--brand-accent); outline-offset: 2px;
}
.au-tbl-search::placeholder, .au-permission-search::placeholder { color: var(--text-muted); opacity: 1; }
.au-empty-state { margin: 18px 0; padding: 24px; border: 1px dashed var(--panel-border); border-radius: 10px; color: var(--text-muted); text-align: center; }
.au-modal-overlay { z-index: 1100; padding: 20px; overflow-y: auto; }
.au-modal-overlay.is-open { display: flex; }
#modal-create-user .au-modal-content, #modal-edit-user .au-modal-content {
    display: flex; flex-direction: column; width: min(820px, 100%); max-width: 820px;
    max-height: min(900px, calc(100dvh - 40px)); padding: 0; overflow: hidden;
}
.au-modal-content:focus { outline: none; }
.au-modal-form { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.au-modal-header { padding: 22px 28px 17px; border-bottom: 1px solid var(--panel-border); }
.au-modal-title { margin: 0; color: var(--text-main); font-size: 20px; line-height: 1.35; }
.au-modal-subtitle { margin: 5px 0 0; color: var(--text-muted); font-size: 13px; }
.au-modal-body { flex: 1; min-height: 0; padding: 22px 28px; overflow-y: auto; }
.au-modal-footer {
    display: flex; justify-content: flex-end; gap: 10px; padding: 14px 28px;
    border-top: 1px solid var(--panel-border); background: var(--panel-bg);
}
.au-modal-footer .btn { min-height: 42px; }
.au-form-section { min-width: 0; margin: 0 0 20px; padding: 0; border: 0; }
.au-section-title { margin: 0; color: var(--text-main); font-size: 14px; font-weight: 650; }
.au-section-hint { color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.au-account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.au-grid-full { grid-column: 1 / -1; }
.au-modal-content .input-group { min-width: 0; margin: 0; }
.au-modal-content .input-group label, .au-field-label, .au-security-label {
    display: block; margin: 0 0 6px; color: var(--text-main); font-size: 12px; font-weight: 600;
}
.au-modal-content .input-group input, .au-modal-content .input-group select,
.au-password-row input, .au-sort-field {
    width: 100%; min-width: 0; min-height: 42px; padding: 9px 11px; border: 1px solid var(--panel-border);
    border-radius: 8px; background: var(--input-bg); color: var(--text-main); font: inherit; font-size: 13px;
}
.au-modal-content :is(input, select, button, summary):focus-visible {
    outline: 2px solid var(--brand-accent); outline-offset: 2px;
}
.au-settings-heading { margin: 0 0 16px; }
.au-settings-heading .au-section-hint { margin: 4px 0 0; }
.au-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.au-selected-count { color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.au-permission-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.au-permission-search-label { flex: 1 0 100%; color: var(--text-main); font-size: 12px; font-weight: 600; }
.au-permission-search {
    flex: 1 1 220px; min-width: 0; min-height: 40px; padding: 8px 11px; border: 1px solid var(--panel-border);
    border-radius: 8px; background: var(--input-bg); color: var(--text-main); font: inherit; font-size: 13px;
}
.au-permission-views { display: flex; gap: 5px; }
.au-view-btn {
    min-height: 40px; padding: 7px 11px; border: 1px solid var(--panel-border); border-radius: 8px;
    background: transparent; color: var(--text-muted); font: inherit; font-size: 12px; cursor: pointer;
}
.au-view-btn:hover, .au-view-btn.is-active {
    border-color: var(--brand-accent); background: color-mix(in srgb, var(--brand-accent) 10%, transparent);
    color: var(--text-main);
}
.au-perm-check-list {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 330px;
    margin: 0; padding: 1px; overflow-y: auto; border: 0;
}
.au-permission-card {
    display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: start; gap: 9px;
    min-height: 68px; padding: 11px; border: 1px solid var(--panel-border); border-radius: 8px;
    background: color-mix(in srgb, var(--panel-bg) 92%, var(--brand-accent) 8%); cursor: pointer;
    transition: border-color .15s ease-out, background .15s ease-out;
}
.au-permission-card:hover { border-color: color-mix(in srgb, var(--brand-accent) 55%, var(--panel-border)); }
.au-permission-card:has(input:checked) {
    border-color: var(--brand-accent); background: color-mix(in srgb, var(--brand-accent) 10%, var(--panel-bg));
}
.au-permission-card input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--brand-accent); }
.au-permission-copy { min-width: 0; }
.au-perm-check-label { display: block; color: var(--text-main); font-size: 13px; font-weight: 600; line-height: 1.35; }
.au-perm-check-desc { display: block; margin-top: 4px; color: var(--text-muted); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; white-space: normal; }
.au-perm-empty { margin: 8px 0 14px; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.au-department-check-list {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 250px;
    margin: 0; padding: 1px; overflow-y: auto; border: 0;
}
.au-department-card {
    display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: center; gap: 9px;
    min-height: 46px; padding: 9px 11px; border: 1px solid var(--panel-border); border-radius: 8px;
    background: color-mix(in srgb, var(--panel-bg) 92%, var(--brand-accent) 8%); cursor: pointer;
    transition: border-color .15s ease-out, background .15s ease-out;
}
.au-department-card:hover { border-color: color-mix(in srgb, var(--brand-accent) 55%, var(--panel-border)); }
.au-department-card:has(input:checked) { border-color: var(--brand-accent); background: color-mix(in srgb, var(--brand-accent) 10%, var(--panel-bg)); }
.au-department-card input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand-accent); }
.au-department-card-label { min-width: 0; color: var(--text-main); font-size: 12px; line-height: 1.35; }
.au-role-option { padding-top: 16px; border-top: 1px solid var(--panel-border); }
.au-brand-check-list { margin: 10px 0 0; }
.au-brand-check-row { min-height: 48px; }
.au-brand-check-label { font-size: 12px; }
.au-tgl { width: 44px; height: 26px; }
.au-tgl input { width: 100%; height: 100%; margin: 0; cursor: pointer; }
.au-tgl-track { pointer-events: none; }
.au-tgl input:focus-visible + .au-tgl-track { outline: 2px solid var(--brand-accent); outline-offset: 3px; }
.au-director-row { margin: 0 0 18px; border: 1px solid var(--panel-border); border-radius: 8px; }
.au-optional-section { margin: 18px 0; padding: 14px 0 0; border-top: 1px solid var(--panel-border); }
.au-optional-heading { color: var(--text-main); font-size: 13px; font-weight: 600; cursor: pointer; }
.au-optional-section > .au-section-hint { margin: 10px 0; }
.au-security-details { margin-top: 18px; }
.au-security-body { padding-top: 14px; }
.au-password-section { padding-bottom: 16px; }
.au-password-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.au-password-row input { flex: 1 1 200px; }
.au-password-generate { min-height: 42px; white-space: nowrap; }
.au-danger-action { min-height: 40px; }
.au-security-message { margin-top: 8px; font-size: 12px; }
.au-security-message.is-success { color: var(--success-green); }
.au-security-message.is-error { color: var(--danger-red); }
.au-2fa-section { padding-top: 14px; border-top: 1px solid var(--panel-border); }
.au-module-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 8px 0 16px; }
.au-module-chip {
    min-height: 38px; padding: 7px 11px; border: 1px solid var(--panel-border); border-radius: 8px;
    background: transparent; color: var(--text-muted); font: inherit; font-size: 12px; cursor: pointer;
}
.au-module-chip:hover, .au-module-chip.is-selected {
    border-color: var(--brand-accent); background: color-mix(in srgb, var(--brand-accent) 11%, transparent);
    color: var(--text-main);
}
.au-field-label { margin-top: 14px; }
.au-sort-list { display: grid; gap: 7px; }
.au-sort-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 7px; }
.au-sort-direction, .au-sort-remove, .au-sort-add-btn {
    min-height: 40px; padding: 7px 10px; border: 1px solid var(--panel-border); border-radius: 8px;
    background: var(--panel-bg); color: var(--text-main); font: inherit; font-size: 12px; cursor: pointer;
}
.au-sort-direction:hover, .au-sort-add-btn:hover { border-color: var(--brand-accent); }
.au-sort-remove { color: var(--danger-red); }
.au-sort-remove:hover { border-color: var(--danger-red); }
.au-sort-add-btn { margin-top: 8px; }
.au-modal-content :is(button, input, select, summary) { touch-action: manipulation; }
html[data-theme="light"] .role-admin { color: #a63f1c; }
html[data-theme="light"] .role-mitarbeiter, html[data-theme="light"] .au-mod-badge, html[data-theme="light"] .au-status-push { color: #76552f; }
html[data-theme="light"] .role-fachberater { color: #365d82; }
html[data-theme="light"] .role-kunde { color: #595963; border-color: #b7b7bf; }
html[data-theme="light"] .au-perm-badge { color: #6246a5; }
html[data-theme="light"] .au-brand-badge { color: #146477; }
html[data-theme="light"] .au-df-badge { color: #8d4a19; }
html[data-theme="light"] .au-gf-badge { color: #705500; }
html[data-theme="light"] .au-status-2fa { color: #24653f; }
html[data-theme="light"] .au-status-ai { color: #2d5a82; }
@media (max-width: 767px) {
    .au-page-header { align-items: center; gap: 12px; }
    .au-create-btn { flex-shrink: 0; padding-right: 12px; padding-left: 12px; }
    #modal-create-user .au-modal-content, #modal-edit-user .au-modal-content {
        width: 100%; max-height: calc(100dvh - 24px);
    }
    .au-modal-overlay { align-items: flex-start; padding: 12px; }
    .au-modal-header { padding: 18px 18px 14px; }
    .au-modal-body { padding: 18px; }
    .au-modal-footer { padding: 12px 18px; }
    .au-perm-check-list { grid-template-columns: 1fr; max-height: 290px; }
    .au-tbl-vis-count { text-align: left; }
}
@media (max-width: 520px) {
    .au-page-header { align-items: flex-start; flex-direction: column; }
    .au-account-grid { grid-template-columns: 1fr; }
    .au-grid-full { grid-column: auto; }
    .au-section-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
    .au-permission-toolbar { align-items: stretch; }
    .au-permission-search { flex-basis: 100%; }
    .au-sort-row { grid-template-columns: minmax(0, 1fr) auto; }
    .au-sort-field { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
    .au-user-table tbody tr, .au-permission-card, .au-tbl-search, .au-tgl-track, .au-tgl-track::after {
        transition: none;
    }
}

/* -- Personenverwaltung / Kontakte (html/modules/admin_contacts.php) -- */
.ac-heading { display:flex; justify-content:space-between; align-items:center; gap:20px; flex-wrap:wrap; padding:6px 0 12px; }
.ac-heading h2 { margin:0; color:var(--text-main); font-size:26px; font-weight:650; letter-spacing:-.5px; }
.ac-heading p, .ac-form-intro { margin:7px 0 0; color:var(--text-muted); font-size:14px; line-height:1.6; }
.ac-heading-actions { display:flex; gap:10px; flex-wrap:wrap; }
.ac-entity-filter { display:flex; padding:4px; background:var(--panel-bg); border:1px solid var(--panel-border); border-radius:10px; gap:3px; }
.ac-entity { min-height:40px; padding:8px 16px; border:0; border-radius:7px; background:transparent; color:var(--text-main); font:inherit; font-size:13px; cursor:pointer; }
.ac-entity.active { background:var(--brand-accent); color:var(--btn-text); }
.ac-entity:not(.active):hover { background:var(--input-bg); }
.ac-filter-bar { border-bottom:1px solid var(--panel-border); padding-bottom:16px; }
.ac-wrap .ac-search { min-height:48px; font-size:14px; }
.ac-wrap .ac-chip { min-height:36px; font-size:12px; color:var(--text-main); }
.ac-wrap .ac-chip.active { color:var(--text-main); background:var(--input-bg); box-shadow:inset 0 -2px var(--brand-accent); }
.ac-wrap .ac-count { font-size:12px; font-variant-numeric:tabular-nums; }
.ac-wrap .ac-badge { color:var(--text-main); font-size:11px; }
.ac-meta { margin-top:5px; }
.ac-contact-row { cursor:pointer; }
.ac-contact-row:hover td { background:var(--input-bg); }
.ac-name-button { display:flex; align-items:center; gap:12px; border:0; padding:0; background:none; color:var(--text-main); text-align:left; font:inherit; font-weight:600; cursor:pointer; min-height:44px; width:100%; overflow-wrap:anywhere; }
.ac-name-button small { display:block; font-size:11px; font-weight:400; margin-top:4px; color:var(--text-muted); }
.ac-avatar { display:inline-flex; align-items:center; justify-content:center; flex:0 0 40px; width:40px; height:40px; border-radius:50%; overflow:hidden; background:var(--input-bg); border:1px solid var(--panel-border); color:var(--brand-accent); }
.ac-avatar img { width:100%; height:100%; object-fit:cover; }
.ac-avatar-company { border-radius:10px; }
.ac-avatar-large { width:88px; height:88px; flex-basis:88px; }
.ac-avatar-large svg { width:40px; height:40px; }
.ac-card, .ac-company-dialog { box-sizing:border-box; width:calc(100% - 32px); max-width:620px; max-height:calc(100dvh - 48px); padding:0; border:1px solid var(--panel-border); border-radius:18px; color:var(--text-main); background:var(--panel-bg); box-shadow:0 24px 80px rgba(0,0,0,.24); }
.ac-card::backdrop, .ac-company-dialog::backdrop { background:rgba(0,0,0,.48); }
.ac-card[open], .ac-company-dialog[open] { animation:ac-card-enter 180ms ease-out; }
.ac-card-top { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:14px 24px; border-bottom:1px solid var(--panel-border); font-size:13px; color:var(--text-muted); }
.ac-card .ac-icon-btn, .ac-company-dialog .ac-icon-btn { display:inline-flex; align-items:center; justify-content:center; min-width:44px; min-height:44px; }
.ac-card-identity { display:flex; align-items:center; gap:20px; padding:28px 28px 22px; }
.ac-card-name { min-width:0; }
.ac-card-name h3 { margin:0; font-size:26px; font-weight:650; line-height:1.2; letter-spacing:-.4px; overflow-wrap:anywhere; }
.ac-card-name p { margin:9px 0 0; color:var(--text-muted); font-size:14px; }
.ac-card-brand { display:flex; align-items:center; gap:22px; flex-wrap:wrap; margin:0 28px 24px; padding:16px 20px; background:#fff; border:1px solid #e5e5e5; border-radius:8px; }
.ac-card-brand img { width:160px; max-width:100%; height:80px; object-fit:contain; }
.ac-card-channels { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1px; margin:0 28px 24px; background:var(--panel-border); border:1px solid var(--panel-border); border-radius:10px; overflow:hidden; }
.ac-card-channel { display:flex; align-items:center; gap:12px; padding:16px; background:var(--panel-bg); color:var(--text-main); text-decoration:none; min-height:44px; }
.ac-card-channel:hover { background:var(--input-bg); }
.ac-card-channel svg { flex:0 0 18px; width:18px; height:18px; color:var(--brand-accent); }
.ac-card-channel span { min-width:0; }
.ac-card-channel small { display:block; margin-bottom:5px; font-size:12px; color:var(--text-muted); }
.ac-card-channel strong { display:block; font-size:14px; font-weight:550; overflow-wrap:anywhere; }
.ac-card-section { margin:0 28px; padding:20px 0; border-top:1px solid var(--panel-border); }
.ac-card-section h4 { margin:0 0 10px; font-size:13px; font-weight:650; color:var(--text-muted); }
.ac-card-section p { margin:0; line-height:1.6; font-size:14px; overflow-wrap:anywhere; }
.ac-card-addresses { display:flex; gap:28px; flex-wrap:wrap; }
.ac-card-address { flex:1 1 180px; }
.ac-card-link { display:flex; align-items:center; gap:10px; padding:10px 0; min-height:44px; box-sizing:border-box; border:0; background:none; color:var(--text-main); text-decoration:underline; text-underline-offset:4px; cursor:pointer; font:inherit; font-size:14px; text-align:left; overflow-wrap:anywhere; }
.ac-card-link:hover { color:var(--brand-accent); }
.ac-card-link svg { flex-shrink:0; color:var(--brand-accent); }
.ac-card-notes { white-space:pre-wrap; }
.ac-card-footer { display:flex; justify-content:flex-end; padding:18px 28px; border-top:1px solid var(--panel-border); }
.ac-card-status { margin:0; padding:28px; font-size:16px; font-weight:500; }
.ac-card-retry { margin:0 28px 28px; }
.ac-card-empty { margin:0 28px 24px; font-size:14px; line-height:1.6; color:var(--text-muted); }
.ac-card-section .ac-card-empty { margin:0; }
.ac-company-dialog { padding:28px; max-width:700px; }
.ac-dialog-heading { display:flex; justify-content:space-between; align-items:center; gap:16px; }
.ac-dialog-heading h3 { margin:0; font-size:22px; font-weight:600; }
.ac-company-dialog .ac-form-grid { margin-top:22px; }
.ac-company-dialog input, .ac-company-dialog select, .ac-company-dialog textarea { box-sizing:border-box; width:100%; min-height:44px; }
.ac-company-dialog .ac-field label { font-size:12px; text-transform:none; letter-spacing:0; }
.ac-company-dialog button:disabled { opacity:.5; cursor:wait; }
.ac-error { color:var(--danger-red); }
.ac-company-dialog .ac-error:empty { display:none; }
.ac-wrap :focus-visible, .ac-card :focus-visible, .ac-company-dialog :focus-visible { outline:2px solid var(--brand-accent); outline-offset:3px; }
@keyframes ac-card-enter { from { opacity:.4; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
@media (prefers-reduced-motion:reduce) { .ac-card[open], .ac-company-dialog[open] { animation:none; } }
@media (max-width:700px) {
    .ac-heading { align-items:flex-start; gap:16px; }
    .ac-heading h2 { font-size:23px; }
    .ac-heading-actions { width:100%; }
    .ac-heading-actions .btn { flex:1; min-height:44px; }
    .ac-toolbar .ac-entity-filter { flex:1 1 100%; }
    .ac-entity { flex:1; padding:8px; }
    .ac-toolbar .ac-search-wrap { min-width:0; flex:1 1 100%; }
    .ac-filter-bar { padding-bottom:10px; }
    .ac-wrap .ac-filter { flex-wrap:nowrap; max-width:100%; overflow-x:auto; padding:4px 2px 10px; box-sizing:border-box; }
    .ac-wrap .ac-chip { flex-shrink:0; min-height:44px; }
    .ac-wrap .ac-table { min-width:0; display:block; }
    .ac-wrap .ac-table thead { display:none; }
    .ac-wrap .ac-table tbody { display:block; }
    .ac-wrap .ac-table .ac-contact-row { display:grid; grid-template-columns:minmax(0,1fr) auto; background:var(--panel-bg); border:1px solid var(--panel-border); border-radius:10px; margin-bottom:10px; padding:12px; gap:12px; }
    .ac-wrap .ac-table .ac-contact-row td { display:block; border:0; padding:0; width:auto; background:transparent; box-shadow:none; border-radius:0; }
    .ac-wrap .ac-contact-row td:first-child { grid-column:1 / -1; }
    .ac-wrap .ac-contact-row td:nth-child(3) { grid-row:3; grid-column:1 / -1; font-size:13px; }
    .ac-wrap .ac-contact-row td:nth-child(4) { grid-row:4; grid-column:1 / -1; }
    .ac-wrap .ac-contact-row td.ac-col-actions { grid-column:2; grid-row:2; position:static; white-space:normal; }
    .ac-wrap .ac-contact-row .ac-icon-btn { min-height:44px; min-width:44px; }
    .ac-wrap .ac-group-head, .ac-wrap .ac-group-head td { display:block; width:auto; margin:0 0 8px; }
    .ac-card-identity { padding:24px 20px 20px; gap:16px; }
    .ac-avatar-large { width:68px; height:68px; flex-basis:68px; }
    .ac-card-name h3 { font-size:23px; }
    .ac-card-brand, .ac-card-channels { margin-left:20px; margin-right:20px; }
    .ac-card-channels { grid-template-columns:minmax(0,1fr); }
    .ac-card-section { margin:0 20px; }
    .ac-card-top, .ac-card-footer { padding-left:20px; padding-right:20px; }
    .ac-company-dialog { padding:20px; }
    .ac-company-dialog .ac-form-grid { grid-template-columns:minmax(0,1fr); }
}
#ac-modal.modal-overlay { z-index: 1100; backdrop-filter: blur(6px); }
#ac-modal .modal-content { max-width: 960px; max-height: 90vh; overflow-y: auto; padding: 24px; }
.ac-wrap { display:flex; flex-direction:column; gap:14px; }
.ac-toolbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.ac-search-wrap { position:relative; flex:1; min-width:230px; }
.ac-search-wrap svg { position:absolute; left:10px; top:50%; transform:translateY(-50%); color:var(--text-muted); pointer-events:none; }
.ac-search { width:100%; box-sizing:border-box; padding:8px 10px 8px 33px; border:1px solid var(--panel-border); border-radius:8px; background:var(--input-bg); color:var(--text-main); font-size:13px; outline:none; }
.ac-search:focus { border-color:var(--brand-accent); }
.ac-filter { display:inline-flex; gap:6px; flex-wrap:wrap; }
.ac-chip { border:1px solid var(--panel-border); border-radius:999px; padding:5px 10px; font-size:11px; color:var(--text-muted); cursor:pointer; background:var(--panel-bg); }
.ac-chip.active { color:var(--brand-accent); border-color:var(--brand-accent); background:rgba(102,157,36,.08); }
.ac-count { margin-left:auto; font-size:11px; color:var(--text-muted); white-space:nowrap; }
.ac-table-wrap { overflow-x:auto; }
.ac-table { width:100%; border-collapse:separate; border-spacing:0 8px; table-layout:fixed; }
.ac-table th:nth-child(1), .ac-table td:nth-child(1) { width:19%; }
.ac-table th:nth-child(2), .ac-table td:nth-child(2) { width:16%; }
.ac-table th:nth-child(3), .ac-table td:nth-child(3) { width:27%; }
.ac-table th:nth-child(4), .ac-table td:nth-child(4) { width:22%; }
.ac-table th.ac-col-actions, .ac-table td.ac-col-actions { width:16%; }
.ac-table th { padding:11px 14px; color:var(--text-muted); font-size:11px; text-transform:uppercase; letter-spacing:.7px; }
.ac-table td { background:var(--panel-bg); padding:14px; border-top:1px solid var(--panel-border); border-bottom:1px solid var(--panel-border); vertical-align:middle; overflow-wrap:anywhere; }
.ac-table td:first-child { border-left:1px solid var(--panel-border); border-radius:8px 0 0 8px; }
.ac-table td:last-child  { border-right:1px solid var(--panel-border); border-radius:0 8px 8px 0; text-align:right; white-space:nowrap; }
.ac-table td.ac-col-actions, .ac-table th.ac-col-actions {
    position: sticky; right: 0;
    background: var(--panel-bg);
    box-shadow: -6px 0 8px -6px rgba(0,0,0,0.35);
}
html[data-theme="light"] .ac-table td.ac-col-actions { box-shadow: -6px 0 8px -6px rgba(0,0,0,0.12); }
.ac-table th.ac-col-actions { background: var(--bg-dark); box-shadow: none; }
.ac-muted { color:var(--text-muted); font-size:11px; }
.ac-linked { display:inline-flex; align-items:center; gap:6px; font-size:11px; border:1px solid rgba(102,157,36,.35); color:var(--brand-accent); background:rgba(102,157,36,.08); border-radius:999px; padding:2px 8px; }
.ac-badge { display:inline-flex; align-items:center; border:1px solid var(--panel-border); border-radius:999px; padding:2px 8px; font-size:10px; text-transform:uppercase; letter-spacing:.5px; color:var(--text-muted); }
.ac-badge.kontakt { color:#8fb269; border-color:rgba(143,178,105,.35); background:rgba(143,178,105,.09); }
.ac-badge.interessent { color:#6B8CAE; border-color:rgba(107,140,174,.35); background:rgba(107,140,174,.10); }
.ac-badge.vertriebler { color:#C5A47E; border-color:rgba(197,164,126,.35); background:rgba(197,164,126,.10); }
.ac-badge.kunde { color:#d6975a; border-color:rgba(214,151,90,.35); background:rgba(214,151,90,.10); }
.ac-badge.mitarbeiter { color:#5aa7a0; border-color:rgba(90,167,160,.35); background:rgba(90,167,160,.10); }
.ac-badge.bewerber { color:#d9739f; border-color:rgba(217,115,159,.35); background:rgba(217,115,159,.10); }
.ac-badge.dienstleister { color:#7f9ad9; border-color:rgba(127,154,217,.35); background:rgba(127,154,217,.10); }
.ac-badge.lieferant { color:#8f7fd9; border-color:rgba(143,127,217,.35); background:rgba(143,127,217,.10); }
.ac-badge.persoenlich { color:#9ba35c; border-color:rgba(155,163,92,.35); background:rgba(155,163,92,.10); }
.ac-badge.benutzerkonto { color:#b37fdb; border-color:rgba(179,127,219,.35); background:rgba(179,127,219,.10); }
.ac-icon-btn { background:none; border:1px solid var(--panel-border); color:var(--text-muted); border-radius:7px; padding:5px 8px; cursor:pointer; transition:.12s; }
.ac-icon-btn:hover { color:var(--brand-accent); border-color:var(--brand-accent); }
.ac-icon-btn.danger:hover { color:var(--danger-red); border-color:var(--danger-red); }
.ac-project-link { background:none; border:none; color:var(--brand-accent); text-decoration:underline; cursor:pointer; padding:0; font-size:11px; }
.ac-empty { text-align:center; color:var(--text-muted); padding:24px 8px; border:1px dashed var(--panel-border); border-radius:10px; }
.ac-group-head td { background:rgba(197,164,126,.06) !important; border:1px dashed rgba(197,164,126,.4) !important; border-radius:8px !important; padding:8px 14px !important; }
.ac-group-head-inner { display:flex; align-items:center; gap:7px; font-size:11px; font-weight:600; color:var(--brand-accent); text-transform:uppercase; letter-spacing:.5px; }

/* Duplikate-Werkzeug (Personenverwaltung, "Duplikate"-Tab + Anlege-Modal-Warnung) */
.ac-chip-dup { display:inline-flex; align-items:center; gap:6px; }
.ac-dup-badge { display:inline-flex; align-items:center; justify-content:center; min-width:16px; height:16px; padding:0 4px; border-radius:999px; background:var(--danger-red); color:#fff; font-size:10px; font-weight:700; line-height:16px; }
.ac-dup-panel { display:flex; flex-direction:column; gap:14px; }
.ac-dup-banner { display:flex; align-items:flex-start; gap:10px; padding:11px 14px; border-radius:10px; border:1px solid var(--panel-border); background:var(--panel-bg); font-size:12px; color:var(--text-muted); line-height:1.5; }
.ac-dup-banner svg { flex:0 0 auto; margin-top:2px; color:var(--brand-accent); }
.ac-dup-group { border:1px solid rgba(255,193,7,.35); background:rgba(255,193,7,.05); border-radius:10px; padding:14px 16px; }
.ac-dup-group-head { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-bottom:10px; }
.ac-dup-group-count { font-size:11px; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:.4px; margin-right:4px; }
.ac-dup-reason { display:inline-flex; align-items:center; border-radius:999px; padding:2px 9px; font-size:10px; font-weight:600; color:#a07820; border:1px solid rgba(160,120,32,.35); background:rgba(160,120,32,.1); }
.ac-dup-members { display:flex; flex-direction:column; gap:8px; }
.ac-dup-member { display:flex; align-items:flex-start; gap:10px; padding:9px 10px; border:1px solid var(--panel-border); border-radius:8px; background:var(--panel-bg); cursor:pointer; }
.ac-dup-member.is-keep { border-color:var(--brand-accent); background:color-mix(in srgb, var(--brand-accent) 8%, var(--panel-bg)); }
.ac-dup-member input[type="radio"] { flex:0 0 auto; width:16px; height:16px; margin:4px 0 0 0; padding:0; accent-color: var(--brand-accent); }
.ac-dup-member-info { flex:1 1 auto; min-width:0; font-size:12px; color:var(--text-main); line-height:1.5; }
.ac-dup-member-name { display:flex; align-items:center; gap:8px; }
.ac-dup-member-tag { flex:0 0 auto; align-self:center; font-size:10px; font-weight:700; color:var(--brand-accent); border:1px solid var(--brand-accent); border-radius:999px; padding:3px 9px; text-transform:uppercase; letter-spacing:.3px; }
.ac-dup-member.is-partner-source { border-color:#a07820; background:rgba(255,193,7,.08); }
.ac-dup-member-partner { display:flex; align-items:center; gap:6px; flex:0 0 auto; align-self:center; font-size:10.5px; font-weight:600; color:var(--text-muted); border:1px solid var(--panel-border); border-radius:999px; padding:4px 10px 4px 8px; cursor:pointer; white-space:nowrap; }
.ac-dup-member-partner:hover { border-color:color-mix(in srgb, #a07820 55%, var(--panel-border)); }
.ac-dup-member-partner input[type="radio"] { flex:0 0 auto; width:14px; height:14px; margin:0; padding:0; accent-color:#a07820; }
.ac-dup-member-partner.is-partner { border-color:#a07820; color:var(--text-main); background:rgba(255,193,7,.14); }
.ac-dup-partner-hint { margin-top:10px; padding:8px 12px; border-radius:8px; border:1px solid rgba(255,193,7,.35); background:rgba(255,193,7,.06); font-size:11.5px; color:var(--text-muted); line-height:1.5; }
.ac-dup-block-hint { margin-top:10px; padding:8px 12px; border-radius:8px; border:1px solid rgba(220,53,69,.4); background:rgba(220,53,69,.08); font-size:11.5px; color:var(--danger-red); line-height:1.5; font-weight:600; }
.ac-dup-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:12px; }
.ac-dup-warning { margin-top:14px; padding:9px 12px; border-radius:8px; border:1px solid rgba(255,193,7,.4); background:rgba(255,193,7,.08); }
.ac-dup-warning-title { display:flex; align-items:center; gap:7px; font-size:12px; font-weight:600; color:#a07820; margin-bottom:6px; }
.ac-dup-candidate { display:flex; flex-direction:column; gap:2px; padding:6px 0; border-top:1px solid rgba(255,193,7,.2); font-size:11px; color:var(--text-main); }
.ac-dup-candidate:first-of-type { border-top:none; }
.ac-dup-candidate-reasons { color:#a07820; font-size:10px; }

.ac-merge-review-content { max-width:660px; padding:26px; max-height:88vh; overflow-y:auto; box-sizing:border-box; }
.ac-merge-review-title { display:flex; align-items:center; gap:9px; margin:0 0 8px; color:var(--accent-gold); font-size:18px; font-weight:600; }
.ac-merge-review-intro { margin:0 0 16px; font-size:12.5px; color:var(--text-muted); line-height:1.55; }
#ac-merge-review-fields { display:flex; flex-direction:column; max-height:52vh; overflow-y:auto; padding:0 12px 0 0; margin-right:-12px; }
.ac-merge-review-field { padding:14px 0; border-bottom:1px solid var(--panel-border); }
.ac-merge-review-field:first-child { padding-top:0; }
.ac-merge-review-field:last-child { border-bottom:none; padding-bottom:0; }
.ac-merge-review-field-label { font-size:10.5px; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:.6px; margin-bottom:10px; }
.ac-merge-review-options { display:flex; flex-wrap:wrap; gap:8px; }
.ac-merge-review-option {
    flex:1 1 220px; display:flex; align-items:flex-start; gap:9px; cursor:pointer;
    border:1px solid var(--panel-border); border-radius:9px; padding:10px 12px;
    background:var(--input-bg); transition:border-color .15s, background .15s;
}
.ac-merge-review-option:hover { border-color:color-mix(in srgb, var(--brand-accent) 55%, var(--panel-border)); }
.ac-merge-review-option:has(input:checked) { border-color:var(--brand-accent); background:color-mix(in srgb, var(--brand-accent) 14%, var(--panel-bg)); }
.ac-merge-review-option input[type="radio"] { flex:0 0 auto; width:15px; height:15px; margin:2px 0 0 0; padding:0; accent-color:var(--brand-accent); }
.ac-merge-review-option-body { display:flex; flex-direction:column; gap:4px; min-width:0; }
.ac-merge-review-option-value { font-size:13px; font-weight:600; color:var(--text-main); word-break:break-word; }
.ac-merge-review-option-source { display:flex; align-items:center; gap:6px; flex-wrap:wrap; font-size:11px; color:var(--text-muted); }
.ac-merge-review-option-tag {
    display:none; font-size:9.5px; font-weight:700; text-transform:uppercase; letter-spacing:.3px; color:var(--brand-accent);
    background:color-mix(in srgb, var(--brand-accent) 16%, transparent); border-radius:20px; padding:1px 7px; white-space:nowrap;
}
.ac-merge-review-option:has(input:checked) .ac-merge-review-option-tag-default { display:inline-flex; }
/* Sobald "Beide behalten" aktiv ist, ersetzen die privat/geschäftlich-Tags den generischen
   Standard-Tag und zeigen live an, welche Angabe welche Rolle bekommt (siehe acMergeGroup). */
.ac-merge-review-field:has(.ac-merge-review-both input:checked) .ac-merge-review-option-tag-default { display:none; }
.ac-merge-review-field:has(.ac-merge-review-both input:checked) .ac-merge-review-option:has(input:checked) .ac-merge-review-option-tag-private { display:inline-flex; }
.ac-merge-review-field:has(.ac-merge-review-both input:checked) .ac-merge-review-option:not(:has(input:checked)) .ac-merge-review-option-tag-business { display:inline-flex; }
.ac-merge-review-option-tag-business { color:#a07820; background:rgba(255,193,7,.16); }
.ac-merge-review-both {
    display:flex; align-items:flex-start; gap:8px; cursor:pointer; margin-top:9px;
    padding:8px 10px; border-radius:8px; border:1px dashed var(--panel-border);
    font-size:11.5px; color:var(--text-muted); line-height:1.4;
}
.ac-merge-review-both:hover { border-color:color-mix(in srgb, var(--brand-accent) 55%, var(--panel-border)); }
.ac-merge-review-both input[type="checkbox"] { flex:0 0 auto; width:15px; height:15px; margin:1px 0 0 0; accent-color:var(--brand-accent); }
.ac-merge-review-both:has(input:checked) { border-style:solid; border-color:var(--brand-accent); color:var(--text-main); background:color-mix(in srgb, var(--brand-accent) 8%, transparent); }
.ac-merge-review-content .ac-form-actions { margin-top:20px; padding-top:16px; border-top:1px solid var(--panel-border); }

/* Privat/Geschäftlich-Umschaltfelder im Kontakt-Formular (E-Mail, Telefon, Handy, Anschrift) –
   analog zu den bw-field-kind-Klassen im Bewerber-Modul, siehe acFieldSetKind/acAddressSetKind. */
.ac-field-kind { display:flex; flex-direction:column; gap:6px; }
.ac-field-kind-toggle { display:inline-flex; gap:2px; background:var(--input-bg); border:1px solid var(--panel-border); border-radius:8px; padding:2px; width:max-content; }
.ac-field-kind-btn {
    border:none; background:transparent; color:var(--text-muted); font-size:10.5px; font-weight:600;
    text-transform:uppercase; letter-spacing:.3px; padding:4px 10px; border-radius:6px; cursor:pointer; transition:background .15s, color .15s;
}
.ac-field-kind-btn:hover { color:var(--text-main); }
.ac-field-kind-btn.is-active { background:var(--brand-accent); color:#fff; }

/* ── 5.x Kalkulation (admin_kalkulation.php, Präfix kalk-) ──────────────── */
.kalk-page { padding: 28px 32px; }
.kalk-page-title { font-size: 22px; font-weight: 500; color: var(--text-main); margin: 0 0 22px; }

/* Tabs 1:1 wie im Lead-Controlling (.lc-tabs/.lc-tab-btn/.lc-tabs-indicator) übernommen, nur
   kalk-präfigiert und mit --brand-accent statt --accent-gold als Akzentfarbe. */
.kalk-tabs { margin-bottom: 20px; }


.kalk-toolbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:16px; }
.kalk-search-wrap { position:relative; flex:1; min-width:230px; max-width:340px; }
.kalk-search-wrap svg { position:absolute; left:10px; top:50%; transform:translateY(-50%); color:var(--text-muted); pointer-events:none; }
.kalk-search { width:100%; box-sizing:border-box; min-height:44px; padding:8px 10px 8px 33px; border:1px solid var(--panel-border); border-radius:8px; background:var(--input-bg); color:var(--text-main); font-size:14px; outline:none; transition:border-color .15s; }
.kalk-search:focus { border-color:var(--brand-accent); }
.kalk-count { margin-left:auto; font-size:12px; color:var(--text-muted); white-space:nowrap; }

.kalk-table-wrap { overflow-x:auto; border-radius:12px; scrollbar-width:thin; scrollbar-color:var(--brand-accent) var(--panel-border); overscroll-behavior-x:contain; }
.kalk-table-wrap::-webkit-scrollbar { height:10px; }
.kalk-table-wrap::-webkit-scrollbar-thumb { background:var(--brand-accent); border-radius:999px; }
.kalk-table-wrap::-webkit-scrollbar-track { background:var(--panel-border); border-radius:999px; }
.kalk-scroll-hint { margin:0 0 8px; padding:8px 12px; border:1px solid color-mix(in srgb, var(--brand-accent) 32%, var(--panel-border)); border-radius:8px; background:color-mix(in srgb, var(--brand-accent) 8%, var(--panel-bg)); color:var(--text-main); font-size:12px; line-height:1.4; }
.kalk-scroll-hint[hidden] { display:none !important; }
.kalk-table { width:100%; border-collapse:separate; border-spacing:0 8px; font-size:14px; }
.kalk-table thead th { position:sticky; top:0; z-index:6; background:var(--bg-dark); text-align:left; font-size:12px; line-height:1.35; text-transform:uppercase; letter-spacing:.5px; color:var(--text-muted); padding:9px 12px 10px; font-weight:700; }
.kalk-table tbody tr.kalk-row { background:var(--panel-bg); border:1px solid var(--panel-border); cursor:pointer; transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.kalk-table tbody tr.kalk-row:hover { border-color:var(--brand-accent); transform:translateY(-1px); box-shadow:0 6px 18px rgba(0,0,0,.18); }
.kalk-table tbody tr.kalk-row:focus-visible { outline:2px solid var(--brand-accent); outline-offset:2px; }
.kalk-table td { padding:10px 12px; white-space:nowrap; }
.kalk-table td:first-child { border-left:1px solid var(--panel-border); border-radius:10px 0 0 10px; font-weight:600; color:var(--text-main); }
.kalk-table td:last-child { border-right:1px solid var(--panel-border); border-radius:0 10px 10px 0; }
.kalk-table td.kalk-actions-cell { white-space:nowrap; }
.kalk-empty { text-align:center; color:var(--text-muted); padding:24px 8px; }

.kalk-badge { display:inline-flex; align-items:center; border:1px solid var(--panel-border); border-radius:999px; padding:4px 10px; font-size:12px; text-transform:uppercase; letter-spacing:.4px; color:var(--text-muted); }
.kalk-badge-offen { color:#e97b24; border-color:rgba(233,123,36,.35); background:rgba(233,123,36,.1); }
.kalk-badge-progress { color:#3b82f6; border-color:rgba(59,130,246,.35); background:rgba(59,130,246,.1); }
.kalk-badge-done { color:#00C851; border-color:rgba(0,200,81,.35); background:rgba(0,200,81,.1); }
.kalk-dot-new { display:inline-block; width:7px; height:7px; border-radius:50%; background:var(--danger-red); margin-left:4px; vertical-align:middle; }

/* ── Detail-Modal ────────────────────────────────────────────────────── */
.kalk-modal .kalk-modal-content { max-width: 640px; width:92vw; max-height:88vh; overflow-y:auto; position:relative; padding: 28px; }
.kalk-modal-close { position:absolute; top:12px; right:12px; width:44px; height:44px; display:inline-flex; align-items:center; justify-content:center; background:none; border:1px solid transparent; border-radius:8px; color:var(--text-muted); cursor:pointer; }
.kalk-modal-close:hover { color:var(--text-main); }
.kalk-detail-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:18px; padding-right:42px; }
.kalk-detail-title { font-size:20px; line-height:1.3; font-weight:650; color:var(--text-main); }
.kalk-detail-sub { font-size:13px; line-height:1.5; color:var(--text-muted); margin-top:4px; }
.kalk-detail-section { margin-bottom:20px; }
.kalk-detail-section-title { font-size:13px; line-height:1.4; text-transform:uppercase; letter-spacing:.4px; color:var(--text-muted); font-weight:700; margin-bottom:8px; }
.kalk-contact { border:1px solid var(--panel-border); border-radius:8px; padding:10px 12px; margin-bottom:8px; }
.kalk-contact-name { font-size:14px; font-weight:600; color:var(--text-main); }
.kalk-contact-primary { font-size:11px; text-transform:uppercase; color:var(--brand-accent); border:1px solid var(--brand-accent); border-radius:999px; padding:2px 7px; margin-left:6px; }
.kalk-contact-line { font-size:13px; line-height:1.5; color:var(--text-muted); margin-top:3px; }
.kalk-contact-line a { color:var(--brand-accent); }

.kalk-doc-list { display:flex; flex-direction:column; gap:6px; margin-bottom:10px; }
.kalk-doc-row { display:flex; align-items:center; gap:8px; border:1px solid var(--panel-border); border-radius:8px; padding:7px 10px; font-size:14px; }
.kalk-doc-row a { color:var(--brand-accent); text-decoration:underline; flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.kalk-doc-type { font-size:12px; text-transform:uppercase; color:var(--text-muted); border:1px solid var(--panel-border); border-radius:999px; padding:3px 7px; }
.kalk-doc-del { min-width:44px; min-height:44px; display:inline-flex; align-items:center; justify-content:center; background:none; border:none; color:var(--text-muted); cursor:pointer; padding:2px; }
.kalk-doc-del:hover { color:var(--danger-red); }

.kalk-upload-zone { display:flex; align-items:center; gap:10px; border:2px dashed var(--panel-border); border-radius:10px; padding:16px; color:var(--text-muted); font-size:14px; transition:.15s; }
.kalk-upload-zone.is-drag { border-color:var(--brand-accent); color:var(--brand-accent); background:rgba(102,157,36,.06); }
.kalk-upload-link { color:var(--brand-accent); text-decoration:underline; cursor:pointer; }

/* Admin-Migrations-Upload für Angebotscheckliste/Pläne einer Alt-Kalkulationsrunde (Nutzerwunsch:
   auch bei bereits nicht mehr offenen Runden nachtragbar, siehe admin_kalkulation.php renderTaskDetail). */
.kalk-hidden-file-input { display:none; }
.kalk-admin-migration-row { margin-top:8px; font-size:12px; }

.kalk-price-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(160px, 220px)); gap:12px; margin-bottom:10px; }
.kalk-price-grid > div { border:1px solid var(--panel-border); border-radius:8px; padding:10px 12px; text-align:center; }
.kalk-price-grid span { display:block; font-size:12px; color:var(--text-muted); text-transform:uppercase; letter-spacing:.4px; margin-bottom:4px; }
.kalk-price-grid strong { font-size:15px; color:var(--text-main); }
.kalk-notes { font-size:14px; line-height:1.55; color:var(--text-main); background:var(--bg-dark); border-radius:8px; padding:10px 12px; margin-bottom:8px; }

.kalk-form-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(160px, 220px)); gap:12px; margin-bottom:10px; }
.kalk-form-grid label, .kalk-notes-label { display:flex; flex-direction:column; gap:6px; font-size:13px; line-height:1.4; color:var(--text-muted); }
.kalk-form-grid input, .kalk-notes-label textarea { min-height:44px; box-sizing:border-box; border:1px solid var(--panel-border); border-radius:8px; background:var(--input-bg); color:var(--text-main); padding:9px 11px; font-size:14px; outline:none; font-family:inherit; resize:vertical; }
.kalk-form-grid input:focus, .kalk-notes-label textarea:focus { border-color:var(--brand-accent); }
.kalk-modal :is(button, input, select, textarea, a, [tabindex]):focus-visible,
.kalk-page :is(button, input, select, textarea, a, [tabindex]):focus-visible { outline:2px solid var(--brand-accent); outline-offset:2px; }

.kalk-prev-calc-list { display:flex; flex-direction:column; gap:6px; }
.kalk-prev-calc-row { display:flex; align-items:center; gap:12px; border:1px solid var(--panel-border); border-radius:8px; padding:8px 12px; font-size:14px; color:var(--text-main); }
.kalk-prev-calc-row span:nth-child(2) { color:var(--text-muted); flex:1; }
.kalk-prev-calc-row span:nth-child(3) { font-weight:600; }
/* Parallelanfrage (Nutzerwunsch: Interessent z.B. unentschlossen zwischen Bungalow/normalem Haus -
   zwei gleichzeitig laufende Kalkulationsrunden desselben Leads), siehe parallelSiblings in
   renderTaskDetail() sowie kalkClusterParallel()/kalk-parallel-* weiter unten - eigene Akzentfarbe
   (Violett), damit sie klar von Status-Farben (offen/in Bearbeitung/abgeschlossen/abgelehnt) sowie
   von überfällig/wird-knapp (Rot/Orange) unterscheidbar bleibt. */
.kalk-prev-calc-row-parallel { border-color:rgba(139,92,246,.4); background:rgba(139,92,246,.07); }
.kalk-link-btn { min-height:44px; border:none; background:none; color:var(--brand-accent); font-size:14px; font-weight:600; cursor:pointer; padding:0 6px; font-family:inherit; }
.kalk-link-btn:hover { text-decoration:underline; }

.kalk-detail-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:14px; }
.kalk-planning-actions { margin-top:8px; }
.kalk-modal #kalk-modal-body > .kalk-sticky-actions:last-child {
    position:sticky; bottom:-28px; z-index:5; margin:18px -28px -28px; padding:14px 28px 18px;
    border-top:1px solid var(--panel-border); background:var(--panel-bg);
    box-shadow:0 -8px 18px rgba(0,0,0,.12);
}
.kalk-btn { min-height:44px; border:none; border-radius:8px; padding:10px 18px; font-size:14px; font-weight:600; cursor:pointer; transition:filter .15s, transform .12s; }
.kalk-btn:hover { transform:translateY(-1px); }
.kalk-btn-primary { background:var(--brand-accent); color:var(--btn-text); }
.kalk-btn-outline { background:none; border:1px solid var(--brand-accent); color:var(--text-main); }
.kalk-btn-success { background:#00C851; color:#06351c; }
.kalk-btn-warn { background:#e97b24; color:#3b1a00; }
.kalk-btn-primary:hover, .kalk-btn-success:hover, .kalk-btn-warn:hover { filter:brightness(1.1); }
.kalk-btn-danger { background:var(--danger-red); color:#380909; }
.kalk-btn-danger:hover { filter:brightness(1.1); }

/* ── Kombinierte Aufgabenliste: von Verkäufern übergebene Kalkulationen UND eigene, selbst
   angelegte Aufgaben werden in EINER Tabelle dargestellt (Nutzerwunsch); die Titel-Spalte
   zeigt "Übergabe" bzw. den eigenen Aufgabentitel. Fälligkeits-Dringlichkeit (überfällig/
   wird knapp) gilt für beide Zeilentypen. */
.kalk-table tbody tr.kalk-combined-row.is-overdue td:first-child { border-left:3px solid var(--danger-red); padding-left:12px; }
.kalk-table tbody tr.kalk-combined-row.is-overdue { background:rgba(255,68,68,.07); }
.kalk-table tbody tr.kalk-combined-row.is-due-soon td:first-child { border-left:3px solid #e97b24; padding-left:12px; }
.kalk-table tbody tr.kalk-combined-row.is-due-soon { background:rgba(233,123,36,.07); }
.kalk-own-due { display:inline-flex; align-items:center; gap:5px; }
.kalk-own-due.is-overdue { color:var(--danger-red); font-weight:600; }
.kalk-own-due.is-due-soon { color:#e97b24; font-weight:600; }
.kalk-own-lead-chip { font-size:13px; color:var(--text-muted); }

.kalk-icon-btn { width:44px; height:44px; flex:0 0 44px; align-items:center; justify-content:center; background:none; border:1px solid var(--panel-border); color:var(--text-muted); border-radius:8px; padding:5px; cursor:pointer; display:inline-flex; transition:.15s; }
.kalk-icon-btn:hover { border-color:var(--brand-accent); color:var(--brand-accent); }
.kalk-icon-btn.success:hover { border-color:#00C851; color:#00C851; }
.kalk-icon-btn.danger:hover { border-color:var(--danger-red); color:var(--danger-red); }

@media (min-width:768px) and (max-width:1440px) {
    .kalk-table thead th:first-child,
    .kalk-table thead th:last-child { z-index:8; }
    .kalk-table thead th:first-child { position:sticky; left:0; }
    .kalk-table thead th:last-child { position:sticky; right:0; }
    .kalk-table tbody tr.kalk-combined-row td:first-child {
        position:sticky; left:0; z-index:3; background:var(--panel-bg);
        box-shadow:4px 0 10px rgba(0,0,0,.12);
    }
    .kalk-table tbody tr.kalk-combined-row td:last-child {
        position:sticky; right:0; z-index:3; background:var(--panel-bg);
        box-shadow:-4px 0 10px rgba(0,0,0,.12);
    }
    .kalk-table tbody tr.kalk-combined-row.is-overdue td:first-child,
    .kalk-table tbody tr.kalk-combined-row.is-overdue td:last-child { background:rgba(255,68,68,.07); }
    .kalk-table tbody tr.kalk-combined-row.is-due-soon td:first-child,
    .kalk-table tbody tr.kalk-combined-row.is-due-soon td:last-child { background:rgba(233,123,36,.07); }
}

.kalk-own-modal-content { max-width:560px; }
.kalk-form-grid label.span-2, .kalk-notes-label.span-2 { grid-column:1 / -1; }
.kalk-own-lead-field { position:relative; }
.kalk-own-lead-search-wrap { position:relative; }
.kalk-own-lead-results { position:absolute; top:calc(100% + 4px); left:0; right:0; max-height:220px; overflow-y:auto; background:var(--panel-bg); border:1px solid var(--panel-border); border-radius:8px; box-shadow:0 8px 24px rgba(0,0,0,.28); z-index:20; display:none; }
.kalk-own-lead-results.is-open { display:block; }
.kalk-own-lead-result { min-height:44px; padding:10px 12px; font-size:14px; cursor:pointer; border-bottom:1px solid var(--panel-border); }
.kalk-own-lead-result:last-child { border-bottom:none; }
.kalk-own-lead-result:hover { background:rgba(255,255,255,.06); }
.kalk-own-lead-result-name { font-weight:600; color:var(--text-main); }
.kalk-own-lead-result-sub { font-size:12px; color:var(--text-muted); margin-top:2px; }
.kalk-own-lead-selected { display:flex; align-items:center; justify-content:space-between; gap:8px; border:1px solid var(--brand-accent); border-radius:8px; padding:8px 12px; font-size:12.5px; color:var(--text-main); background:color-mix(in srgb, var(--brand-accent) 10%, transparent); }
.kalk-own-lead-clear { min-width:44px; min-height:44px; align-items:center; justify-content:center; background:none; border:none; color:var(--text-muted); cursor:pointer; padding:2px; display:flex; }
.kalk-own-lead-clear:hover { color:var(--danger-red); }

/* ── "Zuweisen"-Auswahlpopover im Rechtsklickmenü (Nutzerwunsch: "Eine Aufgabe muss einem anderen
   Benutzer aus der Kalkulation zugewiesen werden können."), siehe kalkOpenAssignPopover() –
   position:fixed wie .lc-ctx-menu, da mit Bildschirmkoordinaten statt scrollX/scrollY positioniert. ── */
.kalk-assign-pop { position:fixed; z-index:2000; width:260px; max-width:calc(100vw - 16px); padding:10px; display:none; }
.kalk-assign-pop.is-open { display:block; }
.kalk-assign-pop input { width:100%; margin-bottom:8px; }
.kalk-assign-results { max-height:220px; overflow-y:auto; display:flex; flex-direction:column; gap:2px; }
.kalk-assign-result { padding:8px 9px; border-radius:8px; cursor:pointer; font-size:12.5px; color:var(--text-main); transition:background .12s ease; }
.kalk-assign-result:hover { background:color-mix(in srgb, var(--brand-accent) 14%, transparent); }
.kalk-assign-empty { padding:10px 4px; font-size:12px; color:var(--text-muted); text-align:center; }

/* ── Statistik-Tab: Durchlaufzeiten & Kennzahlen. Zeitraum-Auswahl 1:1 wie im Lead-Controlling
   (dort lc-qrange/lc-qr-btn/lc-ts-header/lc-date-sel/lc-stat-*), hier kalk-präfigiert und mit
   --brand-accent statt --accent-gold (siehe Kalkulation-CSS-Konvention). ── */
.kalk-stats-panel { margin-top:4px; }
.kalk-qrange { display:flex; gap:4px; flex-wrap:wrap; }
.kalk-qr-btn { background:none; border:1px solid var(--panel-border); border-radius:6px; padding:4px 10px; font-size:11px; color:var(--text-muted); cursor:pointer; transition:.12s; white-space:nowrap; font-family:inherit; }
.kalk-qr-btn:hover { border-color:var(--brand-accent); color:var(--brand-accent); }
.kalk-qr-btn.active { background:var(--brand-accent); color:#fff; border-color:var(--brand-accent); }
.kalk-ts-header { border:1px solid var(--panel-border); border-radius:12px; padding:14px 16px; margin-bottom:16px;
                  position:sticky; top:-30px; z-index:40;
                  backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px);
                  background:color-mix(in srgb, var(--panel-bg) 80%, transparent);
                  transition:box-shadow .2s ease, border-radius .2s ease; }
.kalk-ts-header.kalk-stuck { box-shadow:0 4px 22px rgba(0,0,0,.55); border-radius:0 0 12px 12px; }
.kalk-date-row { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.kalk-date-sel { background:rgba(0,0,0,.2); border:1px solid var(--panel-border); border-radius:8px; padding:6px 10px; color:var(--text-main); font-size:12px; outline:none; font-family:inherit; }
.kalk-date-sel:focus { border-color:var(--brand-accent); }
.kalk-stat-sub { font-size:11px; color:var(--text-muted); }

.kalk-kpi-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:10px; margin-bottom:18px; }
.kalk-stat-card { background:var(--panel-bg); border:1px solid var(--panel-border); border-radius:10px; padding:14px 16px; }
.kalk-stat-num { font-size:clamp(20px,1.6vw,28px); font-weight:700; color:var(--brand-accent); line-height:1.1; word-break:break-word; }
.kalk-stat-label { font-size:11px; color:var(--text-muted); margin-top:4px; }

.kalk-chart-wrap { background:var(--panel-bg); border:1px solid var(--panel-border); border-radius:12px; padding:16px; margin-bottom:16px; }
.kalk-chart-title { font-size:12px; font-weight:600; color:var(--text-main); margin-bottom:12px; }
.kalk-chart-box { position:relative; height:260px; }
.kalk-chartjs { animation:kalkChartReveal .45s ease; }
@keyframes kalkChartReveal { from { opacity:0; transform:translateY(5px); } to { opacity:1; transform:translateY(0); } }
.ac-group-head-inner svg { flex-shrink:0; }
.ac-row-compact td { padding:8px 14px !important; }
.ac-row-compact td:first-child { border-left-color:rgba(197,164,126,.4) !important; border-left-width:2px !important; }
.ac-badge-primary { display:inline-flex; align-items:center; font-size:9px; text-transform:uppercase; letter-spacing:.5px; color:var(--brand-accent); border:1px solid rgba(197,164,126,.4); background:rgba(197,164,126,.08); border-radius:999px; padding:1px 7px; margin-left:6px; }
.ac-badge-secondary { display:inline-flex; align-items:center; font-size:9px; text-transform:uppercase; letter-spacing:.5px; color:var(--text-muted); border:1px solid var(--panel-border); border-radius:999px; padding:1px 7px; margin-left:6px; }
.ac-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 14px; }
.ac-field { display:flex; flex-direction:column; gap:5px; }
.ac-field label { font-size:10px; font-weight:700; letter-spacing:.6px; text-transform:uppercase; color:var(--text-muted); }
.ac-field input,.ac-field select,.ac-field textarea { width:100%; box-sizing:border-box; border:1px solid var(--panel-border); border-radius:8px; padding:9px 10px; background:var(--input-bg); color:var(--text-main); font-size:13px; }
.ac-field textarea { min-height:90px; resize:vertical; }
.ac-field.full { grid-column:1 / -1; }
.ac-field-hint { font-size:11px; color:var(--text-muted); }
.ac-split { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.ac-box { padding:10px; border:1px solid var(--panel-border); border-radius:10px; background:rgba(255,255,255,.02); }
.ac-form-actions { margin-top:14px; display:flex; justify-content:flex-end; gap:8px; }
@media (max-width: 767px) {
    .ac-form-grid, .ac-split { grid-template-columns:1fr; }
    .ac-table { min-width:760px; }
}

/* -- Lead-Controlling / Fachberater-Dashboard + Kanban (html/modules/lead_controlling.php) --
   Neue Klassen (lc-dash-*, lc-kanban-*) für das Fachberater-Dashboard und das Kanban-Board im
   Leads-Tab. Das übrige, bestehende CSS des Moduls lebt weiterhin in dessen eigenem <style>-Block
   (noch nicht migriert, siehe css-konventionen); dieser Abschnitt betrifft nur die neuen Teile. */
.lc-dash-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(190px, 1fr)); gap:14px; margin-bottom:20px; }
.lc-dash-card { background:var(--panel-bg); border:1px solid var(--panel-border); border-radius:14px; padding:16px 18px; }
.lc-dash-card-label { font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--text-muted); margin-bottom:8px; }
.lc-dash-card-val { font-size:26px; font-weight:700; color:var(--text-main); line-height:1.1; }
.lc-dash-card-val small { font-size:13px; font-weight:500; color:var(--text-muted); margin-left:4px; }
.lc-dash-card-meta { margin-top:8px; font-size:11.5px; color:var(--text-muted); }
.lc-dash-panel { background:var(--panel-bg); border:1px solid var(--panel-border); border-radius:14px; padding:18px 20px; margin-bottom:20px; }
.lc-dash-panel-head { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:14px; }
.lc-dash-panel-head h2 { margin:0; font-size:15px; color:var(--text-main); }
.lc-dash-stage-dot { width:9px; height:9px; border-radius:50%; flex-shrink:0; }
.lc-dash-attn-row { display:flex; align-items:center; gap:10px; padding:9px 0; font-size:12.5px; }
.lc-dash-attn-row + .lc-dash-attn-row { border-top:1px solid var(--panel-border); }
.lc-dash-attn-name { flex:1; color:var(--text-main); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; cursor:pointer; }
.lc-dash-attn-name:hover { color:var(--brand-accent); }
.lc-dash-attn-days { font-size:10.5px; color:var(--text-muted); background:var(--bg-dark); border:1px solid var(--panel-border); border-radius:20px; padding:1px 8px; white-space:nowrap; }
.lc-dash-empty { text-align:center; color:var(--text-muted); padding:18px 8px; font-size:12px; }

/* Team-Kennzahlen-Kachel (Bereichsleiter-Dashboard) */
.lc-dash-team-summary { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 16px; }
.lc-dash-team-chip { display:inline-flex; align-items:center; gap:7px; background:var(--bg-dark); border:1px solid var(--panel-border); border-radius:999px; padding:5px 12px 5px 10px; font-size:11.5px; color:var(--text-main); cursor:default; }
.lc-dash-team-row { display:flex; align-items:center; gap:10px; padding:9px 0; font-size:12.5px; }
.lc-dash-team-row + .lc-dash-team-row { border-top:1px solid var(--panel-border); }
.lc-dash-team-name { flex:1; color:var(--text-main); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.lc-dash-team-name.is-inactive { color:var(--text-muted); font-style:italic; }
.lc-dash-team-stat { font-size:10.5px; color:var(--text-muted); background:var(--bg-dark); border:1px solid var(--panel-border); border-radius:20px; padding:1px 8px; white-space:nowrap; }

/* Fortschrittsbalken unter der Marktausschöpfungs-Kachel (Ist vs. anteiliges Jahresziel). */
.lc-dash-progress-track { margin-top:10px; height:6px; border-radius:3px; background:color-mix(in srgb, var(--text-muted) 20%, transparent); overflow:hidden; }
.lc-dash-progress-fill { height:100%; border-radius:3px; background:var(--brand-accent); transition:width .6s cubic-bezier(.22,1,.36,1); }

/* ── "Verliebt-dich-ins-Dashboard"-Kacheln (Provision/Rangliste/Bestleistung/Momentum/Impuls) ──
   Wallet-Karten-Optik (gestapelte Karten, wie im Referenz-Screenshot), aber bewusst gedämpft statt
   bunt: farbiger Kopfbereich pro Kachel (dunkler Farbton, keine Regenbogen-Verläufe) mit Wellenkante,
   dahinter eine dezent versetzte "Schattenkarte" (Stapel-Optik). Alle Werte bleiben jederzeit voll
   sichtbar/lesbar – nichts wird hinter der gestapelten Karte versteckt (Übersichtlichkeit geht vor). */
.lc-dash-delight-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(210px, 1fr)); gap:20px; margin-bottom:22px; }
/* align-self:start verhindert das Grid-Standardverhalten "Stretch auf Zeilenhöhe": ohne das würde
   die Karte auf die Höhe des größten Zeilen-Nachbarn gedehnt, der sichtbare Inhalt aber nur oben
   sitzen -> die Eck-Schattenkarte (an der eigenen Unterkante verankert) würde dann je nach Nachbar
   unterschiedlich weit vom sichtbaren Inhalt abrücken. */
.lc-dash-delight-card { position:relative; isolation:isolate; align-self:start; border-radius:16px; overflow:visible; transition:transform .18s ease, box-shadow .18s ease; }
.lc-dash-delight-card:hover { transform:translateY(-2px); box-shadow:0 10px 26px rgba(0,0,0,.18); }
/* Versetzte "Schattenkarte" dahinter -> vermittelt den Stapel-Effekt, ohne Inhalte zu verdecken.
   Exakte Kopie der Kartenform (inset:0, gleicher Radius), nur per transform verschoben -> Rahmen
   ist dadurch bei jeder Kachel gleich dick, unabhängig von Inhaltslänge. */
.lc-dash-delight-card::before { content:''; position:absolute; inset:0; z-index:-1; border-radius:16px; background:var(--lc-delight-color, var(--brand-accent)); opacity:.30; transform:translate(5px, 5px); }
/* Blickdichter Innen-Container (eigene bg/border) -> deckt die Kopf/Body-Nahtstelle komplett ab,
   damit dort bei Sub-Pixel-Rundung nie die Schattenkarte durchscheint. */
.lc-dash-delight-inner { position:relative; z-index:1; border-radius:16px; overflow:hidden; background:var(--panel-bg); border:1px solid var(--panel-border); }
.lc-dash-delight-head { position:relative; padding:14px 18px 26px; overflow:hidden; background:var(--lc-delight-color-dk, var(--lc-delight-color, var(--brand-accent))); color:#fff; }
/* Dezenter diagonaler Glanzstreifen für den "Premium"-Materialeffekt, ohne bunt zu wirken. */
.lc-dash-delight-head::before { content:''; position:absolute; top:-60%; left:-15%; width:65%; height:220%; background:linear-gradient(120deg, rgba(255,255,255,.16), transparent 65%); transform:rotate(12deg); pointer-events:none; }
/* Wellenkante am unteren Rand des Kopfbereichs (Ellipse in Panel-Farbe schneidet die Kurve heraus). */
.lc-dash-delight-head::after { content:''; position:absolute; left:-12%; right:-12%; bottom:-22px; height:40px; background:var(--panel-bg); border-radius:50%; }
.lc-dash-delight-body { padding:11px 18px 16px; }
/* Die 4 Kennzahlen-Kacheln (Provision/Rangliste/Bestleistung/Momentum) bekommen bewusst eine
   gemeinsame Mindesthoehe -> sonst wirkt die Reihe durch unterschiedlich langen Text pro Kachel
   unruhig. Die Impuls-Kachel (volle Breite, eigener Inhalt) bleibt davon unberuehrt.
   min-height auf .lc-dash-delight-head normiert die Kopfzeile, da manche Labels ("Meine Provision",
   "Meine Bestleistung") bei schmaler Kartenbreite auf 2 Zeilen umbrechen, andere ("Rangliste",
   "Momentum") nur 1 Zeile brauchen -> ohne Fixierung waeren schon allein die Koepfe unterschiedlich
   hoch. min-height auf .lc-dash-delight-inner deckt zusaetzlich den laengsten Body-Inhalt ab
   (Provision hat eine zusaetzliche, ggf. umbrechende Fusszeile "X dieses Jahr · Hochrechnung Y"). */
.lc-dash-delight-stat .lc-dash-delight-head { box-sizing:border-box; min-height:114px; display:flex; flex-direction:column; justify-content:center; }
.lc-dash-delight-stat .lc-dash-delight-inner { box-sizing:border-box; display:flex; flex-direction:column; min-height:270px; }
.lc-dash-delight-stat .lc-dash-delight-body { flex:1; display:flex; flex-direction:column; justify-content:center; }
.lc-dash-delight-icon { position:relative; display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; border-radius:10px; margin-bottom:10px; color:#fff; background:rgba(255,255,255,.22); }
.lc-dash-delight-label { position:relative; font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:rgba(255,255,255,.92); }
/* Info-Icon-Button neben "Meine Provision" (lcProvInfoToggle) – erklärt die individuelle
   Provisionszusammensetzung (Vertrag/Bereichsleiter-Status/Brutto-Netto), siehe .lc-prov-info-pop. */
.lc-prov-info-btn { position:relative; display:inline-flex; align-items:center; justify-content:center; width:17px; height:17px; margin-left:5px; padding:0; border:none; border-radius:50%; background:rgba(255,255,255,.22); color:rgba(255,255,255,.92); cursor:pointer; vertical-align:-3px; transition:background .15s, color .15s; }
.lc-prov-info-btn:hover { background:rgba(255,255,255,.34); color:#fff; }
.lc-prov-info-pop { position:absolute; z-index:1250; width:290px; max-width:calc(100vw - 20px); padding:14px 16px; }
.lc-prov-info-title { font-size:12.5px; font-weight:700; color:var(--text-main); margin-bottom:9px; }
.lc-prov-info-body { display:flex; flex-direction:column; gap:5px; margin-bottom:10px; }
.lc-prov-info-row { display:flex; align-items:baseline; justify-content:space-between; gap:10px; font-size:11.5px; }
.lc-prov-info-row span { color:var(--text-muted); }
.lc-prov-info-row b { color:var(--text-main); font-weight:700; text-align:right; }
.lc-prov-info-note { font-size:10.5px; color:var(--text-muted); line-height:1.5; padding-top:8px; border-top:1px solid var(--panel-border); }
.lc-prov-info-note + .lc-prov-info-note { border-top:none; padding-top:0; margin-top:-2px; }
.lc-dash-delight-val { font-size:24px; font-weight:700; color:var(--text-main); line-height:1.1; }
.lc-dash-delight-sub { margin-top:4px; font-size:11.5px; color:var(--text-muted); }
.lc-dash-delight-foot { margin-top:9px; font-size:11px; color:var(--text-muted); display:flex; flex-wrap:wrap; gap:6px; }
.lc-dash-provision { --lc-delight-color: #669d24; --lc-delight-color-dk: #3e6b12; }
.lc-dash-leaderboard { --lc-delight-color: #C5A47E; --lc-delight-color-dk: #8a6b45; }
.lc-dash-record { --lc-delight-color: #6B8CAE; --lc-delight-color-dk: #3f5a76; }
.lc-dash-streak { --lc-delight-color: #d19900; --lc-delight-color-dk: #8f6600; }
.lc-dash-motivation { --lc-delight-color: #8B7EC8; --lc-delight-color-dk: #5c4f97; }
.lc-dash-rank-chip { display:inline-flex; align-items:center; font-size:10.5px; color:var(--text-muted); background:var(--bg-dark); border:1px solid var(--panel-border); border-radius:20px; padding:2px 9px; }
.lc-dash-rank-chip.is-self { color:var(--lc-delight-color, var(--brand-accent)); border-color:color-mix(in srgb, var(--lc-delight-color, var(--brand-accent)) 45%, var(--panel-border)); font-weight:700; }
.lc-dash-streak.is-hot .lc-dash-delight-icon { color:#fff; background:linear-gradient(135deg, #d19900, #e85d2c); animation:lcDashStreakPulse 1.8s ease-in-out infinite; }
@keyframes lcDashStreakPulse { 0%,100% { box-shadow:0 0 0 0 rgba(216,120,20,.45); } 50% { box-shadow:0 0 0 6px rgba(216,120,20,0); } }
.lc-dash-delight-quote { margin-top:2px; font-size:13px; font-style:italic; color:var(--text-main); line-height:1.5; }
@media (max-width: 767px) {
    .lc-dash-delight-grid { grid-template-columns:repeat(auto-fit, minmax(150px, 1fr)); }
}

/* ── Dashboard-Neustrukturierung: schlanke KPI-Leiste oben + 2-spaltiges Layout ──────────────────
   Arbeitsbereich (Leads/Aufmerksamkeit/Team) links, feste Seitenspalte mit Erfolgen/Zielen rechts
   – so ist das Kanban-Board sofort sichtbar, ohne an Gamification-Kacheln vorbeiscrollen zu müssen. */
.lc-dash-kpi-strip { display:flex; gap:14px; flex-wrap:wrap; margin-bottom:20px; }
.lc-dash-kpi { flex:1; min-width:170px; display:flex; flex-direction:column; background:var(--panel-bg); border:1px solid var(--panel-border); border-radius:14px; padding:13px 16px; }
.lc-dash-kpi-label { font-size:10.5px; text-transform:uppercase; letter-spacing:.06em; color:var(--text-muted); margin-bottom:6px; }
.lc-dash-kpi-val { font-size:21px; font-weight:700; color:var(--text-main); line-height:1.1; }
.lc-dash-kpi-meta { display:block; margin-top:4px; font-size:11px; color:var(--text-muted); }
.lc-dash-kpi-quota { flex-basis:220px; }

.lc-dash-layout { display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:20px; align-items:start; }
.lc-dash-main-col, .lc-dash-side-col { min-width:0; display:flex; flex-direction:column; }
/* Im Markup steht die Seitenspalte (Ziele/Erfolge) zuerst (natürliche Fortsetzung der KPI-Leiste),
   visuell soll der Arbeitsbereich "Meine Leads" aber links/breit stehen -> per order tauschen. */
.lc-dash-main-col { order:1; }
.lc-dash-side-col { order:2; position:sticky; top:16px; }
.lc-dash-side-col .lc-dash-delight-grid { grid-template-columns:repeat(2, 1fr); gap:18px; }
.lc-dash-side-col .lc-dash-motivation { grid-column:1 / -1; }

/* "Meine Leads" ist der primäre Arbeitsbereich -> optisch leicht hervorgehoben (Akzent-Leiste oben,
   etwas größere Überschrift), damit sofort klar ist, wo im Alltag gearbeitet wird. */
.lc-dash-panel-hero {
    position:relative;
    border-color:color-mix(in srgb, var(--brand-accent) 30%, var(--panel-border));
    background-image:linear-gradient(90deg, var(--brand-accent), color-mix(in srgb, var(--brand-accent) 40%, #ffb300));
    background-position:left top;
    background-repeat:no-repeat;
    background-size:100% 3px;
}
.lc-dash-panel-hero .lc-dash-panel-head h2 { font-size:17px; font-weight:700; }

.lc-dash-panel { transition:box-shadow .18s ease; }
.lc-dash-panel:hover { box-shadow:0 8px 24px rgba(0,0,0,.10); }

/* Dezente, leicht gestaffelte Eintritts-Animation beim ersten Laden (kein Dauer-Effekt). */
@keyframes lcDashFadeUp { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
.lc-dash-kpi-strip, .lc-dash-main-col > *, .lc-dash-side-col > * { animation:lcDashFadeUp .45s ease both; }
.lc-dash-main-col > *:nth-child(2) { animation-delay:.05s; }
.lc-dash-main-col > *:nth-child(3) { animation-delay:.1s; }
.lc-dash-side-col > *:nth-child(2) { animation-delay:.04s; }
.lc-dash-side-col > *:nth-child(3) { animation-delay:.08s; }

@media (max-width: 1440px) {
    .lc-dash-layout { grid-template-columns:1fr; }
    .lc-dash-side-col { position:static; }
    .lc-dash-side-col .lc-dash-delight-grid { grid-template-columns:repeat(auto-fit, minmax(210px, 1fr)); }
}
@media (max-width: 640px) {
    .lc-dash-kpi-strip { flex-direction:column; }
    .lc-dash-kpi { min-width:0; }
}

/* Mein Tag: eigenstaendige Tagesassistenz, das Leads-Board bleibt unveraendert. */
.lc-day { margin-bottom:20px; padding:16px 18px; border:1px solid var(--panel-border); border-radius:14px; background:var(--panel-bg); color:var(--text-main); }
.lc-day [hidden] { display:none !important; }
.lc-day-head { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px 16px; }
.lc-day h2, .lc-day h3, .lc-day p { margin:0; }
.lc-day h2 { display:flex; flex-wrap:wrap; align-items:baseline; gap:6px 12px; font-size:17px; line-height:1.4; }
.lc-day h2 span { font-size:13px; font-weight:400; }
.lc-day-tools, .lc-day-actions, .lc-day-footer { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.lc-day .lc-btn, .lc-day .lc-btn-gold { box-sizing:border-box; min-height:44px; min-width:44px; padding:9px 12px; font-size:13px; line-height:1.3; text-decoration:none; display:inline-flex; align-items:center; justify-content:center; gap:7px; }
.lc-day .lc-btn svg { flex:none; }
.lc-day .lc-btn:focus-visible, .lc-day .lc-btn-gold:focus-visible, .lc-day input:focus-visible,
.lc-day textarea:focus-visible, .lc-day select:focus-visible { outline:2px solid var(--brand-accent); outline-offset:3px; }
.lc-day .lc-btn:disabled, .lc-day .lc-btn-gold:disabled { opacity:.6; cursor:wait; }
.lc-day .lc-day-summary { margin-top:3px; font-size:13px; line-height:1.5; }
.lc-day-item { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; padding:14px 0; border-top:1px solid var(--panel-border); }
.lc-day-item-copy { flex:1 1 220px; min-width:0; overflow-wrap:anywhere; }
.lc-day-item h3 { font-size:15px; line-height:1.5; }
.lc-day .lc-day-time { font-size:12px; font-weight:600; line-height:1.5; font-variant-numeric:tabular-nums; }
.lc-day .lc-day-context, .lc-day .lc-day-note { font-size:13px; line-height:1.5; }
.lc-day-preview { margin-top:10px; padding-bottom:10px; }
.lc-day-preview .lc-day-context { overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.lc-day .lc-day-primary { background:var(--brand-accent); border-color:var(--brand-accent); color:var(--btn-text); font-weight:600; }
.lc-day .lc-day-primary:hover { filter:brightness(.92); }
.lc-day-footer { justify-content:space-between; }
.lc-day-list { margin-top:16px; }
.lc-day-list > h3 { font-size:14px; padding:14px 0 8px; }
.lc-day .lc-day-note { margin-top:8px; white-space:pre-wrap; }
.lc-day .lc-day-empty, .lc-day .lc-day-hint { padding:8px 0; font-size:13px; line-height:1.5; }
.lc-day .lc-day-error { margin:10px 0; padding:10px 12px; border:1px solid currentColor; border-radius:8px; font-size:13px; line-height:1.5; color:var(--text-main); background:color-mix(in srgb, var(--panel-bg) 92%, #d34b4b); }
.lc-day-overdue-toggle { font-weight:600; }
.lc-day-followup { margin-top:16px; padding-top:16px; border-top:1px solid var(--panel-border); }
.lc-day-followup > * + * { margin-top:12px; }
.lc-day-outcomes { display:flex; flex-wrap:wrap; gap:8px 20px; border:0; padding:0; }
.lc-day-outcomes legend { font-size:13px; font-weight:600; margin-bottom:6px; }
.lc-day-outcomes label, .lc-day-check { display:flex; align-items:center; gap:8px; min-height:44px; font-size:14px; cursor:pointer; }
.lc-day input[type="checkbox"], .lc-day input[type="radio"] { accent-color:var(--brand-accent); flex:none; }
.lc-day-field { display:flex; flex-direction:column; gap:6px; font-size:13px; font-weight:600; }
.lc-day .lc-input { width:100%; min-width:0; min-height:44px; box-sizing:border-box; font-size:16px; }
.lc-day textarea { resize:vertical; }
.lc-day-fields { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.lc-day-reason { grid-column:1 / -1; }
@media (min-width:1100px) {
    .lc-day-preview .lc-day-actions { flex:0 1 auto; }
}
@media (max-width:640px) {
    .lc-day { padding:12px; }
    .lc-day h2 { display:block; }
    .lc-day h2 span { display:block; font-size:12px; }
    .lc-day-item { display:block; }
    .lc-day-actions { margin-top:10px; }
    .lc-day-actions .lc-btn { flex:1 1 auto; }
    .lc-day-preview h3 { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
    .lc-day-fields { grid-template-columns:1fr; }
}
@media (prefers-reduced-motion:reduce) {
    .lc-day { animation:none; }
}

/* ── Ziel-Trichter ("Wunsch-Jahreseinkommen" -> Gamification-Kachel im Fachberater-Dashboard) ──
   Der Fachberater hinterlegt sein persönliches Jahreseinkommens-Ziel; daraus wird rückwärts über
   Provisionssatz/Ø-Hauspreis + die Trichterquoten (Einstellungen > Zielgrößen) errechnet, wie viele
   Adressen/Bedarfsanalysen/Angebote/Präsentationen/Verträge dafür nötig sind, jeweils dem eigenen
   Year-to-Date-Stand gegenübergestellt. Bewusst spielerischer als die übrigen Kacheln (Level-Badge,
   Meilenstein-Fortschrittsbalken, Trichter-Form), aber ohne die professionelle Grundoptik zu verlassen. */
.lc-goal-panel { border-top:2px solid var(--brand-accent); }
.lc-goal-level { display:inline-flex; align-items:center; gap:7px; font-size:11.5px; font-weight:700; color:var(--brand-accent); background:color-mix(in srgb, var(--brand-accent) 14%, transparent); border:1px solid color-mix(in srgb, var(--brand-accent) 40%, transparent); border-radius:999px; padding:5px 13px 5px 10px; white-space:nowrap; }
.lc-goal-level svg { flex-shrink:0; }
.lc-goal-level.is-reached { color:#fff; background:linear-gradient(135deg, #d19900, #e85d2c); border-color:transparent; animation:lcDashStreakPulse 1.8s ease-in-out infinite; }
.lc-goal-setup { display:flex; flex-wrap:wrap; align-items:flex-start; gap:12px 16px; margin-bottom:16px; }
.lc-goal-setup-field { display:flex; flex-direction:column; gap:8px; min-width:0; }
.lc-goal-setup-field label { font-size:11px; color:var(--text-muted); }
.lc-goal-setup-msg { font-size:11.5px; display:none; align-items:center; gap:5px; }
.lc-goal-setup-msg.is-err { color:var(--danger-red); }
.lc-goal-setup-hint { flex:1 1 260px; font-size:11.5px; color:var(--text-muted); line-height:1.6; padding-top:2px; }
/* Wunsch-Jahreseinkommen: großzügiges, live tausenderformatiertes Eingabefeld mit Euro-Piktogramm,
   Autosave-Statusanzeige (Spinner -> grüner Haken, blendet danach wieder aus) statt Klick-Button, sowie
   Schnellauswahl-Chips für gängige Zielgrößen. */
.lc-goal-income-box { display:flex; align-items:center; gap:9px; width:100%; box-sizing:border-box; background:var(--lc-input-bg); border:1.5px solid var(--lc-input-border); border-radius:12px; padding:10px 14px; transition:border-color .15s, background .15s, box-shadow .15s; }
.lc-goal-income-box:hover { border-color:var(--lc-input-border-hover); }
.lc-goal-income-box:focus-within { border-color:var(--accent-gold); background:rgba(102,157,36,.05); box-shadow:0 0 0 4px rgba(209,153,0,.14); }
.lc-goal-income-icon { flex-shrink:0; color:var(--accent-gold); }
.lc-goal-income-input { flex:1 1 auto; min-width:0; border:none; outline:none; background:transparent; color:var(--text-main); font-size:21px; font-weight:700; font-variant-numeric:tabular-nums; letter-spacing:.2px; padding:0; }
.lc-goal-income-input::placeholder { color:var(--text-muted); font-weight:600; opacity:.55; }
.lc-goal-income-suffix { flex-shrink:0; font-size:12px; font-weight:600; color:var(--text-muted); white-space:nowrap; }
.lc-goal-income-savestate { display:none; align-items:center; gap:4px; flex-shrink:0; font-size:11px; font-weight:600; white-space:nowrap; padding-left:8px; border-left:1px solid color-mix(in srgb, var(--text-muted) 25%, transparent); }
.lc-goal-income-savestate.is-saving, .lc-goal-income-savestate.is-saved { display:inline-flex; }
.lc-goal-income-savestate.is-saving { color:var(--accent-gold); }
.lc-goal-income-savestate.is-saved { color:#669d24; animation:lcGoalSavedPop .4s ease; }
.lc-goal-income-savestate-icon { display:none; }
.lc-goal-income-savestate.is-saving .lc-goal-income-savestate-spin { display:inline-flex; animation:lcGoalSpin 1s linear infinite; }
.lc-goal-income-savestate.is-saved .lc-goal-income-savestate-check { display:inline-flex; }
@keyframes lcGoalSpin { to { transform:rotate(360deg); } }
@keyframes lcGoalSavedPop { 0% { transform:scale(.6); opacity:0; } 60% { transform:scale(1.15); opacity:1; } 100% { transform:scale(1); } }
.lc-goal-income-presets { display:flex; flex-wrap:wrap; gap:6px; margin-top:9px; }
.lc-goal-preset-chip { border:1px solid var(--lc-input-border); background:transparent; color:var(--text-muted); font-size:11.5px; font-weight:600; border-radius:999px; padding:5px 12px; cursor:pointer; transition:.15s; }
.lc-goal-preset-chip:hover { border-color:var(--accent-gold); color:var(--text-main); }
.lc-goal-preset-chip.is-active { background:var(--accent-gold); border-color:var(--accent-gold); color:#fff; }
.lc-goal-share-check { margin:12px 0 16px; }
.lc-goal-progress-wrap { margin-bottom:22px; }
.lc-goal-progress-track { position:relative; height:16px; border-radius:999px; background:color-mix(in srgb, var(--text-muted) 16%, transparent); overflow:hidden; }
.lc-goal-progress-fill { height:100%; border-radius:999px; background:linear-gradient(90deg, var(--brand-accent), color-mix(in srgb, var(--brand-accent) 55%, #ffb300)); transition:width .8s cubic-bezier(.22,1,.36,1); }
.lc-goal-progress-marker { position:absolute; top:0; bottom:0; width:1px; background:color-mix(in srgb, var(--panel-bg) 60%, transparent); }
.lc-goal-progress-labels { display:flex; justify-content:space-between; align-items:baseline; margin-top:8px; font-size:12px; color:var(--text-muted); }
.lc-goal-progress-labels strong { color:var(--text-main); font-size:14px; }
.lc-goal-funnel { display:flex; flex-direction:column; margin:4px 0 18px; }
.lc-goal-funnel-row { position:relative; height:56px; cursor:pointer; }
.lc-goal-funnel-row:hover .lc-goal-funnel-shape,
.lc-goal-funnel-row:hover .lc-goal-funnel-fill { filter:brightness(1.1); }
.lc-goal-funnel-shape { position:absolute; inset:0; background:color-mix(in srgb, var(--text-muted) 16%, var(--panel-bg)); }
.lc-goal-funnel-fill { position:absolute; inset:0; background:linear-gradient(90deg, var(--brand-accent), color-mix(in srgb, var(--brand-accent) 55%, #ffb300)); }
.lc-goal-funnel-row.is-done .lc-goal-funnel-fill { background:linear-gradient(90deg, #669d24, #8bc34a); }
/* Beschriftung liegt ÜBER der (ggf. schräg zulaufenden) Trichterform, nicht in ihr geclippt -> Text bleibt
   in jeder Stufe voll lesbar/mittig. Ein fester dunkler Chip-Hintergrund (statt nur Text-Schatten) sorgt für
   verlässlichen Kontrast, egal ob darunter die helle Restfläche oder der farbige Fortschritts-Fill liegt. */
.lc-goal-funnel-label { position:relative; z-index:1; height:100%; display:flex; align-items:center; justify-content:center; padding:0 14px; }
.lc-goal-funnel-chip { display:flex; flex-direction:column; align-items:center; gap:2px; max-width:100%; padding:5px 14px; border-radius:10px; background:rgba(0,0,0,.42); box-shadow:0 1px 3px rgba(0,0,0,.25), inset 0 0 0 1px rgba(255,255,255,.09); }
.lc-goal-funnel-name { font-size:12px; font-weight:700; color:#fff; letter-spacing:.2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%; }
.lc-goal-funnel-nums { display:flex; align-items:center; gap:4px; font-size:11.5px; font-weight:600; color:#fff; white-space:nowrap; }
.lc-goal-funnel-check { display:inline-flex; color:#8bc34a; }
.lc-goal-foot { font-size:11.5px; color:var(--text-muted); line-height:1.7; text-align:center; }
.lc-goal-foot strong { color:var(--text-main); }
@media (max-width:640px) {
    .lc-goal-setup { flex-direction:column; align-items:stretch; }
    .lc-goal-income-box { min-width:0; }
    .lc-goal-funnel-label { padding:0 10px; }
    .lc-goal-funnel-name { font-size:11.5px; }
    .lc-goal-funnel-nums { font-size:10.5px; }
}

/* ── "Offenes Pipeline-Budget"-Kachel: Wert klickbar -> Modal mit den Leads des höchsten Haus-Budgets ── */
.lc-stat-num-clickable { cursor:pointer; transition:color .12s ease, filter .12s ease; text-decoration:underline dotted transparent; text-underline-offset:3px; }
.lc-stat-num-clickable:hover { filter:brightness(1.18); text-decoration-color:currentColor; }
.lc-budget-top-summary { font-size:11.5px; color:var(--text-muted); margin-bottom:16px; padding-bottom:12px; border-bottom:1px solid var(--panel-border); }
.lc-budget-top-summary strong { color:var(--accent-gold); }
.lc-budget-top-row { margin-bottom:13px; }
.lc-budget-top-row-head { display:flex; align-items:baseline; justify-content:space-between; gap:10px; font-size:12.5px; margin-bottom:5px; }
.lc-budget-top-name { font-weight:600; color:var(--text-main); cursor:pointer; }
.lc-budget-top-name:hover { text-decoration:underline; }
.lc-budget-top-meta { display:flex; align-items:center; gap:5px; color:var(--text-muted); font-size:10.5px; white-space:nowrap; }
.lc-budget-top-stage-dot { width:7px; height:7px; border-radius:50%; flex-shrink:0; }
.lc-budget-top-val { font-weight:700; color:var(--accent-gold); white-space:nowrap; }
.lc-budget-top-bar-track { height:8px; border-radius:4px; background:color-mix(in srgb, var(--text-muted) 14%, transparent); overflow:hidden; }
.lc-budget-top-bar-fill { height:100%; border-radius:4px; background:linear-gradient(90deg, var(--brand-accent), color-mix(in srgb, var(--brand-accent) 45%, #ffe53b)); transition:width .5s ease; }
.lc-budget-top-empty { font-size:12px; color:var(--text-muted); text-align:center; padding:20px 0; }

/* ── "Neuen Lead erfassen"-Auswahl (manuell / QR-Code / Foto) + QR-Scan- und Foto-OCR-Erfassung ── */
.lc-modal-box-sm { width:min(94vw,420px); }
.lc-quicklead-choice-grid { display:grid; grid-template-columns:repeat(3, 1fr); gap:10px; }
.lc-quicklead-choice { display:flex; flex-direction:column; align-items:center; gap:8px; padding:18px 8px; border-radius:12px; border:1px solid var(--panel-border); background:var(--panel-bg); color:var(--text-main); cursor:pointer; transition:transform .15s ease, border-color .15s ease, box-shadow .15s ease; font-size:12px; text-align:center; line-height:1.3; }
.lc-quicklead-choice:hover { transform:translateY(-2px); border-color:var(--accent-gold); box-shadow:0 8px 20px rgba(0,0,0,.16); }
.lc-quicklead-choice svg { color:var(--accent-gold); }
@media (max-width: 520px) {
    .lc-quicklead-choice-grid { grid-template-columns:1fr; }
    .lc-quicklead-choice { flex-direction:row; justify-content:flex-start; text-align:left; }
}

.lc-scan-viewport { position:relative; width:100%; aspect-ratio:1/1; max-height:60vh; border-radius:12px; overflow:hidden; background:#000; }
.lc-scan-viewport video { width:100%; height:100%; object-fit:cover; }
.lc-scan-frame { position:absolute; inset:12%; border:2px solid var(--accent-gold); border-radius:14px; box-shadow:0 0 0 2000px rgba(0,0,0,.35); pointer-events:none; }
.lc-scan-status { margin-top:10px; font-size:12px; color:var(--text-muted); text-align:center; min-height:16px; }
.lc-scan-status.is-error { color:#c62828; }
.lc-scan-status.is-success { color:#0cb300; }

.lc-ocr-picker { display:flex; justify-content:center; padding:20px 0; }
.lc-ocr-picker-row { display:flex; gap:10px; flex-wrap:wrap; justify-content:center; }
.lc-ocr-file-label { display:inline-flex; align-items:center; gap:8px; cursor:pointer; }
.lc-ocr-preview-img { display:block; width:100%; max-height:260px; object-fit:contain; border-radius:10px; border:1px solid var(--panel-border); background:var(--bg-dark); }
.lc-ocr-progress { margin-top:10px; height:6px; border-radius:3px; background:color-mix(in srgb, var(--text-muted) 20%, transparent); overflow:hidden; }
.lc-ocr-progress-bar { height:100%; width:0%; border-radius:3px; background:var(--brand-accent); transition:width .25s ease; }

/* PLZ-Karte (Fachberater): kompakte "Meine Leads"-Liste unter der Kartenlegende + Ladezustand des
   "Lead-Standorte geocodieren"-Buttons. */
.lc-brush-btn:disabled { opacity:.7; cursor:wait; }
.lc-mylead-closed-toggle { display:flex; align-items:center; gap:5px; font-size:11px; font-weight:400; color:var(--text-muted); cursor:pointer; margin:2px 0 6px; }
.lc-mylead-closed-toggle input { margin:0; }
.lc-mylead-list { display:flex; flex-direction:column; gap:4px; max-height:180px; overflow-y:auto; margin:2px 0 8px; }
.lc-mylead-list-empty { font-size:11px; color:var(--text-muted); line-height:1.6; padding:4px 2px; }
.lc-mylead-list-item { display:flex; align-items:center; gap:7px; font-size:12px; color:var(--text-main); cursor:pointer; padding:3px 4px; border-radius:6px; transition:background .12s; }
.lc-mylead-list-item:hover { background:rgba(197,164,126,.1); }
.lc-mylead-list-dot { display:inline-block; width:9px; height:9px; border-radius:50%; flex-shrink:0; box-shadow:0 0 0 2px rgba(255,255,255,.08); }
.lc-mylead-list-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.lc-mylead-geocode-progress { margin-top:6px; }
.lc-mylead-geocode-progress-track { height:5px; border-radius:3px; background:color-mix(in srgb, var(--text-muted) 20%, transparent); overflow:hidden; }
.lc-mylead-geocode-progress-fill { height:100%; width:0%; border-radius:3px; background:var(--accent-gold); transition:width .3s ease; }
.lc-mylead-geocode-cancel { margin-top:6px; width:100%; font-size:11px; padding:5px 10px; border:1px solid var(--panel-border); border-radius:8px; background:none; color:var(--text-muted); cursor:pointer; transition:color .12s, border-color .12s; }
.lc-mylead-geocode-cancel:hover:not(:disabled) { color:var(--danger-red); border-color:var(--danger-red); }
.lc-mylead-geocode-cancel:disabled { opacity:.6; cursor:default; }

/* Fachberater-Tabelle: "Gerade online"-Badge in der Spalte "Letzte Aktivität" (siehe
   vt_is_online/vt_last_active_at in get_vertriebler_stats, basiert auf dem Heartbeat-Mechanismus
   aus admin.php/api_push.php). Wrapper-Div stapelt Online-Badge und "Letzte Aktivität" sauber
   untereinander statt nebeneinander zu quetschen. */
.lc-vt-act-cell { display:flex; flex-direction:column; align-items:flex-start; gap:3px; }
.lc-vt-online-badge { display:inline-flex; align-items:center; gap:5px; font-size:10.5px; font-weight:700; color:#669d24; text-transform:uppercase; letter-spacing:.3px; }
.lc-vt-online-dot { width:7px; height:7px; border-radius:50%; background:#669d24; flex-shrink:0; box-shadow:0 0 0 3px rgba(102,157,36,.18); animation:lc-vt-online-pulse 2s ease-in-out infinite; }
@keyframes lc-vt-online-pulse { 0%, 100% { opacity:1; } 50% { opacity:.45; } }

/* ── Einklappbare Formular-Abschnitte (z.B. "Adresse"/"Bauvorhaben" im Neuer-Lead-Modal) ──
   Standardmäßig eingeklappt, damit auf den ersten Blick nur die wichtigsten Felder sichtbar
   sind – Klick auf die Kopfzeile blendet die restlichen Felder ein/aus. ── */
.lc-collapsible > .lc-collapsible-toggle { display:flex; align-items:center; width:100%; background:none; border:none; padding:0; margin:0 0 12px; cursor:pointer; font:inherit; text-align:left; }
.lc-collapsible[data-collapsed="1"] > .lc-collapsible-toggle { margin-bottom:0; }
.lc-collapsible-hint { font-weight:400; text-transform:none; letter-spacing:0; color:var(--text-muted); margin-left:6px; font-size:10.5px; }
.lc-collapsible-chevron { margin-left:auto; color:var(--text-muted); transition:transform .2s ease; flex-shrink:0; }
.lc-collapsible[data-collapsed="0"] .lc-collapsible-chevron { transform:rotate(180deg); }
.lc-collapsible-body { animation:lcCollapsibleIn .2s ease; }
@keyframes lcCollapsibleIn { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:translateY(0); } }

/* ── Leichtgewichtige Tabs INNERHALB eines Modals (z.B. Lead-Bearbeiten-Modal) – bewusst eigene
   Klassen statt .lc-tabs/.lc-tab-btn (Haupt-Modultabs), damit lcShowTab()
   nicht versehentlich auch diese Buttons erfasst. ── */
.lc-mtabs { margin-bottom: 14px; }
.lc-mtab-panel { display:none; }
.lc-mtab-panel.active { display:flex; flex-direction:column; gap:10px; }

/* ── Hinweis "gesperrt" bei Fachberater-Feldern (z.B. Fachberater-Zuweisung im Lead-Modal) ── */
.lc-lock-hint { display:flex; align-items:center; gap:5px; font-size:10.5px; color:var(--text-muted); margin-top:5px; }
.lc-lock-hint svg { flex-shrink:0; opacity:.7; }
.lc-select:disabled { opacity:.65; cursor:not-allowed; }

/* ── Kalkulation-Hinweis in der Lead-Tabelle: markiert Leads, die (bereits) zur Kalkulation
   übergeben wurden. Wiederverwendet die Farbgebung von .kalk-badge-* (admin_kalkulation.php),
   damit "offen/in Bearbeitung/abgeschlossen" überall gleich aussieht. Rein informativ, nicht
   anklickbar (weder Lead-Controller noch Fachberater haben Zugriff auf das Kalkulation-Modul). ── */
.lc-calc-badge { margin-left:6px; gap:4px; cursor:default; }
tr.lc-row-main.lc-row-in-calc { box-shadow:inset 3px 0 0 0 #3b82f6; }

/* ── Lead-Wert-Einschätzung ("Lead-Wert-Ampel"): kompaktes Smiley-Sticker-Badge (siehe
   lcValueRatingBadgeHtml()). Bewusst klein und ohne Textlabel gehalten ("Sticker", keine Pille wie
   .kalk-badge), damit weder Tabellenzeile noch Dashboard-Kachel optisch aufgebläht werden. Farben
   folgen der Ampel-Logik: grün/lächelnd = Top-Lead, gelb/neutral = Interessant, rot/traurig =
   Normal, gestrichelter grauer Kreis = noch nicht eingeschätzt. */
.lc-value-badge { display:inline-flex; align-items:center; justify-content:center; width:19px; height:19px; border-radius:50%; flex-shrink:0; vertical-align:middle; margin-right:5px; }
.lc-value-badge.is-clickable { cursor:pointer; }
.lc-value-badge.is-clickable:hover { filter:brightness(1.15); }
.lc-value-badge-top         { background:rgba(0,200,81,.16);  color:var(--success-green); }
.lc-value-badge-interessant { background:rgba(234,179,8,.18); color:#eab308; }
.lc-value-badge-normal      { background:rgba(255,68,68,.16); color:var(--danger-red); }
.lc-value-badge-unrated     { color:var(--text-muted); opacity:.55; }
.lc-value-badge-unrated.is-clickable:hover { opacity:1; }
/* Sticker-Optik auf der Kanban-Karte: an der Ecke "angeklebt", OHNE die Kartenhöhe zu beeinflussen
   (position:absolute, kein zusätzlicher Platzverbrauch im Kartenfluss). */
.lc-kanban-card-value-badge-wrap { position:absolute; top:-7px; right:-7px; }
.lc-kanban-card-value-badge-wrap .lc-value-badge { margin-right:0; box-shadow:0 1px 4px rgba(0,0,0,.3); border:2px solid var(--bg-dark); }

/* Bewertungs-Modal (Lead-Wert-Ampel, siehe lc-value-rating-modal): 3 große, farbige Smiley-Buttons
   zur Auswahl der Stufe + Notiz + darunter die vollständige Verlaufshistorie. */
.lc-vrm-options { display:flex; gap:10px; }
.lc-vrm-opt { flex:1; display:flex; flex-direction:column; align-items:center; gap:6px; padding:14px 8px; border-radius:12px; border:2px solid var(--panel-border); background:var(--panel-bg); cursor:pointer; color:var(--text-muted); font-size:12px; font-family:inherit; transition:.15s; }
.lc-vrm-opt svg { width:30px; height:30px; }
.lc-vrm-opt[data-rating="normal"] { color:var(--danger-red); }
.lc-vrm-opt[data-rating="interessant"] { color:#eab308; }
.lc-vrm-opt[data-rating="top"] { color:var(--success-green); }
.lc-vrm-opt:hover { border-color:currentColor; }
.lc-vrm-opt.is-selected { border-color:currentColor; background:color-mix(in srgb, currentColor 14%, var(--panel-bg)); font-weight:600; }
.lc-vrm-history { margin-top:16px; padding-top:12px; border-top:1px solid var(--panel-border); max-height:220px; overflow-y:auto; }
.lc-vrm-history-title { font-size:11px; text-transform:uppercase; letter-spacing:.4px; color:var(--text-muted); margin-bottom:6px; }
.lc-vrm-history-item { display:flex; align-items:flex-start; gap:8px; padding:7px 0; border-bottom:1px solid var(--panel-border); font-size:12px; }
.lc-vrm-history-item:last-child { border-bottom:none; }
.lc-vrm-history-item-label { font-weight:600; }
.lc-vrm-history-item-note { color:var(--text-muted); }
.lc-vrm-history-meta { color:var(--text-muted); font-size:11px; margin-top:2px; }

/* ── Lead-Qualifizierungs-Fragebogen (siehe lcQualificationFormHtml()): ausklappbare Abschnitte,
   wiederverwendet im Bewertungs-Modal UND im Tab "Qualifizierung" des Lead-Modals. */
.lc-modal-section-title { margin:0 0 10px; font-size:12px; text-transform:uppercase; letter-spacing:.5px; color:var(--text-muted); font-weight:700; }
.lc-qual-form { display:flex; flex-direction:column; gap:8px; }
.lc-qual-section { border:1px solid var(--panel-border); border-radius:10px; overflow:hidden; background:rgba(255,255,255,.015); }
.lc-qual-section-head { width:100%; display:flex; align-items:center; justify-content:space-between; gap:8px; padding:10px 14px; background:none; border:none; cursor:pointer; font-size:12.5px; font-weight:600; color:var(--text-main); font-family:inherit; text-align:left; }
.lc-qual-section-head:hover { color:var(--accent-gold); }
.lc-qual-section-head svg { transition:transform .15s; flex-shrink:0; color:var(--text-muted); }
.lc-qual-section.is-open .lc-qual-section-head svg { transform:rotate(180deg); }
.lc-qual-section-body { display:none; padding:4px 14px 14px; border-top:1px solid var(--panel-border); }
.lc-qual-section.is-open .lc-qual-section-body { display:block; }
/* Einheitlicher vertikaler Rhythmus zwischen den Blöcken EINES Abschnitts (Grid/Feld/Grid/…) –
   ersetzt vormals uneinheitliche, manuell im JS gesetzte margin-top-Werte je Block. */
.lc-qual-section-body > * + * { margin-top:10px; }
/* Labels dürfen NIE umbrechen: bricht eine (längere) Bezeichnung in einer Grid-Zeile auf 2 Zeilen
   um, während die danebenliegende einzeilig bleibt, rutscht deren Switch/Input sichtbar tiefer als
   das Nachbarfeld – genau das "vertikale Verschieben" innerhalb derselben .lc-form-grid-Zeile. */
.lc-qual-section-body .lc-label { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
/* Die generische Regel ".lc-form-section .lc-field + .lc-field { margin-top:12px; }" (für normale,
   untereinander gestapelte Formulare) greift unerwünscht auch hier: innerhalb eines 2-spaltigen
   .lc-form-grid ist das ZWEITE Feld einer Zeile im DOM ebenfalls ein auf ".lc-field" folgendes
   ".lc-field" (nur optisch daneben, nicht darunter) und bekam dadurch 12px Extra-Abstand nach oben –
   genau das beobachtete "vertikale Verschieben" zwischen Spalte 1 und Spalte 2 derselben Zeile.
   Für Grid-Kinder MUSS dieser Abstand wieder auf 0, da .lc-form-grid den Spaltenabstand bereits
   selbst über "gap" regelt. */
.lc-qual-section-body .lc-form-grid > .lc-field + .lc-field { margin-top:0; }
/* Button-Switch für Fragebogen-Felder mit wenigen Auswahlmöglichkeiten (Ja/Nein/Unklar, Finanzierungs-
   status etc.) – ersetzt <select>-Dropdowns, damit der aktuelle Stand auf einen Blick sichtbar ist.
   Optik bewusst an .lc-cal-type-toggle/.lc-dfauto-mode-toggle angelehnt (echte Radio-Inputs). */
.lc-qual-toggle { display:flex; flex-wrap:wrap; gap:4px; background:var(--bg-dark); border:1px solid var(--panel-border); border-radius:9px; padding:3px; }
.lc-qual-toggle-opt { position:relative; flex:1 1 auto; display:flex; align-items:center; justify-content:center; padding:7px 9px; border-radius:6px; border:1px solid transparent; font-size:12px; font-weight:600; color:var(--text-muted); cursor:pointer; white-space:nowrap; text-align:center; transition:color .15s, background .15s, border-color .15s; }
.lc-qual-toggle-opt input { position:absolute; width:0; height:0; opacity:0; pointer-events:none; }
.lc-qual-toggle-opt:hover { color:var(--text-main); }
.lc-qual-toggle-opt:has(input:checked) { background:var(--panel-bg); border-color:var(--panel-border); color:var(--accent-gold); }
.lc-qual-toggle-opt:has(input:disabled) { opacity:.55; cursor:not-allowed; }
/* Mehrfachauswahl "Ausstattung" als Chip-Reihe statt nackter Checkboxen – gleiche Bedienlogik wie
   der Switch oben (Klick = Toggle), aber als Pille erkennbar mehrfach wählbar. */
.lc-qual-checks { display:flex; flex-wrap:wrap; gap:6px; }
.lc-qual-chip { position:relative; display:inline-flex; align-items:center; gap:6px; padding:7px 13px; border-radius:999px; border:1px solid var(--panel-border); background:var(--panel-bg); font-size:12px; font-weight:600; color:var(--text-muted); cursor:pointer; transition:.15s; }
.lc-qual-chip input { position:absolute; width:0; height:0; opacity:0; pointer-events:none; }
.lc-qual-chip:hover { color:var(--text-main); border-color:var(--lc-input-border-hover); }
.lc-qual-chip:has(input:checked) { border-color:var(--accent-gold); color:var(--accent-gold); background:color-mix(in srgb, var(--accent-gold) 12%, var(--panel-bg)); }
.lc-qual-chip:has(input:disabled) { opacity:.55; cursor:not-allowed; }
.lc-qual-save-row { display:flex; align-items:center; gap:10px; margin-top:10px; flex-wrap:wrap; }
.lc-qual-save-row .lc-btn-gold { margin-left:auto; font-size:12px; }
.lc-qual-history { margin-top:10px; padding-top:10px; border-top:1px solid var(--panel-border); max-height:200px; overflow-y:auto; }
/* Trennlinie zwischen Fragebogen und Gesamteinschätzung im Bewertungs-Modal. */
#lc-value-rating-modal .lc-form-section + .lc-form-section { margin-top:18px; padding-top:16px; border-top:1px solid var(--panel-border); }

/* Kalkulation-Kurzkarte in der aufgeklappten Lead-Zeile (nur aktuellste Runde, siehe
   lcDfRenderRowExpand()). ── */
.lc-df-exp-calc { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.lc-df-exp-calc-meta { font-size:11px; color:var(--text-muted); }

/* ── Gesprächsprotokoll (Telefonate/persönliche Gespräche/schriftlicher Kontakt) eines Leads –
   Liste in der aufgeklappten Lead-Zeile (lcDfRenderRowExpand) UND im Tab "Notizen & Verlauf" des
   Lead-Bearbeiten-Modals (lcOpenLeadModal), siehe lcConversationLogHtml(). ── */
.lc-conv-list { list-style:none; margin:0; padding:0; }
.lc-conv-item { display:flex; gap:10px; padding:10px 0; border-bottom:1px solid var(--panel-border); }
.lc-conv-item:last-child { border-bottom:none; padding-bottom:2px; }
.lc-conv-item-icon { flex-shrink:0; width:26px; height:26px; border-radius:50%; background:rgba(102,157,36,.14); color:var(--accent-gold); display:flex; align-items:center; justify-content:center; margin-top:1px; }
.lc-conv-item-body { flex:1; min-width:0; }
.lc-conv-item-head { display:flex; align-items:center; gap:8px; margin-bottom:3px; }
.lc-conv-item-type { font-size:11.5px; font-weight:700; color:var(--text-main); }
.lc-conv-item-date { font-size:10.5px; color:var(--text-muted); margin-left:auto; white-space:nowrap; }
.lc-conv-item-del { background:none; border:none; color:var(--text-muted); cursor:pointer; padding:2px; display:inline-flex; flex-shrink:0; transition:color .12s; }
.lc-conv-item-del:hover { color:var(--danger-red); }
.lc-conv-item-note { font-size:12.5px; color:var(--text-muted); line-height:1.5; white-space:pre-wrap; word-break:break-word; }
.lc-conv-empty { font-size:12px; color:var(--text-muted); padding:2px 0 12px; }
.lc-conv-add { display:flex; flex-direction:column; gap:8px; margin-top:12px; padding-top:12px; border-top:1px solid var(--panel-border); }
.lc-conv-add-row { display:flex; gap:8px; flex-wrap:wrap; }
.lc-conv-add-row .lc-select { flex:1 1 180px; max-width:240px; }
.lc-conv-add-row .lc-input { flex:1 1 180px; max-width:220px; }
.lc-conv-add-btn { align-self:flex-end; display:inline-flex; align-items:center; gap:6px; }

/* Anruf-Notiz-Modal: öffnet sich zusätzlich zum tel:-Link, sobald auf einen Telefon-/Handy-Button
   eines Leads geklickt wird (siehe lcOpenCallModal() in lead_controlling.php). ── */
.lc-call-modal-sub { display:flex; align-items:center; gap:8px; font-size:12.5px; color:var(--text-muted); margin:-4px 0 14px; }
.lc-call-modal-sub svg { color:var(--accent-gold); flex-shrink:0; }

/* ── Klickbarer Chip für die DOCUframe-ID in der aufgeklappten Lead-Zeile: kopiert den Wert
   in die Zwischenablage (siehe lcCopyErpId() in lead_controlling.php). ── */
.lc-df-copyable { cursor:pointer; transition:background .12s ease, border-color .12s ease; }
.lc-df-copyable:hover { background:color-mix(in srgb, var(--accent-gold) 12%, transparent); border-color:color-mix(in srgb, var(--accent-gold) 45%, var(--panel-border)); }
.lc-df-copy-icon { opacity:.55; margin-left:2px; }
.lc-df-copyable:hover .lc-df-copy-icon { opacity:1; }

/* ── Dezentes Kopier-Element für einzelne Kontaktwerte (Adresse/Telefon/Handy/E-Mail) – siehe
   lcCopyableHtml(): kein Pill-Hintergrund/-Rahmen wie die DOCUframe-ID-Chip (bliebe sonst in
   Tabellenzeilen/Kontakt-Karten optisch zu dominant), nur dezentes Hover-Highlight + Icon über
   die geerbten .lc-df-copyable-Regeln oben. */
.lc-copy-inline { display:inline-flex; align-items:center; gap:3px; border-radius:5px; padding:1px 4px; margin:-1px -4px; }

/* ── Variante für die Mängelliste (Kundendienst): Kopier-Icon bei der DOCUframe-Nummer ist
   standardmäßig komplett unsichtbar und erscheint NUR bei Hover (siehe kdDfNummerCopyHtml() in
   kundendienst.php) - im Unterschied zur Leads-Tabelle, wo das Icon dauerhaft dezent sichtbar
   ist. Höhere Spezifität (zwei Klassen) überschreibt die generische .lc-df-copy-icon-Regel oben. */
.lc-df-copyable.kd-copy-hover-reveal .lc-df-copy-icon { opacity:0; }
.lc-df-copyable.kd-copy-hover-reveal:hover .lc-df-copy-icon { opacity:1; }

/* ── Rechtsklick-Kontextmenü im Lead-Controlling (Tabellenzeile, Kanban-Karte, Attention-Row) –
   siehe lcOpenLeadCtxMenu()/lcCtxMenuEnsure() in lead_controlling.php. Ein einzelnes, lazy erzeugtes
   #lc-ctx-menu wird per fixed-Positionierung an die Cursor-Position gesetzt. ── */
/* Hintergrund/Rand/Schatten kommen aus `.hbb-glass-pop` (per JS auf className gesetzt) — border-top bleibt als eigener Gold-Akzent (analog .ipr-bell-panel). */
.lc-ctx-menu { position:fixed; z-index:2000; min-width:210px; max-width:260px; border-top:2px solid var(--accent-gold); padding:6px; display:none; }
.lc-ctx-menu.is-open { display:block; }
.lc-ctx-item { display:flex; align-items:center; gap:9px; width:100%; padding:8px 10px; border-radius:8px; border:none; background:none; color:var(--text-main); font-size:12.5px; text-align:left; cursor:pointer; transition:background .12s ease; }
.lc-ctx-item:hover { background:color-mix(in srgb, var(--accent-gold) 14%, transparent); }
.lc-ctx-item.danger { color:var(--danger-red); }
.lc-ctx-item.danger:hover { background:color-mix(in srgb, var(--danger-red) 14%, transparent); }
.lc-ctx-item-muted { cursor:default; opacity:.6; }
.lc-ctx-item-muted:hover { background:none; }
.lc-ctx-item svg { flex-shrink:0; opacity:.75; }
.lc-ctx-sep { height:1px; margin:6px 4px; background:var(--panel-border); }
.lc-ctx-label { padding:6px 10px 4px; font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:.3px; color:var(--text-muted); }
.lc-ctx-status-list { max-height:220px; overflow-y:auto; display:flex; flex-direction:column; gap:1px; }
.lc-ctx-status-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
/* Kaskadierendes Untermenü innerhalb des Zeilen-Kontextmenüs (z. B. Kundendienst-Mängelliste:
   "Kategorie" ▶ Oberkategorie ▶ Unterkategorie) - 1:1 nach dem Vorbild von .lc-colctx-submenu
   (Spalten-Kontextmenü): wird per JS beim Aufklappen aus dem (per .hbb-glass-pop geblurrten)
   Eltern-Menü gelöst und direkt an document.body gehängt, da verschachteltes backdrop-filter
   browserübergreifend unzuverlässig gerendert wird (siehe kdCtxDetachSubmenus() im jeweiligen
   Modul). Beliebig tief verschachtelbar (jede Ebene detached sich unabhängig). */
.lc-ctx-item.has-submenu { position:relative; padding-right:26px; }
.lc-ctx-item.has-submenu::after { content:''; position:absolute; right:10px; top:50%; width:6px; height:6px; border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor; transform:translateY(-50%) rotate(-45deg); opacity:.6; }
.lc-ctx-submenu { display:none; position:fixed; min-width:200px; padding:6px; z-index:2001; border-radius:10px; opacity:0; transform:translateY(2px); transition:opacity .12s ease, transform .12s ease; border-top:2px solid var(--accent-gold); }
.lc-ctx-submenu.is-visible { display:block; }
.lc-ctx-submenu.is-shown { opacity:1; transform:translateY(0); }

/* ── Wiedervorlage-Badge (Uhr-Icon + Datum) auf Lead-Zeilen, Kanban-Karten und der Attention-Row.
   Farbverlauf analog zu .bw-reminder-due (Bewerbermodul): Rot = überfällig, Amber = heute fällig,
   Gold = zukünftig. Siehe lcReminderUrgency()/lcReminderBadgeHtml() in lead_controlling.php. ── */
.lc-reminder-badge { display:inline-flex; align-items:center; gap:4px; font-size:10.5px; font-weight:600; color:var(--brand-accent); white-space:nowrap; }
.lc-reminder-badge svg { flex-shrink:0; }
.lc-reminder-badge.is-overdue { color:var(--danger-red); }
.lc-reminder-badge.is-today { color:#d9a441; }
.lc-reminder-badge.is-upcoming { color:var(--brand-accent); }
.lc-dash-attn-reminder-btn { display:inline-flex; align-items:center; justify-content:center; width:22px; height:22px; border-radius:7px; border:1px solid var(--panel-border); background:var(--bg-dark); color:var(--text-muted); cursor:pointer; transition:.15s; flex-shrink:0; }
.lc-dash-attn-reminder-btn:hover { color:var(--accent-gold); border-color:rgba(102,157,36,.4); }

/* ── Wiedervorlage-Karte im Lead-Modal (Notizen-Tab, Sektion "Wiedervorlage") – Aufbau angelehnt an
   .bw-reminder-card (Bewerbermodul). ── */
.lc-reminder-card { display:flex; align-items:flex-start; gap:10px; padding:12px 14px; border:1px solid var(--panel-border); border-left:3px solid var(--brand-accent); border-radius:10px; background:var(--panel-bg); }
.lc-reminder-card.is-overdue { border-left-color:var(--danger-red); }
.lc-reminder-card.is-today { border-left-color:#d9a441; }
.lc-reminder-card-body { flex:1; min-width:0; }
.lc-reminder-card-row1 { display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-size:12.5px; font-weight:600; color:var(--text-main); }
.lc-reminder-card-reason { font-size:12px; color:var(--text-muted); margin-top:4px; }
.lc-reminder-card-note { font-size:11.5px; color:var(--text-muted); margin-top:4px; white-space:pre-wrap; }
.lc-reminder-card-actions { display:flex; gap:6px; flex-shrink:0; }
.lc-reminder-empty { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; padding:20px; color:var(--text-muted); font-size:12px; background:var(--panel-bg); border:1px dashed var(--panel-border); border-radius:10px; }
.lc-btn-danger { background:var(--danger-red); color:#fff; border:none; }
.lc-btn-danger:hover { filter:brightness(1.1); }

/* ── Dashboard-Block "Wiedervorlagen" (lcLoadMyDashboard) – Liste aus .lc-reminder-card, zusätzlich
   klickbar (öffnet den Lead) und mit Lead-Namen-Zeile, da hier (anders als im Lead-Modal) mehrere
   verschiedene Leads gleichzeitig aufgelistet werden. ── */
.lc-dash-reminders-list { display:flex; flex-direction:column; gap:8px; }
.lc-dash-reminder-card { cursor:pointer; transition:border-color .15s; }
.lc-dash-reminder-card:hover { border-color:var(--brand-accent); }
.lc-dash-reminder-name { font-size:12.5px; font-weight:600; color:var(--text-main); margin-top:2px; }

/* ── Kalender-Tab (html/modules/lead_controlling.php), Präfix lc-cal-. FullCalendar (lokal via
   html/vendor/fullcalendar/) wird in .lc-cal-wrap eingebettet und über CSS-Variablen an die
   Farbwelt des restlichen Portals angepasst (Dark/Light-Themes bereits über --panel- und --text-
   Variablen im :root abgedeckt). ── */
.lc-cal-toolbar { display:flex; flex-wrap:wrap; align-items:flex-end; gap:14px; margin-bottom:14px; }
.lc-cal-toolbar-spacer { flex:1 1 auto; }
.lc-cal-vt-picker { min-width:220px; }
.lc-cal-daystart-picker { min-width:150px; }
.lc-cal-legend { display:flex; flex-wrap:wrap; gap:14px; align-items:center; padding-bottom:9px; }
.lc-cal-legend-item { display:flex; align-items:center; gap:6px; font-size:11.5px; color:var(--text-muted); }
.lc-cal-dot { width:9px; height:9px; border-radius:50%; flex-shrink:0; }
.lc-cal-dot-vor-ort { background:var(--lc-cal-vor-ort); }
.lc-cal-dot-remote { background:var(--lc-cal-remote); }
.lc-cal-dot-birthday { background:var(--lc-cal-birthday); }
.lc-cal-dot-event { background:var(--lc-cal-event); }
.lc-cal-dot-vacation { background:var(--lc-cal-vacation); }
.lc-cal-readonly-banner { display:flex; align-items:center; gap:8px; margin-bottom:12px; padding:9px 12px; border-radius:8px; border:1px solid var(--panel-border); background:var(--bg-dark); font-size:12px; color:var(--text-muted); }
/* Veranstaltungs-Modal (Lead-Controller: "Für alle Fachberater"-Umschalter + Mehrfachauswahl,
   Mehrfachauswahl-Dropdown selbst nutzt die bestehenden .lc-stage-dropdown-*/.lc-stage-chk-*-Klassen). */
.lc-event-forall-row { display:flex; align-items:center; gap:9px; font-size:13px; color:var(--text-main); cursor:pointer; }
.lc-event-forall-row input[type="checkbox"] { width:16px; height:16px; accent-color:var(--accent-gold); cursor:pointer; }
/* E-Mail-Einladung + RSVP (Zu-/Absage) für Veranstaltungen: Checkbox im Modal-Footer neben
   "Speichern" (Ersteller/Controller), eigene Zusagen/Absagen-Buttons im read-only-Modal
   (Fachberater-Sicht) und Teilnehmer-/Rückmeldungsliste im Tab "Rückmeldungen" (Controller-Sicht). */
.lc-event-notify-row { display:flex; align-items:center; gap:8px; font-size:12.5px; color:var(--text-muted); margin-right:10px; cursor:pointer; }
.lc-event-notify-row input[type="checkbox"] { width:15px; height:15px; accent-color:var(--accent-gold); cursor:pointer; }
.lc-event-rsvp-own { display:flex; align-items:center; gap:10px; margin-right:auto; font-size:12.5px; color:var(--text-muted); }
.lc-event-rsvp-list { display:flex; flex-direction:column; gap:6px; }
.lc-event-rsvp-empty { font-size:13px; color:var(--text-muted); padding:6px 0; }
.lc-event-rsvp-row { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:8px 12px; border:1px solid var(--panel-border); border-radius:8px; background:var(--bg-dark); }
.lc-event-rsvp-name { font-size:13px; color:var(--text-main); }
.lc-rsvp-badge { font-size:11px; font-weight:700; padding:3px 9px; border-radius:20px; white-space:nowrap; }
.lc-rsvp-badge.ausstehend { background:color-mix(in srgb, var(--text-muted) 18%, transparent); color:var(--text-muted); }
.lc-rsvp-badge.zugesagt { background:color-mix(in srgb, #3fa65b 20%, transparent); color:#3fa65b; }
.lc-rsvp-badge.abgesagt { background:color-mix(in srgb, var(--danger-red) 18%, transparent); color:var(--danger-red); }
.lc-rsvp-badge.vorlaeufig { background:color-mix(in srgb, var(--accent-gold) 20%, transparent); color:var(--accent-gold); }
.lc-event-rsvp-hint { display:flex; align-items:flex-start; gap:7px; font-size:11.5px; color:var(--text-muted); margin:0 0 10px; line-height:1.5; }
.lc-event-rsvp-hint svg { flex-shrink:0; margin-top:1px; opacity:.75; }
.lc-cal-wrap {
    --fc-border-color: var(--panel-border);
    --fc-page-bg-color: transparent;
    --fc-neutral-bg-color: var(--bg-dark);
    --fc-list-event-hover-bg-color: var(--bg-dark);
    --fc-today-bg-color: color-mix(in srgb, var(--accent-gold) 10%, transparent);
    background:var(--panel-bg); border:1px solid var(--panel-border); border-radius:12px; padding:14px;
}
.lc-cal-wrap .fc { color:var(--text-main); font-family:inherit; }
.lc-cal-wrap .fc-toolbar-title { font-size:15px; font-weight:600; color:var(--text-main); }
.lc-cal-wrap .fc-button { background:var(--bg-dark); border:1px solid var(--panel-border); color:var(--text-main); box-shadow:none; text-transform:capitalize; }
.lc-cal-wrap .fc-button:hover { background:color-mix(in srgb, var(--accent-gold) 12%, transparent); color:var(--text-main); }
.lc-cal-wrap .fc-button-primary:not(:disabled).fc-button-active,
.lc-cal-wrap .fc-button-primary:not(:disabled):active { background:var(--accent-gold); border-color:var(--accent-gold); color:#1a1a1a; }
/* FullCalendar liefert für :disabled fest verdrahtete Farben (weißer Text auf dunkelblauem Bg,
   unabhängig vom Theme) mit höherer Spezifität als unsere Basisregel oben – ohne diesen Block
   bleibt z. B. der "Heute"-Button (disabled, wenn die Ansicht bereits den heutigen Tag zeigt) beim
   Hover kaum lesbar (weißer Text auf fast transparentem Hover-Hintergrund). */
.lc-cal-wrap .fc-button:disabled { background:var(--bg-dark); border-color:var(--panel-border); color:var(--text-muted); opacity:.6; cursor:not-allowed; }
.lc-cal-wrap .fc-button:disabled:hover { background:var(--bg-dark); color:var(--text-muted); }
.lc-cal-wrap .fc-daygrid-day-number, .lc-cal-wrap .fc-col-header-cell-cushion { color:var(--text-main); }
.lc-cal-wrap .fc-day-other .fc-daygrid-day-number { color:var(--text-muted); }
.lc-cal-wrap .fc-event { border:none; cursor:pointer; font-size:11px; }
.lc-cal-wrap .fc-event.lc-cal-event-cancelled { opacity:.5; text-decoration:line-through; }
/* Eigener eventContent-Aufbau (Zeit/Titel/Mini-Aktionsbuttons) für Termin-Kästchen im Kalender. */
.lc-cal-ev { display:flex; flex-direction:column; gap:2px; padding:1px 2px; overflow:hidden; }
.lc-cal-ev-time { font-size:10px; font-weight:700; opacity:.85; }
.lc-cal-ev-title { font-size:11px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.lc-cal-ev-actions { display:flex; gap:4px; margin-top:1px; flex-shrink:0; }
.lc-cal-ev-btn { display:inline-flex; align-items:center; justify-content:center; width:17px; height:17px; border-radius:5px; background:rgba(255,255,255,.22); color:inherit; flex-shrink:0; transition:background .12s; }
.lc-cal-ev-btn:hover { background:rgba(255,255,255,.42); }
/* Monatsansicht: eigener Farb-Punkt vor Zeit/Titel, da eventContent FullCalendars eingebauten
   Dot-Indikator komplett ersetzt (sonst wären Termine farblos, unabhängig von der Legende). */
.lc-cal-ev-head { display:flex; align-items:center; gap:4px; min-width:0; }
.lc-cal-ev-head .lc-cal-ev-title { flex:1 1 auto; min-width:0; }
.lc-cal-ev-head .lc-cal-ev-time { flex-shrink:0; }
.lc-cal-ev-dot { width:7px; height:7px; border-radius:50%; flex-shrink:0; }
/* Wochen-/Tagesansicht (timeGrid): Titel bekommt eine eigene volle Zeile (nicht mehr durch Zeit-
   Präfix + Icons verdrängt), Zeit+Aktions-Icons teilen sich darunter eine kompakte zweite Zeile –
   informativer als eine einzige, stark gekürzte Zeile, aber kompakt genug für kurze Terminblöcke. */
.lc-cal-ev-meta { display:flex; align-items:center; gap:6px; margin-top:1px; }
.lc-cal-ev-meta .lc-cal-ev-time { flex:0 0 auto; }
.lc-cal-ev-meta .lc-cal-ev-actions { margin-top:0; margin-left:auto; }
/* Quick-Action-Leiste (Anrufen/Route/E-Mail/Meeting beitreten) als Seitenleiste im Termin-Modal. */
.lc-cal-modal-layout { display:grid; grid-template-columns:1fr 190px; gap:16px; align-items:start; }
.lc-cal-modal-layout.lc-cal-modal-layout--empty { grid-template-columns:1fr; }
.lc-cal-modal-layout.lc-cal-modal-layout--empty .lc-cal-modal-sidebar { display:none; }
.lc-cal-modal-main { min-width:0; }
.lc-cal-modal-sidebar { display:flex; flex-direction:column; gap:8px; padding:12px; border-radius:10px; background:var(--bg-dark); border:1px solid var(--panel-border); position:sticky; top:0; }
.lc-cal-qa-label { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:var(--text-muted); }
.lc-cal-qa-bar { display:flex; flex-direction:column; gap:8px; }
.lc-cal-qa-btn { display:flex; align-items:center; gap:8px; padding:9px 12px; border-radius:9px; background:color-mix(in srgb, var(--accent-gold) 12%, transparent); border:1px solid color-mix(in srgb, var(--accent-gold) 35%, transparent); color:var(--accent-gold); font-size:12.5px; font-weight:600; text-decoration:none; width:100%; box-sizing:border-box; transition:background .15s, border-color .15s; }
.lc-cal-qa-btn:hover { background:color-mix(in srgb, var(--accent-gold) 22%, transparent); border-color:var(--accent-gold); }
.lc-cal-qa-btn svg { flex-shrink:0; }
@media(max-width:760px) {
    .lc-cal-modal-layout { grid-template-columns:1fr; }
    .lc-cal-modal-sidebar { position:static; }
}
.lc-cal-ical-box { margin-top:14px; padding:12px 14px; border:1px solid var(--panel-border); border-radius:10px; background:var(--panel-bg); }
.lc-cal-ical-label { display:flex; align-items:center; gap:7px; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:var(--text-muted); margin-bottom:9px; }
.lc-cal-ical-row { display:flex; gap:8px; }
.lc-cal-ical-row .lc-input { flex:1 1 auto; font-family:monospace; font-size:11.5px; }
.lc-cal-type-toggle { display:flex; gap:4px; background:var(--bg-dark); border:1px solid var(--panel-border); border-radius:10px; padding:4px; }
.lc-cal-type-btn { position:relative; flex:1; display:flex; align-items:center; justify-content:center; gap:7px; padding:9px 10px; border-radius:7px; border:1px solid transparent; font-size:12.5px; font-weight:600; color:var(--text-muted); cursor:pointer; white-space:nowrap; transition:color .15s, background .15s, border-color .15s; }
.lc-cal-type-btn input { position:absolute; width:0; height:0; opacity:0; pointer-events:none; }
.lc-cal-type-btn svg { flex-shrink:0; }
.lc-cal-type-btn:hover { color:var(--text-main); }
.lc-cal-type-btn.is-active { background:var(--panel-bg); border-color:var(--panel-border); color:var(--accent-gold); }

/* DOCUframe: Automatischer Sync (Einstellungen-Tab, lead_controlling.php) – Modus-Umschalter
   (Intervall/Uhrzeiten) im selben Look wie .lc-cal-type-toggle, plus Uhrzeit-Chips. */
.lc-dfauto-mode-toggle { display:flex; gap:4px; background:var(--bg-dark); border:1px solid var(--panel-border); border-radius:10px; padding:4px; margin-bottom:14px; max-width:420px; }
.lc-dfauto-mode-btn { position:relative; flex:1; display:flex; align-items:center; justify-content:center; padding:8px 10px; border-radius:7px; font-size:12px; font-weight:600; color:var(--text-muted); cursor:pointer; white-space:nowrap; transition:color .15s, background .15s; }
.lc-dfauto-mode-btn input { position:absolute; width:0; height:0; opacity:0; pointer-events:none; }
.lc-dfauto-mode-btn.is-active { background:var(--panel-bg); border:1px solid var(--panel-border); color:var(--accent-gold); }
.lc-dfauto-fields { margin-top:4px; }
.lc-dfauto-interval-select { max-width:220px; }
.lc-dfauto-times-list { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.lc-dfauto-times-empty { font-size:11.5px; color:var(--text-muted); margin-top:6px; }
.lc-dfauto-time-chip { display:flex; align-items:center; gap:4px; background:var(--bg-dark); border:1px solid var(--panel-border); border-radius:8px; padding:3px 4px 3px 8px; }
.lc-dfauto-time-input { background:none; border:none; color:var(--text-main); font-size:12.5px; font-family:inherit; width:70px; }
.lc-dfauto-time-remove { display:flex; align-items:center; justify-content:center; width:20px; height:20px; border:none; border-radius:5px; background:none; color:var(--text-muted); cursor:pointer; transition:color .15s, background .15s; }
.lc-dfauto-time-remove:hover { background:rgba(255,255,255,.08); color:var(--danger-red); }

/* Einstellungen-Kacheln (Master/Detail-Übersicht statt Textwand, bislang nur lokal in
   lead_controlling.php definiert) - hier zentral nachgezogen, damit auch andere Module (z. B.
   kundendienst.php) dieselbe Kachel-Optik nutzen können, ohne lead_controlling.php anzufassen. */
.lc-settings-intro { font-size:12px; color:var(--text-muted); margin-bottom:16px; line-height:1.6; max-width:760px; }
.lc-settings-tiles { display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); gap:14px; margin-bottom:18px; }
.lc-settings-tile { display:flex; align-items:flex-start; gap:12px; text-align:left; background:rgba(255,255,255,.025); border:1px solid var(--panel-border); border-radius:12px; padding:16px; cursor:pointer; transition:border-color .15s, transform .15s, background .15s; font-family:inherit; }
.lc-settings-tile:hover { border-color:var(--brand-accent); transform:translateY(-1px); background:color-mix(in srgb, var(--brand-accent) 5%, transparent); }
.lc-settings-tile-icon { flex:none; width:38px; height:38px; border-radius:9px; display:flex; align-items:center; justify-content:center; background:color-mix(in srgb, var(--brand-accent) 12%, transparent); color:var(--brand-accent); }
/* KI-Kacheln (z. B. "Mängel-Kategorisierung durch KI" in den Kundendienst-Einstellungen) - Icon in
   Lila statt Marken-Akzent, dieselbe KI-Signalfarbe wie .ckpt-ai-label-badge/--ai-purple überall
   sonst im Portal (siehe Kommentar dort). */
.lc-settings-tile-icon-ai { background:color-mix(in srgb, var(--ai-purple) 14%, transparent); color:var(--ai-purple); }
.lc-settings-tile-body { flex:1; min-width:0; }
.lc-settings-tile-title { font-size:13px; font-weight:700; color:var(--text-main); margin-bottom:4px; }
.lc-settings-tile-desc { font-size:11px; color:var(--text-muted); line-height:1.5; }
.lc-settings-tile-arrow { flex:none; color:var(--text-muted); margin-top:8px; transition:transform .15s; }
.lc-settings-tile:hover .lc-settings-tile-arrow { transform:translateX(2px); color:var(--brand-accent); }
.lc-settings-detail-back { display:inline-flex; align-items:center; gap:6px; background:none; border:none; color:var(--text-muted); font-size:12px; font-weight:600; cursor:pointer; padding:6px 0; margin-bottom:14px; }
.lc-settings-detail-back:hover { color:var(--brand-accent); }

/* Einstellungen-Kacheln (lead_controlling.php, Kachel/Detail-Übersicht): optionaler Status-Badge,
   zeigt den aktuell gespeicherten Wert/Zustand direkt auf der Kachel an (ohne sie öffnen zu müssen). */
.lc-settings-tile-badge { display:inline-flex; align-items:center; gap:5px; margin-top:6px; padding:3px 9px; border-radius:999px; font-size:10.5px; font-weight:700; letter-spacing:.2px; background:rgba(255,255,255,.06); color:var(--text-muted); border:1px solid var(--panel-border); }
.lc-settings-tile-badge::before { content:''; width:6px; height:6px; border-radius:50%; background:currentColor; flex:none; }
.lc-settings-tile-badge.is-on { background:rgba(0,200,81,.12); border-color:rgba(0,200,81,.35); color:var(--success-green); }
.lc-settings-tile-badge.is-off { background:rgba(255,255,255,.04); border-color:var(--panel-border); color:var(--text-muted); }
.lc-settings-tile-badge.is-info { background:rgba(197,164,126,.12); border-color:rgba(197,164,126,.35); color:var(--accent-gold); }

/* Terminkonflikt-Hinweis im Kalender-Modal: bewusst auffällig (rot, Glow-Pulse, Icon-Wackeln),
   sitzt direkt unter Beginn/Ende – darf im Formular nicht "untergehen" wie ein normaler Hinweis. */
.lc-cal-conflict-box {
    margin:2px 0 4px; padding:12px 14px; border-radius:10px;
    border:1.5px solid var(--danger-red);
    background:color-mix(in srgb, var(--danger-red) 10%, var(--panel-bg));
    animation: lcCalConflictPop .32s cubic-bezier(.34,1.56,.64,1), lcCalConflictGlow 1.6s ease-in-out .32s infinite;
}
.lc-cal-conflict-title { display:flex; align-items:center; gap:8px; font-size:12.5px; font-weight:800; letter-spacing:.2px; color:var(--danger-red); margin-bottom:7px; }
.lc-cal-conflict-title svg { flex-shrink:0; animation: lcCalConflictShake 1.6s ease-in-out .32s infinite; }
.lc-cal-conflict-list { font-size:12px; color:var(--text-main); line-height:1.6; }
@keyframes lcCalConflictPop {
    0%   { transform:scale(.93); opacity:0; }
    60%  { transform:scale(1.015); opacity:1; }
    100% { transform:scale(1); opacity:1; }
}
@keyframes lcCalConflictGlow {
    0%, 100% { box-shadow:0 0 0 0 color-mix(in srgb, var(--danger-red) 35%, transparent); }
    50%      { box-shadow:0 0 0 6px color-mix(in srgb, var(--danger-red) 0%, transparent); }
}
@keyframes lcCalConflictShake {
    0%, 88%, 100% { transform:rotate(0deg); }
    90% { transform:rotate(-10deg); }
    92% { transform:rotate(9deg); }
    94% { transform:rotate(-7deg); }
    96% { transform:rotate(5deg); }
    98% { transform:rotate(-3deg); }
}
@media (max-width: 760px) {
    .lc-cal-toolbar { flex-direction:column; align-items:stretch; }
    .lc-cal-vt-picker { min-width:0; }
    .lc-cal-ical-row { flex-wrap:wrap; }
}
/* FullCalendars eigene Kopfzeile (prev/next/heute | Titel | Ansicht-Buttons) ist standardmäßig
   eine einzige nicht umbrechende Flex-Zeile – auf Smartphone-Breite überlappten sich Titel und
   Ansicht-Buttons dadurch. Auf schmalen Screens wird die Kopfzeile stattdessen in 3 zentrierte,
   selbst umbrechende Zeilen gestapelt (prev/next/heute, Titel, Ansicht-Umschalter). */
@media (max-width: 600px) {
    .lc-cal-wrap { padding:10px; }
    .lc-cal-wrap .fc-header-toolbar { flex-direction:column; align-items:stretch; gap:8px; margin-bottom:12px !important; }
    .lc-cal-wrap .fc-toolbar-chunk { display:flex; justify-content:center; flex-wrap:wrap; gap:6px; }
    .lc-cal-wrap .fc-toolbar-title { text-align:center; font-size:14px; }
    .lc-cal-wrap .fc-button { padding:6px 9px; font-size:12.5px; }
    .lc-cal-wrap .fc-col-header-cell-cushion { font-size:11px; padding:4px 2px; }
    .lc-cal-wrap .fc-daygrid-day-number { font-size:11px; padding:3px; }
}

/* Gantt-/Auslastungsansicht im Veranstaltungs-Modal (analog Outlook-Planungsassistent): je
   ausgewähltem Fachberater eine Zeitleisten-Zeile über den Kalendertag der geplanten Veranstaltung,
   graue Blöcke = bestehende Termine/Veranstaltungen, rot = überschneidet sich mit der geplanten
   Zeit, goldener Rahmen (.lc-event-gantt-target) markiert die geplante Veranstaltung selbst und ist
   per Maus/Touch verschiebbar (Drag) sowie über die Griffe an den Rändern in der Dauer veränderbar
   (Resize) — siehe lcEventBindGanttDrag() in lead_controlling.php, synct live in #event-start/-end. */
.lc-event-gantt { border:1px solid var(--panel-border); border-radius:10px; background:var(--bg-dark); padding:10px 12px 8px; }
.lc-event-gantt-hours { position:relative; height:16px; margin-bottom:4px; }
.lc-event-gantt-hour { position:absolute; top:0; transform:translateX(-50%); font-size:10px; color:var(--text-muted); white-space:nowrap; }
.lc-event-gantt-row { display:flex; align-items:center; gap:10px; padding:5px 0; border-top:1px solid var(--panel-border); }
.lc-event-gantt-row:first-of-type { border-top:none; }
.lc-event-gantt-name { flex:0 0 120px; font-size:12px; font-weight:600; color:var(--text-main); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.lc-event-gantt-name.is-conflict { color:var(--danger-red); }
.lc-event-gantt-track { position:relative; flex:1 1 auto; height:20px; background:var(--panel-bg); border-radius:5px; overflow:visible; }
.lc-event-gantt-block { position:absolute; top:2px; bottom:2px; background:var(--text-muted); border-radius:3px; opacity:.55; }
.lc-event-gantt-block.is-conflict { background:var(--danger-red); opacity:.85; }
.lc-event-gantt-target { position:absolute; top:-1px; bottom:-1px; z-index:2; border:2px solid var(--accent-gold); border-radius:4px; background:color-mix(in srgb, var(--accent-gold) 18%, transparent); cursor:grab; touch-action:none; user-select:none; }
.lc-event-gantt-target:active,
.lc-event-gantt-target.is-dragging { cursor:grabbing; background:color-mix(in srgb, var(--accent-gold) 28%, transparent); }
.lc-event-gantt-resize-handle { position:absolute; top:0; bottom:0; width:8px; cursor:ew-resize; }
.lc-event-gantt-resize-handle[data-side="left"] { left:-4px; }
.lc-event-gantt-resize-handle[data-side="right"] { right:-4px; }
@media (max-width: 760px) {
    .lc-event-gantt-name { flex-basis:80px; font-size:11px; }
}

/* ── Bewerbermanagement (html/modules/admin_bewerber.php), Präfix bw- — vollständig zentralisiert
   (vorher modul-eigener <style>-Block). .btn/.btn-gold/.btn-outline werden NICHT hier dupliziert,
   die sind bereits global in admin.php definiert. Echtes responsives Verhalten (Handy + große
   Monitore) über die Mobile-Media-Query am Ende dieses Abschnitts. ── */
.bw-page { padding: 28px 32px; }
.bw-page-title { font-size: 22px; font-weight: 500; color: var(--text-main); margin: 0 0 22px; }

/* Tabs (identisches Prinzip wie Einstellungen/Kundendienst) */
.bw-tabs { margin-bottom: 22px; width: 100%; }

.bw-tab-panel { display: none; }
.bw-tab-panel.active { display: block; animation: bwFadeIn .25s ease; }
@keyframes bwFadeIn { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:translateY(0); } }

/* Toolbar */
.bw-toolbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:16px; }
.bw-search-wrap { position:relative; flex:1; min-width:230px; max-width:340px; }
.bw-search-wrap svg { position:absolute; left:10px; top:50%; transform:translateY(-50%); color:var(--text-muted); pointer-events:none; }
.bw-search { width:100%; box-sizing:border-box; padding:8px 10px 8px 33px; border:1px solid var(--panel-border); border-radius:8px; background:var(--input-bg); color:var(--text-main); font-size:13px; outline:none; transition:border-color .15s; }
.bw-search:focus { border-color:var(--accent-gold); }
.bw-filter { display:inline-flex; gap:6px; flex-wrap:wrap; }
.bw-chip { border:1px solid var(--panel-border); border-radius:999px; padding:5px 10px; font-size:11px; color:var(--text-muted); cursor:pointer; background:var(--panel-bg); transition:.12s; }
.bw-chip:hover { color:var(--text-main); }
.bw-chip.active { color:var(--accent-gold); border-color:var(--accent-gold); background:rgba(102,157,36,.08); }
.bw-count { margin-left:auto; font-size:11px; color:var(--text-muted); white-space:nowrap; }

/* Archiv-Umschalter (Abgelehnt/Zurückgezogen ein-/ausblenden) */
.bw-archive-toggle { display:inline-flex; align-items:center; gap:8px; cursor:pointer; user-select:none; font-size:12px; color:var(--text-muted); white-space:nowrap; }
.bw-archive-toggle input { display:none; }
.bw-toggle-track { position:relative; width:34px; height:19px; background:rgba(255,255,255,0.12); border-radius:10px; flex-shrink:0; transition:background .2s; }
.bw-toggle-track::before { content:''; position:absolute; width:14px; height:14px; left:2.5px; top:2.5px; background:#fff; border-radius:50%; transition:transform .2s; }
.bw-archive-toggle input:checked ~ .bw-toggle-track { background:var(--accent-gold); }
.bw-archive-toggle input:checked ~ .bw-toggle-track::before { transform:translateX(15px); }

/* Kanban-Board — auf Desktop flexible Spaltenbreite, auf Mobile Swipe-Karussell (siehe Media-Query) */
.bw-board { display:flex; align-items:flex-start; gap:14px; overflow-x:auto; padding-bottom:10px; }
.bw-column { flex:1 1 230px; max-width:300px; background:var(--panel-bg); border:1px solid var(--panel-border); border-radius:14px; display:flex; flex-direction:column; max-height: calc(100vh - 320px); min-height: 260px; box-shadow:0 2px 10px rgba(0,0,0,.10); }
.bw-column.is-archive { flex:0 0 230px; opacity:.82; }
.bw-column.is-archive .bw-column-head::before { opacity:.06; }
.bw-board-divider { flex:0 0 auto; align-self:stretch; display:flex; flex-direction:column; align-items:center; gap:8px; padding:6px 2px; }
.bw-board-divider::before, .bw-board-divider::after { content:''; flex:1; width:1px; background:var(--panel-border); }
.bw-board-divider span { writing-mode:vertical-rl; text-transform:uppercase; letter-spacing:.08em; font-size:10px; font-weight:700; color:var(--text-muted); white-space:nowrap; }
.bw-column-head { display:flex; align-items:center; gap:8px; padding:13px 14px 11px; border-bottom:1px solid var(--panel-border); border-radius:14px 14px 0 0; position:relative; overflow:hidden; }
.bw-column-head::before { content:''; position:absolute; inset:0; opacity:.10; background: var(--bw-col-color, var(--accent-gold)); }
.bw-column-dot { width:9px; height:9px; border-radius:50%; background:var(--bw-col-color, var(--accent-gold)); flex-shrink:0; position:relative; box-shadow: 0 0 0 3px color-mix(in srgb, var(--bw-col-color, var(--accent-gold)) 20%, transparent); }
.bw-column-title { font-size:12.5px; font-weight:700; color:var(--text-main); position:relative; flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bw-column-count { font-size:10.5px; color:var(--text-muted); background:var(--bg-dark); border:1px solid var(--panel-border); border-radius:20px; padding:1px 8px; position:relative; flex-shrink:0; }
.bw-column-body { flex:1; overflow-y:auto; padding:10px; display:flex; flex-direction:column; gap:9px; transition:background .15s; min-height:80px; }
.bw-column-body.drag-over { background: color-mix(in srgb, var(--bw-col-color, var(--accent-gold)) 8%, transparent); outline:2px dashed var(--bw-col-color, var(--accent-gold)); outline-offset:-4px; border-radius:8px; }
.bw-column-empty { color:var(--text-muted); font-size:11px; text-align:center; padding:18px 6px; opacity:.6; }

/* Wiedervorlagen: eigenständige Liste unterhalb des Kanban-Boards, siehe bwRenderReminders()
   in admin_bewerber.php und hbb_applicant_reminders in db.php. Bewerber bleiben dabei immer
   in ihrer Pipeline-Phase, die Wiedervorlage ist rein zusätzlich. */
.bw-reminders-section { margin-top:22px; }
.bw-reminders-head { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; margin-bottom:12px; }
.bw-reminders-title { display:flex; align-items:center; gap:8px; margin:0; }
.bw-reminders-title svg { color:var(--accent-gold); flex-shrink:0; }
.bw-reminders-count { display:inline-flex; align-items:center; justify-content:center; min-width:20px; height:20px; padding:0 7px; border-radius:20px; background:color-mix(in srgb, var(--accent-gold) 16%, transparent); border:1px solid color-mix(in srgb, var(--accent-gold) 40%, transparent); color:var(--accent-gold); font-size:11px; font-weight:700; }
.bw-reminder-list { display:flex; flex-direction:column; gap:10px; }
.bw-reminder-empty { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; padding:38px 20px; color:var(--text-muted); font-size:12.5px; background:var(--panel-bg); border:1px dashed var(--panel-border); border-radius:14px; }
.bw-reminder-empty svg { opacity:.35; }

.bw-reminder-card {
    display:flex; align-items:center; gap:14px; background:var(--panel-bg); border:1px solid var(--panel-border);
    border-left:3px solid var(--panel-border); border-radius:12px; padding:12px 14px; cursor:pointer;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.bw-reminder-card:hover { transform:translateY(-2px); box-shadow:0 6px 16px rgba(0,0,0,.16); }
.bw-reminder-card.is-overdue { border-left-color:var(--danger-red); }
.bw-reminder-card.is-today { border-left-color:#d9a441; }
.bw-reminder-card.is-upcoming { border-left-color:var(--accent-gold); }
.bw-reminder-card.is-done { border-left-color:#00C851; opacity:.62; }
.bw-reminder-avatar { width:38px; height:38px; border-radius:50%; flex-shrink:0; background-size:cover; background-position:center; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; color:#fff; }
.bw-reminder-body { flex:1; min-width:0; }
.bw-reminder-row1 { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.bw-reminder-name { font-size:13.5px; font-weight:600; color:var(--text-main); }
.bw-reminder-comment { font-size:12px; color:var(--text-muted); margin-top:3px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:520px; }
.bw-reminder-row2 { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-top:6px; }
.bw-reminder-due { display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:600; color:var(--text-muted); }
.bw-reminder-due svg { flex-shrink:0; }
.bw-reminder-due.is-overdue { color:var(--danger-red); }
.bw-reminder-due.is-today { color:#d9a441; }
.bw-reminder-due.is-upcoming { color:var(--accent-gold); }
.bw-reminder-assigned { font-size:11px; color:var(--text-muted); }
.bw-reminder-side { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.bw-reminder-action-btn { display:inline-flex; align-items:center; gap:6px; padding:6px 11px; border-radius:20px; font-size:11.5px; font-weight:600; border:1px solid var(--panel-border); background:var(--bg-dark); color:var(--text-muted); text-decoration:none; transition:.15s; cursor:pointer; }
.bw-reminder-action-btn:hover { color:var(--accent-gold); border-color:rgba(102,157,36,.4); }
.bw-reminder-action-btn.is-static { cursor:default; opacity:.6; }
.bw-reminder-action-btn.is-static:hover { color:var(--text-muted); border-color:var(--panel-border); }
.bw-reminder-controls { display:flex; align-items:center; gap:6px; }
.bw-icon-btn.success:hover { color:#00C851; border-color:rgba(0,200,81,.4); }

/* Wiedervorlage-Indikator (Glocke) in Kanban-Karte, Tabelle und mobiler Listenkarte */
.bw-reminder-btn.has-reminder { color:var(--accent-gold); border-color:rgba(102,157,36,.4); }
.bw-reminder-btn.has-reminder.is-overdue { color:var(--danger-red); border-color:rgba(255,68,68,.4); }
.bw-reminder-btn.has-reminder.is-today { color:#d9a441; border-color:rgba(217,164,65,.45); }

/* Wiedervorlage-Modal */
.bw-reminder-box { width:min(96vw, 480px); }
.bw-reminder-modal-person { margin:-6px 0 16px; font-size:12.5px; color:var(--text-muted); }

.bw-card { background:var(--bg-dark); border:1px solid var(--panel-border); border-left:3px solid var(--bw-col-color, var(--accent-gold)); border-radius:10px; padding:11px 12px; cursor:grab; transition: transform .15s, box-shadow .15s, border-color .15s; }
.bw-card:hover { border-color: color-mix(in srgb, var(--bw-col-color, var(--accent-gold)) 45%, var(--panel-border)); border-left-color:var(--bw-col-color, var(--accent-gold)); box-shadow: 0 4px 14px rgba(0,0,0,.18); transform: translateY(-2px); }
.bw-card.dragging { opacity:.4; cursor:grabbing; }
.bw-card-top { display:flex; align-items:center; gap:9px; margin-bottom:8px; }
.bw-card-avatar { width:32px; height:32px; border-radius:50%; flex-shrink:0; background-size:cover; background-position:center; display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:700; color:#fff; }
.bw-card-name { font-size:13px; font-weight:600; color:var(--text-main); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bw-card-position { font-size:11px; color:var(--text-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-bottom:6px; }
.bw-card-meta { position:relative; display:flex; align-items:center; justify-content:space-between; gap:6px; }
.bw-card-stars { display:flex; gap:1px; color: #d9a441; }
.bw-card-stars svg { width:11px; height:11px; }
.bw-card-days { font-size:9.5px; color:var(--text-muted); background:var(--panel-bg); border:1px solid var(--panel-border); border-radius:20px; padding:1px 7px; white-space:nowrap; }

/* Absage-Erteilt-Switch – ersetzt in der Kanban-Karte die Sterne-Bewertung im Status "Abgelehnt"
   (bwRenderRejectionToggle), da die Bewertung nach einer Absage zweitrangig ist. Gedämpftes Grün
   (statt reinem #00C851) für besseren Kontrast/weniger Neon-Wirkung. */
.bw-rejection-switch { display:inline-flex; align-items:center; gap:6px; padding:0; border:none; background:none; cursor:pointer; font-size:10px; font-weight:600; color:#d9a441; white-space:nowrap; }
.bw-rejection-switch:disabled { cursor:default; opacity:.55; }
.bw-rejection-switch-track { position:relative; width:24px; height:13px; border-radius:20px; flex-shrink:0; background:color-mix(in srgb, #d9a441 14%, transparent); border:1px solid color-mix(in srgb, #d9a441 40%, transparent); transition:background .15s, border-color .15s; }
.bw-rejection-switch-thumb { position:absolute; top:1px; left:1px; width:9px; height:9px; border-radius:50%; background:#d9a441; transition:transform .15s, background .15s; }
.bw-rejection-switch.is-sent { color:#3d9a68; }
.bw-rejection-switch.is-sent .bw-rejection-switch-track { background:color-mix(in srgb, #3d9a68 18%, transparent); border-color:color-mix(in srgb, #3d9a68 45%, transparent); }
.bw-rejection-switch.is-sent .bw-rejection-switch-thumb { transform:translateX(11px); background:#3d9a68; }

/* Statistiken: Zeitraum-Auswahl 1:1 wie in der Kalkulation-Statistik übernommen (dort
   kalk-qrange/kalk-qr-btn/kalk-ts-header/kalk-date-row/kalk-date-sel, siehe admin_kalkulation.php),
   hier bw-präfigiert und mit --accent-gold statt --brand-accent (Bewerber-CSS-Konvention). */
.bw-qrange { display:flex; gap:4px; flex-wrap:wrap; }
.bw-qr-btn { background:none; border:1px solid var(--panel-border); border-radius:6px; padding:4px 10px; font-size:11px; color:var(--text-muted); cursor:pointer; transition:.12s; white-space:nowrap; font-family:inherit; }
.bw-qr-btn:hover { border-color:var(--accent-gold); color:var(--accent-gold); }
.bw-qr-btn.active { background:var(--accent-gold); color:#fff; border-color:var(--accent-gold); }
.bw-ts-header { border:1px solid var(--panel-border); border-radius:12px; padding:14px 16px; margin-bottom:16px;
                position:sticky; top:-30px; z-index:40;
                backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px);
                background:color-mix(in srgb, var(--panel-bg) 80%, transparent);
                transition:box-shadow .2s ease, border-radius .2s ease; }
.bw-ts-header.bw-stuck { box-shadow:0 4px 22px rgba(0,0,0,.55); border-radius:0 0 12px 12px; }
.bw-date-row { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.bw-date-sel { background:rgba(0,0,0,.2); border:1px solid var(--panel-border); border-radius:8px; padding:6px 10px; color:var(--text-main); font-size:12px; outline:none; font-family:inherit; }
.bw-date-sel:focus { border-color:var(--accent-gold); }
.bw-date-apply-btn { background:none; border:1px solid var(--accent-gold); color:var(--accent-gold); border-radius:8px; padding:6px 14px; font-size:12px; font-weight:600; cursor:pointer; transition:filter .15s, transform .12s; font-family:inherit; }
.bw-date-apply-btn:hover { filter:brightness(1.15); transform:translateY(-1px); }
.bw-stat-sub { font-size:11px; color:var(--text-muted); }

.bw-stat-hint { font-size:11.5px; color:var(--text-muted); margin:-6px 0 14px; }
.bw-stat-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(200px,1fr)); gap:14px; margin-bottom:22px; }
.bw-stat-card { background:var(--panel-bg); border:1px solid var(--panel-border); border-radius:14px; padding:16px 18px; position:relative; overflow:hidden; }
.bw-stat-card::after { content:''; position:absolute; inset:0; background: radial-gradient(220px 160px at 100% 0%, color-mix(in srgb, var(--accent-gold) 12%, transparent), transparent 75%); pointer-events:none; }
.bw-stat-value { font-size:26px; font-weight:700; color:var(--text-main); position:relative; }
.bw-stat-label { font-size:11.5px; color:var(--text-muted); margin-top:4px; position:relative; }
.bw-section-card { background:var(--panel-bg); border:1px solid var(--panel-border); border-radius:14px; padding:18px 20px; margin-bottom:16px; }
.bw-section-title { font-size:13px; font-weight:700; color:var(--text-main); margin:0 0 14px; }
.bw-chartjs { width:100%; }
.bw-funnel-row { display:grid; grid-template-columns:120px 1fr 40px; align-items:center; gap:10px; margin-bottom:10px; }
.bw-funnel-row.bw-stage-row { grid-template-columns:190px 1fr 50px; }
.bw-funnel-label { font-size:12px; color:var(--text-main); }
.bw-funnel-track { height:10px; background:var(--bg-dark); border-radius:6px; overflow:hidden; }
.bw-funnel-bar { height:100%; border-radius:6px; transition: width .5s cubic-bezier(.4,0,.2,1); }
.bw-funnel-count { font-size:12px; color:var(--text-muted); text-align:right; }
.bw-source-row { display:grid; grid-template-columns:140px 1fr 34px; align-items:center; gap:10px; margin-bottom:9px; }
.bw-source-label { font-size:12px; color:var(--text-main); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bw-source-track { height:8px; background:var(--bg-dark); border-radius:6px; overflow:hidden; }
.bw-source-bar { height:100%; border-radius:6px; background:var(--accent-gold); transition: width .5s cubic-bezier(.4,0,.2,1); }
.bw-source-count { font-size:11.5px; color:var(--text-muted); text-align:right; }

/* Tabelle */
.bw-table-wrap { overflow-x:auto; }
.bw-table { width:100%; border-collapse:separate; border-spacing:0 8px; }
.bw-table th { padding:11px 14px; color:var(--text-muted); font-size:11px; text-transform:uppercase; letter-spacing:.7px; text-align:left; }
.bw-table td { background:var(--panel-bg); border-top:1px solid var(--panel-border); border-bottom:1px solid var(--panel-border); padding:11px 14px; font-size:13px; color:var(--text-main); vertical-align:middle; }
.bw-table tr td:first-child { border-left:1px solid var(--panel-border); border-radius:10px 0 0 10px; }
.bw-table tr td:last-child { border-right:1px solid var(--panel-border); border-radius:0 10px 10px 0; }
.bw-table tr:hover td { border-color: rgba(102,157,36,.35); }
.bw-row-name { display:flex; align-items:center; gap:10px; }
.bw-badge { display:inline-flex; align-items:center; padding:3px 10px; border-radius:20px; font-size:11px; font-weight:600; border:1px solid; }
.bw-icon-btn { background:none; border:1px solid var(--panel-border); color:var(--text-muted); border-radius:6px; padding:5px 8px; cursor:pointer; transition:.12s; display:inline-flex; }
.bw-icon-btn:hover { color:var(--accent-gold); border-color:rgba(102,157,36,.4); }
.bw-icon-btn.danger:hover { color:var(--danger-red); border-color:rgba(255,68,68,.4); }
.bw-empty-state { text-align:center; padding:50px 20px; color:var(--text-muted); }
.bw-empty-state svg { opacity:.35; margin-bottom:10px; }

/* Mobile-Kartenlayout für den Liste-Tab (Ersatz für die Tabelle unter 768px, siehe
   bwRenderTable()/bwRenderListCards() in admin_bewerber.php) — auf Desktop nicht sichtbar,
   Umschaltung passiert komplett per Media-Query weiter unten. */
.bw-list-cards { display: none; flex-direction: column; gap: 10px; }
.bw-list-card { background:var(--panel-bg); border:1px solid var(--panel-border); border-radius:12px; padding:12px 14px; cursor:pointer; transition:border-color .12s; }
.bw-list-card:hover { border-color: rgba(102,157,36,.35); }
.bw-list-card-top { display:flex; align-items:center; gap:10px; }
.bw-list-card-id { flex:1; min-width:0; }
.bw-list-card-name { font-size:14px; font-weight:600; color:var(--text-main); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bw-list-card-position { font-size:11.5px; color:var(--text-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-top:1px; }
.bw-list-card-badge { flex-shrink:0; }
.bw-list-card-meta { display:flex; align-items:center; flex-wrap:wrap; gap:5px; font-size:11.5px; color:var(--text-muted); margin-top:8px; }
.bw-list-card-dot { opacity:.5; }
.bw-list-card-actions { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-top:10px; padding-top:10px; border-top:1px solid var(--panel-border); }

/* Modal */
.bw-modal-overlay { display:none; position:fixed; inset:0; z-index:1200; background:rgba(0,0,0,.82); backdrop-filter:blur(5px); justify-content:center; align-items:center; padding:20px; }
.bw-modal-overlay.is-open { display:flex; }
.bw-modal-box { background:var(--panel-bg); border:1px solid var(--panel-border); border-radius:14px; width:min(96vw, 720px); max-height:92vh; overflow:hidden; display:flex; flex-direction:column; }
.bw-modal-head { padding:18px 22px 14px; border-bottom:1px solid var(--panel-border); display:flex; align-items:center; justify-content:space-between; flex-shrink:0; }
.bw-modal-head h3 { margin:0; font-size:16px; font-weight:600; color:var(--accent-gold); }
.bw-modal-head-title-row { display:flex; align-items:center; gap:9px; min-width:0; }
.bw-modal-sub { display:inline-flex; align-items:center; flex-shrink:0; font-size:10.5px; font-weight:600; color:var(--text-muted); background:var(--bg-dark); border:1px solid var(--panel-border); border-radius:20px; padding:3px 10px; white-space:nowrap; }
.bw-modal-close { background:none; border:none; color:var(--text-muted); cursor:pointer; padding:4px; border-radius:6px; }
.bw-modal-close:hover { color:var(--text-main); }
.bw-modal-body { flex:1; overflow-y:auto; padding:18px 22px; }
.bw-modal-foot { padding:14px 22px; border-top:1px solid var(--panel-border); display:flex; gap:8px; justify-content:flex-end; flex-shrink:0; }

/* Modal-Subtabs (Stammdaten/Dokumente/Verlauf) */
.bw-dtabs { margin-bottom: 16px; }
.bw-dtab-panel { display:none; }
.bw-dtab-panel.active { display:block; }
.bw-dtab-hint { color:var(--text-muted); font-size:12.5px; padding:24px 0; text-align:center; }

/* Hero-Namensbereich: direkt anklickbare "unsichtbare" Textfelder */
.bw-avatar-section { display:flex; align-items:flex-start; gap:20px; margin-bottom:28px; }
.bw-avatar-wrap { position:relative; width:74px; height:74px; flex-shrink:0; }
.bw-avatar-big {
    width:74px; height:74px; border-radius:50%; background-size:cover; background-position:center;
    display:flex; align-items:center; justify-content:center; font-size:22px; font-weight:700; color:#fff;
    border:2px solid var(--accent-gold); box-shadow:0 4px 14px rgba(0,0,0,.25); cursor:pointer;
    transition:opacity .15s, transform .2s cubic-bezier(.4,0,.2,1);
}
.bw-avatar-big:hover { opacity:.88; transform:scale(1.03); }
.bw-avatar-wrap::after { content:''; position:absolute; top:100%; left:50%; transform:translateX(-50%); width:96px; height:14px; }
.bw-avatar-menu {
    position:absolute; top:100%; left:50%; margin-top:4px; z-index:5; white-space:nowrap;
    display:flex; gap:5px; padding:5px; border-radius:20px;
    opacity:0; visibility:hidden; pointer-events:none; transform:translate(-50%,-6px);
    transition:opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}
.bw-avatar-wrap:hover .bw-avatar-menu, .bw-avatar-menu:hover {
    opacity:1; visibility:visible; pointer-events:auto; transform:translate(-50%,0);
    transition:opacity .18s ease, transform .18s ease, visibility 0s;
}
.bw-avatar-menu-btn {
    width:28px; height:28px; border-radius:50%; padding:0; flex-shrink:0; cursor:pointer;
    display:flex; align-items:center; justify-content:center;
    background:var(--bg-dark); border:1px solid var(--panel-border); color:var(--text-muted); transition:.15s;
}
.bw-avatar-menu-btn:hover { border-color:var(--accent-gold); color:var(--accent-gold); background:rgba(102,157,36,.08); transform:scale(1.08); }
.bw-avatar-menu-btn.danger:hover { border-color:var(--danger-red); color:var(--danger-red); background:rgba(255,68,68,.08); }
.bw-hero-info { flex:1; min-width:0; padding-top:2px; }
.bw-hero-name-row { display:flex; align-items:baseline; gap:8px; }
.bw-hero-salutation { flex:0 0 58px; background:none; border:none; border-bottom:2px solid transparent; color:var(--text-muted); font-size:13.5px; font-weight:500; padding:4px 2px 6px; outline:none; cursor:pointer; font-family:inherit; border-radius:4px 4px 0 0; transition:border-color .2s, background .2s, color .2s; }
.bw-hero-salutation:hover { background:rgba(255,255,255,.04); border-bottom-color:var(--panel-border); }
.bw-hero-salutation:focus { border-bottom-color:var(--accent-gold); color:var(--text-main); }
.bw-hero-input { flex:1; min-width:0; background:none; border:none; border-bottom:2px solid transparent; color:var(--text-main); font-size:23px; font-weight:600; letter-spacing:.2px; padding:4px 3px 6px; outline:none; font-family:inherit; border-radius:4px 4px 0 0; transition:border-color .2s, background .2s; }
.bw-hero-input::placeholder { color:var(--text-muted); font-weight:500; opacity:.5; }
.bw-hero-input:hover { border-bottom-color:var(--panel-border); background:rgba(255,255,255,.03); }
.bw-hero-input:focus { border-bottom-color:var(--accent-gold); background:rgba(102,157,36,.06); }
.bw-hero-position { display:block; width:100%; max-width:360px; margin-top:6px; background:none; border:none; border-bottom:1.5px solid transparent; color:var(--accent-gold); font-size:13px; font-weight:600; padding:4px 3px 7px; outline:none; font-family:inherit; box-sizing:border-box; border-radius:4px 4px 0 0; transition:border-color .2s, background .2s; }
.bw-hero-position::placeholder { color:var(--text-muted); font-weight:500; opacity:.6; }
.bw-hero-position:hover { border-bottom-color:var(--panel-border); background:rgba(255,255,255,.03); }
.bw-hero-position:focus { border-bottom-color:var(--accent-gold); background:rgba(102,157,36,.06); }

/* Stammdaten-Formular in thematische Abschnitte gruppiert (Kontakt/Adresse/Bewerbung/Notizen)
   statt eines einzigen 16-Felder-Rasters – bessere Übersicht ohne die Feld-Optik zu ändern. */
.bw-form-section { margin-bottom:22px; }
.bw-form-section:last-child { margin-bottom:0; }
.bw-form-section-title { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.6px; color:var(--text-muted); margin:0 0 12px; padding-top:16px; border-top:1px solid var(--panel-border); }
.bw-form-section:first-child .bw-form-section-title { padding-top:0; border-top:none; }

/* Formularfelder: Floating-Label + animierter Gold-Unterstrich statt Kasten */
.bw-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px 18px; }
.bw-field { position:relative; display:flex; flex-direction:column; }
.bw-field.span-2 { grid-column: 1 / -1; }
.bw-field label {
    position:absolute; left:2px; top:12px; font-size:13px; color:var(--text-muted); pointer-events:none;
    transition:top .18s cubic-bezier(.4,0,.2,1), font-size .18s cubic-bezier(.4,0,.2,1), color .18s, letter-spacing .18s;
    transform-origin:left top; z-index:1;
}
.bw-field input, .bw-field select, .bw-field textarea {
    position:relative; background:transparent; border:none; border-bottom:1.5px solid var(--panel-border); border-radius:0;
    padding:19px 22px 7px 2px; color:var(--text-main); font-size:14px; outline:none; box-sizing:border-box;
    font-family:inherit; width:100%; transition:border-color .2s;
}
.bw-field textarea { padding-top:22px; min-height:64px; resize:vertical; }
.bw-field input:hover, .bw-field select:hover, .bw-field textarea:hover { border-bottom-color: color-mix(in srgb, var(--accent-gold) 35%, var(--panel-border)); }
.bw-field::after {
    content:''; position:absolute; left:0; right:0; bottom:0; height:2px; background:var(--accent-gold);
    transform:scaleX(0); transition:transform .28s cubic-bezier(.4,0,.2,1); pointer-events:none;
}
.bw-field.is-focused::after { transform:scaleX(1); }
.bw-field.is-focused label, .bw-field.has-value label { top:-3px; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; }
.bw-field.is-focused label { color:var(--accent-gold); }
.bw-field:not(.bw-field-static) input::placeholder,
.bw-field:not(.bw-field-static) textarea::placeholder { color:transparent; }
.bw-field:not(.bw-field-static).is-focused input::placeholder,
.bw-field:not(.bw-field-static).is-focused textarea::placeholder { color:var(--text-muted); }
.bw-field-icon { position:absolute; right:2px; bottom:9px; display:flex; color:var(--text-muted); pointer-events:none; opacity:.7; transition:color .2s, opacity .2s; }
.bw-field.is-focused .bw-field-icon { color:var(--accent-gold); opacity:1; }
.bw-field-icon-txt { font-size:14px; font-weight:700; }
.bw-field-icon-date { pointer-events:auto; cursor:pointer; }
.bw-date-native { position:absolute !important; right:0; bottom:0; width:22px !important; height:22px !important; padding:0 !important; border:none !important; opacity:0; cursor:pointer; z-index:2; }
.bw-field.bw-field-static label { position:static; font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.5px; color:var(--text-muted); margin-bottom:6px; }
.bw-field.bw-field-static::after { display:none; }

/* E-Mail Privat/Geschäftlich: Mini-Toggle oben rechts im Feld statt 2 dauerhaft sichtbarer Zeilen. */
.bw-field-kind-toggle { position:absolute; top:2px; right:0; display:flex; gap:3px; z-index:2; }
.bw-field-kind-btn { padding:2px 6px; border:1px solid var(--panel-border); border-radius:5px; background:var(--bg-dark);
    font-size:9px; font-weight:700; text-transform:uppercase; letter-spacing:.3px; color:var(--text-muted); cursor:pointer;
    transition:color .15s, background .15s, border-color .15s; line-height:1.5; }
.bw-field-kind-btn:hover { color:var(--text-main); }
.bw-field-kind-btn.is-active { background:color-mix(in srgb, var(--accent-gold) 16%, transparent); border-color:color-mix(in srgb, var(--accent-gold) 40%, transparent); color:var(--accent-gold); }
.bw-field-kind input { padding-right:22px; }

/* Quelle-Schnellsuche: Vorschlagsliste bereits verwendeter Bezeichnungen (bwRenderSourceSuggestions),
   damit Schreibweisen wie "Social Media"/"SocialMedia" nicht auseinanderlaufen. */
.bw-field-autocomplete { position:relative; }
.bw-autocomplete-list {
    display:none; position:absolute; left:0; right:0; top:calc(100% + 2px); z-index:10;
    max-height:180px; overflow-y:auto; background:var(--panel-bg); border:1px solid var(--panel-border);
    border-radius:8px; box-shadow:0 8px 20px rgba(0,0,0,.25); padding:4px;
}
.bw-autocomplete-list.is-open { display:block; }
.bw-autocomplete-item { padding:7px 10px; border-radius:5px; font-size:13px; color:var(--text-main); cursor:pointer; }
.bw-autocomplete-item:hover { background:rgba(102,157,36,.12); color:var(--accent-gold); }

.bw-star-input { display:flex; gap:3px; cursor:pointer; }
.bw-star-input svg { width:20px; height:20px; color:#3a3a3a; transition:color .1s; }
.bw-star-input svg.filled { color:#d9a441; }

/* Dokumente */
.bw-doc-dropzone {
    position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px;
    padding:28px 20px; margin-bottom:16px; border-radius:12px; border:2px dashed var(--panel-border);
    background:rgba(255,255,255,.02); color:var(--text-muted); text-align:center; cursor:pointer;
    transition:border-color .2s, background .2s, transform .15s;
}
.bw-doc-dropzone svg { color:var(--text-muted); transition:color .2s, transform .3s cubic-bezier(.4,0,.2,1); }
.bw-doc-dropzone:hover { border-color:color-mix(in srgb, var(--accent-gold) 45%, var(--panel-border)); background:rgba(102,157,36,.04); }
.bw-doc-dropzone:hover svg { color:var(--accent-gold); transform:translateY(-2px); }
.bw-doc-dropzone .bw-doc-drop-title { font-size:12.5px; font-weight:600; color:var(--text-main); }
.bw-doc-dropzone .bw-doc-drop-hint { font-size:10.5px; }
.bw-doc-dropzone select { position:relative; z-index:2; }
.bw-doc-dropzone.is-dragover {
    border-color:var(--accent-gold); border-style:solid; background:rgba(102,157,36,.09);
    transform:scale(1.01); box-shadow:0 0 0 4px rgba(102,157,36,.12);
}
.bw-doc-dropzone.is-dragover svg { color:var(--accent-gold); animation:bwDropPulse 1s ease-in-out infinite; }
@keyframes bwDropPulse { 0%,100% { transform:translateY(0) scale(1); } 50% { transform:translateY(-4px) scale(1.08); } }
.bw-doc-list { display:flex; flex-direction:column; gap:8px; }
.bw-doc-row { animation:bwDocRowIn .25s cubic-bezier(.4,0,.2,1); display:flex; align-items:center; gap:10px; background:var(--bg-dark); border:1px solid var(--panel-border); border-radius:9px; padding:10px 12px; }
@keyframes bwDocRowIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
.bw-doc-icon { color:var(--accent-gold); flex-shrink:0; }
.bw-doc-info { flex:1; min-width:0; }
.bw-doc-name { font-size:12.5px; color:var(--text-main); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bw-doc-meta { font-size:10.5px; color:var(--text-muted); }
.bw-doc-type-tag { font-size:9.5px; text-transform:uppercase; letter-spacing:.4px; color:var(--accent-gold); background:rgba(102,157,36,.1); border:1px solid rgba(102,157,36,.3); border-radius:5px; padding:1px 6px; flex-shrink:0; }

/* Verlauf/Aktivitäten */
.bw-activity-add { display:flex; gap:8px; margin-bottom:16px; flex-wrap:wrap; }
.bw-activity-add select { flex:0 0 140px; }
.bw-activity-add textarea { flex:1; min-width:180px; min-height:38px; }
.bw-timeline { position:relative; padding-left:20px; }
.bw-timeline::before { content:''; position:absolute; left:5px; top:6px; bottom:6px; width:1px; background:var(--panel-border); }
.bw-timeline-item { position:relative; padding-bottom:16px; }
.bw-timeline-item:last-child { padding-bottom:0; }
.bw-timeline-dot { position:absolute; left:-20px; top:3px; width:10px; height:10px; border-radius:50%; background:var(--accent-gold); border:2px solid var(--panel-bg); }
.bw-timeline-head { display:flex; align-items:center; gap:8px; margin-bottom:3px; }
.bw-timeline-type { font-size:11px; font-weight:700; color:var(--text-main); }
.bw-timeline-date { font-size:10.5px; color:var(--text-muted); margin-left:auto; }
.bw-timeline-note { font-size:12.5px; color:var(--text-muted); line-height:1.5; white-space:pre-wrap; }
.bw-timeline-del { background:none; border:none; color:var(--text-muted); cursor:pointer; font-size:10px; padding:2px 4px; }
.bw-timeline-del:hover { color:var(--danger-red); }

/* Bewerber-Modul: kleine Abfrage-Modal "Zu welchem Personentyp umwandeln?" beim Wechsel auf Status
   'eingestellt' (siehe bwPromptConvertType() in admin_bewerber.php). Liegt über dem Haupt-Modal. */
.bw-convert-overlay { z-index:1300; }
.bw-convert-box { max-width:420px; }
.bw-convert-intro { color:var(--text-muted); font-size:13px; line-height:1.5; margin:0 0 18px; text-align:left; }
/* Zwei-Optionen-Umschalter (Mitarbeiter/Fachberater) statt Dropdown – Pill-Stil analog .bw-tabs. */
.bw-convert-toggle { display:flex; gap:4px; background:var(--bg-dark); border:1px solid var(--panel-border); border-radius:10px; padding:4px; }
.bw-convert-toggle-btn { flex:1; padding:10px 14px; border:1px solid transparent; border-radius:7px; background:none; font-size:13px; font-weight:600; color:var(--text-muted); cursor:pointer; transition:color .15s, background .15s, border-color .15s; }
.bw-convert-toggle-btn:hover { color:var(--text-main); }
.bw-convert-toggle-btn.is-active { background:var(--panel-bg); border-color:var(--panel-border); color:var(--accent-gold); }

/* Tab "Vertrag & Provision" (Fachberater-Vertrags-/Provisionsdaten, hbb_vertriebler_contracts).
   Buchhaltungsreferenz als natives <details>-Accordion (niedrige Priorität, standardmäßig eingeklappt). */
.bw-vt-accordion { margin:22px 0 0; padding-top:16px; border-top:1px solid var(--panel-border); }
.bw-vt-accordion summary { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.6px; color:var(--text-muted); cursor:pointer; list-style:none; display:flex; align-items:center; gap:6px; }
.bw-vt-accordion summary::-webkit-details-marker { display:none; }
.bw-vt-accordion summary::before { content:'▸'; font-size:10px; transition:transform .15s; }
.bw-vt-accordion[open] summary::before { transform:rotate(90deg); }
.bw-vt-accordion summary:hover { color:var(--text-main); }
.bw-vt-accordion .bw-form-grid { margin-top:14px; }

/* Sektion "Marke & Status" (Tab "Vertrag & Provision"): Checkbox-Label "Bereichsleiter/Gebietsleiter"
   analog .lc-inline-check aus lead_controlling.php. */
.bw-vt-inline-check { display:inline-flex; align-items:center; gap:7px; font-size:12.5px; color:var(--text-main); cursor:pointer; }
.bw-vt-inline-check input { width:14px; height:14px; accent-color:var(--accent-gold); }

/* Team-Picker "Zugeordnete Fachberater" (Bereichsleiter-Zuordnung) – Dropdown-Button + Panel, wird
   beim Öffnen als Fixed-Overlay an <body> angehängt (siehe bwVtToggleTeamDropdown()), analog zum
   Fachberater-Modal in lead_controlling.php (dortige .lc-stage-dropdown-*-Klassen liegen aber im
   modul-eigenen <style>-Block dort, hier eigenständige bw-Klassen da admin_bewerber.php komplett
   nach style.css migriert ist). */
.bw-vt-team-dropdown-wrap { position:relative; }
.bw-vt-team-btn { display:inline-flex; align-items:center; gap:8px; }
.bw-vt-team-btn.has-value { color:var(--accent-gold); border-color:var(--accent-gold); }
.bw-vt-team-panel { display:none; flex-direction:column; width:280px; max-height:320px; padding:8px; }
.bw-vt-team-panel.is-open { display:flex; }
.bw-vt-team-search-input { width:100%; padding:8px 10px; border:1px solid var(--panel-border); border-radius:8px; background:var(--bg-dark); color:var(--text-main); font-size:12.5px; margin-bottom:6px; }
.bw-vt-team-list { overflow-y:auto; max-height:250px; }
.bw-vt-team-item { display:flex; align-items:center; gap:8px; padding:7px 8px; border-radius:7px; font-size:12.5px; color:var(--text-main); cursor:pointer; transition:background .12s; }
.bw-vt-team-item:hover { background:rgba(214,175,84,.1); }
.bw-vt-team-item.is-checked { color:var(--accent-gold); }
.bw-vt-team-item-empty { padding:10px 8px; font-size:12px; color:var(--text-muted); }
.bw-vt-team-checkbox { width:16px; height:16px; border:1.5px solid var(--panel-border); border-radius:4px; display:flex; align-items:center; justify-content:center; flex-shrink:0; color:var(--accent-gold); }
.bw-vt-team-item.is-checked .bw-vt-team-checkbox { border-color:var(--accent-gold); background:rgba(214,175,84,.14); }

/* Zusatzvereinbarungen (mehrere pro Fachberater, hbb_vertriebler_contract_addenda) – voll editierbar
   (Hausart-Pills, Marke, Gültigkeit, Provisions-Sonderwerte), 1:1 zum Fachberater-Modal im
   Lead-Controlling-Modul (siehe .lc-vtc-* dort), hier eigenständige bw-Klassen. */
.bw-vtc-addendum-card { position:relative; border:1px solid var(--panel-border); border-radius:10px; padding:12px 40px 12px 12px; margin-bottom:10px; background:var(--bg-dark); }
.bw-vtc-addendum-card:last-child { margin-bottom:0; }
.bw-vtc-addendum-remove { position:absolute; top:10px; right:10px; background:none; border:none; color:var(--text-muted); cursor:pointer; padding:5px; border-radius:6px; transition:.15s; }
.bw-vtc-addendum-remove:hover { color:var(--danger-red); background:rgba(224,60,60,.1); }
.bw-vtc-hausart-pills { display:flex; flex-wrap:wrap; gap:6px; }
.bw-vtc-hausart-pill { padding:6px 12px; border:1px solid var(--panel-border); border-radius:999px; background:var(--panel-bg); font-size:11.5px; font-weight:600; color:var(--text-muted); cursor:pointer; transition:.15s; user-select:none; }
.bw-vtc-hausart-pill:hover { color:var(--text-main); }
.bw-vtc-hausart-pill.is-active { background:rgba(214,175,84,.14); border-color:var(--accent-gold); color:var(--accent-gold); }
.bw-vtc-addenda-empty { font-size:12px; color:var(--text-muted); padding:6px 2px 10px; }

/* Duplikat-Warnung beim Einstellen (siehe bwPromptDupConfirm() in admin_bewerber.php) – gleiches
   Farbschema wie .ac-dup-candidate/.lc-dup-candidate (bernstein/Warnfarbe statt Fehler-Rot, da es
   sich um einen Hinweis und keinen Blockfehler handelt). */
.bw-dup-list { max-height:220px; overflow-y:auto; margin-top:6px; }
.bw-dup-candidate { padding:7px 0; border-top:1px solid rgba(255,193,7,.2); font-size:12px; color:var(--text-main); }
.bw-dup-candidate:first-of-type { border-top:none; }
.bw-dup-candidate-reasons { color:#a07820; font-size:10.5px; margin-top:2px; }

/* Kontakt-Buttons (E-Mail/Telefon/Handy/Maps) auf jeder Kanban-Karte – standardmäßig ausgeblendet,
   erscheinen erst beim Hover der Karte rechts überlagernd über der "Tg. in Phase"-Badge (per
   position:absolute innerhalb von .bw-card-meta, das dafür position:relative braucht). */
.bw-card-contact {
    position:absolute; top:50%; right:0; transform:translateY(-50%) translateX(6px);
    display:flex; align-items:center; gap:5px; padding-left:22px;
    background:linear-gradient(to right, transparent, var(--bg-dark) 22px);
    opacity:0; pointer-events:none;
    transition:opacity .18s ease, transform .18s ease;
}
.bw-card:hover .bw-card-contact { opacity:1; pointer-events:auto; transform:translateY(-50%) translateX(0); }
.bw-card-contact-btn { display:inline-flex; align-items:center; justify-content:center; width:22px; height:22px; border-radius:6px; background:var(--panel-bg); border:1px solid var(--panel-border); color:var(--text-muted); transition:color .12s, border-color .12s; }
.bw-card-contact-btn:hover { color:var(--accent-gold); border-color:color-mix(in srgb, var(--accent-gold) 45%, var(--panel-border)); }
.bw-card-contact-btn svg { width:11px; height:11px; }

/* ── Tab "Vorlagen" (E-Mail-Vordrucke für die Kontaktaufnahme mit Bewerbern, Brief-Symbol) +
   Compose-Modal (siehe bwOpenMailModal()/bwOpenTemplateEdit() in admin_bewerber.php). Rich-Text-
   Editor/Serienbrieffeld-Leiste sind bewusst schlanke Eigenentwicklungen (kein Fontgröße-/Farb-
   Picker wie im Lead-Modul), da Bewerber-Vorlagen keine Marken-Signaturfarben brauchen. ── */
.bw-templates-list { display:flex; flex-direction:column; gap:10px; }
.bw-template-card { background:var(--panel-bg); border:1px solid var(--panel-border); border-radius:12px; padding:14px 16px; display:flex; align-items:center; gap:14px; }
.bw-template-card-body { flex:1; min-width:0; }
.bw-template-card-name { font-size:13.5px; font-weight:600; color:var(--text-main); }
.bw-template-card-subject { font-size:12px; color:var(--text-muted); margin-top:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bw-template-card-badge { flex-shrink:0; }
.bw-template-card-actions { display:flex; gap:6px; flex-shrink:0; }
.bw-templates-empty { color:var(--text-muted); font-size:12.5px; padding:24px 0; text-align:center; }

.bw-rte-toolbar { display:flex; align-items:center; gap:4px; margin-bottom:6px; }
.bw-rte-btn {
    width:28px; height:26px; border-radius:6px; padding:0; cursor:pointer; font-size:12px; line-height:1;
    display:flex; align-items:center; justify-content:center;
    background:var(--bg-dark); border:1px solid var(--panel-border); color:var(--text-muted); transition:.15s;
}
.bw-rte-btn:hover { border-color:var(--accent-gold); color:var(--accent-gold); }
/* Bewusst festes Weiß + dunkle Schrift (analog .lc-rte-editor): der Inhalt WIRD die E-Mail, die der
   Bewerber auf hellem Grund liest. */
.bw-rte-editor {
    min-height:130px; max-height:320px; overflow-y:auto; padding:11px 13px; border-radius:8px;
    background:#fdfdfb; border:1px solid var(--panel-border); color:#1c1c1c;
    font-size:13px; line-height:1.5; outline:none; box-shadow:inset 0 1px 3px rgba(0,0,0,.08);
}
.bw-rte-editor:focus { border-color:var(--accent-gold); }
.bw-rte-editor:empty::before { content:attr(data-placeholder); color:#8a8a8a; font-style:italic; }
.bw-mergefield-bar { display:flex; flex-wrap:wrap; align-items:center; gap:5px; margin:2px 0 6px; padding:6px 8px; background:var(--bg-dark); border:1px dashed var(--panel-border); border-radius:8px; }
.bw-mergefield-label { font-size:10.5px; color:var(--text-muted); margin-right:2px; }
.bw-mergefield-btn { font-size:10.5px; padding:3px 8px; border-radius:999px; cursor:pointer; background:var(--panel-bg); border:1px solid var(--panel-border); color:var(--accent-gold); transition:.15s; }
.bw-mergefield-btn:hover { background:var(--accent-gold); color:#1a1a1a; border-color:var(--accent-gold); }

.bw-mail-box { max-width:680px; box-shadow:0 24px 70px rgba(0,0,0,.4); }
.bw-mail-head-icon { display:inline-flex; align-items:center; justify-content:center; width:30px; height:30px; border-radius:9px; background:rgba(214,175,84,.15); color:var(--accent-gold); flex-shrink:0; }
.bw-mail-meta { border:1px solid var(--panel-border); border-radius:10px; background:var(--bg-dark); padding:0 12px; margin-bottom:12px; }
.bw-mail-meta-row { display:flex; align-items:center; gap:9px; padding:6px 0; }
.bw-mail-meta-row + .bw-mail-meta-row { border-top:1px solid var(--panel-border); }
.bw-mail-meta-label { flex:0 0 24px; font-size:9.5px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:var(--text-muted); }
.bw-mail-meta-person { display:flex; align-items:center; gap:8px; min-width:0; }
.bw-mail-avatar { width:22px; height:22px; border-radius:50%; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-size:9.5px; font-weight:700; color:#fff; }
.bw-mail-meta-text { display:flex; flex-direction:row; align-items:baseline; gap:6px; min-width:0; line-height:1.3; }
.bw-mail-meta-text strong { font-size:12px; color:var(--text-main); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex-shrink:0; }
.bw-mail-meta-text span { font-size:11px; color:var(--text-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bw-mail-fields-row { display:flex; align-items:stretch; gap:10px; margin-bottom:8px; }
.bw-mail-subject-row { flex:1; min-width:0; }
.bw-mail-subject-row input {
    width:100%; box-sizing:border-box; border:none; border-bottom:1px solid var(--panel-border);
    background:none; padding:7px 2px; font-size:14px; font-weight:600; color:var(--text-main); outline:none; transition:border-color .15s;
}
.bw-mail-subject-row input::placeholder { font-weight:400; color:var(--text-muted); }
.bw-mail-subject-row input:focus { border-bottom-color:var(--accent-gold); }
.bw-mail-template-select {
    flex:0 0 150px; min-width:0; font-size:11.5px; color:var(--text-muted); background:none; outline:none;
    border:none; border-bottom:1px solid var(--panel-border); padding:7px 2px; transition:border-color .15s;
}
.bw-mail-template-select:focus { border-bottom-color:var(--accent-gold); color:var(--text-main); }
.bw-mail-editor-wrap { display:flex; flex-direction:column; gap:5px; }
.bw-mail-toolbar-row { display:flex; flex-wrap:wrap; align-items:center; gap:5px; margin-bottom:2px; }
.bw-mail-toolbar-sep { width:1px; height:18px; background:var(--panel-border); margin:0 2px; }
.bw-mail-status { margin-top:8px; font-size:12px; min-height:1em; }
.bw-mail-status.err { color:var(--danger-red); }

/* ── Responsive (Handy/Tablet): Bewerber-Seite muss ohne winzige Textfragmente/abgeschnittene
   Kanban-Spalten nutzbar sein. Kanban wird zum Swipe-Karussell (eine Spalte pro Bildschirm,
   Scroll-Snap statt 3 halb abgeschnittener Spalten), Toolbar/Formular werden einspaltig.
   Liste-Tab: Tabelle (horizontales Scrollen = unbenutzbar) weicht einem Kartenlayout mit allen
   wichtigen Infos auf einen Blick; Status-Filter-Chips werden zu einer kompakten Scroll-Leiste
   statt mehrzeilig umzubrechen und viel vertikalen Platz zu fressen. ── */
@media (max-width: 767px) {
    .bw-page { padding: 16px; }
    .bw-toolbar { align-items: stretch; }
    .bw-search-wrap { flex-basis: 100%; max-width: none; min-width: 0; }
    .bw-archive-toggle { flex: 1 1 auto; }
    .bw-board { scroll-snap-type: x mandatory; gap: 12px; }
    .bw-column, .bw-column.is-archive { flex: 0 0 88%; max-width: none; scroll-snap-align: start; max-height: none; min-height: 320px; }
    .bw-board-divider { display: none; }
    .bw-form-grid { grid-template-columns: 1fr; }
    .bw-avatar-section { gap: 12px; }
    .bw-avatar-wrap, .bw-avatar-big { width: 56px; height: 56px; }
    .bw-hero-name-row { flex-wrap: wrap; row-gap: 4px; }
    .bw-hero-input { font-size: 17px; min-width: 100px; }

    .bw-filter {
        flex-basis: 100%; flex-wrap: nowrap; gap: 5px; overflow-x: auto; padding-bottom: 2px;
        -webkit-overflow-scrolling: touch; scrollbar-width: none;
    }
    .bw-filter::-webkit-scrollbar { display: none; }
    .bw-chip { flex: 0 0 auto; padding: 4px 9px; font-size: 10.5px; }
    .bw-count { order: 1; }

    .bw-table-wrap { display: none; }
    .bw-list-cards { display: flex; }
}

/* ── Floating Action Button "Neu" (Präfix lc-, geteilt zwischen lead_controlling.php UND
   admin_bewerber.php — siehe css-konventionen.md). Im Lead-Modul kontextsensitiv je Tab
   (Lead / Fachberater / Termin), klappt im Kalender-Tab zu zwei Mini-Buttons (Termin /
   Veranstaltung) auf. Im Bewerber-Modul nur der Hauptbutton ohne Speed-Dial (eine Aktion). ── */
.lc-fab-wrap { position:fixed; right:28px; bottom:calc(28px + var(--hbb-sync-reserved, 0px)); z-index:950; display:none; flex-direction:column; align-items:flex-end; gap:14px; transition:bottom .2s ease; }
.lc-fab-wrap.is-visible { display:flex; }
/* .lc-fab-speed (Termin/Veranstaltung/Urlaub-Minibuttons) nur im Kalender-Tab einblenden – sonst
   bleibt der leere Platz darüber (Layouthöhe der 3 Mini-Reihen) trotz unsichtbarer Buttons ein
   ganz normales, klickbares Element und blockiert darunterliegende Listen-Buttons (Bearbeiten,
   Mail usw.), obwohl optisch nichts zu sehen ist. */
.lc-fab-speed { display:none; flex-direction:column; align-items:flex-end; gap:12px; }
.lc-fab-wrap.lc-fab-has-speed .lc-fab-speed { display:flex; }
.lc-fab-mini { display:flex; align-items:center; gap:10px; opacity:0; transform:translateY(12px) scale(.8); pointer-events:none; transition:opacity .18s ease, transform .18s ease; }
.lc-fab-wrap.is-open .lc-fab-mini { opacity:1; transform:translateY(0) scale(1); pointer-events:auto; }
.lc-fab-wrap.is-open .lc-fab-mini:nth-child(1) { transition-delay:.1s; }
.lc-fab-wrap.is-open .lc-fab-mini:nth-child(2) { transition-delay:.05s; }
.lc-fab-wrap.is-open .lc-fab-mini:nth-child(3) { transition-delay:0s; }
.lc-fab-mini-label { background:var(--lc-modal-bg,var(--panel-bg)); border:1px solid var(--panel-border); color:var(--text-main); font-size:12px; font-weight:600; padding:6px 13px; border-radius:8px; box-shadow:0 6px 18px rgba(0,0,0,.28); white-space:nowrap; }
.lc-fab-mini-btn { width:46px; height:46px; border-radius:50%; border:none; cursor:pointer; display:flex; align-items:center; justify-content:center; color:#fff; background:var(--accent-gold); box-shadow:0 6px 16px rgba(0,0,0,.32); transition:transform .15s ease, filter .15s ease; flex-shrink:0; }
.lc-fab-mini-btn:hover { transform:scale(1.1); filter:brightness(1.12); }
.lc-fab-mini-btn.lc-fab-mini-event { background:#6B8CAE; }
.lc-fab-mini-btn.lc-fab-mini-vacation { background:var(--lc-cal-vacation); }
.lc-fab-main { width:60px; height:60px; border-radius:50%; border:none; cursor:pointer; background:linear-gradient(145deg, var(--accent-gold), #8f764b); color:#fff; display:flex; align-items:center; justify-content:center; box-shadow:0 10px 26px rgba(0,0,0,.4); position:relative; transition:transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .2s ease, filter .15s ease; }
.lc-fab-main::before { content:''; position:absolute; inset:-6px; border-radius:50%; border:1.5px solid rgba(197,164,126,.5); opacity:0; transform:scale(.85); transition:opacity .25s ease, transform .25s ease; }
.lc-fab-main:hover { transform:translateY(-3px) scale(1.06); filter:brightness(1.08); box-shadow:0 14px 34px rgba(0,0,0,.46); }
.lc-fab-main:hover::before { opacity:1; transform:scale(1); }
.lc-fab-main:active { transform:translateY(-1px) scale(.96); }
.lc-fab-main svg { position:relative; z-index:1; transition:transform .3s cubic-bezier(.34,1.56,.64,1); }
.lc-fab-wrap.is-open .lc-fab-main svg { transform:rotate(45deg); }
.lc-fab-pulse { position:absolute; inset:0; border-radius:50%; box-shadow:0 0 0 0 rgba(102,157,36,.5); animation:lcFabPulse 2.8s ease-out infinite; pointer-events:none; }
.lc-fab-wrap.is-open .lc-fab-pulse { animation:none; box-shadow:none; }
@keyframes lcFabPulse { 0% { box-shadow:0 0 0 0 rgba(102,157,36,.45); } 70% { box-shadow:0 0 0 16px rgba(102,157,36,0); } 100% { box-shadow:0 0 0 0 rgba(102,157,36,0); } }
@media(max-width:760px){
    .lc-fab-wrap { right:16px; bottom:calc(16px + env(safe-area-inset-bottom, 0px) + var(--hbb-sync-reserved, 0px)); }
}

/* ── Lead-Controlling (html/modules/lead_controlling.php), Präfix lc- — Modul hat noch einen
   eigenen <style>-Block (Alt-Regeln, siehe css-konventionen.md), NEUE Regeln (hier: Mobile-
   Optimierung) kommen ab sofort direkt hierher statt in den Modul-eigenen Block. ── */

/* ── Prospektversand (Status-Spalte in der Leads-Tabelle, Filter "Prospektversand", Massen-
   Download-Modal) — Feature: Serienbrief-DOCX je Fachberater erzeugen/herunterladen, siehe
   api_lead.php Actions get_prospekt_versand_summary/_preview/download_prospekt_versand +
   lib_docx_merge.php. Die Sichtbarkeit der Status-Spalte selbst wird über das Spalten-Layout
   gesteuert (siehe .lc-df-th-opt/.lc-colctx-* weiter unten), nicht mehr über eine eigene Klasse. */
.lc-prospekt-status { display: inline-flex; align-items: center; gap: 5px; }
.lc-prospekt-status-none { color: var(--text-muted); opacity: .55; }
.lc-prospekt-status-pending { color: #e0a000; }
.lc-prospekt-status-done { color: var(--success-green); }
.lc-prospekt-status-txt { font-size: 11px; white-space: nowrap; }

/* ── Spalten-Anpassung der dfleads-Tabelle (Lead-Controlling → Leads): Rechtsklick auf einen
   Spaltenkopf öffnet ein Kontextmenü (Ausblenden/Einfügen-Untermenüs/Zurücksetzen/Systemvorgabe),
   Drag&Drop-Umsortierung läuft NUR im expliziten Sortiermodus (Menüpunkt "Spaltenreihenfolge
   ändern…" bzw. Button in #lc-dfcol-sort-bar), erkennbar am Wackeln der Spaltenköpfe – analog zum
   Bearbeitungsmodus des Sidebar-Menüs (.sidebar.is-menu-editing/@keyframes hbb-nav-wiggle), siehe
   lcDfColCtxMenu()/lcDfColSortModeSet()/lcDfColDrag*() in lead_controlling.php. ── */
.lc-df-th-opt { user-select: none; }
.lc-df-th-opt.is-dragging { opacity: .4; }
.lc-df-th-opt.is-drop-before { box-shadow: inset 3px 0 0 0 var(--accent-gold); }
.lc-df-th-opt.is-drop-after { box-shadow: inset -3px 0 0 0 var(--accent-gold); }
.lc-df-col-sorting .lc-df-th-opt { cursor: grab; animation: hbb-nav-wiggle .5s ease-in-out infinite; }
.lc-dfcol-sort-bar {
    display: none; align-items: center; gap: 9px; margin-bottom: 10px; padding: 8px 14px;
    border-radius: 10px; background: color-mix(in srgb, var(--accent-gold) 12%, var(--panel-bg));
    border: 1px solid color-mix(in srgb, var(--accent-gold) 35%, var(--panel-border));
    color: var(--accent-gold); font-size: 12.5px;
}
.lc-dfcol-sort-bar span { flex: 1 1 auto; }
.lc-dfcol-sort-done-btn {
    border: 1px solid color-mix(in srgb, var(--accent-gold) 50%, transparent); background: transparent;
    color: var(--accent-gold); border-radius: 7px; padding: 5px 14px; font-size: 12px; font-weight: 600;
    cursor: pointer; transition: .15s;
}
.lc-dfcol-sort-done-btn:hover { background: var(--accent-gold); color: #fff; }
.lc-colctx-menu {
    position: absolute; z-index: 3000; display: none; min-width: 230px; padding: 6px;
    border-radius: 10px; font-size: 12.5px;
}
.lc-colctx-menu.is-open { display: block; }
.lc-colctx-item { position: relative; padding: 8px 10px; border-radius: 7px; cursor: pointer; color: var(--text-main); white-space: nowrap; }
.lc-colctx-item:hover { background: rgba(102,157,36,.1); }
.lc-colctx-item.is-disabled { color: var(--text-muted); cursor: default; }
.lc-colctx-item.is-disabled:hover { background: none; }
.lc-colctx-item.is-admin-action { color: var(--accent-gold); }
.lc-colctx-sep { height: 1px; background: var(--panel-border); margin: 4px 2px; }
.lc-colctx-item.has-submenu::after { content: ''; position: absolute; right: 10px; top: 50%; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-50%) rotate(-45deg); opacity: .6; }
/* Hintergrund/Rand/Schatten kommen aus `.hbb-glass-pop`. Vorfall 2026-10-02 (Teil 2): verschachteltes
   `backdrop-filter` (Untermenü INNERHALB des bereits per `hbb-glass-pop` geblurrten Eltern-Menüs)
   wird browserübergreifend unzuverlässig gerendert (komplett transparent, kein Blur sichtbar) –
   daher wird das Untermenü per JS (lcDfColCtxDetachSubmenus) aus dem Menü gelöst und direkt an
   document.body gehängt, sobald es aufgeklappt wird; `position: fixed` + `z-index` sind daher
   zwingend, `left`/`top` werden von dort per JS inline überschrieben. */
.lc-colctx-submenu {
    display: none; position: fixed; min-width: 200px; padding: 6px; z-index: 3001;
    border-radius: 10px; opacity: 0; transform: translateY(2px); transition: opacity .12s ease, transform .12s ease;
}
.lc-colctx-submenu.is-visible { display: block; }
.lc-colctx-submenu.is-shown { opacity: 1; transform: translateY(0); }
.lc-colctx-item.is-active { color: var(--accent-gold); font-weight: 600; }
.lc-dfcol-sort-bar.bem-sort-bar { display: flex; }
.lc-colctx-menu.bem-colctx-menu { position: fixed; left: 0; top: 0; max-width: calc(100vw - 8px); max-height: calc(100vh - 8px); overflow: auto; }
.lc-colctx-submenu.bem-colctx-submenu { left: 0; top: 0; max-width: calc(100vw - 8px); max-height: calc(100vh - 8px); overflow: auto; }
.bem-colctx-menu button.lc-colctx-item, .bem-colctx-submenu button.lc-colctx-item { display: block; width: 100%; border: 0; background: transparent; font: inherit; text-align: left; }
.bem-colctx-menu button.lc-colctx-item:hover, .bem-colctx-submenu button.lc-colctx-item:hover { background: rgba(102,157,36,.1); }
.bem-colctx-menu .has-submenu { padding-right: 28px; }
@media (prefers-reduced-motion: reduce) {
    .bem-article-table .lc-df-col-sorting .lc-df-th-opt { animation: none; }
}

/* ── Reihenfolge-/Sichtbarkeits-Anpassung der Haupt-Tableiste (Dashboard/Leads/.../Lead-Pool/…):
   Rechtsklick auf einen Tab öffnet dasselbe Kontextmenü-Muster wie bei den dfleads-Spalten oben
   (.lc-colctx-* wird 1:1 wiederverwendet), Drag&Drop läuft NUR im expliziten Sortiermodus
   ("Tab-Reihenfolge ändern…" bzw. #lc-tab-sort-bar, das die .lc-dfcol-sort-bar-Klasse teilt) –
   erkennbar am Wackeln der Tabs, siehe lcTabCtxMenu()/lcTabSortModeSet()/lcTabDrag*() in
   lead_controlling.php. ── */
.lc-tabs.lc-tabs-sorting .lc-tab-btn[data-tab-key] { cursor: grab; animation: hbb-nav-wiggle .5s ease-in-out infinite; }
.lc-tab-btn.is-dragging { opacity: .4; }
.lc-tab-btn.is-drop-before { box-shadow: inset 3px 0 0 0 var(--accent-gold); }
.lc-tab-btn.is-drop-after { box-shadow: inset -3px 0 0 0 var(--accent-gold); }

/* ── Benachrichtigungs-E-Mails je Schwelle (Achtung/Warnung/Lead-Pool), siehe lib_rule_mail.php
   und lcRuleMail*() in lead_controlling.php – Teil des Einstellungsbereichs "Verweil-Schwellwerte
   pro Status" (.lc-rules-wrap), spannt dort bewusst beide Grid-Spalten über die volle Breite. ── */
.lc-rulemail-section { grid-column: 1 / -1; }
.lc-rulemail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; gap: 10px; }
.lc-rulemail-title { margin: 0; font-size: 15px; }
.lc-rulemail-desc { font-size: 11px; color: var(--text-muted); margin-top: 3px; max-width: 640px; }
.lc-rulemail-box { padding: 16px; }
.lc-rulemail-box-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.lc-rulemail-body-row { margin-top: 10px; }
.lc-rulemail-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.lc-rulemail-status { font-size: 11px; color: var(--text-muted); }
.lc-rulemail-hint { margin-top: 10px; font-size: 10.5px; color: var(--text-muted); line-height: 1.6; }
.lc-rulemail-privacy-hint {
    font-size: 11px; line-height: 1.5; color: #e97b24; background: rgba(233,123,36,.1);
    border: 1px solid rgba(233,123,36,.35); border-radius: 8px; padding: 6px 10px; margin-bottom: 10px;
}
.lc-rulemail-noaccess { font-size: 12px; color: var(--text-muted); }


/* Modal: Zusammenfassung (letzter Versand / Anzahl offen), Hinweis bei fehlender Vorlage */
.lc-prospekt-summary { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
.lc-prospekt-summary-warn {
    margin-top: 4px; padding: 8px 10px; border-radius: 8px; font-size: 11.5px; line-height: 1.45;
    background: rgba(224, 100, 0, .12); border: 1px solid rgba(224, 100, 0, .35); color: #e06400;
}
.lc-prospekt-mode-row { display: flex; flex-direction: column; gap: 8px; }
.lc-prospekt-radio { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: 12.5px; }
.lc-prospekt-radio input[type="radio"] {
    width: 15px; height: 15px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--brand-accent); cursor: pointer;
}
.lc-prospekt-count-preview { margin-top: 10px; font-size: 12px; color: var(--text-muted); }

@media (max-width: 767px) {
    /* Toolbar: Suchfeld/Filter-Dropdowns dürfen auf schmalen Screens nicht mehr zusammengequetscht
       werden als per Mindestbreite vorgesehen — stattdessen sauber umbrechen. Vorher blieb
       ".lc-search-group" trotz flex-basis:100% INTERN ein nicht umbrechendes Flex-Row
       (Suchfeld+Filter-Button+Zeitraum-Button in einer Zeile) — auf sehr schmalen Screens
       (<~380px) quetschte das das Suchfeld (flex:1;min-width:0) auf wenige Pixel zusammen,
       wodurch der absolut positionierte "X Filter aktiv"-Badge (right:8px relativ zum
       geschrumpften Suchfeld) weit nach links aus dem Viewport hinausragte (abgeschnittener
       Text am linken Rand). Fix: Gruppe selbst umbrechen lassen, Suchfeld bekommt eine eigene
       volle Zeile, Filter/Zeitraum-Buttons teilen sich die Zeile darunter. */
    .lc-search-group { min-width: 0; flex-basis: 100%; flex-wrap: wrap; }
    /* Höhere Selektor-Spezifität nötig, um das Modul-eigene ".lc-search-group .lc-search-wrap"
       (2 Klassen, im Modul-<style>-Block nach style.css eingebunden) zu überstimmen. */
    .lc-controls .lc-search-group .lc-search-wrap { min-width: 0; flex: 1 1 100%; }
    .lc-search-group > .lc-stage-dropdown-wrap { flex: 1 1 0; min-width: 0; }
    .lc-search-group > .lc-stage-dropdown-wrap .lc-stage-dropdown-btn { width: 100%; justify-content: center; }
    .lc-controls-actions { flex-basis: 100%; justify-content: flex-start; }

    /* Status-Verteilungs-Legende (Leads-Tab) und Stage-Verteilung (Fachberater-Tab): bei vielen
       Etappen nahm je 1 Eintrag pro Zeile (variable Textlänge + white-space:nowrap) unnötig viel
       Höhe ein. Festes 2-Spalten-Raster + Zeilenumbruch statt freiem Flex-Wrap nutzt die Breite
       deutlich besser aus. */
    .lc-df-dist-legend, .lc-vt-dist-legend {
        display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px;
    }
    .lc-df-dist-item, .lc-vt-dist-item { white-space: normal; font-size: 10.5px; padding: 3px 5px; }

    /* Leads-Tabelle (.lc-table) UND Fachberater-Tabelle (.lc-table.lc-vt-table) waren horizontal
       scrollende Tabellen mit 6 Spalten — auf dem Handy unbenutzbar (Aktionen/Status nur nach
       seitwärts wischen sichtbar). Fix: jede Zeile wird zu einer eigenständigen Karte, Spalten
       stapeln sich untereinander mit kleiner Beschriftung (per data-label-Attribut an den <td>s
       in lcDfLeadsLoad()/lcVtLoad() gesetzt) statt eines Tabellenkopfs. Die Aufklapp-Zeile
       (.lc-row-expand, per max-height-Trick ein-/ausgeblendet, siehe lcDfToggleRowExpand()/
       lcVtToggleRowExpand()) bleibt technisch unverändert, wird nur zu einem Block statt einer
       Tabellenzeile. */
    .lc-vt-table-card { overflow-x: visible; border: none; box-shadow: none; }
    .lc-table thead { display: none; }
    .lc-table, .lc-table tbody { display: block; width: 100%; }
    .lc-table tr.lc-row-main {
        display: block; background: var(--panel-bg); border: 1px solid var(--panel-border);
        border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer;
    }
    .lc-table tr.lc-row-expand { display: block; }
    .lc-table tr.lc-row-expand td { display: block; padding: 0; border: none; }
    .lc-table td { display: block; padding: 7px 0; border: none; vertical-align: top; }
    .lc-table td[data-label]::before {
        content: attr(data-label); display: block; font-size: 9.5px; font-weight: 700;
        text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 3px;
    }
    .lc-table td:last-child {
        text-align: left !important; white-space: normal !important; padding-top: 10px;
        margin-top: 4px; border-top: 1px solid var(--panel-border);
    }

    /* Filter-Dropdown-Panel (.lc-filter-panel, siehe Abschnitt 5.x Kalkulation/Lead-Controlling):
       die feste min-width:420px (für die 2-spaltige Desktop-Ansicht) ragt auf schmalen Screens
       über den Viewport hinaus - Spalten stapeln sich stattdessen untereinander. */
    .lc-filter-panel { min-width: 0; width: calc(100vw - 32px); max-width: 320px; }
    .lc-filter-panel-cols { flex-direction: column; }
    .lc-filter-panel-vsep { display: none; }

    /* ── Kalkulation (admin_kalkulation.php): dieselbe Karten-Umwandlung wie oben bei .lc-table,
       hier für .kalk-table (kombinierte Aufgabenliste aus übergebenen Kalkulationen + eigenen
       Aufgaben). Spalten-Beschriftung kommt ebenfalls per data-label-Attribut (siehe
       kalkColCellHtml()/renderCombinedRow() in admin_kalkulation.php). Gruppierungs-Kopfzeilen
       (.kalk-group-row) bleiben bewusst schlicht (kein Karten-Look), nur die eigentlichen
       Aufgaben-Zeilen (.kalk-combined-row) werden zu Karten. */
    .kalk-page { padding: 16px; }
    .kalk-toolbar { gap: 8px; }
    .kalk-search-wrap { flex: 1 1 100%; max-width: none; min-width: 0; }
    .kalk-filter-wrap, .kalk-group-wrap, #kalk-filter-wrap, #kalk-group-wrap { flex: 1 1 0; min-width: 0; }
    #kalk-filter-wrap .lc-stage-dropdown-btn, #kalk-group-wrap .lc-stage-dropdown-btn { width: 100%; justify-content: center; }
    .kalk-count { flex-basis: 100%; margin-left: 0; text-align: left; }
    .kalk-table thead { display: none; }
    .kalk-table, .kalk-table tbody { display: block; width: 100%; }
    .kalk-table tr.kalk-combined-row {
        display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start;
        column-gap: 16px; row-gap: 6px; background: var(--panel-bg); border: 1px solid var(--panel-border);
        border-radius: 12px; padding: 14px; margin-bottom: 10px; cursor: pointer;
    }
    .kalk-table tr.kalk-combined-row.is-overdue, .kalk-table tr.kalk-combined-row.is-due-soon { border-radius: 12px; }
    .kalk-table tr.kalk-combined-row.is-overdue td:first-child, .kalk-table tr.kalk-combined-row.is-due-soon td:first-child { border-left: none; padding-left: 0; }
    .kalk-table td { display: block; padding: 6px 0; border: none !important; white-space: normal; border-radius: 0 !important; }
    .kalk-table td[data-label="Titel"], .kalk-table td[data-label="Kunde"] { grid-column: 1 / -1; }
    .kalk-table td[data-label]::before {
        content: attr(data-label); display: block; font-size: 12px; line-height:1.35; font-weight: 700;
        text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 3px;
    }
    .kalk-table td.kalk-actions-cell {
        grid-column: 1 / -1; white-space: normal !important; padding-top: 10px; margin-top: 4px;
        border-top: 1px solid var(--panel-border) !important; display: flex; align-items:center; gap: 8px; flex-wrap: wrap;
    }
    .kalk-table tbody tr.kalk-group-row td { padding: 14px 4px 6px; }

    /* Detail-/Aufgaben-Modals (.kalk-modal, .kalk-own-modal-content, .kalk-reject-modal-content):
       auf schmalen Screens reicht weniger Innenabstand, damit mehr Platz für den Inhalt bleibt. */
    .kalk-modal .kalk-modal-content { padding: 18px; }
    .kalk-modal-close { top: 8px; right: 8px; }
    .kalk-modal #kalk-modal-body > .kalk-sticky-actions:last-child {
        bottom: -18px; margin:18px -18px -18px; padding:12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
    }
    #kalk-fab-wrap { bottom:calc(73px + env(safe-area-inset-bottom, 0px) + var(--hbb-sync-reserved, 0px)); }
}

/* -- Admin-Shell Sidebar: einklappbare Menü-Gruppen (html/admin.php) --
   admin.php selbst ist "Shell/Chrome" und noch nicht komplett zentralisiert (siehe
   css-konventionen.md), NEUE Klassen kommen aber ab sofort direkt hierher statt in einen
   weiteren Inline-<style>-Block in admin.php. */
.nav-group-header {
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 12px 20px 8px; margin: 6px 0 0; background: none; border: none;
    font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--text-muted); cursor: pointer; transition: color 0.15s ease;
}
.nav-group-header:hover { color: var(--brand-accent); }
.nav-group-chevron { flex-shrink: 0; transition: transform 0.2s ease; }
.nav-group-header.is-collapsed .nav-group-chevron { transform: rotate(-90deg); }
/* Animierter Auf-/Zuklapp-Effekt ohne JS-Höhenmessung: grid-template-rows 0fr<->1fr-Trick.
   .nav-group-items-inner braucht overflow:hidden + min-height:0, damit die 0fr-Zeile den Inhalt
   tatsächlich auf 0px zusammenschiebt statt ihn nur zu überlappen. */
.nav-group-items { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 0.25s ease; }
.nav-group-items.is-collapsed { grid-template-rows: 0fr; }
.nav-group-items-inner { display: flex; flex-direction: column; overflow: hidden; min-height: 0; }

/* -- Admin-Shell Sidebar: kompakte Tablet-Leiste mit beschriftetem Overlay-Menü -- */
@supports (-webkit-touch-callout: none) {
    @media (max-width: 767px) {
        body #mobile-header {
            padding-top: env(safe-area-inset-top, 0px);
        }
        body #app-content {
            margin-top: calc(57px + env(safe-area-inset-top, 0px));
        }
        body #hbb-offline-banner {
            top: calc(57px + env(safe-area-inset-top, 0px));
        }
        body #admin-sidebar .sidebar-header {
            padding-top: calc(30px + env(safe-area-inset-top, 0px));
        }
        body #admin-sidebar {
            padding-bottom: env(safe-area-inset-bottom, 0px);
            box-sizing: border-box;
        }
    }
}

.tablet-sidebar-toggle { display: none; }
body .sidebar .sidebar-header { text-align: center; padding: 30px 20px; }
body .sidebar .sidebar-brand-logo { width: 100%; max-width: 180px; height: auto; }
body .sidebar .nav-link:focus-visible,
body .sidebar .nav-group-header:focus-visible,
body .sidebar .theme-btn:focus-visible {
    outline: 2px solid var(--brand-accent); outline-offset: -2px; position: relative; z-index: 1;
}
.tablet-sidebar-toggle {
    width: 44px; height: 44px; padding: 0; flex: 0 0 44px;
    align-items: center; justify-content: center;
    color: var(--text-muted); background: transparent;
    border: 1px solid transparent; border-radius: 10px;
    cursor: pointer; transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.tablet-sidebar-toggle:hover,
.tablet-sidebar-toggle:focus-visible {
    color: var(--accent-gold); background: rgba(var(--brand-accent-rgb), 0.1);
    border-color: rgba(var(--brand-accent-rgb), 0.28);
}
.tablet-sidebar-toggle:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.tablet-sidebar-close-icon { display: none; }

@media (max-width: 1199px) {
    body .sidebar-backdrop {
        display: block; visibility: hidden; opacity: 0; pointer-events: none;
        transition: opacity 0.26s ease, visibility 0s linear 0.26s;
    }
    body .sidebar-backdrop.is-open {
        visibility: visible; opacity: 1; pointer-events: auto;
        transition: opacity 0.32s ease, visibility 0s;
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    body .sidebar {
        position: fixed; top: 0; right: auto; bottom: 0; left: 0; z-index: 300;
        width: 72px; min-width: 72px; flex: 0 0 72px;
        overflow-x: hidden; overflow-y: auto;
        box-shadow: none;
        transition: width 0.32s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.32s ease;
    }
    body .main-content { margin-left: 72px; min-width: 0; padding: 20px; }
    body .sidebar .sidebar-header {
        display: flex; flex-direction: column; align-items: center; gap: 8px;
        padding: 12px 8px;
    }
    body .sidebar .tablet-sidebar-toggle { display: inline-flex; }
    body .sidebar .sidebar-brand-logo,
    body .sidebar .sidebar-header .hbb-env-badge {
        flex-shrink: 0; max-height: 0; opacity: 0; overflow: hidden;
        visibility: hidden;
        transition: max-height 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease, visibility 0s linear 0.32s;
    }
    body .sidebar .sidebar-brand-logo { width: 180px; }
    body .sidebar:not(.is-open) .sidebar-header { gap: 0; }
    body .sidebar:not(.is-open) .nav-link {
        position: relative; box-sizing: border-box; min-height: 48px;
        justify-content: center; padding: 12px 0; font-size: 0;
        border: 0; border-left: 0;
    }
    body .sidebar:not(.is-open) .nav-link svg {
        width: 20px; height: 20px; margin-right: 0;
    }
    body .sidebar:not(.is-open) .nav-link:hover,
    body .sidebar:not(.is-open) .nav-link.active {
        padding-left: 0; border-left: 0;
    }
    body .sidebar:not(.is-open) .nav-link.active::after {
        content: ""; position: absolute; top: 50%; right: 9px;
        width: 5px; height: 5px; border-radius: 50%;
        background: var(--accent-gold); transform: translateY(-50%);
    }
    body .sidebar:not(.is-open) .nav-group-header { display: none; }
    body .sidebar:not(.is-open) .nav-group-items {
        margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--panel-border);
    }
    body .sidebar:not(.is-open) .nav-group-items.is-collapsed { grid-template-rows: 1fr; }
    body .sidebar:not(.is-open) .theme-switcher {
        flex-direction: column; justify-content: center; gap: 4px; padding: 8px 0;
    }
    body .sidebar:not(.is-open) .theme-switcher-label { display: none; }
    body .sidebar:not(.is-open) .theme-btn { width: 44px; height: 44px; padding: 0; }
    body .sidebar:not(.is-open) .theme-btn svg { width: 18px; height: 18px; }
    body .sidebar.is-open {
        width: 280px;
        box-shadow: 8px 0 40px rgba(0, 0, 0, 0.35);
    }
    body .sidebar.is-open .sidebar-header { padding: 12px 16px; }
    body .sidebar.is-open .sidebar-brand-logo,
    body .sidebar.is-open .sidebar-header .hbb-env-badge {
        max-height: 180px; opacity: 1; visibility: visible;
        transition: max-height 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease 0.08s, visibility 0s;
    }
    body .sidebar.is-open .tablet-sidebar-toggle { align-self: flex-start; }
    body .sidebar.is-open .tablet-sidebar-open-icon { display: none; }
    body .sidebar.is-open .tablet-sidebar-close-icon { display: block; }
    body .sidebar.is-open .nav-link {
        justify-content: flex-start; min-height: 48px; padding: 15px 20px;
        font-size: 14px; border: 0; border-bottom: 1px solid var(--panel-border);
    }
    body .sidebar.is-open .nav-link svg { width: 18px; height: 18px; margin-right: 12px; }
    body .sidebar.is-open .nav-link:hover,
    body .sidebar.is-open .nav-link.active {
        background: rgba(var(--brand-accent-rgb), 0.05); color: var(--accent-gold);
    }
    body .sidebar.is-open .nav-link.active::after { display: none; }
    body .sidebar.is-open .theme-switcher { justify-content: flex-start; padding: 14px 20px; }
    body .sidebar.is-open .theme-switcher-label { display: block; }
}

@media (prefers-reduced-motion: reduce) {
    body .sidebar,
    body .sidebar .tablet-sidebar-toggle,
    body .sidebar .sidebar-brand-logo,
    body .sidebar .sidebar-header .hbb-env-badge,
    body .sidebar-backdrop { transition: none; }
}

/* -- Admin-Dashboard / Startseite (html/modules/admin_dashboard.php) -- */
.adash-shell {
    --adash-secondary: color-mix(in srgb, var(--text-main) 76%, var(--panel-bg));
    --adash-danger: #ff9a91;
    --adash-positive: #b6d987;
    padding: 4px 2px 32px; max-width: 1800px; color: var(--text-main); font-size: 14px; line-height: 1.5;
}
html[data-theme="light"] .adash-shell { --adash-danger: #a82f25; --adash-positive: #42651e; }
.adash-shell [hidden] { display: none !important; }
.adash-shell a { color: inherit; text-decoration: none; }
.adash-shell button { font: inherit; cursor: pointer; }
.adash-shell :is(a, button, input, summary):focus-visible { outline: 2px solid var(--text-main); outline-offset: 3px; }
.adash-shell ::selection { background: var(--brand-accent); color: var(--btn-text); }
.adash-head { margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-right: 52px; }
.adash-head h1 { margin: 0; font-size: 26px; letter-spacing: -.025em; color: var(--text-main); }
.adash-sub { margin: 3px 0 0; color: var(--adash-secondary); font-size: 14px; }
.adash-start { display: grid; grid-template-columns: minmax(0, 2fr) minmax(250px, 1fr); gap: 24px; margin-bottom: 28px; }
.adash-workday { min-width: 0; background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 16px; padding: 18px 22px; }
.adash-shortcuts { min-width: 0; padding: 18px 0; }
.adash-section { margin-top: 24px; }
.adash-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.adash-section-head h2 { font-size: 18px; font-weight: 650; letter-spacing: -.015em; margin: 0; }
.adash-section-note, .adash-updated { font-size: 13px; color: var(--adash-secondary); }
.adash-workday-help { color: var(--adash-secondary); font-size: 13px; margin: -4px 0 14px; max-width: 70ch; }
.adash-work-counts { display: flex; gap: 8px 20px; flex-wrap: wrap; margin-bottom: 12px; font-size: 13px; color: var(--adash-secondary); }
.adash-work-counts strong { color: var(--text-main); font-size: 17px; font-variant-numeric: tabular-nums; margin-right: 3px; }
.adash-work-empty { padding: 10px 0 4px; }
.adash-work-empty strong { font-size: 16px; }
.adash-work-empty p { max-width: 62ch; color: var(--adash-secondary); margin: 5px 0; }
.adash-task { display: grid; grid-template-columns: minmax(0, 1fr) auto 18px; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--panel-border); }
.adash-task-copy { min-width: 0; }
.adash-task-copy strong { display: block; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.adash-task-copy > span { display: block; color: var(--adash-secondary); font-size: 13px; overflow-wrap: anywhere; }
.adash-task-due { color: var(--adash-secondary); text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
.adash-shell .adash-overdue, .adash-shell .adash-overdue strong, .adash-warn { color: var(--adash-danger); }
.adash-due-today { color: var(--adash-positive); font-weight: 650; }
.adash-task-note { color: var(--adash-secondary); font-size: 13px; margin: 8px 0 0; }
.adash-shortcut { display: flex; align-items: center; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--panel-border); padding: 6px 8px; border-radius: 6px; font-weight: 600; }
.adash-shortcut > span:nth-child(2) { flex: 1; }
.adash-shortcut-icon { display: flex; color: var(--adash-positive); }
.adash-task:hover, .adash-shortcut:hover, .adash-recent-item:hover { background: color-mix(in srgb, var(--text-main) 5%, transparent); }
.adash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.adash-tile {
    min-width: 0; background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 14px;
    padding: 16px 18px 0; color: inherit; transition: border-color .2s ease-out, box-shadow .2s ease-out;
}
.adash-tile:hover, .adash-tile:focus-within { border-color: color-mix(in srgb, var(--text-main) 32%, var(--panel-border)); box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.adash-tile-warning { border-color: var(--adash-danger); }
.adash-tile-link { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.adash-tile-link > svg { flex-shrink: 0; color: var(--adash-secondary); }
.adash-tile-title { flex: 1; font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.adash-tile-icon { display: flex; align-items: center; color: var(--adash-positive); }
.adash-metric { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 0; flex-wrap: wrap; }
.adash-metric:empty { display: none; }
.adash-metric strong { font-size: 28px; font-weight: 650; letter-spacing: -.025em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.adash-metric > span { color: var(--adash-secondary); font-size: 14px; }
.adash-tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 0 8px; }
.adash-scope { font-size: 12px; color: var(--adash-secondary); }
.adash-pin, .adash-order-btn { border: 0; background: transparent; color: var(--adash-secondary); display: inline-flex; align-items: center; justify-content: center; min-width: 36px; min-height: 36px; border-radius: 8px; }
.adash-pin:hover, .adash-order-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--text-main) 8%, transparent); }
.adash-pin.is-active { color: var(--adash-positive); }
.adash-pin.is-active svg { fill: currentColor; }
.adash-order-btn:disabled { opacity: .35; cursor: default; }
.adash-tile-meta { font-size: 13px; color: var(--adash-secondary); margin: 0 0 12px; }
.adash-chart { margin-bottom: 16px; }
.adash-chart-caption, .adash-chart-empty { margin: 0 0 8px; color: var(--adash-secondary); font-size: 13px; }
.adash-chart-empty { margin-bottom: 16px; }
.adash-chart-bar { display: block; width: 100%; height: 12px; border-radius: 4px; overflow: hidden; }
.adash-series-0 { --adash-series: #557f9d; }
.adash-series-1 { --adash-series: #6d9490; }
.adash-series-2 { --adash-series: #ad915c; }
.adash-series-3 { --adash-series: #8b8e94; }
.adash-chart-bar rect { fill: var(--adash-series); }
.adash-chart-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; margin: 10px 0 0; min-height: 46px; align-content: start; font-size: 13px; }
.adash-chart-legend > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 6px; min-width: 0; }
.adash-chart-legend dt { display: flex; align-items: baseline; gap: 6px; min-width: 0; color: var(--adash-secondary); }
.adash-chart-legend dt > span:last-child { overflow-wrap: anywhere; }
.adash-chart-legend dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.adash-chart-swatch { display: inline-block; flex-shrink: 0; width: 9px; height: 9px; border-radius: 2px; background: var(--adash-series); }
.adash-details { border-top: 1px solid var(--panel-border); padding: 0 0 10px; }
.adash-details summary { padding-top: 10px; cursor: pointer; color: var(--adash-secondary); font-size: 13px; }
.adash-details h3 { font-size: 13px; font-weight: 650; margin: 16px 0 8px; }
.adash-distribution { margin: 0; }
.adash-distribution > div { display: flex; justify-content: space-between; gap: 14px; padding: 4px 0; font-size: 13px; }
.adash-distribution dt { color: var(--adash-secondary); overflow-wrap: anywhere; }
.adash-distribution dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.adash-recent-item { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 13px; }
.adash-recent-item > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.adash-status { text-align: right; font-size: 12px; color: var(--adash-secondary); }
.adash-admin-grid .adash-metric strong { font-size: 22px; }
.adash-admin-grid .adash-tile-icon { color: var(--adash-secondary); }
.adash-empty { color: var(--adash-secondary); font-size: 14px; padding: 12px 0; margin: 0; }
.adash-notice { padding: 12px 16px; border: 1px solid var(--adash-danger); color: var(--adash-danger); border-radius: 10px; }
.adash-retry { background: none; color: inherit; border: 0; text-decoration: underline; text-underline-offset: 3px; }
.adash-tile.adash-dragging { opacity: .4; cursor: grabbing; }
.adash-tile.adash-drag-over { outline: 2px dashed var(--brand-accent); outline-offset: -4px; }

/* -- Kacheln anordnen/ein-ausblenden (Manage-Panel oben rechts) -- */
.adash-mgr-wrap { position: relative; flex-shrink: 0; }
.adash-mgr-btn {
    display: inline-flex; align-items: center; gap: 7px; background: var(--panel-bg);
    border: 1px solid var(--panel-border); border-radius: 10px; padding: 9px 14px; min-height: 42px;
    color: var(--text-main); font-size: 14px; font-weight: 600; cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.adash-mgr-btn:hover { border-color: var(--brand-accent); color: var(--brand-accent); }
.adash-mgr-btn.has-value { color: var(--brand-accent); border-color: var(--brand-accent); }
.adash-mgr-panel {
    display: none; position: absolute; top: calc(100% + 8px); right: 0; z-index: 20; width: min(390px, calc(100vw - 120px)); max-height: 65vh; overflow-y: auto;
    background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 12px;
    padding: 8px; box-shadow: 0 10px 28px rgba(0,0,0,0.22);
}
.adash-mgr-panel.is-open { display: block; }
.adash-mgr-item {
    display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 8px;
    font-size: 14px; color: var(--text-main);
}
.adash-mgr-item:hover { background: rgba(var(--brand-accent-rgb), 0.1); }
.adash-mgr-item label { display: flex; align-items: center; gap: 10px; flex: 1; cursor: pointer; min-width: 0; min-height: 40px; }
.adash-mgr-item input { width: 17px; height: 17px; accent-color: var(--adash-positive); flex-shrink: 0; }
.adash-mgr-help { color: var(--adash-secondary); font-size: 13px; margin: 4px 8px 10px; }
.adash-mgr-reset { width: 100%; padding: 10px; border: 1px solid var(--panel-border); background: none; color: var(--text-main); border-radius: 8px; margin-top: 8px; }

/* Offline-Hinweis über dem Grid, wenn Kacheln aus dem localStorage-Zwischenspeicher statt live
   geladen werden (adashRenderFromCache() in admin_dashboard.php) — gleiche Bernstein-Farbe wie
   der App-weite Offline-Banner/Queued-Toast, damit das Muster wiedererkennbar bleibt. */
.adash-cache-note {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: rgba(180,83,9,.1);
    border: 1px solid rgba(180,83,9,.3); border-radius: 10px; padding: 9px 14px;
    color: var(--adash-secondary); font-size: 14px; margin-bottom: 14px;
}
.adash-cache-note svg { flex-shrink: 0; }

@media (min-width: 1500px) { .adash-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .adash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
    .adash-start { grid-template-columns: minmax(0, 1fr); gap: 4px; margin-bottom: 12px; }
    .adash-shortcuts { padding: 12px 0; }
    #adash-shortcuts { display: flex; gap: 8px; flex-wrap: wrap; }
    .adash-shortcut { border: 1px solid var(--panel-border); padding: 8px 12px; min-height: 42px; font-size: 13px; }
    .adash-shortcut > svg { display: none; }
    .adash-workday { padding: 16px; }
    .adash-head { align-items: flex-start; padding-right: 0; }
    .adash-head h1 { font-size: 24px; }
    .adash-mgr-btn { font-size: 13px; padding: 8px 10px; }
}
@media (max-width: 520px) {
    .adash-grid { grid-template-columns: minmax(0, 1fr); }
    .adash-task { grid-template-columns: minmax(0, 1fr) 18px; gap: 2px 8px; }
    .adash-task-due { grid-column: 1; grid-row: 2; text-align: left; }
    .adash-task > svg { grid-column: 2; grid-row: 1 / 3; }
    .adash-head { flex-wrap: wrap; gap: 10px; }
    .adash-mgr-panel { left: auto; right: 0; width: min(390px, calc(100vw - 48px)); box-sizing: border-box; }
}
@media (prefers-reduced-motion: reduce) { .adash-tile { transition: none; } }

/* -- Verbesserungsvorschläge / Wunschliste (html/modules/feature_requests.php) -- */
.fr-is-hidden { display: none !important; }
.fr-modal-overlay.is-open { display: flex; }
.fr-lightbox.is-open { display: flex; }
.fr-page { padding: 28px 32px; }
.fr-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.fr-page-title { margin: 0; font-size: 24px; color: var(--text-main); }
.fr-page-sub { margin: 8px 0 0; color: var(--text-muted); font-size: 13px; max-width: 62ch; line-height: 1.6; }

/* ── Kennzahlen-Leiste über der Liste, dem Board und den Kacheln; Zahlen zählen die aktuell
   geladene/gefilterte Menge. ── */
.fr-stats-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 18px; }
.fr-stat-card { background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 12px; padding: 12px 16px; border-top: 3px solid var(--panel-border); }
.fr-stat-value { font-size: 22px; font-weight: 700; color: var(--text-main); line-height: 1.2; }
.fr-stat-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.fr-stat-card-offen { border-top-color: #94a3b8; }
.fr-stat-card-in_arbeit { border-top-color: var(--brand-accent); }
.fr-stat-card-erledigt { border-top-color: #22c55e; }
.fr-stat-card-critical { border-top-color: var(--danger-red); }
.fr-stat-card-critical .fr-stat-value { color: var(--danger-red); }

/* ── Listen-, Board- und Kachelansicht ── */
.fr-view-toggle { display: inline-flex; border: 1px solid var(--panel-border); border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.fr-view-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-bg); border: none; border-right: 1px solid var(--panel-border); padding: 8px 13px; font-size: 12.5px; color: var(--text-muted); cursor: pointer; transition: .15s; font-family: inherit; }
.fr-view-btn:last-child { border-right: none; }
.fr-view-btn:hover { color: var(--text-main); }
.fr-view-btn.active { background: rgba(102,157,36,.12); color: var(--brand-accent); font-weight: 600; }
.fr-view-btn:focus-visible, .fr-filter-btn:focus-visible, .fr-list-details summary:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }

.fr-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.fr-search-wrap { position: relative; flex: 1 1 220px; min-width: 180px; }
.fr-search-wrap svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.fr-search { width: 100%; box-sizing: border-box; padding: 9px 12px 9px 34px; background: var(--input-bg); border: 1px solid var(--panel-border); border-radius: 8px; color: var(--text-main); font-size: 13px; }
.fr-search:focus { border-color: var(--brand-accent); outline: none; }
.fr-select { background: var(--input-bg); border: 1px solid var(--panel-border); border-radius: 8px; color: var(--text-main); font-size: 12.5px; padding: 8px 10px; }
.fr-select:focus { border-color: var(--brand-accent); outline: none; }
.fr-select-full { width: 100%; box-sizing: border-box; margin-bottom: 14px; }

/* ── Kombiniertes "Filter"-Dropdown (Modul/Status/Priorität/Aufwand) — eigene fr-Präfix-Klassen,
   optisch/funktional nach Vorbild von lead_controlling.php's lc-stage-dropdown- und lc-filter-panel
   Klassen (dort noch im modul-eigenen style-Block, daher hier bewusst als eigenständige fr-Klassen
   statt Cross-Modul-Wiederverwendung — siehe css-konventionen.md). ── */
.fr-filter-dropdown-wrap { position: relative; flex-shrink: 0; }
.fr-filter-btn { position: relative; background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 8px; padding: 8px 14px; color: var(--text-muted); cursor: pointer; font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; transition: .15s; white-space: nowrap; }
.fr-filter-btn:hover { border-color: color-mix(in srgb, var(--brand-accent) 45%, var(--panel-border)); color: var(--text-main); }
.fr-filter-btn.has-value { border-color: var(--brand-accent); color: var(--brand-accent); background: rgba(102,157,36,.08); }
.fr-filter-count { position: absolute; top: -6px; right: -6px; background: var(--brand-accent); color: #fff; border-radius: 999px; font-size: 9px; font-weight: 700; padding: 1px 5px; line-height: 1.4; min-width: 14px; text-align: center; box-shadow: 0 0 0 2px var(--panel-bg); }
.fr-filter-panel { display: none; position: absolute; top: calc(100% + 5px); right: 0; min-width: 480px; max-width: 92vw; background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 10px; z-index: 300; box-shadow: 0 6px 22px rgba(0,0,0,.4); padding: 10px; }
.fr-filter-panel.is-open { display: block; }
.fr-filter-panel-cols { display: flex; align-items: stretch; gap: 4px; }
.fr-filter-panel-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.fr-filter-panel-col-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); padding: 2px 8px 6px; }
.fr-filter-panel-vsep { width: 1px; align-self: stretch; background: var(--panel-border); flex-shrink: 0; margin: 0 4px; }
.fr-filter-panel-list { max-height: 240px; overflow-y: auto; }
.fr-chk-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 7px; font-size: 12px; color: var(--text-main); cursor: pointer; transition: .12s; user-select: none; }
.fr-chk-item:hover { background: color-mix(in srgb, var(--brand-accent) 8%, transparent); }
.fr-chk-box { width: 15px; height: 15px; border: 1.5px solid var(--panel-border); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: .12s; color: #fff; }
.fr-chk-item.is-checked .fr-chk-box { background: var(--brand-accent); border-color: var(--brand-accent); }
.fr-search-wrap.has-filter .fr-search { padding-right: 175px; }
.fr-filter-tag { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: rgba(102,157,36,.12); border: 1px solid rgba(102,157,36,.4); border-radius: 14px; padding: 2px 4px 2px 8px; font-size: 11px; color: var(--brand-accent); display: none; align-items: center; gap: 3px; z-index: 1; max-width: 220px; }
.fr-filter-tag.is-active { display: inline-flex; }
.fr-filter-tag span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-filter-tag button { background: none; border: none; color: var(--brand-accent); opacity: .7; cursor: pointer; padding: 0 2px; font-size: 14px; line-height: 1; flex-shrink: 0; }
.fr-filter-tag button:hover { opacity: 1; }
@media (max-width: 640px) {
    .fr-filter-panel { left: 0; right: auto; min-width: 0; width: 100%; }
    .fr-filter-panel-cols { flex-direction: column; gap: 8px; }
    .fr-filter-panel-vsep { display: none; }
}

.fr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.fr-loading, .fr-empty { grid-column: 1 / -1; text-align: center; padding: 50px 20px; color: var(--text-muted); font-size: 13px; }
.fr-card { position: relative; background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 9px; box-shadow: 0 2px 10px rgba(0,0,0,.08); transition: box-shadow .2s, transform .15s; }
.fr-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.16); transform: translateY(-2px); }
.fr-card-edit-btn { position: absolute; top: 12px; right: 12px; opacity: 0; transition: opacity .15s; z-index: 1; }
.fr-card:hover .fr-card-edit-btn, .fr-card-edit-btn:focus-visible { opacity: 1; }
.fr-card-delete-btn { position: absolute; bottom: 12px; right: 12px; opacity: 0; transition: opacity .15s; z-index: 1; }
.fr-card:hover .fr-card-delete-btn, .fr-card-delete-btn:focus-visible { opacity: 1; }
@media (hover: none) { .fr-card-edit-btn, .fr-card-delete-btn { opacity: 1; } }
.fr-card-head { display: flex; flex-wrap: wrap; gap: 6px; padding-right: 30px; }
.fr-badge { display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 600; border-radius: 999px; padding: 3px 10px; white-space: nowrap; border: 1px solid transparent; }
.fr-badge-module { background: var(--bg-dark); border-color: var(--panel-border); color: var(--text-muted); }
.fr-badge-type-fehler { background: rgba(220,38,38,.12); color: var(--danger-red); }
.fr-badge-type-verbesserung { background: rgba(102,157,36,.12); color: var(--brand-accent); }
.fr-badge-type-ergänzung { background: rgba(99,102,241,.14); color: #6366f1; }
.fr-badge-prio-none { background: rgba(148,163,184,.12); color: var(--text-muted); }
.fr-badge-prio-niedrig { background: rgba(59,130,246,.12); color: #3b82f6; }
.fr-badge-prio-mittel { background: rgba(234,179,8,.14); color: #ca9a08; }
.fr-badge-prio-hoch { background: rgba(249,115,22,.14); color: #f97316; }
.fr-badge-prio-kritisch { background: rgba(220,38,38,.14); color: var(--danger-red); }
.fr-badge-status-offen { background: rgba(148,163,184,.14); color: var(--text-muted); }
.fr-badge-status-in_arbeit { background: rgba(102,157,36,.14); color: var(--brand-accent); }
.fr-badge-status-erledigt { background: rgba(34,197,94,.14); color: #22c55e; }
.fr-badge-effort-none { background: rgba(148,163,184,.12); color: var(--text-muted); }
.fr-badge-effort-einfach { background: rgba(20,184,166,.14); color: #14b8a6; }
.fr-badge-effort-mittel { background: rgba(99,102,241,.14); color: #6366f1; }
.fr-badge-effort-aufwendig { background: rgba(168,85,247,.14); color: #a855f7; }
.fr-card-title { margin: 0; font-size: 15px; font-weight: 700; color: var(--text-main); line-height: 1.3; }
.fr-card-desc { margin: 0; font-size: 12.5px; color: var(--text-muted); line-height: 1.55; max-height: 4.7em; overflow: hidden; text-overflow: ellipsis; }
.fr-card-thumb { display: block; padding: 0; border: 1px solid var(--panel-border); border-radius: 10px; overflow: hidden; cursor: zoom-in; background: none; }
.fr-card-thumb img { display: block; width: 100%; max-height: 160px; object-fit: cover; }
.fr-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--text-muted); }
.fr-card-manage { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; border-top: 1px solid var(--panel-border); }
/* flex-wrap statt starrer Segment-Pille: verhindert, dass die Buttons (v.a. die 5er PRIO-Reihe)
   über schmale Karten/Board-Spalten hinausragen \u2013 jeder Button ist jetzt ein eigener, umbrechender
   Chip statt eines zusammenhängenden Segments. */
.fr-type-switch {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px;
}
.fr-type-btn {
    border: 1px solid var(--panel-border); border-radius: 10px; background: var(--bg-dark); color: var(--text-muted);
    padding: 10px 12px; font-size: 12px; font-weight: 600; cursor: pointer; transition: .15s ease;
}
.fr-type-btn:hover { border-color: var(--brand-accent); color: var(--text-main); }
.fr-type-btn.is-active {
    background: linear-gradient(180deg, rgba(102,157,36,.18), rgba(102,157,36,.08));
    border-color: color-mix(in srgb, var(--brand-accent) 50%, var(--panel-border));
    color: var(--brand-accent);
    box-shadow: inset 0 0 0 1px rgba(102,157,36,.18);
}
.fr-type-btn[data-fr-type-value="fehler"].is-active {
    background: linear-gradient(180deg, rgba(220,38,38,.16), rgba(220,38,38,.08));
    border-color: rgba(220,38,38,.5); color: var(--danger-red);
}
.fr-type-btn[data-fr-type-value="ergänzung"].is-active {
    background: linear-gradient(180deg, rgba(99,102,241,.16), rgba(99,102,241,.08));
    border-color: rgba(99,102,241,.5); color: #6366f1;
}
.fr-switch-row { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.fr-switch-label { flex: 0 0 56px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); padding-top: 6px; }
.fr-switch-group { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto; min-width: 0; }
.fr-switch-btn { background: var(--bg-dark); border: 1px solid var(--panel-border); border-radius: 6px; padding: 5px 9px; font-size: 11px; font-weight: 500; color: var(--text-muted); cursor: pointer; transition: .15s; white-space: nowrap; }
.fr-switch-btn:hover { color: var(--text-main); background: color-mix(in srgb, var(--brand-accent) 12%, var(--bg-dark)); }
.fr-switch-btn.active { font-weight: 700; }
.fr-switch-btn[data-fr-prio-value=""].active { background: rgba(148,163,184,.18); color: var(--text-muted); }
.fr-switch-btn[data-fr-prio-value="niedrig"].active { background: rgba(59,130,246,.18); color: #3b82f6; }
.fr-switch-btn[data-fr-prio-value="mittel"].active { background: rgba(234,179,8,.2); color: #ca9a08; }
.fr-switch-btn[data-fr-prio-value="hoch"].active { background: rgba(249,115,22,.2); color: #f97316; }
.fr-switch-btn[data-fr-prio-value="kritisch"].active { background: rgba(220,38,38,.2); color: var(--danger-red); }
.fr-switch-btn[data-fr-status-value="offen"].active { background: rgba(148,163,184,.18); color: var(--text-muted); }
.fr-switch-btn[data-fr-status-value="in_arbeit"].active { background: rgba(102,157,36,.18); color: var(--brand-accent); }
.fr-switch-btn[data-fr-status-value="erledigt"].active { background: rgba(34,197,94,.18); color: #22c55e; }
.fr-switch-btn[data-fr-effort-value=""].active { background: rgba(148,163,184,.18); color: var(--text-muted); }
.fr-switch-btn[data-fr-effort-value="einfach"].active { background: rgba(20,184,166,.18); color: #14b8a6; }
.fr-switch-btn[data-fr-effort-value="mittel"].active { background: rgba(99,102,241,.18); color: #6366f1; }
.fr-switch-btn[data-fr-effort-value="aufwendig"].active { background: rgba(168,85,247,.18); color: #a855f7; }
.fr-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex-shrink: 0; border-radius: 7px; border: 1px solid var(--panel-border); background: var(--bg-dark); color: var(--text-muted); cursor: pointer; transition: .15s; }
.fr-icon-btn:hover { border-color: var(--danger-red); color: var(--danger-red); }
.fr-icon-danger:hover { background: rgba(220,38,38,.1); }
.fr-card-edit-btn:hover { border-color: var(--brand-accent); color: var(--brand-accent); background: rgba(102,157,36,.1); }

/* Kompakte Statusübersicht; lange Beschreibungen und Triage-Aktionen erscheinen erst auf Nachfrage. */
.fr-list { margin-bottom: 16px; overflow: hidden; background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 12px; }
.fr-list-tools { display: flex; justify-content: flex-end; margin: -6px 0 8px; }
.fr-list-tools-empty { display: none !important; }
.fr-completed-toggle { display: inline-flex; min-height: 44px; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--panel-border); border-radius: 8px; color: var(--text-muted); font-size: 12px; cursor: pointer; }
.fr-completed-toggle input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand-accent); }
.fr-completed-toggle input:disabled { cursor: not-allowed; }
.fr-completed-count { color: var(--text-main); font-size: 11px; font-variant-numeric: tabular-nums; }
.fr-completed-toggle.is-disabled { cursor: default; opacity: .7; }
.fr-list-row { display: grid; grid-template-columns: minmax(160px, 2fr) minmax(85px, .85fr) minmax(90px, .8fr) minmax(95px, .8fr) minmax(125px, 1fr) max-content; align-items: center; gap: 14px; padding: 12px 16px 12px 18px; border-left: 4px solid transparent; border-bottom: 1px solid var(--panel-border); transition: background .15s; }
.fr-list-row:last-child { border-bottom: none; }
.fr-list-row:hover { background: color-mix(in srgb, var(--brand-accent) 4%, var(--panel-bg)); }
.fr-list-row-type-fehler { border-left-color: var(--danger-red); background: rgba(220,38,38,.02); }
.fr-list-row-type-verbesserung { border-left-color: var(--brand-accent); background: rgba(102,157,36,.02); }
.fr-list-row-type-ergänzung { border-left-color: #6366f1; background: rgba(99,102,241,.02); }
.fr-list-summary, .fr-list-field { min-width: 0; }
.fr-list-title { margin: 0; color: var(--text-main); font-size: 13px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.fr-list-preview { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin: 4px 0 0; color: var(--text-muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.fr-list-field { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; color: var(--text-main); font-size: 12px; line-height: 1.35; }
.fr-list-label { color: var(--text-muted); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.fr-list-field .fr-badge { max-width: 100%; white-space: normal; }
.fr-list-author time { color: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.fr-list-details { justify-self: end; }
.fr-list-details[open] { grid-column: 1 / -1; justify-self: stretch; }
.fr-list-details summary { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; border: 1px solid var(--panel-border); border-radius: 7px; color: var(--text-muted); font-size: 11.5px; font-weight: 600; cursor: pointer; list-style: none; white-space: nowrap; }
.fr-list-details summary::-webkit-details-marker { display: none; }
.fr-list-details summary::after { content: ''; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.fr-list-details[open] summary::after { transform: rotate(225deg) translate(-1px, -1px); }
.fr-list-details summary:hover { border-color: var(--brand-accent); color: var(--text-main); }
.fr-list-details-content { display: grid; justify-items: start; gap: 12px; padding: 14px 0 2px; border-top: 1px solid var(--panel-border); margin-top: 12px; }
.fr-list-description { max-width: 72ch; margin: 0; color: var(--text-main); font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.fr-list-actions { display: flex; gap: 8px; }
.fr-list-action-btn { width: 44px; height: 44px; }
.fr-list .fr-switch-btn { min-height: 44px; }
.fr-list-message { padding: 28px 18px; color: var(--text-muted); text-align: center; font-size: 13px; }

/* ── Board-Ansicht: alternative Gruppierung der Vorschläge nach Status (siehe
   frRenderBoard()/frApplyViewMode() in feature_requests.php) — hält die Übersicht bei vielen
   Einträgen, da jede Spalte unabhängig scrollt statt einer endlos wachsenden Kachel-Fläche. ── */
.fr-board { display: flex; align-items: flex-start; gap: 16px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 16px; }
/* flex:1 1 0 ohne max-width lässt die 3 Spalten die komplette verfügbare Breite (auch Ultrawide)
   ausfüllen; die Karten wachsen dabei nicht beliebig in die Breite, sondern .fr-board-col-body
   ist ein auto-fill-Grid, das bei viel Platz mehrere Karten nebeneinander in derselben Spalte
   anordnet (mehr sichtbarer Inhalt statt nur Leerraum/übermäßig breiter Karten). */
.fr-board-col { flex: 1 1 0; min-width: 300px; display: flex; flex-direction: column; background: rgba(255,255,255,.02); border: 1px solid var(--panel-border); border-radius: 14px; max-height: calc(100vh - 380px); min-height: 220px; }
.fr-board-col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 13px 14px; border-bottom: 1px solid var(--panel-border); border-top: 3px solid var(--panel-border); border-radius: 14px 14px 0 0; flex-shrink: 0; }
.fr-board-col-head-offen { border-top-color: #94a3b8; }
.fr-board-col-head-in_arbeit { border-top-color: var(--brand-accent); }
.fr-board-col-head-erledigt { border-top-color: #22c55e; }
.fr-board-col-title { font-size: 13px; font-weight: 700; color: var(--text-main); }
.fr-board-col-count { min-width: 22px; text-align: center; justify-content: center; }
.fr-board-col-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); align-content: start; gap: 12px; padding: 12px; overflow-y: auto; }
.fr-board-col-empty { text-align: center; padding: 30px 10px; color: var(--text-muted); font-size: 12px; grid-column: 1 / -1; }
@media (max-width: 900px) {
    .fr-board { flex-direction: column; overflow-x: visible; }
    .fr-board-col { width: 100%; max-height: none; }
    .fr-board-col-body { max-height: 420px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
    .fr-list-row { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
    .fr-list-summary, .fr-list-details { grid-column: 1 / -1; justify-self: stretch; }
    .fr-list-details summary { min-height: 44px; }
}
@media (max-width: 640px) {
    .fr-list-row { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; }
    .fr-list-title { font-size: 13px; }
    .fr-list-preview { -webkit-line-clamp: 3; }
    .fr-list-details-content { padding-top: 12px; }
    .fr-list .fr-switch-label { flex-basis: 100%; }
}

/* Erstellen-Modal */
.fr-modal-content { max-width: 560px; width: 92%; max-height: 88vh; overflow-y: auto; text-align: left; padding: 28px; }
.fr-modal-title { margin: 0 0 18px; font-size: 19px; color: var(--text-main); }
.fr-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.fr-textarea { min-height: 90px; resize: vertical; font-family: inherit; }
.fr-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

.fr-image-drop { position: relative; border: 2px dashed var(--panel-border); border-radius: 12px; padding: 18px; cursor: pointer; transition: border-color .2s, background .2s; margin-bottom: 4px; }
.fr-image-drop:hover { border-color: color-mix(in srgb, var(--brand-accent) 45%, var(--panel-border)); }
.fr-image-drop.is-dragover { border-color: var(--accent-gold); background: rgba(102,157,36,.06); }
.fr-image-placeholder { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-muted); font-size: 12.5px; padding: 14px 0; text-align: center; }
.fr-image-paste-hint { font-size: 11px; opacity: .75; }
.fr-image-editor { cursor: default; }
.fr-canvas-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.fr-canvas-hint { font-size: 11.5px; color: var(--text-muted); }
.fr-color-input { width: 32px; height: 30px; padding: 2px; border: 1px solid var(--panel-border); border-radius: 6px; background: none; cursor: pointer; }
.fr-canvas-btn { padding: 6px 11px; font-size: 11.5px; }
.fr-canvas-btn-danger { border-color: var(--danger-red); color: var(--danger-red); }
.fr-canvas-wrap { border: 1px solid var(--panel-border); border-radius: 10px; overflow: auto; max-height: 60vh; background: var(--bg-dark); display: flex; }
.fr-canvas-wrap canvas { display: block; max-width: 100%; height: auto; touch-action: none; cursor: crosshair; margin: auto; }

/* Screenshot-Lightbox */
.fr-lightbox { position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; padding: 30px; cursor: zoom-out; }
.fr-lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 20px 50px rgba(0,0,0,.5); }

@media (max-width: 640px) {
    .fr-page { padding: 16px; }
    .fr-toolbar { flex-direction: column; align-items: stretch; }
    .fr-search-wrap { flex: 1 1 auto; }
    .fr-filter-dropdown-wrap { width: 100%; }
    .fr-filter-btn { width: 100%; justify-content: space-between; }
    .fr-view-toggle { width: 100%; }
    .fr-view-btn { flex: 1 1 0; justify-content: center; }
}

/* ── Gerätesteuerung (MQTT): Geräteübersicht + Verwaltung (Server/Geräte), siehe
   html/modules/geraetesteuerung.php + html/api_geraetesteuerung.php. Präfix gs-. ── */
.gs-page { padding: 28px 32px; }
.gs-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.gs-page-title { margin: 0; font-size: 24px; color: var(--text-main); }
.gs-page-sub { margin: 8px 0 0; color: var(--text-muted); font-size: 13px; max-width: 62ch; line-height: 1.6; }

.gs-subtabs { margin-bottom: 18px; width: fit-content; }

.gs-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 50px 20px; color: var(--text-muted); text-align: center; }
.gs-empty svg { opacity: .5; }

.gs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.gs-card { background: linear-gradient(160deg, var(--panel-bg) 0%, rgba(255,255,255,.02) 100%); border: 1px solid var(--panel-border); border-radius: 16px; padding: 18px; box-shadow: 0 2px 10px rgba(0,0,0,.08); transition: box-shadow .2s, transform .15s, border-color .2s; }
.gs-card:hover { box-shadow: 0 10px 28px rgba(0,0,0,.22); transform: translateY(-3px); border-color: rgba(255,255,255,.14); }
.gs-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.gs-card-title { display: inline-flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 700; color: var(--text-main); min-width: 0; }
.gs-conn-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.gs-conn-dot.is-online { background: #3d9a68; box-shadow: 0 0 0 3px rgba(61,154,104,.18); }
.gs-conn-dot.is-offline { background: var(--danger-red); box-shadow: 0 0 0 3px rgba(224,90,90,.18); }

.gs-card-body { display: flex; flex-direction: column; gap: 4px; }
.gs-ctrl-empty { font-size: 12px; color: var(--text-muted); }
.gs-ctrl-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gs-ctrl-row-slider { flex-direction: column; align-items: stretch; gap: 6px; }
.gs-ctrl-label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-main); }
.gs-ctrl-label svg { color: var(--accent-gold); flex-shrink: 0; }
.gs-ctrl-body { display: flex; align-items: center; gap: 10px; }
.gs-ctrl-body-slider { width: 100%; }

/* Ein/Aus: großer, dauerhaft sichtbarer Schalter ohne eigene Überschrift — das einzige Element,
   das auf der Geräte-Kachel immer präsent ist (siehe gsDeviceCardHtml). Beim Einschalten pulsiert
   ein grüner Glühring nach außen, um das Gerät spürbar "lebendig" wirken zu lassen. */
.gs-card-power { display: flex; align-items: center; gap: 16px; padding: 4px 0 10px; }
.gs-power-btn { position: relative; width: 58px; height: 58px; border-radius: 50%; border: 2px solid var(--panel-border); background: rgba(255,255,255,.03); color: var(--text-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; transition: border-color .25s, color .25s, background .25s, box-shadow .25s, transform .12s; }
.gs-power-btn svg { width: 26px; height: 26px; }
.gs-power-btn:active { transform: scale(.94); }
.gs-power-btn.is-on { border-color: #3d9a68; color: #3d9a68; background: rgba(61,154,104,.16); box-shadow: 0 0 0 7px rgba(61,154,104,.1), 0 0 26px rgba(61,154,104,.4); }
.gs-power-btn.is-on::after { content: ''; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid rgba(61,154,104,.5); animation: gsPowerPulse 2.2s ease-out infinite; pointer-events: none; }
.gs-power-btn.is-off { border-color: var(--panel-border); color: var(--text-muted); }
.gs-power-btn.is-unknown { border-style: dashed; color: var(--text-muted); }
.gs-power-btn:disabled { cursor: default; opacity: .5; }
.gs-power-btn.gs-is-pending { opacity: .7; pointer-events: none; }
@keyframes gsPowerPulse { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.35); opacity: 0; } }

.gs-power-status { font-size: 13.5px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; color: var(--text-muted); }
.gs-power-status.is-on { color: #3d9a68; }
.gs-power-status.is-unknown { font-style: italic; text-transform: none; }

/* Gruppen-Sammelschalter: zusätzlicher "teilweise an"-Zustand (nicht alle Geräte gleich), da ein
   Gruppenschalter — anders als ein Einzelgerät — mehr als zwei mögliche Zustände abbilden muss. */
.gs-power-btn.is-mixed { border-color: var(--accent-gold); color: var(--accent-gold); background: rgba(214,175,84,.14); }
.gs-power-status.is-mixed { color: var(--accent-gold); }

/* Helligkeit/Lautstärke: zweitrangig, standardmäßig eingeklappt hinter "Weitere Einstellungen" —
   grid-template-rows-Trick für eine flüssige Aufklapp-Animation ganz ohne JS-Höhenberechnung. */
.gs-more-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; background: none; border: none; border-top: 1px solid var(--panel-border); margin-top: 4px; padding: 10px 0 0; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--text-muted); cursor: pointer; }
.gs-more-toggle:hover { color: var(--text-main); }
.gs-more-toggle svg { transition: transform .2s; flex-shrink: 0; }
.gs-more-toggle.is-open svg { transform: rotate(180deg); }
.gs-more-wrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .25s ease; }
.gs-more-wrap.is-open { grid-template-rows: 1fr; }

/* -- Changelog / "Was ist neu" (html/modules/admin_changelog.php) -- */
.cl-page { padding: 28px 32px; max-width: 820px; margin: 0 auto; }
.cl-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.cl-page-title { font-size: 22px; font-weight: 800; margin: 0 0 6px; color: var(--text-main); }
.cl-page-sub { font-size: 13px; color: var(--text-muted); margin: 0; max-width: 520px; }
.cl-timeline { display: flex; flex-direction: column; gap: 22px; }
.cl-release {
    position: relative; background: var(--panel-bg); border: 1px solid var(--panel-border);
    border-radius: 14px; padding: 20px 24px; padding-left: 28px;
}
.cl-release::before { content: ''; position: absolute; left: 0; top: 20px; bottom: 20px; width: 3px; border-radius: 3px; background: var(--brand-accent); opacity: .55; }
.cl-release.is-draft { border-style: dashed; opacity: .8; }
.cl-release-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 4px; }
.cl-release-date { font-size: 12px; font-weight: 700; letter-spacing: .03em; color: var(--brand-accent); text-transform: uppercase; }
.cl-release-version { font-size: 11px; font-weight: 700; color: var(--text-muted); background: rgba(255,255,255,.06); border-radius: 20px; padding: 2px 9px; }
.cl-release-draft-badge { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #d6af54; background: rgba(214,175,84,.14); border-radius: 20px; padding: 2px 9px; }
.cl-release-headline { font-size: 16.5px; font-weight: 700; color: var(--text-main); margin: 2px 0 12px; }
.cl-items { display: flex; flex-direction: column; gap: 8px; }
.cl-item { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; line-height: 1.5; color: var(--text-main); }
.cl-item-tag {
    flex-shrink: 0; width: 84px; box-sizing: border-box; text-align: center;
    font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
    border-radius: 6px; padding: 2px 4px; margin-top: 1px; white-space: nowrap;
}
.cl-item-tag.cat-neu { background: rgba(102,157,36,.16); color: var(--brand-accent); }
.cl-item-tag.cat-verbessert { background: rgba(90,150,220,.16); color: #5a96dc; }
.cl-item-tag.cat-behoben { background: rgba(220,140,60,.16); color: #dc8c3c; }
.cl-release-actions { position: absolute; top: 16px; right: 18px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.cl-release:hover .cl-release-actions { opacity: 1; }
@media (hover: none) { .cl-release-actions { opacity: 1; } }
.cl-release-action-btn {
    width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--panel-border); background: var(--panel-bg);
    color: var(--text-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: .15s;
}
.cl-release-action-btn:hover { border-color: var(--brand-accent); color: var(--brand-accent); }
.cl-release-action-btn.cl-danger:hover { border-color: #d9534f; color: #d9534f; }
.cl-empty { text-align: center; padding: 60px 20px; color: var(--text-muted); font-size: 13.5px; }

/* -- Editor-Modal (Anlegen/Bearbeiten eines Releases + dynamische Stichpunkt-Liste) -- */
#cl-modal .modal-content { max-width: 560px; padding: 28px; max-height: 88vh; overflow-y: auto; }
.cl-form-row { display: flex; gap: 12px; margin-bottom: 14px; }
.cl-form-row > div { flex: 1 1 0; }
.cl-form-label { display: block; font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 5px; }
.cl-published-row { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.cl-published-row input[type="checkbox"] { width: 16px; height: 16px; padding: 0; flex: 0 0 auto; }
.cl-item-editor-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.cl-item-editor-row { display: flex; gap: 8px; align-items: flex-start; }
.cl-item-editor-row select { flex: 0 0 132px; }
.cl-item-editor-row textarea { flex: 1 1 auto; min-height: 40px; resize: vertical; font-family: inherit; }
.cl-item-remove-btn {
    flex-shrink: 0; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--panel-border);
    background: transparent; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.cl-item-remove-btn:hover { border-color: #d9534f; color: #d9534f; }
.cl-add-item-btn {
    display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--brand-accent);
    background: none; border: 1px dashed var(--brand-accent); border-radius: 8px; padding: 7px 12px; cursor: pointer; margin-bottom: 18px;
}
.cl-add-item-btn:hover { background: rgba(102,157,36,.08); }
.cl-modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

@media (max-width: 640px) {
    .cl-page { padding: 16px; }
    .cl-form-row { flex-direction: column; gap: 10px; }
    .cl-item-editor-row { flex-wrap: wrap; }
    .cl-item-editor-row select { flex: 1 1 100%; }
}
.gs-more-panel { overflow: hidden; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.gs-more-wrap.is-open .gs-more-panel { padding-top: 12px; }

/* Gerätedashboard: Gruppen- und Einzelgeräte-Sektion, jeweils mit eigener Überschrift — Gruppen
   immer oben, darunter ALLE Einzelgeräte (auch bereits gruppierte, siehe gsRenderDevices). */
.gs-dash-section + .gs-dash-section { margin-top: 30px; }
.gs-dash-section-title { margin: 0 0 14px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }

/* Gerätegruppen im Nutzer-Dashboard: kommen vor den Einzel-Geräten (dezenter goldener Rand links
   zur Unterscheidung), Sammelschalter oben wie bei einem Einzelgerät. */
.gs-group-card { border-left: 3px solid var(--accent-gold); }
.gs-group-count { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; flex-shrink: 0; }
.gs-group-icon-badge { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; background: rgba(214,175,84,.14); color: var(--accent-gold); flex-shrink: 0; }
.gs-card-group-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--accent-gold); margin: -8px 0 12px; }
.gs-card-group-tag svg { width: 12px; height: 12px; flex-shrink: 0; }

/* Admin-Reihenfolge per Drag & Drop (Geräte-/Gruppen-Verwaltungsliste) — analog zum
   Kachel-Reorder im App-Dashboard (adash-drag-over), hier per Griff-Icon statt der ganzen Karte. */
.gs-drag-handle { display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); cursor: grab; flex-shrink: 0; touch-action: none; }
.gs-drag-handle:active { cursor: grabbing; }
.gs-server-card.gs-dragging { opacity: .4; }
.gs-subview-hint { margin: 0 0 12px; font-size: 12px; color: var(--text-muted); }

/* Ein/Aus-Schalter (Checkbox-getrieben, kein natives Checkbox-Aussehen) — weiterhin für generische
   Toggles wie SSL/TLS im Server-Modal verwendet. */
.gs-switch { position: relative; display: inline-flex; width: 42px; height: 24px; flex-shrink: 0; }
.gs-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 2; }
.gs-switch-track { position: absolute; inset: 0; border-radius: 20px; background: rgba(255,255,255,.08); border: 1px solid var(--panel-border); transition: background .18s, border-color .18s; }
.gs-switch-thumb { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #cfcfcf; transition: transform .18s, background .18s; }
.gs-switch input:checked + .gs-switch-track { background: rgba(61,154,104,.28); border-color: #3d9a68; }
.gs-switch input:checked + .gs-switch-track .gs-switch-thumb { transform: translateX(18px); background: #3d9a68; }
.gs-switch.is-disabled, .gs-switch input:disabled { cursor: default; opacity: .55; }

.gs-slider { width: 100%; accent-color: var(--accent-gold); cursor: pointer; }
.gs-slider:disabled { cursor: default; opacity: .55; }
.gs-slider-value { font-size: 11.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; align-self: flex-end; }

/* Sensor-Messwert: rein lesend, daher statische Zeile statt Slider (siehe gsDeviceCardInner). */
.gs-ctrl-row-static { padding: 4px 0; }
.gs-ctrl-value-static { font-size: 15px; font-weight: 700; color: var(--text-main); font-variant-numeric: tabular-nums; }

/* Verwaltung: Server-/Geräte-Listen (gemeinsames Karten-Layout) */
.gs-server-list, .gs-device-admin-list { display: flex; flex-direction: column; gap: 10px; }
.gs-server-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 12px; padding: 12px 16px; }
.gs-server-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.gs-server-main svg { color: var(--text-muted); flex-shrink: 0; }
.gs-server-name { font-size: 13.5px; font-weight: 700; color: var(--text-main); }
.gs-server-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.gs-row-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.gs-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--panel-border); background: rgba(255,255,255,.02); color: var(--text-muted); cursor: pointer; transition: .15s; }
.gs-icon-btn:hover { border-color: var(--brand-accent); color: var(--brand-accent); background: rgba(102,157,36,.1); }
.gs-icon-btn-danger:hover { border-color: var(--danger-red); color: var(--danger-red); background: rgba(224,90,90,.1); }

/* Modals (Basis .modal-overlay/.modal-content aus Abschnitt 1, hier nur Größen-/Inhalts-Anpassung) */
#gs-server-modal .modal-content, #gs-device-modal .modal-content, #gs-group-modal .modal-content { max-width: 480px; max-height: 90vh; overflow-y: auto; padding: 26px; }
.gs-modal-content-lg { max-width: 620px !important; }
.gs-modal-title { margin: 0 0 18px; font-size: 17px; color: var(--text-main); }
.gs-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.gs-field { display: flex; flex-direction: column; gap: 5px; }
.gs-field-full { grid-column: 1 / -1; }
.gs-field-label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); }
.gs-field-toggle { flex-direction: row; align-items: center; justify-content: space-between; }
.gs-field-check { flex-direction: row; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
.gs-input { background: rgba(255,255,255,.03); border: 1px solid var(--panel-border); border-radius: 8px; padding: 9px 11px; color: var(--text-main); font-size: 13px; width: 100%; box-sizing: border-box; }
.gs-input:focus { outline: none; border-color: var(--brand-accent); }
.gs-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* Geräte-Checkliste im Gruppen-Modal: Zuordnung direkt beim Anlegen/Bearbeiten der Gruppe statt
   nur einzeln über den Geräte-Bearbeiten-Dialog (siehe .gs-switch für den Toggle selbst). */
.gs-group-devices-section { margin-top: 16px; }
.gs-group-device-list { display: flex; flex-direction: column; border: 1px solid var(--panel-border); border-radius: 10px; overflow: hidden; margin-top: 8px; max-height: 260px; overflow-y: auto; }
.gs-group-device-row { display: flex; align-items: center; gap: 11px; padding: 10px 12px; }
.gs-group-device-row + .gs-group-device-row { border-top: 1px solid var(--panel-border); }
.gs-group-device-text { flex: 1; min-width: 0; }
.gs-group-device-label { font-size: 13px; color: var(--text-main); font-weight: 500; display: block; }
.gs-group-device-meta { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.gs-group-device-empty { padding: 16px 12px; font-size: 12.5px; color: var(--text-muted); text-align: center; }

.gs-ctrl-section { border: 1px solid var(--panel-border); border-radius: 10px; padding: 12px 14px; margin-top: 12px; }
.gs-ctrl-section-head { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; font-weight: 700; color: var(--text-main); }
.gs-ctrl-section-head > input { flex: 0 0 16px; width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--brand-accent); }
.gs-ctrl-section-head > span { display: inline-flex; align-items: center; gap: 7px; }
.gs-ctrl-section-head svg { color: var(--accent-gold); }
.gs-ctrl-section-body { margin-top: 12px; }
.gs-ctrl-section-body[hidden] { display: none; }
.gs-reboot-hint, .gs-boot-hint { margin: 0; color: var(--text-main); font-size: 12px; line-height: 1.5; }
.gs-reboot-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; align-self: flex-start; min-height: 44px; padding: 9px 14px; border: 1px solid var(--panel-border); border-radius: 8px; background: var(--panel-bg); color: var(--text-main); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.gs-reboot-btn:hover:not(:disabled) { border-color: var(--brand-accent); background: var(--input-bg); }
.gs-reboot-btn:disabled { opacity: .55; cursor: default; }
.gs-reboot-btn:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 3px; }

/* Verlauf-Icon-Button in der Kartenkopfzeile (neben dem Verbindungs-Punkt) + zugehöriges Modal
   mit Chart.js-Diagramm (gsOpenHistoryModal/gsRenderHistoryChart, siehe geraetesteuerung.php). */
.gs-card-head-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.gs-history-btn { width: 28px; height: 28px; }
#gs-history-modal.is-open { display: flex; }
#gs-history-modal .modal-content { width: min(1040px, calc(100vw - 32px)); max-width: 1040px; max-height: 90vh; max-height: 90dvh; overflow-y: auto; padding: 26px; box-sizing: border-box; }
.gs-history-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.gs-history-tabs { display: flex; gap: 6px; flex-wrap: wrap; background: rgba(255,255,255,.03); border: 1px solid var(--panel-border); border-radius: 10px; padding: 4px; }
.gs-history-tab-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border: none; background: transparent; color: var(--text-main); font-size: 12px; font-weight: 600; padding: 7px 12px; border-radius: 7px; cursor: pointer; transition: background .15s, color .15s; }
.gs-history-tab-btn svg { color: var(--accent-gold); flex-shrink: 0; }
.gs-history-tab-btn:hover { color: var(--text-main); }
.gs-history-tab-btn.is-active { background: var(--accent-gold); color: #fff; }
.gs-history-tab-btn.is-active svg { color: #fff; }
.gs-history-navigation { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; border-top: 1px solid var(--panel-border); }
.gs-history-viewport { display: grid; gap: 5px; font-size: 13px; font-variant-numeric: tabular-nums; }
.gs-history-viewport span { color: var(--text-main); font-size: 12px; }
.gs-history-zoom { display: flex; align-items: center; gap: 8px; }
.gs-history-nav-btn { min-height: 44px; min-width: 44px; padding: 8px 12px; background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 7px; color: var(--text-main); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.gs-history-nav-btn svg { width: 18px; height: 18px; display: block; }
.gs-history-nav-btn:hover:not(:disabled) { background: var(--input-bg); border-color: var(--brand-accent); }
.gs-history-nav-btn:disabled { opacity: .45; cursor: default; }
.gs-history-tab-btn:focus-visible, .gs-history-nav-btn:focus-visible, #gs-history-position:focus-visible, #gs-history-chart:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 3px; }
.gs-history-chart-wrap { position: relative; width: 100%; height: clamp(220px, 38vh, 380px); }
#gs-history-chart { cursor: grab; touch-action: none; }
#gs-history-chart.is-dragging { cursor: grabbing; }
#gs-history-chart[hidden], .gs-history-empty[hidden], .gs-history-help[hidden] { display: none; }
.gs-history-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; padding: 16px; color: var(--text-main); font-size: 13px; text-align: center; }
.gs-history-navigator { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--panel-border); }
.gs-history-navigator label { font-size: 12px; flex-shrink: 0; }
#gs-history-position { flex: 1; min-width: 0; min-height: 44px; margin: 0; accent-color: var(--brand-accent); cursor: ew-resize; }
#gs-history-position:disabled { opacity: .4; cursor: default; }
.gs-history-help { margin: 0; color: var(--text-main); font-size: 12px; line-height: 1.6; }
#gs-history-note { margin-top: 8px; }
.gs-history-actions { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--panel-border); }
.gs-history-actions-title { margin: 0 0 8px; font-size: 14px; font-weight: 650; color: var(--text-main); }
.gs-history-actions-list { display: grid; max-height: 260px; overflow-y: auto; }
.gs-history-action { display: grid; grid-template-columns: minmax(150px, .7fr) minmax(0, 1.5fr); gap: 8px 16px; padding: 10px 4px; border-bottom: 1px solid var(--panel-border); }
.gs-history-action-meta { display: grid; gap: 3px; align-content: start; color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.gs-history-action-description { margin: 0; color: var(--text-main); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.gs-history-actions-empty, .gs-history-actions-note { margin: 0; padding: 8px 4px; color: var(--text-muted); font-size: 12px; line-height: 1.5; }

@media (max-width: 640px) {
    .gs-page { padding: 16px; }
    .gs-head { flex-direction: column; }
    .gs-form-grid { grid-template-columns: 1fr; }
    .gs-server-card { flex-wrap: wrap; }
    .gs-history-chart-wrap { height: 260px; }
    #gs-history-modal .modal-content { padding: 18px; }
    .gs-history-toolbar, .gs-history-navigator { align-items: stretch; flex-direction: column; gap: 8px; }
    .gs-history-tabs { flex-wrap: nowrap; }
    .gs-history-tab-btn { flex: 1; padding-inline: 8px; }
    .gs-history-navigation { align-items: flex-start; }
    .gs-history-zoom { width: 100%; }
    .gs-history-action { grid-template-columns: 1fr; gap: 4px; }
    #gs-history-reset { flex: 1; }
}

/* Gerätesteuerung: Automatisierungen, gegliedert in Wenn / Und wenn / Dann. */
.gs-auto[hidden] { display: none; }
.gs-auto { color: var(--text-main); font-size: 14px; line-height: 1.5; }
.gs-auto h2 { font-size: 22px; margin: 0 0 6px; letter-spacing: -.02em; }
.gs-auto h3 { font-size: 18px; margin: 0; }
.gs-auto-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 8px 0 24px; }
.gs-auto-heading p { max-width: 65ch; margin: 6px 0 0; color: var(--text-muted); }
.gs-auto-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px 14px; border: 1px solid var(--panel-border); border-radius: 8px; color: var(--text-main); background: var(--panel-bg); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; }
.gs-auto .btn-gold { background: var(--accent-gold); color: #fff; border-color: var(--accent-gold); }
.gs-auto-btn svg { width: 18px; height: 18px; flex: 0 0 18px; }
.gs-auto-btn:hover:not(:disabled) { border-color: var(--brand-accent); background: var(--input-bg); color: var(--text-main); }
.gs-auto button:disabled, .gs-auto input:disabled, .gs-auto select:disabled { opacity: .5; cursor: default; }
.gs-auto :is(button, input, select, textarea, summary):focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 3px; }
.gs-auto input, .gs-auto textarea { caret-color: var(--brand-accent); }
.gs-auto ::selection { background: var(--brand-accent); color: #fff; }
.gs-auto input[type="checkbox"] { width: 18px; height: 18px; flex: 0 0 18px; margin: 0; padding: 0; accent-color: var(--brand-accent); }
.gs-auto .gs-input { min-height: 44px; font-size: 14px; background: var(--input-bg); }
.gs-auto-list-tools { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin: 4px 0 20px; color: var(--text-muted); }
.gs-auto-list-tools .gs-auto-field { width: min(100%, 400px); }
.gs-auto-list { border-block: 1px solid var(--panel-border); }
.gs-auto-list-row { display: flex; justify-content: space-between; gap: 24px; align-items: center; padding: 18px 0; }
.gs-auto-list-row + .gs-auto-list-row { border-top: 1px solid var(--panel-border); }
.gs-auto-rule-link { display: grid; gap: 5px; text-align: left; min-width: 0; border: 0; padding: 6px 0; color: var(--text-main); background: transparent; font: inherit; cursor: pointer; }
.gs-auto-rule-link strong { font-size: 16px; }
.gs-auto-rule-link span { font-size: 13px; color: var(--text-muted); max-width: 70ch; overflow-wrap: anywhere; }
.gs-auto-rule-link:hover strong { text-decoration: underline; text-underline-offset: 4px; }
.gs-auto-row-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.gs-auto-badge { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 4px 9px; border: 1px solid var(--panel-border); border-radius: 6px; color: var(--text-main); white-space: nowrap; }
.gs-auto-badge.is-active { color: var(--brand-accent); border-color: var(--brand-accent); }
.gs-auto-badge.is-error, .gs-auto .gs-auto-danger { color: var(--danger-red); }
.gs-auto-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; max-width: 680px; padding: 40px clamp(20px, 4vw, 48px); border: 1px solid var(--panel-border); border-radius: 12px; background: var(--panel-bg); }
.gs-auto-empty > svg { width: 32px; height: 32px; color: var(--accent-gold); }
.gs-auto-empty p, .gs-auto-empty h3 { margin: 0; }
.gs-auto-empty small { color: var(--text-muted); font-size: 12px; }
.gs-auto-footnote { color: var(--text-muted); font-size: 12px; margin: 24px 0 8px; }
.gs-auto-editor { max-width: 940px; margin-inline: auto; }
.gs-auto-editor-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 4px 0 26px; }
.gs-auto-editor-top > span { color: var(--text-muted); font-size: 12px; }
.gs-auto-settings { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; margin-top: 20px; }
.gs-auto-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; margin: 0; }
.gs-auto-field > span { font-size: 12px; font-weight: 600; color: var(--text-main); }
.gs-auto-enabled { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.gs-auto-preview { margin: 20px 0 30px; color: var(--text-muted); max-width: 75ch; font-size: 13px; overflow-wrap: anywhere; }
.gs-auto-section { border: 1px solid var(--panel-border); border-radius: 12px; margin-block: 20px; padding: clamp(16px, 2.4vw, 26px); background: var(--panel-bg); }
.gs-auto-section > header { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 20px; }
.gs-auto-section > header > svg { width: 23px; height: 23px; color: var(--accent-gold); flex: 0 0 23px; margin-top: 2px; }
.gs-auto-section > header p { margin: 4px 0 0; font-size: 13px; color: var(--text-muted); }
.gs-auto-optional { font-size: 12px; color: var(--text-muted); margin-left: auto; }
.gs-auto-block { border-block: 1px solid var(--panel-border); }
.gs-auto-block.is-auto-dragging { opacity: .5; }
.gs-auto-block.gs-auto-drop-before { box-shadow: inset 0 2px var(--brand-accent); }
.gs-auto-block.gs-auto-drop-after { box-shadow: inset 0 -2px var(--brand-accent); }
.gs-auto-drag { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 10px; border: 0; border-radius: 6px; color: var(--text-muted); background: transparent; cursor: grab; touch-action: none; user-select: none; }
.gs-auto-drag svg { width: 20px; height: 20px; pointer-events: none; }
.gs-auto-drag:hover { color: var(--text-main); background: var(--input-bg); }
.gs-auto-drag:active { cursor: grabbing; }
.gs-auto-mode { max-width: 400px; margin-bottom: 20px; }
.gs-auto-block + .gs-auto-block { border-top: 0; }
.gs-auto-block > summary { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 24px 10px 0; cursor: pointer; font-weight: 600; overflow-wrap: anywhere; position: relative; list-style: none; }
.gs-auto-block > summary::-webkit-details-marker { display: none; }
.gs-auto-block > summary::after { content: ""; position: absolute; right: 4px; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.gs-auto-block[open] > summary::after { transform: rotate(225deg); }
.gs-auto-block-body { padding: 4px 0 18px; }
.gs-auto-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.gs-auto-block-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.gs-auto-block-actions .gs-auto-btn { background: transparent; font-size: 12px; }
.gs-auto-action-index { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--panel-border); border-radius: 5px; font-size: 12px; font-variant-numeric: tabular-nums; flex: 0 0 24px; }
.gs-auto-add { display: flex; align-items: flex-end; gap: 10px; margin-top: 18px; }
.gs-auto-add .gs-auto-field { flex: 1; max-width: 250px; }
.gs-auto-section > .gs-auto-btn { margin-top: 18px; }
.gs-auto-junction { display: block; color: var(--text-muted); font-size: 11px; font-weight: 700; padding-block: 10px; }
.gs-auto-condition-group { grid-column: 1 / -1; padding-left: 18px; border-left: 1px solid var(--panel-border); min-width: 0; }
.gs-auto-weekdays { grid-column: 1 / -1; border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.gs-auto-weekdays legend { font-size: 12px; font-weight: 600; margin-bottom: 7px; }
.gs-auto-weekdays label { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 8px; min-height: 44px; box-sizing: border-box; cursor: pointer; border: 1px solid var(--panel-border); border-radius: 6px; }
.gs-auto-notice { color: var(--text-muted); font-size: 13px; margin: 8px 0 14px; line-height: 1.6; }
.gs-auto-fields > .gs-auto-notice { align-self: end; }
.gs-auto-error { color: var(--danger-red); background: var(--panel-bg); border: 1px solid var(--danger-red); border-radius: 8px; padding: 12px 16px; margin: 12px 0; }
.gs-auto-error[hidden] { display: none; }
.gs-auto-advanced, .gs-auto-runs { padding: 6px 0 16px; margin-top: 20px; }
.gs-auto-advanced > summary, .gs-auto-runs > summary { cursor: pointer; min-height: 44px; align-content: center; font-weight: 600; }
.gs-auto-advanced-body { display: grid; gap: 16px; margin-top: 12px; }
.gs-auto-advanced-body > p { font-size: 13px; color: var(--text-muted); margin: 0; max-width: 75ch; }
.gs-auto-runs > .gs-auto-btn { margin: 10px 0; }
.gs-auto-run { padding: 16px 0; border-bottom: 1px solid var(--panel-border); }
.gs-auto-run > div { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.gs-auto-run strong { font-size: 13px; }
.gs-auto-run p { margin: 5px 0 0; font-size: 13px; overflow-wrap: anywhere; }
.gs-auto-savebar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; margin-top: 20px; border-top: 1px solid var(--panel-border); }
.gs-auto-savebar > span { color: var(--text-muted); font-size: 12px; }
@media (max-width: 850px) {
    .gs-auto-list-row { flex-direction: column; align-items: stretch; gap: 12px; }
    .gs-auto-row-actions { flex-wrap: wrap; }
}
@media (max-width: 640px) {
    .gs-auto { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
    .gs-auto-heading, .gs-auto-list-tools, .gs-auto-add { flex-direction: column; align-items: stretch; gap: 16px; }
    .gs-auto-fields, .gs-auto-settings { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .gs-auto-section { padding: 16px; }
    .gs-auto-section > header { gap: 9px; }
    .gs-auto-optional { display: none; }
    .gs-auto-add .gs-auto-field { max-width: none; }
    .gs-auto-condition-group { padding-left: 8px; }
    .gs-auto-block-actions { justify-content: flex-start; }
    .gs-auto-editor-top { gap: 10px; }
    .gs-auto-editor-top > span { text-align: right; }
    .gs-auto .gs-input { font-size: 16px; }
}

/* ── Datei-Upload-Ablagefeld mit Drag&Drop (Lead-Dokumente) – gleiche Optik/Verhalten wie im
   Bewerber-Modul (.bw-doc-dropzone), nur unter lc-Präfix für dieses Modul. ── */
.lc-doc-dropzone {
    position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px;
    padding:22px 16px; margin-bottom:12px; border-radius:12px; border:2px dashed var(--panel-border);
    background:rgba(255,255,255,.02); color:var(--text-muted); text-align:center; cursor:pointer;
    transition:border-color .2s, background .2s, transform .15s;
}
.lc-doc-dropzone svg { color:var(--text-muted); transition:color .2s, transform .3s cubic-bezier(.4,0,.2,1); }
.lc-doc-dropzone:hover { border-color:color-mix(in srgb, var(--accent-gold) 45%, var(--panel-border)); background:rgba(102,157,36,.04); }
.lc-doc-dropzone:hover svg { color:var(--accent-gold); transform:translateY(-2px); }
.lc-doc-dropzone .lc-doc-drop-title { font-size:12px; font-weight:600; color:var(--text-main); }
.lc-doc-dropzone .lc-doc-drop-hint { font-size:10.5px; }
.lc-doc-dropzone select { position:relative; z-index:2; }
.lc-doc-dropzone.is-dragover {
    border-color:var(--accent-gold); border-style:solid; background:rgba(102,157,36,.09);
    transform:scale(1.01); box-shadow:0 0 0 4px rgba(102,157,36,.12);
}
.lc-doc-dropzone.is-dragover svg { color:var(--accent-gold); animation:lcDocDropPulse 1s ease-in-out infinite; }
@keyframes lcDocDropPulse { 0%,100% { transform:translateY(0) scale(1); } 50% { transform:translateY(-4px) scale(1.08); } }

/* Klickbare Status-Chip-Leiste über dem Kanban-Board – scrollt beim Klick zur passenden Spalte
   und hebt sie kurz farblich hervor (lcFlashKanbanColumn), damit man "alle Leads eines Status"
   sofort findet statt eine separate Liste durchsuchen zu müssen. */
.lc-dash-chip-strip { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:16px; }
.lc-dash-chip { display:inline-flex; align-items:center; gap:7px; background:var(--bg-dark); border:1px solid var(--panel-border); border-radius:999px; padding:5px 12px 5px 10px; font-size:11.5px; color:var(--text-main); cursor:pointer; transition:border-color .15s, transform .1s; }
.lc-dash-chip:hover { border-color:color-mix(in srgb, var(--brand-accent) 45%, var(--panel-border)); transform:translateY(-1px); }
.lc-dash-chip-cnt { color:var(--text-muted); font-weight:700; }

.lc-kanban-board { display:flex; align-items:flex-start; gap:14px; overflow-x:auto; padding-bottom:10px; }
.lc-kanban-col { flex:1 1 230px; max-width:300px; background:var(--panel-bg); border:1px solid var(--panel-border); border-radius:14px; display:flex; flex-direction:column; max-height:calc(100vh - 380px); min-height:260px; box-shadow:0 2px 10px rgba(0,0,0,.10); transition:box-shadow .3s, border-color .3s; }
.lc-kanban-col.lc-flash { border-color:var(--lc-col-color, var(--brand-accent)); box-shadow:0 0 0 3px color-mix(in srgb, var(--lc-col-color, var(--brand-accent)) 35%, transparent); }
.lc-kanban-col-head { display:flex; align-items:center; gap:8px; padding:13px 14px 11px; border-bottom:1px solid var(--panel-border); border-radius:14px 14px 0 0; position:relative; overflow:hidden; }
.lc-kanban-col-head::before { content:''; position:absolute; inset:0; opacity:.10; background:var(--lc-col-color, var(--brand-accent)); }
.lc-kanban-col-dot { width:9px; height:9px; border-radius:50%; background:var(--lc-col-color, var(--brand-accent)); flex-shrink:0; position:relative; }
.lc-kanban-col-title { font-size:12.5px; font-weight:700; color:var(--text-main); position:relative; flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.lc-kanban-col-count { font-size:10.5px; color:var(--text-muted); background:var(--bg-dark); border:1px solid var(--panel-border); border-radius:20px; padding:1px 8px; position:relative; flex-shrink:0; }
.lc-kanban-col-body { flex:1; overflow-y:auto; padding:10px; display:flex; flex-direction:column; gap:9px; transition:background .15s; min-height:80px; }
.lc-kanban-col-body.drag-over { background:color-mix(in srgb, var(--lc-col-color, var(--brand-accent)) 8%, transparent); outline:2px dashed var(--lc-col-color, var(--brand-accent)); outline-offset:-4px; border-radius:8px; }
.lc-kanban-col-empty { color:var(--text-muted); font-size:11px; text-align:center; padding:18px 6px; opacity:.6; }
.lc-kanban-card { position:relative; background:var(--bg-dark); border:1px solid var(--panel-border); border-left:3px solid var(--lc-col-color, var(--brand-accent)); border-radius:10px; padding:11px 12px; cursor:grab; transition:transform .15s, box-shadow .15s, border-color .15s; }
.lc-kanban-card:hover { border-color:color-mix(in srgb, var(--lc-col-color, var(--brand-accent)) 45%, var(--panel-border)); box-shadow:0 4px 14px rgba(0,0,0,.18); transform:translateY(-2px); }
.lc-kanban-card.dragging { opacity:.4; cursor:grabbing; }
.lc-kanban-card-name { font-size:13px; font-weight:600; color:var(--text-main); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-bottom:4px; }
.lc-kanban-card-meta { display:flex; align-items:center; justify-content:space-between; gap:6px; font-size:10.5px; color:var(--text-muted); }
.lc-kanban-card-brand { display:inline-flex; align-items:center; font-size:9px; text-transform:uppercase; letter-spacing:.4px; border:1px solid var(--panel-border); border-radius:999px; padding:1px 7px; }
.lc-kanban-card-days { background:var(--panel-bg); border:1px solid var(--panel-border); border-radius:20px; padding:1px 7px; white-space:nowrap; }
.lc-kanban-card-actions { display:flex; gap:5px; margin-top:8px; padding-top:8px; border-top:1px solid var(--panel-border); }
.lc-kanban-card-actions .lc-action-btn { padding:3px 6px; }

/* Foto-Badge des zugewiesenen Fachberaters (nur für Bereichsleiter bei Leads ihres Teams, siehe
   lcRenderKanbanCard()) - Ecken-Sticker oben links, analog zur Lead-Wert-Ampel oben rechts
   (.lc-kanban-card-value-badge-wrap), damit auf einen Blick erkennbar ist, wessen Lead man gerade
   vor sich hat, wenn das Board eigene und unterstellte Leads gemischt in denselben Spalten zeigt. */
.lc-kanban-card-vt-badge-wrap { position:absolute; top:-7px; left:-7px; }
.lc-kanban-card-vt-badge { width:22px; height:22px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:9px; font-weight:700; color:#fff; overflow:hidden; box-shadow:0 1px 4px rgba(0,0,0,.3); border:2px solid var(--bg-dark); cursor:help; }
.lc-kanban-card-vt-badge img { width:100%; height:100%; object-fit:cover; }

/* Kalkulations-Hinweis auf Kanban-Karten: Badge (Piktogramm + Status) + dezente Hervorhebung der
   gesamten Karte, solange die Kalkulation noch nicht fertig ist (siehe lcRenderKanbanCard()). Die
   Badge-Farben entsprechen bewusst 1:1 .kalk-badge-* (admin_kalkulation.php), damit Lead-Tabelle
   und Kanban-Board optisch identisch kommunizieren. */
.lc-kanban-card-calc-row { margin-bottom:6px; }
.lc-kanban-card-calc-badge { cursor:default; }
.lc-kanban-card-in-calc { box-shadow:inset 0 0 0 1.5px rgba(59,130,246,.35); background:color-mix(in srgb, #3b82f6 5%, var(--bg-dark)); }

/* Schnell-Filter oberhalb des Kanban-Boards: "In Kalkulation" / "Kalkulation fertig" sind
   unabhängig voneinander kombinierbar (ODER-Verknüpfung), siehe lcKanbanToggleCalcFilter(). */
.lc-kanban-calc-filter-bar { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-bottom:14px; }
.lc-kanban-calc-filter-btn { font-size:11.5px; padding:6px 12px; }
.lc-btn.lc-kanban-calc-filter-btn-open.active { background:#3b82f6; border-color:#3b82f6; color:#fff; }
.lc-btn.lc-kanban-calc-filter-btn-done.active { background:var(--success-green); border-color:var(--success-green); color:#1a1a1a; }
.lc-kanban-filter-sep { width:1px; align-self:stretch; background:var(--panel-border); margin:2px 2px; }
.lc-kanban-value-filter-btn { font-size:11.5px; padding:6px 12px; }
.lc-btn.lc-kanban-value-filter-btn-normal.active      { background:var(--danger-red); border-color:var(--danger-red); color:#fff; }
.lc-btn.lc-kanban-value-filter-btn-interessant.active { background:#eab308; border-color:#eab308; color:#1a1a1a; }
.lc-btn.lc-kanban-value-filter-btn-top.active         { background:var(--success-green); border-color:var(--success-green); color:#1a1a1a; }

/* Beziehungs-Tag eines Lead-Ansprechpartners (z. B. "Vater", "Ehepartner/in") */
.lc-badge-relation { display:inline-flex; align-items:center; font-size:10px; font-weight:600; border-radius:10px; padding:2px 8px; border:1px solid rgba(201,163,90,.4); background:rgba(201,163,90,.12); color:var(--accent-gold); white-space:nowrap; }

/* Lead-Dokumente/Unterlagen (Upload im Lead-Bearbeiten-Modal) */
.lc-doc-list { display:flex; flex-direction:column; gap:7px; margin-bottom:10px; }
.lc-doc-card { display:flex; align-items:center; gap:9px; background:var(--bg-dark); border:1px solid var(--panel-border); border-radius:9px; padding:8px 10px; }
.lc-doc-card-icon { flex-shrink:0; color:var(--text-muted); display:flex; }
.lc-doc-card-body { flex:1; min-width:0; }
.lc-doc-card-name { font-size:12px; font-weight:600; color:var(--text-main); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.lc-doc-card-meta { font-size:10.5px; color:var(--text-muted); margin-top:1px; }
.lc-doc-upload-row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.lc-doc-upload-row .lc-select { max-width:200px; }
/* Drag&Drop-Hervorhebung direkt auf einer kompakten .lc-doc-card-Zeile (Datei per Drop ersetzen,
   ohne für jede Zeile eine eigene große Dropzone-Box zu brauchen – z. B. Prospekt-Dateien-Liste). */
.lc-doc-card.is-dragover { border-color:var(--accent-gold); background:rgba(102,157,36,.08); box-shadow:0 0 0 3px rgba(102,157,36,.12); }

/* Kalkulations-Übergabe (Nutzerwunsch: je Kalkulationsrunde eine eigene Angebotscheckliste +
   Pläne, siehe lc-calc-handover-modal sowie die Dokumente-Verwaltung innerhalb lm-calc-body). */
.lc-hidden-file-input { display:none; }
.lc-form-section .lc-field + .lc-field { margin-top:12px; }
.lc-calc-handover-hint { font-size:12px; color:var(--text-muted); margin:0 0 14px; }
.lc-calc-handover-filepick { display:block; border:1px dashed var(--panel-border); border-radius:8px; padding:10px 12px; font-size:12.5px; color:var(--text-muted); cursor:pointer; transition:.15s; }
.lc-calc-handover-filepick:hover { border-color:var(--accent-gold); color:var(--accent-gold); }
.lc-calc-handover-filepick.has-file { border-style:solid; border-color:var(--brand-accent); color:var(--text-main); }
.lc-calc-handover-filepick.is-dragover { border-color:var(--accent-gold); border-style:solid; background:rgba(102,157,36,.09); color:var(--accent-gold); box-shadow:0 0 0 3px rgba(102,157,36,.12); }
.lc-calc-handover-filelist { display:flex; flex-direction:column; gap:6px; margin-top:8px; }
.lc-calc-handover-file-row { display:flex; align-items:center; gap:8px; font-size:12px; background:var(--bg-dark); border:1px solid var(--panel-border); border-radius:7px; padding:6px 9px; }
.lc-calc-handover-file-row .name { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.lc-calc-handover-file-remove { background:none; border:none; color:var(--text-muted); cursor:pointer; padding:2px; font-size:13px; line-height:1; }
.lc-calc-handover-file-remove:hover { color:var(--danger-red); }

/* Parallele Kalkulationsrunden (Nutzerwunsch: der Interessent kann z.B. zwischen Bungalow und
   normalem Haus unentschlossen sein - dann bekommt der Lead bewusst MEHRERE gleichzeitig offene/
   in Bearbeitung befindliche Runden, siehe lcFindActiveCalcs()/lcSubmitToCalc() sowie
   submit_lead_to_calc: allow_parallel in api_lead.php). Jede aktive Runde bekommt einen eigenen,
   optisch abgesetzten Block innerhalb der Kalkulation-Tab-Sektion (lm-calc-body). */
.lc-calc-round-block { margin-bottom:14px; padding-bottom:10px; border-bottom:1px solid var(--panel-border); }
.lc-calc-round-block:last-of-type { border-bottom:none; }
.lc-calc-round-status { margin-bottom:8px; }
.lc-calc-round-btn { font-size:11px; margin-top:10px; }
.lc-calc-parallel-hint { font-size:11.5px; color:var(--text-muted); margin:4px 0 8px; }

/* Verknuepfte Kalkulationsrunden, gemeinsam in Vertrieb und Kalkulation. */
.calc-history { margin:16px 0; border-block:1px solid var(--panel-border); font-size:13px; }
.calc-history > summary { min-height:44px; padding:12px 0; box-sizing:border-box; cursor:pointer; font-weight:600; color:var(--text-main); }
.calc-history-list { list-style:none; margin:0; padding:0 0 0 16px; }
.calc-history > .calc-history-list { padding:0 0 12px; }
.calc-history-list .calc-history-list { border-inline-start:1px solid var(--panel-border); margin-inline-start:8px; }
.calc-history-list .calc-history-list .calc-history-list .calc-history-list { padding-inline-start:0; margin-inline-start:0; border:0; }
.calc-history-row { padding:8px; overflow-wrap:anywhere; }
.calc-history-row.is-current { background:var(--bg-dark); border-radius:6px; }
.calc-history-heading { display:flex; flex-wrap:wrap; align-items:center; gap:4px 12px; }
.calc-history-link { min-height:44px; padding:6px 0; border:0; background:none; color:var(--brand-accent); font:inherit; font-weight:600; text-align:left; text-decoration:underline; text-underline-offset:3px; cursor:pointer; }
.calc-history-link:hover { color:var(--text-main); }
.calc-history-status, .calc-history-meta { color:var(--text-muted); font-size:12px; line-height:1.6; }
.calc-history-price { font-variant-numeric:tabular-nums; line-height:1.6; }
.calc-history summary:focus-visible, .calc-history-link:focus-visible, .lc-calc-result:focus, .lc-calc-round-block:focus { outline:2px solid var(--brand-accent); outline-offset:3px; }
.lc-calc-round-title { font-weight:600; margin-bottom:4px; }
.lc-calc-parent-link { display:block; font-size:12px; }
.lc-calc-group-title { margin:20px 0 8px; font-size:13px; font-weight:600; color:var(--text-muted); }
.lc-calc-group-title.is-rejected { color:var(--danger-red); }
.lc-calc-result { margin-top:10px; }
.lc-calc-result-completed { padding:12px; border:1px solid var(--panel-border); border-radius:8px; overflow-wrap:anywhere; }
.lc-calc-result-meta { color:var(--text-muted); font-size:12px; line-height:1.6; margin-top:4px; }
.lc-calc-result-notes { margin-top:8px; color:var(--text-muted); }
.lc-calc-followup-btn { margin:12px 0 0; min-height:44px; }
.lc-modal.lc-calc-handover-open { display:flex; }
#lc-calc-handover-modal .lc-mfoot button, #lc-calc-handover-modal .lc-calc-handover-file-remove { min-height:44px; }
#lc-calc-handover-modal .lc-close-btn { min-height:44px; min-width:44px; }
#lc-calc-handover-modal .lc-calc-handover-filepick:focus-visible { outline:2px solid var(--brand-accent); outline-offset:3px; }
.kalk-category-empty { color:var(--text-muted); }
.kalk-documents-locked { font-size:13px; line-height:1.6; color:var(--text-muted); }
.kalk-form-grid.kalk-price-entry { display:flex; align-items:flex-end; gap:10px; max-width:400px; }
.kalk-price-entry .kalk-price-field { flex:1; min-width:0; }
.kalk-price-entry .kalk-price-field input { width:100%; min-width:0; height:46px; }
.kalk-price-basis { display:flex; flex:0 0 auto; gap:0; padding:0; margin:0; border:1px solid var(--panel-border); border-radius:9px; background:var(--input-bg); min-width:0; }
.kalk-price-basis legend { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.kalk-form-grid .kalk-price-basis label { position:relative; display:flex; flex-direction:row; align-items:stretch; gap:0; min-height:44px; cursor:pointer; }
.kalk-price-basis label span { display:flex; align-items:center; justify-content:center; margin:3px; padding:0 10px; border-radius:6px; color:var(--text-muted); font-size:13px; font-weight:600; transition:background .16s ease, color .16s ease; }
.kalk-form-grid .kalk-price-basis input { position:absolute; inset:0; z-index:1; width:100%; height:100%; min-height:44px; margin:0; padding:0; opacity:0; cursor:pointer; }
.kalk-price-basis input:checked + span { background:var(--brand-accent); color:var(--btn-text); }
.kalk-price-basis input:not(:checked):hover + span { color:var(--text-main); background:var(--bg-dark); }
.kalk-price-basis input:focus-visible + span { outline:2px solid var(--brand-accent); outline-offset:3px; }
@media (prefers-reduced-motion:reduce) { .kalk-price-basis label span { transition:none; } }

/* Dokumente DIESER EINEN Kalkulationsrunde innerhalb der Lead-Kalkulation-Sektion (lm-calc-body) -
   bewusst dieselben .lc-doc-list/.lc-doc-card-Klassen wie die allgemeinen Lead-Dokumente, nur in
   eigenen, nach Angebotscheckliste/Pläne getrennten Gruppen je Runde. */
.lc-calc-doc-group { margin-top:10px; }
.lc-calc-doc-group-title { font-size:10.5px; text-transform:uppercase; letter-spacing:.4px; color:var(--text-muted); margin-bottom:5px; }
.lc-calc-doc-empty { font-size:11.5px; color:var(--text-muted); }
.lc-calc-doc-upload-link { display:inline-block; margin-top:6px; font-size:11.5px; color:var(--brand-accent); text-decoration:underline; cursor:pointer; }

/* Vorlagen je Lead-Status: kompakte Status-Liste (links) + Detail-Editor (rechts), damit nicht
   für jeden Status ein voller E-Mail/DOCX-Editor untereinander gerendert wird ("Schlauch"-Effekt). */
.lc-stagetpl-wrap { display:grid; grid-template-columns:230px 1fr; gap:16px; align-items:start; }
@media(max-width:860px) { .lc-stagetpl-wrap { grid-template-columns:1fr; } }
.lc-stagetpl-list { display:flex; flex-direction:column; gap:3px; max-height:560px; overflow-y:auto; padding-right:2px; }
.lc-stagetpl-row { display:flex; align-items:center; gap:9px; width:100%; text-align:left; background:none; border:1px solid transparent; border-radius:9px; padding:8px 9px; cursor:pointer; font-family:inherit; transition:background .12s, border-color .12s; }
.lc-stagetpl-row:hover { background:rgba(255,255,255,.035); }
.lc-stagetpl-row.is-active { background:rgba(197,164,126,.1); border-color:rgba(197,164,126,.35); }
.lc-stagetpl-row-dot { width:9px; height:9px; border-radius:50%; flex-shrink:0; }
.lc-stagetpl-row-name { flex:1; min-width:0; font-size:12.5px; font-weight:600; color:var(--text-main); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.lc-stagetpl-row-badges { display:flex; flex-direction:column; gap:3px; flex-shrink:0; }
.lc-stagetpl-brand-badges { display:flex; align-items:center; gap:3px; padding-left:5px; border-left:2px solid var(--panel-border); }
.lc-stagetpl-brand-badges::before { content:attr(data-label); font-size:7.5px; font-weight:800; letter-spacing:.02em; color:var(--text-muted); min-width:17px; }
.lc-stagetpl-brand-badges[data-brand="fischerhaus"] { border-left-color:#003056; }
.lc-stagetpl-brand-badges[data-brand="naturholzhaus"] { border-left-color:#1b4d2e; }
.lc-stagetpl-brand-badges[data-brand="objektbau"],
.lc-stagetpl-brand-badges[data-brand="wohnungsbau"] { border-left-color:#333333; }
.lc-stagetpl-badge-ico { width:14px; height:14px; border-radius:50%; display:flex; align-items:center; justify-content:center; color:transparent; background:transparent; border:1px solid var(--panel-border); opacity:.45; flex-shrink:0; }
.lc-stagetpl-badge-ico[data-state="fallback"] { opacity:.85; border-style:dashed; }
.lc-stagetpl-badge-ico[data-state="own"] { color:#fff; opacity:1; }
.lc-stagetpl-brand-badges[data-brand="fischerhaus"] .lc-stagetpl-badge-ico[data-state="fallback"] { border-color:#003056; color:#003056; }
.lc-stagetpl-brand-badges[data-brand="fischerhaus"] .lc-stagetpl-badge-ico[data-state="own"] { background:#003056; border-color:#003056; box-shadow:0 0 0 2px rgba(0,48,86,.22); }
.lc-stagetpl-brand-badges[data-brand="naturholzhaus"] .lc-stagetpl-badge-ico[data-state="fallback"] { border-color:#1b4d2e; color:#1b4d2e; }
.lc-stagetpl-brand-badges[data-brand="naturholzhaus"] .lc-stagetpl-badge-ico[data-state="own"] { background:#1b4d2e; border-color:#1b4d2e; box-shadow:0 0 0 2px rgba(27,77,46,.22); }
.lc-stagetpl-brand-badges[data-brand="objektbau"] .lc-stagetpl-badge-ico[data-state="fallback"],
.lc-stagetpl-brand-badges[data-brand="wohnungsbau"] .lc-stagetpl-badge-ico[data-state="fallback"] { border-color:#333333; color:#333333; }
.lc-stagetpl-brand-badges[data-brand="objektbau"] .lc-stagetpl-badge-ico[data-state="own"],
.lc-stagetpl-brand-badges[data-brand="wohnungsbau"] .lc-stagetpl-badge-ico[data-state="own"] { background:#333333; border-color:#333333; box-shadow:0 0 0 2px rgba(51,51,51,.22); }
.lc-stagetpl-detail { border:1px solid var(--panel-border); border-radius:10px; padding:16px; background:rgba(255,255,255,.015); min-height:160px; }
.lc-stagetpl-detail-head { display:flex; align-items:center; gap:8px; margin-bottom:14px; }
.lc-stagetpl-detail-dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; }
.lc-stagetpl-brand-title { font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted); margin-bottom:10px; padding-left:10px; border-left:3px solid var(--panel-border); }
.lc-stagetpl-brand-block[data-brand="fischerhaus"] .lc-stagetpl-brand-title { border-left-color:#003056; }
.lc-stagetpl-brand-block[data-brand="naturholzhaus"] .lc-stagetpl-brand-title { border-left-color:#1b4d2e; }
.lc-stagetpl-brand-block[data-brand="objektbau"] .lc-stagetpl-brand-title,
.lc-stagetpl-brand-block[data-brand="wohnungsbau"] .lc-stagetpl-brand-title { border-left-color:#333333; }
.lc-stagetpl-section { border:1px solid var(--panel-border); border-radius:10px; padding:14px 14px 16px; background:rgba(255,255,255,.012); }
.lc-stagetpl-section + .lc-stagetpl-section { margin-top:16px; }
.lc-stagetpl-brand-switch { margin-bottom: 14px; width: 100%; }
.lc-stagetpl-brandbtn-logo { height:22px; width:auto; max-width:90px; object-fit:contain; display:block; }
.lc-stagetpl-brandbtn-logo-dark { display:block; }
.lc-stagetpl-brandbtn-logo-light { display:none; }
html[data-theme="light"] .lc-stagetpl-brandbtn-logo-dark { display:none; }
html[data-theme="light"] .lc-stagetpl-brandbtn-logo-light { display:block; }

/* -- Gemeinsame einzeilige Inhalts-Tabs für Module und Dialoge -- */
.hbb-tabs {
    position: relative;
    display: flex;
    box-sizing: border-box;
    align-items: center;
    flex-wrap: nowrap;
    min-width: 0;
    max-width: 100%;
    gap: 4px;
    padding: 4px;
    overflow: auto hidden;
    background: var(--bg-dark);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
}
.hbb-tabs[data-hbb-tabs-ready]:not([data-hbb-tabs-reorder]) { overflow: visible; }
@supports selector(:popover-open) {
    .hbb-tabs[data-hbb-tabs-ready]:not([data-hbb-tabs-reorder]) { overflow: clip; }
}
.hbb-tabs-indicator {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 0;
    z-index: 0;
    width: 0;
    box-sizing: border-box;
    border: 1px solid var(--panel-border);
    border-radius: 7px;
    background: var(--panel-bg);
    opacity: 0;
    pointer-events: none;
}
.hbb-tabs[data-hbb-tabs-highlight] > .hbb-tabs-indicator { opacity: 1; }
.hbb-tabs > .hbb-tab {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 0 0 auto;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    text-transform: none;
    letter-spacing: normal;
    margin: 0;
    white-space: nowrap;
    cursor: pointer;
    transition: color .15s;
}
.hbb-tabs > .hbb-tab[data-hbb-tab-overflow] { display: none !important; }
.hbb-tabs[data-hbb-tabs-overflow] > .hbb-tab {
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    justify-content: safe center;
}
.hbb-tabs > .hbb-tab svg { flex: 0 0 auto; }
.hbb-tabs > .hbb-tab:hover { color: var(--text-main); }
.hbb-tabs > .hbb-tab:is(.active, .is-active, [aria-selected="true"]) { color: var(--accent-gold); }
.hbb-tabs:not([data-hbb-tabs-highlight]) > .hbb-tab:is(.active, .is-active, [aria-selected="true"]) {
    background: var(--panel-bg);
    border-color: var(--panel-border);
}
.hbb-tabs > .hbb-tab:is(:disabled, [aria-disabled="true"]) { opacity: .45; cursor: not-allowed; }
.hbb-tabs > .hbb-tab:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 1px; }
.hbb-tabs-more {
    display: flex;
    flex: 0 0 auto;
    order: 999;
    margin-inline-start: auto;
    min-height: 44px;
    min-width: 44px;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: var(--panel-bg);
    color: var(--text-muted);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: color .15s, border-color .15s, background-color .15s;
}
.hbb-tabs-more[data-hbb-tabs-measuring] { position: absolute; }
.hbb-tabs-more[hidden], .hbb-tabs-menu[hidden] { display: none; }
.hbb-tabs-more:hover, .hbb-tabs-more[aria-expanded="true"] { color: var(--text-main); border-color: var(--accent-gold); }
.hbb-tabs-more:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 1px; }
.hbb-tabs-more svg { flex: 0 0 auto; }
.hbb-tabs-count {
    min-width: 2ch;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--bg-dark);
    color: var(--text-main);
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    font-variant-numeric: tabular-nums;
    text-align: center;
}
.hbb-tabs-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 3000;
    box-sizing: border-box;
    width: min(220px, calc(100vw - 16px));
    max-height: min(60vh, 360px);
    padding: 6px;
    overflow-y: auto;
    border-radius: 10px;
    font-size: 12.5px;
}
.hbb-tabs-menu:not([hidden]) { display: grid; gap: 2px; }
.hbb-tabs-menu[popover] { position: fixed; inset: 0 auto auto 0; margin: 0; }
.hbb-tabs-menu[popover]:not(:popover-open) { display: none; }
.hbb-tabs-option {
    width: 100%;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--text-main);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.hbb-tabs-option:hover { background: var(--panel-bg); }
.hbb-tabs-option:disabled { opacity: .45; cursor: not-allowed; }
.hbb-tabs-option:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: -2px; }
@media (max-width: 480px) {
    .hbb-tabs-more { gap: 4px; padding: 8px; }
    .hbb-tabs-more-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .hbb-tabs > .hbb-tab, .hbb-tabs-more { transition: none; }
    .lc-tabs.lc-tabs-sorting .lc-tab-btn[data-tab-key] { animation: none; }
}

.as-tabs-wrap { margin-bottom: 22px; }
.as-tab-panel { display: none; }
.as-tab-panel.active { display: block; }

/* -- Systemeinstellungen: Tab "Offline-Modus" (html/modules/admin_settings.php), Präfix as-off- --
   admin_settings.php ist laut css-konventionen.md noch nicht vollständig migriert (eigener
   <style>-Block bleibt für as-page etc. bestehen), aber diese NEUE, in sich geschlossene
   Sektion kommt seit der 2026-08-12-Konvention direkt hierher statt in den Modul-Block. -- */
.as-off-intro { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; margin: 0 0 18px; max-width: 74ch; }
.as-off-groups { display: flex; flex-direction: column; gap: 16px; }
.as-off-group { background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 12px; padding: 16px 18px; }
.as-off-group-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.as-off-group-head svg { flex-shrink: 0; }
.as-off-group-head h3 { margin: 0; font-size: 13.5px; color: var(--text-main); }
.as-off-group.is-ok .as-off-group-head svg { color: #22c55e; }
.as-off-group.is-limited .as-off-group-head svg { color: #ca9a08; }
.as-off-group.is-blocked .as-off-group-head svg { color: var(--text-muted); }
.as-off-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.as-off-item { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; color: var(--text-main); line-height: 1.55; }
.as-off-item svg { flex-shrink: 0; margin-top: 2px; }
.as-off-item b { font-weight: 600; }
.as-off-item span { color: var(--text-muted); }
.as-off-group.is-ok .as-off-item svg { color: #22c55e; }
.as-off-group.is-limited .as-off-item svg { color: #ca9a08; }
.as-off-group.is-blocked .as-off-item svg { color: var(--text-muted); }
.as-off-note { display: flex; align-items: flex-start; gap: 10px; background: rgba(180,83,9,.08); border: 1px solid rgba(180,83,9,.3); border-radius: 10px; padding: 12px 14px; font-size: 12px; color: var(--text-main); line-height: 1.6; margin-top: 16px; }
.as-off-note svg { flex-shrink: 0; margin-top: 1px; color: #b45309; }

/* -- Systemeinstellungen: Berechtigungen (html/modules/admin_settings.php), Präfix as-perm-/as-pgm- -- */
.as-perm-intro { margin-bottom: 18px; }
.as-perm-heading { margin: 0 0 6px; color: var(--text-main); font-size: 17px; font-weight: 650; }
.as-perm-intro > p { max-width: 76ch; margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.55; }
.as-perm-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.as-perm-search-field,
.as-pgm-search-field { display: grid; gap: 6px; min-width: 0; color: var(--text-muted); font-size: 12px; font-weight: 600; }
.as-perm-search-field { flex: 1; max-width: 440px; }
.as-perm-toolbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.as-perm-count { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.as-perm-type-list { overflow: hidden; margin: 0 0 14px; border: 1px solid var(--panel-border); border-radius: 10px; background: var(--panel-bg); }
.as-perm-type-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 16px; }
.as-perm-type-row + .as-perm-type-row { border-top: 1px solid var(--panel-border); }
.as-perm-type-row[hidden] { display: none !important; }
.as-perm-type-details { min-width: 0; }
.as-perm-type-name { margin: 0; color: var(--text-main); font-size: 14px; font-weight: 650; line-height: 1.4; }
.as-perm-type-description { max-width: 72ch; margin: 3px 0 0; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.as-perm-type-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 7px; color: var(--text-muted); font-size: 12px; }
.as-perm-type-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.as-perm-type-actions .as-action-btn { min-height: 44px; padding: 8px 11px; font-size: 12px; }
.as-perm-type-actions .as-perm-primary-action { color: var(--accent-gold); border-color: rgba(102,157,36,.4); }
.as-perm-type-actions .as-action-btn:disabled { opacity: .55; cursor: not-allowed; }
.as-perm-state { margin: 0; padding: 16px; color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.as-perm-state.is-error { color: var(--danger-red); }
.as-perm-filter-empty { padding: 4px 0 14px; }
.as-perm-filter-empty[hidden] { display: none; }
.as-modal-close { min-height: 44px; padding: 7px 10px; border: 1px solid var(--panel-border); border-radius: 7px; background: transparent; color: var(--text-muted); font: inherit; font-size: 12px; cursor: pointer; }
.as-modal-close:hover { color: var(--text-main); border-color: var(--text-muted); }
.as-form-error { margin: 6px 0 0; color: var(--danger-red); font-size: 12px; line-height: 1.45; }
.as-form-error[hidden] { display: none; }
.as-form-input[aria-invalid="true"] { border-color: var(--danger-red); }
.as-perm-toolbar-actions .as-new-btn { min-height: 44px; }
.as-perm-type-dialog { width: min(96vw, 560px); }
.as-perm-type-dialog .as-modal-foot .btn,
.as-pgm-dialog .as-modal-foot .btn { min-height: 44px; }
.as-pgm-dialog.as-modal-box { width: min(96vw, 820px); max-height: min(92vh, 900px); }
.as-pgm-modal .as-modal-body { padding: 14px 18px; }
.as-pgm-intro { margin: 0 0 14px; color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.as-pgm-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px 14px; margin-bottom: 12px; }
.as-pgm-search-field { grid-column: 1; }
.as-pgm-view { display: flex; align-items: center; gap: 4px; padding: 3px; border: 1px solid var(--panel-border); border-radius: 8px; background: var(--bg-dark); }
.as-pgm-view-btn { min-height: 44px; padding: 6px 10px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text-muted); font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.as-pgm-view-btn:hover { color: var(--text-main); }
.as-pgm-view-btn.is-active { border-color: var(--panel-border); background: var(--panel-bg); color: var(--accent-gold); }
.as-pgm-status { grid-column: 1 / -1; color: var(--text-muted); font-size: 12px; }
.as-pgm-colhead { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) 52px 68px; gap: 8px; padding: 8px 8px; border-bottom: 1px solid var(--panel-border); background: var(--panel-bg); color: var(--text-muted); font-size: 11px; font-weight: 700; }
.as-pgm-colhead span:not(:first-child) { text-align: center; }
.as-pgm-list { border-top: 1px solid var(--panel-border); }
.as-department-manager {
    margin: 18px 0 24px; padding: 18px; border: 1px solid var(--panel-border);
    border-radius: 10px; background: var(--panel-bg);
}
.as-dept-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.as-dept-header p { max-width: 76ch; margin: 5px 0 0; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.as-dept-status { color: var(--text-muted); font-size: 12px; line-height: 1.45; }
.as-dept-status.is-error { color: var(--danger-red); }
.as-dept-layout { display: grid; grid-template-columns: minmax(220px, .75fr) minmax(0, 1.4fr); gap: 20px; }
.as-dept-controls { display: grid; align-content: start; gap: 8px; }
.as-dept-label { color: var(--text-main); font-size: 12px; font-weight: 600; }
.as-dept-controls .as-form-input,
.as-dept-module-panel .as-form-input { min-height: 44px; }
.as-dept-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 4px; }
.as-dept-actions button { min-height: 44px; }
.as-dept-actions #as-dept-active-toggle { grid-column: 1 / -1; }
.as-dept-actions button:disabled,
.as-dept-module-save:disabled { opacity: .55; cursor: not-allowed; }
.as-dept-user-status { min-height: 18px; margin: 2px 0 0; color: var(--text-muted); font-size: 12px; }
.as-dept-module-panel { min-width: 0; padding-left: 20px; border-left: 1px solid var(--panel-border); }
.as-dept-module-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.as-dept-subheading { margin: 0; color: var(--text-main); font-size: 14px; font-weight: 650; }
.as-dept-module-heading p { margin: 4px 0 0; color: var(--text-muted); font-size: 12px; line-height: 1.45; }
.as-dept-module-count { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.as-dept-module-list {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 8px; max-height: 270px;
    margin: 8px 0 4px; overflow-y: auto;
}
.as-dept-module-option {
    display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 7px 9px;
    border-radius: 7px; color: var(--text-main); font-size: 12px; cursor: pointer;
}
.as-dept-module-option:hover { background: color-mix(in srgb, var(--brand-accent) 8%, transparent); }
.as-dept-module-option[hidden] { display: none; }
.as-dept-module-option input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand-accent); }
.as-dept-module-option input:disabled { cursor: not-allowed; }
.as-dept-module-empty { margin: 6px 0 12px; color: var(--text-muted); font-size: 12px; }
.as-dept-module-empty[hidden] { display: none; }
.as-dept-module-save { min-height: 44px; margin-top: 8px; }
.as-pgm-module { border-bottom: 1px solid var(--panel-border); }
.as-pgm-module:last-child { border-bottom: 0; }
.as-pgm-module[hidden] { display: none !important; }
.as-pgm-module-head { display: flex; align-items: center; gap: 10px; padding: 4px; }
.as-pgm-module-toggle { display: flex; flex: 1; min-width: 0; align-items: center; gap: 10px; min-height: 44px; padding: 6px 8px; border: 0; border-radius: 7px; background: transparent; color: var(--text-main); text-align: left; cursor: pointer; }
.as-pgm-module-toggle:hover { background: rgba(102,157,36,.06); }
.as-pgm-module-toggle:focus-visible,
.as-pgm-bulk-btn:focus-visible,
.as-pgm-view-btn:focus-visible,
.as-modal-close:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 2px; }
.as-pgm-chevron { width: 7px; height: 7px; flex: 0 0 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; color: var(--text-muted); transform: rotate(-45deg); transition: transform .18s ease; }
.as-pgm-module.is-open .as-pgm-chevron { transform: rotate(45deg); }
.as-pgm-module-title { min-width: 0; flex: 1; font-size: 13px; font-weight: 650; }
.as-pgm-module-count { color: var(--text-muted); font-size: 12px; font-weight: 500; white-space: nowrap; }
.as-pgm-module-count.has-grants { color: var(--accent-gold); }
.as-pgm-bulk-actions { display: flex; flex-shrink: 0; gap: 6px; }
.as-pgm-bulk-btn { min-height: 44px; padding: 6px 9px; border: 1px solid var(--panel-border); border-radius: 6px; background: transparent; color: var(--text-muted); font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.as-pgm-bulk-btn:hover { border-color: rgba(102,157,36,.4); color: var(--accent-gold); }
.as-pgm-module-body { padding: 2px 6px 10px; }
.as-pgm-module-body[hidden] { display: none; }
.as-pgm-cap-row { display: grid; grid-template-columns: minmax(0, 1fr) 52px 68px; align-items: center; gap: 8px; padding: 10px 8px; }
.as-pgm-cap-row + .as-pgm-cap-row { border-top: 1px solid var(--panel-border); }
.as-pgm-cap-row[hidden] { display: none !important; }
.as-pgm-cap-copy { min-width: 0; }
.as-pgm-cap-label { color: var(--text-main); font-size: 13px; font-weight: 600; line-height: 1.4; }
.as-pgm-cap-desc { max-width: 75ch; margin: 3px 0 0; color: var(--text-muted); font-size: 12px; line-height: 1.45; }
.as-pgm-toggle.as-module-toggle { display: block; width: 44px; height: 44px; margin: 0 auto; cursor: pointer; }
.as-pgm-toggle .as-module-slider { inset: 11px 3px; }
.as-pgm-toggle input:focus-visible + .as-module-slider { outline: 2px solid var(--accent-gold); outline-offset: 3px; }
.as-pgm-na { color: var(--text-muted); font-size: 12px; line-height: 1.35; text-align: center; }
.as-pgm-empty { margin: 0; padding: 18px 8px; color: var(--text-muted); font-size: 13px; text-align: center; }
.as-pgm-empty[hidden] { display: none; }

/* -- Systemeinstellungen: Tab "Corporate Design" (html/modules/admin_settings.php), Präfix as-cd- --
   Firmendaten (Anschrift/E-Mail/Telefon) + Briefvorlagen/Präsentationsvorlage je Gesellschaft/
   Marke (siehe html/corporate_design.php) - zentrale Quelle für andere Module (Cockpit,
   Kundendienst), die diese Vorlagen wiederverwenden. -- */
.as-cd-intro { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; margin: 0 0 18px; max-width: 80ch; }
.as-cd-margin-top { margin-top: 16px; }
.as-cd-section-desc { font-size: 12px; color: var(--text-muted); margin: 0 0 14px; line-height: 1.5; }
.as-cd-contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.as-cd-contact-field-wide { grid-column: span 2; }
.as-cd-entities { display: flex; flex-direction: column; gap: 14px; }
.as-cd-loading { color: var(--text-muted); font-size: 13px; padding: 16px 0; }
.as-cd-entity-card { background: var(--bg-dark); border: 1px solid var(--panel-border); border-radius: 10px; padding: 14px 16px; }
.as-cd-entity-title { font-size: 13.5px; font-weight: 700; color: var(--text-main); margin-bottom: 10px; }
.as-cd-asset-group { margin-bottom: 12px; }
.as-cd-asset-group:last-child { margin-bottom: 0; }
.as-cd-asset-group-label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 8px; }
.as-cd-asset-slots { display: flex; gap: 10px; flex-wrap: wrap; }
.as-cd-slot { display: flex; flex-direction: column; gap: 4px; background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 8px; padding: 10px 12px; min-width: 200px; flex: 1 1 200px; }
.as-cd-slot-format { font-size: 10px; font-weight: 700; color: var(--accent-gold); letter-spacing: .4px; }
.as-cd-slot-file { font-size: 12.5px; color: var(--text-main); text-decoration: none; word-break: break-all; }
.as-cd-slot-file:hover { color: var(--accent-gold); text-decoration: underline; }
.as-cd-slot-meta { font-size: 11px; color: var(--text-muted); }
.as-cd-slot-empty { font-size: 12px; color: var(--text-muted); font-style: italic; }
.as-cd-slot-actions { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.as-cd-slot-upload-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 600; color: var(--accent-gold); background: rgba(102,157,36,0.1); border: 1px solid rgba(102,157,36,0.3); border-radius: 6px; padding: 5px 10px; cursor: pointer; transition: .12s; }
.as-cd-slot-upload-btn:hover { background: rgba(102,157,36,0.18); }
.as-cd-slot-file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.as-cd-slot-delete-btn { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; background: none; border: 1px solid var(--panel-border); border-radius: 6px; color: var(--text-muted); cursor: pointer; font-size: 12px; transition: .12s; }
.as-cd-slot-delete-btn:hover { color: var(--danger-red); border-color: var(--danger-red); }
.as-cd-slot-status { font-size: 11px; }

/* -- API-Keys-Tab: "Anzeigen"-Augen-Button neben Secret-Feldern (html/modules/admin_settings.php),
   Präfix as-key- -- */
.as-key-input-wrap { position: relative; flex: 1; min-width: 220px; }
.as-key-input-wrap .as-form-input { width: 100%; padding-right: 38px; }
.as-key-reveal-btn { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; background: none; border: none; border-radius: 6px; color: var(--text-muted); cursor: pointer; transition: 0.12s; }
.as-key-reveal-btn:hover { color: var(--accent-gold); background: rgba(102,157,36,0.1); }
.as-key-reveal-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* -- Uploads-Tab: zentrale Größenlimits für Datei-Uploads/E-Mail-Anhänge (html/modules/
   admin_settings.php, siehe html/upload_limits.php), Präfix as-upload-limit- -- */
.as-upload-page { display: flex; flex-direction: column; gap: 16px; }
.as-upload-intro { max-width: 76ch; }
.as-upload-page-title { margin: 0 0 5px; color: var(--text-main); font-size: 19px; font-weight: 600; }
.as-upload-intro p,
.as-upload-section-desc { margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.55; }
.as-upload-server-note { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 12px 14px; background: var(--bg-dark); border: 1px solid var(--panel-border); border-radius: 8px; color: var(--text-muted); font-size: 12px; line-height: 1.55; }
.as-upload-server-note strong { color: var(--text-main); font-size: 12.5px; }
.as-upload-server-note code,
.as-filetype-analyze-mime code { background: var(--input-bg); border: 1px solid var(--panel-border); border-radius: 5px; padding: 2px 6px; color: var(--text-main); font-size: 11px; }
.as-upload-section { padding: 20px; }
.as-upload-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.as-upload-section-title { margin: 0 0 5px; color: var(--text-main); font-size: 16px; font-weight: 600; }
.as-upload-section-desc { max-width: 70ch; }
.as-upload-overview { flex: 0 0 auto; padding: 6px 10px; border: 1px solid var(--panel-border); border-radius: 999px; color: var(--text-muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.as-upload-limit-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 20px; }
.as-upload-limit-row { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-width: 0; }
.as-upload-limit-label { min-height: 36px; color: var(--text-main); font-size: 13px; font-weight: 600; line-height: 1.4; }
.as-upload-limit-input-wrap { display: flex; align-items: center; gap: 8px; width: 100%; }
.as-upload-page .as-upload-limit-input { flex: 1; min-width: 0; min-height: 44px; width: auto; text-align: left; }
.as-upload-limit-unit { flex: 0 0 24px; color: var(--text-muted); font-size: 12px; font-weight: 600; }
.as-upload-limit-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--panel-border); }
.as-upload-limit-actions .as-save-btn { min-height: 44px; }
.as-upload-limit-result-ok { color: var(--success-green); font-size: 12px; font-weight: 600; }
.as-upload-limit-result-err { color: var(--danger-red); font-size: 12px; font-weight: 600; }
.as-upload-state { padding: 12px 0; color: var(--text-muted); font-size: 13px; }
.as-upload-load-error { padding: 12px; border: 1px solid var(--panel-border); border-radius: 8px; color: var(--danger-red); font-size: 13px; line-height: 1.5; }

/* -- Uploads-Tab: erlaubte Dateiformate je Upload-Stelle (html/modules/admin_settings.php, siehe
   html/upload_filetypes.php), Präfix as-filetype- -- */
.as-upload-page .as-form-input { background: var(--input-bg); border-color: var(--panel-border); }
.as-filetype-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: end; margin-bottom: 10px; }
.as-upload-field-label { display: block; color: var(--text-main); font-size: 12px; font-weight: 600; line-height: 1.4; }
.as-filetype-toolbar .as-upload-field-label { grid-column: 1 / -1; }
.as-upload-page .as-filetype-search { grid-column: 1; min-height: 44px; }
.as-filetype-search-status { display: flex; align-items: center; min-height: 44px; color: var(--text-muted); font-size: 12px; text-align: right; }
.as-filetype-options { display: flex; flex-direction: column; border-top: 1px solid var(--panel-border); }
.as-filetype-row { border-bottom: 1px solid var(--panel-border); }
.as-filetype-row[hidden] { display: none; }
.as-filetype-row-summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 56px; padding: 8px 6px; color: var(--text-main); cursor: pointer; list-style: none; }
.as-filetype-chevron { flex: 0 0 8px; width: 8px; height: 8px; margin: 0 4px 0 2px; border-right: 1.5px solid var(--text-muted); border-bottom: 1.5px solid var(--text-muted); transform: rotate(-45deg); transition: transform 150ms ease-out; }
.as-filetype-row[open] .as-filetype-chevron { transform: rotate(45deg); }
.as-filetype-row-summary:focus-visible,
.as-upload-register > summary:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 2px; border-radius: 6px; }
.as-filetype-row-label { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; line-height: 1.4; }
.as-filetype-row-count { flex: 0 0 auto; color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
.as-filetype-row-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; padding: 0 8px 14px 22px; }
.as-filetype-chip { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 6px 10px; border: 1px solid var(--panel-border); border-radius: 8px; background: var(--bg-dark); color: var(--text-main); font-size: 12px; line-height: 1.35; cursor: pointer; }
.as-filetype-chip:hover { border-color: var(--accent-gold); }
.as-filetype-chip:focus-within { outline: 2px solid var(--accent-gold); outline-offset: 2px; }
.as-filetype-chip input { flex: 0 0 18px; width: 18px; height: 18px; margin: 0; accent-color: var(--accent-gold); }
.as-filetype-chip span { overflow-wrap: anywhere; }
.as-upload-empty { margin: 0; padding: 12px 0; color: var(--text-muted); font-size: 13px; }
.as-upload-register { margin-top: 14px; border-top: 1px solid var(--panel-border); }
.as-upload-register > summary { min-height: 52px; padding: 8px 4px; color: var(--text-main); font-size: 13px; font-weight: 600; cursor: pointer; }
.as-upload-register-body { padding: 0 4px 4px; }
.as-upload-register-body > p { max-width: 70ch; margin: 0 0 14px; color: var(--text-muted); font-size: 13px; line-height: 1.55; }
.as-filetype-sample-field,
.as-filetype-add-field { display: flex; flex: 1 1 220px; flex-direction: column; gap: 7px; min-width: 0; }
.as-filetype-add-row { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.as-filetype-add-row .as-form-input { min-width: 0; width: 100%; min-height: 44px; }
.as-filetype-add-row .as-new-btn { min-height: 44px; }
.as-filetype-sample-input::file-selector-button { min-height: 32px; margin-right: 10px; padding: 4px 10px; border: 1px solid var(--panel-border); border-radius: 6px; background: var(--panel-bg); color: var(--text-main); font: inherit; cursor: pointer; }
.as-filetype-analyze-result { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--panel-border); }
.as-filetype-analyze-mime { margin-bottom: 12px; color: var(--text-muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.as-filetype-analyze-mime code { white-space: normal; }
.as-filetype-custom-list { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--panel-border); font-size: 12px; color: var(--text-muted); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.as-filetype-custom-label { font-weight: 600; color: var(--text-main); }
.as-filetype-custom-tag { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; background: rgba(102,157,36,0.12); border: 1px solid rgba(102,157,36,0.3); border-radius: 20px; padding: 0 5px 0 12px; color: var(--text-main); }
.as-filetype-custom-remove { min-height: 44px; padding: 0 10px; border: none; border-radius: 16px; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 11px; font-weight: 600; }
.as-filetype-custom-remove:hover { background: var(--panel-bg); color: var(--danger-red); }
.as-upload-page :is(.as-form-input, .as-save-btn, .as-new-btn, .as-filetype-custom-remove):focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
    .as-filetype-chevron { transition: none; }
}

@media (max-width: 1080px) {
    .as-upload-limit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .as-upload-page { gap: 12px; }
    .as-upload-page-title { font-size: 18px; }
    .as-upload-section { padding: 16px; }
    .as-upload-section-head { flex-direction: column; gap: 8px; margin-bottom: 14px; }
    .as-upload-limit-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .as-upload-limit-label { min-height: 0; }
    .as-upload-limit-actions { align-items: stretch; flex-direction: column-reverse; }
    .as-upload-limit-actions .as-save-btn { width: 100%; }
    .as-filetype-toolbar { grid-template-columns: minmax(0, 1fr); }
    .as-filetype-toolbar .as-upload-field-label,
    .as-upload-page .as-filetype-search { grid-column: 1; }
    .as-filetype-search-status { min-height: 0; text-align: left; }
    .as-filetype-row-summary { align-items: flex-start; gap: 8px; }
    .as-filetype-row-count { max-width: 110px; white-space: normal; }
    .as-filetype-row-checks { grid-template-columns: minmax(0, 1fr); padding-left: 12px; }
    .as-filetype-chip { font-size: 14px; }
    .as-filetype-add-row { align-items: stretch; flex-direction: column; }
    .as-filetype-add-row .as-new-btn { width: 100%; }
    .as-upload-page .as-form-input { font-size: 16px; }
}

/* -- Mein Postfach (html/modules/mein_postfach.php), Präfix mp- --
   Eigenständiger Menüpunkt für JEDEN Mitarbeiter/Admin/Fachberater, der mit einer
   @holzbau-bayern.de-Adresse angemeldet ist (unabhängig von Lead-Controlling-Berechtigungen) –
   einfacher E-Mail-Client (Posteingang/Gesendet, Antworten/Weiterleiten/Verfassen, Konto-
   Einstellungen) über dasselbe Backend wie der E-Mail-Tab in lead_controlling.php
   (siehe api_lead.php::mailOwnPersonId()/mailAccountForcesM365()). Rechtsklickmenü auf der
   E-Mail-Liste (siehe mpInboxOpenCtxMenu() in mein_postfach.php) reicht bis zur "Lead
   verknüpfen"-Aktion, diese ist aber ausschließlich für Fachberater sichtbar (MP_IS_FACHBERATER),
   da nur diese Zielgruppe Leads verwaltet; Vorlagen/Serienbrieffelder bleiben weiterhin bewusst
   ausgespart. Nutzt die globalen Basis-Klassen .modal-overlay/.modal-content (Abschnitt 3). -- */
.mp-page { padding: 24px 28px; width: 100%; max-width: none; box-sizing: border-box; height: 100%; display: flex; flex-direction: column; }
.mp-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.mp-title { font-size: 22px; font-weight: 500; color: var(--text-main); margin: 0; }
.mp-title-sub { font-size: 12.5px; color: var(--text-muted); margin: 4px 0 0; }
.mp-actions { display: flex; align-items: center; gap: 8px; }
.mp-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--panel-border); background: var(--panel-bg); color: var(--text-muted); cursor: pointer; transition: .15s; }
.mp-icon-btn:hover { border-color: var(--accent-gold); color: var(--accent-gold); background: rgba(197,164,126,.08); }
.mp-icon-btn svg.spin { animation: spin 1s linear infinite; }

.mp-setup-empty { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 70px 20px; color: var(--text-muted); background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 14px; }
.mp-setup-empty svg { color: var(--accent-gold); opacity: .8; }
.mp-setup-empty h3 { margin: 0; font-size: 15px; color: var(--text-main); }
.mp-setup-empty p { margin: 0; max-width: 46ch; font-size: 12.5px; line-height: 1.6; }

/* Erstsynchronisierung: identischer Rahmen wie .mp-setup-empty, damit der Übergang ins normale
   Postfach optisch ruhig bleibt, zusätzlich pulsierendes Icon + indeterminate Fortschrittsbalken. */
.mp-initial-sync { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 70px 20px; color: var(--text-muted); background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 14px; }
.mp-initial-sync-icon { color: var(--accent-gold); animation: mp-initial-sync-pulse 1.8s ease-in-out infinite; }
.mp-initial-sync h3 { margin: 0; font-size: 15px; color: var(--text-main); }
.mp-initial-sync p { margin: 0; max-width: 50ch; font-size: 12.5px; line-height: 1.6; }
.mp-initial-sync-bar { width: 260px; max-width: 100%; height: 6px; border-radius: 999px; background: var(--input-bg); border: 1px solid var(--panel-border); overflow: hidden; }
.mp-initial-sync-bar-fill { width: 40%; height: 100%; border-radius: 999px; background: var(--accent-gold); animation: mp-initial-sync-bar 1.6s ease-in-out infinite; }
.mp-initial-sync-elapsed { font-size: 11.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
@keyframes mp-initial-sync-pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes mp-initial-sync-bar {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

.mp-inbox-wrap { display: flex; flex-direction: column; flex: 1; min-height: 480px; }
.mp-inbox-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.mp-inbox-toolbar-search { position: relative; flex: 1; min-width: 180px; }
.mp-inbox-toolbar-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.mp-inbox-toolbar-search input { width: 100%; padding-left: 32px; }
.mp-inline-check { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-muted); user-select: none; white-space: nowrap; cursor: pointer; }
.mp-inline-check input { width: 14px; height: 14px; accent-color: var(--accent-gold); }
.mp-inbox-body { flex: 1; display: flex; gap: 14px; min-height: 0; }
.mp-inbox-list { width: 340px; flex: 0 0 340px; overflow-y: auto; border: 1px solid var(--panel-border); border-radius: 12px; background: rgba(255,255,255,.025); }
.mp-inbox-folder-switch { display: flex; gap: 4px; position: sticky; top: 0; z-index: 1; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); background: color-mix(in srgb, var(--panel-bg) 75%, transparent); border-bottom: 1px solid var(--panel-border); border-radius: 11px 11px 0 0; padding: 8px; }
.mp-inbox-folder-btn { display: flex; align-items: center; justify-content: center; gap: 6px; flex: 1; background: none; border: none; padding: 7px 10px; border-radius: 7px; font-size: 11.5px; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: background .15s, color .15s; white-space: nowrap; }
.mp-inbox-folder-btn:hover { color: var(--text-main); }
.mp-inbox-folder-btn.active { color: var(--accent-gold); background: var(--panel-bg); border: 1px solid var(--panel-border); }
.mp-inbox-item { display: flex; align-items: flex-start; gap: 9px; padding: 11px 13px; border-bottom: 1px solid var(--panel-border); cursor: pointer; transition: background-color .12s ease; position: relative; }
.mp-inbox-item:last-child { border-bottom: none; }
.mp-inbox-item:hover { background: color-mix(in srgb, var(--accent-gold) 10%, transparent); }
.mp-inbox-item.is-active { background: rgba(197,164,126,.09); }
.mp-inbox-item.is-active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent-gold); }
.mp-inbox-item-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--accent-gold); box-shadow: 0 0 0 3px rgba(197,164,126,.15); }
.mp-inbox-item.is-read .mp-inbox-item-dot { background: transparent; box-shadow: none; }
/* Neu per Hintergrund-Sync eingetroffene E-Mail, oben in die Liste eingefügt (siehe
   mpInboxPrependItems() in mein_postfach.php) – kurzer Einblend-Effekt statt eines abrupten
   Auftauchens, ohne dabei den restlichen Listeninhalt zu berühren. */
@keyframes mpInboxItemEnter { from { opacity: 0; transform: translateY(-6px); background: color-mix(in srgb, var(--accent-gold) 16%, transparent); } to { opacity: 1; transform: translateY(0); } }
.mp-inbox-item-enter { animation: mpInboxItemEnter .7s ease; }
.mp-inbox-item-main { flex: 1; min-width: 0; }
.mp-inbox-item-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.mp-inbox-item-from { font-weight: 700; font-size: 12.5px; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-inbox-item.is-read .mp-inbox-item-from { color: var(--text-muted); font-weight: 400; }
.mp-inbox-item-time { flex: 0 0 auto; font-size: 10px; color: var(--text-muted); }
.mp-inbox-item-time-wrap { flex: 0 0 auto; display: flex; align-items: center; gap: 4px; }
.mp-inbox-item-attach-icon { flex: 0 0 auto; color: var(--text-muted); }
.mp-inbox-item-subject { font-size: 12px; color: var(--text-main); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-inbox-item.is-read .mp-inbox-item-subject { color: var(--text-muted); }
.mp-inbox-item-preview { font-size: 11px; color: var(--text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-inbox-item-del { position: absolute; bottom: 8px; right: 10px; width: 27px; height: 27px; opacity: 0; transition: opacity .15s ease, background-color .15s ease, color .15s ease, border-color .15s ease; background: var(--panel-bg); border-color: var(--panel-border); box-shadow: 0 1px 5px rgba(0,0,0,.22); }
.mp-inbox-item:hover .mp-inbox-item-del { opacity: 1; }
.mp-inbox-item-del:hover { background: rgba(255,68,68,.14); border-color: var(--danger-red); color: var(--danger-red); }
.mp-inbox-empty { text-align: center; padding: 40px 16px; color: var(--text-muted); font-size: 12.5px; }
.mp-inbox-reading { flex: 1; min-width: 0; overflow-y: auto; border: 1px solid var(--panel-border); border-radius: 12px; background: rgba(255,255,255,.025); padding: 18px 22px; }
.mp-reading-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--panel-border); }
.mp-reading-subject { margin: 0 0 6px; font-size: 16px; font-weight: 700; color: var(--text-main); }
.mp-reading-meta { font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.mp-reading-actions { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.mp-reading-body { font-size: 13.5px; line-height: 1.6; color: var(--text-main); margin-top: 16px; }
/* Papier-Optik (Schatten, abgerundete Ecken) wie .lc-inbox-read-body in lead_controlling.php: die
   meisten HTML-Mails gehen von hellem Hintergrund + schwarzer Schrift aus, im Dark-Mode braucht es
   also eine eigene helle "Karte" statt der Theme-Panel-Farben. */
.mp-reading-body iframe { width: 100%; border: none; background: #fff; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 10px 28px rgba(0,0,0,.16); }

.mp-compose-fields { display: flex; flex-direction: column; gap: 10px; }
.mp-field { display: flex; flex-direction: column; gap: 5px; }
.mp-field-row { display: flex; gap: 10px; }
.mp-field-row > .mp-field { flex: 1; min-width: 0; }
.mp-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .55px; color: var(--text-muted); }
.mp-input, .mp-select, .mp-textarea { background: rgba(255,255,255,.05); border: 1px solid var(--panel-border); border-radius: 8px; padding: 8px 11px; color: var(--text-main); font-size: 13px; outline: none; width: 100%; box-sizing: border-box; transition: border-color .15s, background .15s, box-shadow .15s; font-family: inherit; }
.mp-input:hover, .mp-select:hover, .mp-textarea:hover { border-color: rgba(255,255,255,.22); }
.mp-input:focus, .mp-select:focus, .mp-textarea:focus { border-color: var(--accent-gold); background: rgba(197,164,126,.05); box-shadow: 0 0 0 3px rgba(197,164,126,.13); }
.mp-input:disabled { opacity: .6; cursor: not-allowed; }
.mp-textarea { resize: vertical; min-height: 90px; }

/* Rich-Text-Toolbar für die Signatur-Einstellung (Fett/Kursiv/Unterstrichen/Schriftgröße/Farbe
   FH-Blau+NHH-Grün+Standard) – analog lc-rte-* in lead_controlling.php, hier eigenständig unter
   mp- dupliziert, da lead_controlling.php's Regeln in dessen eigenem <style>-Block liegen und
   diesem Modul nicht zur Verfügung stehen (siehe css-konventionen.md). */
.mp-rte-toolbar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.mp-rte-btn { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--panel-border); background: var(--panel-bg); color: var(--text-main); cursor: pointer; font-size: 12.5px; display: inline-flex; align-items: center; justify-content: center; transition: .15s; }
.mp-rte-btn:hover { border-color: var(--accent-gold); color: var(--accent-gold); }
.mp-rte-sep { width: 1px; height: 18px; background: var(--panel-border); margin: 0 2px; }
.mp-rte-size-wrap { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--panel-border); border-radius: 6px; padding: 0 6px; height: 26px; cursor: pointer; }
.mp-rte-size-icon { font-size: 11px; color: var(--text-muted); }
.mp-rte-size-select { border: none; background: none; color: var(--text-main); font-size: 11.5px; outline: none; cursor: pointer; }
.mp-rte-color-btn { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--panel-border); cursor: pointer; padding: 0; }
.mp-rte-color-btn:hover { border-color: var(--accent-gold); }
.mp-rte-color-reset { background: var(--panel-bg); color: var(--text-muted); font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.mp-rte-editor { min-height: 90px; max-height: 260px; overflow-y: auto; background: rgba(255,255,255,.05); border: 1px solid var(--panel-border); border-radius: 8px; padding: 8px 11px; color: var(--text-main); font-size: 13px; transition: border-color .15s, background .15s, box-shadow .15s; }
.mp-rte-editor:hover { border-color: rgba(255,255,255,.22); }
.mp-rte-editor:focus { outline: none; border-color: var(--accent-gold); background: rgba(197,164,126,.05); box-shadow: 0 0 0 3px rgba(197,164,126,.13); }
.mp-rte-editor:empty::before { content: attr(data-placeholder); color: var(--text-muted); font-style: italic; }
.mp-btn { background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 8px; padding: 7px 14px; color: var(--text-muted); cursor: pointer; font-size: 12px; display: inline-flex; align-items: center; gap: 6px; transition: .15s; white-space: nowrap; }
.mp-btn:hover { border-color: var(--accent-gold); color: var(--accent-gold); background: rgba(197,164,126,.06); }
.mp-btn-gold { background: var(--accent-gold); color: #fff; border: none; border-radius: 8px; padding: 8px 18px; font-size: 13px; font-weight: 600; cursor: pointer; transition: .15s; display: inline-flex; align-items: center; gap: 7px; }
.mp-btn-gold:hover { filter: brightness(1.1); }
.mp-btn-gold:disabled { opacity: .6; cursor: default; filter: none; }

/* ── Rechtsklickmenü der E-Mail-Liste: nutzt die zentralen, mit lead_controlling.php geteilten
   .lc-ctx-menu/.lc-ctx-item/.lc-ctx-sep-Klassen (siehe weiter oben) direkt, keine mp-eigene
   Kopie nötig – siehe mpInboxOpenCtxMenu()/mpInboxCtxMenuHtml() in mein_postfach.php. ── */

/* "Lead verknüpfen"-Suchpopover (nur Fachberater) – position:fixed wie .lc-ctx-menu, damit die
   Positionierung ohne scrollX/scrollY-Offsets auskommt (siehe mpPositionFloatingPanel()). ── */
.mp-assign-pop { position: fixed; z-index: 2000; width: 280px; max-width: calc(100vw - 16px); padding: 10px; display: none; }
.mp-assign-pop.is-open { display: block; }
.mp-assign-results { max-height: 260px; overflow-y: auto; margin-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.mp-assign-result { display: flex; flex-direction: column; gap: 1px; padding: 8px 9px; border-radius: 8px; cursor: pointer; transition: background .12s ease; }
.mp-assign-result:hover { background: color-mix(in srgb, var(--accent-gold) 14%, transparent); }
.mp-assign-result b { font-size: 12.5px; color: var(--text-main); font-weight: 600; }
.mp-assign-result span { font-size: 11px; color: var(--text-muted); }
.mp-pop-empty { padding: 10px 4px; font-size: 12px; color: var(--text-muted); text-align: center; }

/* "Kontakt anzeigen"-Popover: Name + Anrufen/Mobil/E-Mail-Schnellaktionen für die zur E-Mail
   gehörende Person (siehe mpInboxShowContactAt() in mein_postfach.php), Icon-Stil analog
   .ipr-contact-pop-btn, aber click-position-verankert statt Avatar-verankert. ── */
.mp-contact-pop { position: fixed; z-index: 2000; width: 240px; max-width: calc(100vw - 16px); padding: 12px; display: none; }
.mp-contact-pop.is-open { display: block; }
.mp-contact-pop-name { font-size: 13px; font-weight: 600; color: var(--text-main); margin-bottom: 8px; }
.mp-contact-pop-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.mp-contact-pop-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 7px; border: 1px solid var(--panel-border); background: rgba(255,255,255,.04); color: var(--text-main); font-size: 11.5px; text-decoration: none; transition: .15s; }
.mp-contact-pop-btn:hover { border-color: var(--accent-gold); color: var(--accent-gold); background: rgba(197,164,126,.08); }
.mp-attach-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.mp-attach-chip { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.03); border: 1px solid var(--panel-border); border-radius: 8px; padding: 6px 10px; font-size: 12px; color: var(--text-main); }
.mp-attach-chip button { margin-left: auto; background: none; border: none; color: var(--text-muted); cursor: pointer; display: flex; }
.mp-attach-chip button:hover { color: var(--danger-red); }
.mp-attach-zone { border: 2px dashed var(--panel-border); border-radius: 10px; padding: 16px; text-align: center; font-size: 12px; color: var(--text-muted); cursor: pointer; transition: .15s; }
.mp-attach-zone:hover, .mp-attach-zone.drag-over { border-color: var(--accent-gold); background: rgba(197,164,126,.06); color: var(--text-main); }
.mp-compose-status { margin-top: 4px; font-size: 12px; min-height: 1em; }
.mp-compose-status.err { color: var(--danger-red); }
/* Herunterladbare Anhänge EINGEHENDER E-Mails im Lesebereich (siehe mpInboxRenderDetail()) –
   flache "Chip"-Reihe oberhalb des E-Mail-Textes, analog zur Gesprächsprotokoll-Ansicht in
   lead_controlling.php (.lc-conv-email-attachments/.lc-mail-attach-chip). */
.mp-inbox-attachments { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; align-items: center; }
.mp-inbox-attach-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; padding: 5px 9px; border-radius: 999px; background: rgba(255,255,255,.03); border: 1px solid var(--panel-border); color: var(--text-muted); max-width: 240px; text-decoration: none; transition: .15s; }
.mp-inbox-attach-chip svg { flex-shrink: 0; }
.mp-inbox-attach-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-inbox-attach-chip:hover { border-color: var(--accent-gold); color: var(--text-main); }
/* Anklickbarer "+N weitere"-Badge, blendet die restlichen Anhang-Chips ein/aus (siehe
   mpRenderInboxAttachments()/mpToggleAttachExtra() in mein_postfach.php) – hält die Anzeige im
   Regelfall auf einer Zeile, statt bei vielen Anhängen unnötig viel Platz im Lesebereich zu belegen. */
.mp-inbox-attach-toggle { display: inline-flex; align-items: center; font-size: 11.5px; padding: 5px 9px; border-radius: 999px; background: none; border: 1px dashed var(--panel-border); color: var(--text-muted); cursor: pointer; transition: .15s; white-space: nowrap; }
.mp-inbox-attach-toggle:hover { border-color: var(--accent-gold); color: var(--text-main); }
.mp-compose-status.ok { color: #5cb85c; }

/* Inline-Antworten/Weiterleiten-Panel (Outlook-artig, direkt oberhalb der gelesenen E-Mail statt
   eines Modals eingeblendet) – siehe mpInboxOpenReply() in mein_postfach.php. Bewusst KOMPLETT als
   helles Papier gestaltet (wie .mp-reading-body iframe darunter), analog zu
   .lc-inbox-inline-reply-box in lead_controlling.php: Inputs/Buttons in den normalen (dunklen)
   Theme-Farben wirkten sonst "grau in grau" auf der hellen Karte. */
.mp-inline-reply { margin: 0 0 16px; }
.mp-inline-reply-box { border: 1px solid #e4e2da; border-radius: 10px; background: #fdfdfb; padding: 18px 20px;
    box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 10px 28px rgba(0,0,0,.16); }
.mp-inline-reply-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.mp-inline-reply-title { margin: 0; font-size: 14px; font-weight: 700; color: #1c1c1c; }
.mp-inline-reply-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.mp-inline-reply-box .mp-modal-close { color: #8a8a86; }
.mp-inline-reply-box .mp-modal-close:hover { background: rgba(0,0,0,.06); color: #1c1c1c; }
.mp-inline-reply-box .mp-label { color: #8a8a86; }
.mp-inline-reply-box .mp-input,
.mp-inline-reply-box .mp-textarea { background: #fff; border-color: #dcdad2; color: #1c1c1c; }
.mp-inline-reply-box .mp-input:hover,
.mp-inline-reply-box .mp-textarea:hover { border-color: var(--accent-gold); }
.mp-inline-reply-box .mp-input:focus,
.mp-inline-reply-box .mp-textarea:focus { background: #fff; box-shadow: 0 0 0 3px rgba(197,164,126,.16); }
.mp-inline-reply-box .mp-btn { background: #fff; border-color: #dcdad2; color: #5a5a55; }
.mp-inline-reply-box .mp-btn:hover { border-color: var(--accent-gold); color: var(--accent-gold); }
.mp-inline-reply-box .mp-attach-zone { border-color: #dcdad2; color: #8a8a86; }
.mp-inline-reply-box .mp-attach-zone:hover,
.mp-inline-reply-box .mp-attach-zone.drag-over { background: rgba(102,157,36,.06); color: #1c1c1c; }
.mp-inline-reply-box .mp-attach-chip { background: #f5f4ef; border-color: #dcdad2; color: #5a5a55; }
.mp-inline-reply-box .mp-attach-chip button { color: #8a8a86; }
.mp-inline-reply-box .mp-compose-status { color: #5a5a55; }
.mp-inline-reply-box .mp-compose-status.err { color: var(--danger-red); }

.mp-m365-hint { font-size: 11.5px; line-height: 1.6; color: var(--text-muted); background: rgba(197,164,126,.06); border: 1px solid rgba(197,164,126,.25); border-radius: 10px; padding: 10px 12px; display: flex; gap: 9px; align-items: flex-start; }
.mp-m365-hint svg { flex-shrink: 0; margin-top: 1px; color: var(--accent-gold); }

#mp-compose-modal .modal-content, #mp-settings-modal .modal-content { max-width: 640px; padding: 24px 26px; max-height: 88vh; overflow-y: auto; }
.mp-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.mp-modal-head h3 { margin: 0; font-size: 16px; color: var(--text-main); }
.mp-modal-close { background: none; border: none; color: var(--text-muted); font-size: 18px; cursor: pointer; line-height: 1; padding: 4px 6px; border-radius: 6px; transition: .12s; }
.mp-modal-close:hover { color: var(--text-main); background: rgba(255,255,255,.07); }
.mp-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

@media (max-width: 860px) {
    .mp-inbox-body { flex-direction: column; }
    .mp-inbox-list { width: 100%; flex: 0 0 auto; max-height: 260px; }
}
@media (max-width: 640px) {
    .mp-page { padding: 16px; }
    .mp-field-row { flex-direction: column; gap: 10px; }
}

/* ── Interne Projekte (html/modules/ipr_projects.php + html/api_ipr.php), Präfix ipr- ──────────
   Eigenständiges Modul für interne Software-/Team-Projekte mit Meilensteinen, Teilaufgaben und
   Team-Terminen (bewusst getrennt von der Hausbau-Projektverwaltung, admin_projects.php/lc-Präfix
   Kollisionsgefahr vermieden). Karten-Grid analog Feature-Requests-Board, FAB nutzt geteilte
   .lc-fab-*-Klassen (siehe oben). ── */
.ipr-page { padding: 28px 32px; }
.ipr-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.ipr-page-title { margin: 0; font-size: 24px; color: var(--text-main); }
.ipr-page-sub { margin: 8px 0 0; color: var(--text-muted); font-size: 13px; max-width: 62ch; line-height: 1.6; }

.ipr-filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.ipr-filter-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 999px; padding: 6px 14px; font-size: 12px; color: var(--text-muted); cursor: pointer; transition: .15s; }
.ipr-filter-chip:hover { border-color: var(--accent-gold); color: var(--text-main); }
.ipr-filter-chip.is-active { background: var(--accent-gold); border-color: var(--accent-gold); color: #fff; font-weight: 600; }

.ipr-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 60px 20px; color: var(--text-muted); text-align: center; }
.ipr-empty svg { opacity: .5; }

.ipr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }

/* Projekt-Karte */
.ipr-card { position: relative; display: flex; flex-direction: column; background: linear-gradient(160deg, var(--panel-bg) 0%, rgba(255,255,255,.02) 100%); border: 1px solid var(--panel-border); border-radius: 16px; padding: 18px 18px 16px; box-shadow: 0 2px 10px rgba(0,0,0,.08); transition: box-shadow .2s, transform .15s, border-color .2s; cursor: pointer; }
.ipr-card:hover { box-shadow: 0 10px 28px rgba(0,0,0,.22); transform: translateY(-3px); border-color: rgba(255,255,255,.14); }
.ipr-card.is-done { opacity: .82; }
.ipr-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.ipr-card-title-wrap { min-width: 0; }
.ipr-card-title { font-size: 16px; font-weight: 700; color: var(--text-main); margin: 0 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ipr-card-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin: 0 0 12px; max-height: 3em; overflow: hidden; }
.ipr-card-status { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.ipr-card-status.status-aktiv { background: rgba(102,157,36,.14); color: var(--brand-accent); }
.ipr-card-status.status-pausiert { background: rgba(214,175,84,.16); color: var(--accent-gold); }
.ipr-card-status.status-abgeschlossen { background: rgba(34,197,94,.16); color: #22c55e; }

.ipr-card-meeting-btn { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--panel-border); background: rgba(255,255,255,.02); color: var(--text-muted); cursor: pointer; transition: .15s; }
.ipr-card-meeting-btn:hover { border-color: var(--accent-gold); color: var(--accent-gold); background: rgba(214,175,84,.08); }
.ipr-card-meeting-btn.has-meetings { color: var(--accent-gold); border-color: color-mix(in srgb, var(--accent-gold) 45%, var(--panel-border)); }

.ipr-card-head-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.ipr-progress-track { position: relative; height: 6px; border-radius: 5px; background: rgba(255,255,255,.06); overflow: hidden; margin-bottom: 14px; }
.ipr-progress-fill { position: absolute; top: 0; left: 0; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--accent-gold), #e0c28a); transition: width .35s ease; }
.ipr-progress-label { font-size: 10.5px; color: var(--text-muted); margin: -10px 0 12px; text-align: right; }

.ipr-milestones { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.ipr-milestone { border: 1px solid var(--panel-border); border-radius: 12px; padding: 10px 12px; background: rgba(255,255,255,.015); }
.ipr-milestone.is-done { opacity: .65; }
.ipr-milestone.is-overdue { border-color: rgba(224,90,90,.45); }
.ipr-milestone.is-due-soon { border-color: rgba(214,175,84,.5); }
.ipr-milestone-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.ipr-milestone-title { font-size: 13px; font-weight: 700; color: var(--text-main); }
.ipr-milestone.is-done .ipr-milestone-title { text-decoration: line-through; color: var(--text-muted); }
.ipr-milestone-due { font-size: 10.5px; color: var(--text-muted); white-space: nowrap; }
.ipr-milestone.is-overdue .ipr-milestone-due { color: var(--danger-red); font-weight: 700; }
.ipr-milestone.is-due-soon .ipr-milestone-due { color: var(--accent-gold); font-weight: 700; }
.ipr-milestone-desc { font-size: 11.5px; color: var(--text-muted); margin: 0 0 8px; line-height: 1.4; }
.ipr-milestone-tasks { display: flex; flex-wrap: wrap; gap: 6px 10px; }
.ipr-task-check { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-main); cursor: pointer; user-select: none; }
.ipr-task-check input[type="checkbox"] { width: 15px; height: 15px; margin: 0; accent-color: var(--brand-accent); cursor: pointer; flex-shrink: 0; }
.ipr-task-check.is-done span { text-decoration: line-through; color: var(--text-muted); }
.ipr-task-num { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: var(--bg-dark); border: 1px solid var(--panel-border); font-size: 9.5px; font-weight: 700; color: var(--text-muted); flex-shrink: 0; }
.ipr-milestones-more { font-size: 11px; color: var(--text-muted); text-align: center; padding-top: 2px; }

.ipr-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--panel-border); }
.ipr-avatar-stack { display: flex; align-items: center; }
.ipr-avatar {
    position: relative; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; font-size: 10.5px; font-weight: 700; color: #fff; border: 2px solid var(--panel-bg); box-shadow: 0 1px 4px rgba(0,0,0,.25); flex-shrink: 0; background-size: cover; background-position: center;
    transform: scale(1); transition: transform .35s cubic-bezier(.22,1,.36,1), box-shadow .3s ease;
}
/* Sehr sanfter "Fischaugen"-Zoom im Hover: einzelne Badges skalieren rein per CSS, gestapelte
   Beteiligten-Avatare (.ipr-avatar-stack) bekommen zusätzlich per bindAvatarFisheye() (ipr_projects.php)
   eine abstandsbasierte Nachbar-Skalierung per Inline-Style, die diese Regel dann überschreibt. */
.ipr-avatar:hover { transform: scale(1.14); box-shadow: 0 6px 16px rgba(0,0,0,.32); z-index: 5; }
.ipr-avatar.is-clickable { cursor: pointer; }
.ipr-avatar-stack .ipr-avatar + .ipr-avatar { margin-left: -9px; }
.ipr-avatar-owner { width: 32px; height: 32px; font-size: 11.5px; border-width: 2px; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.ipr-avatar-more { background: var(--bg-dark); color: var(--text-muted); border: 2px solid var(--panel-bg); }
.ipr-card-actions { display: flex; gap: 6px; flex-shrink: 0; }
.ipr-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--panel-border); background: rgba(255,255,255,.02); color: var(--text-muted); cursor: pointer; transition: .15s; }
.ipr-icon-btn:hover { border-color: var(--brand-accent); color: var(--brand-accent); background: rgba(102,157,36,.1); }
.ipr-icon-btn-danger:hover { border-color: var(--danger-red); color: var(--danger-red); background: rgba(224,90,90,.1); }

/* Kontakt-Popover für Personen-Badges (Klick auf Avatar → Anrufen/E-Mail), siehe iprOpenContactPop()
   in ipr_projects.php. Ein einzelnes, global wiederverwendetes + per JS positioniertes Element (fixed),
   da Badges an sehr vielen verschachtelten Stellen vorkommen (Karten, Zeitstrahl, Modal, Protokoll).
   Nutzt die globale Glas-Optik `.hbb-glass-pop.hbb-glass-pop-arrow` (siehe Abschnitt 3) — hier nur
   noch Position/Breite/Größe/Öffnen-Transition, kein eigenes Hintergrund-CSS mehr. Per
   data-placement wahlweise unter- oder oberhalb des Badges, damit sie nie am Bildschirmrand
   abgeschnitten wird. */
.ipr-contact-pop {
    position: fixed; z-index: 1300; width: 190px; padding: 12px;
    opacity: 0; visibility: hidden; pointer-events: none; transform: translate(-50%, -6px);
    transition: opacity .2s ease, transform .2s cubic-bezier(.22,1,.36,1), visibility 0s linear .2s;
}
.ipr-contact-pop[data-placement="bottom"] { transform: translate(-50%, -6px); }
.ipr-contact-pop[data-placement="top"] { transform: translate(-50%, 6px); }
.ipr-contact-pop.is-open {
    opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, 0);
    transition: opacity .2s ease, transform .2s cubic-bezier(.22,1,.36,1), visibility 0s;
}
.ipr-contact-pop-name { font-size: 12.5px; font-weight: 700; color: var(--text-main); margin: 2px 4px 8px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ipr-contact-pop-actions { display: flex; gap: 6px; }
.ipr-contact-pop-btn { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 11px; border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.1); color: var(--text-muted); font-size: 10.5px; text-decoration: none; transition: .15s; }
.ipr-contact-pop-btn:hover { border-color: var(--brand-accent); color: var(--brand-accent); background: rgba(102,157,36,.14); transform: translateY(-1px); }

/* Team-Termine-Popover (Klick auf Kalender-Icon der Karte) — ebenfalls `.hbb-glass-pop` (Abschnitt 3). */
.ipr-meetings-pop { position: absolute; top: 52px; right: 14px; z-index: 20; width: min(88vw, 300px); padding: 12px; display: none; }
.ipr-meetings-pop.is-open { display: block; }
.ipr-meetings-pop-title { font-size: 12px; font-weight: 700; color: var(--accent-gold); margin: 0 0 8px; text-transform: uppercase; letter-spacing: .03em; }
.ipr-meeting-row { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-top: 1px solid var(--panel-border); }
.ipr-meeting-row:first-child { border-top: none; padding-top: 0; }
.ipr-meeting-title { font-size: 12.5px; font-weight: 600; color: var(--text-main); }
.ipr-meeting-meta { font-size: 11px; color: var(--text-muted); }
.ipr-meeting-link { font-size: 11px; color: var(--brand-accent); text-decoration: none; }
.ipr-meeting-link:hover { text-decoration: underline; }
.ipr-meetings-pop-empty { font-size: 12px; color: var(--text-muted); text-align: center; padding: 10px 0; }
.ipr-meetings-pop-add { width: 100%; margin-top: 10px; }

/* Detail-/Bearbeiten-Modal */
#ipr-modal.modal-overlay { z-index: 1100; }
#ipr-modal .modal-content { max-width: 840px; width: 92vw; max-height: 88vh; overflow-y: auto; overflow-x: hidden; padding: 26px 30px 30px; }
.ipr-tabs { margin-bottom: 20px; width: 100%; }
.ipr-tab-panel { display: none; }
.ipr-tab-panel.is-active { display: block; }

.ipr-form-row { display: flex; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.ipr-form-row > div { flex: 1 1 200px; }
.ipr-form-label { display: block; font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 5px; }

.ipr-user-picker-search-wrap { position: relative; margin-bottom: 8px; max-width: 280px; }
.ipr-user-picker-search-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.ipr-user-picker-search { width: 100%; box-sizing: border-box; padding: 8px 10px 8px 32px; background: var(--input-bg); border: 1px solid var(--panel-border); border-radius: 8px; color: var(--text-main); font-size: 12.5px; }
.ipr-user-picker-search:focus { border-color: var(--brand-accent); outline: none; }
.ipr-user-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.ipr-user-picker-empty { color: var(--text-muted); font-size: 12px; margin: 4px 0 0; }
.ipr-user-chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.03); border: 1px solid var(--panel-border); border-radius: 999px; padding: 5px 12px 5px 6px; font-size: 12px; color: var(--text-muted); cursor: pointer; transition: .15s; user-select: none; }
.ipr-user-chip:hover { border-color: var(--accent-gold); color: var(--text-main); }
.ipr-user-chip.is-selected { background: rgba(214,175,84,.14); border-color: var(--accent-gold); color: var(--text-main); font-weight: 600; }
.ipr-user-chip[aria-disabled="true"] { cursor: default; }
.ipr-user-chip[aria-disabled="true"]:hover { border-color: var(--panel-border); color: inherit; }
/* Stift-Icon je ausgewähltem Beteiligten: schaltet dessen Bearbeiten-Recht (Meilensteine/Teilaufgaben/
   Termine/Dateien) um - unabhängig vom Chip selbst (Klick stoppt die Propagation), Grau = nur
   Erledigt-Markierungen setzen und Protokoll schreiben. */
.ipr-user-chip-edit-toggle { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; border-radius: 50%; border: none; padding: 0; background: var(--brand-accent); color: #fff; cursor: pointer; flex-shrink: 0; transition: .15s; }
.ipr-user-chip-edit-toggle:hover { filter: brightness(1.15); }
.ipr-user-chip-edit-toggle.is-off { background: rgba(255,255,255,.08); color: var(--text-muted); }
/* Dritter Zustand "Beobachter" (reiner Lesezugriff, siehe iprIsProjectObserver() in api_ipr.php) –
   eigene Farbe (Lila), damit er sich klar vom "eingeschränkt"-Grau (is-off) und "volles Bearbeiten"-
   Grün (Standard) unterscheidet. */
.ipr-user-chip-edit-toggle.is-observer { background: #9333ea; color: #fff; }
.ipr-user-chip-edit-toggle[aria-disabled="true"] { cursor: default; pointer-events: none; }

/* ── Übersicht-Tab: alle Felder direkt editierbar (kein Umschalten über einen "Bearbeiten"-Knopf),
   randlos gestylt wie reiner Text, Autosave bei Blur/Change — selbes Prinzip wie bei den Meilensteinen. */
.ipr-ov-title-row { margin-bottom: 6px; }
.ipr-ov-title-inline {
    display: block; width: 100%; box-sizing: border-box; border: none; background: transparent;
    color: var(--text-main); font-family: inherit; font-size: 21px; font-weight: 800; padding: 4px 6px;
    border-radius: 8px; outline: none; transition: background .12s;
}
.ipr-ov-title-inline:hover, .ipr-ov-title-inline:focus { background: rgba(255,255,255,.05); }
.ipr-ov-title-inline::placeholder { color: var(--text-muted); font-weight: 600; }
.ipr-ov-meta-row { display: flex; align-items: flex-start; gap: 22px; flex-wrap: wrap; margin: 8px 0 14px; }
.ipr-ov-field { display: flex; flex-direction: column; gap: 5px; }
.ipr-ov-field .ipr-form-label { margin-bottom: 0; }
.ipr-ov-status-switch { display: inline-flex; gap: 4px; }
.ipr-ov-status-switch.is-disabled { pointer-events: none; opacity: .55; }
.ipr-ov-status-btn {
    background: var(--bg-dark); border: 1px solid var(--panel-border); border-radius: 999px;
    padding: 5px 12px; font-size: 11px; font-weight: 700; color: var(--text-muted); cursor: pointer;
    transition: .15s; white-space: nowrap;
}
.ipr-ov-status-btn:hover { color: var(--text-main); border-color: var(--brand-accent); }
.ipr-ov-status-btn[data-ipr-status-value="aktiv"].is-active { background: rgba(102,157,36,.16); border-color: transparent; color: var(--brand-accent); }
.ipr-ov-status-btn[data-ipr-status-value="pausiert"].is-active { background: rgba(214,175,84,.18); border-color: transparent; color: var(--accent-gold); }
.ipr-ov-status-btn[data-ipr-status-value="abgeschlossen"].is-active { background: rgba(34,197,94,.18); border-color: transparent; color: #22c55e; }

/* ── Rich-Text-Editor (Fett/Kursiv/Unterstrichen/Aufzählung/Nummerierung) für Projekt-/Meilenstein-
   Beschreibungen — Toolbar ist IMMER sichtbar (kein Hover-Menü), damit die Formatiermöglichkeit sofort
   erkennbar ist, bleibt aber randlos/dezent gestylt, damit der cleane "wie reiner Text"-Look erhalten
   bleibt (siehe .ipr-ov-desc-inline/.ipr-ms-desc-inline weiter unten). ── */
.ipr-rte { border-radius: 8px; transition: background .12s; }
.ipr-rte:hover, .ipr-rte:focus-within { background: rgba(255,255,255,.04); }
.ipr-rte.is-readonly .ipr-rte-toolbar { display: none; }
.ipr-rte-toolbar { display: flex; align-items: center; gap: 1px; padding: 2px 4px 0; }
.ipr-rte-btn { display: inline-flex; align-items: center; justify-content: center; width: 23px; height: 23px; border-radius: 6px; border: none; background: none; color: var(--text-muted); cursor: pointer; transition: .12s; }
.ipr-rte-btn:hover { background: rgba(255,255,255,.07); color: var(--text-main); }
.ipr-rte-btn.is-active { background: rgba(214,175,84,.18); color: var(--accent-gold); }
.ipr-rte-content { min-height: 20px; outline: none; cursor: text; }
.ipr-rte-content.is-empty::before { content: attr(data-placeholder); pointer-events: none; }
.ipr-rte-content ul, .ipr-rte-content ol { margin: 4px 0 4px 18px; padding: 0; }
/* Formatierte Beschreibungen (Lese-Ansichten: Projekt-/Meilenstein-Karte, Zeitstrahl) dürfen Listen
   enthalten — sonst würden Aufzählungspunkte ohne Einrückung/Markierung dargestellt. */
.ipr-card-desc ul, .ipr-card-desc ol, .ipr-milestone-desc ul, .ipr-milestone-desc ol,
.ipr-ms-view-desc ul, .ipr-ms-view-desc ol, .ipr-tl-desc ul, .ipr-tl-desc ol { margin: 4px 0 4px 18px; padding: 0; }
.ipr-ov-desc-inline {
    display: block; width: 100%; box-sizing: border-box;
    color: var(--text-muted); font-family: inherit; font-size: 13px; line-height: 1.5;
    padding: 3px 6px 5px;
}
.ipr-ov-desc-inline.is-empty::before { color: var(--text-muted); opacity: .65; font-style: italic; }
#ipr-f-description-wrap { margin-bottom: 16px; }
.ipr-ov-participants-block { margin-top: 4px; }

/* ── Meilenstein-Karten im Modal: Lese-Ansicht (Standard) + Bearbeiten-Umschaltung ── */
.ipr-ms-card { border: 1px solid var(--panel-border); border-radius: 14px; padding: 16px 18px; margin-bottom: 14px; background: rgba(255,255,255,.015); }
.ipr-ms-card.is-done { opacity: .72; }
.ipr-ms-view-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.ipr-ms-view-title-wrap { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; min-width: 0; }
.ipr-ms-status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--panel-border); flex-shrink: 0; }
.ipr-ms-status-dot.is-done { background: #22c55e; }
.ipr-ms-status-dot.is-overdue { background: var(--danger-red); }
.ipr-ms-status-dot.is-due-soon { background: var(--accent-gold); }
.ipr-ms-view-title { font-size: 15px; font-weight: 700; color: var(--text-main); }
.ipr-ms-card.is-done .ipr-ms-view-title { text-decoration: line-through; color: var(--text-muted); }
.ipr-ms-due-pill { display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 700; color: var(--text-muted); background: rgba(255,255,255,.05); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.ipr-ms-due-pill.is-overdue { color: var(--danger-red); background: rgba(224,90,90,.12); }
.ipr-ms-due-pill.is-due-soon { color: var(--accent-gold); background: rgba(214,175,84,.14); }
.ipr-ms-view-actions { display: flex; gap: 6px; flex-shrink: 0; }
.ipr-ms-view-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin: 6px 0 12px; }

/* Meilenstein-Felder: klare Zeilenstruktur (Titel-Zeile / Meta-Zeile / Beschreibung), Eingaben optisch
   wie reiner Text (kein klassisches Formular) */
.ipr-ms-title-row { display: flex; align-items: center; gap: 9px; margin-bottom: 4px; }
.ipr-ms-title-inline {
    border: none; background: transparent; color: var(--text-main); font-family: inherit;
    border-radius: 6px; transition: background .12s, color .12s; outline: none;
    flex: 1 1 auto; min-width: 0; font-size: 15px; font-weight: 700; padding: 3px 6px;
}
.ipr-ms-title-inline:hover, .ipr-ms-title-inline:focus { background: rgba(255,255,255,.05); }
.ipr-ms-card.is-done .ipr-ms-title-inline { text-decoration: line-through; color: var(--text-muted); }
.ipr-ms-title-inline::placeholder { color: var(--text-muted); font-weight: 400; }
.ipr-ms-card .ipr-rte { margin: 0 0 10px; }
.ipr-ms-desc-inline { display: block; width: 100%; box-sizing: border-box; font-size: 12px; color: var(--text-muted); padding: 3px 6px; }
.ipr-ms-desc-inline.is-empty::before { color: var(--text-muted); opacity: .65; font-style: italic; }

/* Meta-Zeile: Fälligkeit + Verantwortlich als kompakte Pills mit Icon (statt frei umbrechender Felder) */
.ipr-ms-meta-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 8px; }
.ipr-ms-meta-field {
    display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700;
    color: var(--text-muted); background: rgba(255,255,255,.05); border-radius: 999px;
    padding: 4px 10px 4px 8px; white-space: nowrap; transition: background .12s, color .12s;
}
.ipr-ms-meta-field svg { flex-shrink: 0; opacity: .85; }
.ipr-ms-meta-field:hover, .ipr-ms-meta-field:focus-within { background: rgba(255,255,255,.1); color: var(--text-main); }
.ipr-ms-meta-field.is-overdue { color: var(--danger-red); background: rgba(224,90,90,.12); }
.ipr-ms-meta-field.is-due-soon { color: var(--accent-gold); background: rgba(214,175,84,.14); }
.ipr-ms-due-inline, .ipr-ms-resp-inline {
    border: none; background: transparent; color: inherit; font: inherit; font-size: 10.5px; font-weight: 700;
    padding: 0; margin: 0; outline: none; cursor: pointer;
}
.ipr-ms-due-inline { width: 84px; }
.ipr-ms-resp-inline { max-width: 130px; }


.ipr-ms-tasks { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.ipr-task-row2 { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; transition: background .12s; }
.ipr-task-row2:hover { background: rgba(255,255,255,.03); }
.ipr-task-check2 { display: flex; align-items: center; flex: 0 0 auto; cursor: pointer; user-select: none; }
.ipr-task-check2 input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--brand-accent); cursor: pointer; flex-shrink: 0; }
.ipr-t-title-view { flex: 1 1 auto; min-width: 0; font-size: 12.5px; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ipr-task-row2.is-done .ipr-t-title-view, .ipr-task-row2.is-done .ipr-t-title-inline { text-decoration: line-through; color: var(--text-muted); }
.ipr-t-title-inline {
    flex: 1 1 auto; min-width: 0; border: none; background: transparent; color: var(--text-main);
    font-family: inherit; font-size: 12.5px; padding: 3px 6px; border-radius: 6px; outline: none;
    transition: background .12s;
}
.ipr-t-title-inline:hover, .ipr-t-title-inline:focus { background: rgba(255,255,255,.05); }
.ipr-t-title-inline::placeholder { color: var(--text-muted); }
.ipr-t-resp-inline {
    flex: 0 0 auto; max-width: 120px; border: none; background: transparent; color: var(--text-muted);
    font-family: inherit; font-size: 11px; padding: 3px 4px; border-radius: 6px; outline: none; cursor: pointer;
    transition: background .12s, color .12s;
}
.ipr-t-resp-inline:hover, .ipr-t-resp-inline:focus { background: rgba(255,255,255,.05); color: var(--text-main); }
.ipr-task-row-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.ipr-mini-icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 7px; border: 1px solid transparent; background: none; color: var(--text-muted); cursor: pointer; transition: .15s; }
.ipr-mini-icon-btn:hover { border-color: var(--panel-border); color: var(--text-main); background: rgba(255,255,255,.04); }
.ipr-mini-icon-btn.has-notes { color: var(--accent-gold); }
.ipr-mini-icon-btn-badge { position: absolute; top: -3px; right: -3px; min-width: 13px; height: 13px; border-radius: 999px; background: var(--accent-gold); color: #fff; font-size: 8.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 3px; }

.ipr-add-milestone-btn, .ipr-add-task-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 1px dashed var(--panel-border); border-radius: 9px; padding: 8px 14px; font-size: 12px; color: var(--text-muted); cursor: pointer; transition: .15s; }
.ipr-add-milestone-btn:hover, .ipr-add-task-btn:hover { border-color: var(--brand-accent); color: var(--brand-accent); background: rgba(102,157,36,.06); }
.ipr-add-task-btn { padding: 6px 12px; font-size: 11.5px; margin-top: 2px; }

/* Meilenstein: Titel/Beschreibung-Felder verhalten sich wie reiner Text (siehe .ipr-ms-title-inline etc. oben) */

/* ── Protokoll (Status-Log) je Meilenstein/Teilaufgabe ── */
.ipr-protocol-toggle { display: inline-flex; align-items: center; gap: 7px; background: none; border: none; color: var(--text-muted); font-size: 11.5px; font-weight: 600; cursor: pointer; padding: 6px 2px; margin-top: 4px; transition: color .12s; }
.ipr-protocol-toggle:hover { color: var(--accent-gold); }
.ipr-protocol-toggle svg { transition: transform .15s; }
.ipr-protocol-toggle.is-open svg.ipr-chevron { transform: rotate(180deg); }
.ipr-protocol-count { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; border-radius: 999px; background: rgba(214,175,84,.16); color: var(--accent-gold); font-size: 10px; font-weight: 700; padding: 0 5px; }
.ipr-protocol-panel { display: none; margin: 6px 0 4px; padding: 12px 14px; border: 1px solid var(--panel-border); border-radius: 12px; background: rgba(255,255,255,.02); }
.ipr-protocol-list { display: flex; flex-direction: column; gap: 10px; max-height: 220px; overflow-y: auto; margin-bottom: 10px; }
.ipr-protocol-empty { font-size: 12px; color: var(--text-muted); text-align: center; padding: 8px 0; }
.ipr-protocol-item { display: flex; gap: 9px; }
.ipr-protocol-item .ipr-avatar { width: 24px; height: 24px; font-size: 9.5px; flex-shrink: 0; }
.ipr-protocol-item-body-wrap { flex: 1 1 auto; min-width: 0; background: rgba(255,255,255,.03); border-radius: 10px; padding: 8px 11px; }
.ipr-protocol-item-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; flex-wrap: wrap; }
.ipr-protocol-item-author { font-size: 11.5px; font-weight: 700; color: var(--text-main); }
.ipr-protocol-item-time { font-size: 10.5px; color: var(--text-muted); }
.ipr-protocol-item-text { font-size: 12.5px; color: var(--text-main); line-height: 1.5; white-space: pre-line; }
.ipr-protocol-del { margin-left: auto; background: none; border: none; color: var(--text-muted); font-size: 14px; line-height: 1; cursor: pointer; padding: 0 2px; }
.ipr-protocol-del:hover { color: var(--danger-red); }
@keyframes iprNoteIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.ipr-protocol-item.is-new { animation: iprNoteIn .3s ease; }

/* Composer: chat-artige Eingabe für neue Protokolleinträge (Avatar + auto-wachsendes Textfeld +
   runder Senden-Button), ersetzt die vorherige schlichte Textarea+Button-Zeile. */
.ipr-protocol-composer { display: flex; gap: 10px; align-items: flex-end; padding-top: 10px; margin-top: 2px; border-top: 1px solid var(--panel-border); }
.ipr-protocol-composer-avatar { width: 30px; height: 30px; font-size: 11px; flex-shrink: 0; margin-bottom: 3px; }
.ipr-protocol-composer-box {
    flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px;
    background: rgba(255,255,255,.035); border: 1px solid var(--panel-border); border-radius: 14px;
    padding: 8px 10px 6px; transition: border-color .18s, box-shadow .18s, background .18s;
}
.ipr-protocol-composer-box:focus-within {
    border-color: color-mix(in srgb, var(--accent-gold) 55%, var(--panel-border));
    box-shadow: 0 0 0 3px rgba(214,175,84,.14);
    background: rgba(255,255,255,.05);
}
.ipr-protocol-composer-input {
    width: 100%; box-sizing: border-box; resize: none; overflow-y: auto; border: none; outline: none;
    background: none; color: var(--text-main); font: inherit; font-size: 12.5px; line-height: 1.5;
    padding: 2px; min-height: 20px; max-height: 140px;
}
.ipr-protocol-composer-input::placeholder { color: var(--text-muted); }
.ipr-protocol-composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ipr-protocol-composer-hint { font-size: 10px; color: var(--text-muted); opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ipr-protocol-send-btn {
    flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 999px; border: none; cursor: pointer;
    background: var(--accent-gold); color: #241c08; box-shadow: 0 2px 10px rgba(214,175,84,.35);
    transition: transform .15s, box-shadow .15s, background .15s, opacity .15s;
}
.ipr-protocol-send-btn svg { transform: translateX(-1px); }
.ipr-protocol-send-btn:hover:not(:disabled) { transform: scale(1.08) translateY(-1px); box-shadow: 0 4px 14px rgba(214,175,84,.5); }
.ipr-protocol-send-btn:active:not(:disabled) { transform: scale(.96); }
.ipr-protocol-send-btn:disabled { background: rgba(255,255,255,.08); color: var(--text-muted); box-shadow: none; opacity: .6; cursor: default; }

.ipr-meeting-editor-card { border: 1px solid var(--panel-border); border-radius: 12px; padding: 16px; margin-bottom: 14px; }

/* ── Projekt-Dateianhänge (Tab "Dateien") — gleiche Optik wie .bw-doc-* im Bewerbermodul,
   eigenständige .ipr-doc-*-Klassen, da CSS-Konvention modulweise Präfixe verlangt. ── */
.ipr-doc-dropzone { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; border: 2px dashed var(--panel-border); border-radius: 12px; padding: 24px 16px; margin-bottom: 16px; cursor: pointer; transition: border-color .15s, background .15s; }
.ipr-doc-dropzone svg { color: var(--text-muted); transition: color .2s, transform .3s cubic-bezier(.4,0,.2,1); }
.ipr-doc-dropzone:hover { border-color: color-mix(in srgb, var(--accent-gold) 45%, var(--panel-border)); background: rgba(214,175,84,.04); }
.ipr-doc-dropzone:hover svg { color: var(--accent-gold); transform: translateY(-2px); }
.ipr-doc-dropzone .ipr-doc-drop-title { font-size: 12.5px; font-weight: 600; color: var(--text-main); }
.ipr-doc-dropzone .ipr-doc-drop-hint { font-size: 10.5px; color: var(--text-muted); }
.ipr-doc-dropzone.is-dragover { border-color: var(--accent-gold); background: rgba(214,175,84,.08); }
.ipr-doc-dropzone.is-dragover svg { color: var(--accent-gold); animation: bwDropPulse 1s ease-in-out infinite; }
.ipr-doc-list { display: flex; flex-direction: column; gap: 8px; }
.ipr-doc-row { animation: bwDocRowIn .25s cubic-bezier(.4,0,.2,1); display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.02); border: 1px solid var(--panel-border); border-radius: 9px; padding: 10px 12px; }
.ipr-doc-icon { color: var(--accent-gold); flex-shrink: 0; }
.ipr-doc-info { flex: 1; min-width: 0; }
.ipr-doc-name { font-size: 12.5px; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ipr-doc-meta { font-size: 10.5px; color: var(--text-muted); }

/* ── Meilenstein-Dokumente (Zeitstrahl) — kompakte Variante der obigen .ipr-doc-*-Klassen: eigene
   .ipr-mdoc-*-Präfixe, da pro aufgeklappter Meilenstein-Karte deutlich weniger Platz zur Verfügung
   steht als im großen Dateien-Tab. Upload-Link und Drag&Drop sind bewusst EINE einzige, schlanke
   Zone (statt großer Dropzone + separatem Link), um im Zeitstrahl nicht unnötig Raum zu beanspruchen. ── */
.ipr-mdoc-section { margin-top: 12px; }
.ipr-mdoc-head { display: flex; align-items: center; margin-bottom: 7px; }
.ipr-mdoc-title { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--text-muted); }
.ipr-mdoc-title svg { width: 13px; height: 13px; color: var(--accent-gold); }
.ipr-mdoc-dropzone { position: relative; display: flex; align-items: center; gap: 8px; border: 1.5px dashed var(--panel-border); border-radius: 9px; padding: 8px 12px; margin-bottom: 8px; cursor: pointer; color: var(--text-muted); transition: border-color .15s, background .15s; }
.ipr-mdoc-dropzone svg { flex-shrink: 0; transition: color .2s, transform .3s cubic-bezier(.4,0,.2,1); }
.ipr-mdoc-dropzone:hover { border-color: color-mix(in srgb, var(--accent-gold) 45%, var(--panel-border)); background: rgba(214,175,84,.04); color: var(--text-main); }
.ipr-mdoc-dropzone:hover svg { color: var(--accent-gold); transform: translateY(-1px); }
.ipr-mdoc-dropzone.is-dragover { border-color: var(--accent-gold); background: rgba(214,175,84,.08); color: var(--text-main); }
.ipr-mdoc-dropzone.is-dragover svg { color: var(--accent-gold); animation: bwDropPulse 1s ease-in-out infinite; }
.ipr-mdoc-drop-text { font-size: 11.5px; }
.ipr-mdoc-drop-link { color: var(--accent-gold); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.ipr-mdoc-list { display: flex; flex-direction: column; gap: 6px; }
.ipr-mdoc-row { animation: bwDocRowIn .25s cubic-bezier(.4,0,.2,1); display: flex; align-items: center; gap: 9px; background: rgba(255,255,255,.02); border: 1px solid var(--panel-border); border-radius: 9px; padding: 8px 10px; transition: border-color .15s, background .15s; }
.ipr-mdoc-row.is-dragover { border-color: var(--accent-gold); background: rgba(214,175,84,.1); box-shadow: 0 0 0 1px var(--accent-gold) inset; }
.ipr-mdoc-version-badge { display: inline-flex; align-items: center; justify-content: center; margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: rgba(214,175,84,.14); color: var(--accent-gold); font-size: 9.5px; font-weight: 700; }
.ipr-mdoc-empty { font-size: 11.5px; color: var(--text-muted); margin: 0; }

/* ── Versionsverlauf-Modal (je Meilenstein-Dokument) — liegt über dem Zeitstrahl-Modal. ── */
#ipr-docver-modal.modal-overlay { z-index: 1200; }
.ipr-docver-modal { max-width: 480px; width: 92vw; max-height: 80vh; overflow-y: auto; overflow-x: hidden; padding: 24px 26px 28px; }
.ipr-docver-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.ipr-docver-item { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.02); border: 1px solid var(--panel-border); border-radius: 10px; padding: 10px 12px; }
.ipr-docver-item.is-current { border-color: color-mix(in srgb, var(--accent-gold) 45%, var(--panel-border)); background: rgba(214,175,84,.05); }
.ipr-docver-badge { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 24px; border-radius: 7px; background: rgba(255,255,255,.06); color: var(--text-main); font-size: 11px; font-weight: 700; padding: 0 6px; }
.ipr-docver-item.is-current .ipr-docver-badge { background: var(--accent-gold); color: #241c08; }
.ipr-docver-info { flex: 1; min-width: 0; }
.ipr-docver-name { font-size: 12.5px; color: var(--text-main); display: flex; align-items: center; gap: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ipr-docver-current-tag { flex-shrink: 0; font-size: 9.5px; font-weight: 700; color: var(--accent-gold); background: rgba(214,175,84,.14); border-radius: 999px; padding: 1px 6px; }
.ipr-docver-meta { font-size: 10.5px; color: var(--text-muted); }
.ipr-docver-restored-hint { font-size: 10px; color: var(--text-muted); font-style: italic; margin-top: 1px; }

/* ── Zeitstrahl-Modal (rein visuelle, interaktive Projekt-Timeline) ───────────────────────────
   Vertikale Roadmap-Darstellung statt einer datumsskalierten horizontalen Achse — dadurch keine
   Kollisions-/Skalierungsprobleme bei ungleich verteilten Terminen oder Meilensteinen ganz ohne
   Fälligkeitsdatum. Status (erledigt/überfällig/bald fällig/geplant) UND Fortschritt sind bewusst
   redundant kodiert (Knotenfarbe + Icon + Textbadge + Fortschritts-Ring), damit man den Zustand
   jeder Etappe ohne Aufklappen auf einen Blick erfassen kann — Kernanforderung dieses Features. ── */
#ipr-timeline-modal.modal-overlay { z-index: 1100; }
.ipr-tl-modal { max-width: 660px; width: 92vw; max-height: 88vh; overflow-y: auto; overflow-x: hidden; padding: 26px 30px 32px; }
.ipr-tl-head-titles h3 { margin: 0 0 2px; }
.ipr-tl-sub { margin: 0; font-size: 12px; color: var(--text-muted); }

.ipr-tl-progress { display: flex; align-items: center; gap: 12px; margin: 20px 0 12px; }
.ipr-tl-progress-track { position: relative; flex: 1 1 auto; height: 9px; border-radius: 6px; background: rgba(255,255,255,.06); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,.2); }
.ipr-tl-progress-fill { position: absolute; top: 0; left: 0; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent-gold), #e0c28a); transition: width .5s cubic-bezier(.4,0,.2,1); box-shadow: 0 0 10px rgba(214,175,84,.5); }
.ipr-tl-progress-label { flex-shrink: 0; font-size: 13px; font-weight: 800; color: var(--text-main); min-width: 38px; text-align: right; }
.ipr-tl-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.ipr-tl-legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--text-muted); background: rgba(255,255,255,.03); border: 1px solid var(--panel-border); border-radius: 999px; padding: 5px 11px 5px 8px; }
.ipr-tl-legend-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--panel-border); flex-shrink: 0; }
.ipr-tl-legend-item.is-done { color: #22c55e; border-color: rgba(34,197,94,.3); background: rgba(34,197,94,.08); }
.ipr-tl-legend-item.is-overdue { color: var(--danger-red); border-color: rgba(255,68,68,.3); background: rgba(255,68,68,.07); }
.ipr-tl-legend-item.is-due-soon { color: var(--accent-gold); border-color: rgba(214,175,84,.35); background: rgba(214,175,84,.09); }
.ipr-tl-legend-dot.is-done { background: #22c55e; }
.ipr-tl-legend-dot.is-overdue { background: var(--danger-red); }
.ipr-tl-legend-dot.is-due-soon { background: var(--accent-gold); }

.ipr-tl-rail { position: relative; padding-left: 48px; }
.ipr-tl-rail::before {
    content: ""; position: absolute; left: 19px; top: 4px; bottom: 4px; width: 2px;
    background: linear-gradient(180deg, var(--accent-gold) 0%, var(--panel-border) 45%, var(--panel-border) 100%);
    border-radius: 2px;
}
@keyframes iprTlIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.ipr-tl-item, .ipr-tl-today-row { position: relative; animation: iprTlIn .45s cubic-bezier(.4,0,.2,1) both; animation-delay: calc(var(--i, 0) * 65ms); }
.ipr-tl-item { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.ipr-tl-node {
    position: relative; flex-shrink: 0; width: 40px; height: 40px; margin-left: -48px;
    display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
    background: var(--bg-dark); border: 2.5px solid var(--panel-border); color: var(--text-muted);
    box-shadow: 0 0 0 4px var(--panel-bg); transition: border-color .2s, color .2s, background .2s, transform .2s;
    z-index: 1;
}
.ipr-tl-node.is-done { border-color: #22c55e; color: #fff; background: #22c55e; box-shadow: 0 0 0 4px var(--panel-bg), 0 0 14px rgba(34,197,94,.55); }
.ipr-tl-node.is-overdue { border-color: var(--danger-red); color: var(--danger-red); background: color-mix(in srgb, var(--danger-red) 16%, var(--panel-bg)); }
.ipr-tl-node.is-due-soon { border-color: var(--accent-gold); color: var(--accent-gold); background: color-mix(in srgb, var(--accent-gold) 16%, var(--panel-bg)); }
.ipr-tl-node.is-planned { color: var(--text-muted); }
.ipr-tl-node.is-start, .ipr-tl-node.is-end { border-color: var(--accent-gold); color: var(--accent-gold); background: color-mix(in srgb, var(--accent-gold) 16%, var(--panel-bg)); }
.ipr-tl-item:hover .ipr-tl-node { transform: scale(1.08); }
.ipr-tl-node.is-overdue::after {
    content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--danger-red);
    animation: iprTlPing 1.8s cubic-bezier(0,0,.2,1) infinite;
}
@keyframes iprTlPing { 0% { transform: scale(1); opacity: .65; } 100% { transform: scale(1.55); opacity: 0; } }
/* "Heute fällig"/"Morgen fällig": kritischste noch offene Etappen, eigener Orange-Ton statt im
   generischen Gold-"Bald fällig"-Look unterzugehen — heute pulsiert wie überfällig, morgen dezenter. */
.ipr-tl-node.is-critical-today, .ipr-tl-node.is-critical-tomorrow { border-color: #f97316; color: #f97316; background: color-mix(in srgb, #f97316 18%, var(--panel-bg)); }
.ipr-tl-node.is-critical-today::after {
    content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid #f97316;
    animation: iprTlPing 1.8s cubic-bezier(0,0,.2,1) infinite;
}

.ipr-tl-card { flex: 1 1 auto; min-width: 0; border: 1px solid var(--panel-border); border-left: 3px solid var(--panel-border); border-radius: 12px; background: rgba(255,255,255,.02); box-shadow: 0 2px 8px rgba(0,0,0,.06); transition: border-color .15s, background .15s, box-shadow .15s, transform .15s; }
.ipr-tl-card:hover { border-color: color-mix(in srgb, var(--accent-gold) 35%, var(--panel-border)); box-shadow: 0 6px 18px rgba(0,0,0,.16); transform: translateY(-1px); }
.ipr-tl-card.is-done { border-left-color: #22c55e; }
.ipr-tl-card.is-overdue { border-left-color: var(--danger-red); }
.ipr-tl-card.is-due-soon { border-left-color: var(--accent-gold); }
.ipr-tl-card.is-critical-today, .ipr-tl-card.is-critical-tomorrow { border-left-color: #f97316; }
.ipr-tl-card-plain { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: transparent; border-left-style: dashed; box-shadow: none; }
.ipr-tl-card-head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: none; border: none; padding: 13px 14px; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.ipr-tl-card-head-main { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 5px; }
.ipr-tl-card-title-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.ipr-tl-card-title { font-size: 13.5px; font-weight: 700; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ipr-tl-card-sub { display: flex; align-items: center; gap: 8px; }
/* Nur im eingeklappten Zustand sichtbar \u2014 sobald aufgeklappt, \u00fcbernimmt die volle Beschreibung
   im Card-Body dieselbe Stelle, sonst w\u00fcrde der Text doppelt erscheinen. */
.ipr-tl-desc-preview { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; opacity: .85; }
.ipr-tl-item.is-expanded .ipr-tl-desc-preview { display: none; }
.ipr-tl-card-head-side { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.ipr-tl-card-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ipr-tl-chevron { color: var(--text-muted); transition: transform .2s; flex-shrink: 0; }
.ipr-tl-item.is-expanded .ipr-tl-chevron { transform: rotate(180deg); }

.ipr-tl-status-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; border-radius: 999px; padding: 3px 9px 3px 7px; white-space: nowrap; color: var(--text-muted); background: rgba(255,255,255,.06); }
.ipr-tl-status-badge svg { flex-shrink: 0; }
.ipr-tl-status-badge.is-done { color: #22c55e; background: rgba(34,197,94,.16); }
.ipr-tl-status-badge.is-overdue { color: var(--danger-red); background: rgba(255,68,68,.14); }
.ipr-tl-status-badge.is-due-soon { color: var(--accent-gold); background: rgba(214,175,84,.18); }
.ipr-tl-status-badge.is-critical-today, .ipr-tl-status-badge.is-critical-tomorrow { color: #f97316; background: rgba(249,115,22,.18); }
.ipr-tl-due-text { font-size: 11.5px; font-weight: 600; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ipr-tl-due-text.is-overdue { color: var(--danger-red); }
.ipr-tl-due-text.is-due-soon { color: var(--accent-gold); }
.ipr-tl-due-text.is-done { color: #22c55e; }
.ipr-tl-due-text.is-critical-today, .ipr-tl-due-text.is-critical-tomorrow { color: #f97316; font-weight: 800; }

.ipr-tl-due-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; color: var(--text-muted); background: rgba(255,255,255,.05); border-radius: 999px; padding: 4px 9px 4px 7px; white-space: nowrap; }

.ipr-tl-ring { --pct: 0; --ring-color: var(--accent-gold); position: relative; width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; background: conic-gradient(var(--ring-color) calc(var(--pct) * 1%), rgba(255,255,255,.08) 0); transition: background .3s; }
.ipr-tl-ring.is-done { --ring-color: #22c55e; }
.ipr-tl-ring.is-overdue { --ring-color: var(--danger-red); }
.ipr-tl-ring.is-due-soon { --ring-color: var(--accent-gold); }
.ipr-tl-ring.is-critical-today, .ipr-tl-ring.is-critical-tomorrow { --ring-color: #f97316; }
.ipr-tl-ring-inner { position: absolute; inset: 3px; border-radius: 50%; background: var(--panel-bg); display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 800; color: var(--text-main); }

.ipr-tl-docs-badge { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; font-size: 10.5px; font-weight: 700; color: var(--accent-gold); background: rgba(214,175,84,.14); border-radius: 999px; padding: 4px 8px; }

.ipr-tl-card-body-wrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .28s cubic-bezier(.4,0,.2,1); }
.ipr-tl-item.is-expanded .ipr-tl-card-body-wrap { grid-template-rows: 1fr; }
.ipr-tl-card-body-inner { overflow: hidden; }
.ipr-tl-card-body { padding: 0 14px 14px; }
.ipr-tl-desc { margin: 0 0 10px; font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.ipr-tl-desc-muted { font-style: italic; opacity: .8; margin-bottom: 0; }
.ipr-tl-task-progress { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.ipr-tl-task-progress-track { position: relative; flex: 1 1 auto; height: 5px; border-radius: 4px; background: rgba(255,255,255,.06); overflow: hidden; }
.ipr-tl-task-progress-fill { position: absolute; top: 0; left: 0; height: 100%; border-radius: 4px; background: var(--accent-gold); transition: width .35s ease; }
.ipr-tl-task-progress-fill.is-done { background: #22c55e; }
.ipr-tl-task-progress-fill.is-overdue { background: var(--danger-red); }
.ipr-tl-task-progress-fill.is-due-soon { background: var(--accent-gold); }
.ipr-tl-task-progress-fill.is-critical-today, .ipr-tl-task-progress-fill.is-critical-tomorrow { background: #f97316; }
.ipr-tl-task-progress span { flex-shrink: 0; font-size: 10.5px; font-weight: 700; color: var(--text-muted); }
.ipr-tl-tasks { display: flex; flex-direction: column; gap: 6px; }
.ipr-tl-task-mini { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-main); }
.ipr-tl-task-check-wrap { display: flex; align-items: center; flex-shrink: 0; cursor: pointer; }
.ipr-tl-task-check { width: 15px; height: 15px; margin: 0; accent-color: #22c55e; cursor: pointer; flex-shrink: 0; }
.ipr-tl-task-mini-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ipr-tl-task-mini.is-done .ipr-tl-task-mini-title { text-decoration: line-through; color: var(--text-muted); }
.ipr-tl-task-mini .ipr-avatar { width: 20px; height: 20px; font-size: 8.5px; flex-shrink: 0; }

.ipr-tl-protocol-row { margin-top: 4px; border-top: 1px solid var(--panel-border); padding-top: 2px; }

.ipr-tl-today-row { display: flex; align-items: center; gap: 14px; margin: 2px 0 20px; }
.ipr-tl-today-dot {
    position: relative; flex-shrink: 0; width: 40px; height: 40px; margin-left: -48px;
    display: inline-flex; align-items: center; justify-content: center; z-index: 1;
}
.ipr-tl-today-dot::before {
    content: ""; width: 13px; height: 13px; border-radius: 50%; background: var(--accent-gold);
    box-shadow: 0 0 0 4px var(--panel-bg), 0 0 0 6px rgba(214,175,84,.35);
    animation: iprTlPulse 2s ease-in-out infinite;
}
@keyframes iprTlPulse { 0%, 100% { box-shadow: 0 0 0 4px var(--panel-bg), 0 0 0 6px rgba(214,175,84,.35); } 50% { box-shadow: 0 0 0 4px var(--panel-bg), 0 0 0 10px rgba(214,175,84,.12); } }
.ipr-tl-today-pill { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-gold); }

.ipr-tl-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 30px 20px 10px; color: var(--text-muted); font-size: 13px; text-align: center; }

@media (max-width: 640px) {
    .ipr-tl-modal { padding: 20px 16px 26px; }
    .ipr-tl-card-head { flex-wrap: wrap; }
    .ipr-tl-card-meta { flex-wrap: wrap; }
    .ipr-tl-card-head-side { width: 100%; justify-content: space-between; }
}

@media (max-width: 640px) {
    .ipr-page { padding: 16px; }
    .ipr-grid { grid-template-columns: 1fr; }
    .ipr-form-row { flex-direction: column; gap: 10px; }
    #ipr-modal .modal-content { padding: 20px 18px 24px; }
    .ipr-ov-meta-row { gap: 12px; }
}

/* Persistente app-weite Benachrichtigungs-Glocke (siehe admin.php, außerhalb #app-content) */
.hbb-bell-overlay { position: fixed; top: 16px; right: 24px; z-index: 900; font-family: inherit; }
.hbb-bell-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--panel-border); background: var(--panel-bg); color: var(--text-muted); cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.25); transition: transform .3s cubic-bezier(.22,1,.36,1), box-shadow .3s ease, border-color .15s, color .15s; }
.hbb-bell-btn:hover { border-color: var(--accent-gold); color: var(--accent-gold); transform: translateY(-2px) scale(1.06); box-shadow: 0 10px 24px rgba(0,0,0,.32), 0 0 0 5px rgba(214,175,84,.14); }
.hbb-bell-btn:active { transform: translateY(-1px) scale(.97); }
.hbb-bell-badge { position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; border-radius: 999px; background: var(--danger-red); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; box-shadow: 0 0 0 2px var(--panel-bg); }
.hbb-bell-panel { display: none; position: absolute; top: 52px; right: 0; width: min(92vw, 340px); max-height: 420px; border-top: 2px solid var(--accent-gold); overflow: hidden; flex-direction: column; }
.hbb-bell-overlay.is-open .hbb-bell-panel { display: flex; }
.hbb-bell-panel-head { padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; background: linear-gradient(135deg, rgba(214,175,84,.09) 0%, transparent 60%); border-bottom: 1px solid var(--panel-border); flex-shrink: 0; }
.hbb-bell-panel-head strong { font-size: 13px; color: var(--accent-gold); font-weight: 600; }
.hbb-bell-markall { background: none; border: none; color: var(--text-muted); font-size: 11px; cursor: pointer; padding: 3px 6px; border-radius: 6px; transition: .12s; }
.hbb-bell-markall:hover { color: var(--text-main); background: rgba(255,255,255,.06); }
.hbb-bell-list { overflow-y: auto; }
.hbb-bell-empty { padding: 24px 14px; text-align: center; font-size: 12px; color: var(--text-muted); }
.hbb-bell-item { position: relative; padding: 11px 14px 11px 17px; border-bottom: 1px solid var(--panel-border); cursor: pointer; transition: background-color .15s ease; }
.hbb-bell-item::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent-gold); opacity: 0; transition: opacity .15s ease; }
.hbb-bell-item:hover { background-color: rgba(214,175,84,.16); }
.hbb-bell-item:hover::before { opacity: 1; }
.hbb-bell-item:last-child { border-bottom: none; }
.hbb-bell-item.is-unread { background-color: rgba(214,175,84,.06); }
.hbb-bell-item.is-unread:hover { background-color: rgba(214,175,84,.2); }
.hbb-bell-item.is-unread .hbb-bell-item-title { font-weight: 700; }
.hbb-bell-item-title { font-size: 12.5px; color: var(--text-main); margin-bottom: 2px; }
.hbb-bell-item-body { font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }
.hbb-bell-item-time { font-size: 10px; color: var(--text-muted); margin-top: 4px; opacity: .8; }
@media (max-width: 640px) {
    .hbb-bell-overlay { top: 10px; right: 12px; }
    .hbb-bell-panel { width: min(94vw, 320px); right: -6px; }
}

/* ── DSGVO-Modul (admin_dsgvo.php, Präfix dsg-) ──────────────────────────────────────────
   Betroffenenrechte-Werkzeug (Auskunft/Löschung), Verarbeitungsverzeichnis, Auftrags-
   verarbeiter-Register und Datenschutzvorfälle-Log. ── */
.dsg-page { padding: 28px; max-width: 1180px; margin: 0 auto; }
.dsg-head { margin-bottom: 20px; }
.dsg-page-title { margin: 0; color: var(--text-main); font-weight: 500; font-size: 22px; }
.dsg-page-sub { margin: 5px 0 0; color: var(--text-muted); font-size: 13px; }

.dsg-tabs { margin-bottom: 22px; }

.dsg-panel { display: none; }
.dsg-panel.is-active { display: block; }

.dsg-empty { text-align: center; padding: 30px 20px; color: var(--text-muted); font-size: 13px; }

.dsg-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 24px; }
.dsg-stat-card {
    background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 12px; padding: 16px 18px;
}
.dsg-stat-card.is-danger { border-color: rgba(217,83,79,.5); }
.dsg-stat-card.is-warn { border-color: rgba(230,162,60,.5); }
.dsg-stat-value { font-size: 26px; font-weight: 700; color: var(--text-main); line-height: 1.1; }
.dsg-stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.dsg-stat-sub { font-size: 11px; color: var(--text-muted); opacity: .8; margin-top: 6px; }
.dsg-stat-card.is-danger .dsg-stat-sub { color: #d9534f; opacity: 1; }
.dsg-stat-card.is-warn .dsg-stat-sub { color: #e6a23c; opacity: 1; }

.dsg-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-bottom: 24px; }
.dsg-info-card { background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 12px; padding: 18px 20px; }
.dsg-info-card h3 { margin: 0 0 10px; font-size: 14px; color: var(--text-main); }
.dsg-info-card ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.dsg-info-card li { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.dsg-info-card p { margin: 0; font-size: 12.5px; color: var(--text-muted); line-height: 1.55; }
.dsg-info-note { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin: 8px 0 14px; }

.dsg-recent-card { background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 12px; padding: 18px 20px; }
.dsg-recent-card h3 { margin: 0 0 12px; font-size: 14px; color: var(--text-main); }
.dsg-recent-list { display: flex; flex-direction: column; gap: 8px; }
.dsg-recent-item {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px;
    border: 1px solid var(--panel-border); border-radius: 8px; font-size: 12.5px;
}
.dsg-recent-name { color: var(--text-main); font-weight: 600; flex: 1 1 auto; }
.dsg-recent-date { color: var(--text-muted); font-size: 11.5px; white-space: nowrap; }

.dsg-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.dsg-filter-group { display: flex; gap: 6px; flex-wrap: wrap; }
.dsg-filter-btn {
    background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 8px; color: var(--text-muted);
    font-size: 12px; font-weight: 600; padding: 7px 12px; cursor: pointer; transition: .15s;
}
.dsg-filter-btn:hover { border-color: var(--brand-accent); color: var(--brand-accent); }
.dsg-filter-btn.is-active { background: var(--brand-accent); border-color: var(--brand-accent); color: #fff; }
.dsg-btn-sm { padding: 8px 14px; font-size: 12.5px; }

.dsg-table-wrap { overflow-x: auto; border: 1px solid var(--panel-border); border-radius: 12px; }
.dsg-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.dsg-table th {
    text-align: left; padding: 10px 14px; color: var(--text-muted); font-size: 11px; text-transform: uppercase;
    letter-spacing: .03em; border-bottom: 1px solid var(--panel-border); white-space: nowrap;
}
.dsg-table td { padding: 10px 14px; border-bottom: 1px solid var(--panel-border); color: var(--text-main); vertical-align: middle; }
.dsg-table tr:last-child td { border-bottom: none; }
.dsg-table tr.is-overdue td { background: rgba(217,83,79,.08); }
.dsg-col-notes { max-width: 240px; color: var(--text-muted); }
.dsg-col-actions { white-space: nowrap; text-align: right; }

.dsg-badge {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px;
    font-size: 10.5px; font-weight: 700; background: rgba(255,255,255,.06); color: var(--text-muted); white-space: nowrap;
}
.dsg-badge-type { background: rgba(197,164,126,.14); color: var(--brand-accent); }
.dsg-badge-danger { background: rgba(217,83,79,.16); color: #d9534f; }
.dsg-badge-ok { background: rgba(102,157,36,.16); color: #669d24; }
.dsg-status-offen { background: rgba(230,162,60,.16); color: #e6a23c; }
.dsg-status-in_bearbeitung { background: rgba(91,155,213,.18); color: #5b9bd5; }
.dsg-status-erledigt { background: rgba(102,157,36,.16); color: #669d24; }
.dsg-status-abgelehnt { background: rgba(217,83,79,.16); color: #d9534f; }

.dsg-toolbar-note { margin: 0; }
.dsg-contract-details { margin-top: 8px; }
.dsg-contract-details summary { color: var(--brand-accent); cursor: pointer; font-size: 12px; }
.dsg-contract-section { margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--panel-border); }
.dsg-contract-section h4 { margin: 0 0 9px; color: var(--text-main); font-size: 13px; }
.dsg-contract-section .dsg-info-note { margin: 8px 0 12px; }
.dsg-contract-list { max-height: 180px; overflow-y: auto; }
.dsg-contract-items { display: flex; flex-direction: column; gap: 7px; margin: 0; padding: 0; list-style: none; }
.dsg-contract-items li { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.dsg-contract-item-main { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.dsg-contract-item-main a, .dsg-contract-item-main span { overflow-wrap: anywhere; color: var(--text-main); font-size: 12.5px; }
.dsg-contract-item-main a { text-decoration: underline; text-underline-offset: 2px; }
.dsg-contract-item-main small { color: var(--text-muted); font-size: 11px; }
.dsg-contract-empty { display: block; color: var(--text-muted); font-size: 11.5px; }
.dsg-contract-details .dsg-contract-items { margin-top: 7px; }
.dsg-contract-section input[type="file"] { padding: 7px; }

.dsg-search-card { background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 12px; padding: 18px 20px; }
.dsg-search-wrap { position: relative; display: flex; align-items: center; }
.dsg-search-wrap svg { position: absolute; left: 12px; color: var(--text-muted); pointer-events: none; }
.dsg-search-input {
    width: 100%; box-sizing: border-box; background: var(--input-bg); border: 1px solid var(--panel-border);
    border-radius: 10px; color: var(--text-main); font-size: 13px; padding: 11px 14px 11px 36px;
}
.dsg-search-input:focus { border-color: var(--brand-accent); outline: none; }
.dsg-search-results { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.dsg-subject-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 12px 14px; border: 1px solid var(--panel-border); border-radius: 10px;
}
.dsg-subject-main strong { color: var(--text-main); font-size: 13.5px; }
.dsg-subject-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }
.dsg-subject-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.dsg-protected-note {
    display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: #e6a23c; font-weight: 600;
    background: rgba(230,162,60,.12); padding: 6px 10px; border-radius: 8px;
}

.dsg-icon-btn {
    width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--panel-border);
    background: transparent; color: var(--text-muted); cursor: pointer; display: inline-flex;
    align-items: center; justify-content: center; transition: .15s;
}
.dsg-icon-btn:hover { border-color: var(--brand-accent); color: var(--brand-accent); }
.dsg-icon-btn.is-warn:hover { border-color: #e6a23c; color: #e6a23c; }
.dsg-icon-btn.is-danger:hover { border-color: #d9534f; color: #d9534f; }

.dsg-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.dsg-item-card { background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 12px; padding: 16px 18px; }
.dsg-item-card.is-inactive { opacity: .6; }
.dsg-item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.dsg-item-head strong { font-size: 13.5px; color: var(--text-main); flex: 1 1 auto; }
.dsg-item-text { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; margin: 0 0 8px; }
.dsg-item-meta { font-size: 11.5px; color: var(--text-muted); margin: 0 0 4px; }
.dsg-item-meta strong { color: var(--text-main); }
.dsg-item-actions { display: flex; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--panel-border); }
.dsg-item-card.dsg-severity-kritisch { border-color: rgba(217,83,79,.5); }
.dsg-item-card.dsg-severity-hoch { border-color: rgba(230,162,60,.5); }
.dsg-severity-badge-niedrig { background: rgba(255,255,255,.08); color: var(--text-muted); }
.dsg-severity-badge-mittel { background: rgba(91,155,213,.18); color: #5b9bd5; }
.dsg-severity-badge-hoch { background: rgba(230,162,60,.16); color: #e6a23c; }
.dsg-severity-badge-kritisch { background: rgba(217,83,79,.16); color: #d9534f; }

#dsg-req-modal .modal-content, #dsg-ropa-modal .modal-content, #dsg-proc-modal .modal-content, #dsg-inc-modal .modal-content {
    max-width: 560px; padding: 28px; max-height: 88vh; overflow-y: auto;
}
.dsg-modal h3 { margin: 0 0 18px; font-size: 16px; color: var(--text-main); }
.dsg-field-label { display: block; font-size: 12px; font-weight: 700; color: var(--text-muted); margin: 14px 0 5px; }
.dsg-field-label:first-of-type { margin-top: 0; }
.dsg-input {
    width: 100%; box-sizing: border-box; background: var(--input-bg); border: 1px solid var(--panel-border);
    border-radius: 8px; color: var(--text-main); font-size: 13px; padding: 9px 12px; font-family: inherit;
}
.dsg-input:focus { border-color: var(--brand-accent); outline: none; }
.dsg-textarea { resize: vertical; min-height: 60px; }
.dsg-modal-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dsg-checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-main); margin: 14px 0; }
.dsg-checkbox-row input[type="checkbox"] { width: 16px; height: 16px; padding: 0; flex: 0 0 auto; }
.dsg-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

/* ── Auskunftsschreiben (lesbare Ansicht, Modal + Druck) ─────────────────────────────── */
#dsg-auskunft-modal .modal-content.dsg-modal-wide { max-width: 760px; padding: 28px; max-height: 88vh; overflow-y: auto; }
.dsg-print-doc { border: 1px solid var(--panel-border); border-radius: 10px; padding: 24px; background: var(--panel-bg-alt, rgba(255,255,255,.02)); margin-top: 14px; }
.dsg-print-header h1 { font-size: 18px; margin: 0 0 10px; color: var(--text-main); }
.dsg-print-header p { margin: 3px 0; font-size: 13px; color: var(--text-muted); }
.dsg-print-section { margin-top: 20px; }
.dsg-print-section h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--brand-accent); margin: 0 0 8px; border-bottom: 1px solid var(--panel-border); padding-bottom: 6px; }
.dsg-print-empty { font-size: 12.5px; color: var(--text-muted); margin: 0; }
.dsg-print-kv, .dsg-print-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.dsg-print-kv th { text-align: left; width: 220px; padding: 4px 10px 4px 0; color: var(--text-muted); font-weight: 600; vertical-align: top; }
.dsg-print-kv td { padding: 4px 0; color: var(--text-main); }
.dsg-print-table th, .dsg-print-table td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--panel-border); }
.dsg-print-table th { color: var(--text-muted); font-weight: 600; }
.dsg-print-footer { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--panel-border); }
.dsg-print-footer p { font-size: 11.5px; color: var(--text-muted); margin: 0; }

@media print {
    body * { visibility: hidden !important; }
    #dsg-auskunft-print, #dsg-auskunft-print * { visibility: visible !important; }
    #dsg-auskunft-print { position: absolute !important; top: 0; left: 0; width: 100% !important; border: none; padding: 0; }
}

@media (max-width: 640px) {
    .dsg-page { padding: 16px; }
    .dsg-modal-grid2 { grid-template-columns: 1fr; }
    .dsg-toolbar { flex-direction: column; align-items: stretch; }
    .dsg-subject-row { flex-direction: column; align-items: flex-start; }
    #dsg-auskunft-modal .modal-content.dsg-modal-wide { max-width: 94vw; padding: 18px; }
    .dsg-print-kv th { width: auto; display: block; }
    .dsg-print-kv td { display: block; margin-bottom: 6px; }
}

/* ── Sidebar-Menü-Bearbeitungsmodus (html/admin.php), Präfix side-ctx-/side-menu- ──────────────
   Rechtsklick auf die Sidebar öffnet ein kleines Kontextmenü (Vorbild: .lc-ctx-menu) mit dem
   Eintrag "Menü bearbeiten", der einen Home-Assistant-artigen Bearbeitungsmodus DIREKT in der
   Sidebar aktiviert (kein Modal): Menüpunkte wackeln leicht (Signal "verschiebbar"), lassen sich
   per natives Drag & Drop umsortieren und über ein einblendendes Augen-Symbol ein-/ausblenden;
   eine schmale Leiste unter dem Sidebar-Header bietet "Systemvorgabe laden" + "Fertig". Jeder
   Nutzer editiert dort ausschließlich sein eigenes, serverseitig gespeichertes Layout
   (order/visible je Menüpunkt, debounced autosave); nur Administratoren dürfen Punkte
   zusätzlich zwischen "Hauptmenü" und "System" verschieben (clientseitig über JS-Flag
   SIDEBAR_MENU_IS_ADMIN unterbunden, serverseitig zusätzlich in api_admin.php
   action=save_sidebar_menu_layout abgesichert). ── */
.nav-link.nav-link-hidden { display:none !important; }
.nav-link.nav-link-dimmed { opacity:.4; }
/* Hintergrund/Rand/Schatten kommen aus `.hbb-glass-pop` (per JS auf className gesetzt) — border-top bleibt als eigener Gold-Akzent (analog .lc-ctx-menu/.ipr-bell-panel). */
.side-ctx-menu { position:fixed; z-index:2000; min-width:200px; border-top:2px solid var(--accent-gold); padding:6px; display:none; }
.side-ctx-menu.is-open { display:block; }
.side-ctx-item { display:flex; align-items:center; gap:9px; width:100%; padding:8px 10px; border-radius:8px; border:none; background:none; color:var(--text-main); font-size:12.5px; text-align:left; cursor:pointer; transition:background .12s ease; }
.side-ctx-item:hover { background:color-mix(in srgb, var(--accent-gold) 14%, transparent); }
.side-ctx-item svg { flex-shrink:0; opacity:.75; }

@keyframes hbb-nav-wiggle { 0%, 100% { transform:rotate(-.5deg); } 50% { transform:rotate(.5deg); } }
.sidebar.is-menu-editing .nav-link[data-menu-key] { animation:hbb-nav-wiggle .5s ease-in-out infinite; cursor:grab; }
.sidebar.is-menu-editing .nav-link[data-menu-key]:active { cursor:grabbing; }
.sidebar.is-menu-editing .nav-link[data-menu-key].is-dragging { animation:none; opacity:.35; }
.side-menu-eye-btn { display:none; align-items:center; justify-content:center; margin-left:auto; padding:5px; border-radius:6px; background:none; border:none; color:var(--text-muted); flex-shrink:0; }
.sidebar.is-menu-editing .side-menu-eye-btn { display:flex; }
.side-menu-eye-btn:hover { color:var(--accent-gold); background:rgba(255,255,255,.08); }
.side-menu-done-bar { display:flex; flex-direction:column; gap:8px; padding:10px 16px 12px; background:color-mix(in srgb, var(--accent-gold) 10%, transparent); border-bottom:1px solid var(--panel-border); flex-shrink:0; }
.side-menu-editing-label { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--accent-gold); line-height:1.4; }
.side-menu-done-actions { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.side-menu-reset-btn { background:none; border:none; color:var(--text-muted); font-size:11px; cursor:pointer; text-decoration:underline; padding:4px 0; white-space:nowrap; }
.side-menu-reset-btn:hover { color:var(--text-main); }
.side-menu-done-btn { display:flex; align-items:center; gap:5px; background:var(--accent-gold); color:#fff; border:none; padding:6px 12px; border-radius:8px; font-size:12px; font-weight:700; cursor:pointer; white-space:nowrap; flex-shrink:0; }
.side-menu-done-btn:hover { filter:brightness(1.1); }
/* Systemvorgabe-Bearbeitungsmodus (nur Admin): eigener Akzent (statt Gold), da die Änderung
   global für ALLE Nutzer wirkt und sich klar vom persönlichen Bearbeitungsmodus abheben soll. */
.side-menu-done-bar.is-system-scope { background:color-mix(in srgb, var(--danger-red) 12%, transparent); border-bottom-color:color-mix(in srgb, var(--danger-red) 40%, var(--panel-border)); }
.side-menu-done-bar.is-system-scope .side-menu-editing-label { color:var(--danger-red); }
.side-menu-done-bar.is-system-scope .side-menu-done-btn { background:var(--danger-red); }

/* ── Cockpit (html/modules/cockpit.php), Präfix ckpt- — modulübergreifendes, frei
   konfigurierbares Auswertungs-Dashboard (Balken/Linie/Kreis/Karte/KPI/Tabelle-Kacheln via
   GridStack + Chart.js + Leaflet, alle lokal vendored, siehe html/vendor/). ── */
.ckpt-shell { padding: 4px 2px 40px; }

.ckpt-page-head { margin-bottom: 20px; }
.ckpt-page-title { margin: 0; color: var(--text-main); font-weight: 500; font-size: 22px; }
.ckpt-page-sub { margin: 5px 0 0; color: var(--text-muted); font-size: 13px; max-width: 640px; }

.ckpt-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
/* Dashboard-Umschalter: Dropdown + Bearbeiten/Teilen/Löschen-Icons als EINE optisch zusammen-
   gehörige Einheit statt loser Einzel-Buttons über die Kopfzeile verteilt (siehe Nutzer-Feedback
   "deutlich aufgeräumter"). "+ Neues Dashboard" sitzt als angehefteter Listeneintrag direkt in der
   Dropdown-Liste selbst (siehe ckptPopulateDashSelect()), braucht daher keinen eigenen Button mehr. */
.ckpt-dash-switcher { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ckpt-dash-switcher .ckpt-dd { width: 230px; }
.ckpt-toolbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.ckpt-select {
    background: var(--input-bg); border: 1px solid var(--panel-border); color: var(--text-main);
    border-radius: 8px; padding: 8px 12px; font-size: 13px; min-width: 200px;
}
.ckpt-select:focus { border-color: var(--brand-accent); outline: none; }

.ckpt-btn {
    display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.04);
    border: 1px solid var(--panel-border); color: var(--text-main); border-radius: 8px;
    padding: 8px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: .15s;
    white-space: nowrap;
}
.ckpt-btn:hover { border-color: var(--brand-accent); color: var(--brand-accent); }
.ckpt-btn-sm { padding: 6px 10px; font-size: 11.5px; }
.ckpt-btn-ghost { background: none; }
.ckpt-btn-primary { background: var(--brand-accent); color: var(--btn-text); border-color: var(--brand-accent); }
.ckpt-btn-primary:hover { filter: brightness(1.1); color: var(--btn-text); }
.ckpt-btn-danger { color: var(--danger-red); border-color: color-mix(in srgb, var(--danger-red) 40%, var(--panel-border)); }
.ckpt-btn-danger:hover { background: var(--danger-bg); border-color: var(--danger-red); color: var(--danger-red); }

/* Rund um das Umbenennen/Teilen/Löschen-Trio: ein gemeinsamer "Pill"-Container statt einzeln
   umrandeter Buttons - dieselbe Segmentierungs-Optik wie .ckpt-switch, direkt neben dem
   Dashboard-Dropdown, damit beides als EIN Bedienelement wahrgenommen wird. */
.ckpt-icon-group { display: flex; align-items: center; gap: 2px; background: var(--input-bg); border: 1px solid var(--panel-border); border-radius: 9px; padding: 3px; }
.ckpt-icon-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
    border: none; background: none; color: var(--text-muted); border-radius: 6px; cursor: pointer; transition: .15s;
}
.ckpt-icon-btn:hover { background: rgba(255,255,255,.07); color: var(--text-main); }
.ckpt-icon-btn-danger:hover { background: var(--danger-bg); color: var(--danger-red); }

/* Stern-Button "Als Standard-Dashboard markieren" (siehe ckptToggleFavoriteDashboard() in
   modules/cockpit.php) - bewusst außerhalb von .ckpt-icon-group (eigener Rahmen statt Pill-
   Segment), da er unabhängig von Bearbeitungsrechten IMMER sichtbar ist, sobald ein Dashboard
   geöffnet ist (auch bei nur angesehenen freigegebenen Dashboards), anders als das Umbenennen/
   Teilen/Löschen-Trio daneben. */
.ckpt-icon-btn-fav {
    display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
    border: 1px solid var(--panel-border); background: var(--input-bg); color: var(--text-muted);
    border-radius: 8px; cursor: pointer; transition: .15s;
}
.ckpt-icon-btn-fav:hover { border-color: var(--brand-accent); color: var(--brand-accent); }
.ckpt-icon-btn-fav.is-active { color: var(--brand-accent); border-color: var(--brand-accent); background: color-mix(in srgb, var(--brand-accent) 12%, var(--input-bg)); }
.ckpt-icon-btn-fav.is-active svg { fill: currentColor; }

/* Stern-Markierung auf einer freigegebenen Dashboard-Karte (Tab "Für mich freigegeben") - zeigt
   an, dass genau DIESES Dashboard aktuell das Standard-Dashboard des Nutzers ist. */
.ckpt-shared-card-fav { flex-shrink: 0; color: var(--brand-accent); margin-left: auto; }
.ckpt-shared-card-fav svg { fill: currentColor; }

/* Zeitraum als kompakter Popover-Trigger statt einer stets ausgeklappten Leiste - zeigt im
   Ruhezustand nur eine Kurzbeschriftung ("Dieses Jahr" bzw. "DD.MM.–DD.MM.YYYY"), das volle Panel
   mit Schnellauswahl/Datumsfeldern/Übernehmen-Button klappt erst bei Klick auf (siehe
   ckptWireTimeCompact()). */
.ckpt-time-compact { position: relative; }
.ckpt-time-compact-trigger {
    display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-main);
    background: var(--input-bg); border: 1px solid var(--panel-border); border-radius: 9px;
    padding: 8px 11px; cursor: pointer; font-family: inherit; white-space: nowrap; transition: .15s;
}
.ckpt-time-compact-trigger:hover { border-color: var(--brand-accent); }
.ckpt-time-compact-trigger > svg:first-child { flex-shrink: 0; color: var(--text-muted); }
.ckpt-time-popover {
    display: none; position: absolute; z-index: 40; top: calc(100% + 6px); right: 0; min-width: 300px;
    border-radius: 10px; padding: 12px; flex-direction: column; gap: 10px;
}
.ckpt-time-popover.is-open { display: flex; }
.ckpt-time-popover-dates { display: flex; align-items: center; gap: 6px; }
.ckpt-date-input {
    background: var(--input-bg); border: 1px solid var(--panel-border); color: var(--text-main);
    border-radius: 6px; padding: 6px 7px; font-size: 12px; flex: 1 1 auto; min-width: 0;
}
.ckpt-date-input:focus { outline: none; border-color: var(--brand-accent); }
.ckpt-time-filter-sep { color: var(--text-muted); flex-shrink: 0; }
#ckpt-btn-apply-time { width: 100%; justify-content: center; }
.ckpt-time-quick { display: flex; gap: 2px; background: var(--input-bg); border: 1px solid var(--panel-border); border-radius: 8px; padding: 2px; }
.ckpt-time-quick .ckpt-switch-btn {
    flex: 1 1 0; border: none; border-radius: 6px; padding: 6px 9px; font-size: 11.5px; background: transparent; color: var(--text-muted);
}
.ckpt-time-quick .ckpt-switch-btn:hover { color: var(--text-main); background: rgba(255,255,255,.06); }
.ckpt-time-quick .ckpt-switch-btn.is-active { background: var(--brand-accent); color: var(--btn-text); }

.ckpt-tabs { margin-bottom: 16px; }

.ckpt-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
    padding: 60px 20px; color: var(--text-muted); text-align: center;
}
.ckpt-empty p { max-width: 360px; margin: 0; font-size: 13.5px; line-height: 1.5; }

.ckpt-grid.grid-stack { background: none; }
.ckpt-grid .grid-stack-item-content {
    background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 12px;
    overflow: hidden; display: flex; flex-direction: column;
}
/* Piktogramm- und Trenner-Gestaltungselemente wirken als freistehendes Symbol bzw. reine
   Trennlinie, nicht als Daten-Karte - daher ohne den sonst üblichen Kachel-Hintergrund/Rahmen
   (siehe .ckpt-ce-icon-tile/.ckpt-ce-divider). */
.ckpt-grid .grid-stack-item-content:has(.ckpt-ce-tile-ce_icon),
.ckpt-grid .grid-stack-item-content:has(.ckpt-ce-tile-ce_divider),
.ckpt-grid .grid-stack-item-content:has(.ckpt-ce-tile-ce_divider_v) { background: transparent; border: none; box-shadow: none; }

/* ── Cockpit: Drucken/PDF (html/modules/cockpit.php, html/api_cockpit.php) ──────────────────
   Rastert das aktuell angezeigte Dashboard (html2canvas) und legt es auf das unter Einstellungen
   → Corporate Design hinterlegte Briefpapier (Holzbau Bayern, ohne Bankdaten) - siehe
   ckptPrintDashboard()/ckptDownloadDashboardPdf(). #ckpt-print-root wird per JS als DIREKTES Kind
   von <body> angehängt (siehe ckptEnsurePrintRoot()) - die body.ckpt-is-printing-Regel blendet beim
   Drucken dadurch zuverlässig ALLE anderen direkten body-Kinder aus (Sidebar, Kopfzeile, mobile
   Navigation, Toasts, ...), unabhängig davon, wie die App-Chrome an anderer Stelle aufgebaut ist
   oder sich künftig ändert. Seitenränder (60/30/20/20mm) wurden am hochgeladenen Briefpapier-Bild
   vermessen (Kopfbereich mit Logo bis ~46mm, Anschriftzeile bis ~56mm, Fußzeile ab ~274mm). -- */
#ckpt-print-root { display: none; }
body.ckpt-is-printing > *:not(#ckpt-print-root) { display: none !important; }
body.ckpt-is-printing #ckpt-print-root { display: block !important; }
.ckpt-print-page {
    position: relative; width: 210mm; height: 297mm; box-sizing: border-box;
    background-repeat: no-repeat; background-size: 100% 100%;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.ckpt-print-page + .ckpt-print-page { break-before: page; page-break-before: always; }
.ckpt-print-page-content { position: absolute; top: 60mm; left: 20mm; right: 20mm; bottom: 30mm; overflow: hidden; }
.ckpt-print-page-content img { display: block; width: 100%; }
@media print {
    @page { size: A4; margin: 0; }
    html, body.ckpt-is-printing { background: #fff !important; }
}

/* Lade-Zustand der Drucken/PDF/Präsentation-Buttons (ckptSetExportBusy() in modules/cockpit.php) -
   Erstellung rastert ggf. ein ganzes Dashboard und kann je nach Größe einige Sekunden dauern; ohne
   sichtbare Rückmeldung klicken ungeduldige Nutzer sonst mehrfach auf denselben/andere Export-
   Buttons, was mehrere teure html2canvas-Läufe parallel anstößt. Während EIN Export läuft, werden
   alle drei Buttons gesperrt, nur der aktive zeigt einen rotierenden Ring statt seines Icons. */
.ckpt-icon-btn.is-busy { position: relative; color: transparent; pointer-events: none; }
.ckpt-icon-btn.is-busy svg { visibility: hidden; }
.ckpt-icon-btn.is-busy::after {
    content: ''; position: absolute; top: 50%; left: 50%; width: 13px; height: 13px; margin: -7px 0 0 -7px;
    border: 2px solid var(--panel-border); border-top-color: var(--brand-accent); border-radius: 50%;
    animation: ckpt-export-spin .7s linear infinite;
}
@keyframes ckpt-export-spin { to { transform: rotate(360deg); } }

.ckpt-widget { display: flex; flex-direction: column; height: 100%; }
/* Außerhalb eines GridStack-Grid-Items (z. B. "Für mich freigegeben"-Übersicht) gibt es keine
   vom Grid vorgegebene Pixel-Höhe - ".ckpt-widget { height:100% }" liefe sonst gegen eine
   unbestimmte Bezugsgröße. Das Chart.js-Canvas (responsive, maintainAspectRatio:false) würde dann
   mit jedem Resize-Observer-Zyklus neu und größer messen, wodurch die Kachel endlos in die Höhe
   wächst (siehe Nutzer-Bugreport). Eine feste Höhe gibt dem Canvas eine stabile Bezugsgröße. */
.ckpt-widget-standalone { background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 12px; height: 320px; }
.ckpt-widget-head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 10px 12px; border-bottom: 1px solid var(--panel-border); flex-shrink: 0;
}
.ckpt-widget-title { font-size: 12.5px; font-weight: 700; color: var(--text-main); }
.ckpt-widget-meta { font-size: 10.5px; color: var(--text-muted); }
.ckpt-widget-actions { display: flex; gap: 4px; flex-shrink: 0; }
.ckpt-widget-icon-btn {
    background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px;
    border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; transition: .15s;
}
.ckpt-widget-icon-btn:hover { color: var(--brand-accent); background: rgba(255,255,255,.06); }
.ckpt-widget-icon-btn.is-active { color: var(--brand-accent); }
.ckpt-widget-icon-btn-danger:hover { color: var(--danger-red); background: var(--danger-bg); }
.ckpt-widget-ai-btn { color: var(--ai-purple); }
.ckpt-widget-ai-btn:hover { color: var(--ai-purple); background: color-mix(in srgb, var(--ai-purple) 14%, transparent); }
.ckpt-widget-ai-insight {
    flex-shrink: 0; margin: 0 12px 10px; padding: 9px 11px; border-radius: 10px; font-size: 12px; line-height: 1.55;
    color: var(--text-main); background: color-mix(in srgb, var(--ai-purple) 6%, transparent);
    border: 1px solid color-mix(in srgb, var(--ai-purple) 26%, transparent);
}
.ckpt-widget-ai-insight .ckpt-ai-label-badge { margin-right: 4px; }
.ckpt-widget-body { flex: 1 1 auto; min-height: 0; padding: 10px 12px; position: relative; overflow: auto; }
.ckpt-widget-body canvas { max-height: 100%; }
.ckpt-widget-loading, .ckpt-widget-error { font-size: 12px; color: var(--text-muted); padding: 10px 0; }
.ckpt-widget-error { color: var(--danger-red); }
.ckpt-widget-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    height: 100%; min-height: 140px; color: var(--text-muted); text-align: center;
}
.ckpt-widget-empty svg { opacity: .5; }
.ckpt-widget-empty p { margin: 0; font-size: 12.5px; }

/* ── Gestaltungselemente (Titel/Trenner/Beschreibung/Piktogramm) ─────────────────────────────
   Reine Layout-Bausteine ohne den schmalen Kopf-Balken normaler Daten-Kacheln (siehe
   ckptBuildContentElementTileHtml()) - Bearbeiten/Löschen/Teilen schweben stattdessen nur bei
   Hover oben rechts über der Kachel, damit der eigentliche Inhalt (Titel/Trenner/Text/Icon) die
   volle Aufmerksamkeit bekommt. */
.ckpt-ce-tile { position: relative; height: 100%; display: flex; }
.ckpt-ce-tile-body { flex: 1 1 auto; min-width: 0; display: flex; }
.ckpt-ce-tile-actions {
    position: absolute; top: 6px; right: 6px; z-index: 2; display: flex; gap: 2px;
    background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 8px; padding: 2px;
    opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity .15s ease, transform .15s ease;
}
.ckpt-ce-tile:hover .ckpt-ce-tile-actions, .ckpt-ce-tile:focus-within .ckpt-ce-tile-actions { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* Titel: große Überschrift mit farbigem Akzentbalken, optionalem Icon und Untertitel - zur
   Gliederung mehrerer thematisch zusammengehöriger Kacheln. */
.ckpt-ce-title {
    display: flex; align-items: center; gap: 14px; width: 100%; padding: 4px 18px 4px 16px;
    border-left: 4px solid var(--ckpt-ce-color, var(--brand-accent));
}
.ckpt-ce-title.ckpt-ce-align-center { justify-content: center; text-align: center; border-left: none; border-top: 4px solid var(--ckpt-ce-color, var(--brand-accent)); padding: 14px 18px 4px; }
.ckpt-ce-title-icon { flex-shrink: 0; color: var(--ckpt-ce-color, var(--brand-accent)); display: flex; }
.ckpt-ce-title-text-wrap { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ckpt-ce-title-text { font-size: 20px; font-weight: 800; color: var(--text-main); line-height: 1.2; letter-spacing: -.01em; }
.ckpt-ce-title-sub { font-size: 12.5px; color: var(--text-muted); line-height: 1.4; }

/* Trenner: horizontale Trennlinie, optional mit mittig schwebender Beschriftung (Linie/gestrichelt/
   Farbverlauf) - zwei gleich breite Linien-Segmente links/rechts der Beschriftung statt nur einer
   durchgehenden Linie, damit die Beschriftung bei vorhandenem Label wirklich MITTIG sitzt. */
.ckpt-ce-divider { display: flex; align-items: center; width: 100%; height: 100%; padding: 0 12px; position: relative; }
.ckpt-ce-divider-seg {
    flex: 1 1 auto; height: 2px; background: var(--ckpt-ce-color, var(--brand-accent));
}
.ckpt-ce-divider-dashed .ckpt-ce-divider-seg { background: repeating-linear-gradient(to right, var(--ckpt-ce-color, var(--brand-accent)) 0 8px, transparent 8px 14px); }
.ckpt-ce-divider-gradient .ckpt-ce-divider-seg:first-child { background: linear-gradient(to right, transparent, var(--ckpt-ce-color, var(--brand-accent))); }
.ckpt-ce-divider-gradient .ckpt-ce-divider-seg:last-child { background: linear-gradient(to right, var(--ckpt-ce-color, var(--brand-accent)), transparent); }
.ckpt-ce-divider-gradient .ckpt-ce-divider-seg-solo { background: linear-gradient(to right, transparent, var(--ckpt-ce-color, var(--brand-accent)) 50%, transparent); }
.ckpt-ce-divider-label {
    flex-shrink: 0; margin: 0 14px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    color: var(--ckpt-ce-color, var(--brand-accent));
}
/* Vertikaler Trenner: dieselbe Logik um 90° gedreht - Segmente füllen die Höhe statt der Breite,
   die Beschriftung liest sich von oben nach unten (writing-mode), damit sie neben der schmalen
   Kachel nicht quer abgeschnitten wird. */
.ckpt-ce-divider-vertical { flex-direction: column; padding: 12px 0; }
.ckpt-ce-divider-vertical .ckpt-ce-divider-seg { width: 2px; height: auto; }
.ckpt-ce-divider-vertical.ckpt-ce-divider-dashed .ckpt-ce-divider-seg { background: repeating-linear-gradient(to bottom, var(--ckpt-ce-color, var(--brand-accent)) 0 8px, transparent 8px 14px); }
.ckpt-ce-divider-vertical.ckpt-ce-divider-gradient .ckpt-ce-divider-seg:first-child { background: linear-gradient(to bottom, transparent, var(--ckpt-ce-color, var(--brand-accent))); }
.ckpt-ce-divider-vertical.ckpt-ce-divider-gradient .ckpt-ce-divider-seg:last-child { background: linear-gradient(to bottom, var(--ckpt-ce-color, var(--brand-accent)), transparent); }
.ckpt-ce-divider-vertical.ckpt-ce-divider-gradient .ckpt-ce-divider-seg-solo { background: linear-gradient(to bottom, transparent, var(--ckpt-ce-color, var(--brand-accent)) 50%, transparent); }
.ckpt-ce-divider-vertical .ckpt-ce-divider-label { margin: 14px 0; writing-mode: vertical-rl; text-orientation: mixed; }

/* Beschreibung: schlichter Freitext-Block, bewusst dezenter als ein Daten-Widget. */
.ckpt-ce-text { width: 100%; padding: 14px 18px; font-size: 13px; line-height: 1.65; color: var(--text-main); white-space: normal; }
.ckpt-ce-text.ckpt-ce-align-center { text-align: center; }
/* Server sanitisiert ce_text auf eine feste Tag-Whitelist (siehe hbbCockpitSanitizeRichText()),
   inkl. ul/ol/li - hier nur die Standard-Listendarstellung sicherstellen (kein globales
   list-style:none in diesem Projekt, aber Browser-Default-Einzug variiert je nach align-center). */
.ckpt-ce-text ul, .ckpt-ce-text ol { margin: 8px 0; padding-left: 1.4em; }
.ckpt-ce-text.ckpt-ce-align-center ul, .ckpt-ce-text.ckpt-ce-align-center ol { display: inline-block; text-align: left; }
.ckpt-ce-text li { margin: 2px 0; }
.ckpt-ce-text p, .ckpt-ce-text div { margin: 0 0 8px; }
.ckpt-ce-text p:last-child, .ckpt-ce-text div:last-child { margin-bottom: 0; }

/* Rich-Text-Toolbar + Editor im "Beschreibung"-Bearbeiten-Modal */
.ckpt-ce-rte-toolbar {
    display: flex; align-items: center; gap: 2px; padding: 4px; margin-bottom: 6px;
    border: 1px solid var(--panel-border); border-radius: 8px 8px 0 0; border-bottom: none; background: var(--input-bg);
}
.ckpt-ce-rte-btn {
    width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 6px;
    border: 1px solid transparent; background: transparent; color: var(--text-main); font-size: 13px; cursor: pointer; transition: .15s;
}
.ckpt-ce-rte-btn:hover { background: color-mix(in srgb, var(--brand-accent) 12%, transparent); border-color: var(--brand-accent); }
.ckpt-ce-rte-sep { width: 1px; height: 18px; margin: 0 4px; background: var(--panel-border); flex-shrink: 0; }
.ckpt-ce-rte-editor {
    min-height: 110px; max-height: 260px; overflow-y: auto; font-family: inherit; font-size: 13px; line-height: 1.55;
    border-radius: 0 0 8px 8px; margin-top: -6px;
}
.ckpt-ce-rte-editor:focus { outline: none; }
.ckpt-ce-rte-editor:empty::before { content: attr(data-placeholder); color: var(--text-muted); pointer-events: none; }
.ckpt-ce-rte-editor ul, .ckpt-ce-rte-editor ol { margin: 8px 0; padding-left: 1.4em; }

/* Piktogramm: großes Icon in farbigem Badge + Beschriftung, als Blickfang für einen Abschnitt -
   bewusst OHNE den sonst üblichen Kachel-Hintergrund/Rahmen (siehe :has()-Regel bei
   .grid-stack-item-content), da ein Piktogramm eher wie ein freistehendes Symbol wirken soll statt
   wie eine weitere Daten-Karte. Größe von Badge/Icon/Beschriftung skaliert über Container-Queries
   mit der tatsächlichen Kachelgröße (cqmin = kleinere Container-Dimension), nicht mit einem festen
   Pixelwert - bleibt dadurch auch bei sehr kleinen oder sehr großen Kacheln proportional. Deutlich
   knapperes Padding und ein viel größerer Badge-Anteil (ohne Beschriftung fast die gesamte Kachel)
   als zuvor, da sich das Piktogramm sonst "verloren" in viel Leerraum anfühlte (Nutzer-Feedback).
   .ckpt-ce-icon-tile-solo = kein Beschriftungstext gesetzt -> Badge darf die Kachel fast ausfüllen. */
.ckpt-ce-tile-ce_icon .ckpt-ce-tile-body { container-type: size; container-name: ckpt-ce-icon; }
.ckpt-ce-icon-tile { width: 100%; height: 100%; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4%; padding: 3%; }
.ckpt-ce-icon-badge {
    width: clamp(34px, 70cqmin, 400px); height: clamp(34px, 70cqmin, 400px); border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--ckpt-ce-color, var(--brand-accent)); background: color-mix(in srgb, var(--ckpt-ce-color, var(--brand-accent)) 16%, transparent);
}
.ckpt-ce-icon-tile-solo .ckpt-ce-icon-badge { width: clamp(34px, 88cqmin, 460px); height: clamp(34px, 88cqmin, 460px); }
.ckpt-ce-icon-badge svg { width: 52%; height: 52%; }
.ckpt-ce-icon-label { font-size: clamp(11px, 8cqmin, 26px); font-weight: 700; color: var(--text-main); text-align: center; }

/* Icon-/Farb-Auswahl im Bearbeiten-Modal */
.ckpt-ce-icon-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 6px; max-width: 420px; }
.ckpt-ce-icon-pick-btn {
    width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--panel-border); background: var(--input-bg);
    color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: .15s;
}
.ckpt-ce-icon-pick-btn:hover { border-color: var(--brand-accent); color: var(--text-main); }
.ckpt-ce-icon-pick-btn.is-active { border-color: var(--brand-accent); color: var(--brand-accent); background: color-mix(in srgb, var(--brand-accent) 14%, var(--input-bg)); }
.ckpt-ce-color-picker { display: flex; gap: 8px; }
.ckpt-ce-color-pick-btn {
    width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer;
    background: var(--ckpt-ce-color); box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); transition: .15s;
}
.ckpt-ce-color-pick-btn:hover { transform: scale(1.1); }
.ckpt-ce-color-pick-btn.is-active { border-color: var(--text-main); }
.ckpt-ce-preview-box { display: flex; align-items: stretch; min-height: 100px; padding: 0; overflow: hidden; }
.ckpt-ce-preview-box > * { width: 100%; }

/* ── Schwebender "Hinzufügen"-Button (Kachel/Gestaltungselement), analog zum "Neu"-Button im
   Lead-Controlling (.lc-fab-*) - eigene ckpt-*-Klassen, damit beide Module unabhängig bleiben. */
.ckpt-fab-wrap { position: fixed; right: 28px; bottom: calc(28px + var(--hbb-sync-reserved, 0px)); z-index: 950; display: none; flex-direction: column; align-items: flex-end; gap: 14px; transition: bottom .2s ease; }
.ckpt-fab-wrap.is-visible { display: flex; }
.ckpt-fab-speed { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.ckpt-fab-mini { display: flex; align-items: center; gap: 10px; opacity: 0; transform: translateY(12px) scale(.8); pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.ckpt-fab-wrap.is-open .ckpt-fab-mini { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.ckpt-fab-wrap.is-open .ckpt-fab-mini:nth-child(1) { transition-delay: .06s; }
.ckpt-fab-wrap.is-open .ckpt-fab-mini:nth-child(2) { transition-delay: 0s; }
.ckpt-fab-mini-label { background: var(--panel-bg); border: 1px solid var(--panel-border); color: var(--text-main); font-size: 12px; font-weight: 600; padding: 6px 13px; border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.28); white-space: nowrap; }
.ckpt-fab-mini-btn { width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #fff; background: var(--brand-accent); box-shadow: 0 6px 16px rgba(0,0,0,.32); transition: transform .15s ease, filter .15s ease; flex-shrink: 0; }
.ckpt-fab-mini-btn:hover { transform: scale(1.1); filter: brightness(1.12); }
.ckpt-fab-mini-btn.ckpt-fab-mini-ce { background: #8e6fce; }
.ckpt-fab-main { width: 60px; height: 60px; border-radius: 50%; border: none; cursor: pointer; background: linear-gradient(145deg, var(--brand-accent), #8f764b); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 26px rgba(0,0,0,.4); position: relative; transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .2s ease, filter .15s ease; }
.ckpt-fab-main::before { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--brand-accent) 50%, transparent); opacity: 0; transform: scale(.85); transition: opacity .25s ease, transform .25s ease; }
.ckpt-fab-main:hover { transform: translateY(-3px) scale(1.06); filter: brightness(1.08); box-shadow: 0 14px 34px rgba(0,0,0,.46); }
.ckpt-fab-main:hover::before { opacity: 1; transform: scale(1); }
.ckpt-fab-main:active { transform: translateY(-1px) scale(.96); }
.ckpt-fab-main svg { position: relative; z-index: 1; transition: transform .3s cubic-bezier(.34,1.56,.64,1); }
.ckpt-fab-wrap.is-open .ckpt-fab-main svg { transform: rotate(45deg); }
.ckpt-fab-pulse { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand-accent) 50%, transparent); animation: ckptFabPulse 2.8s ease-out infinite; pointer-events: none; }
.ckpt-fab-wrap.is-open .ckpt-fab-pulse { animation: none; box-shadow: none; }
@keyframes ckptFabPulse {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand-accent) 45%, transparent); }
    70% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--brand-accent) 0%, transparent); }
    100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand-accent) 0%, transparent); }
}
@media (max-width: 720px) {
    .ckpt-fab-wrap { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px) + var(--hbb-sync-reserved, 0px)); }
}

.ckpt-kpi { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 4px; }
.ckpt-kpi-value { font-size: 32px; font-weight: 800; color: var(--brand-accent); line-height: 1; }
.ckpt-kpi-label { font-size: 11.5px; color: var(--text-muted); }

.ckpt-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ckpt-table th { text-align: left; color: var(--text-muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--panel-border); }
.ckpt-table td { padding: 6px 8px; border-bottom: 1px solid var(--panel-border); }

.ckpt-map { width: 100%; height: 100%; min-height: 200px; border-radius: 8px; overflow: hidden; }

/* Karte mit umschaltbaren Kennzahlen + Top-5-Rangliste daneben (nur bei mehreren Measures) */
.ckpt-map-toggle { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.ckpt-map-toggle .ckpt-switch-btn { border: 1px solid var(--panel-border); border-radius: 7px; }
.ckpt-map-toggle .ckpt-switch-btn:last-child { border-right: 1px solid var(--panel-border); }
.ckpt-map-layout { display: flex; gap: 12px; height: calc(100% - 0px); min-height: 200px; }
.ckpt-map-layout .ckpt-map { flex: 1 1 auto; min-width: 0; }
.ckpt-map-ranking { flex: 0 0 180px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.ckpt-map-ranking-title { font-size: 11px; color: var(--text-muted); margin: 0 0 4px; text-transform: uppercase; letter-spacing: .03em; }
.ckpt-map-ranking-row { display: grid; grid-template-columns: 1fr 50px; grid-template-rows: auto auto; gap: 2px 6px; font-size: 11.5px; }
.ckpt-map-ranking-name { grid-column: 1 / 2; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ckpt-map-ranking-value { grid-column: 2 / 3; grid-row: 1 / 2; color: var(--text-muted); text-align: right; }
.ckpt-map-ranking-bar { grid-column: 1 / 3; height: 5px; background: rgba(255,255,255,.07); border-radius: 3px; overflow: hidden; }
.ckpt-map-ranking-bar span { display: block; height: 100%; background: var(--brand-accent); border-radius: 3px; }

/* Diagrammtyp "Ziel-Erreichung" (Bullet-/Ampel-Balken) */
.ckpt-target-chart { display: flex; flex-direction: column; gap: 10px; }
.ckpt-target-row { display: flex; flex-direction: column; gap: 3px; }
.ckpt-target-row-label { font-size: 11.5px; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ckpt-target-row-track { height: 12px; border-radius: 6px; background: rgba(255,255,255,.08); overflow: hidden; min-width: 40px; }
.ckpt-target-row-fill { height: 100%; border-radius: 6px; }
.ckpt-target-row-fill.is-good { background: #4d9d4d; }
.ckpt-target-row-fill.is-warn { background: #e0913f; }
.ckpt-target-row-fill.is-bad  { background: #c0392b; }
.ckpt-target-row-fill.is-na   { background: #555; }
.ckpt-chart-caption { font-size: 10.5px; color: var(--text-muted); margin-top: 10px; line-height: 1.5; }

/* Horizontale Balken mit vielen Kategorien (z. B. alle Fachberater): feste Höhe im scrollbaren
   Container statt im Kachel-Rahmen gestaucht - Breite bleibt 100%, Höhe wird per Inline-Style
   passend zur Kategorie-Anzahl gesetzt (siehe ckptRenderWidgetBody). */
.ckpt-chart-scroll { max-height: 100%; height: 100%; overflow-y: auto; }
.ckpt-chart-scroll-inner { position: relative; width: 100%; }

.ckpt-checkbox-list { max-height: 160px; overflow-y: auto; border: 1px solid var(--panel-border); border-radius: 8px; padding: 8px 10px; }

.ckpt-section-title { font-size: 14px; margin: 18px 0 10px; color: var(--text-main); }
.ckpt-muted { color: var(--text-muted); font-size: 12.5px; }

.ckpt-shared-dash-list { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.ckpt-shared-card {
    display: flex; align-items: center; gap: 10px;
    background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 10px;
    padding: 12px 16px; cursor: pointer; transition: .15s; min-width: 220px;
}
.ckpt-shared-card:hover { border-color: var(--brand-accent); }
.ckpt-shared-card-text { min-width: 0; }
.ckpt-shared-card-title { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.ckpt-shared-card-meta { font-size: 11px; color: var(--text-muted); }

.ckpt-shared-widgets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }

/* Modals: Basis-Optik von .modal-overlay/.modal-content (siehe Abschnitt 3) übernommen, hier nur
   abweichende Breite/Innenaufbau (Kopf/Body/Footer mit eigenem Scroll-Bereich im Body). */
.ckpt-modal-overlay { z-index: 1200; }
.ckpt-modal { max-width: 640px; max-height: 88vh; display: flex; flex-direction: column; }
.ckpt-modal-sm { max-width: 440px; }
.ckpt-modal-wizard { max-width: 980px; }
.ckpt-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--panel-border); flex-shrink: 0; }
.ckpt-modal-head h2 { margin: 0; font-size: 16px; }
.ckpt-modal-close { background: none; border: none; color: var(--text-muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 0; }
.ckpt-modal-close:hover { color: var(--text-main); }
.ckpt-modal-body { padding: 16px 20px; overflow-y: auto; flex: 1 1 auto; }
.ckpt-modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--panel-border); flex-shrink: 0; }
.ckpt-modal-foot-spacer { flex: 1 1 auto; }

.ckpt-field-label { display: block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); margin: 14px 0 6px; }
.ckpt-field-label:first-child { margin-top: 0; }
.ckpt-input {
    width: 100%; box-sizing: border-box; background: var(--input-bg); border: 1px solid var(--panel-border);
    color: var(--text-main); border-radius: 8px; padding: 9px 11px; font-size: 13px;
}
.ckpt-input:focus { border-color: var(--brand-accent); outline: none; }
.ckpt-input:disabled { opacity: .5; cursor: not-allowed; }
.ckpt-hint { font-size: 11.5px; color: var(--danger-red); margin: 6px 0 0; line-height: 1.45; }

/* ── Schritt 1 des Kachel-Assistenten: Diagrammtyp mit Vorschaugrafik + Beispiel wählen ──────── */
.ckpt-step-intro { margin: 0 0 14px; font-size: 13.5px; color: var(--text-muted); }

.ckpt-mode-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.ckpt-mode-card {
    display: flex; align-items: flex-start; gap: 14px; text-align: left; font-family: inherit;
    background: var(--input-bg); border: 1px solid var(--panel-border); border-radius: 12px;
    padding: 18px; cursor: pointer; transition: .15s;
}
.ckpt-mode-card:hover { border-color: var(--brand-accent); }
.ckpt-mode-card-icon {
    flex: 0 0 auto; width: 42px; height: 42px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--brand-accent) 16%, transparent); color: var(--brand-accent);
}
.ckpt-mode-card-text { display: flex; flex-direction: column; gap: 4px; }
.ckpt-mode-card-title { font-size: 14px; font-weight: 700; color: var(--text-main); }
.ckpt-mode-card-desc { font-size: 12px; color: var(--text-muted); line-height: 1.45; }

/* KI-Kennzeichnung (lila) - dieselbe Signalfarbe/Badge-Sprache wie beim Chat-Assistenten und der
   KI-Elektroplanung im Kundenportal (siehe modules/chat.php, planung_elektro_original.php,
   modules/dashboard.php "Frag die KI"): Lila markiert durchgängig "hier steckt KI drin", neutrale
   Flächen (Chat-Bubbles, Formularfelder) bleiben bewusst unlila für Lesbarkeit. */
.ckpt-ai-label-badge {
    display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 800;
    letter-spacing: .04em; text-transform: uppercase; background: var(--ai-purple); color: #fff;
    vertical-align: middle; margin-right: 6px; line-height: 1.6;
}
/* Kompaktere Variante für sehr beengte Stellen (z. B. Kategorie-Zelle der Kundendienst-Mängeltabelle,
   siehe kdKategorieCellHtml() in kundendienst.php) - gleiche Farbe/Bedeutung, nur kleiner. */
.ckpt-ai-label-badge-sm { padding: 1px 6px; font-size: 9px; margin-right: 0; }
#ckpt-mode-card-ai { border-color: color-mix(in srgb, var(--ai-purple) 35%, var(--panel-border)); background: color-mix(in srgb, var(--ai-purple) 5%, var(--input-bg)); }
#ckpt-mode-card-ai:hover { border-color: var(--ai-purple); }
#ckpt-mode-card-ai .ckpt-mode-card-icon { background: color-mix(in srgb, var(--ai-purple) 16%, transparent); color: var(--ai-purple); }
#ckpt-mode-card-ai .ckpt-mode-card-title { color: var(--ai-purple); }

.ckpt-type-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.ckpt-type-card {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
    background: var(--input-bg); border: 1px solid var(--panel-border); border-radius: 12px;
    padding: 18px 12px; cursor: pointer; transition: .15s; font: inherit; color: inherit;
}
.ckpt-type-card:hover { border-color: var(--brand-accent); }
.ckpt-type-card.is-active { border-color: var(--brand-accent); background: color-mix(in srgb, var(--brand-accent) 14%, var(--input-bg)); }
.ckpt-type-card-preview { display: flex; align-items: center; justify-content: center; height: 44px; }
.ckpt-type-card-preview-kpi { font-size: 26px; font-weight: 800; color: var(--brand-accent); }
.ckpt-type-card-title { font-size: 13px; font-weight: 700; color: var(--text-main); }
.ckpt-type-card-desc { font-size: 11px; color: var(--text-muted); line-height: 1.4; }

/* ── Schritt 2d des Kachel-Assistenten: "Für mich freigegebene Karten verwenden" - Bilderliste
   der von Kollegen geteilten Kacheln (siehe ckptRenderSharedWidgetPicker() in modules/cockpit.php),
   Klick übernimmt eine Kachel als eigene Kopie ins aktuelle Dashboard. ── */
.ckpt-shared-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.ckpt-shared-picker-card {
    display: flex; flex-direction: column; text-align: left; font: inherit; color: inherit;
    background: var(--input-bg); border: 1px solid var(--panel-border); border-radius: 12px;
    overflow: hidden; cursor: pointer; transition: .15s; padding: 0;
}
.ckpt-shared-picker-card:hover { border-color: var(--brand-accent); }
.ckpt-shared-picker-thumb { display: flex; align-items: center; justify-content: center; height: 110px; background: var(--panel-bg); border-bottom: 1px solid var(--panel-border); overflow: hidden; }
.ckpt-shared-picker-thumb-img { width: 100%; height: 100%; object-fit: contain; }
.ckpt-shared-picker-thumb-fallback { font-size: 22px; font-weight: 800; color: var(--brand-accent); }
.ckpt-shared-picker-text { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.ckpt-shared-picker-title { font-size: 13px; font-weight: 700; color: var(--text-main); }
.ckpt-shared-picker-meta { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }

/* ── Schritt 2: Konfiguration (links) + Live-Vorschau (rechts) - auf größeren Monitoren
   nebeneinander, auf schmalen Bildschirmen untereinander. ── */
.ckpt-modal-body-2col { display: grid; grid-template-columns: 1fr; gap: 24px; }
.ckpt-selected-type {
    display: inline-flex; align-items: center; gap: 6px; background: none; cursor: pointer;
    border: 1px solid var(--panel-border); color: var(--brand-accent); font-size: 12px; font-weight: 700;
    padding: 6px 14px; border-radius: 999px; margin-bottom: 4px; font-family: inherit;
}
.ckpt-selected-type:hover { border-color: var(--brand-accent); }
.ckpt-selected-type-change { color: var(--text-muted); font-weight: 500; text-decoration: underline; }
.ckpt-selected-type.ckpt-selected-type-ai { border-color: color-mix(in srgb, var(--ai-purple) 45%, var(--panel-border)); color: var(--ai-purple); }
.ckpt-selected-type.ckpt-selected-type-ai:hover { border-color: var(--ai-purple); }
.ckpt-preview-col .ckpt-preview-box { min-height: 220px; }
@media (min-width: 880px) {
    .ckpt-modal-body-2col { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
    .ckpt-preview-col { position: sticky; top: 0; }
}

/* ── Schritt 2c: KI-Chat-Assistent - Chatverlauf (links) + Live-Vorschau (rechts) ───────────── */
.ckpt-ai-chat-col { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.ckpt-ai-chat-header { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }
.ckpt-ai-chat-header-icon {
    flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px; display: flex;
    align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--ai-purple) 16%, transparent); color: var(--ai-purple);
}
.ckpt-ai-chat-header-text { display: flex; flex-direction: column; gap: 1px; }
.ckpt-ai-chat-header-title { display: flex; align-items: center; font-size: 13.5px; font-weight: 700; color: var(--ai-purple); }
.ckpt-ai-chat-header-desc { font-size: 11.5px; color: var(--text-muted); }
.ckpt-ai-chat-interactive { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
/* Hinweisbox, wenn die KI-Freigabe (hbb_users.ki_consent) noch fehlt - direkt aktivierbar statt
   nur auf "Mein Profil" zu verweisen (gleiches Freigabe-Flag/gleiche Aktion wie dort/im
   Chat-Assistenten, siehe api_user.php::set_ki_consent). */
.ckpt-ai-consent-gate {
    border: 1px solid color-mix(in srgb, var(--ai-purple) 28%, transparent);
    background: color-mix(in srgb, var(--ai-purple) 6%, transparent);
    border-radius: 14px; padding: 18px 20px;
}
.ckpt-ai-consent-gate p { margin: 0 0 14px; font-size: 13px; line-height: 1.6; color: var(--text-main); }
.ckpt-ai-consent-btn { width: 100%; justify-content: center; background: var(--ai-purple); border-color: var(--ai-purple); color: #fff; }
.ckpt-ai-consent-btn:hover { filter: brightness(1.1); color: #fff; }
.ckpt-ai-consent-btn:disabled { opacity: .6; cursor: not-allowed; filter: none; }
.ckpt-ai-consent-hint { margin: 12px 0 0 !important; font-size: 11.5px !important; color: var(--text-muted) !important; line-height: 1.5 !important; }
.ckpt-ai-chat-log {
    display: flex; flex-direction: column; gap: 10px; background: var(--input-bg);
    border: 1px solid color-mix(in srgb, var(--ai-purple) 22%, var(--panel-border)); border-radius: 12px; padding: 14px;
    min-height: 260px; max-height: 420px; overflow-y: auto;
}

/* -- Hubert (html/modules/hubert.php/api_hubert.php) - interner KI-Chat-Assistent -- */
.hub-shell, .hub-modal {
    --hub-accent: var(--brand-accent);
    --hub-secondary: color-mix(in srgb, var(--text-main) 76%, var(--panel-bg));
    --hub-danger: #ff9a91;
    color: var(--text-main);
}
html[data-theme="light"] :is(.hub-shell, .hub-modal) { --hub-danger: #a82f25; }
.hub-shell { box-sizing: border-box; padding: 4px 2px 0; width: 100%; height: calc(100dvh - 60px); min-height: 440px; display: flex; flex-direction: column; }
.hub-shell [hidden] { display: none !important; }
.hub-shell :is(button, input, textarea, summary), .hub-modal :is(button, input) { font-family: inherit; }
.hub-shell :is(button, input, textarea, summary, [tabindex]):focus-visible,
.hub-modal :is(button, input, [tabindex]):focus-visible { outline: 2px solid var(--hub-accent); outline-offset: 3px; }
.hub-shell ::selection, .hub-modal ::selection { background: var(--brand-accent); color: var(--btn-text); }
.hub-page-head { margin-bottom: 18px; padding-right: 52px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.hub-page-title { margin: 0; font-size: 26px; letter-spacing: -.025em; color: var(--text-main); }
.hub-page-sub { margin: 4px 0 0; color: var(--hub-secondary); font-size: 14px; max-width: 70ch; line-height: 1.6; }
.hub-automations-btn { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; flex-shrink: 0; }
.hub-page-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hub-page-head-actions .btn, .hub-modal .btn { font-size: 14px; min-height: 42px; border-radius: 9px; }
.hub-memory-btn { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; flex-shrink: 0; }

/* -- Automatisierungen-Modal -- */
.hub-modal { display: none; padding: 20px; box-sizing: border-box; }
.hub-modal.is-open { display: flex; }
.hub-schedules-modal-content { width: 100%; max-width: 600px; max-height: 88dvh; overflow-y: auto; padding: 24px 26px; }
.hub-modal-title { margin: 0 0 10px; font-size: 22px; color: var(--text-main); }
.hub-modal-hint { margin: 0 0 20px; font-size: 14px; color: var(--hub-secondary); line-height: 1.65; }
.hub-schedules-list { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow-y: auto; }
.hub-schedules-loading, .hub-schedules-empty { color: var(--hub-secondary); font-size: 14px; padding: 20px 0; text-align: center; }
.hub-schedule-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--input-bg); border: 1px solid var(--panel-border); }
.hub-schedule-icon { flex-shrink: 0; color: var(--hub-accent); display: flex; }
.hub-schedule-info { flex: 1; min-width: 0; }
.hub-schedule-title { font-size: 14px; font-weight: 600; color: var(--text-main); overflow-wrap: anywhere; }
.hub-schedule-owner { font-weight: 400; color: var(--hub-secondary); }
.hub-schedule-meta { font-size: 13px; color: var(--hub-secondary); margin-top: 4px; }
.hub-icon-btn-danger { flex-shrink: 0; width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--panel-border); background: transparent; color: var(--hub-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s ease; }
.hub-icon-btn-danger:hover { color: var(--hub-danger); border-color: var(--hub-danger); background: rgba(224,90,90,.1); }
.hub-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* -- Statistik-Modal (nur Admins) -- */
.hub-stats-btn { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; flex-shrink: 0; }
.hub-stats-modal-content { max-width: 760px; max-height: 86vh; padding: 24px 26px; overflow-y: auto; }
.hub-stats-section-title { margin: 18px 0 8px; font-size: 14px; color: var(--text-main); }
.hub-stats-section-title:first-of-type { margin-top: 4px; }
.hub-stats-table-wrap { overflow-x: auto; }
.hub-stats-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.hub-stats-table th, .hub-stats-table td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--panel-border); }
.hub-stats-table th { font-weight: 650; color: var(--hub-secondary); white-space: nowrap; }
.hub-stats-table td { color: var(--text-main); }
.hub-incidents-list { max-height: 40vh; }
.hub-incident-row { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 10px; background: var(--input-bg); border: 1px solid var(--panel-border); font-size: 14px; overflow-wrap: anywhere; }
.hub-incident-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hub-incident-user { font-weight: 600; color: var(--text-main); }
.hub-incident-time { color: var(--hub-secondary); font-size: 13px; margin-left: auto; }
.hub-incident-question, .hub-incident-answer { color: var(--text-main); line-height: 1.5; }
.hub-incident-detail { color: var(--hub-secondary); font-size: 13px; }
.hub-badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 650; }
.hub-badge-info, .hub-badge-other { color: var(--hub-secondary); background: var(--panel-bg); }
.hub-badge-permission, .hub-badge-failed { color: var(--hub-danger); background: var(--panel-bg); }

.hub-consent-gate {
    border: 1px solid var(--panel-border);
    background: var(--panel-bg);
    border-radius: 14px; padding: 20px 22px; max-width: 640px;
}
.hub-consent-gate p { margin: 0 0 20px; font-size: 15px; line-height: 1.7; color: var(--text-main); }
.hub-consent-btn { background: var(--brand-accent); border-color: var(--brand-accent); color: var(--btn-text); min-height: 44px; }
.hub-consent-btn:hover { background: color-mix(in srgb, var(--brand-accent) 88%, var(--text-main)); color: var(--btn-text); }
.hub-consent-btn:disabled { opacity: .6; cursor: not-allowed; filter: none; }

.hub-layout { position: relative; display: grid; grid-template-columns: 280px minmax(0, 1fr); flex: 1; min-height: 0; background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 16px; overflow: hidden; }

.hub-sidebar {
    display: flex; flex-direction: column; gap: 12px; padding: 18px 12px; min-height: 0; min-width: 0;
    background: color-mix(in srgb, var(--text-main) 3%, var(--panel-bg)); border-right: 1px solid var(--panel-border);
}
.hub-sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px; }
.hub-sidebar-head h2 { font-size: 16px; font-weight: 650; margin: 0; }
.hub-history-close, .hub-history-toggle { display: none; }
.hub-conv-search { width: 100%; box-sizing: border-box; border: 1px solid var(--panel-border); border-radius: 8px; padding: 10px 12px; min-height: 42px; background: var(--panel-bg); color: var(--text-main); font-size: 14px; }
.hub-conv-search::placeholder, .hub-input::placeholder { color: var(--hub-secondary); opacity: 1; }
.hub-new-chat-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 12px; border-radius: 10px;
    border: 1px solid var(--brand-accent); background: var(--brand-accent);
    color: var(--btn-text); font-size: 14px; min-height: 44px; font-weight: 600; cursor: pointer; flex-shrink: 0;
    transition: background .15s ease;
}
.hub-new-chat-btn:hover { background: color-mix(in srgb, var(--brand-accent) 88%, var(--text-main)); }
.hub-conv-list { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; min-height: 0; overscroll-behavior: contain; scrollbar-gutter: stable; }
.hub-conv-empty { color: var(--hub-secondary); font-size: 14px; padding: 10px 4px; }
.hub-conv-group { margin: 14px 8px 4px; font-size: 12px; font-weight: 650; color: var(--hub-secondary); }
.hub-conv-group:first-child { margin-top: 0; }
.hub-conv-item {
    position: relative; border-radius: 9px; color: var(--text-main); transition: background .15s ease;
}
.hub-conv-item:hover { background: var(--input-bg); }
.hub-conv-item.is-active { background: color-mix(in srgb, var(--brand-accent) 12%, var(--panel-bg)); }
.hub-conv-item-title { display: block; width: 100%; border: 0; background: transparent; color: inherit; cursor: pointer; text-align: left; padding: 12px 46px 12px 10px; border-radius: 9px; font-size: 14px; line-height: 1.45; }
.hub-conv-title-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.hub-conv-item.is-active .hub-conv-title-text { font-weight: 650; }
.hub-conv-item-meta { display: block; font-size: 12px; color: var(--hub-secondary); margin-top: 5px; }
.hub-conv-actions summary { position: absolute; right: 4px; top: 8px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 7px; color: var(--hub-secondary); list-style: none; }
.hub-conv-actions summary::-webkit-details-marker { display: none; }
.hub-conv-actions summary:hover, .hub-conv-actions[open] summary { background: var(--panel-bg); color: var(--text-main); }
.hub-conv-item-actions {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 0 8px 10px;
}
.hub-conv-item-action { border: 1px solid var(--panel-border); background: var(--panel-bg); color: var(--text-main); cursor: pointer; padding: 8px; border-radius: 6px; min-height: 38px; font-size: 13px; text-align: left; }
.hub-conv-item-action:hover { background: color-mix(in srgb, var(--text-main) 10%, transparent); color: var(--text-main); }
.hub-conv-item-action-danger:hover { color: var(--hub-danger); background: rgba(224,90,90,.1); }
.hub-conv-item-rename-input {
    width: calc(100% - 48px); box-sizing: border-box; margin: 10px 4px; min-width: 0; font-size: 14px; font-family: inherit; color: var(--text-main); background: var(--panel-bg);
    border: 1px solid var(--hub-accent); border-radius: 6px; padding: 8px 6px;
}
.hub-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.hub-chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--panel-border); flex-shrink: 0; }
.hub-chat-heading { flex: 1; min-width: 0; }
.hub-chat-heading h2 { margin: 0; font-size: 15px; font-weight: 650; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hub-chat-heading p { margin: 3px 0 0; font-size: 12px; color: var(--hub-secondary); }
.hub-chat-share { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 10px; color: var(--hub-secondary); background: transparent; border: 1px solid var(--panel-border); border-radius: 8px; cursor: pointer; font-size: 13px; }
.hub-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 20px; padding: 24px 32px; min-height: 0; overscroll-behavior: contain; scrollbar-gutter: stable; }
.hub-empty-state { margin: auto; padding: 20px 0; text-align: center; color: var(--hub-secondary); max-width: 560px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.hub-empty-state svg { color: var(--hub-accent); flex-shrink: 0; }
.hub-empty-state h3 { margin: 0; font-size: 26px; letter-spacing: -.025em; font-weight: 650; color: var(--text-main); }
.hub-empty-state p { margin: 0; font-size: 15px; line-height: 1.7; max-width: 50ch; }
.hub-suggestions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.hub-suggestions button { min-height: 42px; padding: 10px 12px; border: 1px solid var(--panel-border); border-radius: 8px; color: var(--text-main); background: var(--panel-bg); cursor: pointer; font-size: 14px; }
.hub-suggestions button:hover { border-color: var(--hub-accent); background: color-mix(in srgb, var(--hub-accent) 6%, var(--panel-bg)); }
.hub-empty-state .hub-example-hint { font-size: 12px; }

.hub-msg { max-width: min(100%, 74ch); min-width: 0; box-sizing: border-box; padding: 8px 0; font-size: 15px; line-height: 1.75; overflow-wrap: anywhere; }
.hub-msg p { margin: 0 0 8px; }
.hub-msg p:last-child { margin-bottom: 0; }
.hub-msg ul { margin: 0 0 8px 18px; padding: 0; }
.hub-msg h3, .hub-msg h4, .hub-msg h5, .hub-msg h6 { margin: 10px 0 6px; font-size: 1em; font-weight: 700; color: inherit; }
.hub-msg h3:first-child, .hub-msg h4:first-child, .hub-msg h5:first-child, .hub-msg h6:first-child { margin-top: 0; }
.hub-table-scroll { max-width: 100%; overflow-x: auto; margin: 12px 0; }
.hub-msg table { border-collapse: collapse; margin: 0; font-size: 14px; width: 100%; }
.hub-msg th, .hub-msg td { border: 1px solid color-mix(in srgb, currentColor 20%, transparent); padding: 5px 10px; text-align: left; }
.hub-msg th { font-weight: 700; background: color-mix(in srgb, currentColor 6%, transparent); }
.hub-msg a.hub-contact-link { color: inherit; text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.hub-msg a.hub-contact-link:hover { text-decoration-thickness: 2px; }
.hub-msg-sender { font-size: 13px; font-weight: 650; color: var(--hub-secondary); margin-bottom: 6px; }
.hub-msg-user { align-self: flex-end; max-width: min(86%, 70ch); padding: 12px 16px; border-radius: 14px 14px 4px 14px; background: color-mix(in srgb, var(--brand-accent) 8%, var(--panel-bg)); color: var(--text-main); border: 1px solid var(--panel-border); }
.hub-msg-assistant { align-self: flex-start; width: 100%; color: var(--text-main); }
.hub-msg-error { color: var(--hub-danger); font-size: 13px; }
.hub-retry { font: inherit; background: none; color: inherit; border: 0; text-decoration: underline; cursor: pointer; }

/* -- Teilen-Modal ("Gruppen-Chat mit Hubert", Phase 9) -- */
.hub-share-current { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.hub-share-members-label { font-size: 14px; font-weight: 650; color: var(--hub-secondary); margin-right: 2px; }
.hub-share-member-chip { font-size: 13px; padding: 5px 10px; border-radius: 20px; background: var(--input-bg); color: var(--text-main); }
.hub-share-search {
    width: 100%; box-sizing: border-box; padding: 11px 12px; margin-bottom: 10px; font-size: 15px; font-family: inherit;
    color: var(--text-main); background: var(--input-bg); border: 1px solid var(--panel-border); border-radius: 9px;
}
.hub-share-search:focus { border-color: var(--hub-accent); }
.hub-share-add-btn { flex-shrink: 0; padding: 8px 12px; font-size: 14px; }


.hub-typing { display: flex; align-items: center; gap: 10px; padding: 8px 24px; flex-shrink: 0; font-size: 13px; color: var(--hub-secondary); }
.hub-typing-dots { display: flex; gap: 4px; }
.hub-typing-dots span { width: 5px; height: 5px; border-radius: 50%; background: var(--hub-accent); opacity: .4; animation: hub-typing-bounce 1.1s infinite ease-in-out; }
.hub-typing-dots span:nth-child(2) { animation-delay: .15s; }
.hub-typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes hub-typing-bounce { 0%, 60%, 100% { opacity: .4; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }

.hub-input-row { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; border-top: 1px solid var(--panel-border); padding: 12px 24px; }
.hub-composer-main { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 40px 36px 44px; gap: 8px; align-items: end; min-width: 0; }
.hub-input {
    box-sizing: border-box; width: 100%; field-sizing: content; resize: vertical; max-height: 160px; min-height: 44px; padding: 10px 12px; border-radius: 10px;
    border: 1px solid var(--panel-border); background: var(--panel-bg); color: var(--text-main); font-size: 15px;
    font-family: inherit; line-height: 1.5;
}
.hub-input:focus { border-color: var(--hub-accent); }
.hub-input-hint { margin: 0; color: var(--hub-secondary); font-size: 11.5px; line-height: 1.45; }
.hub-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.hub-attachment-trigger {
    position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 44px; box-sizing: border-box;
    border: 1px solid var(--panel-border); border-radius: 8px; background: var(--panel-bg); color: var(--text-main);
    cursor: pointer;
}
.hub-attachment-trigger:hover { border-color: var(--hub-accent); color: var(--hub-accent); }
.hub-attachment-trigger:focus-within { outline: 3px solid color-mix(in srgb, var(--hub-accent) 45%, transparent); outline-offset: 2px; }
.hub-file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.hub-attachment-info { position: relative; align-self: end; }
.hub-attachment-info summary {
    display: flex; align-items: center; justify-content: center; width: 36px; height: 44px; box-sizing: border-box;
    border: 1px solid var(--panel-border); border-radius: 8px; background: var(--panel-bg); color: var(--hub-secondary);
    cursor: pointer; list-style: none;
}
.hub-attachment-info summary::-webkit-details-marker { display: none; }
.hub-attachment-info summary:hover, .hub-attachment-info[open] summary { border-color: var(--hub-accent); color: var(--hub-accent); }
.hub-attachment-info-panel {
    position: absolute; right: -52px; bottom: calc(100% + 10px); z-index: 20; width: min(340px, calc(100vw - 32px));
    box-sizing: border-box; padding: 12px 14px; border: 1px solid var(--panel-border); border-radius: 10px;
    background: var(--panel-bg); color: var(--text-main); box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
    font-size: 12.5px; line-height: 1.55;
}
.hub-attachment-info-panel p { margin: 0 0 8px; }
.hub-attachment-info-panel p:last-child { margin-bottom: 0; }
.hub-attachment-draft-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.hub-attachment-draft-item {
    display: flex; align-items: center; gap: 8px; max-width: 100%; min-width: 0; padding: 5px 8px;
    border: 1px solid var(--panel-border); border-radius: 8px; background: color-mix(in srgb, var(--hub-accent) 7%, var(--panel-bg));
}
.hub-attachment-draft-name { min-width: 0; color: var(--text-main); font-size: 12px; overflow-wrap: anywhere; }
.hub-attachment-remove { flex-shrink: 0; padding: 4px 6px; border: 0; border-radius: 5px; background: transparent; color: var(--hub-secondary); cursor: pointer; font-size: 11px; text-decoration: underline; text-underline-offset: 2px; }
.hub-attachment-remove:hover { color: var(--hub-danger); }
.hub-message-attachments { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; padding: 0; list-style: none; }
.hub-message-attachments li { max-width: 100%; }
.hub-attachment-link, .hub-attachment-pending {
    display: inline-flex; max-width: 100%; padding: 5px 9px; border: 1px solid var(--panel-border); border-radius: 7px;
    color: var(--text-main); background: color-mix(in srgb, var(--hub-accent) 7%, var(--panel-bg)); font-size: 12px;
    line-height: 1.45; overflow-wrap: anywhere;
}
.hub-attachment-link { text-decoration: underline; text-underline-offset: 2px; }
.hub-attachment-pending { color: var(--hub-secondary); }
.hub-attachment-link:hover, .hub-attachment-link:focus-visible { border-color: var(--hub-accent); color: var(--hub-accent); }
.hub-send-btn {
    width: 44px; height: 44px; border-radius: 10px; border: none; background: var(--brand-accent);
    color: var(--btn-text); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: filter .15s ease;
}
.hub-send-btn:hover { background: color-mix(in srgb, var(--brand-accent) 88%, var(--text-main)); }
.hub-send-btn:disabled { opacity: .5; cursor: not-allowed; }
.hub-shell button:disabled { cursor: not-allowed; opacity: .55; }

@media (max-width: 960px) {
    .hub-layout { grid-template-columns: minmax(0, 1fr); }
    .hub-sidebar { position: absolute; inset: 0; z-index: 2; background: var(--panel-bg); border: 0; visibility: hidden; opacity: 0; transform: translateX(-16px); transition: visibility .2s, opacity .2s ease-out, transform .2s cubic-bezier(.16,1,.3,1); }
    .hub-history-open .hub-sidebar { visibility: visible; opacity: 1; transform: translateX(0); }
    .hub-history-close, .hub-history-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 40px; min-height: 40px; padding: 8px; background: transparent; color: var(--text-main); border: 1px solid var(--panel-border); border-radius: 8px; font-size: 13px; cursor: pointer; }
    .hub-conv-list { flex: 1; }
}
@media (max-width: 760px) {
    .hub-shell { height: calc(100dvh - 160px); min-height: 400px; }
    .hub-page-head { padding-right: 0; margin-bottom: 12px; gap: 8px; }
    .hub-page-title { font-size: 24px; }
    .hub-page-sub { display: none; }
    .hub-page-head-actions { gap: 6px; }
    .hub-page-head-actions .btn { padding: 8px; font-size: 13px; }
    .hub-chat-head { padding: 12px; gap: 8px; }
    .hub-chat-share { font-size: 0; gap: 0; }
    .hub-log { padding: 18px 16px; }
    .hub-input-row { padding: 12px; }
    .hub-composer-main { grid-template-columns: minmax(0, 1fr) 40px 36px 44px; gap: 6px; }
    .hub-empty-state h3 { font-size: 22px; }
    .hub-modal { padding: 12px; }
    .hub-schedules-modal-content, .hub-stats-modal-content { padding: 20px 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .hub-sidebar, .hub-conv-item, .hub-new-chat-btn { transition: none; }
    .hub-typing-dots span { animation: none; }
}

/* =========================================
   Lead-Controlling: Regeln & Schwellwerte (Achtung/Warnung/Lead-Pool, Tage-ODER-Stunden-Einheit)
   und neuer Tab "Lead-Pool" (Leads ohne zugeordneten Fachberater, siehe modules/lead_controlling.php
   lcPool*-Funktionen und api_lead.php get_pool_leads/pool_claim_lead/pool_assign_lead). Zentral hier
   statt im modul-eigenen <style>-Block, da alle NEU generierten Klassen laut Vorgabe zwingend in die
   zentrale style.css gehören (keine Inline-Styles) – das Modul selbst pflegt seinen Bestandscode
   weiterhin in seinem eigenen <style>-Block, siehe dortigen Kommentar-Header.
   ========================================= */

/* ── Regeln & Schwellwerte: Wert + Einheit (Tage/Stunden) nebeneinander im Regel-Editor ── */
.lc-rules-value-unit { display: flex; gap: 6px; align-items: center; }
.lc-rules-value-unit .lc-input { flex: 1 1 auto; min-width: 0; width: auto; }
.lc-rules-value-unit .lc-select { flex: 0 0 92px; width: 92px; }
.lc-dwell-pool { color: #1f8a70; border-color: rgba(31, 138, 112, .35); background: rgba(31, 138, 112, .1); }
.lc-notify-chip.pool { background: rgba(31, 138, 112, .14); color: #1f8a70; border: 1px solid rgba(31, 138, 112, .32); }

/* ── Gesprächsprotokoll: Platzhalter für fremde (nicht eigene) E-Mail-Einträge ── */
.lc-conv-item.lc-conv-restricted { opacity: .82; }
.lc-conv-email-locked {
    display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted);
    font-style: italic; margin-top: 2px;
}

/* ── Tab "Lead-Pool": Toolbar ── */
.lc-pool-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.lc-pool-search-wrap { position: relative; flex: 1 1 240px; min-width: 200px; display: flex; align-items: center; }
.lc-pool-search-wrap svg { position: absolute; left: 11px; color: var(--text-muted); pointer-events: none; }
.lc-pool-search-input { padding-left: 32px !important; }
.lc-pool-sort-select { flex: 0 0 200px; width: 200px; }
.lc-pool-count { margin-left: auto; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.lc-pool-tab-badge {
    display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px;
    padding: 0 4px; border-radius: 999px; background: var(--accent-gold); color: #fff; font-size: 9.5px;
    font-weight: 700; line-height: 1;
}

/* ── Tab "Lead-Pool": Layout (Liste links, Karte rechts – analog .lc-map-wrap der PLZ-Karte) ── */
.lc-pool-body {
    display: grid; grid-template-columns: 380px 1fr; gap: 18px; align-items: stretch;
    --lc-pool-view-h: clamp(480px, calc(100dvh - 320px), 1100px);
}
.lc-pool-list-wrap {
    background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 12px;
    height: var(--lc-pool-view-h); overflow-y: auto; box-sizing: border-box;
}
.lc-pool-list { display: flex; flex-direction: column; gap: 1px; padding: 6px; }
.lc-pool-empty { padding: 30px 16px; text-align: center; color: var(--text-muted); font-size: 12.5px; }
.lc-pool-row {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
    padding: 10px 11px; border-radius: 9px; cursor: pointer; transition: background .12s;
}
.lc-pool-row:hover { background: rgba(255, 255, 255, .04); }
.lc-pool-row-geocoding { opacity: .55; cursor: progress; pointer-events: none; }
.lc-pool-row-main { min-width: 0; flex: 1 1 auto; }
.lc-pool-row-name { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-main); }
.lc-pool-stage-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.lc-pool-row-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; font-size: 11px; color: var(--text-muted); }
.lc-pool-distance, .lc-pool-budget { font-weight: 600; color: var(--text-main); }
.lc-pool-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.lc-pool-wait-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.lc-pool-wait-low  { color: #669d24; background: rgba(102, 157, 36, .12); }
.lc-pool-wait-mid  { color: #b97d00; background: rgba(185, 125, 0, .12); }
.lc-pool-wait-high { color: #c62828; background: rgba(198, 40, 40, .12); }
.lc-pool-row-actions { display: flex; align-items: center; gap: 5px; }
.lc-pool-claim-btn, .lc-pool-assign-btn { padding: 4px 10px !important; font-size: 11px !important; }

/* ── Tab "Lead-Pool": Karte (Leaflet) ── */
.lc-pool-map-wrap { position: relative; }
.lc-pool-map-canvas {
    background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 12px;
    overflow: hidden; position: relative; height: var(--lc-pool-view-h);
}
#lc-pool-map-leaflet { width: 100%; height: 100%; border-radius: 12px; }
.lc-pool-map-hint {
    position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 750;
    background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 10px;
    padding: 8px 12px; font-size: 11.5px; color: var(--text-muted); box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.lc-pool-map-hint button {
    background: none; border: none; color: var(--accent-gold); cursor: pointer; font-size: 11.5px;
    font-weight: 600; padding: 0; text-decoration: underline;
}
.lc-pool-marker-icon span {
    display: block; width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .9); box-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}
.lc-pool-own-marker-icon span {
    display: block; width: 16px; height: 16px; border-radius: 50%; background: #5b9bd5;
    border: 3px solid #fff; box-shadow: 0 0 0 4px rgba(91, 155, 213, .3), 0 1px 4px rgba(0, 0, 0, .5);
}
.lc-pool-popup { font-size: 12.5px; min-width: 160px; }
.lc-pool-popup-stage { color: var(--text-muted); font-size: 11px; margin-top: 2px; }
.lc-pool-popup-dist { color: var(--text-muted); font-size: 11px; margin-top: 4px; }
.lc-pool-popup-claim { margin-top: 8px; width: 100%; justify-content: center; padding: 5px 10px !important; font-size: 11.5px !important; }
.lc-pool-popup-details { margin-top: 6px; width: 100%; justify-content: center; padding: 5px 10px !important; font-size: 11.5px !important; }

/* ── Modal "Fachberater zuweisen" ── */
.lc-pool-assign-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }

/* ── Modal "Lead-Details" (reine Lese-Ansicht eines Pool-Leads für Fachberater, siehe
   lcPoolOpenDetailModal()) – bewusst ohne Formularfelder, da vor der Übernahme nichts bearbeitbar
   sein darf. */
.lc-pool-detail-box { width: min(96vw, 480px); }
.lc-pool-detail-statusbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--panel-border); }
.lc-pool-detail-stage { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text-main); }
.lc-pool-detail-section-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin: 16px 0 6px; }
.lc-pool-detail-section-title:first-of-type { margin-top: 0; }
.lc-pool-detail-row { display: flex; gap: 10px; padding: 5px 0; border-bottom: 1px solid rgba(255, 255, 255, .04); font-size: 13px; }
.lc-pool-detail-label { flex: 0 0 150px; color: var(--text-muted); }
.lc-pool-detail-value { flex: 1 1 auto; color: var(--text-main); word-break: break-word; }
.lc-pool-detail-value a { color: inherit; }
.lc-pool-detail-notes { font-size: 13px; color: var(--text-main); white-space: pre-wrap; background: rgba(255, 255, 255, .04); border-radius: 8px; padding: 10px 12px; }
.lc-pool-detail-conv-empty { font-size: 12.5px; color: var(--text-muted); padding: 4px 0; }
.lc-pool-detail-conv-list { display: flex; flex-direction: column; gap: 8px; }
.lc-pool-detail-conv-item { background: rgba(255, 255, 255, .04); border-radius: 8px; padding: 9px 12px; }
.lc-pool-detail-conv-head { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted); }
.lc-pool-detail-conv-icon { display: inline-flex; color: var(--text-muted); }
.lc-pool-detail-conv-type { font-weight: 600; color: var(--text-main); }
.lc-pool-detail-conv-date { margin-left: auto; white-space: nowrap; }
.lc-pool-detail-conv-note { margin-top: 5px; font-size: 13px; color: var(--text-main); white-space: pre-wrap; }
/* Primäraktion "Lead übernehmen" bewusst groß/auffällig statt gleichberechtigt neben "Schließen" –
   siehe Kommentar in lcPoolOpenDetailModal() (Lesbarkeits-/Auffindbarkeits-Fix). */
#lc-pool-detail-foot { justify-content: space-between; }
.lc-pool-detail-claim-btn { padding: 10px 24px !important; font-size: 13.5px !important; font-weight: 700 !important; box-shadow: 0 4px 14px rgba(102, 157, 36, .35); }

@media (max-width: 900px) {
    .lc-pool-body { grid-template-columns: 1fr; }
    .lc-pool-list-wrap, .lc-pool-map-canvas { height: clamp(320px, 60dvh, 640px); }
}
.ckpt-ai-bubble {
    max-width: 88%; padding: 10px 14px; border-radius: 14px; font-size: 13px;
    line-height: 1.5; color: var(--text-main); word-break: break-word;
}
.ckpt-ai-bubble-user {
    align-self: flex-end; background: var(--brand-accent); color: var(--btn-text);
    border-bottom-right-radius: 4px;
}
.ckpt-ai-bubble-assistant {
    align-self: flex-start; background: var(--panel-bg, var(--input-bg));
    border: 1px solid var(--panel-border); border-bottom-left-radius: 4px;
}
.ckpt-ai-typing { color: var(--text-muted); font-style: italic; }
.ckpt-ai-error { color: var(--danger-red); }
.ckpt-ai-followup {
    margin-top: 10px; padding: 10px 12px; border-radius: 10px; font-weight: 700; color: var(--ai-purple);
    background: color-mix(in srgb, var(--ai-purple) 6%, transparent);
    border: 1px solid color-mix(in srgb, var(--ai-purple) 28%, transparent);
}
.ckpt-ai-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ckpt-ai-chip {
    font-family: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer;
    background: color-mix(in srgb, var(--ai-purple) 10%, transparent); color: var(--ai-purple);
    border: 1px solid var(--ai-purple); border-radius: 999px; padding: 5px 12px; transition: .15s;
}
.ckpt-ai-chip:hover, .ckpt-ai-chip.is-active { background: var(--ai-purple); color: #fff; }
.ckpt-ai-chat-input-row { display: flex; gap: 8px; }
.ckpt-ai-chat-input-row .ckpt-input { flex: 1; }
.ckpt-ai-chat-input-row .ckpt-input:focus { border-color: var(--ai-purple); }
#ckpt-ai-chat-send { background: var(--ai-purple); border-color: var(--ai-purple); color: #fff; }
#ckpt-ai-chat-send:hover { filter: brightness(1.1); color: #fff; }
.ckpt-ai-chat-reset {
    align-self: flex-start; font-family: inherit; font-size: 11.5px; font-weight: 600;
    background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 2px 0;
    text-decoration: underline; text-underline-offset: 2px;
}
.ckpt-ai-chat-reset:hover { color: var(--ai-purple); }
.ckpt-ai-save-row { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.ckpt-ai-apply-btn { width: 100%; justify-content: center; background: var(--ai-purple); border-color: var(--ai-purple); color: #fff; }
.ckpt-ai-apply-btn:hover { filter: brightness(1.1); color: #fff; }
.ckpt-ai-apply-btn:disabled { opacity: .6; cursor: not-allowed; filter: none; }

/* ── Profil-Avatare (Freigabe-Dialog, "Für mich freigegeben") - Profilfoto (hbb_users.avatar_path)
   falls hinterlegt, sonst farbige Initialen; gleiches Prinzip wie .ipr-avatar in ipr_projects.php. ── */
.ckpt-avatar {
    position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 28px; height: 28px; border-radius: 50%; font-size: 10.5px; font-weight: 700; color: #fff;
    border: 2px solid var(--panel-bg); box-shadow: 0 1px 4px rgba(0,0,0,.25); background-size: cover; background-position: center;
}
.ckpt-avatar-sm { width: 18px; height: 18px; font-size: 8px; border-width: 1px; vertical-align: middle; }
.ckpt-avatar-stacked { margin-left: -9px; border-width: 2px; }
.ckpt-avatar-stacked:first-child { margin-left: 0; }
.ckpt-avatar-more, .ckpt-avatar-all { background: var(--bg-dark) !important; color: var(--text-muted); }

.ckpt-share-user-row {
    display: flex; align-items: center; gap: 10px; padding: 7px 4px; cursor: pointer; border-radius: 6px; transition: .12s;
}
.ckpt-share-user-row:hover { background: rgba(255,255,255,.04); }
.ckpt-share-user-info { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; }
.ckpt-share-user-name { font-size: 12.5px; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ckpt-share-user-email { font-size: 10.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ckpt-share-user-row input[type="checkbox"] { flex: 0 0 auto; width: 15px; height: 15px; margin: 0; accent-color: var(--brand-accent); cursor: pointer; }

.ckpt-filter-values, .ckpt-share-user-list { max-height: 220px; overflow-y: auto; border: 1px solid var(--panel-border); border-radius: 8px; padding: 8px 10px; }
.ckpt-checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 3px 0; cursor: pointer; }
.ckpt-checkbox-row input[type="checkbox"] { flex: 0 0 auto; width: 15px; height: 15px; margin: 0; accent-color: var(--brand-accent); cursor: pointer; }
.ckpt-filter-values-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 2px 8px; font-size: 11.5px; color: var(--text-muted); }
.ckpt-filter-values-actions { display: flex; gap: 10px; flex-shrink: 0; }
.ckpt-link-btn { background: none; border: none; padding: 0; color: var(--brand-accent); font-size: 11.5px; font-weight: 600; cursor: pointer; text-decoration: underline; }
.ckpt-link-btn:hover { opacity: .8; }
.ckpt-filter-search { width: 100%; box-sizing: border-box; background: var(--bg-dark); border: 1px solid var(--panel-border); color: var(--text-main); border-radius: 6px; padding: 6px 9px; font-size: 12px; margin-bottom: 8px; }
.ckpt-filter-search:focus { border-color: var(--brand-accent); outline: none; }
.ckpt-filter-values-list { display: flex; flex-direction: column; }

/* ── Eigenes durchsuchbares Dropdown (ersetzt die Browser-Default-Optik von <select>) ───────── */
.ckpt-dd { position: relative; }
.ckpt-dd-native { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.ckpt-dd-trigger {
    width: 100%; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; gap: 8px;
    background: var(--input-bg); border: 1px solid var(--panel-border); color: var(--text-main);
    border-radius: 8px; padding: 9px 11px; font-size: 13px; cursor: pointer; text-align: left; font-family: inherit;
}
.ckpt-dd-trigger:hover { border-color: var(--brand-accent); }
.ckpt-dd-trigger.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.ckpt-dd-trigger-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ckpt-dd-chevron { flex-shrink: 0; color: var(--text-muted); transition: transform .15s; }
.ckpt-dd-panel {
    display: none; position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; right: 0;
    border-radius: 10px; padding: 8px; max-height: 280px; overflow: hidden;
    flex-direction: column;
}
.ckpt-dd-panel.is-open { display: flex; }
.ckpt-dd-search { width: 100%; box-sizing: border-box; background: var(--bg-dark); border: 1px solid var(--panel-border); color: var(--text-main); border-radius: 6px; padding: 7px 9px; font-size: 12.5px; margin-bottom: 6px; flex-shrink: 0; }
.ckpt-dd-search:focus { border-color: var(--brand-accent); outline: none; }
.ckpt-dd-list { overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.ckpt-dd-item { background: none; border: none; text-align: left; color: var(--text-main); font-size: 13px; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-family: inherit; }
.ckpt-dd-item:hover { background: rgba(255,255,255,.06); }
.ckpt-dd-item.is-selected { background: color-mix(in srgb, var(--brand-accent) 18%, transparent); color: var(--brand-accent); font-weight: 600; }
/* Fest angehefteter Listeneintrag (z. B. "+ Neues Dashboard", siehe data-dd-action-value) - optisch
   als eigene Aktion abgesetzt statt als gewöhnlicher Auswahl-Eintrag. */
.ckpt-dd-item-action { margin-top: 4px; padding-top: 9px; border-top: 1px solid var(--panel-border); border-radius: 6px; color: var(--brand-accent); font-weight: 600; flex-shrink: 0; }
.ckpt-dd-item-action:hover { background: color-mix(in srgb, var(--brand-accent) 10%, transparent); }

/* ── Segmentierter Button-Switch (z. B. "Fester Zeitraum" / "Gemeinsamer Zeitraum") ─────────── */
.ckpt-switch { display: inline-flex; border: 1px solid var(--panel-border); border-radius: 8px; overflow: hidden; }
.ckpt-switch-btn {
    background: var(--input-bg); border: none; color: var(--text-muted); font-size: 12.5px; font-weight: 600;
    padding: 9px 14px; cursor: pointer; transition: .15s; font-family: inherit; border-right: 1px solid var(--panel-border);
}
.ckpt-switch-btn:last-child { border-right: none; }
.ckpt-switch-btn:hover { color: var(--text-main); }
.ckpt-switch-btn.is-active { background: var(--brand-accent); color: var(--btn-text); }

.ckpt-time-fixed-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.ckpt-time-mode-row { display: flex; gap: 18px; flex-wrap: wrap; }
.ckpt-radio { display: flex; align-items: center; gap: 6px; font-size: 12.5px; cursor: pointer; }
.ckpt-radio input[type="radio"] { flex: 0 0 auto; width: 15px; height: 15px; margin: 0; accent-color: var(--brand-accent); cursor: pointer; }

.ckpt-preview-wrap { margin-top: 16px; }
.ckpt-preview-box { min-height: 160px; border: 1px dashed var(--panel-border); border-radius: 8px; padding: 10px; position: relative; }

.ckpt-divider { border: none; border-top: 1px solid var(--panel-border); margin: 14px 0; }
.ckpt-existing-shares { display: flex; flex-direction: column; gap: 6px; }
.ckpt-share-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; padding: 7px 10px; background: rgba(255,255,255,.03); border-radius: 8px; }
.ckpt-share-row-who { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; }
.ckpt-share-row-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-main); }
.ckpt-share-row-badge { flex-shrink: 0; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); background: rgba(255,255,255,.06); padding: 3px 8px; border-radius: 999px; }
.ckpt-share-row-badge.is-edit { color: var(--brand-accent); background: color-mix(in srgb, var(--brand-accent) 16%, transparent); }

@media (max-width: 760px) {
    .ckpt-head { flex-direction: column; align-items: stretch; }
    .ckpt-dash-switcher .ckpt-dd { width: 100%; }
    .ckpt-toolbar-actions { justify-content: flex-start; }
    .ckpt-time-popover { min-width: 260px; }
    .ckpt-type-cards { grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); }
}

.as-genesis-card { margin-top: 16px; }
.as-genesis-description,
.as-genesis-footnote { color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.as-genesis-description { margin: 0 0 14px; }
.as-genesis-footnote { margin: 12px 0 0; }
.as-genesis-fields { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) minmax(170px, .7fr) minmax(200px, .9fr); gap: 12px; }
.as-genesis-field { min-width: 0; }
.as-genesis-input { width: 100%; box-sizing: border-box; }
.as-genesis-year { max-width: 220px; }
.as-genesis-saved { color: var(--accent-gold); font-weight: 400; text-transform: none; }
.as-genesis-clear-pass { display: flex; align-items: center; gap: 6px; margin-top: 7px; color: var(--text-muted); font-size: 11px; }
.as-genesis-autosync-field { display: flex; align-items: flex-end; }
.as-genesis-checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-main); cursor: pointer; padding-bottom: 1px; }
.as-genesis-checkbox-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand-accent, var(--accent-gold)); cursor: pointer; }
.as-genesis-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.as-genesis-sync-btn { background: var(--brand-accent, var(--accent-gold)); }
.as-genesis-status { color: var(--text-muted); font-size: 12px; }
.as-genesis-status.is-success { color: var(--success-green, #4caf50); }
.as-genesis-status.is-error { color: var(--danger-red, #e05050); }
.as-genesis-status.is-pending { color: var(--text-muted); }
.as-genesis-actions button:disabled { opacity: .6; cursor: wait; }
.as-genesis-progress-wrap { margin-top: 12px; }
.as-genesis-progress-track { height: 8px; border-radius: 999px; background: var(--panel-border); overflow: hidden; }
.as-genesis-progress-bar { height: 100%; width: 0%; background: var(--brand-accent, var(--accent-gold)); transition: width 0.4s ease; }
.as-genesis-progress-label { margin: 6px 0 0; font-size: 11.5px; color: var(--text-muted); }
.as-genesis-divider { border: none; border-top: 1px solid var(--panel-border); margin: 18px 0; }
.as-genesis-test-title { margin-bottom: 8px; }
.as-genesis-copy-btn { background: transparent; border: 1px solid var(--panel-border); color: var(--text-main); border-radius: 8px; padding: 9px 16px; font-size: 13px; cursor: pointer; transition: .15s; }
.as-genesis-copy-btn:hover { border-color: var(--accent-gold); color: var(--accent-gold); }
.as-genesis-raw-summary { color: var(--text-muted); font-size: 12px; margin: 10px 0 6px; }
.as-genesis-raw-summary.is-success { color: var(--success-green, #4caf50); }
.as-genesis-raw-summary.is-error { color: var(--danger-red, #e05050); }
.as-genesis-raw-output { width: 100%; box-sizing: border-box; background: var(--bg-dark); border: 1px solid var(--panel-border); border-radius: 8px; color: var(--text-main); font-family: monospace; font-size: 11.5px; line-height: 1.5; padding: 10px; resize: vertical; white-space: pre; }

.lc-map-bau-tooltip-title { display: block; font-size: 12px; }
.lc-map-bau-tooltip-value,
.lc-map-bau-tooltip-year,
.lc-map-bau-tooltip-empty { display: block; font-size: 11px; }
.lc-map-bau-tooltip-year,
.lc-map-bau-tooltip-empty { color: var(--text-muted); }

@media (max-width: 760px) {
    .as-genesis-fields { grid-template-columns: 1fr; }
    .as-genesis-year { max-width: none; }
    .as-genesis-actions button { width: 100%; }
    .as-perm-toolbar { align-items: stretch; flex-direction: column; }
    .as-perm-search-field { max-width: none; }
    .as-perm-toolbar-actions { justify-content: space-between; }
    .as-perm-type-row { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 12px; }
    .as-perm-type-actions { justify-content: flex-start; }
    .as-perm-type-actions .as-action-btn { flex: 1; }
    .as-department-manager { padding: 14px; }
    .as-dept-header { flex-direction: column; }
    .as-dept-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .as-dept-module-panel { padding: 16px 0 0; border-top: 1px solid var(--panel-border); border-left: 0; }
    .as-dept-module-list { grid-template-columns: minmax(0, 1fr); max-height: 240px; }
    .au-department-check-list { grid-template-columns: minmax(0, 1fr); max-height: 220px; }
    .as-pgm-dialog.as-modal-box { width: min(96vw, 820px); max-height: 94vh; }
    .as-pgm-modal .as-modal-head,
    .as-pgm-modal .as-modal-body,
    .as-pgm-modal .as-modal-foot { padding-right: 12px; padding-left: 12px; }
    .as-pgm-toolbar { grid-template-columns: minmax(0, 1fr); }
    .as-pgm-search-field,
    .as-pgm-view,
    .as-pgm-status { grid-column: 1; }
    .as-pgm-view { justify-self: start; }
    .as-pgm-module-head { flex-wrap: wrap; gap: 2px 8px; }
    .as-pgm-module-toggle { flex-basis: 100%; }
    .as-pgm-bulk-actions { padding: 0 8px 4px 25px; }
    .as-pgm-colhead,
    .as-pgm-cap-row { grid-template-columns: minmax(0, 1fr) 46px 56px; gap: 6px; }
    .as-pgm-cap-row { padding-right: 4px; padding-left: 4px; }
}

@media (prefers-reduced-motion: reduce) {
    .as-pgm-chevron,
    .as-pgm-bulk-btn,
    .as-pgm-view-btn { transition: none; }
}

/* ══════════════════════════════════════════════════════════════════════════════════════════
   Listen-Tab (zentrale Einstellungen): Icon-Picker + Freitextfeld je Eintrag (Nutzerwunsch:
   Kalkulations-Aufgabenkategorien mit Piktogramm, Ablehnungsgründe mit Vorschlagstext – beide
   über dieselbe generische Listenverwaltung, siehe admin_settings.php asRenderHausartTypes()).
   ══════════════════════════════════════════════════════════════════════════════════════════ */
.as-lookup-item { display: flex; flex-direction: column; gap: 6px; }
.as-icon-pick-wrap { position: relative; flex-shrink: 0; }
.as-icon-pick-btn { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; background: var(--bg-dark); border: 1px solid var(--panel-border); border-radius: 7px; color: var(--accent-gold, var(--brand-accent)); cursor: pointer; transition: .15s; flex-shrink: 0; }
.as-icon-pick-btn:hover { border-color: var(--accent-gold, var(--brand-accent)); }
.as-icon-picker-pop { display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; grid-template-columns: repeat(6, 28px); gap: 4px; background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 10px; padding: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.as-icon-picker-pop.is-open { display: grid; }
.as-icon-pick-opt { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; background: none; border: 1px solid transparent; border-radius: 6px; color: var(--text-muted); cursor: pointer; transition: .12s; }
.as-icon-pick-opt:hover { color: var(--text-main); border-color: var(--panel-border); }
.as-icon-pick-opt.is-selected { color: var(--accent-gold, var(--brand-accent)); border-color: var(--accent-gold, var(--brand-accent)); background: rgba(102,157,36,.1); }
.as-lookup-extra-input { width: 100%; box-sizing: border-box; background: var(--input-bg, transparent); border: 1px solid var(--panel-border); border-radius: 8px; color: var(--text-main); font-size: 12.5px; font-family: inherit; padding: 7px 10px; outline: none; resize: vertical; }
.as-lookup-extra-input:focus { border-color: var(--accent-gold, var(--brand-accent)); }

/* ══════════════════════════════════════════════════════════════════════════════════════════
   Kalkulation: Kategorie eigener Aufgaben (Piktogramm + Bezeichnung) – Auswahl im Formular,
   Badge in Tabelle/Detail-Modal. Eigener, kompakter Dropdown statt natives <select>, damit das
   Piktogramm auch im geschlossenen Zustand sichtbar bleibt (Nutzerwunsch: "elegante
   SVG-Piktogramme statt Emoticons").
   ══════════════════════════════════════════════════════════════════════════════════════════ */
.kalk-cat-badge { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--panel-border); border-radius: 999px; padding: 2px 9px 2px 6px; font-size: 11px; color: var(--text-main); background: var(--bg-dark); white-space: nowrap; }
.kalk-cat-badge svg { flex-shrink: 0; color: var(--brand-accent); }
.kalk-cat-picker { position: relative; }
.kalk-cat-picker-btn { display: flex; align-items: center; gap: 8px; width: 100%; box-sizing: border-box; border: 1px solid var(--panel-border); border-radius: 8px; background: var(--input-bg); color: var(--text-main); padding: 8px 10px; font-size: 13px; cursor: pointer; text-align: left; font-family: inherit; }
.kalk-cat-picker-btn:hover { border-color: var(--brand-accent); }
.kalk-cat-picker-btn svg:first-child { flex-shrink: 0; color: var(--brand-accent); }
.kalk-cat-picker-btn span { flex: 1; }
.kalk-cat-picker-btn .kalk-cat-picker-chevron { color: var(--text-muted); flex-shrink: 0; }
.kalk-cat-picker-placeholder { color: var(--text-muted); }
.kalk-cat-picker-pop { display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; max-height: 260px; overflow-y: auto; z-index: 25; background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.28); }
.kalk-cat-picker-pop.is-open { display: block; }
.kalk-cat-picker-opt { display: flex; align-items: center; gap: 8px; width: 100%; box-sizing: border-box; background: none; border: none; border-bottom: 1px solid var(--panel-border); color: var(--text-main); padding: 8px 12px; font-size: 12.5px; cursor: pointer; text-align: left; font-family: inherit; }
.kalk-cat-picker-opt:last-child { border-bottom: none; }
.kalk-cat-picker-opt:hover { background: rgba(255,255,255,.06); }
.kalk-cat-picker-opt svg { flex-shrink: 0; color: var(--brand-accent); }

/* ── Ablehnen einer übergebenen Kalkulation (Nutzerwunsch: Grund aus Liste + kurze, dazu
   vorausgefüllte Beschreibung) ── */
.kalk-badge-abgelehnt { color: var(--danger-red); border-color: rgba(255,68,68,.35); background: rgba(255,68,68,.1); }
.kalk-reject-info { border: 1px solid rgba(255,68,68,.35); background: rgba(255,68,68,.07); border-radius: 10px; padding: 12px 14px; }
.kalk-reject-info-reason { font-size: 13px; font-weight: 600; color: var(--danger-red); margin-bottom: 4px; }
.kalk-reject-modal-content { max-width: 480px; }

/* ══════════════════════════════════════════════════════════════════════════════════════════
   Fachberater-Dashboard: auffälliger Hinweis bei abgelehnten Kalkulationen (Nutzerwunsch:
   "deutlich hervorgehoben"), siehe lcLoadMyDashboard()/lcRenderCalcRejectedAlert() in
   lead_controlling.php. Farbgebung/Pulsieren analog .hbb-env-badge (Entwicklungsumgebung-Hinweis).
   ══════════════════════════════════════════════════════════════════════════════════════════ */
.lc-dash-calc-alert { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; border: 1px solid color-mix(in srgb, var(--danger-red) 45%, transparent); background: color-mix(in srgb, var(--danger-red) 10%, transparent); border-radius: 12px; padding: 14px 16px; animation: lcDashCalcAlertPulse 2.6s ease-in-out infinite; }
.lc-dash-calc-alert-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--danger-red); text-transform: uppercase; letter-spacing: .4px; }
.lc-dash-calc-alert-head svg { flex-shrink: 0; }
.lc-dash-calc-alert-item { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 10px; padding: 10px 14px; }
.lc-dash-calc-alert-item-main { flex: 1; min-width: 200px; cursor: pointer; }
.lc-dash-calc-alert-name { font-size: 13px; font-weight: 600; color: var(--text-main); }
.lc-dash-calc-alert-reason { font-size: 12px; color: var(--danger-red); margin-top: 2px; }
.lc-dash-calc-alert-note { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
@keyframes lcDashCalcAlertPulse {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger-red) 25%, transparent); }
    50%      { box-shadow: 0 0 0 6px color-mix(in srgb, var(--danger-red) 0%, transparent); }
}

/* ══════════════════════════════════════════════════════════════════════════════════════════
   Generische Filter-Dropdown-Bausteine (Button/Panel/Checkbox-Zeile/Badge) - bislang nur lokal in
   lead_controlling.php definiert; hier zentral nachgezogen, damit auch andere Module (z. B.
   admin_kalkulation.php, Tab "Kalkulation") dieselbe, vertraute Filter-Optik nutzen können, ohne
   lead_controlling.php anzufassen (dessen lokale Kopien bleiben unverändert und gelten nur dort,
   solange das Modul aktiv im DOM ist - kein Konflikt, da module-lokale <style>-Blöcke beim
   SPA-Modulwechsel mit dem restlichen Markup aus dem DOM entfernt werden).
   ══════════════════════════════════════════════════════════════════════════════════════════ */
.lc-btn { background:var(--panel-bg); border:1px solid var(--panel-border); border-radius:8px; padding:7px 14px; color:var(--text-muted); cursor:pointer; font-size:12px; display:inline-flex; align-items:center; gap:6px; transition:.15s; white-space:nowrap; font-family:inherit; }
.lc-btn:hover, .lc-btn.active { border-color:var(--brand-accent); color:var(--brand-accent); background:color-mix(in srgb, var(--brand-accent) 6%, transparent); }
.lc-ins-herkunft-toggle { margin-top:10px; }
.lc-ins-herkunft-toggle[hidden] { display:none; }
.lc-btn-anchor { position:relative; }
.lc-count-badge { position:absolute; top:-6px; right:-6px; background:var(--brand-accent); color:#fff; border-radius:999px; font-size:9px; font-weight:700; padding:1px 5px; line-height:1.4; min-width:14px; text-align:center; box-shadow:0 0 0 2px var(--panel-bg); }
.lc-stage-dropdown-wrap { position:relative; flex-shrink:0; }
.lc-stage-dropdown-btn.has-value { border-color:var(--brand-accent); color:var(--brand-accent); background:color-mix(in srgb, var(--brand-accent) 8%, transparent); }
.lc-stage-dropdown-panel { display:none; position:absolute; top:calc(100% + 5px); left:0; min-width:210px; max-height:300px; overflow-y:auto; z-index:300; padding:5px; }
.lc-stage-dropdown-panel.is-open { display:block; }
.lc-stage-dropdown-panel.align-right { left:auto; right:0; }
.lc-stage-chk-item { display:flex; align-items:center; gap:8px; padding:7px 10px; border-radius:7px; font-size:12px; color:var(--text-main); cursor:pointer; transition:.12s; user-select:none; }
.lc-stage-chk-item:hover { background:color-mix(in srgb, var(--brand-accent) 8%, transparent); }
.lc-stage-chk-item.is-disabled { color:var(--text-muted); cursor:default; }
.lc-stage-chk-item.is-disabled:hover { background:none; }
.lc-stage-chk-box { width:15px; height:15px; border:1.5px solid var(--panel-border); border-radius:4px; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; transition:.12s; }
.lc-stage-chk-item.is-checked .lc-stage-chk-box { background:var(--brand-accent); border-color:var(--brand-accent); color:#fff; }
/* Eingerückter Baum-Eintrag (z. B. Unterkategorie unter ihrer Hauptkategorie im Kategorie-Filter-
   Dropdown, siehe kdRenderKategoriePanelCheckboxes() in modules/kundendienst.php). */
.lc-stage-chk-item-sub { margin-left:20px; font-size:11.5px; color:var(--text-muted); }
.lc-filter-panel { min-width:420px; max-height:none; overflow:visible; padding:10px; }
.lc-filter-panel-cols { display:flex; align-items:stretch; gap:12px; }
.lc-filter-panel-col { flex:1 1 0; min-width:0; display:flex; flex-direction:column; }
.lc-filter-panel-col-title { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted); padding:2px 8px 6px; }
.lc-filter-panel-vsep { width:1px; align-self:stretch; background:var(--panel-border); flex-shrink:0; }
.lc-filter-panel-list { max-height:280px; overflow-y:auto; }

/* ══════════════════════════════════════════════════════════════════════════════════════════
   Zeitraum-Dropdown (Presets + Individuell + Datumsfeld-Auswahl) und Sortier-Panel (Drag&Drop-
   Sortier-Chips) - bislang nur lokal in lead_controlling.php definiert (dortige Kopien nutzen
   var(--accent-gold) statt var(--brand-accent), bleiben unverändert, kein Konflikt siehe Hinweis
   oben); hier zentral nachgezogen, damit auch andere Module (z. B. kundendienst.php, Mängelliste)
   dieselbe Zeitraum-/Sortier-Optik nutzen können.
   ══════════════════════════════════════════════════════════════════════════════════════════ */
.lc-controls-actions { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.lc-btn-icon { position:relative; padding:7px 9px; }
.lc-btn-gold { background:var(--brand-accent); color:#fff; border:none; border-radius:8px; padding:8px 18px; font-size:13px; font-weight:600; cursor:pointer; transition:.15s; display:inline-flex; align-items:center; gap:7px; }
.lc-btn-gold:hover { filter:brightness(1.1); }
.lc-stage-chk-sep { height:1px; background:var(--panel-border); margin:4px 0; }
.lc-date-dropdown-panel { min-width:230px; }
.lc-date-custom-range { display:flex; gap:8px; padding:6px 10px 4px; }
.lc-date-custom-range label { display:flex; flex-direction:column; gap:3px; font-size:10px; color:var(--text-muted); flex:1; }
.lc-date-custom-range input[type="date"] { background:var(--bg-dark); border:1px solid var(--panel-border); border-radius:6px; color:var(--text-main); font-size:11.5px; padding:5px 6px; }
.lc-date-field-choice { padding:2px 0 2px; }
.lc-date-field-label { display:block; font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:.04em; color:var(--text-muted); padding:4px 10px 3px; }
.lc-sort-panel { background:var(--panel-bg); border:1px solid var(--panel-border); border-radius:10px; padding:14px 16px; margin-bottom:12px; display:none; }
.lc-sort-panel.is-open { display:block; }
.lc-sort-panel-hdr { font-size:11px; text-transform:uppercase; letter-spacing:.8px; color:var(--text-muted); font-weight:600; margin-bottom:10px; }
.lc-sort-chips { display:flex; flex-direction:column; gap:6px; min-height:10px; }
.lc-sort-chip { display:flex; align-items:center; gap:8px; padding:6px 10px; border:1px solid var(--panel-border); border-radius:8px; background:rgba(0,0,0,.12); cursor:default; transition:background .12s, border-color .12s; user-select:none; }
.lc-sort-chip.drag-over { border-color:var(--brand-accent); background:color-mix(in srgb, var(--brand-accent) 9%, transparent); }
.lc-sort-chip.dragging { opacity:.38; }
.lc-sort-drag { cursor:grab; color:var(--text-muted); font-size:17px; line-height:1; padding:0 2px; flex-shrink:0; }
.lc-sort-drag:active { cursor:grabbing; }
.lc-sort-field-sel { flex:1; background:transparent; border:none; color:var(--text-main); font-size:12px; outline:none; cursor:pointer; }
.lc-sort-field-sel option { background:var(--panel-bg); }
.lc-sort-dir { background:color-mix(in srgb, var(--brand-accent) 10%, transparent); border:1px solid color-mix(in srgb, var(--brand-accent) 25%, transparent); border-radius:5px; color:var(--brand-accent); padding:2px 9px; font-size:12px; cursor:pointer; transition:.15s; white-space:nowrap; flex-shrink:0; }
.lc-sort-dir:hover { background:color-mix(in srgb, var(--brand-accent) 22%, transparent); }
.lc-sort-remove { background:none; border:none; color:var(--text-muted); cursor:pointer; font-size:15px; line-height:1; padding:0 3px; transition:.15s; flex-shrink:0; }
.lc-sort-remove:hover { color:var(--danger-red); }
.lc-btn.sort-modified { border-color:var(--brand-accent); color:var(--brand-accent); background:color-mix(in srgb, var(--brand-accent) 8%, transparent); }
html[data-theme="light"] .lc-sort-chip { background:rgba(0,0,0,.04); }

/* ══════════════════════════════════════════════════════════════════════════════════════════
   Kundendienst-Arbeitsliste: zentrale Responsive-Regeln und detail drawer containment.
   ══════════════════════════════════════════════════════════════════════════════════════════ */
.kd-table { table-layout: fixed; }
.kd-table th { position: relative; }
.kd-table th, .kd-table td { overflow: hidden; }
.kd-table-wrap { container-name: kd-kundendienst; container-type: inline-size; }
.kd-drawer { container-name: kd-detail-drawer; container-type: inline-size; }
.kd-drawer .kd-drawer-name { white-space: normal; overflow-wrap: anywhere; overflow: visible; text-overflow: clip; }
.kd-info-row, .kd-info-value { min-width: 0; }
.kd-info-label, .kd-info-value { overflow-wrap: anywhere; }
/* right:0 statt eines Negativ-Werts, damit der Griff vollständig innerhalb der eigenen <th>-Box
   bleibt - andernfalls würde er optisch in die Nachbarspalte hineinragen und wäre dort (eigener
   Stacking-Kontext des Nachbar-<th>) für Maus-Events nicht mehr erreichbar. */
.kd-col-resize-handle { position: absolute; top: 0; right: 0; width: 8px; height: 100%; cursor: col-resize; z-index: 2; touch-action: none; }
.kd-col-resize-handle:hover, .kd-col-resize-handle.is-resizing { background: color-mix(in srgb, var(--brand-accent) 35%, transparent); }
body.kd-col-resizing, body.kd-col-resizing * { cursor: col-resize !important; user-select: none !important; }
.kd-table-scroll { width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.kd-table { width: max-content; min-width: 100%; }
.kd-table th { padding: 9px 10px; }
.kd-table td { padding: 9px 10px; font-size: 12px; }
.kd-table .kd-table-indicator-head { width: 8px; min-width: 8px; padding: 0; }
.kd-table .kd-table-indicator-cell { width: 4px; padding: 0; }
.kd-table td.kd-name-cell,
.kd-table td[data-col-key] { white-space: normal; overflow-wrap: anywhere; }
.kd-table td.kd-name-cell { line-height: 1.4; }
.kd-name-number { margin-bottom: 3px; color: var(--text-muted); font: 12px/1.35 ui-monospace, SFMono-Regular, Consolas, monospace; }
.kd-name-title {
    display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    color: var(--text-main); font-size: 13px; font-weight: 600;
}
.kd-name-summary { display: none; }
.kd-row-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 9px; margin-top: 8px; }
.kd-row-summary-project { min-width: 0; max-width: 100%; }
.kd-row-summary-project .kd-filter-chip { max-width: 100%; white-space: normal; }
.kd-row-summary-status, .kd-row-summary-material { display: inline-flex; align-items: center; }
.kd-row-summary-due { display: inline-flex; align-items: baseline; gap: 4px; color: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.kd-row-summary-due.is-overdue { color: var(--danger-red); font-weight: 600; }
.kd-row-summary-label { color: var(--text-muted); font-size: 10px; font-weight: 600; }
.kd-row-summary-effort { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.kd-material-badge-icon { vertical-align: -1px; }
.kd-table td[data-col-key] .kd-filter-chip { max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-overflow: clip; }
.kd-table .kd-project-chip { display: inline-block; border-radius: 4px; font-size: 12px; font-weight: 600; }
.kd-table td[data-col-key="kategorie"] .kd-kat-cell { align-items: flex-start; }
.kd-table td[data-col-key="kategorie"] .kd-kat-label { white-space: normal; overflow: visible; overflow-wrap: anywhere; text-overflow: clip; }
.kd-effort-control { display: inline-flex; align-items: center; gap: 5px; }
.kd-effort-input { box-sizing: border-box; width: 68px; min-width: 0; padding: 6px 7px; border: 1px solid var(--panel-border); border-radius: 6px; background: var(--input-bg); color: var(--text-main); font: inherit; font-variant-numeric: tabular-nums; }
.kd-effort-modal-control { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kd-effort-modal-control .kd-effort-input { width: 86px; min-height: 44px; }
.kd-effort-input:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 2px; }
.kd-effort-input:disabled { opacity: .65; }
.kd-effort-input.is-saving { cursor: progress; }
.kd-effort-unit { color: var(--text-muted); font-size: 12px; }
.kd-expand-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.kd-expand-panel, .kd-expand-left, .kd-expand-right { min-width: 0; }
.kd-expand-panel { box-sizing: border-box; }
.kd-expand-value, .kd-expand-desc, .kd-expand-entry { overflow-wrap: anywhere; }
.kd-expanded-row .kd-expand-desc { max-height: none; overflow: visible; }
.kd-expanded-row .kd-expand-eintraege { max-height: none; overflow: visible; }
.kd-expand-ta { box-sizing: border-box; min-width: 0; }

/* Kundendienst: urgency worklist and its responsive information blocks */
.kd-table-wrap .kd-table-scroll { width:100%; overflow-x:hidden; overscroll-behavior-x:contain; }
.kd-table-wrap table.kd-table { display:block; width:100%; min-width:0; max-width:100%; table-layout:auto; }
.kd-table-wrap .kd-table thead,
.kd-table-wrap .kd-table tbody { display:block; }
.kd-table-wrap .kd-table thead tr {
    display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,.95fr) minmax(0,1.05fr);
    gap:0; padding:0 10px; background:var(--table-th-bg); border-bottom:1px solid var(--panel-border);
}
.kd-table-wrap .kd-table thead th {
    display:block; min-width:0; padding:9px 10px; color:var(--text-muted); font-size:10px;
    font-weight:700; letter-spacing:.04em; text-align:left; text-transform:uppercase;
}
.kd-table-wrap .kd-table thead .kd-table-indicator-head { display:none; }
.kd-table-wrap .kd-table th,
.kd-table-wrap .kd-table td { box-sizing:border-box; overflow:visible; }
.kd-table-wrap .kd-table tbody tr.kd-row-main {
    display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,.95fr) minmax(0,1.05fr);
    margin:0 0 6px; border:1px solid var(--panel-border); border-radius:9px;
    background:var(--panel-bg); cursor:pointer; transition:background .15s ease,border-color .15s ease;
}
.kd-table-wrap .kd-table tbody tr.kd-row-main:hover { border-color:var(--brand-accent); }
.kd-table-wrap .kd-table tbody tr.kd-row-main.kd-row-selected { margin-bottom:0; border-radius:9px 9px 0 0; }
.kd-table-wrap .kd-table tbody tr.kd-row-main > td {
    display:block; min-width:0; padding:8px 12px; border:0; font-size:12px; line-height:1.45;
}
.kd-table-wrap .kd-table tbody tr.kd-row-main > .kd-table-indicator-cell { display:none; }
.kd-worklist-block { min-width:0; }
.kd-worklist-block + .kd-worklist-block { border-left:1px solid var(--panel-border) !important; }
.kd-table-wrap .kd-table tbody tr.kd-row-main:focus-visible { outline:2px solid var(--accent-gold); outline-offset:2px; }
.kd-worklist-block-title {
    margin:0 0 5px; color:var(--text-muted); font-size:10px; font-weight:700;
    letter-spacing:.04em; line-height:1.3; text-transform:uppercase;
}
.kd-worklist-identity-head { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:4px 12px; margin-bottom:3px; }
.kd-worklist-ref { display:flex; align-items:baseline; flex-wrap:wrap; gap:2px 6px; min-width:0; max-width:100%; overflow-wrap:anywhere; }
.kd-worklist-ref-label { color:var(--text-muted); font-size:10px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; }
.kd-worklist-ref .kd-name-number { min-width:0; margin:0; }
.kd-worklist-warranty { min-width:0; margin-inline-start:auto; text-align:right; }
.kd-worklist-warranty .kd-warranty-badge { overflow-wrap:anywhere; }
.kd-worklist-warranty-wide { display:none; }
.kd-name-title {
    display:block; overflow:visible; overflow-wrap:anywhere; color:var(--text-main);
    font-size:14px; font-weight:650; line-height:1.4; -webkit-line-clamp:unset;
}
.kd-worklist-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px 10px; min-width:0; }
.kd-worklist-field { min-width:0; overflow-wrap:anywhere; }
.kd-worklist-field-label { display:block; margin-bottom:2px; color:var(--text-muted); font-size:10px; line-height:1.3; }
.kd-worklist-field-value { display:flex; flex-wrap:wrap; align-items:center; gap:4px 6px; min-width:0; color:var(--text-main); font-size:12px; line-height:1.4; overflow-wrap:anywhere; }
.kd-worklist-field-value .kd-filter-chip { max-width:100%; white-space:normal; overflow-wrap:anywhere; text-overflow:clip; }
.kd-worklist-field-value .kd-project-chip { display:inline-block; border-radius:4px; font-size:12px; font-weight:600; }
.kd-field-empty { color:var(--text-muted); }
.kd-due-date { font-variant-numeric:tabular-nums; }
.kd-due-date.is-overdue { color:var(--danger-red); font-weight:700; }
.kd-worklist-block-readiness .kd-effort-input { min-height:40px; }
.kd-worklist-block-readiness .kd-effort-input:focus-visible { outline:2px solid var(--accent-gold); outline-offset:2px; }
.kd-worklist-overview {
    display:flex; align-items:center; justify-content:space-between; gap:10px 18px; flex-wrap:wrap;
    margin:0 0 10px; padding:9px 12px; border:1px solid var(--panel-border); border-radius:8px;
    background:var(--table-th-bg);
}
.kd-worklist-total { display:flex; align-items:baseline; gap:7px; color:var(--text-main); font-size:12px; }
.kd-worklist-total > strong { font-size:15px; font-variant-numeric:tabular-nums; }
.kd-worklist-effort-total { padding-left:9px; border-left:1px solid var(--panel-border); color:var(--text-muted); font-variant-numeric:tabular-nums; }
.kd-worklist-stats { display:flex; gap:5px 14px; flex-wrap:wrap; }
.kd-worklist-stat { color:var(--text-muted); font-size:11px; }
.kd-worklist-stat strong { margin-right:3px; color:var(--text-main); font-variant-numeric:tabular-nums; }
.kd-worklist-stat-overdue strong { color:var(--danger-red); }
.kd-worklist-stat-soon strong { color:var(--accent-gold); }
.kd-worklist-stat-done strong { color:var(--success-green); }
.kd-table-wrap .kd-table tbody tr.kd-urgency-heading { display:block; }
.kd-table-wrap .kd-table tbody tr.kd-urgency-heading > td {
    display:block; width:100%; padding:10px 0 4px; border:0; background:transparent;
}
.kd-urgency-toggle {
    display:flex; align-items:center; gap:9px; width:100%; min-height:44px; padding:7px 11px;
    border:1px solid var(--panel-border); border-radius:7px; background:var(--table-th-bg);
    color:var(--text-main); text-align:left; cursor:pointer; transition:border-color .15s ease,background .15s ease;
}
.kd-urgency-toggle:hover { border-color:var(--brand-accent); }
.kd-urgency-toggle:focus-visible { outline:2px solid var(--accent-gold); outline-offset:2px; }
.kd-urgency-chevron { flex:0 0 auto; transition:transform .15s ease; }
.kd-urgency-toggle[aria-expanded="false"] .kd-urgency-chevron { transform:rotate(-90deg); }
.kd-urgency-title { font-size:12px; font-weight:700; }
.kd-urgency-count { margin-left:auto; color:var(--text-muted); font-size:11px; font-variant-numeric:tabular-nums; }
.kd-urgency-overdue .kd-urgency-title { color:var(--danger-red); }
.kd-urgency-soon .kd-urgency-title { color:var(--accent-gold); }
.kd-urgency-done .kd-urgency-title { color:var(--success-green); }
.kd-table-wrap .kd-table tbody tr.kd-row-main[hidden],
.kd-table-wrap .kd-table tbody tr.kd-expanded-row[hidden] { display:none !important; }
.kd-table-wrap .kd-table tbody tr.kd-message-row,
.kd-table-wrap .kd-table tbody tr.kd-empty-row { display:block; }
.kd-table-wrap .kd-table tbody tr.kd-message-row > td,
.kd-table-wrap .kd-table tbody tr.kd-empty-row > td { display:block; width:100%; padding:20px; }
.kd-list-error { color:var(--danger-red); }
.kd-table-wrap .kd-table tbody tr.kd-expanded-row { display:block; margin:0 0 8px; border:1px solid var(--panel-border); border-top:0; border-radius:0 0 9px 9px; background:var(--bg-dark); }
.kd-table-wrap .kd-table tbody tr.kd-expanded-row > td { display:block; width:100%; padding:0 !important; overflow:visible; border:0 !important; background:transparent !important; }
.kd-table-wrap .kd-expand-panel { box-sizing:border-box; padding:16px; }
.kd-table-wrap .kd-expand-grid { grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr) minmax(0,1.25fr); gap:0; }
.kd-expand-section { min-width:0; padding:4px 14px; }
.kd-expand-section + .kd-expand-section { border-left:1px solid var(--panel-border); }
.kd-expand-section-heading { display:flex; align-items:baseline; justify-content:space-between; gap:8px; }
.kd-expand-value { margin:0 0 12px; font-style:normal; line-height:1.5; overflow-wrap:anywhere; }
.kd-expand-desc { max-height:none; overflow:visible; padding:0; border:0; background:transparent; font-size:12px; line-height:1.6; white-space:pre-wrap; overflow-wrap:anywhere; }
.kd-expand-eintraege { display:flex; flex-direction:column; gap:0; max-height:none; margin:0 0 10px; overflow:visible; }
.kd-expand-entry { padding:8px 0; border:0; border-top:1px solid var(--panel-border); border-radius:0; background:transparent; font-size:12px; overflow-wrap:anywhere; }
.kd-expand-entry:first-child { border-top:0; }
.kd-expand-entry-meta { margin-bottom:3px; color:var(--text-muted); font-size:10px; }
.kd-expand-empty { padding:4px 0 10px; color:var(--text-muted); font-size:12px; }
.kd-expand-count { color:var(--text-muted); font-size:11px; white-space:nowrap; }
.kd-expand-error { color:var(--danger-red); font-size:13px; }
.kd-expand-actions { gap:7px; align-items:center; flex-wrap:wrap; padding-top:12px; border-top:1px solid var(--panel-border); }
.kd-expand-days { color:var(--text-muted); font-size:11px; white-space:nowrap; }
.kd-status-select-inline { min-height:44px; padding:6px 9px; font-size:12px; }
.kd-expand-add-entry { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px 8px; align-items:end; margin-top:8px; }
.kd-expand-entry-label { grid-column:1/-1; color:var(--text-muted); font-size:11px; }
.kd-expand-ta { width:100%; min-height:44px; box-sizing:border-box; padding:8px 10px; resize:vertical; }
.kd-expand-add-entry .kd-btn { min-width:44px; min-height:44px; }
.kd-empty-row .kd-empty { padding:14px; text-align:center; }

@container kd-kundendienst (min-width: 1311px) {
    .kd-table-wrap .kd-worklist-block-title { display:none; }
    .kd-worklist-warranty-stacked { display:none; }
    .kd-worklist-warranty-wide { display:block; margin-bottom:4px; }
}

@container kd-kundendienst (min-width: 960px) {
    .kd-worklist-block-readiness .kd-worklist-fields { grid-template-columns:repeat(4,minmax(0,1fr)); }
    .kd-worklist-block-readiness .kd-badge { white-space:normal; }
}

@media (pointer:coarse) {
    .kd-worklist-field-value .kd-filter-chip { display:inline-flex; align-items:center; min-height:44px; padding:4px 8px; }
    .kd-pag-btn { min-width:44px; min-height:44px; height:auto; }
}

/* ══════════════════════════════════════════════════════════════════════════════════════════
   Kalkulation: Gruppierungs-Panel/Gruppen-Header-Zeilen (Keine/Status/Kategorie/Zuständig) sowie
   der Hover-Kontakt-Popover (Glas-Design wie Glockenmenü, siehe .hbb-glass-pop weiter oben) für
   Personen (Kunde/Von/Zuständig) mit hinterlegtem Telefon/Mobil/E-Mail in der Aufgabenliste.
   ══════════════════════════════════════════════════════════════════════════════════════════ */
.kalk-group-panel { min-width:170px; }
.kalk-table tbody tr.kalk-group-row { background:none; border:none; }
.kalk-table tbody tr.kalk-group-row td { padding:14px 4px 6px; border:none !important; border-radius:0 !important; white-space:normal; }
.kalk-table tbody tr.kalk-group-row:first-child td { padding-top:0; }
.kalk-group-toggle { display:inline-flex; align-items:center; gap:7px; background:none; border:none; padding:4px 2px; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:var(--text-muted); cursor:pointer; font-family:inherit; }
.kalk-group-toggle:hover { color:var(--brand-accent); }
.kalk-group-chevron { transition:transform .2s ease; flex-shrink:0; }
.kalk-group-toggle.is-collapsed .kalk-group-chevron { transform:rotate(-90deg); }
.kalk-group-count { background:var(--bg-dark); border:1px solid var(--panel-border); border-radius:999px; padding:1px 8px; font-size:10px; font-weight:700; color:var(--text-main); text-transform:none; letter-spacing:0; }

/* Parallelanfragen (Nutzerwunsch: ein Interessent kann sich z.B. nicht zwischen Bungalow und
   normalem Haus entscheiden - der Lead bekommt dann bewusst MEHRERE gleichzeitig offene/in
   Bearbeitung befindliche Kalkulationsrunden, siehe submit_lead_to_calc in api_lead.php:
   allow_parallel). Werden in der Aufgabenliste IMMER automatisch zu einem Block zusammengefasst
   (unabhängig von der optionalen Gruppierung über kalkGroupBy), siehe kalkClusterParallel()/
   kalkRenderRowList() - eigene Akzentfarbe (Violett), damit der Block klar von den normalen
   Status-/Kategorie-/Zuständig-Gruppenzeilen (.kalk-group-row) unterscheidbar bleibt. */
.kalk-table tbody tr.kalk-parallel-group-row { background:none; border:none; }
.kalk-table tbody tr.kalk-parallel-group-row th {
    padding:10px 4px 4px; border:none !important; border-radius:0 !important;
    background:none; text-align:left; white-space:normal;
}
.kalk-table tbody tr.kalk-parallel-group-row:first-child th { padding-top:0; }
.kalk-parallel-group-banner {
    display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; box-sizing:border-box;
    width:100%; min-height:44px; padding:8px 12px;
    border:1px solid color-mix(in srgb, #8b5cf6 42%, var(--panel-border));
    border-radius:9px; background:color-mix(in srgb, #8b5cf6 8%, var(--panel-bg));
}
.kalk-parallel-group-icon { flex:0 0 auto; color:#8b5cf6; }
.kalk-parallel-group-title { color:var(--text-main); font-size:13px; font-weight:700; }
.kalk-parallel-group-name { color:var(--text-main); font-size:13px; }
.kalk-parallel-group-count {
    display:inline-flex; align-items:center; gap:4px; margin-left:auto; padding:4px 9px;
    border:1px solid color-mix(in srgb, #8b5cf6 35%, var(--panel-border));
    border-radius:999px; color:var(--text-main); font-size:12px; font-weight:600;
}
.kalk-parallel-group-count strong { font-variant-numeric:tabular-nums; }
.kalk-table tbody tr.kalk-combined-row.kalk-parallel-member:not(.is-overdue):not(.is-due-soon) {
    background:color-mix(in srgb, #8b5cf6 4%, var(--panel-bg));
}
.kalk-table tbody tr.kalk-combined-row.kalk-parallel-member td {
    border-top:1px solid color-mix(in srgb, #8b5cf6 32%, var(--panel-border));
    border-bottom:1px solid color-mix(in srgb, #8b5cf6 32%, var(--panel-border));
}
.kalk-table tbody tr.kalk-combined-row.kalk-parallel-member td:first-child {
    border-left:1px solid color-mix(in srgb, #8b5cf6 42%, var(--panel-border));
}
.kalk-table tbody tr.kalk-combined-row.kalk-parallel-member td:last-child {
    border-right:1px solid color-mix(in srgb, #8b5cf6 42%, var(--panel-border));
}
.kalk-table tbody tr.kalk-combined-row.kalk-parallel-member:not(.is-overdue):not(.is-due-soon) td:first-child,
.kalk-table tbody tr.kalk-combined-row.kalk-parallel-member:not(.is-overdue):not(.is-due-soon) td:last-child {
    background:color-mix(in srgb, #8b5cf6 4%, var(--panel-bg));
}
.kalk-parallel-badge {
    display:inline-flex; align-items:center; gap:4px; border:1px solid color-mix(in srgb, #8b5cf6 42%, var(--panel-border));
    background:color-mix(in srgb, #8b5cf6 8%, var(--panel-bg)); color:var(--text-main);
    border-radius:999px; padding:3px 8px; font-size:11px; font-weight:700; margin-left:6px; vertical-align:middle;
}

@media (max-width:767px) {
    .kalk-table tbody tr.kalk-parallel-group-row { display:block; margin:8px 0 2px; }
    .kalk-table tbody tr.kalk-parallel-group-row th { display:block; padding:0 0 6px; }
    .kalk-parallel-group-banner { gap:6px 9px; padding:9px 10px; }
    .kalk-parallel-group-count { margin-left:0; }
    .kalk-table tr.kalk-combined-row.kalk-parallel-member:not(.is-overdue):not(.is-due-soon) {
        background:color-mix(in srgb, #8b5cf6 5%, var(--panel-bg));
        border-color:color-mix(in srgb, #8b5cf6 42%, var(--panel-border));
    }
}

.kalk-person-hover { cursor:pointer; border-bottom:1px dashed color-mix(in srgb, var(--brand-accent) 55%, transparent); transition:color .12s; }
.kalk-person-hover:hover { color:var(--brand-accent); }
.kalk-contact-pop {
    position: fixed; z-index: 1300; width: 190px; padding: 12px;
    opacity: 0; visibility: hidden; pointer-events: none; transform: translate(-50%, -6px);
    transition: opacity .2s ease, transform .2s cubic-bezier(.22,1,.36,1), visibility 0s linear .2s;
}
.kalk-contact-pop[data-placement="bottom"] { transform: translate(-50%, -6px); }
.kalk-contact-pop[data-placement="top"] { transform: translate(-50%, 6px); }
.kalk-contact-pop.is-open {
    opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, 0);
    transition: opacity .2s ease, transform .2s cubic-bezier(.22,1,.36,1), visibility 0s;
}
.kalk-contact-pop-name { font-size: 12.5px; font-weight: 700; color: var(--text-main); margin: 2px 4px 8px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kalk-contact-pop-actions { display: flex; gap: 6px; }
.kalk-contact-pop-btn { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 11px; border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.1); color: var(--text-muted); font-size: 10.5px; text-decoration: none; transition: .15s; }
.kalk-contact-pop-btn:hover { border-color: var(--brand-accent); color: var(--brand-accent); background: color-mix(in srgb, var(--brand-accent) 14%, transparent); transform: translateY(-1px); }

/* -- Marken-Vergleich-Kachel "Auswertungen" (html/modules/lead_controlling.php), Präfix
   lc-ins-brand-wr- -- Win-Rate-Badge je Marke (Fischerhaus/Naturholzhaus/Objektbau/Wohnungsbau,
   siehe brand_registry.php), dynamisch aus LC_BRANDS gerendert statt fester FH/NHH-Boxen. */
.lc-ins-brand-wr-row { display: flex; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.lc-ins-brand-wr-box { flex: 1; min-width: 90px; text-align: center; padding: 8px; border-radius: 8px; background: rgba(255,255,255,.03); }
.lc-ins-brand-wr-value { font-size: 19px; font-weight: 700; color: var(--accent-gold); }
.lc-ins-brand-wr-label { font-size: 10px; color: var(--text-muted); }

/* -- Marken-Mehrfachauswahl (html/modules/lead_controlling.php), Präfix lc-brand-checkbox- --
   Ersetzt das frühere Einzel-Dropdown mit der Option "Beide" bei Lead/Fachberater/ZV-Formularen:
   ein Lead oder Fachberater kann jetzt an beliebig vielen der 4 Marken gleichzeitig interessiert/
   zustaendig sein (siehe lcBrandCheckboxesHtml() in lead_controlling.php, brand_registry.php). */
.lc-brand-checkboxes { display: flex; flex-wrap: wrap; gap: 10px 16px; padding: 8px 0; }
.lc-brand-checkbox-item { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-main); cursor: pointer; }
.lc-brand-checkbox-item input[type="checkbox"] { margin: 0; cursor: pointer; }

/* -- Marken-EINFACHauswahl (Radio-Chips), html/modules/lead_controlling.php, Praefix
   lc-brand-radio- -- Im Unterschied zu lc-brand-checkboxes oben ist hier bewusst nur GENAU eine
   Marke waehlbar (z.B. "Neuen Lead erfassen"-Wizard, Marke ist dort ein Pflichtfeld). Faerbung je
   Marke ueber [data-brand], analog zu .lc-stagetpl-brand-badges[data-brand=...] weiter oben. */
.lc-brand-radio-group { display: flex; flex-wrap: wrap; gap: 8px; }
.lc-brand-radio-item input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.lc-brand-radio-item label { display: flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--lc-section-border); background: var(--lc-section-bg); color: var(--text-main); font-size: 12.5px; font-weight: 600; cursor: pointer; transition: .15s; }
.lc-brand-radio-item label:hover { border-color: var(--accent-gold); }
.lc-brand-radio-item input:focus-visible + label { outline: 2px solid var(--accent-gold); outline-offset: 2px; }
.lc-brand-radio-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0; }
.lc-brand-radio-dot[data-brand="fischerhaus"] { background: #003056; }
.lc-brand-radio-dot[data-brand="naturholzhaus"] { background: #1b4d2e; }
.lc-brand-radio-dot[data-brand="objektbau"], .lc-brand-radio-dot[data-brand="wohnungsbau"] { background: #333333; }
.lc-brand-radio-item[data-brand="fischerhaus"] input:checked + label { border-color: #003056; background: rgba(0,48,86,.12); }
.lc-brand-radio-item[data-brand="naturholzhaus"] input:checked + label { border-color: #1b4d2e; background: rgba(27,77,46,.12); }
.lc-brand-radio-item[data-brand="objektbau"] input:checked + label,
.lc-brand-radio-item[data-brand="wohnungsbau"] input:checked + label { border-color: #333333; background: rgba(51,51,51,.12); }

/* -- "Neuen Lead erfassen"-Wizard: Schritt-Indikator + "Welche Marke?"-Auswahlliste bei
   mehrdeutiger PLZ-Zuordnung, html/modules/lead_controlling.php -- */
.lc-form-grid + .lc-form-grid { margin-top: 10px; }
/* .lc-btn/.lc-btn-gold setzen explizit display:inline-flex - ohne diese gezielte Regel würde das
   native [hidden]-Attribut der Wizard-Footer-Buttons (Zurück/Weiter/Lead anlegen) wirkungslos bleiben. */
.lc-mfoot button[hidden] { display: none; }
.lc-wizard-steps { display: flex; align-items: center; margin-bottom: 16px; }
.lc-wizard-step { display: flex; align-items: center; gap: 7px; padding: 5px 6px; border: none; background: none; cursor: pointer; border-radius: 8px; font-family: inherit; }
.lc-wizard-step:hover { background: var(--lc-section-bg); }
.lc-wizard-step-num { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--lc-section-bg); border: 1px solid var(--lc-section-border); color: var(--text-muted); font-size: 11px; font-weight: 700; flex-shrink: 0; transition: .15s; }
.lc-wizard-step-label { font-size: 11px; font-weight: 600; color: var(--text-muted); white-space: nowrap; transition: .15s; }
.lc-wizard-step.is-active .lc-wizard-step-num { background: var(--accent-gold); border-color: var(--accent-gold); color: #fff; }
.lc-wizard-step.is-active .lc-wizard-step-label { color: var(--text-main); }
.lc-wizard-step.is-done .lc-wizard-step-num { background: var(--brand-accent); border-color: var(--brand-accent); color: #fff; }
.lc-wizard-step.is-done .lc-wizard-step-label { color: var(--text-main); }
.lc-wizard-step-sep { flex: 1 1 16px; height: 1px; background: var(--lc-section-border); margin: 0 2px; }
.lc-wizard-panel .lc-form-section + .lc-form-section { margin-top: 12px; }
.lc-wizard-hint { display: flex; align-items: flex-start; gap: 6px; margin-top: 10px; font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }
.lc-wizard-hint svg { flex-shrink: 0; margin-top: 1px; opacity: .75; }
.lc-quicklead-stage-choice { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border: 1px solid var(--lc-section-border); border-radius: 9px; background: var(--lc-section-bg); color: var(--text-main); cursor: pointer; }
.lc-quicklead-stage-choice input { width: auto; flex: 0 0 auto; margin: 3px 0 0; accent-color: var(--brand-accent); }
.lc-quicklead-stage-choice span { display: flex; flex-direction: column; gap: 3px; }
.lc-quicklead-stage-choice strong { font-size: 13px; font-weight: 650; }
.lc-quicklead-stage-choice small { font-size: 12px; line-height: 1.45; color: var(--text-muted); }
.lc-quicklead-stage-choice:focus-within { outline: 2px solid var(--accent-gold); outline-offset: 2px; }
.lc-brandpick-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.lc-brandpick-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--lc-section-border); background: var(--lc-section-bg); color: var(--text-main); cursor: pointer; text-align: left; font-size: 13px; font-family: inherit; transition: .15s; }
.lc-brandpick-item:hover { border-color: var(--accent-gold); background: color-mix(in srgb, var(--accent-gold) 8%, transparent); }
.lc-brandpick-text { display: flex; flex-direction: column; gap: 1px; }
.lc-brandpick-text strong { font-weight: 700; }
.lc-brandpick-sub { color: var(--text-muted); font-size: 11.5px; }

/* -- "Neuen Lead erfassen"-Duplikat-Hinweis: deutlich prominenter als die generische
   .lc-dup-warning (html/modules/lead_controlling.php), da er jetzt direkt unter dem
   Schritt-Indikator sitzt statt am Formularende zu verschwinden. ID-Selektor bewusst statt Klasse,
   damit die Regeln sicher die .lc-dup-warning-Basis-Styles (siehe eingebettetes <style> dort)
   überschreiben, unabhängig von der Reihenfolge der beiden Stylesheets. -- */
#qlm-dup-warning { margin: 0 0 16px; padding: 14px 16px; border: 1px solid rgba(255,193,7,.55); border-left: 4px solid #d19900; border-radius: 10px; background: rgba(255,193,7,.12); box-shadow: 0 2px 12px rgba(209,153,0,.18); }
#qlm-dup-warning .lc-dup-warning-title { font-size: 13.5px; }
@keyframes lcDupWarningShake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(2px); } 30%, 50%, 70% { transform: translateX(-4px); } 40%, 60% { transform: translateX(4px); } }
.lc-dup-warning-shake { animation: lcDupWarningShake .5s ease; }
.lc-dup-candidate-info { flex: 1; min-width: 0; }
.lc-dup-candidate-type { font-weight: 400; color: var(--text-muted); }
.lc-dup-candidate-actions { display: flex; gap: 6px; flex-shrink: 0; }
.lc-dup-candidate-action { padding: 5px 10px; border-radius: 7px; border: 1px solid rgba(255,193,7,.4); background: rgba(255,255,255,.5); color: #7a5b00; font-size: 11px; font-weight: 600; cursor: pointer; white-space: nowrap; font-family: inherit; transition: .15s; }
.lc-dup-candidate-action:hover { border-color: #d19900; background: rgba(255,193,7,.22); }
.lc-dup-candidate-action-primary { background: #d19900; border-color: #d19900; color: #fff; }
.lc-dup-candidate-action-primary:hover { filter: brightness(1.08); background: #d19900; }
.lc-dup-linked { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 9px 11px; border-radius: 8px; background: rgba(102,157,36,.14); border: 1px solid rgba(102,157,36,.4); font-size: 12px; color: var(--text-main); }
.lc-dup-linked svg { flex-shrink: 0; color: var(--brand-accent); }
.lc-dup-linked span { flex: 1; min-width: 0; }
.lc-dup-unlink-btn { flex-shrink: 0; padding: 4px 9px; border-radius: 6px; border: 1px solid var(--lc-section-border); background: none; color: var(--text-muted); font-size: 11px; cursor: pointer; font-family: inherit; }
.lc-dup-unlink-btn:hover { border-color: var(--danger-red); color: var(--danger-red); }
.lc-dup-ack { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,193,7,.35); font-size: 12.5px; font-weight: 600; color: #7a5b00; cursor: pointer; }
/* Globales "input, select { width:100% }" (admin.php) würde die Checkbox sonst auf volle Breite
   strecken und dem Label-Text keinen Platz lassen - hier gezielt zurücksetzen. */
.lc-dup-ack input { width: auto; flex: 0 0 auto; margin-top: 2px; cursor: pointer; }
.lc-dup-ack span { flex: 1; min-width: 0; }
/* .lc-dup-linked/.lc-dup-ack setzen explizit display:flex - ohne diese Regel bliebe das native
   [hidden]-Attribut wirkungslos (gleiches Prinzip wie .lc-mfoot button[hidden] weiter oben). */
.lc-dup-linked[hidden], .lc-dup-ack[hidden] { display: none; }

/* -- Zusammenfassung der verknüpften Kontaktperson im "Neuen Lead erfassen"-Wizard (ersetzt die
   dann obsoleten Kontaktperson-/Adressfelder, siehe #qlm-contact-fields/#qlm-address-fields und
   lcQuickLeadLinkExisting()/lcQuickLeadUnlinkExisting() in lead_controlling.php). -- */
.lc-form-grid-spaced { margin-top: 10px; }
.lc-linked-summary { margin-top: 10px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--lc-section-border); background: var(--lc-section-bg); }
.lc-linked-summary-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin-bottom: 4px; }
.lc-linked-summary-name { font-size: 13.5px; font-weight: 700; color: var(--text-main); }
.lc-linked-summary-line { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* =========================================
   IT-Sicherheitsmeldungen (html/modules/security_advisories.php, html/api_security_feeds.php,
   Präfix itsm-) — Admin-verwaltete RSS-/Atom-Feed-Abos (z. B. BSI-Cybersicherheitswarnungen) mit
   aufbereiteter Kartenansicht sowie persönlichem Push-Opt-in. Eigenständige itsm-Klassen statt
   Cross-Modul-Wiederverwendung von z. B. .up-tgl/.fr-card (siehe css-konventionen.md).
   ========================================= */
.itsm-page { padding: 28px 32px; }
.itsm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.itsm-page-title { margin: 0; font-size: 24px; color: var(--text-main); }
.itsm-page-sub { margin: 8px 0 0; color: var(--text-muted); font-size: 13px; max-width: 70ch; line-height: 1.6; }

.itsm-stats-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 18px; }
.itsm-stat { background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.itsm-stat-num { font-size: 22px; font-weight: 700; color: var(--text-main); line-height: 1.2; }
.itsm-stat-label { font-size: 11px; color: var(--text-muted); }
.itsm-stat-critical { border-top: 3px solid var(--danger-red); }
.itsm-stat-critical .itsm-stat-num { color: var(--danger-red); }

/* ── Persönliches Push-Opt-in (jeder Nutzer mit Modulzugriff, Standard: AUS) ── */
.itsm-push-card { background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 12px; padding: 14px 18px; margin-bottom: 18px; }
.itsm-push-main { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.itsm-push-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.itsm-push-info svg { flex-shrink: 0; color: var(--brand-accent); }
.itsm-push-title { font-size: 13.5px; font-weight: 700; color: var(--text-main); }
.itsm-push-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
/* ── Schweregrad-Filter für die Push-Zustellung ("push nur für kritisch/hoch") - nur sichtbar,
   solange der Schalter oben aktiv ist (display:flex wird per JS gesetzt, siehe
   renderPushSeverityChips()/itsmSetPushState() in security_advisories.php). ── */
.itsm-push-severities { display: none; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--panel-border); }
.itsm-push-severities-label { font-size: 12px; color: var(--text-muted); margin-right: 2px; }
/* ── Hinweis, falls noch kein allgemeines Push-Abo existiert (siehe itsmUpdatePushHint() in
   security_advisories.php) - dieses Modul registriert bewusst kein eigenes Abo, sondern baut nur
   auf dem zentralen Push-System (api_push.php/profil.php) auf. ── */
.itsm-push-hint { display: none; margin-top: 10px; padding: 9px 12px; border-radius: 8px; font-size: 12px; line-height: 1.5; background: color-mix(in srgb, #e0913f 12%, transparent); color: #e0913f; }
.itsm-push-hint a { color: inherit; font-weight: 700; text-decoration: underline; }

/* ── Toggle-Switch ── */
.itsm-tgl { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.itsm-tgl input { opacity: 0; width: 0; height: 0; position: absolute; }
.itsm-tgl-track { position: absolute; inset: 0; background: var(--panel-border); border-radius: 999px; cursor: pointer; transition: background .2s; }
.itsm-tgl input:checked + .itsm-tgl-track { background: var(--brand-accent); }
.itsm-tgl-track::after { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.itsm-tgl input:checked + .itsm-tgl-track::after { transform: translateX(18px); }
.itsm-tgl-sm { width: 34px; height: 20px; }
.itsm-tgl-sm .itsm-tgl-track::after { width: 14px; height: 14px; }
.itsm-tgl-sm input:checked + .itsm-tgl-track::after { transform: translateX(14px); }

/* ── Schweregrad-Badges (Ampelsystem: kritisch=rot, hoch=orange, mittel=gelb, niedrig=grün) -
   dieselben Farben/Klassen dienen sowohl der reinen Anzeige auf den Meldungs-Karten als auch
   (als Variante .itsm-sev-chip) den klickbaren Filter-/Auswahl-Pillen in Toolbar und Push-Karte. ── */
.itsm-sev-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; border-radius: 999px; padding: 3px 10px; white-space: nowrap; border: 1px solid transparent; font-family: inherit; }
.itsm-sev-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.itsm-sev-kritisch { color: var(--danger-red); background: color-mix(in srgb, var(--danger-red) 14%, transparent); }
.itsm-sev-hoch { color: #e0913f; background: color-mix(in srgb, #e0913f 14%, transparent); }
.itsm-sev-mittel { color: #d9b43c; background: color-mix(in srgb, #d9b43c 16%, transparent); }
.itsm-sev-niedrig { color: var(--success-green); background: color-mix(in srgb, var(--success-green) 14%, transparent); }
.itsm-sev-chip { cursor: pointer; opacity: .4; transition: opacity .15s, transform .1s; }
.itsm-sev-chip:hover { transform: translateY(-1px); }
.itsm-sev-chip.is-active { opacity: 1; }
.itsm-sev-filter-row { display: inline-flex; gap: 6px; flex-wrap: wrap; flex-shrink: 0; }

/* ── Update-/Ungepatcht-Kennzeichnung (Titel-Marker mancher Feeds, z. B. BSI WID/CERT-Bund:
   "[UPDATE]"/"[UNGEPATCHT]" - hier aus dem Titel entfernt und als eigene Chips dargestellt, siehe
   hbbSecurityFeedCleanTitle() in lib_security_feeds.php). ── */
.itsm-chip { display: inline-flex; align-items: center; font-size: 10px; font-weight: 600; border-radius: 999px; padding: 3px 9px; white-space: nowrap; border: 1px solid var(--panel-border); color: var(--text-muted); }
.itsm-chip-update { color: var(--brand-accent); border-color: color-mix(in srgb, var(--brand-accent) 40%, transparent); background: color-mix(in srgb, var(--brand-accent) 8%, transparent); }
.itsm-chip-unpatched { color: var(--danger-red); border-color: color-mix(in srgb, var(--danger-red) 40%, transparent); background: var(--danger-bg); }


/* ── Admin-Feed-Verwaltung ('security_advisories.manage') ── */
.itsm-admin-panel { background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 14px; padding: 18px 20px; margin-bottom: 20px; }
.itsm-admin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.itsm-admin-head h3 { margin: 0; font-size: 15px; color: var(--text-main); }
.itsm-feed-list { display: flex; flex-direction: column; gap: 8px; }
.itsm-feed-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 12px; border: 1px solid var(--panel-border); border-radius: 10px; background: var(--bg-dark); flex-wrap: wrap; }
.itsm-feed-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 260px; }
.itsm-feed-row-label { font-size: 13px; font-weight: 600; color: var(--text-main); }
.itsm-feed-row-url { font-size: 11.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.itsm-feed-row-meta { font-size: 11px; color: var(--text-muted); }
.itsm-feed-row-error { color: var(--danger-red); }
.itsm-feed-row-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.itsm-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--panel-border); background: var(--panel-bg); color: var(--text-muted); cursor: pointer; transition: .15s; }
.itsm-icon-btn:hover { border-color: var(--brand-accent); color: var(--brand-accent); }
.itsm-icon-btn-danger:hover { border-color: var(--danger-red); color: var(--danger-red); }

/* ── Toolbar / Suche / Feed-Filter ── */
.itsm-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.itsm-search-wrap { position: relative; flex: 1 1 220px; min-width: 180px; }
.itsm-search-wrap svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.itsm-search-wrap input { width: 100%; box-sizing: border-box; padding: 9px 12px 9px 34px; background: var(--input-bg); border: 1px solid var(--panel-border); border-radius: 8px; color: var(--text-main); font-size: 13px; }
.itsm-search-wrap input:focus { border-color: var(--brand-accent); outline: none; }
.itsm-feed-filter { background: var(--input-bg); border: 1px solid var(--panel-border); border-radius: 8px; color: var(--text-main); font-size: 12.5px; padding: 9px 10px; }
.itsm-feed-filter:focus { border-color: var(--brand-accent); outline: none; }

/* ── Meldungs-Karten ── */
.itsm-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 10px; }
.itsm-empty { text-align: center; padding: 50px 20px; color: var(--text-muted); font-size: 13px; }
.itsm-card { background: var(--panel-bg); border: 1px solid var(--panel-border); border-left: 4px solid var(--panel-border); border-radius: 12px; padding: 16px 18px; transition: box-shadow .2s, border-color .3s, background .3s; }
/* Ampel-Rahmen nach Schweregrad - macht kritische/hohe Meldungen beim Scrollen durch eine lange
   Liste sofort erkennbar, ohne erst den Badge-Text lesen zu müssen (Nutzerwunsch). Kritisch/Hoch
   bekommen zusätzlich einen dezenten Farbschimmer im Hintergrund, um noch stärker aufzufallen. */
.itsm-card-sev-kritisch { border-left-color: var(--danger-red); background: linear-gradient(to right, color-mix(in srgb, var(--danger-red) 7%, var(--panel-bg)), var(--panel-bg) 180px); }
.itsm-card-sev-hoch { border-left-color: #e0913f; background: linear-gradient(to right, color-mix(in srgb, #e0913f 6%, var(--panel-bg)), var(--panel-bg) 180px); }
.itsm-card-sev-mittel { border-left-color: #d9b43c; }
.itsm-card-sev-niedrig { border-left-color: var(--success-green); }
.itsm-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.itsm-card-head .itsm-sev-badge { font-size: 11px; padding: 4px 11px; }
.itsm-card-head .itsm-sev-badge::before { width: 8px; height: 8px; }
/* Feed-Name bewusst neutral/zurückhaltend (statt wie zuvor farbig hervorgehoben) - die Ampel-Farbe
   des Schweregrads soll das einzige starke Farbsignal in der Kopfzeile sein. */
.itsm-card-feed { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); background: var(--bg-dark); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.itsm-card-date { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
.itsm-card-title { margin: 0 0 6px; font-size: 14.5px; color: var(--text-main); line-height: 1.4; }
.itsm-card-summary { margin: 0 0 8px; font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.itsm-card-link { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--brand-accent); text-decoration: none; font-weight: 600; }
.itsm-card-link:hover { text-decoration: underline; }
.itsm-card-highlight { border-color: var(--brand-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-accent) 25%, transparent); }

/* ── Feed-Modal (Anlegen/Bearbeiten, nutzt die globale .modal-overlay/.modal-content-Basis-Optik) ── */
.itsm-feed-modal { max-width: 460px; }
.itsm-feed-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--panel-border); }
.itsm-feed-modal-head h3 { margin: 0; font-size: 15px; color: var(--text-main); }
.itsm-modal-close { background: none; border: none; color: var(--text-muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 6px; transition: .12s; }
.itsm-modal-close:hover { color: var(--text-main); background: rgba(255,255,255,.07); }
.itsm-feed-modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.itsm-field-label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); margin: 10px 0 4px; }
.itsm-field-label:first-of-type { margin-top: 0; }
.itsm-input { width: 100%; box-sizing: border-box; background: var(--input-bg); border: 1px solid var(--panel-border); border-radius: 8px; color: var(--text-main); font-size: 13px; padding: 9px 11px; }
.itsm-input:focus { border-color: var(--brand-accent); outline: none; }
.itsm-feed-modal-msg { display: none; margin-top: 10px; padding: 9px 12px; border-radius: 8px; font-size: 12.5px; }
.itsm-msg-error { background: var(--danger-bg); color: var(--danger-red); }
.itsm-msg-warning { background: color-mix(in srgb, #e0913f 14%, transparent); color: #e0913f; }
.itsm-feed-modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--panel-border); }

@media (max-width: 680px) {
    .itsm-page { padding: 16px; }
    .itsm-push-main { flex-direction: column; align-items: flex-start; }
    .itsm-feed-row { flex-direction: column; align-items: stretch; }
    .itsm-feed-row-actions { justify-content: flex-end; }
}

/* =========================================
   RAUMBUCHUNGEN (modules/raumbuchungen.php, api_raumbuchungen.php)
   ========================================= */
.rb-hidden { display: none !important; }

.rb-page { padding: 24px; max-width: 1600px; margin: 0 auto; }
.rb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.rb-page-title { margin: 0; font-size: 22px; font-weight: 600; color: var(--text-main); }
.rb-page-sub { margin: 4px 0 0; font-size: 12.5px; color: var(--text-muted); }
.rb-head-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.rb-icon-btn { background: var(--panel-bg); border: 1px solid var(--panel-border); color: var(--text-muted); cursor: pointer; padding: 8px; border-radius: 8px; display: inline-flex; transition: .15s; }
.rb-icon-btn:hover { color: var(--accent-gold); border-color: var(--accent-gold); transform: rotate(-20deg); }

.rb-btn, .rb-btn-gold, .rb-btn-danger { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; border-radius: 8px; padding: 8px 14px; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s, color .15s; border: 1px solid var(--panel-border); background: var(--panel-bg); color: var(--text-main); }
.rb-btn:hover { border-color: var(--accent-gold); color: var(--accent-gold); }
.rb-btn-ghost { background: none; border-color: transparent; color: var(--text-muted); }
.rb-btn-gold { background: var(--accent-gold); border-color: var(--accent-gold); color: var(--btn-text); }
.rb-btn-gold:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.rb-btn-danger { background: var(--danger-bg); border-color: transparent; color: var(--danger-red); }
.rb-btn-danger:hover { background: var(--danger-red); color: #fff; }
.rb-btn:disabled, .rb-btn-gold:disabled, .rb-btn-danger:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }

.rb-tabs { margin-bottom: 18px; }
.rb-tab-panel { display: none; animation: rb-fade-in .2s ease; }
.rb-tab-panel.active { display: block; }
@keyframes rb-fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.rb-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 14px; }
.rb-date-nav { display: flex; align-items: center; gap: 4px; }
.rb-nav-btn { background: var(--panel-bg); border: 1px solid var(--panel-border); color: var(--text-main); border-radius: 7px; padding: 7px 10px; cursor: pointer; font-size: 12.5px; font-weight: 600; transition: .15s; }
.rb-nav-btn:hover { border-color: var(--accent-gold); color: var(--accent-gold); }
.rb-nav-today { padding: 7px 14px; }
.rb-date-input { background: var(--input-bg); border: 1px solid var(--panel-border); border-radius: 7px; color: var(--text-main); padding: 6px 9px; font-size: 12.5px; }
.rb-view-toggle { display: inline-flex; border: 1px solid var(--panel-border); border-radius: 8px; overflow: hidden; }
.rb-view-btn { background: var(--panel-bg); border: none; color: var(--text-muted); padding: 7px 14px; font-size: 12px; font-weight: 600; cursor: pointer; transition: .15s; }
.rb-view-btn + .rb-view-btn { border-left: 1px solid var(--panel-border); }
.rb-view-btn.active { background: var(--accent-gold); color: var(--btn-text); }

.rb-legend, .rb-emp-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-left: auto; }
.rb-legend-item, .rb-emp-legend-item { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
.rb-legend-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

.rb-rooms-grid { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.rb-room-col { flex: 1 1 260px; min-width: 240px; background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.rb-room-col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-top: 3px solid; font-size: 13px; font-weight: 600; color: var(--text-main); background: var(--bg-dark); }
.rb-room-capacity { font-size: 11px; font-weight: 500; color: var(--text-muted); }
.rb-room-col-cal { padding: 6px 8px 10px; }
.rb-empty { text-align: center; color: var(--text-muted); font-size: 12.5px; padding: 32px 12px; width: 100%; }

/* FullCalendar-Feinschliff innerhalb der schmalen Raum-Spalten */
.rb-room-col-cal .fc { font-size: 11.5px; }
.rb-room-col-cal .fc-event { border-radius: 6px; border: none !important; cursor: pointer; transition: filter .12s; }
.rb-room-col-cal .fc-event:hover { filter: brightness(1.12); }
.rb-room-col-cal .fc-timegrid-slot-label { color: var(--text-muted); }

/* Kombinierte Übersicht (alle Räume in einem Kalender) */
.rb-combined-wrap { background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 12px; padding: 10px 12px; }
.rb-combined-wrap .fc-event { border-radius: 6px; border: none !important; cursor: pointer; transition: filter .12s; }
.rb-combined-wrap .fc-event:hover { filter: brightness(1.12); }

/* Synthetische Buchung aus einem per Ort-Suchbegriff erkannten DOCUframe-Termin (keine echte
   Raumbuchung, siehe rbFetchDocuframeRoomBookings() in api_raumbuchungen.php) */
.fc-event.rb-event-docuframe { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.14) 0 6px, transparent 6px 12px); }
.rb-event-df-badge { display: inline-block; font-size: 8.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; padding: 1px 5px; margin-right: 4px; border-radius: 999px; background: rgba(255,255,255,.3); color: inherit; vertical-align: middle; }

/* Mitarbeiter-Verfügbarkeit */
.rb-emp-filter { position: relative; }
.rb-emp-filter-btn { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; }
.rb-emp-filter-btn.active { border-color: var(--accent-gold); color: var(--accent-gold); }
.rb-emp-filter-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent-gold); color: var(--btn-text); font-size: 10.5px; font-weight: 700; }
.rb-emp-filter-caret { color: var(--text-muted); transition: transform .15s; }
.rb-emp-filter-btn.active .rb-emp-filter-caret { transform: rotate(180deg); }
.rb-emp-filter-pop { position: absolute; top: calc(100% + 8px); left: 0; z-index: 50; width: 300px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.rb-emp-filter-search-wrap { position: relative; }
.rb-emp-filter-search-wrap svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.rb-emp-filter-search { width: 100%; box-sizing: border-box; background: var(--input-bg); border: 1px solid var(--panel-border); border-radius: 9px; color: var(--text-main); font-size: 13px; padding: 8px 11px 8px 32px; }
.rb-emp-filter-search:focus { border-color: var(--accent-gold); outline: none; }
.rb-emp-filter-list { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -6px; }
.rb-emp-filter-item { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-main); padding: 7px 8px; border-radius: 9px; cursor: pointer; transition: background .12s; }
.rb-emp-filter-item:hover { background: color-mix(in srgb, var(--accent-gold) 14%, transparent); }
.rb-emp-filter-avatar { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--bg-dark); color: var(--text-muted); display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 700; letter-spacing: .3px; }
.rb-emp-filter-item.is-selected .rb-emp-filter-avatar { background: var(--accent-gold); color: var(--btn-text); }
.rb-emp-filter-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-emp-filter-check { flex-shrink: 0; color: var(--accent-gold); opacity: 0; transform: scale(.6); transition: opacity .12s, transform .12s; }
.rb-emp-filter-item.is-selected .rb-emp-filter-check { opacity: 1; transform: scale(1); }
.rb-emp-filter-empty { text-align: center; color: var(--text-muted); font-size: 12px; padding: 18px 0; }
.rb-emp-filter-foot { display: flex; align-items: center; justify-content: center; gap: 8px; padding-top: 8px; border-top: 1px solid var(--panel-border); }
.rb-emp-filter-link { background: none; border: none; color: var(--text-muted); font-size: 11.5px; font-weight: 600; cursor: pointer; padding: 2px 4px; transition: color .12s; }
.rb-emp-filter-link:hover { color: var(--accent-gold); }
.rb-emp-filter-sep { color: var(--panel-border); font-size: 11px; }
.rb-emp-dot, .rb-emp-seg { display: inline-block; border-radius: 3px; }
.rb-emp-dot { width: 9px; height: 9px; }
.rb-emp-dot-free, .rb-emp-seg-free { background: var(--success-green); }
.rb-emp-dot-tentative, .rb-emp-seg-tentative { background: var(--lc-cal-vacation); }
.rb-emp-dot-busy, .rb-emp-seg-busy { background: var(--danger-red); }
.rb-emp-dot-oof, .rb-emp-seg-oof { background: var(--text-muted); }
/* Herkunft eines Belegt-Blocks (M365 vs. synchronisierter DOCUframe-Termin, siehe
   rbFetchDocuframeBlocks() in api_raumbuchungen.php) - Statusfarbe bleibt wie oben, zusätzlich ein
   diagonales Streifenmuster bei DOCUframe-Herkunft (Tooltip zeigt den Klartext beim Hover). */
.rb-emp-dot-docuframe { background: repeating-linear-gradient(45deg, var(--text-muted) 0 3px, transparent 3px 6px); }
.rb-emp-seg-docuframe { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.4) 0 4px, transparent 4px 8px); }
.rb-emp-hours-ruler { display: flex; margin: 0 0 6px 168px; }
.rb-emp-ruler-track { position: relative; flex: 1; height: 16px; font-size: 10.5px; color: var(--text-muted); }
.rb-emp-ruler-track span { position: absolute; transform: translateX(-50%); }
.rb-emp-list { display: flex; flex-direction: column; gap: 6px; }
.rb-emp-row { display: flex; align-items: center; gap: 14px; background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 9px; padding: 9px 14px; }
.rb-emp-name { width: 150px; flex-shrink: 0; font-size: 12.5px; font-weight: 600; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-emp-track { position: relative; flex: 1; height: 18px; background: var(--bg-dark); border-radius: 5px; overflow: hidden; }
.rb-emp-seg { position: absolute; top: 0; height: 100%; border-radius: 0; }

/* Buchungs-/Serien-Modal */
.rb-modal-overlay { display: none; position: fixed; inset: 0; z-index: 1200; background: rgba(0,0,0,.82); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); justify-content: center; align-items: center; padding: 20px; }
.rb-modal-overlay.is-open { display: flex; }
.rb-modal { background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 14px; width: min(980px, calc(100vw - 32px)); max-height: min(900px, calc(100dvh - 32px)); overflow: hidden; display: flex; flex-direction: column; animation: rb-fade-in .18s ease; }
.rb-modal-sm { width: min(92vw, 420px); }
.rb-modal-head { padding: 18px 22px 14px; border-bottom: 1px solid var(--panel-border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.rb-modal-head h2 { margin: 0; font-size: 16px; font-weight: 600; color: var(--accent-gold); }
.rb-modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; min-width: 40px; min-height: 40px; border-radius: 6px; transition: .12s; }
.rb-modal-close:hover { color: var(--text-main); background: rgba(255,255,255,.07); }
.rb-modal-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 24px; }
.rb-modal-foot { padding: 14px 22px; border-top: 1px solid var(--panel-border); display: flex; align-items: center; gap: 8px; justify-content: flex-end; flex-shrink: 0; }
.rb-modal-foot-spacer { flex: 1; }
.rb-modal-foot-col { flex-direction: column; align-items: stretch; }
.rb-modal-conflict { margin-bottom: 14px; padding: 9px 12px; border-radius: 8px; font-size: 12.5px; background: var(--danger-bg); color: var(--danger-red); }
.rb-scope-text { margin: 0; font-size: 13px; color: var(--text-muted); line-height: 1.6; }

.rb-field { margin-bottom: 14px; }
.rb-field-row { display: flex; gap: 10px; }
.rb-field-row .rb-field { flex: 1; }
.rb-field:last-child { margin-bottom: 0; }
.rb-label { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; }
.rb-chk-label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-main); cursor: pointer; }
/* Globales "input, select { width:100% }" (admin.php) stretcht Checkboxen/Radios sonst auf volle
   Breite und reißt Icon und Beschriftung weit auseinander (gleiches Problem wie andernorts im
   Portal, siehe z. B. .lc-dup-ack input/.ckpt-checkbox-row input[type="checkbox"]) - hier explizit
   auf die native Größe zurückgesetzt. */
.rb-chk-label input[type="checkbox"], .rb-chk-label input[type="radio"] { width: 16px; height: 16px; flex: 0 0 auto; margin: 0; accent-color: var(--accent-gold); cursor: pointer; }
.rb-input, .rb-select { width: 100%; box-sizing: border-box; min-height: 42px; background: var(--input-bg); border: 1px solid var(--panel-border); border-radius: 8px; color: var(--text-main); font-size: 13px; padding: 9px 11px; }
.rb-input:focus, .rb-select:focus { border-color: var(--accent-gold); outline: 2px solid color-mix(in srgb, var(--accent-gold) 42%, transparent); outline-offset: 1px; }

.rb-booking-layout { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 28px; }
.rb-booking-column { min-width: 0; }
.rb-booking-section + .rb-booking-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--panel-border); }
.rb-modal-section-title { margin: 0 0 14px; color: var(--text-main); font-size: 13px; font-weight: 700; }
.rb-booking-section .rb-field { margin-bottom: 16px; }
.rb-booking-section .rb-field:last-child { margin-bottom: 0; }
.rb-booking-date-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.rb-booking-date-row .rb-field { min-width: 0; }
.rb-description-input { min-height: 126px; resize: vertical; line-height: 1.5; }
.rb-field-help { display: block; margin-top: 6px; color: var(--text-muted); font-size: 11.5px; line-height: 1.45; }
.rb-modal .rb-btn, .rb-modal .rb-btn-gold, .rb-modal .rb-btn-danger { min-height: 42px; }

@media (max-width: 760px) {
    .rb-modal-overlay { padding: 10px; }
    .rb-modal:not(.rb-modal-sm) { width: 100%; max-height: calc(100dvh - 20px); }
    .rb-modal-body { padding: 16px; }
    .rb-booking-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .rb-booking-column + .rb-booking-column { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--panel-border); }
    .rb-booking-date-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rb-booking-date-row .rb-field:first-child { grid-column: 1 / -1; }
    .rb-modal-foot { padding: 12px 16px; }
}

@media (max-width: 420px) {
    .rb-modal-head { padding: 14px 16px 12px; }
    .rb-modal-foot { flex-wrap: wrap; }
    .rb-modal-foot-spacer { display: none; }
    .rb-modal-foot .rb-btn-danger { margin-right: auto; }
}

/* Fasst inhaltlich zusammengehörige Felder optisch zu Gruppen zusammen (Raum+Titel / Zeitraum+
   Teams-Link / Teilnehmer+Auslastung / Wiederholung) - enger Abstand INNERHALB einer Gruppe
   (.rb-field { margin-bottom }), großzügigerer Abstand + dünne Trennlinie ZWISCHEN Gruppen, damit
   der sonst gleichförmige Buchungsdialog eine klare Lesereihenfolge/Gliederung bekommt, statt einer
   einzigen langen Kette gleich gewichteter Felder. */
.rb-field-group + .rb-field-group { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--panel-border); }

/* Raum-Zusatzinfos (Kapazität/Ausstattung/Teams-Raum) im Buchungsdialog */
.rb-room-info { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.rb-room-info-item { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-muted); background: var(--bg-dark); border: 1px solid var(--panel-border); border-radius: 999px; padding: 4px 10px; }
.rb-room-info-item svg { flex-shrink: 0; color: var(--accent-gold); }
.rb-room-info-teams { color: var(--accent-gold); border-color: color-mix(in srgb, var(--accent-gold) 40%, var(--panel-border)); }
.rb-room-info-empty { font-size: 11.5px; color: var(--text-muted); font-style: italic; }

/* Hinweisblock im Buchungsdialog für synthetische, nicht bearbeitbare DOCUframe-Buchungen */
.rb-df-info-badge { display: inline-block; font-size: 11.5px; font-weight: 600; color: var(--accent-gold); background: color-mix(in srgb, var(--accent-gold) 14%, transparent); border-radius: 8px; padding: 7px 11px; }
.rb-df-info-ort { margin-top: 7px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
.rb-df-copy-btn { display: inline-flex; align-items: center; justify-content: center; background: none; border: 1px solid var(--panel-border); border-radius: 6px; color: var(--text-muted); cursor: pointer; padding: 4px; flex-shrink: 0; transition: .12s; }
.rb-df-copy-btn:hover { color: var(--accent-gold); border-color: var(--accent-gold); }

/* Termin-Inhaber-Hinweis im Buchungsdialog (nur bei fremden Terminen, siehe is_own) */
.rb-owner-info { display: inline-block; font-size: 12px; color: var(--text-muted); }

.rb-attendee-add { display: flex; gap: 6px; position: relative; }
.rb-attendee-add .rb-input { flex: 1; }
.rb-attendee-chips, .rb-weekday-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rb-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-dark); border: 1px solid var(--panel-border); border-radius: 999px; padding: 4px 6px 4px 10px; font-size: 11.5px; color: var(--text-main); }
.rb-chip button { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
.rb-chip button:hover { color: var(--danger-red); }

/* Teilnehmer-Verfügbarkeit im Buchungsdialog (Gantt-Auslastungsansicht wie im Lead-Controlling-
   Terminplanungsdialog, siehe .lc-event-gantt* weiter oben / rbCheckAttendeeAvailability()):
   graue Balken = bestehende Termine, rot = Konflikt mit der geplanten Buchung, goldener Rahmen =
   die geplante Buchung selbst (per Drag verschiebbar, per Griffe an den Rändern in der Dauer
   veränderbar). */
.rb-avail-gantt { border: 1px solid var(--panel-border); border-radius: 10px; background: var(--bg-dark); padding: 10px 12px 8px; margin-top: 8px; }
.rb-avail-gantt-hours { position: relative; height: 16px; margin: 0 0 4px 130px; }
.rb-avail-gantt-hour { position: absolute; top: 0; transform: translateX(-50%); font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.rb-avail-gantt-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; border-top: 1px solid var(--panel-border); }
.rb-avail-gantt-row:first-of-type { border-top: none; }
.rb-avail-gantt-name { flex: 0 0 120px; font-size: 12px; font-weight: 600; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-avail-gantt-name.is-conflict { color: var(--danger-red); }
.rb-avail-gantt-unknown { font-size: 10.5px; font-weight: 400; color: var(--text-muted); }
.rb-avail-gantt-track { position: relative; flex: 1 1 auto; height: 20px; background: var(--panel-bg); border-radius: 5px; overflow: visible; }
.rb-avail-gantt-track-unknown { opacity: .5; }
.rb-avail-gantt-block { position: absolute; top: 2px; bottom: 2px; background: var(--text-muted); border-radius: 3px; opacity: .55; }
.rb-avail-gantt-block.is-conflict { background: var(--danger-red); opacity: .85; }
.rb-avail-gantt-target { position: absolute; top: -1px; bottom: -1px; z-index: 2; border: 2px solid var(--accent-gold); border-radius: 4px; background: color-mix(in srgb, var(--accent-gold) 18%, transparent); cursor: grab; touch-action: none; user-select: none; }
.rb-avail-gantt-target:active,
.rb-avail-gantt-target.is-dragging { cursor: grabbing; background: color-mix(in srgb, var(--accent-gold) 28%, transparent); }
.rb-avail-gantt-resize-handle { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; }
.rb-avail-gantt-resize-handle[data-side="left"] { left: -4px; }
.rb-avail-gantt-resize-handle[data-side="right"] { right: -4px; }

/* Teilnehmer-Suche: Vorschlagsliste (Mitarbeiter/Verkäufer + freie E-Mail) */
.rb-attendee-suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 38px; z-index: 60; max-height: 260px; overflow-y: auto; padding: 6px; }
.rb-attendee-suggest-item { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 9px; cursor: pointer; }
.rb-attendee-suggest-item:hover, .rb-attendee-suggest-item.is-active { background: color-mix(in srgb, var(--accent-gold) 14%, transparent); }
.rb-attendee-suggest-avatar { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--bg-dark); color: var(--text-muted); display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 700; }
.rb-attendee-suggest-avatar-plus { background: var(--accent-gold); color: var(--btn-text); font-size: 15px; }
.rb-attendee-suggest-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.rb-attendee-suggest-name { font-size: 12.5px; font-weight: 600; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-attendee-suggest-email { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-attendee-suggest-badge { flex-shrink: 0; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; padding: 3px 7px; border-radius: 999px; }
.rb-attendee-badge-mitarbeiter { background: color-mix(in srgb, var(--accent-gold) 16%, transparent); color: var(--accent-gold); }
.rb-attendee-badge-verkaeufer { background: color-mix(in srgb, #5b8dd9 16%, transparent); color: #5b8dd9; }
.rb-attendee-suggest-freeform .rb-attendee-suggest-name { color: var(--accent-gold); }

.rb-weekday-chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--panel-border); border-radius: 7px; padding: 5px 9px; font-size: 11.5px; color: var(--text-muted); cursor: pointer; }
.rb-weekday-chip:has(input:checked) { border-color: var(--accent-gold); color: var(--accent-gold); }
.rb-weekday-chip input[type="checkbox"] { width: 13px; height: 13px; flex: 0 0 auto; margin: 0; accent-color: var(--accent-gold); cursor: pointer; }
.rb-recurrence-box { background: var(--bg-dark); border: 1px solid var(--panel-border); border-radius: 10px; padding: 14px; margin-bottom: 14px; }

/* Rechtsklick-Kontextmenü (gleiches Grundgerüst wie .lc-ctx-menu/.side-ctx-menu) */
.rb-ctx-menu { position: fixed; z-index: 2000; min-width: 190px; padding: 6px; border-top: 2px solid var(--accent-gold); }
.rb-ctx-item { display: flex; align-items: center; gap: 9px; width: 100%; background: none; border: none; text-align: left; color: var(--text-main); font-size: 12.5px; padding: 8px 10px; border-radius: 7px; cursor: pointer; transition: .12s; }
.rb-ctx-item:hover { background: color-mix(in srgb, var(--accent-gold) 14%, transparent); color: var(--accent-gold); }

/* Mitarbeiter-Verfügbarkeit: anklickbarer Termin-Block + Detail-Popover (Betreff/Organisator/Ort/
   Teilnehmer, nur bei 'raumbuchungen.details'/Admin, siehe rbShowEmpBlockDetail()) */
.rb-emp-seg-clickable { cursor: pointer; }
.rb-emp-detail-pop { position: fixed; z-index: 2000; min-width: 220px; max-width: 320px; padding: 12px 14px; border-top: 2px solid var(--accent-gold); }
.rb-emp-detail-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }
.rb-emp-detail-src { font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.rb-emp-detail-subject { font-size: 13px; font-weight: 600; color: var(--text-main); margin-bottom: 6px; }
.rb-emp-detail-row { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* Raumverwaltung */
.rb-room-settings-list { display: flex; flex-direction: column; gap: 10px; }
.rb-room-settings-card { display: flex; align-items: flex-start; gap: 14px; background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 12px; padding: 14px 16px; }
.rb-rsc-color input { width: 38px; height: 38px; border: 1px solid var(--panel-border); border-radius: 8px; background: none; cursor: pointer; padding: 2px; }
.rb-rsc-main { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.rb-rsc-name { font-size: 14px; font-weight: 600; max-width: 320px; }
.rb-rsc-mail { font-size: 11.5px; color: var(--text-muted); }
.rb-rsc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; font-size: 11.5px; color: var(--text-muted); }
.rb-rsc-row label { display: flex; align-items: center; gap: 6px; }
.rb-rsc-capacity, .rb-rsc-order { width: 70px; }
.rb-rsc-df-hint { font-size: 11px; color: var(--text-muted); font-style: italic; }
.rb-rsc-save { align-self: center; flex-shrink: 0; }

@media (max-width: 900px) {
    .rb-page { padding: 16px; }
    .rb-rooms-grid { flex-wrap: nowrap; }
    .rb-emp-hours-ruler { margin-left: 0; display: none; }
    .rb-emp-name { width: 96px; }
}

/* -- Kundendienst-Sync-Overlay (html/admin.php, window.HbbKdSync) -- Wiederverwendung der
   hbb-df-*-Klassen (DOCUframe-Leads-Import, Abschnitt "Benutzerverwaltung" o.ä. weiter oben) für
   identische Optik; nur diese Zusatzklasse verschiebt den zweiten Overlay nach oben, damit beide
   gleichzeitig sichtbar sein können, ohne sich zu überlappen. Per ID adressiert (statt nur über die
   Klasse), da admin.php sein eigenes <style>-Grundgerüst für .hbb-df-overlay (bottom:20px) ERST NACH
   dem <link> auf diese Datei einbindet - bei gleicher Spezifität (0,1,0 vs. 0,1,0) gewann bislang die
   spätere Regel aus admin.php und hob den Versatz wieder auf (beide Overlays landeten auf bottom:20px
   übereinander/nebeneinander, siehe Live-Test 2026-11-06). Eine ID-Regel (1,0,0) schlägt das zuverlässig,
   unabhängig von der Reihenfolge im Dokument. */
#hbb-kd-overlay.hbb-kd-overlay-slot { bottom: 92px; }
@media (max-width: 480px) {
    #hbb-kd-overlay.hbb-kd-overlay-slot { bottom: 82px; }
}

/* -- Kundendienst: Einstellungen-Tab (html/modules/kundendienst.php) -- Wiederverwendung der
   zentralen .lc-dfauto-mode-toggle/-fields/-times-*-Klassen (Intervall-/Uhrzeiten-Umschalter,
   bereits oben zentral definiert) für identische Optik wie beim DOCUframe-Leads-Autosync. */
.kd-settings-box { margin-bottom: 18px; padding: 18px 20px; background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 12px; }
.kd-settings-box-title { margin: 0 0 6px; font-size: 15px; color: var(--text-main); font-weight: 600; }
.kd-settings-box-desc { font-size: 12px; color: var(--text-muted); margin: 0 0 14px; line-height: 1.6; }
.kd-inline-check { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-main); cursor: pointer; margin-bottom: 14px; }
.kd-inline-check input { width: 14px; height: 14px; accent-color: var(--accent-gold); }
.kd-settings-label { display: block; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.55px; color: var(--text-muted); margin-bottom: 6px; }
.kd-settings-select { max-width: 220px; width: 100%; box-sizing: border-box; padding: 8px 10px; background: var(--input-bg); border: 1px solid var(--panel-border); border-radius: 8px; color: var(--text-main); font-size: 12.5px; outline: none; }
.kd-settings-select:focus { border-color: var(--accent-gold); }
.kd-settings-save-row { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.kd-settings-saved-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--success-green); }
.kd-settings-error-text { font-size: 12px; color: var(--danger-red); }
.kd-settings-lastrun-text { font-size: 11px; color: var(--text-muted); margin-left: auto; }

/* ── Mängel-Kategorisierung durch KI (Einstellungen-Box, siehe lib_kd_kategorisierung.php) ──── */
.kd-kat-tree { border: 1px solid var(--panel-border); border-radius: 10px; padding: 6px; max-height: 360px; overflow-y: auto; }
.kd-kat-empty { padding: 14px 10px; font-size: 12px; color: var(--text-muted); text-align: center; }
.kd-kat-row { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 7px; font-size: 13px; color: var(--text-main); }
.kd-kat-row:hover { background: color-mix(in srgb, var(--brand-accent) 5%, transparent); }
.kd-kat-row-unter { margin-left: 22px; font-size: 12.5px; color: var(--text-muted); }
.kd-kat-row-unter::before { content: '\21b3'; margin-right: -2px; opacity: .6; }
.kd-kat-name { cursor: pointer; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 2px 4px; border-radius: 4px; }
.kd-kat-name:hover { background: color-mix(in srgb, var(--brand-accent) 8%, transparent); }
.kd-kat-rename-input { flex: 1; min-width: 0; background: var(--input-bg); border: 1px solid var(--accent-gold); border-radius: 5px; padding: 3px 6px; color: var(--text-main); font-size: inherit; font-family: inherit; outline: none; }
.kd-kat-count { font-size: 10.5px; color: var(--text-muted); background: var(--bg-dark); border-radius: 999px; padding: 1px 7px; flex-shrink: 0; }
.kd-kat-icon-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: .12s; }
.kd-kat-icon-btn:hover { background: color-mix(in srgb, var(--brand-accent) 10%, transparent); color: var(--brand-accent); }
.kd-kat-icon-btn-danger:hover { background: color-mix(in srgb, var(--danger-red) 10%, transparent); color: var(--danger-red); }
.kd-kat-children { margin-bottom: 4px; }
.kd-kat-add-row { display: flex; align-items: center; gap: 6px; padding: 5px 8px 5px 22px; }
.kd-kat-tree > .kd-kat-add-row { padding-left: 8px; margin-top: 4px; border-top: 1px solid var(--panel-border); padding-top: 10px; }
.kd-kat-add-input { flex: 1; min-width: 0; background: transparent; border: 1px dashed var(--panel-border); border-radius: 6px; padding: 5px 8px; color: var(--text-main); font-size: 12.5px; font-family: inherit; outline: none; }
.kd-kat-add-input:focus { border-color: var(--accent-gold); border-style: solid; }
.kd-kat-progress-wrap { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.kd-kat-progress-bar { flex: 1 1 160px; min-width: 120px; height: 7px; background: var(--bg-dark); border-radius: 999px; overflow: hidden; }
.kd-kat-progress-fill { height: 100%; background: var(--accent-gold); border-radius: 999px; transition: width .3s ease; }
.kd-kat-progress-fill.is-error { background: var(--danger-red); }

/* ── Kategorie-Zelle der Mängel-Tabelle (siehe kdKategorieCellHtml() in kundendienst.php) - Ampel-
   Punkt symbolisiert die KI-Sicherheit (grün/gelb/rot), %-Wert nur als title-Tooltip. ── */
.kd-kat-cell { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.kd-kat-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.kd-kat-dot-high   { background: var(--success-green); }
.kd-kat-dot-mid    { background: #e8b339; }
.kd-kat-dot-low    { background: var(--danger-red); }
.kd-kat-dot-manual { background: var(--success-green); box-shadow: 0 0 0 2px color-mix(in srgb, var(--success-green) 25%, transparent); }
.kd-kat-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Klickbare Kategorie-Zeile in der Vollansicht (Drawer-Tab "Details", siehe kdDrawerKategorieClick()
   in kundendienst.php) - öffnet dasselbe kaskadierende Untermenü wie das Rechtsklickmenü der Tabelle. */
.kd-info-value-clickable { cursor: pointer; border-radius: 5px; padding: 1px 4px; margin: -1px -4px; transition: background .12s ease; }
.kd-info-value-clickable:hover { background: color-mix(in srgb, var(--brand-accent) 8%, transparent); }

.kd-lastsync-text { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.kd-user-chip { position: relative; display: inline-block; border-bottom: 1px dashed var(--panel-border); cursor: default; }
.kd-user-chip:hover { border-bottom-color: var(--accent-gold); color: var(--accent-gold); }
.kd-user-popover { display: none; position: absolute; left: 0; bottom: 100%; margin-bottom: 6px; z-index: 20; background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 8px; padding: 6px; box-shadow: 0 8px 20px rgba(0,0,0,0.35); white-space: nowrap; }
.kd-user-chip:hover .kd-user-popover, .kd-user-chip:focus-within .kd-user-popover { display: flex; flex-direction: column; gap: 2px; }
.kd-user-popover-action { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 6px; font-size: 11.5px; color: var(--text-main); text-decoration: none; transition: 0.12s; }
.kd-user-popover-action:hover { background: rgba(197,164,126,0.12); color: var(--accent-gold); }

/* -- Kundendienst: Kundenbelastung (DOCUframe "_Betrag") -- Badge in Tabelle/Gantt + Chip in der
   Filterleiste. Semantik: ist hier ein Betrag hinterlegt, wird der Mangel dem Kunden in Rechnung
   gestellt und der Betrag ist die Marge der Firma an diesem Mangel - NICHT der Mangel-/Schadenswert. */
.kd-badge-belastung { display: inline-flex; align-items: center; gap: 4px; background: rgba(197,164,126,0.14); color: var(--accent-gold); border: 1px solid rgba(197,164,126,0.3); }
.kd-gantt-belastung-marker { display: inline-block; margin-left: 5px; color: var(--accent-gold); font-weight: 700; font-size: 11px; cursor: default; }
/* Stat-Chip-Farbvariante für den "Kundenbelastung"-Chip (.kd-stat-chip Basis siehe
   html/modules/kundendienst.php, dortiges <style>-Grundgerüst - neue Varianten kommen zentral
   hierher statt in die lokale Block-Datei). */
.kd-stat-chip-gold { color: var(--accent-gold); }
.kd-stat-chip-gold.active { background: var(--accent-gold); border-color: var(--accent-gold); }

    @container kd-kundendienst (max-width: 1310px) {
        .kd-table-wrap table.kd-table thead { display: none; }
        .kd-table-wrap .kd-table tbody tr.kd-row-main { grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); }
        .kd-table-wrap .kd-table tbody tr.kd-row-main > .kd-worklist-block-identity { grid-column:1/-1; }
        .kd-table-wrap .kd-table tbody tr.kd-row-main > .kd-worklist-block-project { grid-column:1; }
        .kd-table-wrap .kd-table tbody tr.kd-row-main > .kd-worklist-block-readiness { grid-column:2; }
        .kd-table-wrap .kd-worklist-block-project { border-left:0 !important; }
        .kd-table-wrap .kd-worklist-block-readiness { border-left:1px solid var(--panel-border) !important; }
        .kd-table-wrap .kd-expand-grid { grid-template-columns:minmax(0,1fr) minmax(0,1.15fr); }
        .kd-table-wrap .kd-expand-activity { grid-column:1/-1; padding-top:14px; border-top:1px solid var(--panel-border); border-left:0; }
    }

    @container kd-kundendienst (max-width: 680px) {
        .kd-table-wrap .kd-worklist-overview { align-items:flex-start; flex-direction:column; gap:8px; }
        .kd-table-wrap .kd-worklist-stats { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:100%; }
        .kd-worklist-identity-head { flex-wrap:nowrap; align-items:flex-start; }
        .kd-worklist-warranty-stacked { flex:0 1 auto; max-width:58%; }
        .kd-table-wrap .kd-table tbody tr.kd-row-main { grid-template-columns:minmax(0,1fr); }
        .kd-table-wrap .kd-table tbody tr.kd-row-main > .kd-worklist-block-identity,
        .kd-table-wrap .kd-table tbody tr.kd-row-main > .kd-worklist-block-project,
        .kd-table-wrap .kd-table tbody tr.kd-row-main > .kd-worklist-block-readiness { grid-column:1; }
        .kd-table-wrap .kd-table tbody tr.kd-row-main > .kd-worklist-block { border-left:0 !important; }
        .kd-table-wrap .kd-table tbody tr.kd-row-main > .kd-worklist-block + .kd-worklist-block { border-top:1px solid var(--panel-border); }
        .kd-table-wrap .kd-worklist-block-readiness .kd-effort-input { min-height:44px; }
        .kd-table-wrap .kd-expand-grid { grid-template-columns:minmax(0,1fr); }
        .kd-table-wrap .kd-expand-section { padding:12px 0; border-left:0; }
        .kd-table-wrap .kd-expand-section + .kd-expand-section { border-top:1px solid var(--panel-border); }
        .kd-table-wrap .kd-expand-activity { grid-column:auto; }
        .kd-table-wrap .kd-expand-add-entry { grid-template-columns:minmax(0,1fr); }
        .kd-table-wrap .kd-expand-add-entry .kd-btn { justify-self:start; }
    }

    @container kd-detail-drawer (max-width: 520px) {
        .kd-drawer-head { padding: 14px 16px; }
        .kd-drawer .kd-drawer-name { font-size: 14px; }
        .kd-tab-panel { padding: 16px 14px; }
        .kd-drawer .kd-info-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; align-items: start; }
        .kd-drawer .kd-info-label { min-width: 0; }
    }
}

/* ══════════════════════════════════════════════════════════════════════════════════════════
   Dokumente (html/modules/dokumente_pool.php + html/api_document_pool.php) — zentrale
   Dokumentenablage (EINE gemeinsame Ordnerstruktur, Marke als Badge/Filter je Ordner/Dokument)
   mit Ordnerbaum, Karteikarten-Grid, Drag & Drop-Upload/-Versionierung, Versionsverlauf und
   optionaler Freigabe auf Rollen/einzelne Nutzer. Präfix dp-.
   ══════════════════════════════════════════════════════════════════════════════════════════ */
.dp-page { padding: 28px 32px; display: flex; flex-direction: column; height: 100%; min-height: 0; }
.dp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.dp-page-title { margin: 0; font-size: 24px; color: var(--text-main); }
.dp-page-sub { margin: 8px 0 0; color: var(--text-muted); font-size: 13px; max-width: 60ch; line-height: 1.6; }

/* -- Marken-Badge: farbiger Punkt je Marke (hbb_document_folders.brand/hbb_document_files.brand,
   siehe dpBrandDefs() in api_document_pool.php) - NEBEN Ordner-/Dokumentnamen, auf Karteikarten
   sowie als Indikator-Punkt im Marken-Filter-Dropdown der Toolbar. -- */
.dp-brand-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; transition: background .15s; }
/* -- Filter-Punkt in der Toolbar (#dp-brand-filter-dot): bekommt über JS nur die Hintergrund-
   farbe gesetzt (dpRenderBrandFilter()), Größe stammt aus der Basisklasse oben - anders als die
   dynamisch erzeugten Badges auf Karten/Baum/Breadcrumb, die ihre Größe inline per Style
   mitbringen (siehe dpBrandBadge() in dokumente_pool.php). -- */

.dp-body { display: flex; gap: 22px; flex: 1; min-height: 0; }

/* -- Ordnerbaum-Sidebar -- */
/* Feste Breite ist nur der Startwert - per Drag-Griff (.dp-sidebar-resize-handle) frei anpassbar
   und in localStorage gemerkt (siehe initSidebarResize() in dokumente_pool.php), damit tiefe
   Ordnerstrukturen mit langen Namen nicht zwangsläufig abgeschnitten werden (Nutzerwunsch
   2026-11-11). overflow: visible (statt hidden) wird gebraucht, damit der halb über den Rand
   ragende Drag-Griff nicht selbst abgeschnitten wird - der innere .dp-tree-Bereich rundet seine
   Ecken daher selbst ab. */
.dp-sidebar { position: relative; width: 260px; min-width: 200px; max-width: 560px; flex-shrink: 0; display: flex; flex-direction: column; background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 14px; overflow: visible; }
.dp-sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); border-bottom: 1px solid var(--panel-border); border-radius: 14px 14px 0 0; }
.dp-tree { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px; border-radius: 0 0 14px 14px; }
.dp-tree-loading { padding: 20px; text-align: center; font-size: 12px; color: var(--text-muted); }
.dp-tree-list { list-style: none; margin: 0; padding-left: 14px; }
.dp-tree-item { margin: 1px 0; }
/* Einrückung je Verschachtelungsebene - während des "Schwenkens" (Hover/Anklicken eines tiefer
   verschachtelten Ordners, siehe dpTreePanToFolder() in dokumente_pool.php) wird sie für GENAU
   die Vorfahren-Ebenen des Zielordners sanft reduziert statt komplett entfernt (.is-pan-active),
   damit lange Namen in tiefen Ebenen mehr Platz bekommen (Nutzerwunsch 2026-11-11).
   Vorfall 2026-11-11 (mehrere verworfene Anläufe, alle mit demselben Grundproblem): sowohl eine
   width-Animation auf einem Wrapper-Element als auch ein Trick mit width+gegenläufigem transform
   verschieben zwar sichtbar etwas, verankern dabei aber geometrisch zwangsläufig IRGENDEINEN Rand
   der Zeile (meist den rechten) an fester Position - nachfolgende Elemente wie das Anzahl-Badge,
   die nahe diesem verankerten Rand sitzen, blieben dadurch beim Schwenken nahezu unbewegt, während
   Icon/Name sichtbar glitten ("Badge hüpft schneller als sich die Ordner bewegen"). Eine direkte
   Transition auf padding-left umgeht dieses Problem komplett: es gibt keinen zweiten,
   gegenläufigen Effekt, der einen Rand künstlich verankert - die Zeile (inkl. Badge) bewegt sich
   dadurch als EIN zusammenhängendes, gleichmäßig schnelles Stück, und die dadurch tatsächlich
   gewonnene Breite (weniger Innen-Abstand) steht dem Namen GENAUSO zur Verfügung wie zuvor der
   Ellipsis-Kürzung (.dp-tree-name bleibt dabei unverändert, inkl. "...", siehe dort). */
.dp-tree-list { transition: padding-left .32s cubic-bezier(.25,.1,.25,1); }
.dp-tree-list.is-pan-active { padding-left: 3px; }
.dp-tree-list[data-depth="0"] { padding-left: 0; }
/* Verschachtelte Hover-/Auswahl-Hervorhebung (Nutzerwunsch 2026-11-11): beim Hover oder bei
   aktiver Auswahl eines Ordners bekommen auch dessen umgebende Eltern-"Blöcke" (die jeweilige
   <ul>, die den Ordner und seine Geschwister enthält) einen Hintergrund-Tint, der mit
   zunehmendem Abstand zur eigentlichen Zeile schwächer wird ("aktueller Ordner > aktueller
   Unterordnerblock usw., immer weiter ausgefaded") - macht auf einen Blick sichtbar, in welchem
   Ast man sich gerade befindet. Die konkrete Opazität je Ebene wird inline per JS gesetzt
   (dpTreePanToFolder() in dokumente_pool.php), da die Verschachtelungstiefe nicht im Voraus
   bekannt ist - nur Übergang/Form stehen hier fest. */
.dp-tree-list.is-hover-ancestor { border-radius: 8px; transition: background .18s ease, padding-left .32s cubic-bezier(.25,.1,.25,1); }
/* Wrapper um die eigentliche Ordnerhierarchie (NICHT die Fixpunkte Prospekte/Corporate Design/
   Alle Dokumente darüber, die bleiben immer an fester Position) - braucht selbst keine eigenen
   Styles mehr (reine Gruppierung für den querySelectorAll-Scope in dokumente_pool.php), die
   eigentliche Animation läuft komplett über die .dp-tree-list-Einrückung oben. */
/* Drag-Griff zum Verbreitern/Verschmälern der Sidebar - schmaler Hit-Bereich, aber nur ein
   dezenter 2px-Strich sichtbar (voll sichtbar erst bei Hover/während des Ziehens), damit er im
   Ruhezustand nicht wie eine optische Trennlinie wirkt. Doppelklick setzt die Breite zurück
   (siehe initSidebarResize()). */
.dp-sidebar-resize-handle { position: absolute; top: 0; right: -5px; width: 10px; height: 100%; cursor: col-resize; z-index: 3; }
.dp-sidebar-resize-handle::after { content: ''; position: absolute; top: 0; left: 4px; width: 2px; height: 100%; background: transparent; border-radius: 2px; transition: background .15s; }
.dp-sidebar-resize-handle:hover::after { background: var(--accent-gold); }
body.dp-sidebar-resizing { cursor: col-resize; user-select: none; }
body.dp-sidebar-resizing .dp-sidebar-resize-handle::after { background: var(--accent-gold); }
.dp-tree-row, .dp-tree-pinned, .dp-tree-root { display: flex; align-items: center; gap: 7px; padding: 7px 8px; border-radius: 8px; font-size: 12.5px; color: var(--text-main); cursor: pointer; transition: background .13s, box-shadow .15s; user-select: none; }
/* Hover-Hintergrund der EINZELNEN Zeile - deutlich kräftiger als zuvor (.04 -> .11 plus dezenter
   Rahmen), da seit der verschachtelten Ausfade-Hervorhebung oben (.is-hover-ancestor, ebenfalls
   ein Gold-Tint auf dem umgebenden Eltern-Block) ein zu schwacher Zeilen-Hover sonst im Tint des
   gesamten Blocks untergeht - Nutzerwunsch 2026-11-11: "auch bei Hover muss der Ordner unter der
   Maus etwas hervorgehoben werden". Bewusst neutral/weiß (nicht Gold) gehalten, damit "DIESE eine
   Zeile" klar von "der ganze Unterordner-Block" unterscheidbar bleibt. */
.dp-tree-row:hover, .dp-tree-pinned:hover, .dp-tree-root:hover { background: rgba(255,255,255,.16); box-shadow: inset 3px 0 0 rgba(255,255,255,.35); }
.dp-tree-row.is-active, .dp-tree-pinned.is-active, .dp-tree-root.is-active { background: rgba(214,175,84,.14); color: var(--accent-gold); font-weight: 600; }
.dp-tree-row.is-active:hover, .dp-tree-pinned.is-active:hover, .dp-tree-root.is-active:hover { background: rgba(214,175,84,.2); box-shadow: none; }
.dp-tree-row.is-dragover, .dp-tree-root.is-dragover, .dp-tree-pinned.is-dragover { background: rgba(102,157,36,.16); box-shadow: inset 0 0 0 1.5px var(--accent-gold); }
.dp-tree-pinned { margin-bottom: 4px; padding-bottom: 8px; border-bottom: 1px dashed var(--panel-border); border-radius: 0; }
.dp-tree-root { margin-bottom: 2px; }
.dp-tree-toggle { width: 14px; height: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--text-muted); transition: transform .18s; }
.dp-tree-toggle.is-leaf { visibility: hidden; }
.dp-tree-toggle.is-expanded { transform: rotate(90deg); }
.dp-tree-chevron { display: block; }
/* Das Ordner-Icon selbst ist ein nacktes <svg> ohne eigene Klasse (siehe DP_FOLDER_ICON in
   dokumente_pool.php) - braucht trotzdem flex-shrink:0 wie die übrigen Icons/Badges in der Zeile:
   sobald .dp-tree-name (siehe unten) beim Schwenken ihre Ellipsis-Kürzung verliert und auf volle
   Breite wächst, würde der Flex-Container sonst den dadurch entstehenden Platzmangel anteilig auch
   auf dieses Icon umlegen und es bis auf 0px zusammenschrumpfen (beobachteter Darstellungsfehler). */
.dp-tree-row > svg, .dp-tree-pinned > svg, .dp-tree-root > svg { flex-shrink: 0; }
.dp-tree-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-tree-count { font-size: 10px; color: var(--text-muted); background: var(--bg-dark); border: 1px solid var(--panel-border); border-radius: 20px; padding: 1px 7px; flex-shrink: 0; }
.dp-tree-lock, .dp-tree-shared { color: var(--text-muted); flex-shrink: 0; display: flex; opacity: .7; }
.dp-tree-shared { color: var(--accent-gold); opacity: 1; }

/* -- Kontextmenü (Rechtsklick auf Ordner) -- */
.dp-ctx-menu { position: fixed; z-index: 1400; display: none; flex-direction: column; min-width: 210px; background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 10px; box-shadow: 0 14px 34px rgba(0,0,0,.35); padding: 6px; }
.dp-ctx-menu.is-open { display: flex; }
.dp-ctx-menu button { all: unset; box-sizing: border-box; display: block; width: 100%; padding: 8px 10px; border-radius: 7px; font-size: 12.5px; color: var(--text-main); cursor: pointer; }
.dp-ctx-menu button:hover { background: rgba(255,255,255,.06); }
.dp-ctx-menu .dp-ctx-danger { color: var(--danger-red); }

/* -- Hauptbereich: Toolbar + Breadcrumb + Grid -- */
.dp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
/* Eine zusammenhängende, klar umrandete Toolbar-Karte (statt lose auf dem Seitenhintergrund
   schwebender Einzelelemente, siehe Nutzerwunsch 2026-11-10 "Suche/Sortierung/Filter sind
   unübersichtlich") - Breadcrumb oben, Suche/Marken-Filter/Sortierung als einheitliche
   Pill-Controls in einer Reihe darunter. */
.dp-toolbar { display: flex; flex-direction: column; gap: 12px; background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; }
.dp-breadcrumb { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; flex-wrap: wrap; gap: 4px; min-width: 0; }
.dp-crumb-link { color: var(--text-muted); cursor: pointer; text-decoration: none; }
.dp-crumb-link:hover { color: var(--accent-gold); text-decoration: underline; }
.dp-crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--text-main); font-weight: 600; }
.dp-crumb-sep { opacity: .5; }
.dp-crumb-readonly { font-size: 11px; opacity: .7; }
.dp-toolbar-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* Suche, Marken-Filter und Sortierung teilen sich dieselbe Pill-Optik (Icon/Punkt + Eingabe-
   bzw. Auswahlfeld), damit alle drei auf den ersten Blick als zusammengehörige Werkzeugleiste
   erkennbar sind, statt wie zuvor unterschiedlich gestaltet (Suchfeld vs. nackter <select> vs.
   lose Chip-Reihe) nebeneinander zu stehen. */
.dp-filter-control { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.03); border: 1px solid var(--panel-border); border-radius: 9px; padding: 8px 12px; color: var(--text-muted); transition: border-color .15s; }
.dp-filter-control:focus-within { border-color: var(--accent-gold); }
.dp-filter-control svg { flex-shrink: 0; }
.dp-filter-select { all: unset; font-size: 12.5px; color: var(--text-main); cursor: pointer; }
.dp-search-control { min-width: 220px; flex: 1 1 220px; }
.dp-search-control .dp-filter-select { flex: 1; cursor: text; }
.dp-upload-btn { position: relative; overflow: hidden; cursor: pointer; }
.dp-upload-btn input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dp-versions-upload-btn { margin-bottom: 14px; }

/* -- Drop-Zone: ganzflächiges Overlay beim Ziehen einer OS-Datei über den Inhaltsbereich -- */
.dp-dropzone-wrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.dp-dropzone-overlay { position: absolute; inset: 0; z-index: 20; display: none; align-items: center; justify-content: center; background: rgba(20,20,20,.72); border: 2.5px dashed var(--accent-gold); border-radius: 16px; backdrop-filter: blur(2px); pointer-events: none; }
.dp-dropzone-wrap.is-dragover .dp-dropzone-overlay { display: flex; }
.dp-dropzone-inner { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--accent-gold); font-size: 15px; font-weight: 700; animation: dpBounceIn .35s cubic-bezier(.34,1.56,.64,1); }
@keyframes dpBounceIn { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* -- Karteikarten-Grid -- */
.dp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; opacity: 0; }
.dp-grid.dp-grid-in { animation: dpGridIn .28s ease both; }
@keyframes dpGridIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.dp-grid-loading { grid-column: 1 / -1; text-align: center; padding: 40px; color: var(--text-muted); font-size: 12.5px; }

.dp-card { position: relative; display: flex; flex-direction: column; background: linear-gradient(160deg, var(--panel-bg) 0%, rgba(255,255,255,.02) 100%); border: 1px solid var(--panel-border); border-radius: 14px; overflow: hidden; transition: transform .18s cubic-bezier(.22,1,.36,1), box-shadow .2s, border-color .2s; animation: dpCardIn .22s ease both; }
@keyframes dpCardIn { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
.dp-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(0,0,0,.25); border-color: rgba(255,255,255,.16); }
.dp-card.is-dragover { border-color: var(--accent-gold); box-shadow: 0 0 0 3px rgba(214,175,84,.22); }
.dp-card-thumb { position: relative; height: 112px; display: flex; align-items: center; justify-content: center; background: var(--bg-dark); overflow: hidden; }
.dp-card-thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dp-card-thumb-fallback { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.dp-card-thumb .dp-brand-dot { position: absolute; top: 8px; left: 8px; z-index: 2; box-shadow: 0 0 0 2px rgba(0,0,0,.45); }
.dp-card-version-badge { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.65); color: #fff; font-size: 10px; font-weight: 700; border-radius: 20px; padding: 2px 8px; cursor: pointer; }
.dp-card-body { padding: 10px 12px; flex: 1; min-width: 0; }
.dp-card-name { display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--text-main); overflow: hidden; }
.dp-card-name { text-overflow: ellipsis; white-space: nowrap; }
.dp-card-shared-icon { flex-shrink: 0; color: var(--accent-gold); display: inline-flex; }
.dp-card-meta { font-size: 10.5px; color: var(--text-muted); margin-top: 3px; }
.dp-card-meta-muted { opacity: .75; }
.dp-card-actions { display: flex; gap: 4px; padding: 0 10px 10px; opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s; flex-wrap: wrap; }
.dp-card:hover .dp-card-actions, .dp-card:focus-within .dp-card-actions { opacity: 1; transform: none; }
.dp-card-readonly .dp-card-actions { opacity: 1; transform: none; }

/* -- Icons/Buttons (klein, rund) -- */
.dp-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--panel-border); background: rgba(255,255,255,.03); color: var(--text-muted); cursor: pointer; text-decoration: none; transition: .15s; }
.dp-icon-btn:hover { color: var(--accent-gold); border-color: var(--accent-gold); background: rgba(214,175,84,.1); }
.dp-icon-btn-danger:hover { color: var(--danger-red); border-color: var(--danger-red); background: rgba(224,90,90,.1); }

/* -- "Für Hubert bereitstellen" (admin-only, siehe dpHubertBtnHtml() in modules/dokumente_pool.php) -- */
.dp-icon-btn-hubert:hover { color: var(--ai-purple); border-color: var(--ai-purple); background: color-mix(in srgb, var(--ai-purple) 10%, transparent); }
.dp-icon-btn-hubert.is-ready { color: var(--ai-purple); border-color: color-mix(in srgb, var(--ai-purple) 45%, var(--panel-border)); background: color-mix(in srgb, var(--ai-purple) 12%, transparent); }
.dp-icon-btn-hubert.is-processing { color: var(--ai-purple); opacity: .6; cursor: progress; animation: dp-hubert-pulse 1.3s infinite ease-in-out; }
.dp-icon-btn-hubert.is-failed { color: var(--danger-red); border-color: var(--danger-red); }
@keyframes dp-hubert-pulse { 0%, 100% { opacity: .35; } 50% { opacity: .85; } }

.dp-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 60px 20px; color: var(--text-muted); text-align: center; }
.dp-empty svg { opacity: .45; }

/* -- Modale (Ordner anlegen/umbenennen, Dokument umbenennen, Versionsverlauf, Freigabe,
   Marken-Abfrage nach Upload) -- .modal-content selbst liefert bewusst KEIN Padding (siehe
   Kopfkommentar bei .modal-content weiter oben) - jedes Modul ergänzt das selbst, hier einheitlich
   über die gemeinsame Klasse .dp-modal-content (alle Dokumente-Modale nutzen sie). -- */
.dp-modal-content { padding: 26px; max-height: 90vh; overflow-y: auto; }
.dp-modal-content-lg { max-width: 620px !important; }
.dp-modal-title { margin: 0 0 18px; font-size: 18px; color: var(--text-main); }
.dp-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.dp-field-label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); }
.dp-input { background: rgba(255,255,255,.03); border: 1px solid var(--panel-border); border-radius: 8px; padding: 9px 11px; color: var(--text-main); font-size: 13px; width: 100%; box-sizing: border-box; }
.dp-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.dp-upload-brand-hint { font-size: 11.5px; color: var(--text-muted); line-height: 1.5; margin: -8px 0 16px; }
.dp-upload-brand-files { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; max-height: 140px; overflow-y: auto; }
.dp-upload-brand-file-row { font-size: 12px; color: var(--text-main); background: var(--bg-dark); border: 1px solid var(--panel-border); border-radius: 7px; padding: 6px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* -- Namenskonflikt-Modal beim Hochladen (gleicher Name + gleiche Endung bereits im Ordner
   vorhanden): Vorhandene vs. neue Datei nebeneinander, dazwischen ein Pfeil - erleichtert die
   Entscheidung "neue Version" vs. "eigenständiges neues Dokument", siehe dpUploadOneFile()/
   dpOpenUploadConflictModal() in dokumente_pool.php. -- */
.dp-conflict-compare { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.dp-conflict-card { flex: 1; min-width: 0; background: var(--bg-dark); border: 1px solid var(--panel-border); border-radius: 10px; overflow: hidden; }
.dp-conflict-thumb { height: 120px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.02); overflow: hidden; }
.dp-conflict-thumb .dp-card-thumb-img { width: 100%; height: 100%; object-fit: cover; }
.dp-conflict-card-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); padding: 8px 10px 2px; }
.dp-conflict-meta { font-size: 11px; color: var(--text-muted); padding: 0 10px 8px; }
.dp-conflict-arrow { flex-shrink: 0; color: var(--text-muted); }
.dp-conflict-overwrite-btn { width: 100%; justify-content: center; margin-bottom: 14px; }
.dp-conflict-rename-row { display: flex; gap: 8px; }
.dp-conflict-rename-row .dp-input { flex: 1; }

.dp-version-list { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow-y: auto; }
.dp-version-row { display: flex; align-items: center; gap: 12px; background: var(--bg-dark); border: 1px solid var(--panel-border); border-radius: 10px; padding: 10px 12px; }
.dp-version-row.is-current { border-color: var(--accent-gold); background: rgba(214,175,84,.07); }
.dp-version-row-body { flex: 1; min-width: 0; }
.dp-version-row-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dp-version-row-no { font-size: 12px; font-weight: 700; color: var(--text-main); }
.dp-version-row-badge { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #1a1a1a; background: var(--accent-gold); border-radius: 20px; padding: 2px 8px; }
.dp-version-row-name { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-version-row-meta { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }
.dp-version-row-note { font-size: 11px; color: var(--text-main); margin-top: 4px; font-style: italic; opacity: .85; }
.dp-version-row-actions { display: flex; gap: 5px; flex-shrink: 0; }

/* -- Freigabe-Modal (Ordner/Dokumente auf Rollen/Personen einschränken) -- */
.dp-share-hint { font-size: 11.5px; color: var(--text-muted); line-height: 1.5; margin: -8px 0 14px; }
.dp-share-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; max-height: 240px; overflow-y: auto; }
.dp-share-empty { font-size: 12px; color: var(--text-muted); font-style: italic; padding: 8px 0; }
.dp-share-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--bg-dark); border: 1px solid var(--panel-border); border-radius: 8px; padding: 7px 10px; }
.dp-share-row-label { font-size: 12.5px; color: var(--text-main); }
.dp-share-add-row { display: flex; gap: 8px; margin-bottom: 10px; }
.dp-share-add-row .dp-input { flex: 1; }

@media (max-width: 860px) {
    .dp-body { flex-direction: column; }
    .dp-sidebar { width: 100% !important; max-height: 240px; }
    .dp-sidebar-resize-handle { display: none; }
    .dp-toolbar-controls { flex-direction: column; align-items: stretch; }
    .dp-search-control { min-width: 0; }
}

/* -- Lead-Controlling: lesbare, freundliche Arbeitsflaechen -- */
#lc-dfleads-list-view .lc-df-table-region {
    width: 100%;
    min-width: 0;
    container-type: inline-size;
}
#lc-dfleads-list-view .lc-df-table-scroll {
    overflow-x: auto;
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    background: var(--panel-bg);
}
#lc-dfleads-list-view #lc-dfleads-table { font-size: 14px; }
#lc-dfleads-list-view #lc-dfleads-table th {
    padding: 13px 14px;
    background: color-mix(in srgb, var(--brand-accent) 7%, var(--panel-bg));
    color: var(--text-main);
    font-size: 12.5px;
    letter-spacing: 0;
    text-transform: none;
}
#lc-dfleads-list-view #lc-dfleads-table td {
    padding: 13px 14px;
    border-bottom-color: var(--panel-border);
    font-size: 14px;
    line-height: 1.45;
}
#lc-dfleads-list-view #lc-dfleads-table tr.lc-row-main:hover > td {
    background: color-mix(in srgb, var(--brand-accent) 8%, var(--panel-bg));
}
#lc-dfleads-list-view #lc-dfleads-table th#lc-df-th-actions,
#lc-dfleads-list-view #lc-dfleads-table td.lc-df-cell-actions { text-align: right; white-space: nowrap; }
#lc-dfleads-list-view #lc-dfleads-table .lc-df-identity-info > strong {
    display: block;
    color: var(--text-main);
    font-size: 15px;
    line-height: 1.35;
}
#lc-dfleads-list-view #lc-dfleads-table .lc-df-contact-sub,
#lc-dfleads-list-view #lc-dfleads-table .lc-df-vt-empty {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.45;
}
#lc-dfleads-list-view #lc-dfleads-table .lc-action-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 10px;
    color: var(--text-main);
    background: var(--panel-bg);
}
#lc-dfleads-list-view #lc-dfleads-table .lc-action-btn:hover {
    color: var(--brand-accent);
    border-color: color-mix(in srgb, var(--brand-accent) 50%, var(--panel-border));
    background: color-mix(in srgb, var(--brand-accent) 9%, var(--panel-bg));
}
@container (max-width: 1130px) {
    #lc-dfleads-list-view .lc-df-table-scroll {
        overflow: visible;
        border: 0;
        background: transparent;
    }
    #lc-dfleads-list-view #lc-dfleads-table,
    #lc-dfleads-list-view #lc-dfleads-table thead,
    #lc-dfleads-list-view #lc-dfleads-table tbody,
    #lc-dfleads-list-view #lc-dfleads-table tr,
    #lc-dfleads-list-view #lc-dfleads-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    #lc-dfleads-list-view #lc-dfleads-table thead { display: none; }
    #lc-dfleads-list-view #lc-dfleads-table tr.lc-row-main {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        column-gap: 12px;
        align-items: start;
        padding: 12px 16px 4px;
        border: 1px solid var(--panel-border);
        border-radius: 12px;
        background: var(--panel-bg);
    }
    #lc-dfleads-list-view #lc-dfleads-table tr.lc-row-main:hover {
        background: color-mix(in srgb, var(--brand-accent) 8%, var(--panel-bg));
    }
    #lc-dfleads-list-view #lc-dfleads-table tr.lc-row-main:hover > td {
        background: transparent;
    }
    #lc-dfleads-list-view #lc-dfleads-table tr.lc-row-main.is-expanded {
        border-radius: 12px 12px 0 0;
        border-bottom-color: transparent;
    }
    #lc-dfleads-list-view #lc-dfleads-table tr.lc-row-expand { margin-bottom: 12px; }
    #lc-dfleads-list-view #lc-dfleads-table tr.lc-row-expand > td { padding: 0; }
    #lc-dfleads-list-view #lc-dfleads-table tr.lc-row-main.is-expanded + tr.lc-row-expand > td {
        border: 1px solid var(--panel-border);
        border-top: 0;
        border-radius: 0 0 12px 12px;
        background: var(--panel-bg);
    }
    #lc-dfleads-list-view #lc-dfleads-table td.lc-df-cell-main {
        grid-column: 1 / span 2;
        min-width: 0;
        padding: 0 0 10px 2px;
        margin-bottom: 6px;
        border-bottom: 1px solid var(--panel-border);
    }
    #lc-dfleads-list-view #lc-dfleads-table .lc-df-identity {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }
    #lc-dfleads-list-view #lc-dfleads-table .lc-df-identity-info { flex: 1; min-width: 0; }
    #lc-dfleads-list-view #lc-dfleads-table .lc-df-identity-info > strong,
    #lc-dfleads-list-view #lc-dfleads-table .lc-df-contact-sub { overflow-wrap: anywhere; }
    #lc-dfleads-list-view #lc-dfleads-table .lc-df-contact-sub .lc-copy-inline {
        display: inline;
        white-space: normal;
        overflow-wrap: anywhere;
    }
    #lc-dfleads-list-view #lc-dfleads-table td.lc-df-cell {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 4px;
        min-width: 0;
        padding: 7px 4px 8px 2px;
        border-bottom: 1px solid var(--panel-border);
        font-size: 13px;
    }
    #lc-dfleads-list-view #lc-dfleads-table td.lc-df-cell::before {
        content: attr(data-label);
        max-width: 100%;
        color: var(--text-muted);
        font-size: 11.5px;
        font-weight: 600;
        letter-spacing: .01em;
    }
    #lc-dfleads-list-view #lc-dfleads-table td.lc-df-cell > * {
        flex: 0 1 auto;
        min-width: 0;
        max-width: 100%;
        text-align: left;
        overflow-wrap: anywhere;
    }
    #lc-dfleads-list-view #lc-dfleads-table td.lc-df-cell[data-label="Status"] {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px 6px;
    }
    #lc-dfleads-list-view #lc-dfleads-table td.lc-df-cell[data-label="Status"] {
        grid-column: span 2;
    }
    #lc-dfleads-list-view #lc-dfleads-table td.lc-df-cell[data-label="Status"]::before {
        flex: 0 0 100%;
    }
    #lc-dfleads-list-view #lc-dfleads-table td.lc-df-cell[data-label="Status"] > * {
        flex: 0 1 auto;
    }
    #lc-dfleads-list-view #lc-dfleads-table td.lc-df-cell-actions {
        grid-column: 3 / -1;
        grid-row: 1;
        align-self: center;
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 6px;
        padding: 2px;
        text-align: right;
    }
}
@container (max-width: 900px) {
    #lc-dfleads-list-view #lc-dfleads-table tr.lc-row-main {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    #lc-dfleads-list-view #lc-dfleads-table td.lc-df-cell-main {
        grid-column: 1 / span 1;
    }
    #lc-dfleads-list-view #lc-dfleads-table td.lc-df-cell-actions {
        grid-column: 2 / -1;
    }
}
@container (max-width: 600px) {
    #lc-dfleads-list-view #lc-dfleads-table tr.lc-row-main {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    #lc-dfleads-list-view #lc-dfleads-table td.lc-df-cell:not([data-label="Status"]) {
        flex-direction: row;
        justify-content: space-between;
        gap: 10px;
    }
    #lc-dfleads-list-view #lc-dfleads-table td.lc-df-cell:not([data-label="Status"])::before {
        flex: 0 0 34%;
        max-width: 140px;
    }
    #lc-dfleads-list-view #lc-dfleads-table td.lc-df-cell:not([data-label="Status"]) > * {
        flex: 1 1 0;
        text-align: right;
    }
    #lc-dfleads-list-view #lc-dfleads-table td.lc-df-cell[data-label="Status"]::before {
        flex: 0 0 100%;
        max-width: none;
    }
    #lc-dfleads-list-view #lc-dfleads-table td.lc-df-cell[data-label="Status"] > * {
        flex: 0 1 auto;
        text-align: left;
    }
    #lc-dfleads-list-view #lc-dfleads-table td.lc-df-cell-actions {
        grid-column: 2 / -1;
    }
    #lc-dfleads-list-view #lc-dfleads-table td.lc-df-cell[data-label="Status"] {
        grid-column: auto;
    }
}
@container (max-width: 420px) {
    #lc-dfleads-list-view #lc-dfleads-table tr.lc-row-main {
        grid-template-columns: minmax(0, 1fr);
    }
    #lc-dfleads-list-view #lc-dfleads-table td.lc-df-cell-main {
        grid-column: 1 / -1;
    }
    #lc-dfleads-list-view #lc-dfleads-table td.lc-df-cell-actions {
        grid-column: 1 / -1;
        grid-row: auto;
        padding: 8px 2px 6px;
    }
    #lc-dfleads-list-view #lc-dfleads-table td.lc-df-cell:not([data-label="Status"]) {
        flex-direction: row;
        justify-content: space-between;
        gap: 10px;
    }
    #lc-dfleads-list-view #lc-dfleads-table td.lc-df-cell:not([data-label="Status"])::before {
        flex: 0 0 34%;
        max-width: 140px;
    }
    #lc-dfleads-list-view #lc-dfleads-table td.lc-df-cell:not([data-label="Status"]) > * {
        flex: 1 1 0;
        text-align: right;
    }
    #lc-dfleads-list-view #lc-dfleads-table td.lc-df-cell[data-label="Status"]::before {
        flex-basis: auto;
        max-width: none;
    }
}
#lc-dfleads-list-view .lc-df-exp-card {
    padding: 16px 18px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--brand-accent) 3%, var(--panel-bg));
    box-shadow: 0 3px 12px rgba(0, 0, 0, .06);
}
#lc-dfleads-list-view .lc-df-exp-card-title {
    color: var(--text-main);
    font-size: 13px;
    letter-spacing: .02em;
}
#lc-dfleads-list-view .lc-df-exp-note,
#lc-dfleads-list-view .lc-df-exp-empty { color: var(--text-muted); font-size: 14px; line-height: 1.6; }
#lc-dfleads-list-view .lc-df-timeline-stage { font-size: 14px; line-height: 1.45; }
#lc-dfleads-list-view .lc-df-timeline-date,
#lc-dfleads-list-view .lc-df-timeline-src {
    color: var(--text-muted);
    font-size: 13px;
    opacity: 1;
    line-height: 1.45;
}

#lc-lead-modal .lc-modal-box {
    border-radius: 18px;
    border-top: 3px solid var(--brand-accent);
    box-shadow: 0 28px 70px rgba(0, 0, 0, .34), 0 0 0 1px var(--lc-modal-inner);
}
#lc-lead-modal .lc-modal-box.wide { width: min(96vw, 1120px); }
#lc-lead-modal .lc-mhead { padding: 18px 24px; }
#lc-lead-modal #lm-title {
    color: var(--text-main);
    font-size: 21px;
    font-weight: 700;
    line-height: 1.25;
}
#lc-lead-modal .lc-mbody { padding: 20px 24px; font-size: 15px; line-height: 1.55; }
#lc-lead-modal .lc-mfoot { padding: 14px 24px; gap: 10px; }
#lc-lead-modal .lc-form-section {
    padding: 17px 18px;
    border: 1px solid color-mix(in srgb, var(--brand-accent) 18%, var(--lc-section-border));
    border-radius: 14px;
    background: color-mix(in srgb, var(--brand-accent) 3%, var(--lc-section-bg));
    box-shadow: 0 3px 12px rgba(0, 0, 0, .05);
}
#lc-lead-modal .lc-form-section:focus-within {
    border-color: color-mix(in srgb, var(--brand-accent) 55%, var(--lc-section-border));
    background: color-mix(in srgb, var(--brand-accent) 6%, var(--lc-section-bg));
}
#lc-lead-modal .lc-form-section-title {
    color: var(--text-main);
    font-size: 14px;
    letter-spacing: 0;
    text-transform: none;
}
#lc-lead-modal .lc-label {
    color: var(--text-main);
    font-size: 13px;
    font-weight: 650;
    letter-spacing: 0;
    text-transform: none;
}
#lc-lead-modal .lc-input,
#lc-lead-modal .lc-select,
#lc-lead-modal .lc-textarea {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 15px;
}
#lc-lead-modal .lc-form-grid { gap: 14px 16px; }
#lc-lead-modal .lc-mhead button:focus-visible,
#lc-lead-modal .lc-mfoot button:focus-visible {
    outline: 2px solid var(--brand-accent);
    outline-offset: 2px;
}
#lc-lead-modal .lc-mhead .lc-btn-icon,
#lc-lead-modal .lc-close-btn { min-width: 44px; min-height: 44px; }
#lc-lead-modal .lc-close-btn { display: inline-flex; align-items: center; justify-content: center; }

#lc-lead-modal .lc-contact-list { display: flex; flex-direction: column; gap: 12px; }
#lc-lead-modal .lc-contact-card,
#lc-dfleads-list-view .lc-contact-card {
    min-width: 0;
    padding: 14px 16px;
    border-color: color-mix(in srgb, var(--brand-accent) 20%, var(--panel-border));
    border-radius: 13px;
    background: color-mix(in srgb, var(--brand-accent) 4%, var(--panel-bg));
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
#lc-lead-modal .lc-contact-card:hover,
#lc-dfleads-list-view .lc-contact-card:hover {
    border-color: color-mix(in srgb, var(--brand-accent) 48%, var(--panel-border));
    box-shadow: 0 5px 16px rgba(0, 0, 0, .08);
}
#lc-lead-modal .lc-contact-card-head,
#lc-dfleads-list-view .lc-contact-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
#lc-lead-modal .lc-contact-card-info,
#lc-dfleads-list-view .lc-contact-card-info { flex: 1; min-width: 0; }
#lc-lead-modal .lc-contact-card-name,
#lc-dfleads-list-view .lc-contact-card-name {
    color: var(--text-main);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
#lc-lead-modal .lc-contact-card-meta,
#lc-dfleads-list-view .lc-contact-card-meta {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
#lc-lead-modal .lc-contact-empty-name,
#lc-dfleads-list-view .lc-contact-empty-name { color: var(--text-muted); font-weight: 500; }
#lc-lead-modal .lc-contact-primary-badge,
#lc-dfleads-list-view .lc-contact-primary-badge,
#lc-lead-modal .lc-contact-relation,
#lc-dfleads-list-view .lc-contact-relation { margin-left: 6px; vertical-align: middle; }
#lc-lead-modal .lc-contact-links,
#lc-dfleads-list-view .lc-contact-links { display: inline-flex; flex-shrink: 0; gap: 6px; }
#lc-lead-modal .lc-contact-card .lc-contact-links a,
#lc-dfleads-list-view .lc-contact-card .lc-contact-links a {
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--panel-border);
    border-radius: 11px;
    background: var(--panel-bg);
    color: var(--text-main);
    transition: border-color .16s ease, background .16s ease, color .16s ease;
}
#lc-lead-modal .lc-contact-card .lc-contact-links a:hover,
#lc-dfleads-list-view .lc-contact-card .lc-contact-links a:hover {
    border-color: color-mix(in srgb, var(--brand-accent) 52%, var(--panel-border));
    background: color-mix(in srgb, var(--brand-accent) 10%, var(--panel-bg));
    color: var(--brand-accent);
}
#lc-lead-modal .lc-contact-card-actions,
#lc-dfleads-list-view .lc-contact-card-actions { gap: 8px; margin-top: 10px; }
#lc-lead-modal .lc-contact-card-actions .lc-action-btn,
#lc-dfleads-list-view .lc-contact-card-actions .lc-action-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 10px;
    color: var(--text-main);
    background: var(--panel-bg);
}
#lc-lead-modal .lc-contact-add-btn,
#lc-dfleads-list-view .lc-contact-add-btn {
    min-height: 44px;
    padding: 8px 14px;
    color: var(--text-main);
    font-size: 13px;
}
#lc-lead-modal .lc-contact-add-wrap { margin-top: 2px; }
#lc-lead-modal .lc-contact-empty { color: var(--text-muted); font-size: 14px; line-height: 1.5; }

#lc-lead-modal .lc-conv-item,
#lc-dfleads-list-view .lc-conv-item { gap: 12px; padding: 13px 0; }
#lc-lead-modal .lc-conv-item-icon,
#lc-dfleads-list-view .lc-conv-item-icon { width: 32px; height: 32px; }
#lc-lead-modal .lc-conv-item-type,
#lc-lead-modal .lc-conv-email-subject,
#lc-dfleads-list-view .lc-conv-item-type,
#lc-dfleads-list-view .lc-conv-email-subject { font-size: 14px; }
#lc-lead-modal .lc-conv-item-date,
#lc-dfleads-list-view .lc-conv-item-date {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.45;
}
#lc-lead-modal .lc-conv-item-note,
#lc-lead-modal .lc-conv-email-body,
#lc-dfleads-list-view .lc-conv-item-note,
#lc-dfleads-list-view .lc-conv-email-body {
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.6;
}
#lc-lead-modal .lc-conv-item-del,
#lc-dfleads-list-view .lc-conv-item-del {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}
#lc-lead-modal .lc-conv-email-dir { font-size: 11px; }
#lc-lead-modal .lc-conv-email-toggle { min-height: 36px; font-size: 13px; }

@media (max-width: 760px) {
    #lc-dfleads-list-view .lc-df-exp-grid { grid-template-columns: 1fr; }
    #lc-dfleads-list-view #lc-dfleads-table td.lc-df-cell {
        padding: 10px 4px;
        font-size: 14px;
        line-height: 1.45;
    }
    #lc-dfleads-list-view #lc-dfleads-table td.lc-df-cell::before {
        color: var(--text-main);
        font-size: 12px;
        letter-spacing: 0;
    }
    #lc-dfleads-list-view #lc-dfleads-table td.lc-df-cell-actions {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 2px;
    }
    #lc-lead-modal .lc-modal-box.wide {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }
    #lc-lead-modal .lc-mhead { padding: 14px 16px; }
    #lc-lead-modal .lc-mbody { padding: 16px; }
    #lc-lead-modal .lc-mfoot { padding: 12px 16px; }
    #lc-lead-modal .lc-form-grid { grid-template-columns: 1fr; }
    #lc-lead-modal .lc-contact-card-head { align-items: stretch; flex-direction: column; }
    #lc-lead-modal .lc-contact-links { align-self: flex-end; }
    #lc-lead-modal .lc-conv-item-head { align-items: flex-start; flex-wrap: wrap; }
    #lc-lead-modal .lc-conv-item-date { flex: 1 1 100%; margin-left: 0; white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
    #lc-lead-modal .lc-contact-card,
    #lc-lead-modal .lc-contact-card .lc-contact-links a,
    #lc-dfleads-list-view .lc-contact-card,
    #lc-dfleads-list-view .lc-contact-card .lc-contact-links a { transition: none; }
}

#lc-tab-dfleads .lc-search-wrap input,
#lc-tab-dfleads .lc-controls select {
    min-height: 44px;
    font-size: 15px;
}
#lc-tab-dfleads .lc-controls > button,
#lc-tab-dfleads .lc-controls-actions > button,
#lc-tab-dfleads .lc-dfcol-sort-done-btn {
    min-width: 40px;
    min-height: 40px;
    font-size: 13px;
}
#lc-tab-dfleads .lc-filter-chip {
    min-height: 36px;
    padding: 6px 12px;
    color: var(--text-main);
    font-size: 12.5px;
}
#lc-tab-dfleads .lc-filter-chip.active {
    border-color: color-mix(in srgb, var(--brand-accent) 48%, var(--panel-border));
    background: color-mix(in srgb, var(--brand-accent) 9%, var(--panel-bg));
    color: var(--text-main);
    font-weight: 700;
}
#lc-tab-dfleads .lc-df-dist-item {
    min-height: 34px;
    padding: 4px 8px;
    color: var(--text-main);
    font-size: 12.5px;
}
#lc-tab-dfleads .lc-df-dist-item.is-active {
    border-color: color-mix(in srgb, var(--brand-accent) 35%, var(--panel-border));
    background: color-mix(in srgb, var(--brand-accent) 8%, var(--panel-bg));
    color: var(--text-main);
}
#lc-tab-dfleads .lc-pager-btn {
    min-width: 36px;
    min-height: 36px;
    color: var(--text-main);
    font-size: 12.5px;
}
#lc-tab-dfleads .lc-pager-info,
#lc-tab-dfleads .lc-pager-ellipsis,
#lc-tab-dfleads .hbb-pager-info,
#lc-tab-dfleads .hbb-pager-jump { color: var(--text-muted); font-size: 12.5px; }
#lc-tab-dfleads .hbb-perpage-btn { min-height: 36px; color: var(--text-main); font-size: 12px; }
#lc-tab-dfleads .lc-search-wrap input:focus-visible,
#lc-tab-dfleads .lc-controls button:focus-visible,
#lc-tab-dfleads .lc-filter-chip:focus-visible,
#lc-tab-dfleads .lc-pager-btn:focus-visible {
    outline: 2px solid var(--brand-accent);
    outline-offset: 2px;
}
#lc-dfleads-list-view #lc-dfleads-table td.lc-df-cell-meta { color: var(--text-muted); font-size: 14px; }
#lc-dfleads-list-view #lc-dfleads-table .lc-df-identity-empty { color: var(--text-muted); font-weight: 500; }

@media (max-width: 760px) {
    #lc-tab-dfleads .lc-search-wrap input,
    #lc-tab-dfleads .lc-controls select,
    #lc-lead-modal .lc-input,
    #lc-lead-modal .lc-select,
    #lc-lead-modal .lc-textarea { font-size: 16px; }
}

#lc-tab-dfleads .lc-filter-panel-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--panel-border);
}
#lc-tab-dfleads .lc-filter-panel-tabs { display: flex; gap: 4px; }
#lc-tab-dfleads .lc-filter-panel-tab {
    min-height: 40px;
    padding: 6px 10px;
    border: 1px solid var(--panel-border);
    border-radius: 7px;
    background: var(--panel-bg);
    color: var(--text-muted);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
#lc-tab-dfleads .lc-filter-panel-tab:hover,
#lc-tab-dfleads .lc-filter-panel-tab.is-active {
    border-color: var(--brand-accent);
    color: var(--accent-gold);
}
#lc-tab-dfleads .lc-filter-panel-tab:focus-visible {
    outline: 2px solid var(--brand-accent);
    outline-offset: 2px;
}
#lc-tab-dfleads .lc-filter-panel-head .lc-filter-tag {
    position: static;
    top: auto;
    right: auto;
    transform: none;
    max-width: 160px;
    margin-left: auto;
}
#lc-tab-dfleads .lc-filter-panel-view { display: none; }
#lc-tab-dfleads .lc-filter-panel-view.is-active { display: block; }
#lc-tab-dfleads #lc-dfdate-panel { min-width: 0; max-height: 320px; overflow-y: auto; }
#lc-tab-dfleads .lc-date-preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 4px;
}
#lc-tab-dfleads .lc-date-preset-grid .lc-stage-chk-item {
    box-sizing: border-box;
    min-height: 40px;
    padding: 6px 8px;
}
#lc-tab-dfleads .lc-date-field-choice {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--panel-border);
}
#lc-tab-dfleads .lc-date-field-label { grid-column: 1 / -1; }

@media (min-width: 761px) {
    #lc-tab-dfleads .lc-controls {
        gap: 8px;
        margin-bottom: 8px;
    }
    #lc-tab-dfleads .lc-search-group {
        flex: 1 1 260px;
        min-width: 240px;
    }
    #lc-tab-dfleads .lc-df-filter-extra {
        display: flex;
        flex: 1 1 380px;
        min-width: 0;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }
    #lc-tab-dfleads #lc-df-scope-select {
        width: 180px;
        min-width: 140px;
        max-width: 220px;
        flex: 0 1 180px;
    }
    #lc-tab-dfleads .lc-df-filter-extra .lc-controls-actions { margin-left: auto; }
    #lc-tab-dfleads .lc-df-subtext { margin-bottom: 6px; }
    #lc-tab-dfleads .lc-df-dist-wrap { margin-bottom: 8px; }
    #lc-tab-dfleads .lc-df-dist-legend {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
        gap: 2px 6px;
        margin-top: 6px;
    }
    #lc-tab-dfleads .lc-df-dist-item {
        box-sizing: border-box;
        min-width: 0;
        min-height: 44px;
        padding: 4px 5px;
        white-space: normal;
    }
    #lc-tab-dfleads #lc-dfleads-pager-top { padding: 4px 0; }
}

    #lc-tab-dfleads .lc-controls-actions #lc-dfsort-toggle-btn,
    #lc-tab-dfleads .lc-controls-actions #lc-dfexport-btn {
        box-sizing: border-box;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0;
    }
    #lc-tab-dfleads .lc-df-dist-item {
        display: grid;
        grid-template-columns: 8px minmax(0, 1fr) max-content;
        align-items: center;
        min-width: 0;
        padding: 4px;
        gap: 4px;
    }
    #lc-tab-dfleads .lc-df-dist-label {
        grid-column: 2;
        hyphens: auto;
        min-width: 0;
    }
    #lc-tab-dfleads .lc-df-dist-item > strong {
        grid-column: 3;
        justify-self: end;
        white-space: nowrap;
        font-variant-numeric: tabular-nums;
    }
    #lc-dfleads-list-view #lc-dfleads-table .lc-df-identity-marker {
        display: flex;
        flex: 0 0 20px;
        flex-direction: column;
        align-items: center;
        gap: 3px;
    }
    #lc-dfleads-list-view #lc-dfleads-table .lc-df-identity-marker .lc-value-badge { margin: 0; }

#lc-tab-dashboard .lc-dash-kpi-label { font-size: 12.5px; line-height: 1.35; letter-spacing: .04em; }
#lc-tab-dashboard .lc-dash-kpi-meta { font-size: 13px; line-height: 1.4; }
#lc-tab-dashboard .lc-dash-kpi-val { font-size: 23px; }
#lc-tab-dashboard .lc-dash-delight-label { font-size: 12.5px; letter-spacing: .04em; }
#lc-tab-dashboard .lc-dash-delight-sub { font-size: 13px; line-height: 1.4; }
#lc-tab-dashboard .lc-dash-delight-foot { font-size: 12.5px; line-height: 1.4; }
#lc-tab-dashboard .lc-dash-rank-chip { font-size: 12px; }
#lc-tab-dashboard .lc-dash-chip { min-height: 40px; font-size: 12.5px; }
#lc-tab-dashboard .lc-kanban-col-title { font-size: 14px; }
#lc-tab-dashboard .lc-kanban-col-count { color: var(--text-main); font-size: 12px; }
#lc-tab-dashboard .lc-kanban-col-empty { font-size: 13px; }
#lc-tab-dashboard .lc-kanban-card-name { font-size: 14px; }
#lc-tab-dashboard .lc-kanban-card-meta { color: var(--text-main); font-size: 12.5px; }
#lc-tab-dashboard .lc-kanban-card-brand { font-size: 11.5px; }
#lc-tab-dashboard .lc-kanban-card-days { font-size: 12px; }
#lc-tab-dashboard .lc-dash-chip-cnt { color: var(--text-main); }
#lc-tab-dashboard .lc-kanban-calc-filter-btn,
#lc-tab-dashboard .lc-kanban-value-filter-btn { min-height: 40px; font-size: 12.5px; }
#lc-tab-dashboard .lc-kanban-card-actions .lc-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
}
#lc-tab-dashboard .lc-kanban-scroll-hint { display: none; }
#lc-tab-dashboard .lc-dash-chip:focus-visible,
#lc-tab-dashboard .lc-kanban-calc-filter-bar button:focus-visible {
    outline: 2px solid var(--brand-accent);
    outline-offset: 2px;
}

@media (max-width: 640px) {
    #lc-tab-dashboard .lc-dash-kpi-strip { gap: 10px; }
    #lc-tab-dashboard .lc-dash-kpi { padding: 14px 16px; }
    #lc-tab-dashboard .lc-dash-kpi-quota { flex-basis: auto; }
    #lc-tab-dashboard .lc-dash-chip-strip,
    #lc-tab-dashboard .lc-kanban-calc-filter-bar,
    #lc-tab-dashboard .lc-kanban-board {
        max-width: 100%;
        min-width: 0;
        overscroll-behavior-x: contain;
        scrollbar-color: var(--brand-accent) var(--bg-dark);
        scrollbar-width: thin;
    }
    #lc-tab-dashboard .lc-dash-chip-strip {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 8px;
        padding: 2px 2px 8px;
        scroll-snap-type: x proximity;
    }
    #lc-tab-dashboard .lc-dash-chip {
        flex: 0 0 auto;
        min-height: 44px;
        scroll-snap-align: start;
    }
    #lc-tab-dashboard .lc-kanban-calc-filter-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 8px;
        padding: 2px 2px 8px;
        scroll-snap-type: x proximity;
    }
    #lc-tab-dashboard .lc-kanban-calc-filter-bar button {
        flex: 0 0 auto;
        min-height: 44px;
        scroll-snap-align: start;
    }
    #lc-tab-dashboard .lc-kanban-filter-sep { flex: 0 0 1px; min-height: 24px; }
    #lc-tab-dashboard .lc-kanban-scroll-hint {
        display: block;
        margin: -4px 0 10px;
        color: var(--text-muted);
        font-size: 12.5px;
        line-height: 1.4;
    }
    #lc-tab-dashboard .lc-kanban-board {
        gap: 12px;
        overflow-x: auto;
        padding: 2px 2px 12px;
        scroll-padding-inline: 2px;
        scroll-snap-type: x proximity;
    }
    #lc-tab-dashboard .lc-kanban-col {
        flex: 0 0 82vw;
        max-width: 320px;
        scroll-snap-align: start;
    }
    #lc-tab-dashboard .lc-kanban-col-head { padding: 12px; }
    #lc-tab-dashboard .lc-kanban-col-body { padding: 10px; }
    #lc-tab-dashboard .lc-kanban-card-actions .lc-action-btn {
        min-width: 44px;
        min-height: 44px;
    }
    #lc-tab-dashboard .lc-dash-chip-strip::-webkit-scrollbar,
    #lc-tab-dashboard .lc-kanban-calc-filter-bar::-webkit-scrollbar,
    #lc-tab-dashboard .lc-kanban-board::-webkit-scrollbar { height: 7px; }
    #lc-tab-dashboard .lc-dash-chip-strip::-webkit-scrollbar-thumb,
    #lc-tab-dashboard .lc-kanban-calc-filter-bar::-webkit-scrollbar-thumb,
    #lc-tab-dashboard .lc-kanban-board::-webkit-scrollbar-thumb {
        background: var(--brand-accent);
        border-radius: 999px;
    }
    #lc-tab-dashboard .lc-dash-chip-strip::-webkit-scrollbar-track,
    #lc-tab-dashboard .lc-kanban-calc-filter-bar::-webkit-scrollbar-track,
    #lc-tab-dashboard .lc-kanban-board::-webkit-scrollbar-track {
        background: var(--bg-dark);
        border-radius: 999px;
    }
}