/* Subauftrag Finanzen — Design-System, Fassung 02.10.2026.
   Vorgabe des Auftraggebers: Stil eines modernen Karten-Dashboards (dunkle
   Seitenleiste, große weiße Karten mit weichen Ecken, Ringdiagramme, eine
   farbig gefüllte Karte), in den Farben von subauftrag.com:
   Petrol #1B3649 · Orange #FB550A · Graublau #70849D · Hellgrau #F5F6F7.
   Die Klassennamen sind die alten; alle Ansichten bauen nur aus diesen Klassen.
   Fassung 06.10.2026 („individueller und moderner"): eigene Schriften Outfit
   (Überschriften, Zahlen, Navigation) und Manrope (Fließtext) — beide SIL Open
   Font License, liegen in fonts/ —, Flächen ohne Rahmen mit weichem Schatten,
   orangefarbene Marken (Punkt vor Kartentiteln, Zeilenkante beim Überfahren,
   Leuchten der Hauptaktion), weißer Pfeil-Pill für den gewählten Menüpunkt. */

@font-face { font-family: "Outfit"; src: url("fonts/Outfit.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fonts/Manrope.ttf") format("truetype"); font-weight: 200 800; font-display: swap; }

:root {
  /* Marke */
  --brand: #1B3649; --brand-strong: #12262F; --brand-soft: #E8EDF1; --brand-line: #C9D3DB;
  --slate: #70849D; --slate-soft: #EEF1F5;
  /* Alte Namen bleiben gültig */
  --navy: var(--brand); --navy-2: #2B5266;
  --orange: #FB550A; --orange-text: #D2460A; --orange-soft: #FFF0E8;
  /* Text */
  --ink: #142630; --ink-2: #33444F; --muted: #566772; --faint: #6B7B86;
  /* Flächen und Linien */
  --bg: #F5F6F7; --panel: #FFFFFF; --soft: #F7F9FA; --line: #E4E8EC; --line-soft: #EEF1F4;
  /* Zustände */
  --green: #18794E; --green-soft: #E3F4EB; --red: #C2331F; --red-soft: #FCE8E4;
  --amber: #8A5A0B; --amber-soft: #FFF2D9; --blue: #23628A; --blue-soft: #E4F0F7;
  /* Herkunft eines Feldwerts (§8) */
  --auto-bg: #F0F9F3; --auto-bd: #9ED3B5;
  --manual-bg: #FFF6EC; --manual-bd: #F0C18E;
  --calc-bg: #F1F4F6; --calc-bd: #BCC8D1;
  /* Reihenfarben der Diagramme */
  --c1: #1B3649; --c2: #FB550A; --c3: #70849D; --c4: #2FA39A; --c5: #F2B84B; --c6: #8A7CC8;
  --chart-base: #D5E0E8;
  --r-s: 8px; --r-m: 12px; --r-l: 20px; --r-pill: 999px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;
  --fs-xs: 11.5px; --fs-s: 13px; --fs-m: 14px; --fs-l: 16px; --fs-xl: 24px; --fs-kpi: 28px;
  --sidebar-w: 236px; --rail-w: 76px;
  --card-shadow: 0 1px 1px rgba(20,38,48,.03), 0 6px 18px rgba(20,38,48,.05), 0 18px 44px rgba(27,54,73,.06);
  --card-shadow-hover: 0 2px 4px rgba(20,38,48,.05), 0 14px 32px rgba(27,54,73,.12);
  --glow: 0 8px 22px rgba(251,85,10,.30);
  --shadow: 0 24px 60px rgba(20,38,48,.20), 0 2px 8px rgba(20,38,48,.08);
  --ring: 0 0 0 3px rgba(27,54,73,.20);
  /* Überschriften und Zahlen geometrisch wie die Wortmarke, Fließtext in der Systemschrift */
  --font-display: "Outfit", "Avenir Next", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, sans-serif;
  --ease: 150ms cubic-bezier(.2,.7,.3,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--font); font-size: var(--fs-m); line-height: 1.45; color: var(--ink);
  background: radial-gradient(900px 520px at 100% 0%, rgba(251,85,10,.07), transparent 60%),
    radial-gradient(700px 480px at 0% 100%, rgba(27,54,73,.08), transparent 60%), var(--bg);
  background-attachment: fixed; -webkit-font-smoothing: antialiased; }
