/* ═══════════════════════════════════════════════════════════════════════
   A4L Virtual Office – Design-System
   Dark/Light über CSS-Variablen; Statusfarben zentral definiert.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
    /* Statusfarben (in beiden Themes identisch nutzbar) */
    --st-available: #22c55e;
    --st-present: #10b981;
    --st-busy: #e11d48;
    --st-meeting: #3b82f6;
    --st-customer: #a855f7;
    --st-phone: #14b8a6;
    --st-focus: #eab308;
    --st-break: #f97316;
    --st-away: #94a3b8;
    --st-road: #38bdf8;
    --st-offline: #64748b;

    --radius: 12px;
    --radius-sm: 8px;
    --topbar-h: 60px;
    --sidebar-w: 232px;
    --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
}

:root[data-theme="dark"] {
    --bg: #0e1117;
    --bg-soft: #12161e;
    --surface: #171c26;
    --surface-2: #1e2530;
    --surface-hover: #232b38;
    --border: #262f3d;
    --border-soft: #1f2735;
    --text: #e8ecf4;
    --text-dim: #9aa5b8;
    --text-muted: #647084;
    --accent: #4f7cff;
    --accent-soft: #4f7cff22;
    --accent-2: #8b5cf6;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --backdrop: rgba(5, 8, 14, 0.55);
    color-scheme: dark;
}

:root[data-theme="light"] {
    --bg: #eef1f6;
    --bg-soft: #f4f6fa;
    --surface: #ffffff;
    --surface-2: #f2f5fa;
    --surface-hover: #e9eef6;
    --border: #dde3ee;
    --border-soft: #e7ecf4;
    --text: #1b2333;
    --text-dim: #56617a;
    --text-muted: #8a94a8;
    --accent: #3b5bdb;
    --accent-soft: #3b5bdb14;
    --accent-2: #7c3aed;
    --shadow: 0 8px 28px rgba(23, 32, 55, 0.10);
    --shadow-sm: 0 2px 8px rgba(23, 32, 55, 0.07);
    --backdrop: rgba(23, 32, 55, 0.35);
    color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14.5px;
}

a { color: var(--accent); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; }
button { font-family: var(--font); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ── App-Shell ─────────────────────────────────────────────────────────── */
.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-rows: var(--topbar-h) 1fr;
    grid-template-areas: "sidebar topbar" "sidebar main";
    height: 100vh;
}

.app-main {
    grid-area: main;
    overflow-y: auto;
    padding: 22px 26px 40px;
}

/* ── Sidebar ───────────────────────────────────────────────────────────── */
.sidebar {
    grid-area: sidebar;
    background: var(--bg-soft);
    border-right: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    padding: 14px 12px;
    gap: 4px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 18px;
    font-weight: 700;
    font-size: 15.5px;
    letter-spacing: 0.2px;
}

.sidebar-brand .logo {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    flex-shrink: 0;
}

.sidebar-brand small {
    display: block;
    font-size: 10.5px;
    font-weight: 500;
    color: var(--text-dim);
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.nav-link:hover { background: var(--surface-hover); color: var(--text); }

.nav-link.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

.nav-link svg { flex-shrink: 0; }

.sidebar-footer {
    margin-top: auto;
    padding: 10px 12px;
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.5;
}

.live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--st-available);
    margin-right: 6px;
    animation: livePulse 2.4s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); }
    50% { box-shadow: 0 0 0 5px rgba(34, 197, 94, 0); }
}

/* ── Topbar ────────────────────────────────────────────────────────────── */
.topbar {
    grid-area: topbar;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 22px;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border-soft);
}

.topbar .spacer { flex: 1; }

.topbar-clock {
    font-variant-numeric: tabular-nums;
    color: var(--text-dim);
    font-size: 13px;
    white-space: nowrap;
}

.icon-btn {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-dim);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.icon-btn:hover { background: var(--surface-hover); color: var(--text); }

.role-select {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-dim);
    white-space: nowrap;
}

.lang-select select { padding: 6px 9px; font-size: 12.5px; font-weight: 600; cursor: pointer; }

select, input[type="text"], input[type="search"], input[type="date"], input[type="datetime-local"] {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    font-family: var(--font);
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.15s;
}

select:focus, input:focus { border-color: var(--accent); }

/* ── Globale Suche ─────────────────────────────────────────────────────── */
.global-search { position: relative; width: min(420px, 34vw); }

.global-search input {
    width: 100%;
    padding: 8px 12px 8px 36px;
}

.global-search .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    display: grid;
    place-items: center;
}

.search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: min(520px, 80vw);
    max-height: 480px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 60;
    padding: 6px;
    animation: dropIn 0.16s ease;
}

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.search-group-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    padding: 8px 10px 4px;
    font-weight: 600;
}

.search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    background: none;
    border: 0;
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
    font-size: 13.5px;
}

.search-item:hover { background: var(--surface-hover); }
.search-item .sub { color: var(--text-dim); font-size: 12px; }
.search-empty { padding: 14px; color: var(--text-dim); font-size: 13px; }

