/* ═══════════════════════════════════════════════════════════════════════
   BI-I – Design-System der A4L-Plattform, per Kopie aus CRM Intelligence
   übernommen (die Apps teilen keine Projekte, nur die Handschrift).
   BI-I-eigene Ergänzungen stehen am Ende der Datei.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
    /* LS-V-Markenspektrum (Logo). Blau → Türkis → Gelb → Orange → Rot. */
    --brand-blue: #2166d8;
    --brand-teal: #14b58a;
    --brand-amber: #f3c013;
    --brand-orange: #f5811f;
    --brand-red: #e42b22;
    --brand-gradient: linear-gradient(90deg, #2166d8 0%, #14b58a 30%, #f3c013 55%, #f5811f 76%, #e42b22 100%);

    /* Statusfarben (in beiden Themes identisch nutzbar) – gemeinsame Plattform-Palette */
    --st-available: #22c55e;
    --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;

    /* Semantik (Priorität, Score, Freigabe) */
    --sev-crit: #e42b22;
    --sev-high: #f5811f;
    --sev-mid: #f3c013;
    --sev-low: #22c55e;

    --radius: 12px;
    --radius-sm: 8px;
    --topbar-h: 60px;
    --sidebar-w: 240px;
    --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;
    /* LS-V-Akzent (warmes Ende) – auf Dunkel leuchtstark */
    --accent: #f5811f;
    --accent-soft: #f5811f22;
    --accent-2: #e42b22;
    --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;
    /* LS-V-Akzent (warmes Ende) – auf Hell abgedunkelt für Kontrast */
    --accent: #d2551a;
    --accent-soft: #d2551a14;
    --accent-2: #cc2019;
    --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: 3px;
}

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

.sidebar-brand .logo {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--brand-gradient);
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.3px;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(228, 43, 34, 0.25);
}

.sidebar-brand .brand-text { line-height: 1.2; }

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

.nav-section {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    font-weight: 700;
    padding: 14px 12px 5px;
}

.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;
    position: relative;
}

.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.active::before {
    content: "";
    position: absolute;
    left: 0; top: 8px; bottom: 8px;
    width: 3px; border-radius: 3px;
    background: var(--accent);
}

.nav-link svg { flex-shrink: 0; }
.nav-badge {
    margin-left: auto;
    background: var(--accent);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    border-radius: 999px;
    padding: 1px 7px;
    min-width: 18px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    padding: 12px;
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.6;
    border-top: 1px solid var(--border-soft);
}

.sidebar-footer .src-dot { color: var(--st-away); }

.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: 12px;
    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); }

/* ── App-Umschalter (A4L Platform) ─────────────────────────────────────── */
.app-switcher { position: relative; }

.app-switcher-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s, border-color 0.15s;
}

.app-switcher-btn:hover { background: var(--surface-hover); border-color: var(--accent); }
.app-switcher-btn .grid-ico { color: var(--text-dim); display: grid; }
.app-switcher-btn .cur { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.app-switcher-btn .cur small { font-size: 9.5px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
.app-switcher-btn .chev { color: var(--text-muted); }

.app-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 300px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 70;
    padding: 8px;
    animation: dropIn 0.16s ease;
}

.app-menu .app-menu-title {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    font-weight: 700;
    padding: 6px 10px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: none;
    color: var(--text);
    cursor: pointer;
    font-family: var(--font);
    transition: background 0.14s;
}

.app-item:hover { background: var(--surface-hover); }
.app-item.current { border-color: var(--accent); background: var(--accent-soft); }
.app-item .app-ico {
    width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
    display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px;
}
.app-item .app-ico.ta { background: linear-gradient(135deg, #4f46e5, #06b6d4); }
.app-item .app-ico.vo { background: linear-gradient(135deg, #4f7cff, #8b5cf6); }
.app-item .app-ico.crm { background: var(--brand-gradient); }
.app-item .app-name { font-weight: 650; font-size: 13.5px; }
.app-item .app-desc { color: var(--text-dim); font-size: 11.5px; margin-top: 1px; }
.app-item .app-cur-tag { margin-left: auto; font-size: 10px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.5px; }

/* ── Dropdown-Menü (Sprache/Profil) ────────────────────────────────────── */
.menu { position: relative; }
.menu-pop {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 70;
    padding: 6px;
    animation: dropIn 0.16s ease;
}
.menu-item {
    display: flex; align-items: center; gap: 10px;
    width: 100%; text-align: left;
    padding: 8px 10px; border-radius: var(--radius-sm);
    background: none; border: 0; color: var(--text);
    cursor: pointer; font-family: var(--font); font-size: 13.5px;
}
.menu-item:hover { background: var(--surface-hover); }
.menu-item.disabled { color: var(--text-muted); cursor: default; }
.menu-item.disabled:hover { background: none; }
.menu-sep { height: 1px; background: var(--border-soft); margin: 5px 4px; }
.menu-item .check { margin-left: auto; color: var(--accent); }

.profile-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 10px 5px 6px;
    border-radius: 999px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text);
    cursor: pointer; font-size: 13px; font-weight: 600;
    transition: background 0.15s;
}
.profile-btn:hover { background: var(--surface-hover); }

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

select, input[type="text"], input[type="search"], input[type="number"], input[type="date"], input[type="time"], textarea {
    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, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; line-height: 1.5; }

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

/* ── Globale Suche ─────────────────────────────────────────────────────── */
.global-search { position: relative; width: min(380px, 30vw); }
.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;
}

/* ── Seiten-Header ─────────────────────────────────────────────────────── */
.page-head {
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.page-head h1 { font-size: 22px; }
.page-head .sub { color: var(--text-dim); font-size: 13.5px; }
.page-head .head-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 9px 15px; 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; font-family: var(--font);
    transition: all 0.15s; white-space: nowrap;
}
.btn:hover { background: var(--surface-hover); border-color: var(--accent); color: var(--accent); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: 0; color: #fff; }
.btn.primary:hover { filter: brightness(1.08); color: #fff; }
.btn.ghost { background: none; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-hover); }
.btn.sm { padding: 6px 11px; font-size: 12px; }
.btn.danger:hover { border-color: var(--st-busy); color: var(--st-busy); }

/* ── 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; font-family: var(--font);
}
.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; }

/* Segmented control (Ansichtsumschalter) */
.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.segmented button {
    border: 0; background: none; color: var(--text-dim); cursor: pointer;
    padding: 6px 13px; border-radius: 6px; font-size: 12.5px; font-weight: 600; font-family: var(--font);
    display: inline-flex; align-items: center; gap: 6px;
}
.segmented button.on { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }

/* ── Karten & Grids ────────────────────────────────────────────────────── */
.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; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; align-items: start; }

.tile-in { animation: tileIn 0.35s ease; }
@keyframes tileIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* KPI-Kacheln (Dashboard/Sales) */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi {
    background: var(--surface); border: 1px solid var(--border-soft);
    border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 15px 17px;
    display: flex; flex-direction: column; gap: 3px; position: relative; overflow: hidden;
    animation: tileIn 0.35s ease;
}
.kpi::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--kpi-accent, var(--accent)); }
.kpi .kpi-val { font-size: 26px; font-weight: 750; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.kpi .kpi-label { color: var(--text-dim); font-size: 12.5px; }
.kpi .kpi-ico { position: absolute; right: 12px; top: 12px; color: var(--text-muted); opacity: 0.55; }
.kpi .kpi-trend { font-size: 11.5px; font-weight: 600; }
.kpi .kpi-trend.up { color: var(--st-available); }
.kpi .kpi-trend.down { color: var(--st-busy); }

/* Sektion */
.section { margin-bottom: 28px; }
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.section-head h2 { font-size: 16px; }
.section-head .count { color: var(--text-muted); font-size: 12.5px; font-weight: 600; }
.section-head .section-actions { margin-left: auto; display: flex; gap: 8px; }

/* ── Badges / Chips ────────────────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: 999px;
    font-size: 11px; font-weight: 700; letter-spacing: 0.3px;
    white-space: nowrap;
}
.badge.soft { background: var(--surface-2); color: var(--text-dim); }
.badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Prioritäts-/Severity-Farben */
.sev-crit { color: var(--sev-crit); } .bg-sev-crit { background: color-mix(in srgb, var(--sev-crit) 14%, transparent); color: var(--sev-crit); }
.sev-high { color: var(--sev-high); } .bg-sev-high { background: color-mix(in srgb, var(--sev-high) 16%, transparent); color: var(--sev-high); }
.sev-mid  { color: var(--sev-mid); }  .bg-sev-mid  { background: color-mix(in srgb, var(--sev-mid) 18%, transparent); color: #b98900; }
.sev-low  { color: var(--sev-low); }  .bg-sev-low  { background: color-mix(in srgb, var(--sev-low) 14%, transparent); color: var(--sev-low); }
:root[data-theme="dark"] .bg-sev-mid { color: var(--sev-mid); }

/* Statusfarben (Aufträge/Kandidaten/Berichte) */
.st-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.st-neutral { background: var(--surface-2); color: var(--text-dim); }
.st-info { background: color-mix(in srgb, var(--st-meeting) 14%, transparent); color: var(--st-meeting); }
.st-go { background: color-mix(in srgb, var(--st-available) 14%, transparent); color: var(--st-available); }
.st-warn { background: color-mix(in srgb, var(--st-break) 15%, transparent); color: var(--st-break); }
.st-stop { background: color-mix(in srgb, var(--st-busy) 14%, transparent); color: var(--st-busy); }
.st-accent { background: var(--accent-soft); color: var(--accent); }
.st-purple { background: color-mix(in srgb, var(--st-customer) 14%, transparent); color: var(--st-customer); }

/* ── Score-Meter (Akquise-Score / TMS-Sicherheit) ──────────────────────── */
.score { display: inline-flex; align-items: center; gap: 8px; }
.score-bar { width: 68px; height: 7px; border-radius: 999px; background: var(--surface-2); overflow: hidden; flex-shrink: 0; }
.score-bar > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--sev-mid), var(--sev-low)); }
.score-bar.warm > span { background: linear-gradient(90deg, var(--sev-high), var(--sev-crit)); }
.score-num { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; }
.score-num .max { color: var(--text-muted); font-weight: 500; font-size: 11px; }

.score-ring { --p: 0; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
    background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-2) 0); }
.score-ring .inner { width: 34px; height: 34px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 12.5px; font-weight: 750; font-variant-numeric: tabular-nums; }

/* Vertrauens-/Sicherheits-Meter für Tabellen */
.conf { display: inline-flex; flex-direction: column; gap: 3px; min-width: 90px; }
.conf .conf-top { display: flex; justify-content: space-between; font-size: 12px; }
.conf .conf-track { height: 5px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.conf .conf-track > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

/* ── Tabellen ──────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border-soft); box-shadow: var(--shadow-sm); }
.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 td.num { font-variant-numeric: tabular-nums; }
.cell-strong { font-weight: 650; }
.cell-sub { color: var(--text-dim); font-size: 12px; }

/* ── Listenkarten (Aufträge, Nachbereitung, Berichte) ──────────────────── */
.list-card {
    display: flex; align-items: flex-start; gap: 14px;
    background: var(--surface); border: 1px solid var(--border-soft);
    border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 15px 17px;
    transition: border-color 0.2s, box-shadow 0.2s; animation: tileIn 0.35s ease;
    border-left: 3px solid var(--card-accent, var(--border-soft));
}
.list-card:hover { border-color: var(--border); box-shadow: var(--shadow); }
.list-card .lc-main { flex: 1; min-width: 0; }
.list-card .lc-title { font-weight: 650; font-size: 14.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.list-card .lc-meta { color: var(--text-dim); font-size: 12.5px; margin-top: 4px; display: flex; gap: 6px 14px; flex-wrap: wrap; }
.list-card .lc-meta strong { color: var(--text); font-weight: 600; }
.list-card .lc-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }
.list-card .lc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }

.meta-row { display: flex; gap: 6px 14px; flex-wrap: wrap; color: var(--text-dim); font-size: 12.5px; }
.meta-row .mi { display: inline-flex; align-items: center; gap: 5px; }
.meta-row strong { color: var(--text); font-weight: 600; }

/* ── Dashboard: Tages-Timeline ─────────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: flex; gap: 14px; }
.tl-time { width: 58px; flex-shrink: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13.5px; color: var(--text); padding-top: 13px; }
.tl-rail { position: relative; width: 16px; flex-shrink: 0; display: flex; justify-content: center; }
.tl-rail::before { content: ""; position: absolute; top: 0; bottom: 0; width: 2px; background: var(--border); }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); margin-top: 15px; z-index: 1; box-shadow: 0 0 0 1px var(--border); }
.tl-item.free .tl-dot { background: var(--st-away); }
.tl-body { flex: 1; padding: 10px 0 14px; }
.tl-card {
    background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); padding: 12px 15px; transition: border-color 0.2s;
    border-left: 3px solid var(--card-accent, var(--accent));
}
.tl-card:hover { border-color: var(--border); }
.tl-card.free { border-left-color: var(--st-away); background: var(--surface-2); }
.tl-title { font-weight: 650; font-size: 14px; }
.tl-sub { color: var(--text-dim); font-size: 12.5px; margin-top: 3px; display: flex; gap: 6px 14px; flex-wrap: wrap; }
.tl-actions { display: flex; gap: 7px; margin-top: 10px; flex-wrap: wrap; }

/* ── KI-Empfehlungs-Banner ─────────────────────────────────────────────── */
.ai-banner {
    display: flex; gap: 16px; align-items: flex-start;
    border-radius: var(--radius); padding: 18px 20px; margin-bottom: 22px;
    background:
        radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--brand-orange) 14%, transparent), transparent 55%),
        radial-gradient(120% 140% at 100% 100%, color-mix(in srgb, var(--brand-red) 12%, transparent), transparent 55%),
        var(--surface);
    border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
    box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.ai-banner .ai-ico {
    width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
    display: grid; place-items: center; box-shadow: 0 4px 14px rgba(228,43,34,0.3);
}
.ai-banner .ai-body { flex: 1; }
.ai-banner .ai-kicker { font-size: 11px; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase; color: var(--accent); }
.ai-banner .ai-text { font-size: 14px; margin-top: 3px; line-height: 1.5; }
.ai-banner .ai-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.ai-banner .ai-close { position: absolute; top: 10px; right: 10px; background: none; border: 0; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 6px; }
.ai-banner .ai-close:hover { background: var(--surface-hover); color: var(--text); }

/* ── SmartRoute-Layout ─────────────────────────────────────────────────── */
/* Kein separater linker Filterbereich mehr – route-panel (Route/Ankertermine/Vorbereitung) sitzt jetzt als
   linke Spalte unten (grid-area cfg) im gemeinsamen Raster; route-layout ist nur noch der Wrapper. */