/* Schmale Bildlaufleisten in Petrol statt der grauen Systemleiste */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(112,132,157,.35); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(112,132,157,.6); background-clip: padding-box; border: 3px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }
.num, td.money, .kpi-value { font-variant-numeric: tabular-nums; }
td.money, th.money { text-align: right; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
::selection { background: var(--brand-line); }
[hidden] { display: none !important; }

/* ---- Grundlayout: dunkle Seitenleiste, Inhalt rechts ---- */
.layout { display: flex; height: 100vh; }
.sidebar { width: var(--sidebar-w); flex-shrink: 0; color: #fff;
  background: radial-gradient(420px 260px at 0% 100%, rgba(251,85,10,.22), transparent 70%),
    linear-gradient(180deg, #1F3F55 0%, var(--brand) 40%, var(--brand-strong) 100%);
  display: flex; flex-direction: column; padding: var(--sp-4) var(--sp-3) var(--sp-3); overflow-y: auto; overflow-x: hidden;
  position: relative; transition: width var(--ease); }
.brand { display: flex; align-items: center; padding: 4px var(--sp-1) var(--sp-4); min-height: 56px; overflow: hidden; }
.brand img { width: 164px; height: auto; display: block; margin-left: -8px; flex: 0 0 164px; }
.brand-sub { display: none; }
.sidebar-logo { color: #fff; font: 700 var(--fs-l)/1 var(--font-display); padding: 0 var(--sp-2) var(--sp-4); }
.sidebar-logo b { color: var(--orange); }
.nav-group { font: 600 10.5px/1 var(--font-display); letter-spacing: 1.3px; text-transform: uppercase; color: rgba(255,255,255,.42);
  padding: var(--sp-4) var(--sp-2) 8px; white-space: nowrap; }
.nav-group:first-of-type { padding-top: var(--sp-1); }
.nav-item { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.74); text-decoration: none;
  font: 500 var(--fs-s)/1.2 var(--font-display); padding: 6px; border-radius: 14px; cursor: pointer; white-space: nowrap;
  position: relative; transition: background var(--ease), color var(--ease); margin-bottom: 2px; }
.nav-item svg { width: 32px; height: 32px; flex: 0 0 32px; padding: 7.5px; border-radius: 50%; stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: background var(--ease), color var(--ease); }
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: #fff; color: var(--brand); font-weight: 600; box-shadow: 0 8px 20px rgba(0,0,0,.18); }
.nav-item.active svg { background: var(--orange); color: #fff; }
.nav-item:focus-visible { outline-color: #fff; }
.nav-item .badge { margin-left: auto; margin-right: 6px; background: var(--orange); color: #fff; font: 700 10.5px/1.5 var(--font);
  border-radius: var(--r-pill); padding: 1px 7px; min-width: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.nav-spacer { flex: 1; min-height: var(--sp-4); }
.rail-toggle { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: transparent; cursor: pointer;
  color: rgba(255,255,255,.55); font: 500 var(--fs-xs)/1.2 var(--font-display); padding: var(--sp-3) 6px 6px; white-space: nowrap;
  margin-top: var(--sp-2); border-top: 1px solid rgba(255,255,255,.10); }
.rail-toggle svg { width: 32px; height: 32px; flex: 0 0 32px; padding: 8.5px; stroke: currentColor; fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; transition: transform var(--ease); }
.rail-toggle:hover { color: #fff; }

/* Eingeklappt: nur die Zeichen, wie eine Werkzeugleiste */
.layout.rail .sidebar { width: var(--rail-w); }
.layout.rail .brand { width: 31px; margin-left: 9px; padding-left: 0; }
.layout.rail .nav-group { height: 1px; padding: 0; margin: var(--sp-3) 6px; background: rgba(255,255,255,.12); overflow: hidden; color: transparent; }
.layout.rail .nav-group:first-of-type { display: none; }
.layout.rail .nav-item > span:not(.badge), .layout.rail .rail-toggle > span { display: none; }
.layout.rail .nav-item { justify-content: center; }
.layout.rail .nav-item .badge { position: absolute; top: 0; right: 0; margin: 0; }
.layout.rail .rail-toggle { justify-content: center; }
.layout.rail .rail-toggle svg { transform: rotate(180deg); }

.main { flex: 1; overflow-y: auto; padding: var(--sp-4) var(--sp-6) var(--sp-6); position: relative; min-width: 0; }

/* ---- Leiste über jeder Ansicht: Suche, Sicherung, Neuanlage ---- */
.appbar { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.appbar-search { flex: 1; max-width: 460px; display: flex; align-items: center; gap: 8px; background: var(--panel);
  border: 1px solid transparent; border-radius: var(--r-pill); padding: 0 6px 0 16px; height: 42px; box-shadow: var(--card-shadow);
  transition: border-color var(--ease), box-shadow var(--ease); }
.appbar-search:focus-within { border-color: var(--brand); box-shadow: var(--ring); }
.appbar-search svg { width: 16px; height: 16px; stroke: var(--faint); fill: none; stroke-width: 2; stroke-linecap: round; flex: 0 0 16px; }
.appbar-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: var(--fs-s)/1 var(--font); color: var(--ink); }
.appbar-search input::placeholder { color: var(--faint); }
.appbar-actions { margin-left: auto; display: flex; align-items: center; gap: var(--sp-2); }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: var(--r-pill);
  background: var(--panel); border: 1px solid transparent; color: var(--ink-2); font: 600 var(--fs-xs)/1 var(--font);
  cursor: pointer; white-space: nowrap; box-shadow: var(--card-shadow); transition: border-color var(--ease), box-shadow var(--ease); }
.chip:hover { border-color: var(--brand-line); box-shadow: var(--card-shadow-hover); }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.chip.warn::before { background: var(--orange); }
.chip.env { background: var(--orange); color: #fff; font-weight: 700; letter-spacing: .3px; cursor: default; }
.chip.env::before { background: #fff; }

/* ---- Kopfzeile je Ansicht ---- */
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-4); gap: var(--sp-3); }
.topbar h1 { font: 600 26px/1.2 var(--font-display); letter-spacing: -.5px; }
.topbar .sub { color: var(--faint); font: 400 var(--fs-s)/1 var(--font); letter-spacing: 0; }
.toolbar { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.actionbar { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
  margin: calc(var(--sp-2) * -1) 0 var(--sp-4); padding-bottom: var(--sp-3); border-bottom: 1px solid var(--line); }

/* ---- Buttons: rund wie auf subauftrag.com ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--brand); color: #fff;
  border: 1px solid var(--brand); font: 600 var(--fs-s)/1 var(--font); padding: 10px 18px; border-radius: var(--r-pill);
  cursor: pointer; white-space: nowrap; transition: background var(--ease), border-color var(--ease), box-shadow var(--ease), transform var(--ease); }
.btn:hover { background: var(--brand-strong); border-color: var(--brand-strong); box-shadow: 0 6px 16px rgba(27,54,73,.22); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.accent { background: linear-gradient(135deg, #FF6A24, var(--orange) 60%, #E84B05); border-color: transparent;
  font-size: var(--fs-m); font-weight: 700; box-shadow: var(--glow); }
.btn.accent:hover { background: linear-gradient(135deg, #FF5F12, #E84B05 70%); border-color: transparent; box-shadow: 0 10px 26px rgba(251,85,10,.4); }
.btn.ghost { background: var(--panel); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--soft); border-color: var(--brand-line); box-shadow: 0 4px 12px rgba(20,38,48,.08); }
.btn.dark { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn.danger { background: var(--red); border-color: var(--red); }
.btn.danger:hover { background: #A22916; border-color: #A22916; }
.btn.ghost.danger { background: var(--panel); color: var(--red); border-color: #EBBDB4; }
.btn.ghost.danger:hover { background: var(--red-soft); }
.btn.sm { padding: 7px 13px; font-size: var(--fs-xs); }
.btn.onbrand { background: #fff; color: var(--brand); border-color: #fff; }
.btn.onbrand:hover { background: var(--brand-soft); border-color: var(--brand-soft); }

/* Segment-Umschalter: graue Schiene, aktiver Eintrag als weiße Marke */
.seg { display: inline-flex; border-radius: var(--r-pill); padding: 3px; gap: 2px; background: #E9EDF1; }
.seg button { border: none; background: transparent; padding: 7px 14px; font: 600 var(--fs-xs)/1 var(--font);
  color: var(--muted); cursor: pointer; border-radius: var(--r-pill); transition: background var(--ease), color var(--ease); }
.seg button:hover { color: var(--ink); }
.seg button.active { background: var(--brand); color: #fff; box-shadow: 0 2px 6px rgba(27,54,73,.3); }

/* ---- Karten & Kennzahlen ---- */
.card { background: var(--panel); border: 1px solid transparent; border-radius: var(--r-l); padding: 18px 22px 22px;
  box-shadow: var(--card-shadow); transition: box-shadow var(--ease), transform var(--ease); }
.card:has(> .card-head > .card-link):hover { box-shadow: var(--card-shadow-hover); }
.card.soft { background: var(--soft); box-shadow: none; }
.card.accent { background: var(--orange-soft); border-color: #F8D2BE; box-shadow: none; }
/* Die eine gefüllte Karte je Ansicht */
.card.filled { background: radial-gradient(360px 220px at 100% 0%, rgba(251,85,10,.42), transparent 70%),
    linear-gradient(150deg, #23485F 0%, var(--brand) 55%, var(--brand-strong) 100%); border-color: transparent; color: #fff;
  box-shadow: 0 18px 44px rgba(27,54,73,.28); }
.card.filled .kpi-label, .card.filled .card-title { color: rgba(255,255,255,.78); }
.card.filled .kpi-hint, .card.filled .faint { color: rgba(255,255,255,.66); }
.card.filled .task { color: rgba(255,255,255,.90); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.card-title { display: inline-flex; align-items: center; gap: 9px; font: 600 15.5px/1.3 var(--font-display); color: var(--ink); }
.card-title::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--orange); flex: 0 0 7px; transform: rotate(45deg); }
.card.filled .card-title::before { background: #fff; }
.card-link { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%;
  border: 0; background: transparent; color: var(--muted); cursor: pointer; transition: background var(--ease), color var(--ease); }
.card-link:hover { background: var(--slate-soft); color: var(--brand); }
.card-link svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.card.filled .card-link { color: rgba(255,255,255,.8); }
.card.filled .card-link:hover { background: rgba(255,255,255,.14); color: #fff; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-4); }
.kpi { background: var(--panel); border: 1px solid transparent; border-radius: var(--r-l); padding: 18px 22px;
  box-shadow: var(--card-shadow); position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; right: -26px; top: -26px; width: 72px; height: 72px; border-radius: 50%;
  background: var(--brand-soft); opacity: .7; }
.kpi > * { position: relative; }
.kpi-label { font: 600 var(--fs-xs)/1.3 var(--font); color: var(--faint); letter-spacing: .2px; }
.kpi-value { font: 600 30px/1.1 var(--font-display); margin-top: 5px; letter-spacing: -.8px; }
.kpi-value.pos { color: var(--green); } .kpi-value.neg { color: var(--red); } .kpi-value.hi { color: var(--orange-text); }
.kpi-hint { font-size: var(--fs-xs); color: var(--faint); margin-top: 4px; }
/* Raster des Dashboards */
.dash { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--sp-4); }
.dash > * { min-width: 0; }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; }
.span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: var(--sp-3) var(--sp-4); }
.figures > div { min-width: 0; }
.figures > div + div { border-left: 1px solid var(--line-soft); padding-left: var(--sp-4); }
.figures .kpi-label, .figures .kpi-hint { overflow-wrap: anywhere; }
.figures .kpi-value { font-size: 23px; letter-spacing: -.5px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; flex: 0 0 9px; }

/* ---- Tabellen: Liste in einer Karte ---- */
.table-wrap { background: var(--panel); border: 1px solid transparent; border-radius: var(--r-l); overflow: hidden;
  box-shadow: var(--card-shadow); }
.card .table-wrap { box-shadow: none; }
table.data { width: 100%; border-collapse: collapse; font-size: var(--fs-s); }
table.data th { background: var(--panel); text-align: left; padding: 15px 14px 11px; font: 700 10.5px/1.2 var(--font);
  letter-spacing: .6px; text-transform: uppercase; color: var(--faint); border-bottom: 1px solid var(--line); position: sticky; top: 0; white-space: nowrap; }
table.data td { padding: 13px 14px; border-bottom: 1px solid var(--line-soft); color: var(--ink-2); }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background var(--ease); }
table.data tr:hover td { background: var(--soft); }
table.data tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--orange); }
table.data tr.selected td { background: var(--brand-soft); }
table.data tr.overdue td { background: var(--manual-bg); }
table.data tr.sum td { font-weight: 700; color: var(--ink); border-top: 1px solid var(--line); background: var(--soft); }
table.data input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }

/* ---- Status-Marken ---- */
.pill { display: inline-flex; align-items: center; gap: 6px; font: 700 11px/1 var(--font); padding: 5px 10px 5px 8px;
  border-radius: var(--r-pill); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; flex: 0 0 6px; }
.pill.open { background: var(--amber-soft); color: var(--amber); }
.pill.paid { background: var(--green-soft); color: var(--green); }
.pill.part { background: var(--blue-soft); color: var(--blue); }
.pill.overdue { background: var(--red-soft); color: var(--red); }
.pill.cancelled { background: var(--line-soft); color: var(--muted); }
.pill.neutral { background: var(--slate-soft); color: var(--muted); }
.pill svg { width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Formulare & Herkunftsfarben ---- */
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3) var(--sp-4); }
.form-grid.two { grid-template-columns: repeat(2, 1fr); }
.field { display: block; }
.field-label { display: block; font: 500 var(--fs-xs)/1.2 var(--font); color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea, .input { width: 100%; border: 1px solid var(--line);
  border-radius: var(--r-m); background: var(--panel); padding: 9px 12px; font: var(--fs-s)/1.35 var(--font);
  color: var(--ink); transition: border-color var(--ease), box-shadow var(--ease); }
.field input[type="checkbox"] { accent-color: var(--brand); width: 17px; height: 17px; }
.field input:hover, .field select:hover, .field textarea:hover, .input:hover { border-color: var(--brand-line); }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.field.src-auto input   { background: var(--auto-bg);   border-color: var(--auto-bd); }
.field.src-manual input { background: var(--manual-bg); border-color: var(--manual-bd); }
.field.src-calc input   { background: var(--calc-bg);   border-color: var(--calc-bd); font-weight: 700; }
.field.invalid input    { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.field input:disabled, .field select:disabled, .field textarea:disabled, .input:disabled {
  background: var(--bg); color: var(--muted); border-style: dashed; cursor: not-allowed; box-shadow: none; }
.field input:disabled[type="checkbox"] { opacity: .5; }
.field-note { font-size: var(--fs-xs); color: var(--faint); margin-top: 5px; display: block; }
.legend { display: flex; gap: var(--sp-4); font-size: var(--fs-xs); color: var(--muted); margin-top: var(--sp-2); }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

/* ---- Rechnungspositionen ---- */
.lines { width: 100%; border-collapse: collapse; font-size: var(--fs-s); }
.lines th { text-align: left; font: 500 var(--fs-xs)/1.2 var(--font); color: var(--faint); padding: 0 4px 8px;
  border-bottom: 1px solid var(--line); white-space: nowrap; }
.lines td { padding: 8px 4px 0; vertical-align: middle; }
.lines .input { padding: 8px 9px; }
.lines th.num, .lines td.num { text-align: right; }
.lines th.grow { width: 100%; }
.lines td.pos { width: 30px; color: var(--faint); font-variant-numeric: tabular-nums; }
.line-name { display: flex; align-items: center; gap: 6px; }
.lines .proposal { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; min-height: 0; }
.lines .proposal:empty { display: none; }
.line-person { display: inline-flex; width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; background: var(--brand-soft);
  color: var(--brand); align-items: center; justify-content: center; }
.line-person svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }
.lines td.calc { white-space: nowrap; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.lines td.num input { text-align: right; }
.lines input.src-auto { background: var(--auto-bg); border-color: var(--auto-bd); }
.lines input.src-manual { background: var(--manual-bg); border-color: var(--manual-bd); }
.lines input.src-calc { background: var(--calc-bg); border-color: var(--calc-bd); }
.lines tbody tr:last-child td { padding-bottom: 10px; }
.lines tfoot td { padding-top: 12px; border-top: 1px solid var(--line); font-weight: 700; white-space: nowrap; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%;
  border: 0; background: transparent; color: var(--muted); cursor: pointer; transition: background var(--ease), color var(--ease); }
.icon-btn:hover { background: var(--red-soft); color: var(--red); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.icon-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Fortschritt, Banner, Aufgaben ---- */
.progress { height: 8px; background: var(--line-soft); border-radius: var(--r-pill); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--brand); border-radius: var(--r-pill); }
.progress.over > i { background: var(--red); }
.card.filled .progress { background: rgba(255,255,255,.22); }
.card.filled .progress > i { background: #fff; }
.banner { border-radius: var(--r-m); padding: var(--sp-3) var(--sp-4); font-size: var(--fs-s); margin-bottom: var(--sp-3);
  border: 1px solid transparent; }
.banner.warn { background: var(--manual-bg); border-color: #F3D3AD; color: #7A4F12; }
.banner.error { background: var(--red-soft); border-color: #F0C0B7; color: #96281A; }
.banner.ok { background: var(--green-soft); border-color: #BCE0CB; color: #17643E; }
.tasklist { display: flex; flex-direction: column; gap: 10px; }
.task { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); font-size: var(--fs-s); color: var(--ink-2); }

/* ---- Diagramme (reines SVG, keine Bibliothek) ---- */
.chart-card svg.chart, svg.chart { width: 100%; height: 190px; display: block; }
.chart-bar { fill: var(--chart-base); } .chart-bar-hi { fill: var(--orange); }
.chart-axis { font-size: 10.5px; fill: var(--faint); }
/* Verlaufslinie (Mitarbeiter im Einsatz) */
svg.chart.line { height: 170px; }
.chart-grid { stroke: var(--line-soft); stroke-width: 1; }
.chart-line { fill: none; stroke: var(--brand); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart-dot { fill: var(--panel); stroke: var(--brand); stroke-width: 2; }
.chart-dot.today { fill: var(--orange); stroke: var(--orange); r: 5; }
.staff { display: flex; gap: var(--sp-5); align-items: stretch; }
.staff-figures { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3) var(--sp-4); flex: 0 0 300px; align-content: center;
  padding-right: var(--sp-4); border-right: 1px solid var(--line-soft); }
.staff-figures .kpi-value { font-size: 26px; letter-spacing: -.6px; }
.staff-chart { flex: 1; min-width: 0; display: flex; align-items: center; }

/* ---- Dialoge ---- */
dialog { border: 0; border-radius: 26px; box-shadow: var(--shadow); padding: var(--sp-5) 30px; max-width: 640px; width: 92%; color: var(--ink); }
dialog h1 { font-family: var(--font-display); font-weight: 600; }
dialog::backdrop { background: rgba(18,38,47,.5); backdrop-filter: blur(3px); }
dialog.popup.wide { max-width: 1040px; width: 94%; }
.popup-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); }
.popup-head h1 { font-size: var(--fs-xl); letter-spacing: -.3px; }
.popup-section { font: 600 var(--fs-m)/1.3 var(--font-display); margin: var(--sp-4) 0 var(--sp-2); }
.popup .table-wrap { box-shadow: none; border: 1px solid var(--line); }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--sp-2); margin-top: var(--sp-4);
  padding-top: var(--sp-4); border-top: 1px solid var(--line-soft); }

/* ---- Es läuft etwas: Laufband oben, bei längeren Vorgängen ein Ladekreis ---- */
.busy-bar { position: fixed; left: 0; right: 0; top: 0; height: 3px; overflow: hidden; z-index: 40; background: rgba(251,85,10,.18); }
.busy-bar::after { content: ""; position: absolute; top: 0; bottom: 0; width: 38%; background: var(--orange);
  border-radius: 3px; animation: busy-slide 1.1s ease-in-out infinite; }
/* Als Popover in der obersten Ebene: so liegt der Ladekreis auch über einem
   offenen Dialog (etwa beim Mailversand) und nicht hinter dessen Abdunklung. */
.busy-overlay { position: fixed; inset: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0;
  border: 0; padding: 0; background: rgba(245,246,247,.74); align-items: center; justify-content: center; }
.busy-overlay:popover-open { display: flex; }
.busy-box { background: var(--panel); border-radius: var(--r-l); box-shadow: var(--shadow);
  padding: 18px 26px; display: flex; align-items: center; gap: var(--sp-3); font: 600 var(--fs-s)/1.3 var(--font-display); }
.spinner { width: 24px; height: 24px; border-radius: 50%; border: 3px solid var(--brand-line); border-top-color: var(--orange);
  animation: busy-spin .75s linear infinite; flex: 0 0 24px; }
.spinner.sm { width: 14px; height: 14px; border-width: 2px; flex-basis: 14px; }
@keyframes busy-spin { to { transform: rotate(360deg); } }
@keyframes busy-slide { 0% { left: -38%; } 100% { left: 100%; } }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .spinner, .busy-bar::after { animation-duration: 2.4s; }
}

/* ---- Kleinkram ---- */
.muted { color: var(--muted); } .faint { color: var(--faint); }
.mt2 { margin-top: var(--sp-2); } .mt3 { margin-top: var(--sp-3); } .mt4 { margin-top: var(--sp-4); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
.split-detail { display: grid; grid-template-columns: 1.3fr .7fr; gap: var(--sp-4); }  /* Maske | PDF-Vorschau */
.split-detail > * { min-width: 0; }
.pdf-preview { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--card-shadow);
  min-height: 480px; display: flex; align-items: center; justify-content: center; color: var(--faint); overflow: hidden; }
kbd { background: var(--slate-soft); border-radius: 6px; padding: 2px 7px; font: 500 var(--fs-xs)/1.4 var(--font); color: var(--muted); }