/* ── Seiten-Header ─────────────────────────────────────────────────────── */
.page-head {
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.page-head h1 { font-size: 21px; }
.page-head .sub { color: var(--text-dim); font-size: 13.5px; }

/* ── Filterleiste ──────────────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.filter-bar label {
    font-size: 12px;
    color: var(--text-dim);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chip-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-dim);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.chip-toggle:hover { background: var(--surface-hover); }

.chip-toggle.on {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

.filter-reset {
    background: none;
    border: 0;
    color: var(--text-muted);
    font-size: 12.5px;
    cursor: pointer;
    padding: 6px 8px;
}

.filter-reset:hover { color: var(--text); text-decoration: underline; }

/* ── Raum-Grid & Kacheln ───────────────────────────────────────────────── */
/* Masonry-Packung: Kacheln füllen den Platz dicht, ohne Zeilen-Ausrichtungslücken.
   Spaltenzahl passt sich dynamisch der Breite an. */
.rooms-grid {
    columns: 300px;
    column-gap: 16px;
}

.tile-wrap {
    break-inside: avoid;
    margin: 0 0 16px;
    display: block;
}

.tile-wrap[draggable="true"] { cursor: grab; }
.tile-wrap.dragging { opacity: 0.4; }

/* Griff-Indikator im Kachelkopf (nur Optik; die ganze Kachel ist ziehbar) */
.drag-grip {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1;
    letter-spacing: -2px;
    padding: 0 2px;
    user-select: none;
    opacity: 0;
    transition: opacity 0.15s;
}

.tile-wrap:hover .drag-grip { opacity: 0.7; }

/* ── Dashboard-Bereiche: feste vs. logische Räume ── */
.room-section { margin-bottom: 20px; }
.room-section .section-head {
    display: flex; align-items: baseline; gap: 10px;
    margin: 0 0 12px; flex-wrap: wrap;
}
.section-title { font-size: 15px; font-weight: 700; letter-spacing: 0.2px; }
.section-sub { color: var(--text-dim); font-size: 12.5px; }
.logical-section { padding-top: 14px; border-top: 1px dashed var(--border); }
.section-empty { color: var(--text-muted); font-size: 13px; padding: 8px 2px; }

/* Admin-Sortiermodus der festen Räume */
.section-head .sort-toggle, .section-head .sort-hint { margin-left: auto; }
.section-head .action-btn { padding: 4px 11px; font-size: 12px; }
.sort-hint { color: var(--text-dim); font-size: 12px; align-self: center; }
.rooms-grid.sorting .room-tile { outline: 1px dashed color-mix(in srgb, #6264A7 55%, transparent); outline-offset: 2px; }
.sort-ctrl {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 5px; margin-bottom: 6px;
    background: color-mix(in srgb, #6264A7 16%, var(--surface));
    border: 1px solid color-mix(in srgb, #6264A7 40%, transparent);
    border-radius: 8px;
}
.sort-ctrl .mini-btn {
    font-size: 14px; line-height: 1; padding: 3px 10px;
    border-radius: 6px; background: var(--surface); border: 1px solid var(--border);
    color: var(--text); cursor: pointer;
}
.sort-ctrl .mini-btn:disabled { opacity: 0.35; cursor: default; }
.sort-ctrl .mini-btn:not(:disabled):hover { background: var(--surface-hover); }
.sort-pos { font-size: 12px; font-weight: 600; color: var(--text-dim); min-width: 46px; text-align: center; }

/* Raumtyp- und Bot-Badges auf der Kachel */
.room-badges { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 8px; }
.rbadge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 600; line-height: 1;
    padding: 3px 7px; border-radius: 999px;
    background: var(--surface-hover); color: var(--text-dim);
    border: 1px solid var(--border); white-space: nowrap;
}
.rbadge.teams { color: #a5b4fc; border-color: color-mix(in srgb, #6264A7 45%, transparent); }
.rbadge.calendar { color: #7dd3fc; border-color: color-mix(in srgb, #3b82f6 40%, transparent); }
.rbadge.bot-src { color: var(--st-available); border-color: color-mix(in srgb, var(--st-available) 40%, transparent); }
.rbadge.system { color: var(--text-muted); }
.rbadge.bot.ok { color: var(--st-available); border-color: color-mix(in srgb, var(--st-available) 45%, transparent); }
.rbadge.bot.warn { color: var(--st-focus); border-color: color-mix(in srgb, var(--st-focus) 45%, transparent); }
.rbadge.bot.err { color: var(--st-busy); border-color: color-mix(in srgb, var(--st-busy) 45%, transparent); }
.rbadge.bot.idle { color: var(--text-muted); }

/* Weiche Einblendung logischer Räume */
.fade-tile { animation: tileFadeIn 0.28s ease; }
@keyframes tileFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

/* ── Anwesend-Bereich: kompakt, gruppiert je Mandant, einklappbar ── */
.presence-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
}
.presence-head {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 11px 14px; background: transparent; border: 0; cursor: pointer;
    color: var(--text); text-align: left; font-family: var(--font);
}
.presence-head:hover { background: var(--surface-hover); }
.presence-chevron { width: 14px; color: var(--text-dim); font-size: 12px; }
.presence-title { font-weight: 700; font-size: 14.5px; flex: 1; }
.presence-body {
    padding: 4px 14px 14px 34px;
    display: flex; flex-wrap: wrap; gap: 16px 30px;
}
.mandant-group { min-width: 170px; }
.mandant-title {
    font-size: 11px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
    color: var(--text-dim); margin: 0 0 6px; display: flex; align-items: center; gap: 6px;
}
.mg-count {
    font-size: 10.5px; font-weight: 600; color: var(--text-muted);
    background: var(--surface-hover); border-radius: 999px; padding: 1px 6px;
}
.mandant-people { display: flex; flex-direction: column; gap: 2px; }
.present-chip {
    display: flex; align-items: center; gap: 7px;
    padding: 4px 8px; border-radius: 7px; cursor: grab; font-size: 13px;
}
.present-chip:hover { background: var(--surface-hover); }
.present-chip.dnd-dragging { opacity: 0.5; }
.present-chip .pc-name { white-space: nowrap; }
.pc-action {
    margin-left: 2px; border: none; background: transparent; cursor: pointer;
    font-size: 12px; line-height: 1; padding: 2px 4px; border-radius: 5px;
    opacity: 0; transition: opacity .12s, background .12s;
}
.present-chip:hover .pc-action { opacity: .65; }
.pc-action:hover { opacity: 1; background: var(--surface-hover); }

/* Dezenter Hinweis: in Feierabend/Abwesend gelistet, aber im Büro-/Präsenzraum anwesend (nicht eingestempelt). */
.pc-inoffice {
    margin-left: -3px; font-size: 11px; line-height: 1;
    opacity: .5; filter: grayscale(45%); cursor: help;
}
.present-chip:hover .pc-inoffice { opacity: .75; }

/* Auswahl „Nicht stempelpflichtig" (C-Level) */
.exempt-picker { width: 60%; }
.exempt-search { width: 100%; margin-bottom: 6px; }
.exempt-list {
    max-height: 220px; overflow-y: auto;
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--surface); padding: 4px;
}
.exempt-item {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 7px; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.exempt-item:hover { background: var(--surface-hover); }
.exempt-item .ex-name { font-weight: 550; }
.exempt-item .ex-mail { color: var(--text-dim); font-size: 12px; margin-left: auto; }

/* ── Gantt-Timeline (Mitarbeiter) ── */
.view-switch { margin-left: auto; display: inline-flex; gap: 4px; }
.vs-btn {
    padding: 5px 14px; font-size: 13px; border-radius: 7px; cursor: pointer;
    background: var(--surface); border: 1px solid var(--border); color: var(--text-dim);
}
.vs-btn.on { background: var(--accent, #6264A7); border-color: transparent; color: #fff; }

.gantt { display: flex; flex-direction: column; gap: 10px; }
.gantt-toolbar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.gt-group { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
/* Text-Buttons der Gantt-Toolbar: die 28×28-Icon-Basis (.mini-btn) auf Auto-Breite/-Höhe zurücksetzen,
   sonst wird der Text ins Quadrat gequetscht und überlappt. */
.gt-group .mini-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: auto; height: auto; min-width: 30px;
    padding: 5px 10px; border: 1px solid var(--border); border-radius: 6px;
    background: var(--surface); color: var(--text);
    white-space: nowrap; flex: 0 0 auto; cursor: pointer;
}
.gt-group .mini-btn:hover { background: var(--surface-hover, var(--surface)); border-color: var(--accent); color: var(--text); }
.gt-group .mini-btn.on { background: var(--accent, #6264A7); color: #fff; border-color: transparent; }
.gt-group .mini-btn.on:hover { background: var(--accent, #6264A7); color: #fff; }
.gantt-toolbar select, .gantt-toolbar input[type="date"] { flex: 0 0 auto; padding: 5px 8px; font-size: 12.5px; }
.gt-range { font-weight: 600; font-size: 13.5px; }
.gt-lbl { color: var(--text-dim); font-size: 12.5px; display: inline-flex; align-items: center; gap: 5px; }
.gt-dash { opacity: .55; margin: 0 1px; }
.gantt-filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.gt-filter { width: 200px; }

.gantt-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-dim); padding: 4px 2px; }
.gl-item { display: inline-flex; align-items: center; gap: 6px; }
.gl-sw { width: 16px; height: 12px; border-radius: 3px; display: inline-block; }

.gantt-scroll { overflow: auto; max-height: 72vh; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: grab; }
.gantt-scroll.grabbing { cursor: grabbing; user-select: none; }
.gantt-grid { position: relative; width: max-content; min-width: 100%; }

.g-row { display: flex; border-bottom: 1px solid var(--border); }
.g-name {
    position: sticky; left: 0; z-index: 7;
    flex: 0 0 var(--name-w); width: var(--name-w);
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; background: var(--surface);
    border-right: 1px solid var(--border);
}
.gn-main { min-width: 0; }
.gn-line1 { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gn-line2 { color: var(--text-dim); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gn-line3 { font-size: 11.5px; display: flex; align-items: center; gap: 5px; color: var(--text-dim); }
.gn-room { white-space: nowrap; }
.gn-actions { display: flex; gap: 6px; margin-top: 5px; flex-wrap: wrap; }
.gn-act {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--surface-2);
    color: var(--text-dim); font-size: 11px; font-weight: 600;
    line-height: 1.2; white-space: nowrap; text-decoration: none;
    transition: all 0.15s;
}
.gn-act:hover { background: var(--surface-hover); border-color: var(--accent); color: var(--accent); }

/* ── Mehrfachauswahl (Mitarbeiter × Zeitfenster) → Teamstermin ── */
.g-selcb { width: 15px; height: 15px; cursor: pointer; flex: 0 0 auto; margin: 0; }
.gc-head { display: flex; align-items: center; gap: 8px; }
.gantt-selbar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 8px 12px; border: 1px solid var(--accent); border-radius: 10px;
    background: color-mix(in srgb, var(--accent) 10%, var(--surface)); font-size: 13px;
}
.gantt-selbar .dim { color: var(--text-dim); }
.gantt-selmsg { font-size: 12.5px; color: var(--text-dim); padding: 2px 4px; }
/* Text-Buttons in der Auswahlleiste: die 28×28-Basis von .mini-btn auf Auto-Breite überschreiben,
   sonst quetscht der Text aus dem Icon-Kästchen und überlappt die Nachbarn. */
.gantt-selbar .mini-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: auto; height: auto; padding: 6px 11px;
    white-space: nowrap; flex: 0 0 auto; font-size: 12.5px; color: var(--text);
}
.gantt-selbar .mini-btn:hover { background: var(--surface-hover); border-color: var(--accent); color: var(--text); }
.gantt-selbar .action-btn { flex: 0 0 auto; white-space: nowrap; }
.gantt-selbar input { flex: 0 0 auto; }
/* Klickbare Stunden-Spalten im Kopf; Beschriftungen/Ticks lassen Klicks durch. */
.g-hcell { position: absolute; top: 0; bottom: 0; z-index: 6; cursor: pointer; }
.g-hcell:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.g-hcell.sel { background: color-mix(in srgb, var(--accent) 26%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent); }
.g-day, .g-tick, .g-tick-lbl, .g-now { pointer-events: none; }
.g-selband { position: absolute; top: 0; bottom: 0; z-index: 1; pointer-events: none; background: color-mix(in srgb, var(--accent) 14%, transparent); }
.g-timehead .g-selband { z-index: 5; background: color-mix(in srgb, var(--accent) 18%, transparent); }
/* Teilnehmer-Chips im Erstellen-Dialog */
.meet-atts { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; }
.meet-att { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 9px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; }
.meet-att.nomail { opacity: .55; text-decoration: line-through; }
.meet-att-x { border: 0; background: transparent; color: var(--text-dim); cursor: pointer; font-size: 12px; line-height: 1; padding: 0 2px; }
.meet-att-x:hover { color: #dc2626; }

.g-track { position: relative; flex: 0 0 var(--track-w); width: var(--track-w); min-height: 56px; }

.g-head { position: sticky; top: 0; z-index: 8; background: var(--surface); }
.g-corner { z-index: 9; }
.g-timehead { min-height: 52px; height: 52px; }
.g-tick { position: absolute; top: 24px; bottom: -10000px; width: 1px; background: color-mix(in srgb, var(--border) 70%, transparent); }
.g-tick-lbl { position: absolute; top: 32px; transform: translateX(3px); font-size: 11px; color: var(--text-dim); }

/* Tages-Kopf (Wochentag + Datum) über der Zeitachse + Tagestrenner/Schattierung */
.g-day {
    position: absolute; top: 0; height: 23px;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: var(--text);
    border-bottom: 1px solid var(--border); border-left: 2px solid var(--border);
    overflow: hidden; white-space: nowrap;
}
.g-day.alt { background: color-mix(in srgb, var(--text) 4%, transparent); }
.g-day-band { position: absolute; top: 0; bottom: 0; z-index: 0; background: color-mix(in srgb, var(--text) 3.5%, transparent); pointer-events: none; }
.g-day-sep-row { position: absolute; top: 0; bottom: 0; width: 2px; z-index: 5; background: color-mix(in srgb, var(--accent, #6264A7) 50%, transparent); pointer-events: none; }

.g-now { position: absolute; top: 0; bottom: 0; width: 2px; background: #ef4444; z-index: 6; box-shadow: 0 0 6px rgba(239,68,68,.6); }
.g-now::before { content: ""; position: absolute; top: -3px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: #ef4444; }
.g-now-lbl { position: absolute; top: 30px; left: 5px; font-size: 10.5px; font-weight: 700; color: #ef4444; white-space: nowrap; }
.g-now-row { position: absolute; top: -1px; bottom: -1px; width: 2px; background: color-mix(in srgb, #ef4444 60%, transparent); z-index: 3; }

/* Balken im TimeAssist-Stil: gerundet, Schatten, weißer Text mit Schatten, Hover-Lift */
.g-bar {
    position: absolute; top: 13px; height: 30px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center; text-align: center;
    overflow: hidden; box-sizing: border-box;
    padding: 0 9px; white-space: nowrap; text-overflow: ellipsis;
    color: #fff; font-size: 11.5px; font-weight: 600; line-height: 1.15;
    text-shadow: 0 1px 2px rgba(0,0,0,.4);
    box-shadow: 0 2px 6px rgba(16,24,40,.22); opacity: .96; cursor: pointer;
    filter: saturate(1.05);
    transition: transform .14s cubic-bezier(.4,0,.2,1), box-shadow .14s, opacity .14s;
}
.g-bar:hover { transform: translateY(-1px) scaleY(1.05); box-shadow: 0 6px 16px rgba(16,24,40,.32); opacity: 1; z-index: 5; }
.bar-anwesend { background: linear-gradient(180deg, #22c55e, #16a34a); z-index: 2; }
.bar-feierabend {
    top: 20px; height: 16px; border-radius: 4px;
    background: repeating-linear-gradient(45deg,
        transparent, transparent 5px,
        color-mix(in srgb, var(--st-offline) 22%, transparent) 5px,
        color-mix(in srgb, var(--st-offline) 22%, transparent) 10px);
    border: none; color: transparent; text-shadow: none; box-shadow: none; z-index: 1; cursor: default;
}
.bar-feierabend:hover { transform: none; box-shadow: none; opacity: .96; }
.bar-live { box-shadow: 0 0 0 2px color-mix(in srgb, var(--st-available) 45%, transparent), 0 2px 8px rgba(16,24,40,.25); }
.gl-sw.bar-anwesend { background: linear-gradient(180deg, #22c55e, #16a34a); }
.gl-sw.bar-feierabend { background: repeating-linear-gradient(45deg, transparent, transparent 4px, color-mix(in srgb, var(--st-offline) 28%, transparent) 4px, color-mix(in srgb, var(--st-offline) 28%, transparent) 8px); }
.gl-sw.bar-live { background: var(--st-available); box-shadow: 0 0 0 2px color-mix(in srgb, var(--st-available) 45%, transparent); }

/* Outlook-Termine (lila) + Teams-Icon */
.bar-cal { background: linear-gradient(180deg, #8083db, #6264A7); z-index: 4; gap: 5px; }
.bar-cal.is-teams { background: linear-gradient(180deg, #7a8cf0, #5b6fd8); }
/* Ganztägiger Outlook-Termin: durchgehendes Tagesband, etwas heller + Innenkontur zur Abgrenzung von Meetings */
.bar-cal.is-allday { background: linear-gradient(180deg, #8b8ed6, #6b6eb6); box-shadow: inset 0 0 0 1px color-mix(in srgb, #fff 20%, transparent); }
/* Abgesagter Termin: rot, durchgestrichen – sofort als „weg" erkennbar */
.bar-cal.is-cancelled { background: linear-gradient(180deg, #f0616e, #dc2626); }
.bar-cal.is-cancelled .gb-tx { text-decoration: line-through; opacity: .92; }
.gl-sw.bar-cancelled { background: linear-gradient(180deg, #f0616e, #dc2626); }

/* Klickbarer Termin-Balken + Bearbeiten/Löschen-Dialog */
.g-bar.is-editable { cursor: pointer; }
.cal-edit-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 60; display: flex; align-items: center; justify-content: center; }
.cal-edit { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; width: min(440px, 92vw); box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.ce-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ce-title { font-weight: 700; font-size: 15px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ce-x { border: none; background: transparent; color: var(--text-dim); cursor: pointer; font-size: 15px; }
.ce-note { background: color-mix(in srgb, #ef4444 15%, transparent); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; margin-bottom: 10px; }
.ce-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.ce-row label { width: 56px; color: var(--text-dim); font-size: 12.5px; }
.ce-row input { flex: 1; }
.ce-hint { color: var(--text-dim); font-size: 11.5px; margin: 8px 0; }
.ce-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.action-btn.danger { background: linear-gradient(180deg, #ef4444, #dc2626); color: #fff; border-color: transparent; }
.ce-odoo {
    display: inline-flex; align-items: center; gap: 6px; margin: 2px 0 12px; padding: 7px 12px;
    border-radius: 8px; text-decoration: none; font-size: 13px; font-weight: 600;
    color: var(--text); background: color-mix(in srgb, var(--accent, #6264A7) 18%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent, #6264A7) 42%, transparent);
}
.ce-odoo:hover { background: color-mix(in srgb, var(--accent, #6264A7) 30%, transparent); }
.ce-row span { font-size: 13px; }

/* Smart Timer + Aufgabe/Ticket zuordnen */
.ce-timer {
    display: inline-flex; align-items: center; gap: 6px; margin: 0 0 12px; padding: 8px 14px;
    border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer;
    color: #fff; background: linear-gradient(180deg, #22c55e, #16a34a); border: 1px solid transparent;
}
.ce-timer:hover { filter: brightness(1.07); }
.ce-assign { margin: 2px 0 12px; }
.ce-assign-toggle {
    background: none; border: 1px dashed var(--border); color: var(--text-dim);
    border-radius: 8px; padding: 7px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; width: 100%; text-align: left;
}
.ce-assign-toggle:hover { color: var(--text); border-color: var(--text-dim); }
.ce-assign-in {
    width: 100%; margin-top: 8px; padding: 8px 10px; border-radius: 8px; font-size: 13px;
    background: var(--surface); border: 1px solid var(--border); color: var(--text);
}
.ce-assign-list { margin-top: 6px; max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.ce-assign-hit {
    text-align: left; background: var(--surface); border: 1px solid var(--border); color: var(--text);
    border-radius: 8px; padding: 7px 10px; font-size: 12.5px; cursor: pointer; line-height: 1.35;
}
.ce-assign-hit:hover { border-color: var(--accent, #6264A7); background: color-mix(in srgb, var(--accent, #6264A7) 12%, transparent); }
.ce-assign-ref { font-weight: 700; color: var(--accent, #6264A7); margin-right: 4px; }
.ce-assign-sub { display: block; color: var(--text-dim); font-size: 11px; margin-top: 2px; }

/* ── Nutzungsanalyse ── */
.ua-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.ua-presets { display: inline-flex; gap: 5px; }
.ua-kpis { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ua-kpis.small { margin-bottom: 0; gap: 8px; }
.ua-kpi { flex: 1 1 120px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.ua-kpi .k-val { font-size: 22px; font-weight: 800; line-height: 1.1; }
.ua-kpi .k-lbl { font-size: 11.5px; color: var(--text-dim); }
.ua-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ua-grid .ua-wide { grid-column: 1 / -1; }
@media (max-width: 900px) { .ua-grid { grid-template-columns: 1fr; } }
.ua-donut-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.ua-donut-c { font-size: 20px; font-weight: 800; fill: var(--text); text-anchor: middle; }
.ua-donut-s { font-size: 8px; fill: var(--text-dim); text-anchor: middle; }
.ua-legend { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; min-width: 0; }
.ua-leg { display: flex; align-items: center; gap: 7px; }
.ua-leg b { font-weight: 700; }
.ua-sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex: 0 0 auto; }
.ua-dim { color: var(--text-dim); }
.ua-bar { display: flex; height: 26px; border-radius: 7px; overflow: hidden; background: color-mix(in srgb, var(--text) 6%, transparent); }
.ua-bar-seg { height: 100%; }
.ua-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ua-util { display: inline-block; width: 60px; height: 7px; border-radius: 4px; background: color-mix(in srgb, var(--text) 10%, transparent); margin-right: 7px; vertical-align: middle; overflow: hidden; }
.ua-util-bar { display: block; height: 100%; background: linear-gradient(90deg, #22c55e, #f59e0b); }
.ua-flows { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.ua-flow { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.ua-flow .ua-arrow { color: var(--accent, #6264A7); font-weight: 700; }
.ua-flow .ua-flow-n { margin-left: auto; font-weight: 700; color: var(--text-dim); }
.ua-foot { margin-top: 12px; font-size: 11.5px; color: var(--text-muted); }
.ua-vs { color: var(--text-dim); font-size: 12px; }
/* Vergleich */
.ua-compare .ua-vs { font-weight: 400; }
.ua-up { color: #22c55e; font-weight: 700; }
.ua-down { color: #ef4444; font-weight: 700; }
/* Auslastungsindex */
.ua-index { display: flex; align-items: baseline; gap: 4px; margin: 4px 0; }
.ua-index-val { font-size: 40px; font-weight: 800; line-height: 1; }
.ua-index-max { color: var(--text-dim); font-size: 14px; }
.ua-idx-bar { height: 8px; border-radius: 5px; background: color-mix(in srgb, var(--text) 10%, transparent); overflow: hidden; margin: 6px 0 12px; }
.ua-idx-bar span { display: block; height: 100%; }
.ua-idx-comp { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
.ua-idx-comp > div { display: flex; justify-content: space-between; gap: 10px; }
.ua-idx-comp span { color: var(--text-dim); }
/* Heatmap */
.ua-heat { border-collapse: collapse; font-size: 11px; }
.ua-heat th { color: var(--text-dim); font-weight: 600; padding: 2px 3px; text-align: center; }
.ua-heat .ua-heat-lbl { text-align: left; white-space: nowrap; padding-right: 10px; color: var(--text); font-size: 12px; }
.ua-heat-cell { width: 22px; height: 22px; border: 1px solid color-mix(in srgb, var(--border) 60%, transparent); border-radius: 3px; }
/* Empfehlungen */
.ua-reco { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 700px) { .ua-reco { grid-template-columns: 1fr; } }
.ua-reco-h { font-size: 12px; font-weight: 700; color: var(--text-dim); margin-bottom: 6px; }
.ua-reco-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 3px 0; }
.ua-reco-row b.hi { color: #ef4444; }
.ua-reco-row b.lo { color: #22c55e; }
/* KI-Analyse */
.ua-ai-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ua-ai-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 12px; }
@media (max-width: 700px) { .ua-ai-grid { grid-template-columns: 1fr; } }
.ua-ai-h { font-size: 12.5px; font-weight: 700; color: var(--text-dim); margin-bottom: 6px; }
.ua-ai-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.ua-ai-list li { line-height: 1.4; }
/* Filterzeile: Text-Buttons (Presets/Vergleich) nicht ins 28×28-Icon-Quadrat quetschen */
.ua-filters .mini-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: auto; height: auto; min-width: 30px; white-space: nowrap;
    padding: 5px 10px; border-radius: 6px; color: var(--text);
    background: var(--surface); border: 1px solid var(--border); cursor: pointer;
}
.ua-filters .mini-btn.on { background: var(--accent, #6264A7); color: #fff; border-color: transparent; }
/* Kopf mit Qualitäts-Ampel rechts */
.ua-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ua-quality { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px 14px; }
.ua-q-dot { font-size: 20px; line-height: 1; }
.ua-q-val { font-size: 20px; font-weight: 800; line-height: 1.1; }
.ua-q-lbl { font-size: 11px; color: var(--text-dim); }
/* Bot-bestätigt vs. geschätzt (Meeting-Zeit) */
.ua-vbadge { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.ua-vbadge.ok { background: color-mix(in srgb, #22c55e 22%, transparent); color: #22c55e; }
.ua-vbadge.part { background: color-mix(in srgb, #f59e0b 22%, transparent); color: #f59e0b; }
.ua-vbadge.est { background: color-mix(in srgb, var(--text) 12%, transparent); color: var(--text-dim); }

/* ── Fokusmodus ── */
.badge.focus-badge { background: color-mix(in srgb, var(--st-focus, #8b5cf6) 24%, transparent); color: var(--st-focus, #8b5cf6); font-weight: 700; white-space: nowrap; }
.focus-choices { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 10px; }
.focus-custom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--border); }
.focus-custom label { color: var(--text-dim); font-size: 12.5px; }
.focus-panel { margin: 10px 0 4px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--st-focus, #8b5cf6) 12%, transparent); border: 1px solid color-mix(in srgb, var(--st-focus, #8b5cf6) 35%, transparent); }
.focus-panel .fp-head { font-weight: 700; margin-bottom: 6px; color: var(--st-focus, #8b5cf6); }
.focus-panel .fp-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 1px 0; }
.focus-panel .fp-row span { color: var(--text-dim); }
.focus-panel .fp-dnd { margin-top: 6px; font-size: 11.5px; color: var(--text-dim); }

/* ── Verzögerte Nachrichten ── */
.dm-section { margin: 4px 18px 18px; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.dm-busy { font-size: 12.5px; padding: 7px 10px; border-radius: 8px; background: color-mix(in srgb, #f59e0b 15%, transparent); color: #f59e0b; font-weight: 600; }
.dm-text { width: 100%; resize: vertical; background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius-sm); padding: 8px 10px; font-family: var(--font); font-size: 13px; }
.dm-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dm-row label { color: var(--text-dim); font-size: 12px; min-width: 60px; }
.dm-row select { flex: 1; min-width: 0; }
.dm-hint { font-size: 11px; color: var(--text-muted); }
.dm-done td { opacity: .6; }
.dm-cell { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-status { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.dm-status.wait { background: color-mix(in srgb, #f59e0b 20%, transparent); color: #f59e0b; }
.dm-status.ok { background: color-mix(in srgb, #22c55e 20%, transparent); color: #22c55e; }
.dm-status.off { background: color-mix(in srgb, var(--text) 12%, transparent); color: var(--text-dim); }
.dm-status.err { background: color-mix(in srgb, #ef4444 20%, transparent); color: #ef4444; }
.dm-prio { font-size: 11.5px; font-weight: 700; text-transform: capitalize; }
.dm-prio.dringend { color: #f59e0b; }
.dm-prio.kritisch { color: #ef4444; }
.dm-actions { white-space: nowrap; }
.dm-actions .mini-btn { display: inline-flex; width: 26px; height: 26px; margin-left: 3px; }

/* ── Interne Anrufe (K1) ── */
.badge.call-badge { background: color-mix(in srgb, #ef4444 22%, transparent); color: #ef4444; font-weight: 700; white-space: nowrap; }
.call-panel { margin: 10px 0 4px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, #ef4444 10%, transparent); border: 1px solid color-mix(in srgb, #ef4444 32%, transparent); }
.call-panel .cp-head { font-weight: 700; margin-bottom: 6px; color: #ef4444; }
.call-panel .cp-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 1px 0; }
.call-panel .cp-row span { color: var(--text-dim); }
.cp-hide { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-dim); cursor: pointer; }

/* ── Anklopfen / Zutritt (§2–§6, §14) ── */
.conv-panel { margin: 4px 18px 4px; padding: 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.conv-bot { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--text); }
.conv-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--st-away); }
.conv-present .conv-dot { background: var(--st-present); box-shadow: 0 0 0 3px color-mix(in srgb, var(--st-present) 22%, transparent); }
.conv-away .conv-dot { background: #f59e0b; box-shadow: 0 0 0 3px color-mix(in srgb, #f59e0b 22%, transparent); }
.conv-offline .conv-dot { background: var(--st-away); }
.conv-hint { font-size: 12px; color: var(--text-dim); background: color-mix(in srgb, var(--text) 6%, transparent); border-radius: 8px; padding: 8px 10px; line-height: 1.4; }
.conv-input { width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius-sm); padding: 8px 10px; font-family: var(--font); font-size: 13px; }
.conv-status { font-size: 12.5px; font-weight: 600; padding: 7px 10px; border-radius: 8px; display: flex; align-items: center; gap: 8px; }
.conv-status.wait { background: color-mix(in srgb, #f59e0b 15%, transparent); color: #f59e0b; }
.conv-status.ok { background: color-mix(in srgb, #22c55e 16%, transparent); color: #22c55e; }
.conv-status.no { background: color-mix(in srgb, var(--text) 10%, transparent); color: var(--text-dim); }
.link-btn { margin-left: auto; background: none; border: none; color: inherit; text-decoration: underline; cursor: pointer; font-size: 12px; padding: 0; }

/* Anklopf-Inbox: die anwesenden Teilnehmer entscheiden (§4/§23) */
.knock-inbox { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 36px)); }
.knock-card { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent, #6264A7); border-radius: 12px; padding: 12px 14px; box-shadow: 0 16px 40px rgba(0,0,0,.35); display: flex; flex-direction: column; gap: 8px; animation: knock-in .18s ease; }
.knock-card.urgent { border-left-color: #f59e0b; }
@keyframes knock-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.knock-head { display: flex; gap: 10px; align-items: flex-start; }
.knock-emoji { font-size: 20px; line-height: 1; }
.knock-head .grow { flex: 1; font-size: 13px; }
.knock-sub { color: var(--text-dim); font-size: 11.5px; margin-top: 2px; }
.knock-prio { display: inline-block; margin-left: 6px; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, #f59e0b 20%, transparent); color: #f59e0b; vertical-align: middle; }
.knock-prio.wichtig { background: color-mix(in srgb, var(--text) 12%, transparent); color: var(--text-dim); }
.knock-reason { font-size: 12.5px; color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); border-radius: 8px; padding: 6px 9px; }
.knock-reply { width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius-sm); padding: 7px 9px; font-family: var(--font); font-size: 13px; }
.knock-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.knock-actions .action-btn { flex: 1 1 auto; padding: 6px 10px; font-size: 12.5px; justify-content: center; }

/* ── Geplante Meetings ── */
.sched-card { display: flex; flex-direction: column; gap: 5px; }
.sched-card.sched-running { border-color: color-mix(in srgb, #22c55e 45%, transparent); }
.sched-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sched-name { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-cd { font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap;
    background: color-mix(in srgb, var(--accent, #6264A7) 18%, transparent); color: var(--text); }
.sched-cd.on { background: color-mix(in srgb, #22c55e 25%, transparent); color: #22c55e; }
.sched-when { font-size: 12.5px; color: var(--text); }
.sched-meta { font-size: 12px; color: var(--text-dim); display: flex; gap: 6px; flex-wrap: wrap; }
.sched-agenda { font-size: 11.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.gb-teams { font-size: 12px; line-height: 1; flex: 0 0 auto; }
.g-bar .gb-tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.gl-sw.bar-cal { background: linear-gradient(180deg, #8083db, #6264A7); }

/* V-Office-Raumaufenthalte – einheitlich türkis (bewusst NICHT room.Color, sonst Kollision mit Outlook-Lila) */
.bar-room { background: linear-gradient(180deg, #22b8cf, #0e9bb0); z-index: 3; }
.gl-sw.bar-room { background: linear-gradient(180deg, #22b8cf, #0e9bb0); }

/* Abwesenheiten: Abwesend (neutral grau) / Urlaub (blau) */
.bar-leave { background: color-mix(in srgb, var(--st-away) 60%, #1b1f27); color: #fff; z-index: 2; }
.bar-leave.is-urlaub { background: linear-gradient(180deg, #38bdf8, #0ea5e9); color: #04283a; }
.gl-sw.bar-leave { background: color-mix(in srgb, var(--st-away) 60%, #1b1f27); }
.gl-sw.bar-leave.is-urlaub { background: linear-gradient(180deg, #38bdf8, #0ea5e9); }

/* Arbeitszeit-Summe im linken Panel (wie TimeAssist) */
.gn-total { font-size: 11px; font-weight: 700; color: var(--st-available); margin-top: 1px; }

.gantt-empty { padding: 24px; color: var(--text-muted); }

/* Stammdaten Abwesenheitsarten */
.lt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.lt-table th { text-align: left; font-weight: 600; color: var(--text-dim); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.lt-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.lt-table tbody tr:hover td { background: color-mix(in srgb, var(--surface) 60%, transparent); }
.lt-id { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.lt-dim { color: var(--text-dim); }
.lt-prev { display: inline-block; padding: 3px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.ct-prev { display: inline-block; padding: 3px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35); white-space: nowrap; }
.ct-add { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.ct-add h4 { margin: 0 0 8px; font-size: 13px; }
.lt-table input[type="color"] { width: 34px; height: 26px; padding: 0; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); cursor: pointer; vertical-align: middle; }

.room-tile {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    min-height: 0; /* Höhe folgt dem Inhalt – leere Räume bleiben kompakt */
    transition: border-color 0.2s, box-shadow 0.2s;
    animation: tileIn 0.35s ease;
}

@keyframes tileIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.room-tile:hover { border-color: var(--border); box-shadow: var(--shadow); }

/* Raumfarbe als Akzentbalken oben (per Inline-Style --room-accent gesetzt) */
.room-tile { border-top: 3px solid var(--room-accent, var(--border-soft)); }

.room-tile.inactive { opacity: 0.55; }

.card.inactive-card { opacity: 0.6; }

.room-enter {
    opacity: 0;
    transition: opacity 0.15s;
}

.room-head:hover .room-enter { opacity: 1; }

.room-meeting-hint.teams {
    background: color-mix(in srgb, #6264a7 16%, transparent);
    color: #8b93f8;
}

:root[data-theme="light"] .room-meeting-hint.teams { color: #5b63c7; }

.room-meeting-hint .join-inline {
    margin-left: auto;
    font-weight: 650;
    color: inherit;
    text-decoration: underline;
    white-space: nowrap;
}

/* "Mein Raum"-Schnellwechsel in der Topbar */
.my-room-select {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-dim);
    white-space: nowrap;
}

@media (max-width: 900px) {
    .my-room-select .my-room-label { display: none; }
}

.room-tile.has-meeting { border-color: color-mix(in srgb, var(--st-meeting) 45%, var(--border)); }
.room-tile.critical { border-color: color-mix(in srgb, #ef4444 55%, var(--border)); }

.room-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 15px 10px;
    cursor: pointer;
    border-radius: var(--radius) var(--radius) 0 0;
    border: 0;
    background: none;
    color: var(--text);
    width: 100%;
    font-family: var(--font);
}

.room-head:hover { background: var(--surface-hover); }

.room-emoji { font-size: 20px; }
.room-name { font-weight: 650; font-size: 14.5px; flex: 1; text-align: left; }

.room-count {
    font-size: 12px;
    color: var(--text-dim);
    background: var(--surface-2);
    border-radius: 999px;
    padding: 2px 9px;
    font-variant-numeric: tabular-nums;
    transition: background 0.3s;
}

.room-meeting-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 15px 8px;
    padding: 7px 11px;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--st-meeting) 12%, transparent);
    color: var(--st-meeting);
    font-size: 12.5px;
    font-weight: 550;
}

/* Manueller Bot-Check „Wer ist wirklich drin?" */
.room-probe { margin: 0 15px 8px; display: flex; flex-direction: column; gap: 6px; }
.probe-btn {
    align-self: flex-start; width: auto; height: auto; display: inline-flex; align-items: center;
    padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
    border: 1px solid color-mix(in srgb, var(--accent, #6264A7) 40%, transparent);
    background: color-mix(in srgb, var(--accent, #6264A7) 14%, transparent); color: var(--text); cursor: pointer;
}
.probe-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--accent, #6264A7) 26%, transparent); }
.probe-btn:disabled { opacity: .7; cursor: default; }
.probe-result { font-size: 12px; line-height: 1.35; color: var(--text-dim); padding: 6px 10px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--st-available) 10%, transparent); }
.probe-result.err { background: color-mix(in srgb, #ef4444 12%, transparent); color: #ef4444; }
.probe-result .pr-head { font-weight: 700; color: var(--st-available); margin-right: 5px; }
.probe-result .pr-names { color: var(--text); }
/* Bot-Check-Markierung je Teilnehmer */
.occ-wrap { position: relative; }
.occ-wrap.occ-out { opacity: .5; }
.occ-badge { position: absolute; top: 3px; right: 5px; z-index: 2; width: 17px; height: 17px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 11px; font-weight: 800; }
.occ-badge.in { background: color-mix(in srgb, #22c55e 30%, var(--surface)); color: #22c55e; }
.occ-badge.out { background: color-mix(in srgb, #ef4444 30%, var(--surface)); color: #ef4444; }

.room-meeting-hint.critical {
    background: color-mix(in srgb, #ef4444 12%, transparent);
    color: #ef4444;
}

.room-body {
    padding: 4px 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

/* Eingeladen, aber nicht im Meeting: graue Karte */
.invited > .emp-card { opacity: 0.4; filter: grayscale(0.8); }
.invited > .emp-card:hover { opacity: 0.75; filter: grayscale(0.3); }

/* ── Mitarbeiter-Drag&Drop (Phase 3) ── */
.emp-card[draggable="true"] { cursor: grab; }
.emp-card.dnd-dragging { opacity: 0.5; transform: scale(0.97); cursor: grabbing; }
body.dnd-active, body.dnd-active .emp-card { cursor: grabbing; }
.room-tile.dnd-over {
    outline: 2px solid var(--accent, #6264A7);
    outline-offset: 1px;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent, #6264A7) 22%, transparent);
    transition: box-shadow 0.12s;
}

.dnd-toast {
    position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
    z-index: 60; padding: 11px 18px; border-radius: 10px;
    font-size: 13.5px; font-weight: 600;
    background: var(--surface); border: 1px solid var(--border);
    box-shadow: 0 8px 30px rgba(0,0,0,0.35);
    animation: toastIn 0.2s ease;
}
.dnd-toast.ok { color: var(--st-available); border-color: color-mix(in srgb, var(--st-available) 45%, transparent); }
.dnd-toast.err { color: var(--st-busy); border-color: color-mix(in srgb, var(--st-busy) 45%, transparent); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

.modal-overlay {
    position: fixed; inset: 0; z-index: 80;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    animation: toastIn 0.15s ease;
}
.dnd-modal {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; padding: 22px 24px; width: min(440px, 92vw);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.dnd-modal h3 { font-size: 16px; margin: 0 0 10px; }
.dnd-modal-line { font-size: 14.5px; margin: 0 0 10px; }
.dnd-modal-hint { color: var(--text-dim); font-size: 12.5px; margin: 0 0 16px; line-height: 1.5; }
.dnd-modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Laufende Einladung – Vorschau „wird angerufen …" */
.invite-pending {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 11px; margin-top: 8px; border-radius: 10px;
    background: color-mix(in srgb, var(--st-focus) 12%, var(--surface));
    border: 1px dashed color-mix(in srgb, var(--st-focus) 55%, transparent);
}
.invite-pending .ring { font-size: 17px; animation: ringPulse 1s ease-in-out infinite; }
.invite-pending .ip-name { font-weight: 600; font-size: 13.5px; }
.invite-pending .ip-sub { color: var(--text-dim); font-size: 12px; }
@keyframes ringPulse {
    0%, 100% { transform: rotate(0) scale(1); }
    25% { transform: rotate(-12deg) scale(1.08); }
    75% { transform: rotate(12deg) scale(1.08); }
}

.ext-row { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex-wrap: wrap; }
.ext-name { font-weight: 600; color: var(--text); font-size: 12.5px; }
.ext-sub { color: var(--text-muted); font-size: 11.5px; }

.room-external {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    color: var(--text-dim);
    font-size: 12px;
    padding: 6px 9px 2px;
    border-top: 1px dashed var(--border-soft);
    margin-top: 4px;
}

.room-empty {
    color: var(--text-muted);
    font-size: 12.5px;
    padding: 10px 8px 4px;
    font-style: italic;
}

/* ── Mitarbeiterkarte ──────────────────────────────────────────────────── */
.emp-card {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 9px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
    animation: cardIn 0.45s ease;
    text-align: left;
    border: 0;
    background: none;
    color: var(--text);
    width: 100%;
    font-size: 13.5px;
    font-family: var(--font);
}

@keyframes cardIn {
    from { opacity: 0; transform: scale(0.92) translateY(6px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.emp-card:hover { background: var(--surface-hover); }

/* Kurze Hervorhebung nach Statuswechsel */
.emp-card.changed { animation: cardIn 0.45s ease, changedGlow 3.2s ease-out; }

@keyframes changedGlow {
    0% { box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
    100% { box-shadow: inset 0 0 0 1px transparent; background: transparent; }
}

.emp-card.offline { opacity: 0.55; }

.emp-main { flex: 1; min-width: 0; }

.emp-name {
    font-weight: 600;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lead-star { color: var(--st-focus); font-size: 11px; }

/* Rolle/Kontext: bis zu 2 Zeilen umbrechen statt hart abschneiden (… erst nach der 2. Zeile). */
.emp-role {
    color: var(--text-dim); font-size: 12px;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    overflow: hidden; overflow-wrap: anywhere;
}

.emp-status-line {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.emp-context {
    color: var(--text-dim); font-size: 12px; margin-top: 1px;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    overflow: hidden; overflow-wrap: anywhere;
}

.emp-since { color: var(--text-muted); font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.emp-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
    flex-shrink: 0;
}

.emp-card:hover .emp-actions, .emp-card:focus-within .emp-actions { opacity: 1; }

.mini-btn {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.12s;
}

.mini-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.mini-btn.join:hover { background: var(--st-meeting); border-color: var(--st-meeting); }

/* Kompaktmodus */
.emp-card.compact { padding: 5px 8px; }
.emp-card.compact .emp-role, .emp-card.compact .emp-context { display: none; }

/* ── Avatar ────────────────────────────────────────────────────────────── */
.avatar {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
    letter-spacing: 0.3px;
    user-select: none;
}

.avatar.lg { width: 56px; height: 56px; font-size: 19px; }
.avatar.sm { width: 28px; height: 28px; font-size: 10.5px; }

.avatar .presence {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2.5px solid var(--surface);
    transition: background 0.3s;
}

.avatar.lg .presence { width: 15px; height: 15px; }

/* ── Status ────────────────────────────────────────────────────────────── */
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; transition: background 0.3s; }

.status-text { font-weight: 550; }

.st-available { color: var(--st-available); }
.st-present { color: var(--st-present); }
.st-busy { color: var(--st-busy); }
.st-meeting { color: var(--st-meeting); }
.st-customer { color: var(--st-customer); }
.st-phone { color: var(--st-phone); }
.st-focus { color: var(--st-focus); }
.st-break { color: var(--st-break); }
.st-away { color: var(--st-away); }
.st-road { color: var(--st-road); }
.st-offline { color: var(--st-offline); }

.bg-available { background: var(--st-available); }
.bg-present { background: var(--st-present); }
.bg-busy { background: var(--st-busy); }
.bg-meeting { background: var(--st-meeting); }
.bg-customer { background: var(--st-customer); }
.bg-phone { background: var(--st-phone); }
.bg-focus { background: var(--st-focus); }
.bg-break { background: var(--st-break); }
.bg-away { background: var(--st-away); }
.bg-road { background: var(--st-road); }
.bg-offline { background: var(--st-offline); }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.available { background: color-mix(in srgb, var(--st-available) 14%, transparent); color: var(--st-available); }
.status-badge.present { background: color-mix(in srgb, var(--st-present) 14%, transparent); color: var(--st-present); }
.status-badge.busy { background: color-mix(in srgb, var(--st-busy) 14%, transparent); color: var(--st-busy); }
.status-badge.meeting { background: color-mix(in srgb, var(--st-meeting) 14%, transparent); color: var(--st-meeting); }
.status-badge.customer { background: color-mix(in srgb, var(--st-customer) 14%, transparent); color: var(--st-customer); }
.status-badge.phone { background: color-mix(in srgb, var(--st-phone) 14%, transparent); color: var(--st-phone); }
.status-badge.focus { background: color-mix(in srgb, var(--st-focus) 16%, transparent); color: var(--st-focus); }
.status-badge.break { background: color-mix(in srgb, var(--st-break) 14%, transparent); color: var(--st-break); }
.status-badge.away { background: color-mix(in srgb, var(--st-away) 18%, transparent); color: var(--st-away); }
.status-badge.road { background: color-mix(in srgb, var(--st-road) 14%, transparent); color: var(--st-road); }
.status-badge.offline { background: color-mix(in srgb, var(--st-offline) 18%, transparent); color: var(--st-offline); }

/* ── Sidepanel ─────────────────────────────────────────────────────────── */
.panel-backdrop {
    position: fixed;
    inset: 0;
    background: var(--backdrop);
    z-index: 80;
    animation: fadeIn 0.2s ease;
    border: 0;
    padding: 0;
    cursor: default;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.side-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(430px, 94vw);
    background: var(--surface);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow);
    z-index: 90;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.25s cubic-bezier(0.22, 0.8, 0.36, 1);
}

@keyframes slideIn {
    from { transform: translateX(40px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.panel-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border-soft);
}

.panel-head .who { flex: 1; min-width: 0; }
.panel-head h2 { font-size: 17px; }
.panel-head .sub { color: var(--text-dim); font-size: 13px; margin-top: 2px; }

.panel-close {
    align-self: flex-start;
    background: none;
    border: 0;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
}

.panel-close:hover { background: var(--surface-hover); color: var(--text); }

.panel-body { padding: 16px 20px; overflow-y: auto; flex: 1; }

.info-grid { display: grid; grid-template-columns: 130px 1fr; gap: 9px 12px; font-size: 13.5px; margin: 0; }
.info-grid dt { color: var(--text-dim); }
.info-grid dd { margin: 0; font-weight: 500; }

.panel-section-title {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    font-weight: 650;
    margin: 20px 0 10px;
}

.panel-actions {
    padding: 14px 20px 18px;
    border-top: 1px solid var(--border-soft);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}

.action-btn:hover { background: var(--surface-hover); border-color: var(--accent); color: var(--accent); }

.action-btn.primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: 0;
    color: #fff;
}

.action-btn.primary:hover { filter: brightness(1.1); color: #fff; }

.masked-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-style: italic;
    font-size: 12.5px;
}

.participant-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 13.5px;
}

.participant-row .sub { color: var(--text-dim); font-size: 12px; }
.participant-row .grow { flex: 1; min-width: 0; }

/* ── Meetings ──────────────────────────────────────────────────────────── */
.meeting-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
}

.meeting-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: tileIn 0.35s ease;
}

.meeting-card.critical { border-color: color-mix(in srgb, #ef4444 55%, var(--border)); }

.meeting-title-row { display: flex; align-items: flex-start; gap: 10px; }
.meeting-title-row h3 { font-size: 15px; flex: 1; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge.intern { background: color-mix(in srgb, var(--st-meeting) 14%, transparent); color: var(--st-meeting); }
.badge.extern { background: color-mix(in srgb, var(--st-customer) 14%, transparent); color: var(--st-customer); }
.badge.critical { background: color-mix(in srgb, #ef4444 14%, transparent); color: #ef4444; }
.badge.live { background: color-mix(in srgb, var(--st-available) 14%, transparent); color: var(--st-available); }
.badge.held { background: color-mix(in srgb, var(--st-focus) 16%, transparent); color: var(--st-focus); }

.meeting-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-dim); }
.meeting-meta strong { color: var(--text); font-weight: 600; }

.meeting-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 2px; }

.avatar-stack { display: flex; align-items: center; padding-right: 8px; }
.avatar-stack .avatar { margin-right: -8px; border: 2px solid var(--surface); }
.avatar-stack .more {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--surface-2); color: var(--text-dim);
    display: grid; place-items: center; font-size: 10.5px; font-weight: 700;
    border: 2px solid var(--surface); margin-right: -8px;
}

/* ── Tabellen (Mitarbeiterliste) ──────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    font-size: 13.5px;
}

.data-table th {
    text-align: left;
    padding: 11px 14px;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    white-space: nowrap;
}

.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { cursor: pointer; transition: background 0.12s; }
.data-table tbody tr:hover { background: var(--surface-hover); }
.data-table tbody tr.changed { animation: changedGlow 3.2s ease-out; }

.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-sm);
}

/* ── Einstellungen / Karten ────────────────────────────────────────────── */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 16px;
    align-items: start;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 18px 20px;
}

.card h3 { font-size: 15px; margin-bottom: 4px; }
.card .card-sub { color: var(--text-dim); font-size: 12.5px; margin-bottom: 14px; }

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border-soft);
    font-size: 13.5px;
}

.setting-row:last-child { border-bottom: 0; }
.setting-row .hint { color: var(--text-muted); font-size: 12px; margin-top: 2px; }

/* Switch */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
    position: absolute; inset: 0; border-radius: 999px;
    background: var(--border); transition: background 0.2s; cursor: pointer;
}
.switch .slider::before {
    content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
    left: 3px; top: 3px; background: #fff; transition: transform 0.2s;
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(18px); }

.color-legend { display: flex; flex-direction: column; gap: 8px; }
.color-legend .row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.color-swatch { width: 18px; height: 18px; border-radius: 6px; flex-shrink: 0; }

/* Raum-Konfiguration */
.room-config-row {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 8px 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-soft);
    align-items: center;
}

.room-config-row:last-child { border-bottom: 0; }
.room-config-row input { width: 100%; }
.room-config-row .emoji-input { text-align: center; font-size: 16px; padding: 7px 4px; }
.room-config-row .desc { grid-column: 1 / -1; }

/* ── Leere Zustände ────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    color: var(--text-dim);
    padding: 60px 20px;
    font-size: 14px;
}

.empty-state .big { font-size: 34px; margin-bottom: 10px; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    :root { --sidebar-w: 64px; }
    .sidebar { padding: 14px 8px; align-items: center; }
    .sidebar-brand { padding: 6px 0 18px; }
    .sidebar-brand .brand-text { display: none; }
    .nav-link { justify-content: center; padding: 10px; }
    .nav-link .nav-text { display: none; }
    .sidebar-footer { display: none; }
}

@media (max-width: 760px) {
    .app-main { padding: 14px 12px 30px; }
    .rooms-grid { columns: 1; }
    .meeting-grid { grid-template-columns: 1fr; }
    .topbar { padding: 0 12px; gap: 8px; }
    .topbar-clock, .role-select .role-label { display: none; }
    .global-search { width: 100%; }
    .info-grid { grid-template-columns: 110px 1fr; }
    .panel-actions { grid-template-columns: 1fr; }
}

/* Große Monitore: mehr Dichte */
@media (min-width: 2200px) {
    .rooms-grid { columns: 340px; }
    html { font-size: 15.5px; }
}

/* Fehler-UI der Vorlage */
#blazor-error-ui {
    background: #b91c1c;
    color: #fff;
    bottom: 0;
    box-shadow: var(--shadow);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-size: 13.5px;
}

#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

/* ── PWA: Installationshinweis ── */
.pwa-banner {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 9000;
    display: flex; align-items: center; gap: 14px; max-width: 660px; width: calc(100% - 32px);
    padding: 12px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
    box-shadow: 0 12px 40px rgba(0,0,0,.4);
}
.pwa-ico { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center;
    justify-content: center; font-size: 20px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #7B7FD4, #4E52A8); }
.pwa-body { flex: 1; min-width: 0; }
.pwa-title { font-weight: 700; font-size: 13.5px; }
.pwa-text { font-size: 12px; color: var(--text-dim); }
.pwa-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pwa-never { background: none; border: none; color: var(--text-muted); font-size: 11.5px; cursor: pointer; text-decoration: underline; }
@media (max-width: 640px) { .pwa-banner { flex-direction: column; align-items: flex-start; } }

/* ── PWA: gebrandete Reconnect-Anzeige (Blazor steuert die components-reconnect-*-Klassen) ── */
.vo-reconnect { display: none; position: fixed; inset: 0; z-index: 10000; align-items: center; justify-content: center;
    background: rgba(10,10,20,.7); backdrop-filter: blur(3px); }
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected { display: flex; }
.vo-reconnect-card { text-align: center; background: var(--surface); color: var(--text); border: 1px solid var(--border);
    border-radius: 16px; padding: 28px 32px; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.vo-reconnect-logo { width: 60px; height: 60px; border-radius: 15px; margin: 0 auto 14px; display: flex; align-items: center;
    justify-content: center; font-size: 30px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #7B7FD4, #4E52A8); }
.vo-reconnect-title { font-weight: 700; font-size: 17px; margin-bottom: 8px; }
.vo-reconnect-text { font-size: 13.5px; opacity: .85; }
.vo-r-failed { display: none; }
#components-reconnect-modal.components-reconnect-failed .vo-r-retry,
#components-reconnect-modal.components-reconnect-rejected .vo-r-retry { display: none; }
#components-reconnect-modal.components-reconnect-failed .vo-r-failed,
#components-reconnect-modal.components-reconnect-rejected .vo-r-failed { display: block; }
.pwa-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 5px; line-height: 1.4; }

/* ── Dezenter „Desktop-App installieren"-Button in der TopBar ── */
.install-wrap { position: relative; display: inline-flex; }
.icon-btn.install-btn { color: var(--text-dim); }
.icon-btn.install-btn:hover { color: var(--accent, #7B7FD4); }
.install-hint {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 9500; width: 260px;
    padding: 10px 12px; border-radius: 10px; font-size: 11.5px; line-height: 1.45;
    background: var(--surface); color: var(--text); border: 1px solid var(--border);
    box-shadow: 0 12px 32px rgba(0,0,0,.4);
}
