/* ==========================================================================
   Backoffice – Stylesheet (HTML5 / CSS3, ohne Framework)
   Farben und Abstände werden zentral über CSS-Variablen gesteuert.
   ========================================================================== */

:root {
    --primary: #5179A9;
    --primary-dark: #3b5a80;
    --primary-soft: #E8EFF7;

    --bg: #F8FAFC;
    --surface: #FFFFFF;
    --surface-alt: #F1F5F9;
    --text: #0F172A;
    --text-muted: #64748B;
    --border: #E2E8F0;

    --success: #15803D;
    --success-soft: #DCFCE7;
    --warning: #A16207;
    --warning-soft: #FEF9C3;
    --danger: #B91C1C;
    --danger-soft: #FEE2E2;
    --info: #1D4ED8;
    --info-soft: #DBEAFE;

    --sidebar-bg: #0F172A;
    --sidebar-text: #CBD5E1;
    --sidebar-active: #1E293B;

    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 12px rgba(15, 23, 42, .05);
    --shadow-lg: 0 20px 40px -8px rgba(15, 23, 42, .25);
    --sidebar-width: 250px;

    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary: #7BA0CC;
        --primary-dark: #9DB9DB;
        --primary-soft: #1E2A3A;
        --bg: #0B1120;
        --surface: #111827;
        --surface-alt: #1A2232;
        --text: #E2E8F0;
        --text-muted: #94A3B8;
        --border: #263043;
        --success: #4ADE80;
        --success-soft: #14321F;
        --warning: #FACC15;
        --warning-soft: #3A3210;
        --danger: #F87171;
        --danger-soft: #3B1616;
        --info: #93C5FD;
        --info-soft: #172A4A;
        --sidebar-bg: #070B14;
        --sidebar-active: #172033;
        color-scheme: dark;
    }
}

/* --- Grundlagen ----------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}

a { color: var(--primary); }
h1, h2, h3 { line-height: 1.25; margin: 0; }

.icon { width: 18px; height: 18px; flex-shrink: 0; }
.icon-sm { width: 14px; height: 14px; }
.text-muted { color: var(--text-muted); }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* --- Layout --------------------------------------------------------------- */

.app { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    z-index: 50;
    transition: transform .2s ease;
}

.sidebar__brand {
    display: flex; align-items: center; gap: 10px;
    padding: 18px 20px;
    font-weight: 700; color: #fff;
}

.sidebar__logo {
    display: inline-grid; place-items: center;
    width: 32px; height: 32px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff; font-weight: 700;
}

.sidebar__nav { flex: 1; overflow-y: auto; padding: 8px 12px; }

.sidebar__group {
    margin: 18px 10px 6px;
    font-size: .72rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .08em;
    color: #64748B;
}