.route-layout { display: block; }
.route-panel { grid-area: cfg; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.map-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* Ergebnisliste mit eigenem Scrollbereich, damit die Karte darüber sichtbar bleibt. */
.route-results {
    display: flex; flex-direction: column; gap: 12px;
    max-height: 56vh; overflow-y: auto; overscroll-behavior: contain;
    padding: 2px 8px 2px 2px;
    scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.route-results::-webkit-scrollbar { width: 9px; }
.route-results::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
.route-results::-webkit-scrollbar-track { background: transparent; }

/* Hauptraster: DREI Spalten oben – geplante Tour (links), Unternehmensvorschläge (Mitte), Karte (rechts).
   Darunter laufen die Touren-Leiste und der Datenschutzhinweis über die volle Breite.
   Die Reihenfolge im Markup spielt keine Rolle – sie ergibt sich aus den benannten Bereichen. */
.route-lower {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.1fr);
    grid-template-areas:
        "gepl   erg    map"
        "cfg    erg    map"
        "touren touren touren"
        "priv   priv   priv";
    gap: 16px 18px; align-items: start;
}
.route-lower .sim-map { grid-area: map; }
.route-lower .privacy-note { grid-area: priv; }
.route-lower .touren-bar { grid-area: touren; }
.route-lower .rl-erg { grid-area: erg; }
.route-lower .rl-geplant { grid-area: gepl; }
.route-lower-col { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
/* Ergebnisliste steht jetzt über die volle Breite – sie darf höher werden. */
.route-lower-col .route-results { max-height: 66vh; }

/* In der halben Breite ist das 16:9-Format zu flach: feste, mitwachsende Höhe,
   damit Karte und Routenliste nebeneinander etwa gleich hoch stehen. */
.route-lower .sim-map { aspect-ratio: auto; height: clamp(420px, 60vh, 780px); }
.route-lower .rl-geplant .tour-scroll { max-height: clamp(260px, 44vh, 580px); }

/* Schmale Fenster: übereinander stapeln, Karte zuerst. */
@media (max-width: 1200px) {
    .route-lower {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "gepl" "cfg" "erg" "map" "touren" "priv";
    }
    .route-lower .sim-map { height: clamp(320px, 46vh, 560px); }
}

/* Touren-Leiste: viele Touren auf einen Blick (horizontal umbrechendes Raster). */
.touren-bar .saved-list {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 8px; max-height: none;
}
/* Geplante Route: eigener Scrollbereich. */
.tour-scroll {
    max-height: 52vh; overflow-y: auto; overscroll-behavior: contain;
    padding: 2px 8px 2px 2px;
    scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.tour-scroll::-webkit-scrollbar { width: 9px; }
.tour-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
.tour-scroll::-webkit-scrollbar-track { background: transparent; }
.eta-badge {
    display: inline-flex; align-items: center; gap: 4px; font-weight: 600;
    color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent);
    border-radius: 999px; padding: 1px 8px;
}
/* Altlast des früheren Layouts: hier fehlten die Bereiche „map" und „priv", wodurch Karte und
   Datenschutzhinweis aus dem benannten Raster gefallen wären. Die schmale Ansicht wird
   inzwischen von der 1200px-Regel weiter oben abgedeckt – diese Stufe ordnet nur noch feiner. */
@media (max-width: 1050px) {
    .route-lower {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "gepl" "cfg" "erg" "map" "touren" "priv";
    }
}

/* Gespeicherte Routen – Auswahlbereich */
.saved-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.saved-head { font-size: 13px; font-weight: 650; display: flex; align-items: center; gap: 7px; }
/* Ersteller-Filter der Tourenliste – dezent, rechtsbündig in der Kopfzeile. */
.tour-filter { padding: 3px 8px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
    background: var(--surface-2); color: var(--text); font-size: 12px; max-width: 220px; }
.saved-new { display: flex; gap: 8px; }
.saved-new input { flex: 1; min-width: 0; padding: 7px 10px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); }
.saved-list { display: flex; flex-direction: column; gap: 6px; max-height: 26vh; overflow-y: auto; scrollbar-width: thin; }
.saved-route { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; }
.saved-route:hover { border-color: var(--border); }
.saved-route.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
/* Von anderem Nutzer gesperrte Tour in der Liste: dezent hervorheben (öffnen bleibt möglich → nur ansehen). */
.saved-route.locked { border-color: color-mix(in srgb, #f59e0b 45%, var(--border)); background: color-mix(in srgb, #f59e0b 7%, var(--surface-2)); }
.lock-tag { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; font-size: 10.5px; font-weight: 650;
    color: #b45309; background: rgba(245,158,11,.16); border: 1px solid rgba(245,158,11,.4); }
.saved-route .sr-main { flex: 1; min-width: 0; }
.saved-route .sr-name { font-weight: 650; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Tournummer (T-nnnn) als dezenter Chip vor dem Tournamen. */
.saved-route .sr-name .tour-nr { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--border-soft); color: var(--text-dim);
    font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dispo-editor { margin: -2px 2px 6px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); display: flex; flex-direction: column; gap: 9px; }
.dispo-editor label { font-size: 12px; color: var(--text-dim); font-weight: 600; }
.dispo-editor select, .dispo-editor input { width: 100%; padding: 6px 9px; border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); }

.filter-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px; }
.filter-card h3 { font-size: 14px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
/* Zuklappbare Abschnittsköpfe */
.filter-card h3.sec-head { cursor: pointer; user-select: none; margin-bottom: 0; }
.filter-card h3.sec-head + * { margin-top: 12px; }
.filter-card h3.sec-head .chev { margin-left: auto; font-size: 12px; color: var(--text-dim); transition: transform .15s; }
.filter-card h3.sec-head .chev.closed { transform: rotate(-90deg); }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field > label { font-size: 12px; color: var(--text-dim); font-weight: 600; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check-row { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text); padding: 5px 0; cursor: pointer; }
.check-row input { width: 16px; height: 16px; accent-color: var(--accent); }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 6px; }

/* Mehrfach-Rollen (Benutzer & Rollen / Mitarbeiter) */
.role-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.role-chk {
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
    font-size: 12.5px; color: var(--text); padding: 4px 9px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface-2); user-select: none;
}
.role-chk input { width: 14px; height: 14px; accent-color: var(--accent); margin: 0; }
.role-chk.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--text); }

/* Feld-Herkunft (Quelle) + unbekannte Angaben – „keine Dummy-Werte" */
.prov {
    display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 5px;
    font-size: 10.5px; font-weight: 600; letter-spacing: .2px; vertical-align: middle;
    color: var(--text-dim); background: var(--surface-2); border: 1px solid var(--border);
}
.info-grid dd.unknown { color: var(--text-dim); font-style: italic; }

