/* ==========================================================================
   Beleg-Prüfung Quellberg – Design-System
   Ruhig und neutral; Farbe nur für Status (grün = freigeben, bernstein = hinschauen).
   ========================================================================== */
:root {
  --bg: #f5f6f8; --surface: #ffffff; --surface-2: #f9fafb; --surface-3: #f2f4f7;
  --border: #e4e7ec; --border-strong: #d0d5dd;
  --text: #101828; --text-2: #475467; --text-3: #98a2b3;
  --primary: #2f54eb; --primary-hover: #2443cc; --primary-50: #eef2ff; --primary-100: #e0e7ff;
  --ok: #067647; --ok-50: #ecfdf3; --ok-200: #abefc6;
  --warn: #b54708; --warn-50: #fffaeb; --warn-200: #fedf89;
  --bad: #c01048; --bad-50: #fff1f3; --bad-200: #fecdd6;
  --info: #5925dc; --info-50: #f4f3ff;
  --side: #0c111d; --side-2: #161b26; --side-text: #94969c; --side-active: #ffffff;
  --radius: 10px; --radius-lg: 14px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 20px 24px -4px rgba(16, 24, 40, .10), 0 8px 8px -4px rgba(16, 24, 40, .04);
  --sidebar: 252px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; }
.num, td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.small { font-size: 12.5px; }
.icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-lg { width: 20px; height: 20px; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- App-Rahmen */
.app { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: var(--side); color: var(--side-text);
           display: flex; flex-direction: column; padding: 20px 14px; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; color: #fff; text-decoration: none !important; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-weight: 700;
              background: linear-gradient(135deg, #4f6ef7, #2f54eb); color: #fff; box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset; }
.brand-name { font-weight: 650; font-size: 15px; line-height: 1.2; }
.brand-sub { font-size: 12px; color: var(--side-text); }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #5d6270; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--side-text);
         font-weight: 500; text-decoration: none; margin-bottom: 2px; }
.nav a:hover { background: var(--side-2); color: #e4e5e7; }
.nav a.active { background: var(--side-2); color: var(--side-active); }
.nav a.active .icon { color: #8ea2ff; }
.nav .badge { margin-left: auto; background: var(--warn); color: #fff; border-radius: 10px; font-size: 11px; font-weight: 600; padding: 1px 7px; }
.side-foot { margin-top: auto; background: var(--side-2); border-radius: 10px; padding: 12px; font-size: 12px; }
.side-foot .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.side-foot .wert { color: #e4e5e7; font-weight: 500; }
.side-foot .bar { margin-top: 8px; background: #2a303c; }
.side-foot a { color: inherit; text-decoration: none; display: block; }
.main { margin-left: var(--sidebar); min-width: 0; }
.page { padding: 28px 36px 56px; max-width: 1480px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-header h1 { font-size: 24px; font-weight: 650; }
.page-header p { margin: 4px 0 0; color: var(--text-2); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------- Buttons & Formulare */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px;
       border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
       font: 600 13.5px var(--font); cursor: pointer; box-shadow: var(--shadow-xs); text-decoration: none !important; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--primary-100); outline-offset: 1px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { filter: brightness(1.08); background: var(--ok); }
.btn-bad { color: var(--bad); border-color: var(--bad-200); }
.btn-bad:hover { background: var(--bad-50); }
.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn-icon { width: 34px; padding: 0; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.loading { pointer-events: none; opacity: .7; }

label.feld { display: block; margin-bottom: 16px; }
label.feld > span { display: block; font-weight: 550; font-size: 13.5px; margin-bottom: 6px; }
label.feld small, .hilfe { display: block; color: var(--text-3); font-size: 12.5px; margin-top: 6px; }
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 8px;
  font: 14px var(--font); color: var(--text); background: var(--surface); box-shadow: var(--shadow-xs); }
textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--text-3); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }

/* Schalter */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.switch:last-child { border-bottom: 0; }
.switch .t { font-weight: 550; }
.switch .d { color: var(--text-3); font-size: 12.5px; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 11px; background: var(--border-strong); position: relative; flex: none; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s; }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(16px); }

/* Regler */
.regler { padding: 10px 0; }
.regler .kopf { display: flex; justify-content: space-between; font-weight: 550; font-size: 13.5px; }
.regler output { font-variant-numeric: tabular-nums; color: var(--primary); font-weight: 600; }
.regler input[type=range] { width: 100%; accent-color: var(--primary); margin: 8px 0 0; }

/* ---------------------------------------------------------------- Karten & Kennzahlen */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.card + .card { 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: 16px; font-weight: 600; }
.card-header p { margin: 2px 0 0; color: var(--text-2); font-size: 13px; }
.card-body { padding: 20px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
             display: flex; justify-content: flex-end; gap: 8px; align-items: center; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow-xs); }
.kpi-label { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 550; font-size: 13px; }
.kpi-label .dot { width: 8px; height: 8px; border-radius: 50%; }
.kpi-value { font-size: 28px; font-weight: 650; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi-meta { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-top: 10px; }
.bar > span { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
.bar.warnung > span { background: #f79009; }
.bar.erreicht > span { background: var(--bad); }

/* ---------------------------------------------------------------- Tabs, Suche, Tabelle */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 14px 10px; border: 0; background: none; color: var(--text-2);
       font: 600 13.5px var(--font); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none !important; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab .count { background: var(--surface-3); color: var(--text-2); border-radius: 10px; padding: 0 7px; font-size: 12px; }
.tab.active .count { background: var(--primary-50); color: var(--primary); }
.suche { position: relative; width: 260px; padding: 10px 0; }
.suche .icon { position: absolute; left: 11px; top: 21px; color: var(--text-3); }
.suche input { padding-left: 34px; height: 36px; }

.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--surface-2);
            padding: 10px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.link { cursor: pointer; }
.table tbody tr.link:hover td { background: #fafbfc; }
.table .haupt { font-weight: 600; color: var(--text); }
.table .neben { font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; gap: 6px; max-width: 300px; }
.table .neben span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table td.nowrap { white-space: nowrap; }
.table .grund { color: var(--text-2); font-size: 13px; max-width: 380px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.table .ki { font-size: 12px; color: var(--text-3); white-space: nowrap; text-align: right; line-height: 1.35; }
.table .ki b { color: var(--text-2); font-weight: 600; }
.table.kompakt td, .table.kompakt th { padding: 9px 14px; }
.leer { text-align: center; padding: 56px 20px; }
.leer .kreis { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 16px; background: var(--primary-50); color: var(--primary); }
.leer h3 { font-size: 16px; margin-bottom: 6px; }
.leer p { color: var(--text-2); margin: 0 auto 20px; max-width: 420px; }

/* ---------------------------------------------------------------- Status-Pillen */
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 10px 2px 8px; font-size: 12.5px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-ok { background: var(--ok-50); color: var(--ok); border-color: var(--ok-200); }
.pill-warn { background: var(--warn-50); color: var(--warn); border-color: var(--warn-200); }
.pill-bad { background: var(--bad-50); color: var(--bad); border-color: var(--bad-200); }
.pill-run { background: var(--primary-50); color: var(--primary); border-color: var(--primary-100); }
.pill-run::before { animation: puls 1s ease-in-out infinite; }
.pill-wait { background: var(--surface-3); color: var(--text-2); }
.pill-lg { font-size: 14px; padding: 5px 14px 5px 12px; }
.pill-lg::before { width: 8px; height: 8px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-3); color: var(--text-2); border-radius: 6px; padding: 1px 7px; font-size: 11.5px; font-weight: 600; }
.chip-blue { background: var(--primary-50); color: var(--primary); }
@keyframes puls { 50% { opacity: .25; } }
@keyframes drehen { to { transform: rotate(360deg); } }
.spinner { width: 16px; height: 16px; border: 2px solid var(--primary-100); border-top-color: var(--primary); border-radius: 50%; animation: drehen .8s linear infinite; }

/* ---------------------------------------------------------------- Hinweise, Toast, Dialog */
.banner { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px; border: 1px solid; }
.banner.warn { background: var(--warn-50); border-color: var(--warn-200); color: #93370d; }
.banner.info { background: var(--primary-50); border-color: var(--primary-100); color: #2d3282; }
.banner .btn { margin-left: auto; }
.toast { position: fixed; top: 20px; right: 20px; z-index: 100; background: var(--text); color: #fff; padding: 12px 16px; border-radius: 10px;
         box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; font-weight: 500; animation: rein .25s ease-out; }
.toast .icon { color: #75e0a7; }
.toast.weg { opacity: 0; transform: translateY(-8px); transition: all .3s; }
@keyframes rein { from { opacity: 0; transform: translateY(-8px); } }

dialog.modal { border: 0; padding: 0; border-radius: 16px; box-shadow: var(--shadow-lg); width: min(920px, calc(100vw - 32px)); max-height: calc(100vh - 64px); }
dialog.modal::backdrop { background: rgba(12, 17, 29, .55); backdrop-filter: blur(2px); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 18px; }
.modal-head p { margin: 4px 0 0; color: var(--text-2); }
.modal-body { padding: 20px 24px; overflow: auto; max-height: calc(100vh - 230px); }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 8px; align-items: center; background: var(--surface-2); }

.beispiele { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.beispiel { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.beispiel .bild { aspect-ratio: 1 / 1.1; background: var(--surface-3); display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid var(--border); }
.beispiel .bild img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.beispiel .info { padding: 10px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.beispiel .name { font-size: 12px; font-weight: 600; word-break: break-all; line-height: 1.35; }
.beispiel form, .beispiel a.btn { margin-top: auto; }
.beispiel .btn { width: 100%; }

.dropzone { position: fixed; inset: 0; z-index: 90; background: rgba(47, 84, 235, .08); border: 3px dashed var(--primary); display: none; place-items: center; }
.dropzone.aktiv { display: grid; }
.dropzone div { background: var(--surface); padding: 28px 36px; border-radius: 16px; box-shadow: var(--shadow-lg); text-align: center; font-weight: 600; color: var(--primary); }

/* ---------------------------------------------------------------- Prüfansicht (Split-View) */
.review { display: grid; grid-template-columns: minmax(0, 1fr) 540px; grid-template-rows: 60px minmax(0, 1fr); height: 100vh; }
.review-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.review-top .titel { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.review-top .pos { margin-left: auto; display: flex; align-items: center; gap: 4px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.trenner { width: 1px; height: 24px; background: var(--border); flex: none; }

.viewer { background: #e8ebf0; display: flex; flex-direction: column; min-height: 0; position: relative; }
.viewer-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.viewer-bar .zoom { min-width: 48px; text-align: center; font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 13px; }
.viewer-bar .switch { border: 0; padding: 0 6px; gap: 8px; font-weight: 550; font-size: 13px; }
.viewer-canvas { flex: 1; overflow: auto; padding: 28px; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.viewer-canvas img { background: #fff; box-shadow: 0 4px 20px rgba(16, 24, 40, .14); border-radius: 2px; transition: transform .2s; max-width: none; }
.viewer-canvas .laedt { opacity: .5; }
.filterpanel { position: absolute; top: 52px; right: 12px; width: 320px; z-index: 10; background: var(--surface); border: 1px solid var(--border);
               border-radius: 12px; box-shadow: var(--shadow-lg); padding: 16px; }
.filterpanel h3 { font-size: 14px; margin-bottom: 4px; }
.filterpanel .switch { padding: 8px 0; }
.filterpanel .knoepfe { display: flex; gap: 8px; margin-top: 12px; }
.filterpanel .knoepfe .btn { flex: 1; }

.inspector { background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.insp-head { padding: 20px 24px 0; }
.insp-head .lieferant { font-size: 19px; font-weight: 650; margin: 12px 0 4px; letter-spacing: -.01em; }
.insp-head .meta { display: flex; gap: 16px; color: var(--text-2); font-size: 13px; flex-wrap: wrap; }
.insp-head .betrag { font-size: 26px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin-top: 12px; }
.insp-head .betrag small { font-size: 13px; color: var(--text-3); font-weight: 500; margin-left: 6px; letter-spacing: 0; }
.ki-streifen { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 8px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; color: var(--text-2); flex-wrap: wrap; }
.ki-streifen b { color: var(--text); font-weight: 600; }
.insp-tabs { display: flex; gap: 2px; padding: 0 24px; border-bottom: 1px solid var(--border); margin-top: 16px; }
.insp-body { flex: 1; overflow: auto; padding: 20px 24px 28px; }
.insp-foot { border-top: 1px solid var(--border); padding: 14px 24px; background: var(--surface); display: flex; gap: 8px; align-items: center; }
.insp-foot input { flex: 1; min-width: 0; }

.entscheidung { border-radius: 12px; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; border: 1px solid; }
.entscheidung .icon { width: 20px; height: 20px; margin-top: 1px; }
.entscheidung.ok { background: var(--ok-50); border-color: var(--ok-200); color: #054f31; }
.entscheidung.warn { background: var(--warn-50); border-color: var(--warn-200); color: #7a2e0e; }
.entscheidung.run { background: var(--primary-50); border-color: var(--primary-100); color: #2d3282; }
.entscheidung b { display: block; font-size: 14.5px; }
.entscheidung .gruende { margin: 6px 0 0; padding-left: 18px; font-size: 13.5px; line-height: 1.5; }
.entscheidung .gruende li + li { margin-top: 4px; }

.protokoll { list-style: none; margin: 0; padding: 0; }
.protokoll > li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.protokoll > li:last-child { border-bottom: 0; }
.protokoll .st { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; margin-top: 1px; }
.protokoll .st .icon { width: 12px; height: 12px; stroke-width: 3; }
.protokoll .ok .st { background: var(--ok-50); color: var(--ok); }
.protokoll .hinweis .st { background: var(--surface-3); color: var(--text-2); }
.protokoll .fehler .st { background: var(--warn); color: #fff; }
.protokoll .offen .st { background: var(--surface-3); color: var(--text-3); }
.protokoll .name { font-weight: 600; }
.protokoll .offen .name { color: var(--text-3); }
.protokoll .besch { color: var(--text-3); font-size: 12.5px; }
.protokoll .befund { margin-top: 8px; padding: 9px 12px; border-radius: 8px; font-size: 13px; line-height: 1.45; }
.protokoll .befund.fehler { background: var(--warn-50); color: #7a2e0e; border: 1px solid var(--warn-200); }
.protokoll .befund.hinweis { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.protokoll .befund code { display: block; font-size: 10.5px; opacity: .7; margin-bottom: 2px; }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; font-size: 13.5px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; font-weight: 500; word-break: break-word; }
.abschnitt { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin: 22px 0 10px; }
.abschnitt:first-child { margin-top: 0; }
.summen { margin-left: auto; width: 260px; font-size: 13.5px; }
.summen div { display: flex; justify-content: space-between; padding: 4px 0; font-variant-numeric: tabular-nums; }
.summen .gesamt { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 8px; font-weight: 650; font-size: 15px; }
details.roh summary { cursor: pointer; color: var(--text-2); font-weight: 550; margin-top: 18px; }
details.roh pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; overflow: auto; font-size: 11.5px; max-height: 320px; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline li { position: relative; padding: 0 0 16px 22px; border-left: 2px solid var(--border); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); }
.timeline li.wichtig::before { border-color: var(--primary); background: var(--primary); }
.timeline .zeit { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.timeline .was { font-weight: 600; font-size: 13.5px; }
.timeline .details { color: var(--text-2); font-size: 13px; word-break: break-word; }

.minikpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.minikpis div { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.minikpis span { display: block; font-size: 12px; color: var(--text-3); }
.minikpis b { font-size: 17px; font-variant-numeric: tabular-nums; }
.vorschlaege { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.vorschlaege button { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 3px 10px; font: 12.5px var(--font); color: var(--text-2); cursor: pointer; }
.vorschlaege button:hover { border-color: var(--primary); color: var(--primary); }

/* ---------------------------------------------------------------- Einstellungen */
.settings { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; align-items: start; }
.subnav { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 2px; }
.subnav a { padding: 8px 12px; border-radius: 8px; color: var(--text-2); font-weight: 550; text-decoration: none; display: flex; gap: 10px; align-items: center; }
.subnav a:hover { background: var(--surface-3); color: var(--text); }
.subnav a.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-xs); border: 1px solid var(--border); }
.settings .card { scroll-margin-top: 24px; }
.testergebnis { margin-top: 12px; display: grid; gap: 8px; }
.testergebnis div { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); font-size: 13px; }
.testergebnis .ok { background: var(--ok-50); border-color: var(--ok-200); }
.testergebnis .bad { background: var(--bad-50); border-color: var(--bad-200); }
.vergleich { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.vergleich figure { margin: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface-3); }
.vergleich img { width: 100%; display: block; aspect-ratio: 4 / 3; object-fit: cover; object-position: top left; background: #fff; }
.vergleich figcaption { padding: 8px 12px; font-size: 12.5px; display: flex; flex-direction: column; gap: 2px; background: var(--surface); border-top: 1px solid var(--border); }
.preis-tabelle input { height: 32px; padding: 0 8px; font-size: 13px; }
.preis-tabelle td { padding: 8px 10px; }
.aktiv-zeile td { background: var(--primary-50); }

/* ---------------------------------------------------------------- Kosten */
.chart { display: flex; align-items: flex-end; gap: 4px; height: 180px; padding-top: 10px; }
.chart .saeule { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 6px; min-width: 0; }
.chart .saeule span { width: 100%; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 2px; opacity: .85; }
.chart .saeule:hover span { opacity: 1; }
.chart .saeule.ohne span { background: var(--surface-3); }
.chart .achse { font-size: 10.5px; color: var(--text-3); white-space: nowrap; }
.zwei-spalten { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.zwei-spalten .card + .card { margin-top: 0; }

/* ---------------------------------------------------------------- System */
.dienste { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.dienst { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; text-decoration: none !important; color: inherit; transition: border-color .15s, box-shadow .15s; margin: 0 !important; }
.dienst:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.dienst .kopf { display: flex; align-items: center; gap: 12px; }
.dienst .logo { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.dienst h3 { font-size: 15px; }
.dienst p { margin: 0; color: var(--text-2); font-size: 13px; }
.dienst .zugang { font-size: 12px; color: var(--text-3); border-top: 1px solid var(--border); padding-top: 10px; margin-top: auto; }
.status-liste { display: flex; gap: 12px; flex-wrap: wrap; }
.status-liste div { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-weight: 550; font-size: 13px; background: var(--surface); }
.status-liste .punkt { width: 8px; height: 8px; border-radius: 50%; }
.punkt.gruen { background: #17b26a; box-shadow: 0 0 0 3px var(--ok-50); }
.punkt.rot { background: #f04438; box-shadow: 0 0 0 3px var(--bad-50); }

/* ---------------------------------------------------------------- Responsiv */
@media (max-width: 1280px) {
  .review { grid-template-columns: minmax(0, 1fr) 460px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .sidebar { position: static; width: auto; flex-direction: row; align-items: center; padding: 10px 14px; overflow-x: auto; gap: 8px; }
  .brand { padding: 0 8px 0 0; }
  .brand-sub, .nav-label, .side-foot { display: none; }
  .nav { display: flex; gap: 2px; }
  .nav a { margin: 0; white-space: nowrap; }
  .main { margin-left: 0; }
  .page { padding: 20px 16px 40px; }
  .review { grid-template-columns: 1fr; grid-template-rows: auto 60vh auto; height: auto; }
  .inspector { border-left: 0; border-top: 1px solid var(--border); }
  .settings, .zwei-spalten, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .subnav { position: static; flex-direction: row; overflow-x: auto; }
  .suche { width: 100%; }
  .table .grund, .table .ki { display: none; }
}
