/* ============================================================
   FI5 Prognose & Quartalsberichte — Designsystem (Restyle 2026)
   Ideenwelt: gedruckter Quartalsbericht trifft moderne Oberfläche.
   Serif-Display für Titel, Inter für Daten, doppelte Abschluss-
   linie (Buchhaltung) für Ergebniszeilen, Ist-Monate "fixiert".
   ============================================================ */

/* ---------- Schriftarten (selbst gehostet, latin) ---------- */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/fonts/inter-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/static/fonts/inter-500.woff2") format("woff2");
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/static/fonts/inter-600.woff2") format("woff2");
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/static/fonts/inter-700.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/static/fonts/sourceserif4-600.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/static/fonts/sourceserif4-700.woff2") format("woff2");
}

/* ---------- Tokens ---------- */
:root {
  --paper: #f5f7fa;          /* Seitenhintergrund, kühl-hell */
  --card: #ffffff;
  --ink: #16232f;            /* Textfarbe, dunkles Blaugrau */
  --muted: #5e6d7e;
  --faint: #8b98a7;
  --line: #e7ebf1;           /* Hairlines */
  --line-strong: #d5dce4;
  --blue: #1c56c5;           /* Hanseblau */
  --blue-ink: #14418f;
  --blue-soft: #edf3fd;
  --green: #0f7b3f;  --green-soft: #e9f6ee;
  --amber: #96590a;  --amber-soft: #fcf3e1;
  --red:   #b3261e;  --red-soft:   #fdeceb;
  --slate: #64748b;  --slate-soft: #eef1f5;   /* Ist/festgestellt */
  --radius: 12px;
  --radius-s: 8px;
  --shadow: 0 1px 2px rgba(22,35,47,.05), 0 2px 6px rgba(22,35,47,.05);
  --shadow-lg: 0 4px 10px rgba(22,35,47,.08), 0 12px 32px rgba(22,35,47,.10);
  --ring: 0 0 0 3px rgba(28,86,197,.18);
  --sans: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
}

/* ---------- Basis ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 14px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-ink); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
p { margin: 0 0 10px; }
code, pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 4px; }

/* ---------- Kopfzeile: eine Zeile, ruhig ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1440px; margin: 0 auto; padding: 0 24px;
  height: 56px; display: flex; align-items: center; gap: 22px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); flex: none; }
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--blue);
  color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .02em;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 2px rgba(28,86,197,.35);
}
.brand-text { font-size: 14px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.brand-text small { display: block; font-size: 10.5px; font-weight: 500; color: var(--faint); letter-spacing: .04em; text-transform: uppercase; }

.mainnav { display: flex; align-items: center; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.mainnav::-webkit-scrollbar { display: none; }
.navlink {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 11px; border-radius: 8px; white-space: nowrap;
  font-size: 13.5px; font-weight: 500; color: var(--muted);
  border: none; background: none; cursor: pointer; font-family: inherit;
}
.navlink:hover { color: var(--ink); background: var(--slate-soft); }
.navlink.active { color: var(--blue-ink); background: var(--blue-soft); font-weight: 600; }

/* Dropdowns im Kopf ("Mehr", Avatar) */
.navmore, .usermenu { position: relative; }
.menu {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 60;
  min-width: 220px; padding: 6px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-lg);
}
.menu-right { left: auto; right: 0; }
.menu.open { display: block; }
.menu-item {
  display: block; padding: 8px 10px; border-radius: 7px;
  color: var(--ink); font-size: 13.5px; font-weight: 500;
}
.menu-item:hover { background: var(--slate-soft); color: var(--ink); }
.menu-item.active { color: var(--blue-ink); background: var(--blue-soft); }
.menu-danger { color: var(--red); }
.menu-danger:hover { background: var(--red-soft); color: var(--red); }
.menu-head {
  padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line);
}
.menu-head b { display: block; font-size: 13.5px; font-weight: 600; }
.menu-head span { font-size: 12px; color: var(--muted); }
.menu-label {
  display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--faint); margin: 10px 0 6px;
}
.chev { width: 10px; height: 10px; flex: none; opacity: .55; }