/* Tabs (Stammdaten-Feldmapping) */
.tabbar { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.tabbar .tab {
    background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer;
    padding: 9px 14px; font-size: 13.5px; font-weight: 600; color: var(--text-dim);
}
.tabbar .tab:hover { color: var(--text); }
.tabbar .tab.on { color: var(--text); border-bottom-color: var(--accent); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 16px; margin: 8px 0; }

/* Selma Communication – Mein Postfach */
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .post-layout { grid-template-columns: 1fr; } }
.post-item { padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; margin-bottom: 8px; }
.post-item:hover { border-color: var(--accent); }
.post-item.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.pi-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 5px; }
.pi-title { font-weight: 600; font-size: 14px; }
.pi-reco { margin-top: 6px; font-size: 12.5px; color: var(--accent); display: flex; align-items: center; gap: 5px; }
.post-views { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pv-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-dim); font-size: 12.5px; cursor: pointer; }
.pv-chip.on { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.pv-count { font-weight: 700; }
.brief-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.brief-card { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); }
.bc-ico { color: var(--accent); }
.bc-val { font-size: 22px; font-weight: 700; }
.bc-title { font-size: 13px; font-weight: 600; }
.pd-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
.pd-subject { font-weight: 700; font-size: 15px; }
.pd-urg { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.pd-section { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-dim); font-weight: 700; margin: 12px 0 4px; }
.pd-list { margin: 0; padding-left: 18px; font-size: 13px; }
.pd-list li { margin: 2px 0; }
.pd-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pd-draft { width: 100%; }
.pd-original { margin: 10px 0 2px; border-top: 1px solid var(--border); padding-top: 8px; }
.pd-original-meta { margin: 8px 0 4px; }
.pd-original-body { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 340px; overflow: auto; }
/* Fokus-Arbeitszentrale (E-Mails + Odoo-Aufgaben + eigene Aufgaben) */
.fx-search { width: 100%; margin: 6px 0 10px; }
.fx-window { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.fx-window input[type="time"] { width: auto; }
.fx-plan { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 8px 10px; margin: 6px 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.fx-plan-actions { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.fx-bulkbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 6px 8px; margin-bottom: 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.fx-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-dim); cursor: pointer; }
.fx-check input { margin: 0; }
/* Auswahlkästchen je Zeile – oben rechts, damit es die Badges nicht verschiebt. */
.post-item { position: relative; }
.fx-row-check { position: absolute; top: 8px; right: 8px; display: inline-flex; cursor: pointer; }
.fx-row-check input { margin: 0; cursor: pointer; }
.post-item.picked { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
/* Nur dort Platz freihalten, wo tatsächlich ein Kästchen sitzt (die Mail-Liste bleibt unverändert). */
.fx-row-check ~ .pi-badges { padding-right: 26px; }
.fx-desc { font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }

/* ── Selma-Ampel: Priorität direkt an der Mail, ohne sie zu öffnen ─────────
   Zwei Träger derselben Information: ein farbiger Streifen links an der Zeile
   (aus dem Augenwinkel erkennbar beim Überfliegen der Liste) und ein Punkt im
   Abzeichen (eindeutig, auch wenn der Streifen bei aktiver Zeile vom Rahmen
   überlagert wird). Farbe ist NIE der einzige Träger – jedes Abzeichen trägt
   zusätzlich seinen Klartext, sonst wäre die Liste für Farbsehschwächen leer. */
.prio-rot    { --prio: #e5484d; }
.prio-orange { --prio: #f76b15; }
.prio-gelb   { --prio: #ddaa13; }
.prio-gruen  { --prio: #30a46c; }
.prio-grau   { --prio: var(--text-dim); }
.prio-wait   { --prio: var(--border); }

.post-item.prio-l-rot,
.post-item.prio-l-orange,
.post-item.prio-l-gelb,
.post-item.prio-l-gruen,
.post-item.prio-l-grau,
.post-item.prio-l-wait { border-left-width: 4px; }
.post-item.prio-l-rot    { border-left-color: #e5484d; }
.post-item.prio-l-orange { border-left-color: #f76b15; }
.post-item.prio-l-gelb   { border-left-color: #ddaa13; }
.post-item.prio-l-gruen  { border-left-color: #30a46c; }
.post-item.prio-l-grau   { border-left-color: var(--text-dim); }
.post-item.prio-l-wait   { border-left-color: var(--border); border-left-style: dashed; }

/* Dieselbe Ampel im Mail-Client. `none` = keine Selma-Bewertung vorhanden (fremde
   Ordner, Altbestand) – dann bleibt die Zeile unverändert, statt grau zu behaupten,
   die Mail sei bewertet worden. */
.mail-row.prio-l-rot,
.mail-row.prio-l-orange,
.mail-row.prio-l-gelb,
.mail-row.prio-l-gruen,
.mail-row.prio-l-grau,
.mail-row.prio-l-wait { border-left: 4px solid var(--border); }
.mail-row.prio-l-rot    { border-left-color: #e5484d; }
.mail-row.prio-l-orange { border-left-color: #f76b15; }
.mail-row.prio-l-gelb   { border-left-color: #ddaa13; }
.mail-row.prio-l-gruen  { border-left-color: #30a46c; }
.mail-row.prio-l-grau   { border-left-color: var(--text-dim); }
.mail-row.prio-l-wait   { border-left-style: dashed; }

.prio-badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px;
    font-size: 11.5px; font-weight: 600; border: 1px solid color-mix(in srgb, var(--prio) 45%, transparent);
    background: color-mix(in srgb, var(--prio) 14%, transparent); color: var(--text); }
.prio-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--prio); flex-shrink: 0; }

/* Klassifizierungen (§4) – mehrere gleichzeitig, bewusst schlicht, damit sie die
   Ampel nicht überstrahlen. */
.sel-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface); color: var(--text-dim); font-size: 11.5px; }
.sel-tag.pick { cursor: pointer; }
.sel-tag.pick.on { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 14%, transparent); }

.prio-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.prio-opt { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface-2); color: var(--text-dim); font-size: 12.5px; cursor: pointer; }
.prio-opt:hover { border-color: var(--prio); }
.prio-opt.on { border-color: var(--prio); color: var(--text); background: color-mix(in srgb, var(--prio) 16%, transparent); font-weight: 600; }

/* Kopfzeile einer Diskussion: der Stand steht OBEN, damit niemand zwölf Nachrichten
   lesen muss, um zu wissen, ob er handeln muss. */
.thread-sum { border: 1px solid var(--border); border-left: 4px solid var(--prio, var(--border));
    border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; background: var(--surface-2); }
.ts-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.ts-text { font-size: 13.5px; line-height: 1.5; }

/* „Selma analysiert …" – Status an der Mail statt eines eigenen Ordners (§8). */
.sp-spin { display: inline-block; animation: sp-rot 1.4s linear infinite; }
@keyframes sp-rot { to { transform: rotate(360deg); } }

/* „Termin finden" */
.mf-panel { display: flex; flex-direction: column; }
.mf-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mf-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-dim); font-size: 12.5px; cursor: pointer; }
.mf-chip.on { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.mf-chip input { margin: 0; }
.mf-slot { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin: 6px 0; background: var(--surface-2); }
.mf-slot.ok { border-color: color-mix(in srgb, var(--ok, #2e9e5b) 55%, var(--border)); background: color-mix(in srgb, var(--ok, #2e9e5b) 8%, transparent); }
.mf-slot-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mf-avail { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.pd-colleague { padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid var(--border); margin: 6px 0; }
.pd-colleague.decide { background: color-mix(in srgb, #e0a020 16%, transparent); }
.teams-note { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); margin-bottom: 6px; font-size: 13px; }
.teams-note.ack { opacity: .55; }

/* QR-Modal (Desktop „Mit Handy anrufen") */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 200; }
.modal-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg, 0 20px 60px rgba(0,0,0,.4)); padding: 18px; width: min(420px, 92vw); max-height: 90vh; overflow: auto; }
.qr-box { display: flex; justify-content: center; padding: 14px; }
.qr-box svg { width: 220px; height: 220px; background: #fff; border-radius: 10px; padding: 8px; }
.qr-status { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.qr-step { font-size: 13px; color: var(--text-dim); padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); }
.qr-step.on { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* Mobile-Call-Seite (/mobile-call) */
.mob-shell { max-width: 560px; margin: 0 auto; padding: 12px 14px 40px; }
.mob-top { display: flex; justify-content: space-between; align-items: center; padding: 6px 2px 12px; }
.mob-brand { font-weight: 800; letter-spacing: .5px; color: var(--accent); }
.mob-sub { color: var(--text-dim); font-size: 12px; }
.mob-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.mob-company { font-size: 20px; font-weight: 800; }
.mob-muted { color: var(--text-dim); font-size: 13px; }
.mob-contact { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.mob-phone { margin-top: 8px; font-size: 18px; font-weight: 700; letter-spacing: 1px; }
.mob-brief-h { font-weight: 700; margin-bottom: 8px; }
.mob-brief-row { font-size: 13.5px; margin: 5px 0; line-height: 1.4; }
.mob-brief-row ul { margin: 4px 0 0; padding-left: 18px; }
.mob-call { display: block; text-align: center; background: var(--accent); color: #fff; font-size: 20px; font-weight: 800; padding: 18px; border-radius: 16px; text-decoration: none; margin: 8px 0; box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 45%, transparent); }
.mob-return { width: 100%; margin-top: 6px; }
.mob-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 15px; font-weight: 600; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.mob-btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.mob-btn.ghost { background: none; }
.mob-btn.big { width: 100%; font-size: 17px; padding: 15px; margin-top: 6px; }
.mob-outcomes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.mob-outcomes .big { grid-column: span 2; }
.mob-form { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.mob-form label { font-size: 12px; color: var(--text-dim); font-weight: 600; margin-top: 6px; }
.mob-form input, .mob-form textarea, .mob-form select { width: 100%; font-size: 16px; padding: 11px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.mob-row { display: flex; gap: 8px; flex-wrap: wrap; }
.mob-dur { background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin: 8px 0; font-size: 14px; }
.mob-pots { display: flex; flex-wrap: wrap; gap: 6px; }
.mob-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; padding: 8px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); }
.mob-chip.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.mob-chip input { width: 15px; height: 15px; accent-color: var(--accent); }
.mob-error, .mob-done { text-align: center; padding: 40px 16px; }
.mob-emoji { font-size: 46px; margin-bottom: 8px; }

/* Simulierte Karte */
.sim-map {
    /* z-index: 0 erzeugt einen eigenen Stapelkontext. Ohne ihn konkurrieren Leaflets
       interne Ebenen (Panes 400, Controls 800, top/bottom 1000) auf Wurzelebene und
       legen sich über Sidepanel (90), Modals (200) und Busy-Toast. */
    position: relative; z-index: 0; width: 100%; aspect-ratio: 16 / 9; min-height: 300px;
    border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--border); box-shadow: var(--shadow-sm);
    background: var(--surface-2);
}
.sim-map > svg { width: 100%; height: 100%; display: block; }  /* nur die simulierte Karte, NICHT Leaflets Overlay-SVG */
.map-overlay { position: absolute; left: 12px; top: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.map-badge {
    background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(6px);
    border: 1px solid var(--border); border-radius: 999px; padding: 5px 11px;
    font-size: 12px; font-weight: 600; color: var(--text); display: inline-flex; align-items: center; gap: 6px;
}
.map-legend { position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 4px;
    background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(6px);
    border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 11px; font-size: 11.5px; color: var(--text-dim); }
.map-legend .row { display: flex; align-items: center; gap: 7px; }
.map-legend .pin-dot { width: 9px; height: 9px; border-radius: 50%; }
.map-attr { position: absolute; right: 10px; top: 10px; font-size: 10.5px; color: var(--text-muted); }

.map-pin { cursor: pointer; transition: transform 0.15s; transform-origin: center bottom; }
.map-pin:hover { transform: scale(1.18); }
.map-pin.sel { transform: scale(1.25); }

/* Ergebnis-Karten SmartRoute */
.result-card {
    background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); padding: 15px 17px; display: flex; gap: 14px;
    animation: tileIn 0.35s ease; transition: border-color 0.2s, box-shadow 0.2s;
}
.result-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.result-card.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.result-card .rc-main { flex: 1; min-width: 0; }
.result-card .rc-name { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.result-card .rc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px 16px; margin-top: 10px; font-size: 12.5px; }
.result-card .rc-grid .k { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; }
.result-card .rc-grid .v { color: var(--text); font-weight: 600; }
.result-card .rc-actions { display: flex; gap: 7px; margin-top: 12px; flex-wrap: wrap; }
.result-card .rc-side { display: flex; flex-direction: column; align-items: center; gap: 8px; flex-shrink: 0; }

/* Tourenliste */
.tour-list { display: flex; flex-direction: column; gap: 8px; }
.tour-stop {
    display: flex; align-items: center; gap: 12px;
    background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
    padding: 11px 13px; cursor: grab; transition: border-color 0.15s, box-shadow 0.15s;
}
.tour-stop:hover { border-color: var(--border); }
/* Start-/Ziel-Anker: feste Endpunkte der Route (nicht verschiebbar). */
.tour-stop.anchor { cursor: default; background: var(--surface-2); border-style: dashed; padding-left: 13px; }
.tour-stop.anchor .seq.start { background: #22c55e; color: #fff; }
.tour-stop.anchor .seq.end { background: #e42b22; color: #fff; }
/* Rückkehr-Stopp (fester Endpunkt) – als Stopp dargestellt, aber nicht ziehbar. */
.tour-stop.endstop { cursor: default; background: var(--surface-2); }
.tour-stop.endstop .seq.end { background: #e42b22; color: #fff; }
.mini-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent);
    border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: middle; }
.mini-tag.hotel { color: #8b5cf6; background: color-mix(in srgb, #8b5cf6 16%, transparent); }
.tour-stop.hotelstop { background: color-mix(in srgb, #8b5cf6 8%, var(--surface)); }
.tour-stop.hotelstop .seq.hotel { background: #8b5cf6; color: #fff; }

/* Ankertermine (feste Kundentermine als Rahmen der Tour) */
.anker-card { background: var(--surface); border: 1px solid color-mix(in srgb, #1d4ed8 40%, var(--border-soft));
    border-left: 3px solid #1d4ed8; border-radius: var(--radius); box-shadow: var(--shadow-sm);
    padding: 14px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 8px; }
.anker-dot { margin-right: 4px; }
.mini-tag.anker { color: #1d4ed8; background: color-mix(in srgb, #1d4ed8 15%, transparent); text-transform: none; }
.mini-tag.conflict { color: var(--st-busy); background: color-mix(in srgb, var(--st-busy) 15%, transparent); text-transform: none; }
.tour-stop.ankerstop { background: color-mix(in srgb, #1d4ed8 8%, var(--surface)); border-left: 3px solid #1d4ed8; }
.tour-stop.ankerstop .seq.anker { background: #1d4ed8; color: #fff; }
.tour-stop.conflict { background: color-mix(in srgb, var(--st-busy) 10%, var(--surface)); border-left: 3px solid var(--st-busy); }
.anchor-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; margin: 4px 0 8px 34px;
    padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, #1d4ed8 8%, var(--surface));
    border: 1px solid color-mix(in srgb, #1d4ed8 30%, var(--border-soft)); }
.anchor-inline input[type=time] { padding: 4px 6px; }
.eta-badge.late { color: var(--st-busy); background: color-mix(in srgb, var(--st-busy) 14%, transparent); }
.idle-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--st-break);
    background: color-mix(in srgb, var(--st-break) 13%, transparent); border-radius: 4px; padding: 1px 6px; }

/* Tourbewertung (Machbarkeit) */
.feas-panel { margin-top: 10px; border-radius: var(--radius); padding: 11px 13px; border: 1px solid var(--border-soft); }
.feas-panel.st-go { border-color: color-mix(in srgb, var(--st-available) 35%, transparent); }
.feas-panel.st-warn { border-color: color-mix(in srgb, var(--st-break) 40%, transparent); }
.feas-panel.st-stop { border-color: color-mix(in srgb, var(--st-busy) 40%, transparent); }
.feas-head { display: flex; align-items: center; gap: 7px; font-weight: 700; margin-bottom: 6px; }
.feas-score { margin-left: auto; font-size: 15px; font-weight: 800; padding: 1px 9px; border-radius: 999px; }
.feas-panel.st-go .feas-score { background: color-mix(in srgb, var(--st-available) 16%, transparent); color: var(--st-available); }
.feas-panel.st-warn .feas-score { background: color-mix(in srgb, var(--st-break) 18%, transparent); color: var(--st-break); }
.feas-panel.st-stop .feas-score { background: color-mix(in srgb, var(--st-busy) 16%, transparent); color: var(--st-busy); }
.feas-line { font-size: 12.5px; padding: 2px 0; }
.feas-line.ok { color: var(--st-available); }
.feas-line.warn { color: var(--st-break); }

/* Vorbereitung nächste Tour + Hotelplanung */
.prep-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 14px; margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.hotel-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; max-height: 46vh; overflow-y: auto; scrollbar-width: thin; }
.hotel-card { border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface-2); padding: 10px 12px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.hotel-card:hover { border-color: var(--border); }
.hotel-card.sel { border-color: #8b5cf6; box-shadow: 0 0 0 1px #8b5cf6 inset; }
.hotel-card .hotel-name { font-weight: 650; font-size: 13.5px; display: flex; align-items: center; gap: 6px; color: #8b5cf6; }
.hotel-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 14px; margin-top: 8px; }
.hotel-grid .k { font-size: 10.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .03em; }
.hotel-grid .v { font-size: 13px; font-weight: 600; }
.hotel-confirm { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -2px 2px 2px;
    padding: 10px 12px; border: 1px solid #8b5cf6; border-radius: var(--radius-sm);
    background: color-mix(in srgb, #8b5cf6 10%, transparent); }
.hotel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stars { display: inline-flex; gap: 1px; }
.stars .star { cursor: pointer; color: var(--border); font-size: 15px; line-height: 1; }
.stars .star.on { color: #f5b301; }
.amenity-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.amenity { font-size: 11px; font-weight: 600; border-radius: 4px; padding: 2px 7px; }
.amenity.yes { color: #16a34a; background: color-mix(in srgb, #16a34a 15%, transparent); }
.amenity.no { color: #dc2626; background: color-mix(in srgb, #dc2626 15%, transparent); }
.amenity.neutral { color: var(--text-dim); background: var(--surface); border: 1px solid var(--border-soft); }
.amenity.src { color: #2166d8; background: color-mix(in srgb, #2166d8 14%, transparent); font-weight: 700; }
a.amenity { text-decoration: none; }
.hotel-notes { font-size: 12px; color: var(--text-dim); margin-top: 6px; white-space: pre-wrap; }
.hotel-actions { display: flex; gap: 6px; margin-top: 8px; }
.hotel-editor { margin: -2px 2px 4px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); display: flex; flex-direction: column; gap: 9px; }
.hotel-editor .he-row { display: flex; align-items: center; justify-content: space-between; }
.hotel-editor label { font-size: 12px; color: var(--text-dim); font-weight: 600; }
.hotel-editor textarea, .hotel-editor input { width: 100%; padding: 6px 9px; border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font-family: inherit; }
.he-tris { display: flex; flex-wrap: wrap; gap: 6px; }
.he-tris button { font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 4px 10px; cursor: pointer; border: 1px solid var(--border-soft); }
.he-tris .tri.unk { color: var(--text-dim); background: var(--surface-2); }
.he-tris .tri.yes { color: #16a34a; border-color: #16a34a; background: color-mix(in srgb, #16a34a 12%, transparent); }
.he-tris .tri.no { color: #dc2626; border-color: #dc2626; background: color-mix(in srgb, #dc2626 12%, transparent); }
.he-actions { display: flex; gap: 8px; }

/* ── Disposition (Leitstand) ── */
.dispo-filter { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 14px; flex-wrap: wrap; }
.dispo-filter .field { margin-bottom: 0; }
.dispo-filter input, .dispo-filter select { padding: 7px 10px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); }

/* Gespeicherte Mitarbeiter-Filter (geteilte „Teams" für die Gantt-Auswahl) */
.dispo-filter-mgr { border: 1px solid var(--border-soft); border-radius: var(--radius); background: var(--surface); padding: 12px 14px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px; }
.dispo-filter-mgr .dfm-head { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; }
.dfm-body { display: grid; grid-template-columns: 240px 1fr; gap: 14px; align-items: start; }
@media (max-width: 860px) { .dfm-body { grid-template-columns: 1fr; } }
.dfm-list { display: flex; flex-direction: column; gap: 6px; }
.dfm-item { display: flex; align-items: center; gap: 6px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface-2); padding: 2px 4px 2px 2px; }
.dfm-item.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.dfm-pick { flex: 1; min-width: 0; text-align: left; background: none; border: none; color: var(--text); cursor: pointer; padding: 6px 8px; border-radius: var(--radius-sm); display: flex; flex-direction: column; gap: 1px; }
.dfm-pick strong { font-size: 13px; }
.dfm-edit { border-left: 1px solid var(--border-soft); padding-left: 14px; display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 860px) { .dfm-edit { border-left: none; padding-left: 0; border-top: 1px solid var(--border-soft); padding-top: 12px; } }
.dfm-edit-head { display: flex; align-items: center; gap: 10px; }
.dfm-edit-head input { flex: 1; padding: 7px 10px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); }
.dfm-members { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 12px; max-height: 280px; overflow-y: auto; padding: 4px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface-2); }
.dfm-emp { display: flex; align-items: center; gap: 7px; padding: 5px 6px; border-radius: var(--radius-sm); cursor: pointer; font-size: 12.5px; }
.dfm-emp:hover { background: var(--surface); }
.dfm-emp input { flex-shrink: 0; }
.dfm-emp .emp-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dfm-emp .dfm-emp-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dfm-emp .cell-sub { margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Aktiver-Filter-Chip in der Gantt-Navigation */
.dispo-filter-pill { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; padding: 3px 6px 3px 9px; border-radius: 999px;
    font-size: 11.5px; font-weight: 650; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.dispo-filter-pill .dfp-x { border: none; background: none; color: inherit; cursor: pointer; font-size: 12px; line-height: 1; padding: 0 2px; opacity: .8; }
.dispo-filter-pill .dfp-x:hover { opacity: 1; }

.dispo-board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.dispo-col { flex: 0 0 300px; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--radius); display: flex; flex-direction: column; --emp: #64748b; }
.dispo-col.unassigned { --emp: #94a3b8; border-style: dashed; }
.dispo-col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 12px; border-bottom: 1px solid var(--border-soft); border-top: 3px solid var(--emp); border-radius: var(--radius) var(--radius) 0 0; }
.dispo-col-head .dc-name { font-weight: 700; font-size: 13.5px; display: inline-flex; align-items: center; gap: 7px; }
.dispo-col-head .emp-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--emp); }
.dispo-col-head .dc-load { font-size: 11px; color: var(--text-dim); text-align: right; }
.dispo-col-body { display: flex; flex-direction: column; gap: 8px; padding: 10px; max-height: 60vh; overflow-y: auto; scrollbar-width: thin; }
.dispo-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.dispo-card .dc-title { font-weight: 650; font-size: 13px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.dispo-card .dc-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dispo-card select { padding: 5px 7px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font-size: 12px; min-width: 0; }

/* Segmented control (Ansichtsumschalter) */
.seg { display: inline-flex; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { border: none; background: var(--surface-2); color: var(--text-dim); padding: 6px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--accent); color: #fff; }

/* Außendienst-Stammdaten */
.staff-list { display: flex; flex-direction: column; gap: 8px; }
.staff-row { display: grid; grid-template-columns: 1.4fr 0.7fr 1.6fr 1.3fr 0.7fr; gap: 12px; align-items: center;
    background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 10px 12px; }
.staff-row.head { background: transparent; border: none; font-size: 12px; color: var(--text-dim); font-weight: 600; padding-bottom: 0; }
.staff-row.on { border-left: 3px solid var(--st-available); }
.staff-row input { width: 100%; padding: 6px 9px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); }
.staff-row .switch { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; cursor: pointer; }
.staff-row .switch input { width: 16px; height: 16px; accent-color: var(--accent); }
@media (max-width: 900px) { .staff-row { grid-template-columns: 1fr; } .staff-row.head { display: none; } }

/* KI-Dispositionsvorschlag */
.ai-panel { border: 1px solid var(--accent); border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); padding: 12px 14px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.ai-head { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; }
.ai-prop { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 8px 10px; }
.ai-prop .ai-prop-main { flex: 1; min-width: 0; font-size: 13px; }

/* Erfolgsanalyse laufender Terminumfragen */
.survey-analysis { border: 1px solid var(--border-soft); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); padding: 14px; margin-bottom: 18px; display: flex; flex-direction: column; gap: 8px; }
.survey-analysis .sa-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.survey-analysis .sa-title { font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 7px; }
.survey-analysis .sa-metrics { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-dim); padding: 6px 0; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
.survey-analysis .sa-metrics strong { color: var(--text); }
.survey-analysis .sa-forecast { font-size: 13px; }
.survey-analysis .sa-causes .sa-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-dim); }
.survey-analysis .sa-causes ul { margin: 4px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--text-dim); }
.survey-analysis .sa-reco { font-size: 13px; background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: var(--radius-sm); padding: 8px 10px; }

/* Neuausrichtungs-Assistent */
.wizard { border: 1px solid var(--accent); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); padding: 14px; margin: -6px 0 18px; display: flex; flex-direction: column; gap: 10px; }
.wiz-head { display: flex; align-items: center; justify-content: space-between; }
.wiz-title { font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 7px; }
.wiz-steps { display: flex; gap: 6px; flex-wrap: wrap; }
.wiz-pill { font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 3px 10px; background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border-soft); }
.wiz-pill.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.wiz-pill.done { color: var(--st-available); border-color: var(--st-available); }
.wizard .wiz-p { font-size: 13px; margin: 0; }
.wizard textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font-family: inherit; font-size: 13px; }
.wiz-opt { font-size: 13px; padding: 6px 10px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface-2); }
.wiz-radios { display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.wiz-radios label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.wiz-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.wiz-strat { align-items: flex-start !important; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 8px 10px; background: var(--surface-2); }
.wiz-strat.reco { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.wiz-strat input { margin-top: 3px; }
.wiz-tones { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }

/* Karte + Tourdetails nebeneinander */
.dispo-focus { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 16px; align-items: stretch; }
.dispo-focus.split { grid-template-columns: 3fr 2fr; }
.dispo-focus .sim-map { aspect-ratio: auto; height: 440px; min-height: 320px; }
.tour-detail { height: 440px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 14px; display: flex; flex-direction: column; gap: 8px; scrollbar-width: thin; }
.tour-detail .td-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tour-detail .td-title { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.tour-detail .td-close { border: none; background: transparent; color: var(--text-dim); font-size: 16px; cursor: pointer; line-height: 1; }
.tour-detail .td-kpis { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-dim); padding: 6px 0; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
.tour-detail .td-kpis strong { color: var(--text); }
.td-stops { display: flex; flex-direction: column; gap: 8px; }
.td-stop { display: flex; align-items: flex-start; gap: 9px; }
.td-stop .td-stop-main { flex: 1; min-width: 0; }
.td-stop .ts-name { font-weight: 600; font-size: 13px; }
.td-stop-report { align-self: center; flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px;
    border: 1px solid var(--border-soft); background: var(--surface-2); color: var(--accent);
    border-radius: 999px; padding: 3px 9px; font-size: 11.5px; font-weight: 600; cursor: pointer; }
.td-stop-report:hover { border-color: var(--accent); }
/* Besuch ist durchgeführt, der Kontaktbericht fehlt noch – genau diese Lücke soll auffallen. */
.td-stop-report.fehlt { color: #b45309; border-color: color-mix(in srgb, #f59e0b 55%, transparent);
    background: color-mix(in srgb, #f59e0b 12%, transparent); }
.td-stop-report.fehlt:hover { border-color: #f59e0b; }

/* Ist-Zeiten am Stopp (Ankunft/Abfahrt aus der Außendienst-App) + Marke „Kontaktbericht liegt vor" */
.td-stop .ts-ist { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; margin-top: 2px; }
.ist-badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 1px 7px;
    font-size: 11.5px; font-weight: 600; color: #15803d; background: color-mix(in srgb, #22c55e 15%, transparent); }
/* Angekommen, aber noch keine Abfahrt gemeldet – der Besuch läuft gerade. */
.ist-badge.laeuft { color: #0369a1; background: color-mix(in srgb, #0ea5e9 15%, transparent); }
/* Entfallen oder verschoben. */
.ist-badge.off { color: #b45309; background: color-mix(in srgb, #f59e0b 16%, transparent); }
.td-stop.ausgefallen .ts-name { text-decoration: line-through; text-decoration-thickness: 1px; color: var(--text-dim); }
.kkb-chip { align-self: center; flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px;
    border: 1px solid color-mix(in srgb, #22c55e 45%, transparent); background: color-mix(in srgb, #22c55e 13%, transparent);
    color: #15803d; border-radius: 999px; padding: 3px 9px; font-size: 11.5px; font-weight: 600; }
.td-stop .tseq { width: 22px; height: 22px; border-radius: 50%; background: #3b82f6; color: #fff; font-weight: 700; font-size: 11.5px; display: grid; place-items: center; flex-shrink: 0; }
.td-stop .tseq.start { background: #22c55e; }
.td-stop .tseq.hotel { background: #8b5cf6; }
/* Vertriebskette im Tour-Detailpanel */
.sales-chain { border-top: 1px solid var(--border-soft); padding-top: 10px; margin-top: 4px; display: flex; flex-direction: column; gap: 8px; }
.sc-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 13px; }
.sc-form { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface-2); }
.sc-form.inline { margin-top: 4px; }
.sc-form input, .sc-form select, .sc-form textarea { width: 100%; padding: 5px 8px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-family: inherit; }
.sc-form .field-row { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.sc-report { border: 1px solid var(--border-soft); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); padding: 8px 10px; background: var(--surface-2); display: flex; flex-direction: column; gap: 5px; }
.sc-report .scr-title { font-weight: 650; font-size: 13px; }
.sc-report .scr-note { font-size: 12px; color: var(--text-dim); white-space: pre-wrap; }
.sc-opp { border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 6px 8px; background: var(--surface); display: flex; flex-direction: column; gap: 5px; }
.sc-opp .sco-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sc-opp .sco-title { font-weight: 600; font-size: 12.5px; flex: 1; min-width: 0; }
.sc-opp select, .sc-offer select { padding: 3px 6px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font-size: 11.5px; }
.sc-offer { display: flex; align-items: center; gap: 6px; font-size: 12px; padding-left: 6px; }
.sc-offer span { min-width: 0; }
.g-bar.sel { box-shadow: 0 0 0 2px var(--accent) inset; }
.dispo-card.sel { box-shadow: 0 0 0 2px var(--accent) inset; cursor: pointer; }
.dispo-card { cursor: pointer; }
@media (max-width: 1100px) { .dispo-focus.split { grid-template-columns: 1fr; } }

/* Wochenplan (Gantt) */
.gantt-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.gantt-nav .gw-label { font-weight: 650; font-size: 13.5px; }
.gantt-pool { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; padding: 10px; margin-bottom: 12px;
    background: var(--surface-2); border: 1px dashed var(--border); border-radius: var(--radius); min-height: 56px; }
.gantt-pool.drop-over, .g-cell.drop-over { outline: 2px dashed var(--accent); outline-offset: -2px; background: color-mix(in srgb, var(--accent) 8%, transparent); }
.gantt-pool .pool-label { font-size: 11px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; align-self: center; padding-right: 6px; }
.gantt-grid { display: grid; border: 1px solid var(--border-soft); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.gantt-grid > div { border-bottom: 1px solid var(--border-soft); border-right: 1px solid var(--border-soft); min-height: 62px; }
.g-corner { background: var(--surface-2); font-weight: 700; font-size: 12px; padding: 8px 10px; display: flex; align-items: center; }
.g-day-head { background: var(--surface-2); text-align: center; font-size: 11.5px; font-weight: 600; padding: 6px 4px; min-height: 0 !important; }
.g-day-head span { color: var(--text-dim); font-weight: 500; }
.g-day-head.today { background: color-mix(in srgb, var(--accent) 16%, var(--surface-2)); color: var(--accent); }
.g-name { display: flex; align-items: center; gap: 7px; padding: 8px 10px; font-weight: 650; font-size: 12.5px; background: var(--surface-2); border-left: 3px solid var(--emp, var(--border)); }
.g-name.unassigned { border-left-color: #94a3b8; color: var(--text-dim); }
.g-name .emp-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--emp, #64748b); }
.g-cell { padding: 5px; display: flex; flex-direction: column; gap: 4px; }
.g-bar { background: color-mix(in srgb, var(--emp, #3b82f6) 14%, var(--surface)); border: 1px solid var(--emp, #3b82f6);
    border-left: 4px solid var(--emp, #3b82f6); border-radius: var(--radius-sm); padding: 4px 7px; cursor: grab; }
.g-bar.dragging { opacity: .5; }
.g-bar .g-bar-title { display: block; font-size: 12px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-bar .g-bar-sub { display: block; font-size: 10.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Textlabel am markierten Kartenpunkt (Leaflet-Tooltip override) */
.leaflet-tooltip.crm-map-label { background: var(--surface); color: var(--text); border: 1px solid var(--accent);
    border-radius: 6px; font-weight: 650; font-size: 12px; padding: 3px 8px; box-shadow: var(--shadow-sm); }
.leaflet-tooltip.crm-map-label::before { border-top-color: var(--accent); }
.tour-stop.dragging { opacity: 0.5; cursor: grabbing; }
.tour-stop.drop-target { border-color: var(--accent); box-shadow: 0 -2px 0 var(--accent) inset; }
.tour-stop .seq { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 750; font-size: 12.5px; display: grid; place-items: center; flex-shrink: 0; }
.tour-stop .ts-main { flex: 1; min-width: 0; }
.tour-stop .ts-name { font-weight: 650; font-size: 13.5px; }
/* Stoppname öffnet die Stammdaten – als klickbar erkennbar machen. */
.tour-stop .ts-name .ts-link { cursor: pointer; text-decoration-color: transparent; text-underline-offset: 3px; }
.tour-stop .ts-name .ts-link:hover { color: var(--accent); text-decoration: underline; text-decoration-color: currentColor; }
.tour-stop .ts-meta { color: var(--text-dim); font-size: 12px; display: flex; gap: 4px 12px; flex-wrap: wrap; margin-top: 2px; }
.tour-stop .drag-handle { color: var(--text-muted); cursor: grab; display: grid; }
.tour-connector { display: flex; align-items: center; gap: 8px; padding: 2px 0 2px 39px; color: var(--text-muted); font-size: 11.5px; }
.tour-connector .dash { flex: 0 0 20px; border-top: 2px dashed var(--border); }
.tour-summary { display: flex; justify-content: space-between; padding: 12px 4px 4px; font-size: 13px; border-top: 1px dashed var(--border-soft); margin-top: 6px; }
.tour-summary strong { font-variant-numeric: tabular-nums; }

/* ── Kundenbericht / KI-Ergebnis ───────────────────────────────────────── */
.report-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.report-form .full { grid-column: 1 / -1; }
.plaud-field { position: relative; }
.plaud-field textarea { width: 100%; min-height: 130px; }
.plaud-hint { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); margin-top: 6px; }

.ai-result { display: flex; flex-direction: column; gap: 18px; animation: tileIn 0.4s ease; }
.ai-result-head {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
}
.ai-result-head .ico { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; display: grid; place-items: center; flex-shrink: 0; }

.result-block { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px 18px; }
.result-block > h3 { font-size: 14.5px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.result-block > h3 .count { margin-left: auto; color: var(--text-muted); font-size: 12px; font-weight: 600; }

.theme-groups { display: flex; flex-direction: column; gap: 16px; }
.theme-group-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted); font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }

.mini-card { border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface-2); margin-bottom: 8px; }
.mini-card:last-child { margin-bottom: 0; }
.mini-card .mc-head { display: flex; align-items: center; gap: 8px; }
.mini-card .mc-title { font-weight: 650; font-size: 13.5px; flex: 1; }
.mini-card .mc-desc { color: var(--text-dim); font-size: 12.5px; margin-top: 5px; line-height: 1.5; }
.mini-card .mc-foot { display: flex; gap: 6px 14px; flex-wrap: wrap; margin-top: 9px; font-size: 12px; color: var(--text-dim); }
.mini-card .mc-foot strong { color: var(--text); }
.mini-card .mc-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

/* Freigabe-Fortschritt (Bericht) */
.flow { display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.flow-step { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
.flow-step .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); font-size: 11px; font-weight: 700; flex-shrink: 0; }
.flow-step.done { color: var(--st-available); }
.flow-step.done .dot { background: color-mix(in srgb, var(--st-available) 18%, transparent); border-color: var(--st-available); color: var(--st-available); }
.flow-step.current { color: var(--accent); }
.flow-step.current .dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.flow-arrow { width: 26px; border-top: 2px dashed var(--border); margin: 0 6px; }

/* ── Kalender ──────────────────────────────────────────────────────────── */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-head { text-align: center; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); font-weight: 700; padding-bottom: 4px; }
.cal-cell { min-height: 96px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 7px 8px; display: flex; flex-direction: column; gap: 4px; }
.cal-cell.other { opacity: 0.45; }
.cal-cell.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cal-date { font-size: 12px; font-weight: 700; color: var(--text-dim); }
.cal-cell.today .cal-date { color: var(--accent); }
.cal-ev { font-size: 11px; padding: 3px 6px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; border-left: 2px solid var(--accent); }

/* ── Detail-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(460px, 96vw);
    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);
}
/* Telefonakquise-Firmenpanel: doppelt so breit (viele strukturierte Felder nebeneinander). */
.side-panel.wide { width: min(920px, 98vw); }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.panel-head { display: flex; align-items: flex-start; 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: 3px; }
.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: 140px 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: 700; 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; font-family: var(--font);
}
.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.08); color: #fff; }

.source-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.source-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border-soft); }

/* Datenschutz-Hinweis */
.privacy-note {
    display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--st-meeting) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--st-meeting) 25%, transparent);
    color: var(--text-dim); font-size: 12.5px; line-height: 1.5; margin-bottom: 18px;
}
.privacy-note .pn-ico { color: var(--st-meeting); flex-shrink: 0; }

/* ── Einstellungen ─────────────────────────────────────────────────────── */
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); font-size: 13.5px; }
.setting-row:last-child { border-bottom: 0; }
.setting-row .s-label { font-weight: 550; }
.setting-row .hint { color: var(--text-muted); font-size: 12px; margin-top: 2px; }

.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); }

.accent-swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.accent-swatch { width: 40px; height: 40px; border-radius: 10px; cursor: pointer; border: 2px solid transparent; position: relative; transition: transform 0.12s; }
.accent-swatch:hover { transform: translateY(-2px); }
.accent-swatch.sel { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.accent-swatch .chk { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; }

/* Mock-Schnittstellenstatus */
.conn-card { display: flex; align-items: center; gap: 12px; padding: 13px 15px; }
.conn-card .conn-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-dim); flex-shrink: 0; }
.conn-card .conn-main { flex: 1; min-width: 0; }
.conn-card .conn-name { font-weight: 650; font-size: 13.5px; }
.conn-card .conn-state { font-size: 12px; color: var(--text-dim); margin-top: 1px; }

.dot-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.dot-status .d { width: 8px; height: 8px; border-radius: 50%; }
.dot-status.off .d { background: var(--st-offline); } .dot-status.off { color: var(--text-muted); }
.dot-status.mock .d { background: var(--st-focus); } .dot-status.mock { color: var(--st-focus); }
.dot-status.on .d { background: var(--st-available); } .dot-status.on { color: var(--st-available); }
.dot-status.manual .d { background: var(--st-meeting); } .dot-status.manual { color: var(--st-meeting); }

/* ── Selma-Chat ────────────────────────────────────────────────────────── */
.selma-page { display: flex; flex-direction: column; height: calc(100vh - var(--topbar-h) - 62px); }
.chat-scroll { flex: 1; overflow-y: auto; padding: 6px 4px 14px; display: flex; flex-direction: column; gap: 12px; }

.selma-avatar {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    background: var(--brand-gradient); color: #fff;
    display: grid; place-items: center; box-shadow: 0 2px 8px rgba(228,43,34,0.28);
}
.selma-avatar.lg { width: 44px; height: 44px; }

.selma-welcome { text-align: center; padding: 46px 20px 26px; color: var(--text-dim); }
.selma-welcome .selma-avatar { margin: 0 auto 14px; }
.selma-welcome h2 { color: var(--text); font-size: 19px; margin-bottom: 6px; }
.selma-examples { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

.chat-row { display: flex; gap: 10px; align-items: flex-end; }
.chat-row.from-user { justify-content: flex-end; }

.bubble {
    max-width: min(860px, 88%);
    border-radius: var(--radius);
    padding: 11px 14px;
    box-shadow: var(--shadow-sm);
    animation: tileIn 0.25s ease;
}
.bubble.user { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-bottom-right-radius: 4px; }
.bubble.selma { background: var(--surface); border: 1px solid var(--border-soft); border-bottom-left-radius: 4px; }
.bubble-text { font-size: 13.5px; line-height: 1.55; white-space: normal; }
.bubble-time { font-size: 10.5px; opacity: 0.65; margin-top: 5px; text-align: right; }

.typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); animation: typingBlink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBlink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.draft-card { margin-top: 10px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface-2); }
.draft-card .dc-head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.draft-card .dc-foot { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border-soft); }

.mail-preview { border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface); padding: 12px 14px; }
.mail-preview .mail-subject { font-weight: 650; font-size: 13px; padding-bottom: 8px; border-bottom: 1px solid var(--border-soft); margin-bottom: 8px; }
.mail-preview .mail-body { font-family: var(--font); font-size: 13px; line-height: 1.55; white-space: pre-wrap; margin: 0; color: var(--text); }

.selma-hint {
    display: flex; align-items: flex-start; gap: 8px;
    font-size: 12.5px; color: var(--text-dim);
    padding: 6px 10px; border-radius: var(--radius-sm);
    background: var(--accent-soft); margin-bottom: 5px;
}
.selma-hint svg { color: var(--accent); flex-shrink: 0; margin-top: 2px; }

.chat-input {
    display: flex; gap: 10px; align-items: flex-end;
    padding: 0 0 12px; border-bottom: 1px solid var(--border-soft);
}
.chat-input textarea { flex: 1; min-height: 46px; max-height: 140px; resize: vertical; }

@media (max-width: 760px) {
    .selma-page { height: calc(100vh - var(--topbar-h) - 46px); }
    .bubble { max-width: 94%; }
}

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

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
    .route-layout { grid-template-columns: 300px 1fr; }
}
@media (max-width: 1050px) {
    :root { --sidebar-w: 66px; }
    .dash-cols { grid-template-columns: 1fr !important; }
    .sidebar { padding: 14px 8px; align-items: center; }
    .sidebar-brand { padding: 6px 0 16px; }
    .sidebar-brand .brand-text { display: none; }
    .nav-section { display: none; }
    .nav-link { justify-content: center; padding: 10px; }
    .nav-link .nav-text { display: none; }
    .nav-link.active::before { display: none; }
    .nav-badge { position: absolute; top: 3px; right: 3px; margin: 0; padding: 0 5px; }
    .sidebar-footer { display: none; }
    .route-layout { grid-template-columns: 1fr; }
    .app-switcher-btn .cur { display: none; }
}
@media (max-width: 760px) {
    .app-main { padding: 14px 12px 30px; }
    .cards-grid, .settings-grid, .kpi-grid { grid-template-columns: 1fr; }
    .topbar { padding: 0 12px; gap: 8px; }
    .topbar-clock, .role-select .role-label { display: none; }
    .global-search { width: 100%; }
    .report-form { grid-template-columns: 1fr; }
    .field-row { grid-template-columns: 1fr; }
    .info-grid { grid-template-columns: 116px 1fr; }
    .panel-actions { grid-template-columns: 1fr; }
    .cal-grid { font-size: 11px; }
    .cal-cell { min-height: 62px; }
    .flow { gap: 4px; } .flow-arrow { width: 14px; }
}
@media (min-width: 2200px) {
    .cards-grid { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
    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; }

/* Globales „Ich arbeite"-Feedback: nicht-blockierender Spinner-Toast (unten rechts). */
.a4l-busy {
    position: fixed; right: 20px; bottom: 20px; z-index: 2000;
    display: flex; align-items: center; gap: 10px;
    background: var(--surface, #1b2130); color: var(--text, #e7ecf3);
    border: 1px solid var(--border, #2a3245); border-radius: 10px;
    padding: 10px 16px; box-shadow: var(--shadow, 0 8px 24px rgba(0,0,0,.35));
    font-size: 13.5px; pointer-events: none;
    animation: a4l-busy-in .12s ease-out;
}
.a4l-busy .a4l-spinner {
    width: 18px; height: 18px; border-radius: 50%;
    border: 2.5px solid var(--border, #2a3245);
    border-top-color: var(--brand-orange, #f5811f);
    animation: a4l-spin .7s linear infinite;
}
@keyframes a4l-spin { to { transform: rotate(360deg); } }
@keyframes a4l-busy-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Buttons im Wartezustand: Cursor + leichte Transparenz signalisieren „läuft". */
.btn:disabled { cursor: progress; opacity: .6; }

/* ── Adress-Autovervollständigung (SmartRoute) ─────────────────────────── */
.suggest-dd {
    position: absolute; left: 0; right: 0; top: 100%; z-index: 30;
    background: var(--surface, #1b2130); border: 1px solid var(--border, #2a3245);
    border-radius: 8px; margin-top: 3px; overflow: hidden; box-shadow: var(--shadow, 0 8px 24px rgba(0,0,0,.35));
    max-height: 230px; overflow-y: auto;
}
.suggest-item {
    display: block; width: 100%; text-align: left; padding: 7px 10px; font-size: 12.5px;
    background: none; border: 0; color: var(--text, #e7ecf3); cursor: pointer;
}
.suggest-item:hover { background: var(--surface-2, #232c3d); }
.addr-ok { color: var(--st-available, #22c55e); font-size: 11.5px; margin-top: 2px; }

/* ── LinkedIn-Signale (Lead Intelligence) ──────────────────────────────── */
.data-table tr.row-sel { background: var(--accent-soft); }
.data-table tr.row-sel td.cell-strong { color: var(--accent); }

/* Erfassungs-Modal (§3): zentrierte Box über dem Panel-Backdrop */
.lin-modal {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: min(640px, 96vw); max-height: 88vh; z-index: 90;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); display: flex; flex-direction: column;
    animation: fadeIn 0.18s ease;
}
.lin-modal-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.lin-capture-row {
    display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px;
    border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
    margin-bottom: 8px; cursor: pointer; transition: background 0.12s;
}
.lin-capture-row:hover { background: var(--surface-hover); }
.lin-capture-row input { margin-top: 3px; flex-shrink: 0; }

.action-btn:disabled { cursor: not-allowed; opacity: 0.5; }
.action-btn.primary:disabled { filter: none; }

/* Formular in den LinkedIn-Dialogen */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.form-grid > label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-dim); font-weight: 600; }
.form-grid input, .form-grid select, .form-grid textarea {
    font-size: 13px; padding: 7px 9px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-family: var(--font);
}
.form-grid textarea { resize: vertical; }
.chk-row { display: inline-flex; flex-direction: row !important; align-items: center; gap: 6px; font-size: 12px; color: var(--text-dim); font-weight: 600; }
.chk-row input { width: auto; }

@media (max-width: 900px) { .lin-cols, .form-grid { grid-template-columns: 1fr !important; } }

/* ══════════════ Modul Telefonakquise ══════════════ */
.acq-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.acq-kpis .kpi { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 14px 16px; }
.acq-kpis .kpi.on, .acq-kpis .kpi[onclick]:hover { border-color: var(--accent); cursor: pointer; }
.acq-kpis .kpi-val { font-size: 26px; font-weight: 800; line-height: 1; }
.acq-kpis .kpi-lbl { font-size: 12px; color: var(--text-dim); margin-top: 6px; }

.acq-hub-layout { display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: start; }
@media (max-width: 1050px) { .acq-hub-layout { grid-template-columns: 1fr; } }
.acq-hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.acq-area { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); box-shadow: var(--shadow-sm); text-decoration: none; color: inherit; }
.acq-area.ready { cursor: pointer; transition: border-color .15s, transform .1s; }
.acq-area.ready:hover { border-color: var(--accent); transform: translateY(-1px); }
.acq-area-ico { width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.acq-area-main { flex: 1; min-width: 0; }
.acq-area-name { font-weight: 650; font-size: 14px; }

/* Funnel */
.funnel { display: flex; flex-direction: column; gap: 7px; }
.funnel-row { display: grid; grid-template-columns: 120px 1fr 34px; align-items: center; gap: 8px; font-size: 12px; }
.funnel-lbl { color: var(--text-dim); }
.funnel-track { height: 16px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.funnel-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2, var(--accent))); border-radius: 999px; }
.funnel-num { text-align: right; font-weight: 700; }

/* Suchoberfläche */
.acq-search-box { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px; margin-bottom: 16px; }
/* wird auch als <form> gerendert (Absenden mit Enter) – UA-Standardrand abschalten */
.acq-search-input { display: flex; align-items: center; gap: 10px; color: var(--text-dim); margin: 0; }
.acq-search-input input { flex: 1; min-width: 0; font-size: 16px; padding: 12px 6px; border: none; background: transparent; color: var(--text); outline: none; }
.acq-search-input .btn { flex-shrink: 0; }
.acq-examples { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }

/* KI-Interpretation */
.interp-card { border-left: 3px solid var(--accent); }
.interp-grid { display: grid; grid-template-columns: minmax(160px, 1fr) 130px 140px 170px; gap: 12px; }
@media (max-width: 800px) { .interp-grid { grid-template-columns: 1fr 1fr; } }
.interp-block { margin-top: 12px; }
.interp-block > label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 5px; }
.interp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 800px) { .interp-cols { grid-template-columns: 1fr; } }
.interp-add { padding: 5px 8px; border: 1px dashed var(--border); border-radius: 999px; background: var(--surface-2); color: var(--text-dim); font-size: 12px; }
.chip-toggle.accent { border-color: var(--accent); color: var(--accent); }
.chip-toggle.stop { border-color: color-mix(in srgb, var(--st-busy) 45%, transparent); color: var(--st-busy); }
.src-chip { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-soft); color: var(--text-dim); }

/* Ergebnis-Ansichten */
.view-toggle { display: flex; gap: 6px; }
.acq-table-wrap { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: var(--radius); background: var(--surface); }
.acq-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.acq-table th { text-align: left; padding: 10px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); border-bottom: 1px solid var(--border-soft); background: var(--surface-2); }
.acq-table td { padding: 10px 12px; border-bottom: 1px solid var(--border-soft); }
.acq-table tbody tr:hover { background: var(--surface-2); }

.pot-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.pot-chip { font-size: 11px; font-weight: 650; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border-soft); }
.pot-chip.lvl-hoch { color: var(--st-available); background: color-mix(in srgb, var(--st-available) 13%, transparent); border-color: color-mix(in srgb, var(--st-available) 30%, transparent); }
.pot-chip.lvl-mittel { color: var(--st-break); background: color-mix(in srgb, var(--st-break) 13%, transparent); border-color: color-mix(in srgb, var(--st-break) 30%, transparent); }
.pot-chip.lvl-niedrig { color: var(--text-dim); }
.pot-detail { padding: 7px 0; border-top: 1px solid var(--border-soft); }
.mini-scores { display: flex; flex-direction: column; gap: 2px; font-size: 10.5px; color: var(--text-dim); margin-top: 4px; text-align: center; }

/* KI-Zusammenfassung */
.ki-summary .ki-text { font-size: 14px; line-height: 1.6; margin: 6px 0 14px; }
.ki-top-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--border-soft); font-size: 13px; }
.ki-rank { width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 12px; display: grid; place-items: center; }
.ki-top-name { font-weight: 650; }

.last-call { font-size: 12.5px; color: var(--text-dim); margin: 2px 0 8px; display: flex; align-items: center; gap: 5px; }

/* Telefonakquise – Gesprächs-/Potenzialerfassung im Detail-Panel */
.acq-desc { font-size: 13px; line-height: 1.55; background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; border-left: 3px solid var(--accent); margin-bottom: 14px; }
.acq-selma { margin-bottom: 14px; }
.selma-note { margin-top: 8px; font-size: 12.5px; line-height: 1.55; background: color-mix(in srgb, var(--accent) 7%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border-soft)); border-radius: var(--radius-sm); padding: 10px 12px; }
.attempt-row { padding: 7px 0; border-top: 1px solid var(--border-soft); }
.acq-form { background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 12px; display: flex; flex-direction: column; gap: 9px; margin-top: 8px; }
.acq-form-title { font-weight: 650; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.acq-form .field label { font-size: 11.5px; color: var(--text-dim); }
.acq-form textarea, .acq-form input, .acq-form select { width: 100%; padding: 7px 9px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-size: 13px; }
.acq-selma-inline { display: flex; gap: 6px; }
.acq-selma-inline input { flex: 1; min-width: 0; padding: 6px 9px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-size: 12.5px; }
.acq-selma-inline .btn { flex-shrink: 0; }
.acq-call-form { flex-wrap: wrap; }

/* Recherche vertiefen – alle Anreicherungsquellen an einer Stelle */
.acq-research { margin-bottom: 16px; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 12px 14px; }
.acq-research .ar-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.acq-research .ar-title { font-weight: 650; font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.acq-research .ar-log { margin-top: 10px; max-height: 190px; overflow-y: auto; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 11.5px; line-height: 1.65; color: var(--text-dim); background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 8px 10px; }
.acq-research .ar-table { margin-top: 10px; font-size: 12.5px; }
.acq-research .ar-table td { vertical-align: top; }
.acq-research .ar-table tr.ar-skip { opacity: .6; }
.acq-research .ar-paid { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border-soft); display: flex; flex-direction: column; gap: 6px; }
.acq-research .ar-paid-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Telefonakquise – Multiselect & Akquiselisten */
.result-card { position: relative; }
.result-card.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
/* Auswahlkästchen als echte Spalte der Karte. Früher absolut positioniert – der dafür
   reservierte Platz (.rc-main margin-left) wurde in .route-results wieder auf 0 gesetzt,
   dadurch lag das Kästchen über den ersten Buchstaben des Firmennamens. */
.rc-check { display: flex; align-items: flex-start; padding-top: 3px; flex-shrink: 0; cursor: pointer; }
.rc-check input { width: 17px; height: 17px; cursor: pointer; }
.acq-table tr.sel { background: color-mix(in srgb, var(--accent) 10%, transparent); }

.acq-selbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; margin: 10px 0; background: color-mix(in srgb, var(--accent) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border-soft)); border-radius: var(--radius); position: sticky; top: 8px; z-index: 5; }
.acq-selbar .sel-count { font-size: 14px; }
.acq-selbar select, .acq-selbar input { padding: 6px 9px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-size: 13px; }

.acq-create { margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px; }
.acq-lists-layout { display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: start; }
@media (max-width: 1050px) { .acq-lists-layout { grid-template-columns: 1fr; } }
.acq-lists-col { display: flex; flex-direction: column; gap: 8px; }
.acq-list-card { display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); box-shadow: var(--shadow-sm); cursor: pointer; transition: border-color .15s; }
.acq-list-card:hover, .acq-list-card.active { border-color: var(--accent); }
.acq-list-card .alc-main { flex: 1; min-width: 0; }
.alc-name { font-weight: 650; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.acq-list-detail { display: flex; flex-direction: column; gap: 14px; }
.alc-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--text-dim); }

.mini-table { width: 100%; max-width: 560px; border-collapse: collapse; font-size: 13px; }
.mini-table td { padding: 5px 8px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.mini-table tr:last-child td { border-bottom: 0; }

.dist-emps { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-bottom: 10px; }
.dist-emp { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface-2); cursor: pointer; }
.dist-emp.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--surface-2)); }
.dist-emp .de-name { font-weight: 600; font-size: 13px; }
.dist-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.dist-actions select { padding: 6px 9px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-size: 13px; }

.acq-comp-list { display: flex; flex-direction: column; gap: 6px; }
.acq-comp-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); }
.acq-comp-row .acr-main { flex: 1; min-width: 0; cursor: pointer; }
.acr-name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.acr-assign { padding: 6px 9px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font-size: 12.5px; flex-shrink: 0; }

/* Telefonakquise – Website-Zusammenfassung */
.web-sum { font-size: 12.5px; line-height: 1.5; margin: 2px 0 8px; padding: 8px 10px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--accent) 7%, var(--surface-2)); border-left: 3px solid var(--accent); }
.sel-sep { width: 1px; align-self: stretch; background: var(--border-soft); margin: 0 2px; }

/* Telefonakquise – Treffer aus eigener DB deutlich hervorheben */
.result-card.owndb { border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.result-card.owndb::before { content: "🗄️ Eigene DB"; position: absolute; top: -1px; right: 10px; font-size: 10px; font-weight: 700; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-top: none; border-radius: 0 0 6px 6px; padding: 2px 8px; }

/* Telefonakquise – Hunter Credits */
.credit-row { display: grid; grid-template-columns: 220px 1fr 190px; align-items: center; gap: 12px; margin: 8px 0; }
@media (max-width: 800px) { .credit-row { grid-template-columns: 1fr; gap: 4px; } }
.credit-lbl { font-size: 12.5px; color: var(--text-dim); }
.credit-track { height: 16px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.credit-track span { display: block; height: 100%; border-radius: 999px; }
.credit-track .bar-go { background: var(--st-available); }
.credit-track .bar-warn { background: var(--st-break); }
.credit-track .bar-stop { background: var(--st-busy); }
.credit-num { font-size: 12.5px; text-align: right; }

/* Telefonakquise – Suchprotokoll + Quellen-Toggles */
.acq-log { margin: 12px 0; border: 1px solid var(--border-soft); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.acq-log-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 12.5px; font-weight: 650; border-bottom: 1px solid var(--border-soft); background: var(--surface-2); }
.acq-log-live { color: var(--st-available); font-weight: 700; animation: acqpulse 1.2s ease-in-out infinite; }
@keyframes acqpulse { 50% { opacity: .35; } }
.acq-log-body { max-height: 240px; overflow-y: auto; padding: 8px 12px; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12px; line-height: 1.6; scrollbar-width: thin; }
.acq-log-line { color: var(--text-dim); white-space: pre-wrap; }
.acq-log-line:last-child { color: var(--text); }

.src-toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.src-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--border-soft); border-radius: 999px; background: var(--surface-2); font-size: 12.5px; cursor: pointer; }
.src-toggle input { width: auto; }
.src-toggle.db { border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
/* „Nur neue Treffer" aktiv: deutlich hervorheben – der Schalter ändert das Ergebnis grundlegend. */
.src-toggle.accent { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface-2)); color: var(--text); }
.src-toggle input:disabled { opacity: .5; }
.src-toggle:has(input:disabled) { opacity: .55; cursor: default; }

/* Telefonakquise – Nutzungslimit-Zeilen */
.usage-row { padding: 10px 0; border-top: 1px solid var(--border-soft); }
.usage-row:first-of-type { border-top: none; }
.usage-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.usage-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.usage-ctl input { padding: 5px 8px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); }

/* Telefonakquise – Vertriebs-Score im Profil */
.salesscore { display: flex; gap: 14px; align-items: flex-start; }
.score-ring.big { width: 68px; height: 68px; flex-shrink: 0; }
.salesscore-info { flex: 1; min-width: 0; }
.score-factors { margin-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.sf-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.sf-pts { min-width: 34px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.sf-pts.pos { color: var(--st-available); }
.sf-pts.neg { color: var(--st-busy); }

/* Website-Analyse – strukturiertes, quellenbelegtes Firmenprofil (§15) */
.acq-profile { display: flex; flex-direction: column; gap: 3px; margin-bottom: 6px; }
.pf-row { display: flex; align-items: center; gap: 7px; font-size: 12px; flex-wrap: wrap; padding: 2px 0; border-bottom: 1px dashed var(--border-soft); }
.pf-key { min-width: 130px; color: var(--text-dim); }
.pf-val { font-weight: 600; }
.pf-src { font-size: 10.5px; font-weight: 600; color: var(--accent); text-decoration: none; }
.pf-src:hover { text-decoration: underline; }
.acq-pages { margin-top: 6px; }
.acq-pages summary { cursor: pointer; }
.pf-actions { display: inline-flex; gap: 3px; margin-left: auto; }
.pf-edit { padding: 3px 6px; border: 1px solid var(--border-soft); border-radius: 5px; background: var(--surface); color: var(--text); font-size: 12px; min-width: 120px; }
.pf-conflict { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 11.5px; color: var(--st-busy); margin: 0 0 4px 130px; }
.verify-box { margin: 4px 0 10px; padding: 8px 10px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface-2); }

/* CRM-I Mail-Client (Outlook-orientiertes 3-Spalten-Layout) */
.mail-shell { display: grid; grid-template-columns: 220px 340px 1fr; gap: 12px; align-items: start; }
@media (max-width: 1200px) { .mail-shell { grid-template-columns: 200px 1fr; } .mail-detail { grid-column: 1 / -1; } }
.mail-folders { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px; }
.mail-folder { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 0; background: transparent; color: var(--text); border-radius: 7px; cursor: pointer; font-size: 13px; text-align: left; }
.mail-folder:hover:not(:disabled) { background: var(--surface-2); }
.mail-folder.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.mail-folder:disabled { opacity: .5; cursor: default; }
.mail-folder-count { margin-left: auto; font-size: 11px; background: var(--surface-2); border-radius: 9px; padding: 0 7px; }
.mail-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); max-height: 72vh; overflow-y: auto; }
.mail-list-head { padding: 10px 12px; font-weight: 600; border-bottom: 1px solid var(--border-soft); position: sticky; top: 0; background: var(--surface); }
.mail-row { padding: 9px 12px; border-bottom: 1px solid var(--border-soft); cursor: pointer; }
.mail-row:hover { background: var(--surface-2); }
.mail-row.active { background: var(--accent-soft); }
.mail-row-top { display: flex; align-items: center; gap: 8px; }
.mail-subj { font-weight: 600; font-size: 13px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-detail { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; min-height: 300px; }
.mail-editor .field-row { display: flex; gap: 10px; margin-bottom: 6px; }
.mail-editor .field { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.mail-editor label { font-size: 11px; color: var(--text-dim); }
.mail-editor input, .mail-editor select, .mail-body { padding: 7px 9px; border: 1px solid var(--border-soft); border-radius: 6px; background: var(--surface-2); color: var(--text); font-size: 13px; width: 100%; }
.mail-body { font-family: inherit; line-height: 1.5; resize: vertical; }
.mail-selma { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.mail-attach { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.mail-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 6px; padding: 3px 8px; font-size: 12px; }
.mail-chip-x { border: 0; background: transparent; color: var(--text-dim); cursor: pointer; }
.mail-read { font-size: 13.5px; line-height: 1.6; background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; }
.mail-recip-pop { position: absolute; top: 52px; left: 0; right: 0; z-index: 40; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); max-height: 260px; overflow-y: auto; }
.mail-recip-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: transparent; color: var(--text); padding: 7px 10px; cursor: pointer; border-bottom: 1px solid var(--border-soft); }
.mail-recip-item:hover { background: var(--accent-soft); }
.mail-recip-name { font-weight: 600; font-size: 13px; }
.mail-chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 4px 6px; border: 1px solid var(--border-soft); border-radius: 6px; background: var(--surface-2); min-height: 34px; }
.mail-chips .mail-chip { background: var(--accent-soft); color: var(--accent); border: 0; }
.mail-chipinput { flex: 1; min-width: 120px; border: 0 !important; background: transparent !important; padding: 3px !important; color: var(--text); font-size: 13px; }
.mail-typefilter { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 5px; }
.mail-context-bar { display: flex; align-items: center; gap: 10px; margin: 8px 0; padding: 10px 12px; border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 6px; }
.mcb-title { font-weight: 700; font-size: 13.5px; }