.sidebar__link {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-weight: 500;
}
.sidebar__link:hover { background: var(--sidebar-active); color: #fff; }
.sidebar__link.is-active { background: var(--primary); color: #fff; }

.sidebar__badge {
    margin-left: auto;
    min-width: 22px; padding: 1px 7px;
    border-radius: 999px;
    background: #EF4444; color: #fff;
    font-size: .75rem; font-weight: 600; text-align: center;
}

.sidebar__footer {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}
.sidebar__footer .btn-ghost { color: var(--sidebar-text); }
.sidebar__footer .btn-ghost:hover { background: var(--sidebar-active); color: #fff; }

.sidebar__user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sidebar__user strong { display: block; color: #fff; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user small { display: block; color: #94A3B8; font-size: .78rem; }

.avatar {
    display: inline-grid; place-items: center;
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--primary-dark); color: #fff; font-weight: 600;
    flex-shrink: 0;
}

.sidebar-backdrop { display: none; }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-width); display: flex; flex-direction: column; }
.app--guest .main { margin-left: 0; }

.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 12px;
    padding: 14px 28px;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.topbar__title { font-size: 1.35rem; }
.topbar__toggle { display: none; }

.content { padding: 24px 28px 40px; width: 100%; max-width: 1400px; }

/* --- Karten --------------------------------------------------------------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card + .card, .grid + .card, .card + .grid { margin-top: 20px; }

.card__header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.card__header h2 { font-size: 1rem; }
.card__body { padding: 20px; }

.grid { display: grid; gap: 20px; }
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }

.stat { padding: 18px 20px; display: flex; align-items: center; gap: 16px; text-decoration: none; color: inherit; }
.stat__icon {
    display: grid; place-items: center;
    width: 44px; height: 44px; border-radius: 10px;
    background: var(--primary-soft); color: var(--primary);
}
.stat__value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.stat__label { color: var(--text-muted); font-size: .88rem; }
a.stat:hover { border-color: var(--primary); }

/* --- Buttons -------------------------------------------------------------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    font: inherit; font-size: .92rem; font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s;
}
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-alt); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-alt); color: var(--text); }
.btn-danger-ghost:hover { background: var(--danger-soft); color: var(--danger); }
.btn-icon { padding: 7px; }
.btn-block { width: 100%; }

/* --- Werkzeugleiste & Suche ----------------------------------------------- */

.toolbar {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.toolbar__search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1; }
.toolbar__actions { display: flex; gap: 8px; }

.search-input { position: relative; flex: 0 1 300px; min-width: 200px; }
.search-input .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-input input { padding-left: 36px; }

input, select, textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font: inherit; font-size: .93rem;
}
.toolbar select { width: auto; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input[readonly], input:disabled, select:disabled, textarea:disabled { background: var(--surface-alt); color: var(--text-muted); }
[aria-invalid="true"] { border-color: var(--danger); }
textarea { resize: vertical; min-height: 90px; }

/* --- Tabelle -------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; text-align: left; }
.table th {
    padding: 12px 18px;
    background: var(--surface-alt);
    color: var(--text-muted);
    font-size: .76rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .05em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td { padding: 13px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr[data-modal-row] { cursor: pointer; transition: background .12s; }
.table tbody tr[data-modal-row]:hover, .table tbody tr[data-modal-row]:focus-visible { background: var(--primary-soft); outline: none; }
.table__empty td { text-align: center; color: var(--text-muted); padding: 40px 18px; }
.table .nowrap { white-space: nowrap; }

.sort { display: inline-flex; align-items: center; gap: 4px; color: inherit; text-decoration: none; }
.sort .icon { opacity: .4; }
.sort.is-active { color: var(--text); }
.sort.is-active .icon, .sort:hover .icon { opacity: 1; }

.col-actions { width: 1%; white-space: nowrap; text-align: right; }
.row-actions { display: flex; justify-content: flex-end; gap: 2px; }

.cell-sub { display: block; color: var(--text-muted); font-size: .85rem; }

/* --- Badges --------------------------------------------------------------- */

.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--surface-alt);
    color: var(--text-muted);
    font-size: .78rem; font-weight: 600;
    white-space: nowrap;
}
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger  { background: var(--danger-soft);  color: var(--danger); }
.badge-info    { background: var(--info-soft);    color: var(--info); }

/* --- Blättern ------------------------------------------------------------- */

.pagination {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 20px;
    background: var(--surface-alt);
}
.pagination__info { color: var(--text-muted); font-size: .9rem; }
.pagination__links { display: flex; flex-wrap: wrap; gap: 4px; }
.pagination__per { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--text-muted); }
.pagination__per select { width: auto; padding: 5px 8px; }

.page-link {
    min-width: 34px; padding: 5px 10px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text);
    text-align: center; text-decoration: none; font-size: .88rem;
}
.page-link:hover { border-color: var(--primary); }
.page-link.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-gap { padding: 5px 4px; color: var(--text-muted); }

/* --- Modaler Dialog (HTML5 <dialog>) -------------------------------------- */

.modal {
    width: min(720px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    padding: 0;
    border: none;
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-lg);
}
.modal::backdrop { background: rgba(15, 23, 42, .55); backdrop-filter: blur(2px); }
.modal[open] { animation: modal-in .18s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }

.modal__inner, .modal__inner > form { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.modal__header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}
.modal__header h2 { font-size: 1.15rem; }
.modal__body { padding: 20px 24px; overflow-y: auto; }
.modal__footer {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    background: var(--surface-alt);
}
.modal__loading { padding: 48px; text-align: center; color: var(--text-muted); }
.spacer { flex: 1; }

/* --- Formulare ------------------------------------------------------------ */

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field--wide { grid-column: 1 / -1; }
.form-field > label { font-size: .85rem; font-weight: 600; }
.form-field .req { color: var(--danger); }
.form-help { color: var(--text-muted); font-size: .8rem; }
.form-error { color: var(--danger); font-size: .82rem; min-height: 0; }
.form-error:empty { display: none; }
.form .form-field + .form-field { margin-top: 0; }
.form > .form-field { margin-bottom: 14px; }

.checkbox { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--primary); }

/* --- Detailansicht -------------------------------------------------------- */