.userbar { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.avatar-btn {
  display: flex; align-items: center; gap: 9px;
  padding: 4px 8px 4px 4px; border: none; background: none; cursor: pointer;
  border-radius: 999px; font-family: inherit;
}
.avatar-btn:hover { background: var(--slate-soft); }
.avatar {
  width: 30px; height: 30px; border-radius: 999px; flex: none;
  background: var(--blue-soft); color: var(--blue-ink);
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(28,86,197,.25);
}
.userchip-meta { text-align: left; line-height: 1.2; }
.userchip-name { display: block; font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.userchip-role { display: block; font-size: 11px; color: var(--faint); white-space: nowrap; }
.demo-switch { padding: 8px 10px 4px; min-width: 220px; }
.demo-switch select { width: 100%; margin-bottom: 8px; }
.demo-switch .btn { width: 100%; }

/* Demo-Hinweis: schlank, ausblendbar */
.demobar {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  max-width: 1440px; margin: 10px auto 0; padding: 5px 12px;
  width: calc(100% - 48px);
  background: var(--amber-soft); color: var(--amber);
  border: 1px solid rgba(150,89,10,.18); border-radius: 8px;
  font-size: 12px; line-height: 1.4;
}
.demobar b { font-weight: 600; }
.demobar-x {
  margin-left: 4px; border: none; background: none; cursor: pointer;
  color: var(--amber); font-size: 14px; line-height: 1; padding: 2px 4px;
  border-radius: 4px; font-family: inherit;
}
.demobar-x:hover { background: rgba(150,89,10,.12); }

/* ---------- Inhalt ---------- */
.content { max-width: 1440px; margin: 0 auto; padding: 28px 24px 60px; }
.pagehead {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.pagehead h1 {
  font-family: var(--serif); font-size: 25px; font-weight: 600;
  letter-spacing: -.01em; color: var(--ink);
}
.subtitle { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 980px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Karten ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 18px; min-width: 0;
}
.card > h2, .card > h3, .card-inner > h2 {
  font-size: 13px; font-weight: 600; letter-spacing: .02em;
  color: var(--ink); margin: 0 0 14px;
}
.card-table { padding: 0; overflow: hidden; }
.card-table > h2, .card-table > h3 {
  padding: 14px 20px 12px; margin: 0; border-bottom: 1px solid var(--line);
  font-size: 13px; font-weight: 600; letter-spacing: .02em;
}
.card-table .scroll-x, .card-table table.tbl { margin: 0; }

/* Statzellen: Zahl über Label (KPI-Stil) */
.statrow { display: flex; gap: 34px; flex-wrap: wrap; }
.stat { display: inline-flex; flex-direction: column; gap: 3px; }
.stat .stat-num { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1; }
.stat .stat-label { font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }

/* Key-Value */
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 22px; }
.kv { display: flex; gap: 8px; align-items: baseline; padding: 3px 0; }
.kv-label { flex: none; min-width: 130px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); }
.kv-value { font-size: 13.5px; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em; white-space: nowrap;
}
.badge-ico { font-size: 7px; line-height: 1; opacity: .75; }
.b-gray { background: var(--slate-soft); color: var(--slate); }
.b-blue { background: var(--blue-soft); color: var(--blue-ink); }
.b-green { background: var(--green-soft); color: var(--green); }
.b-amber { background: var(--amber-soft); color: var(--amber); }
.b-red { background: var(--red-soft); color: var(--red); }
.b-dark { background: var(--ink); color: #fff; }

.pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  background: var(--slate-soft); color: var(--muted);
  font-size: 11.5px; font-weight: 600;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: var(--radius-s);
  border: 1px solid var(--line-strong); background: var(--card); color: var(--ink);
  font: 600 13px/1 var(--sans); cursor: pointer; text-decoration: none;
  transition: background .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.btn:hover { background: var(--slate-soft); color: var(--ink); }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 1px 2px rgba(28,86,197,.3); }
.btn-primary:hover { background: var(--blue-ink); border-color: var(--blue-ink); color: #fff; }
.btn-ghost { border-color: transparent; background: none; color: var(--blue); }
.btn-ghost:hover { background: var(--blue-soft); }
.btn-danger { background: var(--card); border-color: rgba(179,38,30,.35); color: var(--red); }
.btn-danger:hover { background: var(--red-soft); color: var(--red); }
.btn-small { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-large { height: 40px; padding: 0 20px; font-size: 14px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Formulare ---------- */
input[type="text"], input[type="password"], input[type="number"], input[type="date"], select, textarea {
  height: 34px; padding: 0 10px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-s); background: var(--card); color: var(--ink);
  font: 400 13.5px/1.4 var(--sans); transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; padding: 8px 10px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: var(--ring); }
select { cursor: pointer; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); }
.wrap-form { flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 16px; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.form-grid label, .form-row label, .form-grid > * { min-width: 0; }
.form-row > label { flex: 1 1 170px; }
.form-grid label > select, .form-grid label > input,
.form-row label > select, .form-row label > input { width: 100%; }
select { max-width: 100%; }
.form-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.checkbox-label { display: flex; gap: 8px; align-items: center; font-size: 13.5px; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--blue); }
label { color: var(--ink); }
.hint { font-size: 12px; color: var(--muted); }
.hint-inline { font-size: 12px; color: var(--faint); }
.text-danger { color: var(--red); }

.sticky-actions {
  position: sticky; bottom: 0; z-index: 30;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 12px 16px; margin: 18px 0;
  background: rgba(255,255,255,.94); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}

/* ---------- Tabellen ---------- */
.scroll-x { overflow-x: auto; margin: 0 0 4px; }
table.tbl {
  width: 100%; border-collapse: collapse; font-size: 13px; color: var(--ink);
}
.tbl th {
  text-align: left; padding: 8px 10px; white-space: nowrap;
  font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--faint); border-bottom: 1px solid var(--line-strong);
}
.tbl td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tbody tr:hover td { background: #f9fbfd; }
.tbl th.num, .tbl td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl td.ist { color: var(--ink); font-weight: 500; }
.tbl td.ref { color: var(--muted); }
.tbl td.total, .tbl td.sum { font-weight: 600; }
td.actions { display: table-cell; text-align: right; vertical-align: middle; white-space: nowrap; }
.tbl th.hint, .tbl th.th-hint { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); font-size: 11px; }
.tbl .row-total td { font-weight: 600; border-top: 2px solid var(--ink); }
.tbl .row-result td { font-weight: 700; border-top: 3px double var(--ink); font-size: 13.5px; }
.tbl .row-filtered td, .row-filtered { color: var(--faint); font-style: italic; }
.tbl-mini { font-size: 12px; }
.tbl-mini th, .tbl-mini td { padding: 5px 8px; }
.tbl-plain, .tbl-plain td { border: none; }
.tbl-report td { padding: 8px 10px; }
tr.row-total:hover td, tr.row-result:hover td { background: transparent; }

/* Eingabezellen */
.cell-input {
  width: 104px; text-align: right; font-variant-numeric: tabular-nums;
  background: #fbfcfe; border-color: var(--line);
  padding: 4px 8px; height: 30px; font-size: 13px;
}
.cell-input:hover { border-color: var(--line-strong); }
.cell-input:focus { background: #fff; border-color: var(--blue); box-shadow: var(--ring); }
.cell-input.qty { width: 72px; }
.cell-ro { display: inline-block; min-width: 70px; text-align: right; font-variant-numeric: tabular-nums; padding: 5px 8px; }
.cell-changed { background: var(--amber-soft) !important; border-radius: 4px; }
.empty-cell { color: var(--faint); }
.pos-col { min-width: 220px; }

/* Legende der Eingabemaske (Signatur: Ist = fixiert, Prognose = offen) */
.legend { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin: 2px 0 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.sw { width: 14px; height: 14px; border-radius: 3px; display: inline-block; flex: none; }
.sw-ist { background: var(--slate-soft); border: 1px solid var(--line-strong); }
.sw-edit { background: #fbfcfe; border: 1.5px solid var(--blue); }
.sw-prog { background: var(--blue-soft); border: 1px solid rgba(28,86,197,.3); }
.sw-budget { background: var(--amber-soft); border: 1px solid rgba(150,89,10,.25); }
.sw-sum { background: var(--card); border: 1px solid var(--line-strong); border-bottom: 3px double var(--ink); }

/* ---------- Tabs ---------- */
.tabs {
  display: flex; gap: 2px; align-items: center; border-bottom: 1px solid var(--line);
  margin-bottom: 18px; overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 9px 14px; margin-bottom: -1px; white-space: nowrap;
  color: var(--muted); font-size: 13.5px; font-weight: 500;
  border-bottom: 2px solid transparent; border-radius: 6px 6px 0 0;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--blue-ink); font-weight: 600; border-bottom-color: var(--blue); }
.tab small { display: block; font-size: 10.5px; font-weight: 500; color: var(--faint); letter-spacing: .02em; }
.tab.active small { color: var(--blue-ink); opacity: .75; }
.tabs-small .tab { padding: 6px 10px; font-size: 12.5px; }
.report-tabs { margin-bottom: 14px; }
.report-tabs .tab { padding: 8px 12px; font-size: 13px; }

/* ---------- Hinweise, Meldungen ---------- */
.notice { padding: 10px 14px; border-radius: var(--radius-s); font-size: 13px; margin: 0 0 14px; border: 1px solid transparent; }
.notice-info { background: var(--blue-soft); color: var(--blue-ink); border-color: rgba(28,86,197,.15); }
.notice-warn { background: var(--amber-soft); color: var(--amber); border-color: rgba(150,89,10,.18); }
.notice-lock { background: var(--slate-soft); color: var(--slate); border-color: var(--line-strong); }
.warn-inline { color: var(--amber); font-weight: 500; }
.demo-note {
  padding: 8px 14px; border-radius: var(--radius-s); font-size: 12px;
  background: var(--amber-soft); color: var(--amber);
  border: 1px solid rgba(150,89,10,.18); margin: 10px 0 0;
}
.report-meta {
  display: flex; gap: 6px 18px; flex-wrap: wrap; align-items: center;
  font-size: 12.5px; color: var(--muted); padding: 10px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-s);
  margin-bottom: 16px;
}
.report-meta b { color: var(--ink); font-weight: 600; }

.flash { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius-s); font-size: 13.5px; margin-bottom: 10px; border: 1px solid transparent; }
.flash-info { background: var(--blue-soft); color: var(--blue-ink); border-color: rgba(28,86,197,.15); }
.flash-success, .flash-ok { background: var(--green-soft); color: var(--green); border-color: rgba(15,123,63,.18); }
.flash-error, .flash-danger { background: var(--red-soft); color: var(--red); border-color: rgba(179,38,30,.2); }
.flash-warn { background: var(--amber-soft); color: var(--amber); border-color: rgba(150,89,10,.18); }
.flashes { margin-bottom: 6px; }

.muted { color: var(--muted); }
.muted-block { color: var(--muted); font-size: 13px; max-width: 70ch; }
.muted-code { display: block; background: var(--slate-soft); padding: 10px 12px; border-radius: var(--radius-s); font-size: 12px; overflow-x: auto; white-space: pre-wrap; }
td .muted-code, .tbl .muted-code {
  display: inline-block; background: none; padding: 0; margin: 3px 0 0;
  font-size: 10.5px; letter-spacing: .04em; color: var(--faint); white-space: nowrap;
}

/* ---------- Leere Zustände ---------- */
.empty { text-align: center; padding: 44px 20px; }
.empty-ico {
  width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 12px;
  background: var(--blue-soft); color: var(--blue-ink);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.empty-title { font-weight: 600; font-size: 14px; margin: 0 0 4px; }
.empty-hint { color: var(--muted); font-size: 13px; max-width: 46ch; margin: 0 auto 12px; }

/* ---------- Fortschritt, Flags, kleine Bausteine ---------- */
.progress { height: 6px; border-radius: 999px; background: var(--slate-soft); overflow: hidden; min-width: 90px; }
.progress > * { display: block; height: 100%; background: var(--blue); border-radius: 999px; }
.flag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 600; background: var(--slate-soft); color: var(--slate); }
.flag-missing { background: var(--amber-soft); color: var(--amber); }
.flag-test { background: var(--blue-soft); color: var(--blue-ink); }

.chain { border-left: 2px solid var(--line-strong); margin: 10px 0 0 8px; padding-left: 16px; }
.chain .card { margin-bottom: 10px; padding: 12px 16px; }
.rev-details, .return-reason {
  background: var(--slate-soft); border-radius: var(--radius-s);
  padding: 10px 12px; font-size: 13px; margin-top: 10px;
}
.return-reason { background: var(--amber-soft); color: var(--amber); }

.comment-form { display: grid; gap: 8px; }
.comment-form textarea { min-height: 70px; }
.draft-box { border: 1px dashed var(--line-strong); border-radius: var(--radius-s); padding: 12px 14px; background: #fbfcfe; margin: 10px 0; font-size: 13.5px; }
.ai-origin { display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 600; color: var(--faint); letter-spacing: .02em; }

.submit-card { border: 1px solid rgba(28,86,197,.25); background: linear-gradient(180deg, var(--blue-soft), var(--card) 70%); }

/* ---------- Diagramme ---------- */
.chart-card { padding: 14px 16px; }
.chart { max-width: 100%; height: auto; }
.chart-axis { font-size: 10px; fill: var(--faint); }
.chart-label { font-size: 11px; fill: var(--ink); font-weight: 500; }
.chart-zero { stroke: var(--line-strong); stroke-width: 1; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.bar { rx: 3; }
.bar-ist { fill: var(--slate); }
.bar-prog { fill: var(--blue); }
.bar-budget { fill: var(--amber-soft); stroke: rgba(150,89,10,.4); stroke-width: 1; }

.bridge { display: flex; gap: 8px; align-items: flex-end; overflow-x: auto; padding: 10px 0; }
.bridge-col { min-width: 86px; text-align: center; font-size: 12px; }
.deviation { font-variant-numeric: tabular-nums; }
.neg { color: var(--red); }
.pos { color: var(--green); }
.mini { font-size: 11px; color: var(--faint); }
.mn { font-variant-numeric: tabular-nums; }
.mn.current { font-weight: 600; }
.mn.proposed { color: var(--faint); font-size: 11.5px; }

/* Validation-Zeilen (Import) */
.val-errors td, .val .text-danger { color: var(--red); }

/* ---------- Login & Fehler ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; flex-direction: column; }
.login-card {
  width: 100%; max-width: 380px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 28px;
}
.login-card h1 { font-family: var(--serif); font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.login-card .btn { width: 100%; margin-top: 4px; }
.login-demo { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.login-demo-title { font-weight: 600; color: var(--ink); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 6px; }
.login-demo-hint { font-size: 12px; color: var(--faint); }
.errorpage { text-align: center; padding: 80px 20px; }
.error-code { font-family: var(--serif); font-size: 56px; font-weight: 700; color: var(--line-strong); letter-spacing: -.02em; }

/* ---------- Fußzeile ---------- */
.footer {
  max-width: 1440px; margin: 0 auto; padding: 18px 24px 28px;
  border-top: 1px solid var(--line); color: var(--faint); font-size: 12px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}

/* ---------- Responsive ---------- */
@media (max-width: 1120px) {
  .userchip-meta { display: none; }
  .brand-text { display: none; }
}
@media (max-width: 720px) {
  .topbar-inner { padding: 0 14px; gap: 10px; }
  .content { padding: 18px 14px 48px; }
  .pagehead { align-items: flex-start; flex-direction: column; }
  .pagehead h1 { font-size: 21px; }
  .kv-grid { grid-template-columns: 1fr; }
  .pos-col { min-width: 160px; }
  .inline-form { display: flex; width: 100%; }
  .inline-form > label { min-width: 0; flex: 1 1 150px; }
  .inline-form select, .inline-form input[type="text"], .inline-form input[type="number"] { width: 100%; min-width: 0; flex: 1 1 150px; }
  .wrap-form select, .wrap-form input { min-width: 0; }
  .demobar { width: calc(100% - 28px); font-size: 11px; }
  .statrow { gap: 18px; }
  .footer { flex-direction: column; gap: 4px; }
}

/* ---------- Druck ---------- */
@media print {
  .topbar, .demobar, .mainnav, .userbar, .actions, .actions-row, .sticky-actions,
  .toolbar, .btn, .footer, .tabs, .flashes { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ccc; }
}

/* ---------- Reduzierte Bewegung ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