/* Mein Postfach – Live-Analyseprotokoll */
.post-log { max-height: 320px; overflow-y: auto; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 8px 10px; }
.post-log-line { font-family: Consolas, "Cascadia Mono", monospace; font-size: 11.5px; line-height: 1.7; color: var(--text-dim); border-bottom: 1px dashed var(--border-soft); }
.post-log-line:first-child { color: var(--text); }
.acq-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; margin: 4px 0; cursor: pointer; }
.acq-check input { width: auto; }

/* Telefonakquise – Firmen-DB-Verwaltung */
.acq-db-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.acq-db-filter .db-search { flex: 1; min-width: 220px; padding: 8px 11px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); }
.acq-db-filter select { padding: 7px 9px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font-size: 13px; }
.acq-edit { margin-bottom: 16px; }
.edit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 900px) { .edit-grid { grid-template-columns: 1fr 1fr; } }
.edit-grid textarea, .edit-grid input, .edit-grid select { width: 100%; padding: 7px 9px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font-size: 13px; }

/* ═══════════════════════════════════════════════════════════════════════════
   SmartRoute · Positionsbezogene Kartensuche (Rechtsklick auf die Karte)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Kontextmenü auf der Karte (§1). Wird von here-map.js in den Kartencontainer gehängt. */
.crm-map-menu { position: absolute; z-index: 1200; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); box-shadow: var(--shadow-lg, 0 12px 34px rgba(0,0,0,.35)); padding: 4px; min-width: 260px; }
.crm-map-menu-item { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: transparent;
    color: var(--text); font: inherit; font-size: 13px; border-radius: 6px; cursor: pointer; }