.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.detail-item { padding: 10px 14px; border-radius: 8px; background: var(--surface-alt); min-width: 0; }
.detail-item--wide { grid-column: 1 / -1; }
.detail-label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.detail-value { margin-top: 2px; overflow-wrap: anywhere; }

.text-block, .message-box {
    white-space: pre-wrap;
    line-height: 1.55;
}
.message-box {
    padding: 14px 16px;
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    background: var(--surface-alt);
}

.section-title { margin: 20px 0 8px; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.timeline li { padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; }
.timeline__meta { font-size: .82rem; color: var(--text-muted); margin-bottom: 4px; }

.simple-list { list-style: none; margin: 0; padding: 0; }
.simple-list li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--border); }
.simple-list li:last-child { border-bottom: none; }

pre.code {
    margin: 0; padding: 12px 14px;
    border-radius: 8px;
    background: var(--surface-alt);
    font-size: .82rem;
    white-space: pre-wrap; overflow-wrap: anywhere;
}

/* --- Analyse: Zeitraum, Reiter, Filter-Chips ------------------------------ */

.period-bar { margin-bottom: 20px; }
.period-bar + .card { margin-top: 0; }

.tabs { display: flex; gap: 4px; padding: 0 16px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs__item {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 14px;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    color: var(--text-muted); text-decoration: none; font-weight: 500; white-space: nowrap;
}
.tabs__item:hover { color: var(--text); }
.tabs__item.is-active { color: var(--primary); border-bottom-color: var(--primary); }

.period-bar__form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 20px; }
.period-bar__form input[type="date"], .period-bar__form select { width: auto; }
.presets { display: flex; flex-wrap: wrap; gap: 4px; margin-right: 8px; }

.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 20px 14px; font-size: .88rem; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: 999px;
    background: var(--primary-soft); color: var(--primary);
    text-decoration: none;
}
.chip:hover { background: var(--danger-soft); color: var(--danger); }

/* --- Analyse: Säulendiagramm ---------------------------------------------- */

.bar-chart { --plot-h: 180px; position: relative; padding-left: 44px; }
.bar-chart__grid { position: absolute; left: 0; right: 0; top: 0; height: var(--plot-h); pointer-events: none; }
.bar-chart__grid span {
    position: absolute; left: 0; right: 0;
    border-top: 1px solid var(--border);
    font-size: .7rem; line-height: 0; color: var(--text-muted);
}
.bar-chart__grid span::before { content: ''; }
.bar-chart__plot { position: relative; display: flex; gap: 2px; }
.bar-chart__col { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: stretch; outline: none; }
.bar-chart__track { display: flex; align-items: flex-end; height: var(--plot-h); }
.bar-chart__bar {
    display: block; width: 100%; max-width: 40px; margin: 0 auto;
    background: var(--primary);
    border-radius: 4px 4px 0 0;
    transition: background .12s;
}
.bar-chart__col:hover .bar-chart__bar, .bar-chart__col:focus-visible .bar-chart__bar { background: var(--primary-dark); }
.bar-chart__label {
    margin-top: 6px;
    font-size: .7rem; color: var(--text-muted); text-align: center;
    white-space: nowrap; overflow: visible;
}
.bar-chart__label.is-hidden { visibility: hidden; }
.bar-chart__col::after {
    content: attr(data-tip);
    position: absolute; bottom: calc(100% + 6px); left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px; border-radius: 6px;
    background: var(--text); color: var(--surface);
    font-size: .78rem; white-space: nowrap;
    box-shadow: var(--shadow-lg);
    opacity: 0; pointer-events: none; transition: opacity .1s;
    z-index: 5;
}
.bar-chart__col:hover::after, .bar-chart__col:focus-visible::after { opacity: 1; }
.bar-chart__col:first-child::after { left: 0; transform: none; }
.bar-chart__col:last-child::after { left: auto; right: 0; transform: none; }

/* --- Analyse: Top-Listen -------------------------------------------------- */

