/* LKL Antragsmodul — Designsystem v4 (Redesign 2026-10)
   Ein Stylesheet für Admin + öffentliche Seiten. Port-Ziel: service/static/css/lkl-v4.css */

@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("/static/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("/static/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("/static/fonts/inter-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url("/static/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 600; font-display: swap; src: url("/static/fonts/jetbrains-mono-latin-600-normal.woff2") format("woff2"); }

/* ───────────── Tokens ───────────── */
:root {
  /* Marke */
  --petrol-900: #00252a;
  --petrol-800: #0c3c42;
  --petrol-700: #14535b;
  --petrol-200: #b9d9dd;
  --petrol-100: #e2eff0;
  --petrol-50:  #f0f6f6;

  /* Neutrale (warm) */
  --ink:        #17211f;
  --ink-2:      #3d4847;
  --ink-3:      #5b6665;
  --paper:      #f6f5f1;
  --surface:    #fffefb;
  --surface-2:  #f1f0eb;
  --line:       #e3e1d9;
  --line-strong:#cbc8be;

  /* Semantik */
  --ok:        #1d6b3a;  --ok-bg:     #e7f2ea;
  --warn:      #7d5200;  --warn-bg:   #fbf0d8;
  --danger:    #a3261d;  --danger-bg: #fbe8e5;
  --info:      #285a85;  --info-bg:   #e7eff7;

  /* Zuständigkeit („Wartet auf …“) */
  --who-sb:     var(--petrol-800); --who-sb-bg:     var(--petrol-100);
  --who-vs:     #7a4a00;           --who-vs-bg:     #f8ebd2;
  --who-at:     #285a85;           --who-at-bg:     #e4eef7;
  --who-sm:     #1d6b3a;           --who-sm-bg:     #e4f1e8;
  --who-none:   #5b6665;           --who-none-bg:   #ecebe6;

  /* Typo */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --fs-xs: 0.75rem;   /* 12 */
  --fs-sm: 0.8125rem; /* 13 */
  --fs-md: 0.9375rem; /* 15 */
  --fs-lg: 1.0625rem; /* 17 */
  --fs-xl: 1.375rem;  /* 22 */
  --fs-2xl: 1.75rem;  /* 28 */

  /* Raum & Form */
  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem; --s-5: 1.5rem; --s-6: 2rem; --s-7: 3rem;
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(23, 33, 31, 0.06);
  --shadow-2: 0 2px 6px rgba(23, 33, 31, 0.06), 0 12px 32px rgba(23, 33, 31, 0.08);
  --focus: 0 0 0 3px rgba(20, 83, 91, 0.35);
  --container: 1280px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ───────────── Basis ───────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
body.is-public { font-size: 1rem; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; color: var(--ink); }
h1 { font-size: var(--fs-2xl); font-weight: 700; }
h2 { font-size: var(--fs-xl); font-weight: 600; }
h3 { font-size: var(--fs-lg); font-weight: 600; }
h4 { font-size: var(--fs-md); font-weight: 600; }
p { margin: 0; }
a { color: var(--petrol-700); text-underline-offset: 2px; }
a:hover { color: var(--petrol-900); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.muted { color: var(--ink-3); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.eyebrow { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--surface); padding: var(--s-2) var(--s-3); z-index: 100; }
.skip-link:focus { left: var(--s-3); top: var(--s-3); }
[hidden] { display: none !important; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--s-5); }
.container--narrow { max-width: 760px; }
.container--reading { max-width: 960px; }
.stack > * + * { margin-top: var(--s-4); }
.stack-lg > * + * { margin-top: var(--s-5); }
.row { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.spacer { flex: 1; }

/* ───────────── App-Bar (Admin) ───────────── */
.appbar { background: var(--petrol-800); color: #f2f7f7; border-bottom: 1px solid var(--petrol-900); position: sticky; top: 0; z-index: 30; }
.appbar__inner { display: flex; align-items: center; gap: var(--s-5); height: 56px; }
.appbar__brand { display: flex; align-items: center; gap: var(--s-2); color: #fff; text-decoration: none; font-weight: 700; white-space: nowrap; }
.appbar__brand-mark { width: 28px; height: 28px; border-radius: 7px; background: #f2f7f7; color: var(--petrol-800); display: grid; place-items: center; font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.02em; }
.appbar__nav { display: flex; gap: var(--s-1); }
.appbar__nav a { color: #d6e7e9; text-decoration: none; font-size: var(--fs-sm); font-weight: 600; padding: 0.45rem 0.7rem; border-radius: var(--r-sm); transition: background .15s var(--ease), color .15s; }
.appbar__nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.appbar__nav a[aria-current="page"] { background: rgba(255,255,255,.14); color: #fff; }
.appbar__nav .count { margin-left: 0.35rem; font-family: var(--mono); font-size: var(--fs-xs); opacity: .8; }
.appbar__search { margin-left: auto; position: relative; }
.appbar__search input { width: 280px; height: 34px; border-radius: var(--r-sm); border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff; padding: 0 2.4rem 0 0.75rem; font: inherit; font-size: var(--fs-sm); }
.appbar__search input::placeholder { color: #a9c6ca; }
.appbar__search kbd { position: absolute; right: 8px; top: 7px; font-family: var(--mono); font-size: 11px; color: #a9c6ca; border: 1px solid rgba(255,255,255,.2); border-radius: 4px; padding: 0 4px; }
.appbar__user { display: flex; align-items: center; gap: var(--s-3); font-size: var(--fs-sm); color: #d6e7e9; white-space: nowrap; }
.appbar__user button { background: none; border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: var(--r-sm); padding: 0.3rem 0.6rem; font: inherit; font-size: var(--fs-sm); cursor: pointer; }

/* ───────────── Public Header/Footer ───────────── */
.site-header { background: var(--petrol-800); color: #fff; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.site-header a { color: #fff; text-decoration: none; font-weight: 600; }
.site-header nav a { font-weight: 500; color: #d6e7e9; margin-left: var(--s-4); font-size: var(--fs-sm); }
.site-footer { border-top: 1px solid var(--line); margin-top: var(--s-7); padding: var(--s-5) 0; color: var(--ink-3); font-size: var(--fs-sm); }
.site-footer .row { justify-content: center; gap: var(--s-5); }

/* ───────────── Seitenkopf ───────────── */
.page { padding: var(--s-5) 0 var(--s-7); }
.breadcrumb { font-size: var(--fs-sm); color: var(--ink-3); margin-bottom: var(--s-3); }
.breadcrumb a { color: var(--ink-3); text-decoration: none; }
.breadcrumb a:hover { color: var(--petrol-700); text-decoration: underline; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-5); }
.page-head p { color: var(--ink-2); margin-top: var(--s-1); }

/* ───────────── Buttons ───────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; min-height: 38px; padding: 0 0.95rem; border-radius: var(--r-sm); border: 1px solid transparent; font: inherit; font-size: var(--fs-sm); font-weight: 600; line-height: 1; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s var(--ease), border-color .15s, color .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--petrol-800); color: #fff; }
.btn--primary:hover { background: var(--petrol-900); color: #fff; }
.btn--secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn--secondary:hover { border-color: var(--petrol-700); color: var(--petrol-800); }
.btn--ghost { background: transparent; color: var(--petrol-700); }
.btn--ghost:hover { background: var(--petrol-50); }
.btn--danger { background: var(--surface); color: var(--danger); border-color: #e7c2bd; }
.btn--danger:hover { background: var(--danger-bg); }
.btn--lg { min-height: 46px; padding: 0 1.25rem; font-size: var(--fs-md); }
.btn--sm { min-height: 30px; padding: 0 0.6rem; font-size: var(--fs-xs); }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn .kbd { font-family: var(--mono); font-size: 11px; opacity: .7; }

/* ───────────── Chips ───────────── */
.chip { display: inline-flex; align-items: center; gap: 0.4rem; height: 24px; padding: 0 0.6rem; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.chip--plain::before { display: none; }
.status--eingegangen   { color: var(--info); }
.status--in_pruefung   { color: var(--petrol-700); }
.status--rueckfrage    { color: var(--warn); background: var(--warn-bg); border-color: #efd9a8; }
.status--beschlossen   { color: var(--petrol-800); background: var(--petrol-100); border-color: var(--petrol-200); }
.status--ausgezahlt    { color: var(--ok); background: var(--ok-bg); border-color: #c4e0cc; }
.status--abgeschlossen { color: var(--ink-2); background: var(--surface-2); }
.status--abgelehnt     { color: var(--danger); background: var(--danger-bg); border-color: #efc7c1; }

.who { display: inline-flex; align-items: center; gap: 0.4rem; font-size: var(--fs-xs); font-weight: 600; padding: 0.15rem 0.55rem 0.15rem 0.2rem; border-radius: var(--r-pill); white-space: nowrap; }
.who__dot { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 9px; font-weight: 700; color: #fff; }
.who--sb { color: var(--who-sb); background: var(--who-sb-bg); } .who--sb .who__dot { background: var(--who-sb); }
.who--vs { color: var(--who-vs); background: var(--who-vs-bg); } .who--vs .who__dot { background: var(--who-vs); }
.who--at { color: var(--who-at); background: var(--who-at-bg); } .who--at .who__dot { background: var(--who-at); }
.who--sm { color: var(--who-sm); background: var(--who-sm-bg); } .who--sm .who__dot { background: var(--who-sm); }
.who--none { color: var(--who-none); background: var(--who-none-bg); } .who--none .who__dot { background: var(--who-none); }

.tag { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .03em; padding: 0.05rem 0.4rem; border-radius: 4px; background: var(--surface-2); color: var(--ink-3); }
.tag--at { background: var(--who-at-bg); color: var(--who-at); }
.tag--intern { background: var(--surface-2); color: var(--ink-2); }
.tag--auto { background: var(--petrol-50); color: var(--petrol-700); }

.age { font-family: var(--mono); font-size: var(--fs-xs); color: var(--ink-3); }
.age--warn { color: var(--warn); font-weight: 600; }
.age--late { color: var(--danger); font-weight: 600; }

/* Vorgangs-Motiv — wie Live (admin.css / public.css): nur Emoji, kein Kästchen, kein Textname */
.motif-badge {
  font-size: 1.35rem;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
.motif-hero-emoji {
  font-size: 2rem;
  line-height: 1;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
.motif-mark { margin: 0; }
.motif-mark-emoji {
  font-size: 1.75rem;
  line-height: 1;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

/* ───────────── Karten & Abschnitte ───────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-4) var(--s-5) 0; }
.card__body { padding: var(--s-4) var(--s-5) var(--s-5); }
.card__foot { padding: var(--s-3) var(--s-5); border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.card--inset { background: var(--surface-2); box-shadow: none; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-3); }
.divider { border: 0; border-top: 1px solid var(--line); margin: var(--s-4) 0; }

/* ───────────── Callouts ───────────── */
.callout { display: grid; grid-template-columns: auto 1fr; gap: var(--s-3); align-items: start; padding: var(--s-3) var(--s-4); border-radius: var(--r-md); font-size: var(--fs-sm); line-height: 1.5; }
.callout__icon { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; margin-top: 1px; }
.callout strong { font-weight: 600; }
.callout--info { background: var(--info-bg); color: #1d4466; } .callout--info .callout__icon { background: var(--info); }
.callout--warn { background: var(--warn-bg); color: #5c3c00; } .callout--warn .callout__icon { background: var(--warn); }
.callout--ok { background: var(--ok-bg); color: #164f2b; } .callout--ok .callout__icon { background: var(--ok); }
.callout--danger { background: var(--danger-bg); color: #7a1c15; } .callout--danger .callout__icon { background: var(--danger); }

/* ───────────── Tabs ───────────── */
.tabs { display: flex; gap: var(--s-1); border-bottom: 1px solid var(--line); margin-bottom: var(--s-5); overflow-x: auto; }
.tabs button, .tabs a { appearance: none; background: none; border: 0; border-bottom: 2px solid transparent; padding: 0.7rem 0.85rem; font: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-3); cursor: pointer; text-decoration: none; white-space: nowrap; margin-bottom: -1px; }
.tabs button:hover, .tabs a:hover { color: var(--ink); }
.tabs [aria-selected="true"] { color: var(--petrol-800); border-bottom-color: var(--petrol-800); }
.tabs .count { font-family: var(--mono); font-size: var(--fs-xs); color: var(--ink-3); margin-left: 0.3rem; }

.segmented { display: inline-flex; flex-wrap: wrap; gap: var(--s-1); padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); }
.segmented button, .segmented a { appearance: none; border: 0; background: none; font: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); padding: 0.4rem 0.75rem; border-radius: 7px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 0.45rem; }
.segmented button:hover { color: var(--ink); }
.segmented [aria-pressed="true"], .segmented [aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.segmented .count { font-family: var(--mono); font-size: var(--fs-xs); background: var(--surface-2); border-radius: var(--r-pill); padding: 0 0.4rem; color: var(--ink-3); }
.segmented [aria-pressed="true"] .count { background: var(--petrol-100); color: var(--petrol-800); }

/* ───────────── Stepper (Ablauf) ───────────── */
.stepper { display: grid; grid-template-columns: repeat(5, 1fr); list-style: none; margin: 0; padding: 0; counter-reset: step; }
.stepper li { position: relative; padding-top: 22px; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-3); }
.stepper li::before { content: ""; position: absolute; top: 6px; left: 0; right: 0; height: 3px; background: var(--line); border-radius: 2px; }
.stepper li::after { content: ""; position: absolute; top: 1px; left: 0; width: 13px; height: 13px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); }
.stepper li + li { padding-left: 2px; }
.stepper .step-sub { display: block; font-weight: 400; color: var(--ink-3); margin-top: 2px; }
.stepper li[data-state="done"]::before { background: var(--petrol-700); }
.stepper li[data-state="done"]::after { background: var(--petrol-700); border-color: var(--petrol-700); }
.stepper li[data-state="done"] { color: var(--ink-2); }
.stepper li[data-state="current"] { color: var(--petrol-800); }
.stepper li[data-state="current"]::before { background: linear-gradient(90deg, var(--petrol-700) 0 50%, var(--line) 50%); }
.stepper li[data-state="current"]::after { background: var(--surface); border: 4px solid var(--petrol-800); width: 15px; height: 15px; top: 0; }
.stepper li[data-state="paused"] { color: var(--warn); }
.stepper li[data-state="paused"]::after { background: var(--warn-bg); border-color: var(--warn); }
.stepper li[data-state="stopped"] { color: var(--danger); }
.stepper li[data-state="stopped"]::after { background: var(--danger); border-color: var(--danger); }

/* ───────────── Definition-Liste (Antragsdaten) ───────────── */
.dl { display: grid; grid-template-columns: minmax(150px, 34%) 1fr; margin: 0; }
.dl > div { display: contents; }
.dl dt, .dl dd { padding: 0.7rem 0; border-top: 1px solid var(--line); margin: 0; }
.dl > div:first-child dt, .dl > div:first-child dd { border-top: 0; }
.dl dt { color: var(--ink-3); font-size: var(--fs-sm); padding-right: var(--s-4); }
.dl dd { color: var(--ink); white-space: pre-line; }
.dl dd .hint { display: flex; gap: 0.4rem; margin-top: 0.35rem; font-size: var(--fs-sm); white-space: normal; }
.hint--warn { color: var(--warn); } .hint--info { color: var(--info); } .hint--ok { color: var(--ok); }
.hint::before { font-weight: 700; }
.hint--warn::before { content: "!"; } .hint--info::before { content: "i"; } .hint--ok::before { content: "✓"; }

/* ───────────── Nächster Schritt (Action Card) ───────────── */
.next { border: 1px solid var(--petrol-200); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; }
.next__head { padding: var(--s-4) var(--s-5); background: var(--petrol-50); border-bottom: 1px solid var(--petrol-100); display: flex; justify-content: space-between; gap: var(--s-4); align-items: flex-start; flex-wrap: wrap; }
.next__head h2 { font-size: var(--fs-lg); }
.next__head p { color: var(--ink-2); font-size: var(--fs-sm); margin-top: 2px; max-width: 62ch; }
.next__body { padding: var(--s-4) var(--s-5); }
.next__foot { padding: var(--s-3) var(--s-5) var(--s-4); display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }
.next__foot .meta { margin-left: auto; font-size: var(--fs-xs); color: var(--ink-3); }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: grid; grid-template-columns: 22px 1fr auto; gap: var(--s-3); align-items: start; padding: 0.6rem 0; border-top: 1px solid var(--line); }
.checklist li:first-child { border-top: 0; }
.checklist label { cursor: pointer; }
.checklist input[type="checkbox"] { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--petrol-800); cursor: pointer; }
.checklist .auto-mark { width: 18px; height: 18px; border-radius: 4px; display: grid; place-items: center; margin-top: 2px; font-size: 11px; font-weight: 700; }
.checklist .auto-mark--ok { background: var(--ok); color: #fff; }
.checklist .auto-mark--open { border: 2px dashed var(--line-strong); }
.checklist li.is-done .text { color: var(--ink-3); }
.checklist .text small { display: block; color: var(--ink-3); font-size: var(--fs-xs); margin-top: 1px; }
.progress-label { font-size: var(--fs-xs); color: var(--ink-3); font-family: var(--mono); }

/* ───────────── Geldleiter ───────────── */
.ladder { list-style: none; margin: 0; padding: 0; }
.ladder li { display: grid; grid-template-columns: 16px 1fr auto; gap: var(--s-3); align-items: baseline; padding: 0.55rem 0; position: relative; }
.ladder li::before { content: ""; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); position: relative; top: 1px; z-index: 1; }
.ladder li:not(:last-child)::after { content: ""; position: absolute; left: 5px; top: 1.35rem; bottom: -0.35rem; width: 2px; background: var(--line); }
.ladder .label { font-size: var(--fs-sm); color: var(--ink-2); }
.ladder .label small { display: block; font-size: var(--fs-xs); color: var(--ink-3); }
.ladder .amount { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: var(--fs-md); color: var(--ink-2); }
.ladder li[data-state="done"]::before { background: var(--petrol-700); border-color: var(--petrol-700); }
.ladder li[data-state="pending"] .amount { color: var(--ink-3); }
.ladder li[data-state="current"]::before { background: var(--surface); border: 3px solid var(--petrol-800); }
.ladder li[data-state="current"] .label { color: var(--ink); font-weight: 600; }
.ladder li[data-state="current"] .amount { color: var(--petrol-800); font-weight: 600; font-size: var(--fs-lg); }
.ladder .delta { font-size: var(--fs-xs); color: var(--warn); font-family: var(--mono); display: block; text-align: right; }

/* ───────────── Kennzahlen ───────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--s-3); }
.stat { padding: var(--s-4); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.stat__label { font-size: var(--fs-xs); color: var(--ink-3); font-weight: 600; }
.stat__value { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: var(--fs-xl); font-weight: 600; margin-top: 0.2rem; }
.stat__sub { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 0.15rem; }
.stat--accent { background: var(--petrol-800); border-color: var(--petrol-800); color: #fff; }
.stat--accent .stat__label, .stat--accent .stat__sub { color: #b9d9dd; }

.meter { height: 10px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; display: flex; }
.meter span { display: block; height: 100%; }
.meter .m-paid { background: var(--ok); }
.meter .m-approved { background: var(--petrol-700); }
.meter .m-requested { background: repeating-linear-gradient(45deg, var(--petrol-200) 0 6px, var(--petrol-100) 6px 12px); }
.legend { display: flex; flex-wrap: wrap; gap: var(--s-4); font-size: var(--fs-xs); color: var(--ink-2); margin-top: var(--s-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 0.35rem; vertical-align: -1px; }

/* ───────────── Tabelle / Arbeitskorb ───────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th { text-align: left; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-3); padding: 0.6rem var(--s-3); border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.table th:first-child { border-top-left-radius: var(--r-md); }
.table th:last-child { border-top-right-radius: var(--r-md); }
.table td { padding: 0.75rem var(--s-3); border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--petrol-50); }
.table tbody tr[data-href] { cursor: pointer; }
.table .t-num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .t-main a { font-weight: 600; color: var(--ink); text-decoration: none; }
.table .t-main a:hover { color: var(--petrol-700); text-decoration: underline; }
.table .t-sub { display: block; color: var(--ink-3); font-size: var(--fs-xs); margin-top: 1px; max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table .t-id { font-family: var(--mono); font-size: var(--fs-xs); color: var(--ink-3); }

/* ───────────── Formulare ───────────── */
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field + .field { margin-top: var(--s-4); }
.field label, .field .label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
.field .help { font-size: var(--fs-xs); color: var(--ink-3); }
.field .error { font-size: var(--fs-xs); color: var(--danger); font-weight: 600; }
.input, .select, .textarea { width: 100%; font: inherit; font-size: var(--fs-md); color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 0.55rem 0.7rem; transition: border-color .15s, box-shadow .15s; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--petrol-700); box-shadow: var(--focus); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input--money { font-family: var(--mono); text-align: right; max-width: 180px; }
.input-affix { display: inline-flex; align-items: center; gap: 0.4rem; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }

.choice-cards { display: grid; gap: var(--s-2); }
.choice { display: grid; grid-template-columns: 20px 1fr; gap: var(--s-3); padding: var(--s-3) var(--s-4); border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.choice:hover { border-color: var(--petrol-700); }
.choice input { margin: 3px 0 0; accent-color: var(--petrol-800); width: 16px; height: 16px; }
.choice strong { display: block; font-size: var(--fs-md); }
.choice span { font-size: var(--fs-sm); color: var(--ink-3); }
.choice:has(input:checked) { border-color: var(--petrol-800); background: var(--petrol-50); box-shadow: inset 0 0 0 1px var(--petrol-800); }
.choice--danger:has(input:checked) { border-color: var(--danger); background: var(--danger-bg); box-shadow: inset 0 0 0 1px var(--danger); }

.switch { display: inline-flex; align-items: center; gap: var(--s-3); cursor: pointer; font-size: var(--fs-sm); }
.switch input { appearance: none; width: 36px; height: 20px; border-radius: var(--r-pill); background: var(--line-strong); position: relative; cursor: pointer; transition: background .15s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s var(--ease); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--petrol-800); }
.switch input:checked::after { transform: translateX(16px); }

.dropzone { border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); padding: var(--s-5); text-align: center; background: var(--surface-2); color: var(--ink-2); transition: border-color .15s, background .15s; }
.dropzone:hover { border-color: var(--petrol-700); background: var(--petrol-50); }
.dropzone strong { color: var(--petrol-800); }

/* ───────────── Listen: Dokumente, Aktivität ───────────── */
.doclist { list-style: none; margin: 0; padding: 0; }
.doclist li { display: grid; grid-template-columns: 32px 1fr auto; gap: var(--s-3); align-items: center; padding: 0.6rem 0; border-top: 1px solid var(--line); }
.doclist li:first-child { border-top: 0; }
.doclist .ftype { width: 32px; height: 38px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-family: var(--mono); font-size: 9px; font-weight: 600; color: var(--ink-3); }
.doclist .ftype--pdf { color: var(--danger); }
.doclist .ftype--sys { color: var(--petrol-700); background: var(--petrol-50); }
.doclist a { font-weight: 600; text-decoration: none; color: var(--ink); font-size: var(--fs-sm); }
.doclist a:hover { color: var(--petrol-700); text-decoration: underline; }
.doclist .meta { display: block; font-size: var(--fs-xs); color: var(--ink-3); }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 28px 1fr; gap: var(--s-3); padding-bottom: var(--s-4); position: relative; }
.feed li:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 4px; width: 2px; background: var(--line); }
.feed .avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff; background: var(--ink-3); }
.feed .avatar--sb { background: var(--who-sb); } .feed .avatar--vs { background: var(--who-vs); } .feed .avatar--at { background: var(--who-at); } .feed .avatar--sys { background: var(--line-strong); color: var(--ink-2); }
.feed .head { display: flex; gap: var(--s-2); align-items: baseline; flex-wrap: wrap; font-size: var(--fs-sm); }
.feed .head strong { font-weight: 600; }
.feed time { font-size: var(--fs-xs); color: var(--ink-3); }
.feed .bubble { margin-top: 0.35rem; padding: 0.6rem 0.8rem; border-radius: var(--r-md); background: var(--surface-2); font-size: var(--fs-sm); white-space: pre-line; }
.feed .bubble--at { background: var(--who-at-bg); }
.feed .event { margin-top: 0.15rem; font-size: var(--fs-sm); color: var(--ink-2); }

/* ───────────── Overflow-Menü ───────────── */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu__list { position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-2); padding: 0.35rem; z-index: 40; }
.menu__list a, .menu__list button { display: block; width: 100%; text-align: left; background: none; border: 0; font: inherit; font-size: var(--fs-sm); color: var(--ink); padding: 0.5rem 0.65rem; border-radius: var(--r-sm); text-decoration: none; cursor: pointer; }
.menu__list a:hover, .menu__list button:hover { background: var(--surface-2); }
.menu__list .danger { color: var(--danger); }
.menu__list hr { border: 0; border-top: 1px solid var(--line); margin: 0.3rem 0; }

/* ───────────── Dialog / Side-Sheet ───────────── */
dialog.sheet { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(560px, 100vw); max-width: 100vw; border: 0; padding: 0; background: var(--surface); box-shadow: var(--shadow-2); display: none; flex-direction: column; }
dialog.sheet[open] { display: flex; animation: sheet-in .22s var(--ease); }
dialog.sheet::backdrop { background: rgba(0, 37, 42, 0.32); }
.sheet__head { padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--line); display: flex; gap: var(--s-3); align-items: flex-start; }
.sheet__head h2 { font-size: var(--fs-lg); }
.sheet__head .close { margin-left: auto; }
.sheet__body { padding: var(--s-5); overflow-y: auto; flex: 1; }
.sheet__body > section + section { margin-top: var(--s-5); padding-top: var(--s-5); border-top: 1px solid var(--line); }
.sheet__foot { padding: var(--s-3) var(--s-5) var(--s-4); border-top: 1px solid var(--line); background: var(--surface-2); }
.transition-line { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-sm); color: var(--ink-2); margin-top: 2px; }
@keyframes sheet-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

dialog.modal { border: 0; border-radius: var(--r-lg); padding: 0; width: min(520px, calc(100vw - 2rem)); box-shadow: var(--shadow-2); background: var(--surface); }
dialog.modal::backdrop { background: rgba(0, 37, 42, 0.32); }
dialog.modal h2 { font-size: var(--fs-lg); }
dialog.sheet > form { display: contents; }

/* ───────────── Layouts ───────────── */
.case { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s-5); align-items: start; }
.case__rail { position: sticky; top: 72px; display: flex; flex-direction: column; gap: var(--s-4); }
.case-head { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s-4); align-items: center; margin-bottom: var(--s-4); }
.case-head h1 { font-size: var(--fs-xl); display: flex; gap: var(--s-3); align-items: baseline; flex-wrap: wrap; }
.case-head h1 .mono { font-size: var(--fs-md); color: var(--ink-3); font-weight: 600; }
.case-head .sub { color: var(--ink-2); font-size: var(--fs-sm); margin-top: 2px; }
.case-head .row { margin-top: var(--s-2); }
.case-progress { padding: var(--s-4) var(--s-5) var(--s-3); margin-bottom: var(--s-5); }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 360px); gap: var(--s-5); align-items: start; }
.center-card { max-width: 480px; margin: var(--s-7) auto; }

/* ───────────── Hilfsklassen ───────────── */
.h-card { font-size: var(--fs-md); font-weight: 600; }
.mt-1, [data-mt="1"] { margin-top: var(--s-1); } .mt-2, [data-mt="2"] { margin-top: var(--s-2); } .mt-3, [data-mt="3"] { margin-top: var(--s-3); } .mt-4, [data-mt="4"] { margin-top: var(--s-4); }
.fieldset-reset { border: 0; padding: 0; margin: 0; min-width: 0; }
.fieldset-reset > legend { font-size: var(--fs-sm); font-weight: 600; margin-bottom: var(--s-2); padding: 0; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff; background: var(--ink-3); flex: none; }
.avatar--sb { background: var(--who-sb); } .avatar--vs { background: var(--who-vs); } .avatar--at { background: var(--who-at); } .avatar--sys { background: var(--line-strong); color: var(--ink-2); }
.amount-xl { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: var(--fs-xl); font-weight: 600; }
.summary-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.quote { margin: 0; padding: 0.7rem 0.9rem; border-radius: var(--r-md); background: var(--who-at-bg); font-size: var(--fs-sm); white-space: pre-line; }
.inline-list { margin: var(--s-1) 0 0; padding-left: 1.1rem; }
.link-summary { cursor: pointer; color: var(--petrol-700); font-weight: 600; font-size: var(--fs-sm); }
details.card > summary { list-style: none; cursor: pointer; padding-bottom: var(--s-4); }
details.card > summary::-webkit-details-marker { display: none; }
details.card[open] > summary { padding-bottom: 0; }
.table tfoot td { padding: 0.75rem var(--s-3); border-bottom: 0; }
.table tr.is-rejected td { opacity: .5; }
.table tr.is-rejected .t-main a { text-decoration: line-through; }

/* ───────────── Prototyp-Werkzeugleiste (nicht portieren) ───────────── */
.proto-bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 90; display: flex; gap: var(--s-2); align-items: center; padding: 0.4rem 0.5rem 0.4rem 0.8rem; background: #1b1f1e; color: #e8eceb; border-radius: var(--r-pill); box-shadow: var(--shadow-2); font-size: var(--fs-xs); max-width: calc(100vw - 24px); overflow-x: auto; }
.proto-bar b { color: #9fd3c7; font-weight: 600; white-space: nowrap; }
.proto-bar select, .proto-bar a { background: #2b302f; color: #fff; border: 1px solid #3c4241; border-radius: var(--r-pill); padding: 0.3rem 0.65rem; font: inherit; font-size: var(--fs-xs); text-decoration: none; white-space: nowrap; }

/* ───────────── Responsive ───────────── */
@media (max-width: 1080px) {
  .case { grid-template-columns: 1fr; }
  .case__rail { position: static; }
  .split { grid-template-columns: 1fr; }
  .appbar__search input { width: 180px; }
}
@media (max-width: 720px) {
  .container { padding: 0 var(--s-4); }
  body { font-size: 1rem; }
  h1 { font-size: var(--fs-xl); }
  .appbar__inner { gap: var(--s-3); height: auto; min-height: 56px; flex-wrap: wrap; padding: var(--s-2) 0; }
  .appbar__nav { order: 3; width: 100%; overflow-x: auto; }
  .appbar__search { display: none; }
  .appbar__user span { display: none; }
  .case-head { grid-template-columns: auto 1fr; }
  .case-head > :last-child { grid-column: 1 / -1; }
  .stepper { grid-template-columns: repeat(5, minmax(64px, 1fr)); overflow-x: auto; }
  .stepper .step-sub { display: none; }
  .dl { grid-template-columns: 1fr; }
  .dl dt { padding-bottom: 0; border-top: 1px solid var(--line); }
  .dl dd { border-top: 0; padding-top: 0.15rem; }
  .field-grid { grid-template-columns: 1fr; }
  .btn { min-height: 44px; }
  .next__foot .btn { flex: 1 1 auto; }
  .table--cards thead { display: none; }
  .table--cards, .table--cards tbody, .table--cards tr, .table--cards td { display: block; width: 100%; }
  .table--cards tr { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); }
  .table--cards td { border: 0; padding: 0.15rem 0; }
  .table--cards td[data-label]::before { content: attr(data-label) " · "; color: var(--ink-3); font-size: var(--fs-xs); }
  .table--cards .t-num { text-align: left; }
  .proto-bar {
    position: relative;
    left: auto;
    bottom: auto;
    transform: none;
    width: max-content;
    margin: var(--s-4) auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