.crm-map-menu-item:hover { background: var(--accent-soft); color: var(--accent); }

/* Suchmarker: bewusst anders als Tourstopps (blau nummeriert) und Kandidaten (farbige Punkte). */
.crm-search-pin { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #0891b2;
    background: rgba(8,145,178,.18); display: grid; place-items: center; box-shadow: 0 1px 6px rgba(0,0,0,.4); }
.crm-search-pin span { width: 8px; height: 8px; border-radius: 50%; background: #0891b2; display: block; }

/* Kartenzeichen der eigenen Firmendatenbank: Form = Kundenstatus, Farbe = Prio.
   Dieselben Symbole erscheinen als Legende im Suchfenster und als Marke in der Trefferliste,
   damit Karte und Liste ohne Umdenken zusammenpassen. */
.rl-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text-soft); }
.rl-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.rl-sym { display: inline-block; width: 13px; height: 13px; flex: 0 0 auto; box-sizing: border-box;
    border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); vertical-align: -2px; }
.rl-circle { border-radius: 50%; }
.rl-square { border-radius: 3px; }
.rl-blocked { border-color: var(--st-busy); }
/* Punkt in der Mitte = die Prio ist die von Hand bewertete Verkaufschance, nicht die Leadqualität. */
.rl-dot { position: relative; }
.rl-dot::after { content: ""; position: absolute; inset: 0; margin: auto; width: 4px; height: 4px;
    border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.3); }