.toplist { list-style: none; margin: 0; padding: 8px 12px 12px; display: grid; gap: 4px; }
.toplist a {
    position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 7px 10px; border-radius: 6px;
    color: var(--text); text-decoration: none; overflow: hidden;
}
.toplist a:hover { background: var(--surface-alt); }
.toplist__bar {
    position: absolute; left: 0; top: 0; bottom: 0;
    background: var(--primary-soft);
    border-radius: 6px;
    z-index: 0;
}
.toplist__label { position: relative; z-index: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toplist__value { position: relative; z-index: 1; white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }
.toplist__value small { margin-left: 6px; font-weight: 400; color: var(--text-muted); }

/* --- Meldungen ------------------------------------------------------------ */

.alert { padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; font-size: .92rem; }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-error   { background: var(--danger-soft);  color: var(--danger); }
.alert-warning { background: var(--warning-soft); color: var(--warning); }
.alert-info    { background: var(--info-soft);    color: var(--info); }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 2000; display: grid; gap: 8px; }
.toast {
    padding: 12px 16px; border-radius: 8px;
    background: var(--text); color: var(--surface);
    box-shadow: var(--shadow-lg);
    font-size: .92rem;
    animation: modal-in .2s ease-out;
    transition: opacity .4s;
}
.toast-error { background: var(--danger); color: #fff; }
.toast-success { background: var(--success); color: #fff; }
.toast.is-hiding { opacity: 0; }

.empty-state { padding: 48px 24px; text-align: center; }
.empty-state__code { font-size: 3rem; font-weight: 700; color: var(--primary); }

/* --- Anmeldung ------------------------------------------------------------ */

.auth-page { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.auth-card {
    width: 100%; max-width: 400px;
    padding: 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 1.4rem; margin-bottom: 8px; }
.auth-card .form { margin-top: 20px; }
.auth-card__brand { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 24px; }

/* --- Responsive ----------------------------------------------------------- */

@media (max-width: 960px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar-open .sidebar { transform: none; }
    .sidebar-open .sidebar-backdrop {
        display: block; position: fixed; inset: 0; z-index: 40;
        background: rgba(15, 23, 42, .5);
    }
    .main { margin-left: 0; }
    .topbar { padding: 12px 16px; }
    .topbar__toggle { display: inline-flex; }
    .content { padding: 16px; }
}

@media (max-width: 640px) {
    .form-grid, .detail-grid { grid-template-columns: 1fr; }
    .toolbar__search, .search-input { flex: 1 1 100%; }
    .toolbar select { flex: 1; }

    /* Tabelle als Kartenliste */
    .table thead { display: none; }
    .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
    .table tr { padding: 10px 4px; border-bottom: 1px solid var(--border); }
    .table td { padding: 4px 14px; border: none; display: flex; gap: 12px; }
    .table td::before {
        content: attr(data-label);
        flex: 0 0 38%;
        font-size: .75rem; font-weight: 600; text-transform: uppercase; color: var(--text-muted);
    }
    .table td.col-actions { width: 100%; text-align: left; }
    .table td.col-actions::before { content: none; }
    .table__empty td::before { content: none; }
    .row-actions { justify-content: flex-start; }

    .modal { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
    .modal__inner, .modal__inner > form { max-height: 100dvh; height: 100%; }
    .modal__body { flex: 1; }
}

@media print {
    .sidebar, .topbar, .toolbar, .pagination, .col-actions, .toasts { display: none !important; }
    .main { margin: 0; }
    .card { box-shadow: none; border: none; }
}

/* ==========================================================================
   KBR-Fuchs: Mandantenwahl, Formular-Abschnitte, Kennzeichen
   ========================================================================== */
.sidebar__mandant {
    margin: 0 12px 6px; padding: 10px 12px;
    background: var(--sidebar-active); border-radius: var(--radius-sm);
    color: #fff; display: flex; flex-direction: column; gap: 2px;
}
.sidebar__mandant small { color: var(--sidebar-text); font-size: .75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__mandant select {
    width: 100%; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.2);
    border-radius: var(--radius-sm); padding: 4px 6px; font: inherit; font-weight: 600;
}
.sidebar__mandant select option { color: var(--text); background: var(--surface); }

.mandant-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.mandant-list form { margin: 0; }
.mandant-list__item {
    width: 100%; text-align: left; cursor: pointer; font: inherit; color: var(--text);
    display: flex; flex-direction: column; gap: 2px;
    padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface);
}
.mandant-list__item:hover, .mandant-list__item.is-active { border-color: var(--primary); background: var(--primary-soft); }

.form-heading {
    grid-column: 1 / -1; margin: 10px 0 -4px; padding-top: 10px;
    border-top: 1px solid var(--border);
    font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted);
}
.form-heading:first-child { border-top: none; margin-top: 0; padding-top: 0; }

.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .85em; }

.stat__value { white-space: nowrap; }

/* Jahreswahl (Journal, EÜR) */
.toolbar .chips { padding: 0; }
.toolbar .chip { text-decoration: none; }
.toolbar .chip:hover { background: var(--primary-soft); color: var(--primary-dark); }
.toolbar .chip.is-active { background: var(--primary); color: #fff; font-weight: 600; }