/* ── Suchfenster ───────────────────────────────────────────────────────── */
.ps-dialog { width: min(760px, 96vw); max-height: 92vh; display: flex; flex-direction: column; gap: 0; padding: 0; }
.ps-head { display: flex; align-items: flex-start; gap: 10px; padding: 16px 18px 12px; border-bottom: 1px solid var(--border-soft); }
.ps-head h3 { margin: 0; font-size: 16px; }
.ps-head .ps-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.ps-head .ps-close { margin-left: auto; }
.ps-body { padding: 14px 18px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.ps-foot { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--border-soft);
    background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); flex-wrap: wrap; }
.ps-foot .ps-cost { font-size: 12px; color: var(--text-dim); margin-right: auto; }

.ps-sec { display: flex; flex-direction: column; gap: 8px; }
.ps-sec > h4 { margin: 0; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); }

/* Position + Kartenvorschau (§2) */
.ps-pos { display: flex; gap: 12px; align-items: stretch; }
.ps-pos-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ps-pos-info .ps-addr { font-weight: 650; font-size: 13.5px; }
.ps-pos-info .ps-coord { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.ps-preview { position: relative; width: 168px; height: 112px; flex-shrink: 0; border-radius: var(--radius-sm);
    overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.ps-preview img { position: absolute; width: 256px; height: 256px; max-width: none; }
.ps-preview .ps-cross { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%;
    border: 3px solid #0891b2; background: rgba(8,145,178,.25); box-shadow: 0 0 0 1px rgba(255,255,255,.7); }
.ps-preview .ps-nomap { display: grid; place-items: center; width: 100%; height: 100%; font-size: 11.5px; color: var(--text-dim); text-align: center; padding: 8px; }

/* Radius (§2) */
.ps-radius { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ps-radius input[type=range] { flex: 1; min-width: 160px; accent-color: var(--accent); }
.ps-radius .ps-radius-val { font-weight: 700; font-size: 13.5px; min-width: 54px; font-variant-numeric: tabular-nums; }
.ps-radius-max { font-size: 11.5px; color: var(--text-dim); width: 100%; }

/* Quellen (§3) */
.ps-sources { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.ps-source { display: flex; gap: 9px; align-items: flex-start; padding: 9px 10px; border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm); background: var(--surface-2); }
.ps-source.on { border-color: var(--accent); background: var(--accent-soft); }
.ps-source.off { opacity: .55; }
.ps-source input { margin-top: 2px; accent-color: var(--accent); }
.ps-source .ps-src-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ps-source .ps-src-name { font-weight: 650; font-size: 13px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ps-source .ps-src-note { font-size: 11.5px; color: var(--text-dim); line-height: 1.35; }

/* Kriterien (§4) */
.ps-crit { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) { .ps-crit { grid-template-columns: 1fr; } .ps-pos { flex-direction: column; } .ps-preview { width: 100%; } }
.ps-ai { display: flex; gap: 8px; align-items: flex-start; }
.ps-ai textarea { flex: 1; }
.ps-ai-out { font-size: 12px; color: var(--text-dim); border-left: 2px solid var(--accent); padding-left: 9px; }

/* Fortschritt (§5) */
.ps-progress { background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
    padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; max-height: 190px; overflow: auto; }
.ps-progress .ps-line { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.ps-progress .ps-line.now { color: var(--accent); font-weight: 650; }
.ps-stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; }
.ps-stats b { font-variant-numeric: tabular-nums; }

/* ── Suchauftrags-Leiste und Ergebnisse (§7/§10) ───────────────────────── */
.ps-jobs { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 10px; }
.ps-job-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border: 1px solid var(--border-soft);
    border-radius: 999px; background: var(--surface-2); color: var(--text); font-size: 12.5px; cursor: pointer; }
.ps-job-chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.ps-job-chip .ps-job-x { border: 0; background: transparent; color: inherit; cursor: pointer; opacity: .6; padding: 0 0 0 2px; line-height: 1; }
.ps-job-chip .ps-job-x:hover { opacity: 1; }
.ps-job-chip .ps-spin { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: ps-pulse 1.1s ease-in-out infinite; }
@keyframes ps-pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

.result-card.ps-hit { border-left: 3px solid #0891b2; }
.result-card.ps-hit.ps-dup { border-left-color: #f59e0b; }
.result-card.ps-hit.ps-blocked { border-left-color: var(--st-busy, #e11d48); }
.ps-badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 999px;
    font-size: 10.5px; font-weight: 650; background: rgba(8,145,178,.16); color: #0891b2; }
/* CRM-I-Status „übernommen" (automatisch aus der Suche in die CRM-I-DB geschrieben) hervorheben. */
.ps-card .v.v-imported, .v.v-imported { color: #0891b2; font-weight: 650; }
.ps-flags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.ps-flag { font-size: 10.5px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2);
    border: 1px solid var(--border-soft); color: var(--text-dim); }
.ps-flag.warn { background: rgba(245,158,11,.14); border-color: rgba(245,158,11,.4); color: #b45309; }
.ps-flag.stop { background: rgba(225,29,72,.13); border-color: rgba(225,29,72,.4); color: #be123c; }
.ps-flag.info { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.ps-srcline { font-size: 11.5px; color: var(--text-dim); margin-top: 4px; }
.ps-insert { margin-top: 7px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2);
    border: 1px solid var(--border-soft); font-size: 12px; display: flex; flex-direction: column; gap: 3px; }
.ps-insert .ps-ins-warn { color: #b45309; }
.ps-insert .ps-ins-ok { color: var(--text-dim); }

/* ══ Flexible Touranlage (leere Tour, manuelle Stopps, On-Demand-Routing) ══ */
.btn.warn { background: #f59e0b; border: 0; color: #1a1205; }
.btn.warn:hover { background: #d97706; color: #fff; }

/* Leere Tour anlegen + aktive-Tour-Kopfzeile (§2) */
/* Anlege-Buttons oberhalb des eingerahmten Tourbereichs, nebeneinander. */
.rl-geplant > .at-create { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.rl-geplant > .at-create .btn { justify-content: center; white-space: nowrap; }

/* „das einrahmen der Tour": oranger Rahmen um die komplette Tour (Kopfzeile · Route · Bezeichnung · Stopps · Summary). */
.tour-frame { border: 2px solid var(--accent); border-radius: var(--radius); background: var(--surface);
    box-shadow: var(--shadow-sm); padding: 12px 14px 14px; }
/* Schreibgeschützt (fremd gesperrt): Rahmen bernsteinfarben, Editierbereiche nicht bedienbar + gedimmt. Banner bleibt aktiv. */
.tour-frame.readonly { border-color: #f59e0b; }
.tour-frame.readonly .at-meta, .tour-frame.readonly .at-bezeichnung, .tour-frame.readonly .section-actions,
.tour-frame.readonly .tour-scroll, .tour-frame.readonly .tour-summary { pointer-events: none; opacity: .6; }
.lock-banner { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; padding: 8px 12px;
    border-radius: var(--radius-sm); font-size: 13px; color: var(--text);
    background: color-mix(in srgb, #f59e0b 14%, var(--surface)); border: 1px solid color-mix(in srgb, #f59e0b 45%, var(--border)); }
.lock-banner > button { margin-left: auto; }

/* Zeile A (im Rahmen oben): Tour-Nr. + Datum links, Speichern + Auto-Speichern rechts. */
.at-meta { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 12px; }
.at-meta .at-actions { margin-left: auto; }
/* Zeile C (unter „Geplante Route"): Bezeichnung + Status. */
.at-bezeichnung { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 12px; }
.at-bezeichnung .at-field-name { flex: 1; min-width: 180px; }
.at-bezeichnung .at-field-status { margin-left: auto; }

/* Beschriftete Feldgruppen der Tour-Kopfzeile. */
.at-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.at-field > label { font-size: 10px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; }
.at-field-name .at-name { width: 100%; }
.at-status { min-width: 150px; }
.at-date { width: 160px; }
.at-field-nr .at-nr { display: inline-block; padding: 6px 10px; border-radius: 999px; background: var(--surface-2);
    border: 1px solid var(--border-soft); color: var(--text); font-size: 13px; font-weight: 700;
    font-variant-numeric: tabular-nums; white-space: nowrap; }
.at-actions { display: flex; align-items: center; gap: 8px; }
.at-save { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-dim); white-space: nowrap; }
/* Trenner + Unterüberschrift im Dialog „Tourvorschlag anlegen" (Route ↔ Ankertermine). */
.tp-divider { border-top: 1px solid var(--border-soft); margin: 14px 0 10px; }
.tp-subhead { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 650; margin-bottom: 4px; }
.at-save.saved { color: #16a34a; }
.at-save.error { color: var(--st-busy, #e11d48); }

/* Start-/Zielmodus (§5) */
.startziel-modes { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-bottom: 10px;
    padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--radius); }
.startziel-modes .szm-group { display: flex; align-items: center; gap: 6px; }
.startziel-modes .szm-label { font-size: 11px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: .03em; }
.startziel-modes .szm-ret { margin-left: auto; }

/* Veraltet-Banner + Kennzeichnung (§6) */
.stale-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px;
    padding: 9px 12px; background: rgba(245,158,11,.12); border: 1px solid #f59e0b; border-radius: var(--radius);
    color: #b45309; font-size: 13px; }
.stale-banner button { margin-left: auto; }
.tour-summary.stale { opacity: .82; }
.stale-tag { color: #b45309; font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: .04em; }

/* Leerzustand (§7) */
.tour-empty { text-align: center; padding: 30px 20px; border: 1px dashed var(--border-soft); border-radius: var(--radius);
    background: var(--surface-2); }
.tour-empty .te-emoji { font-size: 34px; }
.tour-empty .te-title { font-weight: 700; margin-top: 6px; font-size: 15px; }
.tour-empty .te-text { color: var(--text-dim); margin: 4px auto 14px; max-width: 460px; font-size: 13px; }
.tour-empty .te-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }

/* Stopp-Aktionen + Inline-Editor (§4) */
.ts-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.btn.ghost.on { border-color: var(--accent); color: var(--accent); }
.stop-editor { margin: 4px 0 10px 42px; padding: 12px; background: var(--surface-2); border: 1px solid var(--border-soft);
    border-radius: var(--radius); display: flex; flex-direction: column; gap: 8px; }
.stop-editor .field-row { display: flex; gap: 10px; flex-wrap: wrap; }
.stop-editor .field { flex: 1; min-width: 130px; }

/* Dialog „Stopp hinzufügen" (§3) */
.addstop-dialog { width: min(720px, 96vw); max-height: 92vh; display: flex; flex-direction: column; gap: 0; padding: 0; }
.as-sources { display: flex; flex-wrap: wrap; gap: 6px; }
.as-search { display: flex; gap: 8px; align-items: stretch; }
.as-search input { flex: 1; }
.as-results { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow: auto; }
.as-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border-soft);
    border-radius: 10px; background: var(--surface); }
.as-row .as-main { flex: 1; min-width: 0; }
.as-row .as-name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.as-row .as-src { font-size: 10px; font-weight: 600; color: var(--text-dim); background: var(--surface-2);
    border: 1px solid var(--border-soft); border-radius: 999px; padding: 1px 7px; }
.as-manual { border-top: 1px solid var(--border-soft); padding-top: 10px; }
.as-manual h4 { margin: 0 0 6px; font-size: 13px; }

/* ── SmartRoute-Ergebnisliste: kompakter & platzoptimiert (nur diese Liste; Telefonakquise unberührt) ── */
.route-results { gap: 8px; }
.route-results .result-card { padding: 10px 13px; gap: 12px; }
/* Kein Einzug mehr nötig: das Auswahlkästchen ist eine eigene Flex-Spalte (siehe .rc-check).
   Karten ohne Kästchen nutzen dadurch automatisch die volle Breite. */
.route-results .result-card .rc-name { font-size: 13.5px; gap: 6px; margin-bottom: 1px; }
/* auto-fit statt auto-fill: die Feldspalten füllen die verfügbare Breite, es bleiben keine leeren Spuren
   (behebt das „teilweise nicht richtig dargestellt, obwohl noch Platz"); kleinerer Mindestwert ⇒ mehr Felder pro Zeile ⇒ niedrigere Karte */
.route-results .result-card .rc-grid {
    grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
    gap: 3px 14px; margin-top: 6px; font-size: 11.5px;
}
.route-results .result-card .rc-grid > div { min-width: 0; line-height: 1.2; }
.route-results .result-card .rc-grid .k { font-size: 9.5px; letter-spacing: 0.3px; margin-bottom: 1px; }
.route-results .result-card .rc-grid .v { overflow-wrap: anywhere; }
.route-results .result-card .rc-actions { gap: 5px; margin-top: 8px; }
.route-results .result-card .rc-actions .btn { padding: 4px 9px; font-size: 12px; }
.route-results .result-card .rc-side { gap: 5px; }

/* Ankunft nach Geschäftsschluss (Firma vermutlich zu) – bernsteinfarben; Ankertermin-Konflikt (rot) hat Vorrang */
.mini-tag.closed { color: #b45309; background: color-mix(in srgb, #f59e0b 16%, transparent); text-transform: none; }
.eta-badge.closed { color: #b45309; background: color-mix(in srgb, #f59e0b 14%, transparent); }
.tour-stop.afterclose { background: color-mix(in srgb, #f59e0b 8%, var(--surface)); }
.tour-stop.conflict.afterclose { background: color-mix(in srgb, var(--st-busy) 10%, var(--surface)); }

/* ── Geplante Route: kompakte, gerahmte Stopp-Liste (Tour eingerahmt, Höhe/Abstände reduziert, Aktionen enger) ── */
.tour-scroll {
    border: 1px solid var(--border-soft); border-radius: var(--radius);
    background: var(--surface-2); padding: 8px;
}
.tour-list { gap: 6px; }
.tour-stop { padding: 7px 10px; gap: 9px; }
.tour-stop .seq { width: 22px; height: 22px; font-size: 11.5px; }
.tour-stop .drag-handle svg { width: 15px; height: 15px; }
.tour-stop .ts-name { font-size: 13px; }
.tour-stop .ts-meta { font-size: 11.5px; gap: 3px 10px; margin-top: 1px; }
.tour-stop .ts-meta .eta-badge, .tour-stop .ts-meta .idle-badge { padding: 1px 7px; }
.tour-stop .mini-tag { font-size: 9.5px; padding: 1px 5px; margin-left: 5px; }
.tour-connector { padding: 1px 0 1px 33px; font-size: 11px; }
/* Schmale linke Spalte optimal nutzen: Inhalt (Name/Meta) über die volle Breite,
   Aktionen brechen in eine eigene Zeile darunter um – kein verschenkter Platz rechts,
   Name nicht mehr 3-zeilig. */
.tour-stop { flex-wrap: wrap; align-items: flex-start; row-gap: 4px; }
.tour-stop .ts-main { flex: 1 1 auto; min-width: 0; }
.tour-stop .ts-name { white-space: normal; overflow-wrap: anywhere; }
.tour-stop .ts-actions { flex-basis: 100%; justify-content: flex-start; flex-wrap: wrap; gap: 4px; margin-left: 33px; }
.tour-stop .ts-actions .btn { padding: 3px 6px; }
.tour-stop .ts-actions select { padding: 3px 6px; font-size: 12px; }
/* Klickbare Zeit-Badges → Schnellbearbeitung der festen Uhrzeit (Klick auf die Zeit). */
.tour-stop .eta-badge.clickable, .tour-stop .mini-tag.clickable { cursor: pointer; }
.tour-stop .eta-badge.clickable:hover, .tour-stop .mini-tag.clickable:hover { text-decoration: underline; }
.tour-stop .eta-badge.soft { color: var(--text-dim); background: var(--surface-2); border: 1px dashed var(--border-soft); }
.time-quick-edit { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.time-quick-edit input[type="time"] { padding: 3px 6px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text); font-variant-numeric: tabular-nums; }
.btn.xs { padding: 3px 7px; font-size: 12px; line-height: 1; }
.tour-summary { padding: 8px 4px 2px; font-size: 12.5px; gap: 4px 14px; flex-wrap: wrap; }

/* ── System → Tools · Übersicht + Softwareerkennung aus Tickets ─────────── */
.st-badge.soft { background: var(--surface-2); color: var(--text-dim); }
.tabbar .tab.active { color: var(--text); border-bottom-color: var(--accent); }   /* NavLink-Unternavigation */

/* Tool-Übersichtskarten */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 4px; }
.tool-card { cursor: pointer; display: flex; flex-direction: column; gap: 8px; transition: border-color .12s, transform .12s; }
.tool-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.tc-head { display: flex; align-items: center; gap: 10px; }
.tc-ico { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: var(--radius-sm);
    background: var(--accent-soft); color: var(--accent); flex: 0 0 auto; }
.tc-title { font-weight: 700; font-size: 14.5px; }
.tc-desc { color: var(--text-dim); font-size: 12.5px; line-height: 1.45; min-height: 34px; }
.tc-meta { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text-dim); margin-top: auto; }
.tc-lbl { color: var(--text-muted); display: inline-block; min-width: 92px; }
.tc-actions { margin-top: 4px; }

/* Filter-Chips (Kundenauswahl) */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 10px; border-radius: 999px;
    background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; }
.chip-x { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
.check-row.disabled { opacity: .5; }

/* Auftragsfortschritt */
.progress-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress-bar .pb-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s; }

/* Vergleichsansicht je Ticket */
.ticket-card { margin-top: 10px; }
.tk-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tk-models { display: flex; gap: 6px; flex-wrap: wrap; }
.cmp-table td, .cmp-table th { font-size: 12.5px; vertical-align: top; }
.cmp-table .cmp-sys-row td { border-top: 2px solid var(--border); padding-top: 8px; }
.cmp-table td.diff { background: color-mix(in srgb, var(--st-break) 12%, transparent); }
.diff-dot { display: inline-block; margin-left: 5px; color: var(--st-break); font-weight: 800; }

/* Übernahme-Zeile (§11) */
.adopt-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.adopt-in { padding: 5px 8px; font-size: 12.5px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); max-width: 190px; }

/* ── Activity & Quality Center (/cockpit) ───────────────────────────────── */
/* Warnvariante des Hinweisbandes: Doppelarbeit + veraltete Kennzahlen. */
.selma-hint.warn { background: color-mix(in srgb, var(--warn, #d98b00) 14%, transparent); }
.selma-hint.warn svg { color: var(--warn, #d98b00); }

/* Bewertung mit Begründung: Ring links, Faktoren aufklappbar darunter. */
.score-why { min-width: 230px; }
.score-why-head { display: flex; align-items: center; gap: 12px; }
.score-why-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.score-why-head .btn { margin-left: 6px; }
.score-why-list { list-style: none; margin: 10px 0 0; padding: 0; font-size: 12.5px; }
.score-why-list li {
    display: grid; grid-template-columns: 18px 1fr auto; align-items: baseline;
    gap: 6px; padding: 3px 0; border-bottom: 1px solid var(--border-soft);
}
.score-why-list li .cell-sub { grid-column: 2 / -1; }
.score-why-list li.miss .sw-label { color: var(--text-dim); }
.score-why-list .sw-mark { text-align: center; }
.score-why-list li.ok .sw-mark { color: var(--ok, #2e9e5b); }
.score-why-list li.miss .sw-mark { color: var(--text-dim); }
.score-why-list .sw-points { color: var(--text-dim); font-variant-numeric: tabular-nums; }

/* Quellenübergreifende Firmen-Zeitleiste. */
.ct-timeline { list-style: none; margin: 0; padding: 0; }
.ct-timeline li {
    display: grid; grid-template-columns: 64px 1fr; gap: 12px;
    padding: 8px 0; border-bottom: 1px solid var(--border-soft);
}
.ct-when { text-align: right; }
.ct-date { display: block; font-size: 12.5px; font-weight: 600; }
.ct-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.ct-text { font-size: 13px; margin-top: 2px; }

/* Empfehlungen: eine Zeile = eine Arbeitsliste. */
.reco-list { list-style: none; margin: 0; padding: 0; }
.reco-list li { padding: 4px 0; font-size: 13px; }
.reco-list li::before { content: "• "; color: var(--accent); }

/* ══════════════ Kundenkontaktbericht: Wirkung des Speicherns sichtbar machen ══════════════
   Grün = es entsteht ein Bericht (crmi.ContactReports), grau = der Kontakt bleibt nur im
   Kontaktverlauf der Firma. Die Checkbox übersteuert die Automatik in beide Richtungen. */
.report-flag {
    margin: 8px 0; padding: 8px 10px; border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft); background: var(--surface-2);
    border-left: 3px solid var(--text-dim);
}
.report-flag.on {
    border-left-color: var(--st-available);
    background: color-mix(in srgb, var(--st-available) 10%, transparent);
}
.report-flag-main { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; margin: 0; }
.report-flag-main input { width: 16px; height: 16px; margin-top: 1px; flex-shrink: 0; accent-color: var(--st-available); }
.report-flag-text { display: flex; flex-direction: column; gap: 1px; }
.report-flag-text strong { font-size: 13px; font-weight: 600; }
.report-flag.on .report-flag-text strong { color: var(--st-available); }
.report-flag-text .cell-sub { font-size: 11.5px; }

/* Abschluss-Screen am Handy */
.mob-report-state { font-size: 13px; margin: 6px 0; }
.mob-report-state .err { color: var(--st-busy); }

/* ─────────────────────────────────────────────────────────────────────────
   Termin- und Reisemanagement (Veranstaltungen & Reisen)
   ───────────────────────────────────────────────────────────────────────── */

/* Semantische Aliase auf die vorhandenen Statusfarben – damit die Seiten nicht
   direkt auf --st-* zugreifen müssen. */
:root { --line: var(--border); --warn: var(--st-break); --danger: var(--st-busy); }

/* Selma-Arbeitsliste */
.hint-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.hint-list li { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; line-height: 1.45; }
.hint-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: 0 0 8px; background: var(--st-away); }
.hint-info .hint-dot { background: var(--st-meeting); }
.hint-warnung .hint-dot { background: var(--warn); }
.hint-kritisch .hint-dot { background: var(--danger); }
.hint-kritisch { color: var(--danger); }

/* Aufklappbarer Teilnehmer-Block in der Statustabelle */
.plan-detail-row > td { background: var(--surface-2); padding: 0 !important; }
.plan-panel { padding: 14px 16px 18px; }
.plan-ask {
    display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap;
    background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 8px;
    padding: 10px 12px; margin-bottom: 12px; font-size: 13px;
}

/* Ortssuche (Veranstaltungsort, Hotel, Ausgangsort) */
.loc-search { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.loc-search input { flex: 1 1 260px; }
.loc-hits { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.loc-hit {
    text-align: left; background: var(--surface); border: 1px solid var(--border);
    border-radius: 6px; padding: 7px 10px; cursor: pointer; display: flex;
    justify-content: space-between; gap: 12px; align-items: baseline; color: inherit; font: inherit;
}
.loc-hit:hover { background: var(--surface-hover); border-color: var(--accent); }

/* Bekanntes Hotel aus dem internen Stamm */
.hotel-known {
    margin-top: 10px; padding: 9px 12px; border-radius: 8px;
    background: var(--surface-2); border: 1px solid var(--border-soft); font-size: 12.5px;
}
.hotel-known span { margin-right: 12px; }

/* Reisekette eines Teilnehmers */
.travel-chain { display: flex; flex-direction: column; gap: 6px; }
.travel-leg {
    display: grid; grid-template-columns: 34px 150px 1fr auto; gap: 12px; align-items: center;
    background: var(--surface); border: 1px solid var(--border-soft); border-left: 3px solid var(--st-road);
    border-radius: 7px; padding: 8px 12px;
}
.travel-leg.locked { border-left-color: var(--accent); }
.travel-ico { font-size: 17px; text-align: center; }
.travel-when { font-size: 12.5px; white-space: nowrap; }
.travel-when span { color: var(--text-dim); }
.travel-what b { font-size: 13px; }
.travel-state { display: flex; gap: 8px; align-items: center; white-space: nowrap; }

/* Konflikte in der Kalender-Vorschau */
.conflict-row {
    display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap;
    border: 1px solid var(--warn); border-radius: 8px; padding: 9px 12px; margin-bottom: 8px; font-size: 13px;
}
.conflict-fix { color: var(--warn); font-size: 12.5px; max-width: 380px; }

@media (max-width: 900px) {
    .travel-leg { grid-template-columns: 28px 1fr; }
    .travel-when, .travel-state { grid-column: 2; }
}

/* Einladungsstatus (allgemeiner Termin über das Selma-Postfach) */
.invite-state { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.chk-row { display: flex; align-items: center; gap: 8px; }
.chk-row input[type="checkbox"] { width: auto; margin: 0; }

/* Online-Termin statt Veranstaltungsort */
.online-venue {
    display: flex; align-items: center; gap: 8px; font-size: 13px;
    background: var(--surface-2); border: 1px solid var(--border-soft);
    border-left: 3px solid var(--st-meeting); border-radius: 7px; padding: 8px 12px;
}

/* Hotelsuche: interner Stamm + Google/HERE */
.hotel-hits { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.hotel-hit {
    text-align: left; background: var(--surface); border: 1px solid var(--border);
    border-radius: 7px; padding: 9px 12px; cursor: pointer; color: inherit; font: inherit;
    display: flex; flex-direction: column; gap: 3px;
}
.hotel-hit:hover { background: var(--surface-hover); border-color: var(--accent); }
/* Bekannte Hotels heben sich ab – dort steckt unser Wissen. */
.hotel-hit.known { border-left: 3px solid var(--accent); }
.hh-main { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.hh-rating { color: var(--accent); font-size: 12px; letter-spacing: 1px; }
.hh-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 3px; }
.hh-notes { font-size: 12px; color: var(--text-dim); font-style: italic; margin-top: 2px; }

/* ── Belege zur Veranstaltung: Ablagefläche, Liste, KI-Vorschlag ───────────── */

/* Das Dateifeld liegt unsichtbar über der ganzen Fläche: dadurch nimmt sie sowohl
   fallengelassene Dateien als auch einen Klick entgegen – ohne JavaScript. */
.dropzone {
    position: relative; border: 1.5px dashed var(--border); border-radius: 8px;
    background: var(--surface-2); padding: 14px 16px; transition: border-color .12s, background .12s;
}
.dropzone:hover:not(.disabled):not(.busy) { border-color: var(--accent); background: var(--surface-hover); }
.dropzone.disabled { opacity: .55; }
.dropzone.busy { border-style: solid; border-color: var(--accent); }
.dz-input {
    position: absolute; inset: 0; width: 100%; height: 100%;
    opacity: 0; cursor: pointer; z-index: 2;
}
.dropzone.busy .dz-input { cursor: progress; }
.dz-inner { display: flex; align-items: center; gap: 10px; color: var(--text-dim); pointer-events: none; }
.dz-title { font-size: 13px; font-weight: 650; color: var(--text); }
.dz-sub { font-size: 11.5px; color: var(--text-muted); }

.doc-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.doc-row {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px;
    background: var(--surface); border: 1px solid var(--border-soft); border-radius: 7px;
}
.doc-row .doc-main { flex: 1; min-width: 0; }
.doc-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta { font-size: 11.5px; color: var(--text-muted); }
.doc-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* Vorschlagskarte: nichts davon ist gespeichert, bis freigegeben wird. */
.doc-proposal { border-left: 3px solid var(--accent); }
.dp-field {
    display: flex; gap: 10px; align-items: flex-start; padding: 8px 0;
    border-bottom: 1px solid var(--border-soft);
}
.dp-field:last-child { border-bottom: 0; }
.dp-field input[type="checkbox"] { margin-top: 3px; width: auto; flex-shrink: 0; }
.dp-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); font-weight: 700; }
.dp-value { font-size: 13px; white-space: pre-wrap; }
.dp-hint { font-size: 12.5px; color: var(--warn); }
.dp-source {
    font-size: 11.5px; color: var(--text-muted); font-family: ui-monospace, monospace;
    max-height: 96px; overflow: auto; background: var(--surface-2);
    border: 1px solid var(--border-soft); border-radius: 6px; padding: 6px 8px; margin-top: 6px;
}

/* Soll/Ist des Kalendertextes nebeneinander */
.cal-text-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cal-text-box {
    background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 7px;
    padding: 10px 12px; font-size: 12.5px; white-space: pre-wrap; max-height: 40vh; overflow: auto;
}
.cal-text-box.differs { border-left: 3px solid var(--warn); }
@media (max-width: 780px) { .cal-text-grid { grid-template-columns: 1fr; } }

/* ── KundenAnalyse: Relationship Timeline (Feinspec §4) ──────────────────────
   Waagerechte Zeitachse als CSS-Grid nach dem Muster des Dispo-Gantt (.gantt-grid):
   je Kennzahl eine Zeile, je Periode eine Spalte. Bewusst KEINE Diagrammbibliothek –
   CRM-I hat keine, und eine einzuführen wäre eine plattformweite Entscheidung. */
.ka-timeline { display: grid; gap: 2px 3px; align-items: end; min-width: 620px; }
.ka-tl-label {
    font-size: 12px; color: var(--text-dim); text-align: right; padding-right: 10px;
    align-self: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ka-tl-cell {
    height: 34px; display: flex; align-items: flex-end; justify-content: center;
    background: var(--surface-2); border-radius: var(--radius-sm);
}
.ka-tl-bar {
    width: 100%; min-height: 2px; border-radius: var(--radius-sm);
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
/* Ein Nullwert bleibt sichtbar als flacher Strich – „keine Aktivität" ist eine Aussage,
   eine leere Zelle sähe aus wie „keine Daten". */
.ka-tl-bar[style*="height:0%"] { min-height: 2px; background: var(--border); }
.ka-tl-axis {
    font-size: 11px; color: var(--text-muted); text-align: center; padding-top: 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Touren im Outlook-Kalender (/touren/kalender) ───────────────────────── */
.tc-flags { display: flex; flex-wrap: wrap; gap: 8px; }
.tc-flag {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 600; border: 1px solid var(--border);
}
.tc-flag.on { background: color-mix(in srgb, var(--ok, #2e9e5b) 14%, transparent); border-color: var(--ok, #2e9e5b); }
.tc-flag.off { background: color-mix(in srgb, var(--text-dim) 12%, transparent); color: var(--text-dim); }
.tc-hint { color: var(--text-dim); font-size: 12.5px; margin-top: 10px; line-height: 1.5; }
.tc-muted { color: var(--text-dim); font-size: 13px; }
.tc-summary { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.tc-emp {
    display: flex; gap: 12px; align-items: baseline;
    padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px;
}
.tc-emp span { color: var(--text-dim); font-size: 12.5px; }
.tc-warn {
    margin-top: 12px; padding: 10px 12px; border-radius: 8px;
    border: 1px solid var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent);
    font-size: 12.5px; line-height: 1.5;
}
.tc-warn ul { margin: 6px 0 0 18px; }
.tc-result {
    margin-top: 12px; padding: 10px 12px; border-radius: 8px;
    border: 1px solid var(--border); font-size: 13px;
}
.tc-result ul { margin: 8px 0 0 18px; color: var(--danger); font-size: 12.5px; }
.tc-detail { padding: 10px 4px; }
.tc-act {
    display: inline-block; min-width: 84px; padding: 2px 8px; border-radius: 999px;
    font-size: 11.5px; font-weight: 700; text-align: center;
}
.tc-act.add { background: color-mix(in srgb, var(--ok, #2e9e5b) 18%, transparent); color: var(--ok, #2e9e5b); }
.tc-act.chg { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.tc-act.del { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.tc-act.same { background: color-mix(in srgb, var(--text-dim) 12%, transparent); color: var(--text-dim); }

/* ── KundenAnalyse · Beziehungsnetzwerk ──────────────────────────────────────
   Radiales Netz als eigenes SVG. Bewusst OHNE Graphenbibliothek: CRM-I hat keine
   (nur Leaflet), und für Mittelpunkt-plus-Ring braucht es keine. Erst ein freier
   Gesamtgraph mit kräftebasiertem Layout würde eine rechtfertigen. */
.ka-net-wrap { width: 100%; overflow-x: auto; }
.ka-net { width: 100%; min-width: 560px; max-height: 78vh; display: block; }

.ka-net-edge { stroke: var(--border); fill: none; stroke-linecap: round; }
/* Fünf Stufen statt stufenlos: feiner ist im Bild nicht unterscheidbar und würde
   eine Genauigkeit vortäuschen, die die Zahlen nicht hergeben. */
.ka-net-s1 { stroke-width: 1;   opacity: .35; }
.ka-net-s2 { stroke-width: 2;   opacity: .5; }
.ka-net-s3 { stroke-width: 3.5; opacity: .65; }
.ka-net-s4 { stroke-width: 5;   opacity: .8; stroke: var(--accent-2); }
.ka-net-s5 { stroke-width: 7;   opacity: .95; stroke: var(--accent); }

.ka-net-node circle { fill: var(--surface-2); stroke: var(--border-soft); stroke-width: 2; cursor: pointer; }
.ka-net-node.kunde circle { stroke: var(--accent); }
.ka-net-node.interessent circle { stroke-dasharray: 3 3; }
.ka-net-node:hover circle { fill: var(--surface-3, var(--surface)); stroke-width: 3; }
.ka-net-label { font-size: 13px; fill: var(--text); pointer-events: none; }
.ka-net-delta { font-size: 11px; font-weight: 600; pointer-events: none; }
.ka-net-delta.up { fill: var(--ok, #3fb950); }
.ka-net-delta.down { fill: var(--warn, #d29922); }

.ka-net-symtext { font-size: 12px; fill: var(--text-dim); pointer-events: none; }
.ka-net-sym { pointer-events: auto; }

.ka-net-center circle { fill: var(--accent); stroke: none; }
.ka-net-center text { font-size: 20px; font-weight: 700; fill: #fff; pointer-events: none; }
.ka-net-centerlabel { font-size: 15px; font-weight: 600; fill: var(--text); }

/* ── Beziehungsnetzwerk: Kommunikation links, Netz rechts ─────────────────
   Die Reihenfolge macht das Raster, nicht das Markup. Die Tabelle laeuft
   darunter ueber beide Spalten. Unter 1100px greift die natuerliche
   Reihenfolge wieder, weil zwei Spalten dort nichts mehr bringen. */
.ka-net-split { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 16px; align-items: start; }
.ka-net-split > .ka-col-comm  { grid-column: 1; grid-row: 1; }
.ka-net-split > .ka-col-graph { grid-column: 2; grid-row: 1; }
.ka-net-split > .ka-col-table { grid-column: 1 / -1; grid-row: 2; }
@media (max-width: 1100px) {
  .ka-net-split { grid-template-columns: 1fr; }
  .ka-net-split > .ka-col-comm,
  .ka-net-split > .ka-col-graph,
  .ka-net-split > .ka-col-table { grid-column: 1; grid-row: auto; }
}

/* Haken ueber dem Knoten: filtert die Kommunikationsliste auf diese Gegenseite. */
.ka-net-pick rect { fill: var(--surface-2); stroke: var(--border-soft); stroke-width: 1.5; cursor: pointer; }
.ka-net-pick:hover rect { stroke: var(--accent); stroke-width: 2; }
.ka-net-pick.on rect { fill: var(--accent); stroke: var(--accent); }
.ka-net-picktext { font-size: 12px; font-weight: 700; fill: #ffffff; pointer-events: none; }

/* Gespeicherter Nachrichtentext im aufgeklappten Vorgang. */
.ka-body-text { white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: 4px;
  padding: 8px 10px; margin-top: 6px; font-size: 13px; line-height: 1.45; }

/* ─────────────────────────────────────────────────────────────────────────────
   Rollen- und Rechteverwaltung (/admin/rollen, docs/rollen-rechte-feinspec.md §7)

   Die Matrix hat 53 Zeilen × 4 Optionsfelder. Ohne feste Spaltenbreiten und ohne
   Gruppenzeilen ist sie unbedienbar: die Optionsfelder würden je Zeile wandern.
   ──────────────────────────────────────────────────────────────────────────── */
.rr-matrix th.rr-opt, .rr-matrix td.rr-opt { width: 74px; text-align: center; }
.rr-matrix td.rr-opt input[type=radio] { cursor: pointer; }
.rr-matrix tr.rr-group > td { background: var(--surface-2); border-top: 1px solid var(--border); }
.rr-matrix tr.rr-group .btn { margin-right: 4px; }
.rr-matrix code { font-size: 11px; color: var(--text-dim); }
.rr-matrix tbody tr:hover > td { background: color-mix(in srgb, var(--accent) 6%, transparent); }

/* ── Stand der Einspielung in der Kopfzeile ────────────────────────────────
   Leise: sichtbar ist nur ein Datum in gedaempfter Farbe. Was drinsteckt, zeigt
   der Aufklapper beim Darueberfahren – rein ueber CSS, damit das Darueberfahren
   keine Runde zum Server kostet. Ein Klick fuehrt ins vollstaendige Protokoll. */
.build-info { position: relative; display: flex; }
.build-chip {
    display: flex; align-items: center; gap: 5px;
    padding: 4px 7px; border: 0; border-radius: var(--radius-sm);
    background: none; color: var(--text-muted);
    font-family: var(--font); font-size: 12px;
    font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer;
}
.build-chip:hover { color: var(--text-dim); background: var(--surface-2); }
.build-pop {
    display: none;
    position: absolute; top: calc(100% + 6px); right: 0;
    width: 300px; z-index: 70; cursor: default;
    padding: 10px 12px 11px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
    animation: dropIn 0.16s ease;
}
.build-info:hover .build-pop { display: block; }
.build-pop-head {
    font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase;
    color: var(--text-muted);
}
.build-pop-title { font-size: 13px; font-weight: 600; margin: 5px 0 7px; }
.build-pop-list {
    margin: 0; padding-left: 16px;
    font-size: 12.5px; line-height: 1.5; color: var(--text-dim);
}
.build-pop-list li { margin-bottom: 4px; }
.build-pop-more { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.build-pop-foot {
    margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--border);
    font-size: 11.5px; color: var(--brand-teal);
}
@media (max-width: 760px) { .build-info { display: none; } }

/* ═══ Außendienst live (docs/aussendienst-live-feinspec.md §8) ═══════════════════════════════ */
.adl-live-punkt { color: var(--st-available); font-weight: 700; font-size: 12.5px; animation: adl-blink 2s infinite; }
@keyframes adl-blink { 50% { opacity: .45; } }
.adl-ortshinweis { font-size: 12.5px; color: var(--text-dim); margin: -6px 0 10px; display: flex; gap: 6px; align-items: center; }

.adl-raster { display: grid; grid-template-columns: 300px minmax(0, 1fr) 380px; gap: 12px; align-items: start; }
@media (max-width: 1400px) { .adl-raster { grid-template-columns: 270px minmax(0, 1fr) 340px; } }
@media (max-width: 1100px) { .adl-raster { grid-template-columns: 1fr; } .adl-karte { height: 420px !important; } }
.adl-raster > .card { padding: 10px; margin: 0; }

.adl-liste { max-height: calc(100vh - var(--topbar-h) - 150px); overflow: auto; }
.adl-filter { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.adl-filter input[type=search], .adl-filter select { width: 100%; }
.adl-schalter { font-size: 12.5px; color: var(--text-dim); display: flex; gap: 6px; align-items: center; }

.adl-person-zeile {
    display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; font: inherit; color: var(--text);
    background: none; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 8px; cursor: pointer;
}
.adl-person-zeile:hover { background: var(--surface-hover); }
.adl-person-zeile.an { border-color: var(--accent); background: var(--accent-soft); }
.adl-person-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.adl-person-name { font-weight: 600; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.adl-zahl { white-space: nowrap; }
.adl-badge-neu { background: var(--accent); color: #fff; }
.adl-fortschritt { display: block; height: 4px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 3px; }
.adl-fortschritt span { display: block; height: 100%; border-radius: 99px; }

.adl-avatar {
    flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: var(--f); color: #fff; font-weight: 800; font-size: 12.5px; position: relative;
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px color-mix(in srgb, var(--f) 35%, transparent);
}
.adl-avatar.gross { width: 44px; height: 44px; font-size: 15px; }
.adl-avatar.st-keine-tour, .adl-avatar.st-fertig { opacity: .6; }
.adl-avatar.st-vor-ort::after {
    content: ""; position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 50%;
    background: var(--st-available); border: 2px solid var(--surface);
}

.adl-kartenfeld { position: relative; padding: 0 !important; overflow: hidden; }
.adl-karte { height: calc(100vh - var(--topbar-h) - 150px); min-height: 420px; width: 100%; border-radius: var(--radius); }
.adl-alles { position: absolute; left: 50px; bottom: 12px; z-index: 500; background: var(--surface); }
.adl-feed {
    position: absolute; top: 10px; right: 10px; z-index: 500; width: 320px; max-width: calc(100% - 20px);
    background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 8px 10px; box-shadow: var(--shadow-sm); font-size: 12.5px;
    max-height: 46%; overflow: auto;
}
.adl-feed-kopf { font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-dim); margin-bottom: 4px; }
.adl-feed-zeile { display: flex; gap: 8px; padding: 4px 0; border-top: 1px solid var(--border-soft); animation: adl-ein .5s ease-out; }
.adl-feed-zeile:first-of-type { border-top: 0; }
.adl-feed-zeile.a-kontakt, .adl-feed-zeile.a-kontakt-erkannt { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.adl-feed-zeile.a-nachricht-rein { background: color-mix(in srgb, var(--st-meeting) 10%, transparent); }
.adl-feed-zeit { color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
@keyframes adl-ein { from { transform: translateX(14px); opacity: 0; } to { transform: none; opacity: 1; } }

.adl-detail { max-height: calc(100vh - var(--topbar-h) - 150px); overflow: auto; }
.adl-detail-kopf { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.adl-reiter { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.adl-reiter button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 6px 10px; font: inherit; font-size: 13px; color: var(--text-dim); cursor: pointer; }
.adl-reiter button.an { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.adl-tour { margin-bottom: 10px; }
.adl-tour-kopf { margin-bottom: 4px; }
.adl-stopp-zeile { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-top: 1px solid var(--border-soft); }
.adl-stopp-zeile.naechster { background: var(--accent-soft); border-radius: var(--radius-sm); }
.adl-stopp-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.adl-stopp-nr { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--f); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.adl-stopp-zeile.z-durchgefuehrt .adl-stopp-nr { background: var(--st-available); border-color: var(--st-available); color: #fff; }
.adl-stopp-zeile.z-angefahren .adl-stopp-nr { background: var(--accent); border-color: var(--accent); color: #fff; }
.adl-stopp-zeile.z-entfallen .adl-stopp-nr, .adl-stopp-zeile.z-verschoben .adl-stopp-nr { background: var(--surface-2); border-color: var(--text-muted); color: var(--text-muted); text-decoration: line-through; }

.adl-selma { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px; margin-top: 6px; background: var(--surface-2); }
.adl-selma-kopf { display: flex; gap: 6px; align-items: center; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.adl-selma-kopf .btn { margin-left: auto; }
.adl-selma-text { font-size: 13px; margin: 6px 0; white-space: pre-line; }
.adl-fakten { margin: 4px 0 0 16px; font-size: 12.5px; color: var(--text-dim); }

.adl-verlauf-zeile { display: flex; gap: 8px; padding: 5px 0; border-top: 1px solid var(--border-soft); font-size: 13px; }
.adl-verlauf-zeile.a-kontakt, .adl-verlauf-zeile.a-bericht { background: color-mix(in srgb, var(--accent) 8%, transparent); }

.adl-faden { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.adl-nachr { max-width: 90%; padding: 7px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); font-size: 13px; }
.adl-nachr.raus { align-self: flex-end; background: var(--accent-soft); }
.adl-nachr.rein { align-self: flex-start; background: var(--surface-2); }
.adl-nachr-text { white-space: pre-wrap; word-wrap: break-word; margin: 2px 0; }
.adl-nachr-status { font-size: 11.5px; }
.adl-schreiben { display: flex; flex-direction: column; gap: 6px; }
.adl-schreiben textarea { width: 100%; resize: vertical; }
.adl-chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.adl-chip { border: 1px solid var(--border); background: var(--surface); color: var(--text-dim); border-radius: 99px; padding: 3px 9px; font-size: 12px; cursor: pointer; }
.adl-chip.an { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.adl-vorschlaege { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.adl-vorschlag { text-align: left; font: inherit; font-size: 13px; color: var(--text); background: var(--surface-2); border: 1px dashed var(--accent); border-radius: var(--radius-sm); padding: 6px 8px; cursor: pointer; }

/* Kartenmarkierungen (ad-live-map.js) */
.adl-stopp-wrap, .adl-person-wrap, .adl-welle-wrap { background: none; border: 0; }
.adl-stopp {
    width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--f); background: #fff; color: #1b2333;
    display: flex; align-items: center; justify-content: center; font: 700 11px/1 var(--font); box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.adl-stopp.z-durchgefuehrt { background: #22c55e; border-color: #15803d; color: #fff; }
.adl-stopp.z-angefahren { background: #f5811f; border-color: #c2410c; color: #fff; }
.adl-stopp.z-entfallen, .adl-stopp.z-verschoben { background: #e2e8f0; border-color: #94a3b8; color: #64748b; text-decoration: line-through; }
.adl-stopp.naechster { box-shadow: 0 0 0 4px color-mix(in srgb, var(--f) 35%, transparent), 0 1px 4px rgba(0,0,0,.3); }
.adl-stopp.blass, .adl-person.blass { opacity: .35; }
.adl-person {
    width: 36px; height: 36px; border-radius: 50% 50% 50% 4px; background: var(--f); color: #fff; position: relative;
    display: flex; align-items: center; justify-content: center; font: 800 12.5px/1 var(--font);
    border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); cursor: pointer;
}
.adl-person.st-vor-ort::before {
    content: ""; position: absolute; inset: -6px; border-radius: inherit; border: 2px solid var(--f);
    animation: adl-puls 1.8s ease-out infinite;
}
.adl-person.gewaehlt { transform: scale(1.18); box-shadow: 0 0 0 3px var(--f), 0 2px 10px rgba(0,0,0,.4); }
.adl-person.huepf { animation: adl-huepf .7s ease; }
.adl-person-zahl {
    position: absolute; top: -7px; right: -7px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px;
    background: #e42b22; color: #fff; font: 800 10px/17px var(--font); font-style: normal; text-align: center;
}
@keyframes adl-puls { from { transform: scale(.9); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }
@keyframes adl-huepf { 0%, 100% { transform: translateY(0); } 30% { transform: translateY(-12px); } 60% { transform: translateY(-4px); } }
.adl-welle { position: relative; width: 80px; height: 80px; }
.adl-welle span {
    position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--f);
    animation: adl-welle 1.6s ease-out 3; opacity: 0;
}
.adl-welle span:nth-child(2) { animation-delay: .5s; }
.adl-welle b {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 22px;
    animation: adl-huepf .8s ease 2; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4));
}
@keyframes adl-welle { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
.leaflet-tooltip.adl-hinweis { font-weight: 700; background: #1b2333; color: #fff; border: 0; box-shadow: 0 2px 10px rgba(0,0,0,.35); }
.leaflet-tooltip.adl-hinweis::before { border-top-color: #1b2333; }
.adl-person.ort-plan { border-style: dashed; }

/* ═══ BI-I-Ergänzungen ═══════════════════════════════════════════════════ */
.test-banner { background: var(--st-busy); color: #fff; font-weight: 700; padding: 6px 12px; border-radius: var(--radius-sm); margin-bottom: 12px; letter-spacing: .4px; }
.abschnitt { margin-bottom: 16px; }
.abschnitt h3.unter { margin-top: 14px; }
.form-grid.drei { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .voll, label.voll { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-dim); font-weight: 600; margin-top: 8px; }
.form-grid .check-row { flex-direction: row; align-items: center; }
.app-main input, .app-main select, .app-main textarea {
    background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 7px 9px; font: inherit; font-size: 13px;
}
.app-main input:disabled, .app-main select:disabled, .app-main textarea:disabled { opacity: .7; cursor: not-allowed; }
.app-main input[type="checkbox"] { width: 16px; height: 16px; padding: 0; accent-color: var(--accent); }
.data-table.eingabe tbody tr { cursor: default; }
.data-table.eingabe td { padding: 6px 8px; vertical-align: top; }
.data-table.eingabe input.breit, input.breit { width: 100%; min-width: 180px; }
input.zahl { width: 110px; text-align: right; font-variant-numeric: tabular-nums; }
input.kurz, select.kurz { width: 80px; }
.data-table.kompakt td, .data-table.kompakt th { padding: 6px 10px; }
.data-table tr.gewaehlt td { background: var(--accent-soft); }
.data-table tr.dringend td { background: color-mix(in srgb, var(--sev-high) 10%, transparent); }
.data-table tr.vorbei td { color: var(--text-muted); }
.hinweis { font-size: 12px; color: var(--st-break); margin-top: 3px; }
.meldung { padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 12px; font-size: 13px; }
.meldung.fehler { background: color-mix(in srgb, var(--st-busy) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--st-busy) 45%, var(--border)); }
.meldung.erfolg { background: color-mix(in srgb, var(--st-available) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--st-available) 45%, var(--border)); }
.aktionen { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.zeile { display: flex; gap: 8px; align-items: center; }
.detail-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; align-items: start; margin-bottom: 8px; }
dl.info { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 13px; margin: 12px 0 0; }
dl.info dt { color: var(--text-dim); }
dl.info dd { margin: 0; }
ul.liste { margin: 6px 0 0; padding-left: 18px; line-height: 1.7; }
.unsichtbar { display: none; }
.filter-bar .field { margin-bottom: 0; }
.hinweis-seite { display: grid; place-items: center; min-height: 100vh; }
.hinweis-karte { max-width: 560px; }
.hinweis-karte h1 { font-size: 20px; margin-bottom: 12px; }
@media (max-width: 1100px) { .detail-grid, .form-grid.drei { grid-template-columns: 1fr; } }
.einrichtung-seite { min-height: 100vh; padding: 28px 16px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.einrichtung-kopf { width: 100%; max-width: 980px; }
.einrichtung-karte { width: 100%; max-width: 980px; }
.einrichtung-karte h1 { font-size: 21px; margin-bottom: 6px; }

/* ── Odoo-Überwachung (Inkrement 1b, §20) ─────────────────────────────── */
.meldung.warnung { background: color-mix(in srgb, var(--st-break) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--st-break) 45%, var(--border)); }
.data-table.nur-lesen tbody tr { cursor: default; }
.data-table td.rechts, .data-table th.rechts { text-align: right; white-space: nowrap; }
.data-table td .badge { margin: 1px 4px 1px 0; font-size: 11px; }
.tabbar.umbruch { flex-wrap: wrap; }
.tabbar .tab .zahl { margin-left: 6px; font-weight: 500; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.alter-leiste { display: flex; gap: 6px; flex-wrap: wrap; margin: -10px 0 16px; }
.kpi .kpi-zusatz { color: var(--text-muted); font-size: 11.5px; }
