/* DNA Finanzen — gleiche Formensprache wie die Content-Engine:
   heller Grund, Haarlinien statt Schatten, keine Rundungen, Flaeche statt Dekoration. */

:root {
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, Consolas, "JetBrains Mono", monospace;

  --bg: #ffffff;
  --bg-sunken: #f6f8fa;
  --bg-nav: #fbfcfd;

  --text: #0b1220;
  --text-secondary: #556071;
  --text-muted: #8a94a3;

  --line: #e4e8ee;
  --line-strong: #cdd4dd;

  --accent: #0050b0;
  --accent-hover: #003f8c;
  --accent-wash: #eef4fc;
  --accent-line: #b9d2ee;

  --ok: #15803d;
  --ok-wash: #eaf6ee;
  --warn: #a35a06;
  --warn-wash: #fdf3e5;
  --err: #c02626;
  --err-wash: #fdeded;

  --nav-w: 208px;
  --head-h: 52px;
}

* { box-sizing: border-box; margin: 0; }
html, body { overflow-x: hidden; max-width: 100%; }

body {
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.5;
  letter-spacing: .01em;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Kopfzeile ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--head-h); z-index: 20;
  display: flex; align-items: center; padding: 0 20px;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 9px; }
.brand-mark { font-weight: 700; font-size: 15px; letter-spacing: .04em; }
.brand-sub {
  font-size: 9px; letter-spacing: .28em; text-transform: uppercase;
  color: var(--text-muted); padding-left: 9px; border-left: 1px solid var(--line-strong);
}
.topbar-tabs { display: flex; align-self: stretch; margin-left: 28px; margin-right: auto; }
.apptab {
  display: flex; align-items: center; padding: 0 16px;
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.apptab:hover { color: var(--text); }
.apptab.active { color: var(--text); border-bottom-color: var(--accent); }
.topbar-right { display: flex; align-items: center; gap: 16px; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; top: var(--head-h); bottom: 0; left: 0; width: var(--nav-w); z-index: 10;
  padding: 16px 0; background: var(--bg-nav); border-right: 1px solid var(--line);
  overflow-y: auto;
}
.nav-gruppe {
  padding: 14px 20px 6px; font-size: 9px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--text-muted);
}
.nav-item {
  display: block; width: 100%; text-align: left; padding: 7px 20px;
  background: none; border: none; border-left: 2px solid transparent;
  font: inherit; font-size: 13px; color: var(--text-secondary); cursor: pointer;
}
.nav-item:hover { background: var(--bg-sunken); color: var(--text); }
.nav-item.active {
  background: var(--accent-wash); border-left-color: var(--accent);
  color: var(--accent); font-weight: 500;
}

/* ---------- Inhalt ---------- */
main { margin: var(--head-h) 0 0 var(--nav-w); padding: 26px 32px 80px; max-width: 1180px; }
.view { display: none; }
.view.active { display: block; }

h1 { font-size: 19px; font-weight: 600; letter-spacing: -.01em; margin-bottom: 4px; }
h2 { font-size: 14px; font-weight: 600; margin: 26px 0 10px; }
.lead { color: var(--text-secondary); margin-bottom: 20px; max-width: 76ch; }

.karte { border: 1px solid var(--line); padding: 18px 20px; margin-bottom: 16px; background: var(--bg); }
.karte h2 { margin-top: 0; }

/* Kennzahlen */
.zahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 20px; }
.zahl { background: var(--bg); padding: 14px 16px; }
.zahl b { display: block; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 5px; font-weight: 500; }
.zahl span { font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.zahl small { display: block; font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.zahl.gut span { color: var(--ok); }
.zahl.schlecht span { color: var(--err); }

/* Tabellen */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; padding: 8px 10px; font-size: 9px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-muted); font-weight: 500;
  border-bottom: 1px solid var(--line-strong); white-space: nowrap;
}
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:hover td { background: var(--bg-sunken); }
td.zahl-r, th.zahl-r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabelle-huelle { overflow-x: auto; border: 1px solid var(--line); }
.storniert td { color: var(--text-muted); text-decoration: line-through; }
.storno td { color: var(--warn); }

/* Formulare */
.feld { margin-bottom: 12px; }
.feld label { display: block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
input, select, textarea {
  width: 100%; padding: 7px 9px; font: inherit; font-size: 13px;
  border: 1px solid var(--line-strong); background: var(--bg); color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-line); outline-offset: -1px; border-color: var(--accent); }
input[type=checkbox] { width: auto; }
.reihe { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.hinweis-klein { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

button {
  padding: 7px 16px; font: inherit; font-size: 12px; font-weight: 500;
  background: var(--accent); color: #fff; border: 1px solid var(--accent); cursor: pointer;
}
button:hover { background: var(--accent-hover); }
button.sek { background: none; color: var(--text-secondary); border-color: var(--line-strong); }
button.sek:hover { background: var(--bg-sunken); color: var(--text); }
button.gefahr { background: none; color: var(--err); border-color: var(--err); }
button.gefahr:hover { background: var(--err-wash); }
button:disabled { opacity: .45; cursor: not-allowed; }
.knopfreihe { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }

.linkbtn {
  background: none; border: none; padding: 0; cursor: pointer; font: inherit;
  font-size: 11px; color: var(--text-muted); letter-spacing: .06em; text-transform: uppercase;
}
.linkbtn:hover { color: var(--accent); }
a { color: var(--accent); }

/* Kennzeichen */
.chip {
  display: inline-block; padding: 2px 7px; font-size: 10px; letter-spacing: .06em;
  text-transform: uppercase; border: 1px solid var(--line-strong); color: var(--text-muted);
  white-space: nowrap;
}
.chip.ok { color: var(--ok); border-color: var(--ok); background: var(--ok-wash); }
.chip.warn { color: var(--warn); border-color: var(--warn); background: var(--warn-wash); }
.chip.err { color: var(--err); border-color: var(--err); background: var(--err-wash); }
.chip.info { color: var(--accent); border-color: var(--accent-line); background: var(--accent-wash); }

/* Meldungen */
.meldung { padding: 10px 14px; margin-bottom: 14px; border-left: 2px solid; font-size: 13px; }
.meldung.ok { background: var(--ok-wash); border-color: var(--ok); color: #14532d; }
.meldung.err { background: var(--err-wash); border-color: var(--err); color: #7f1d1d; }
.meldung.warn { background: var(--warn-wash); border-color: var(--warn); color: #713f12; }
.meldung.info { background: var(--accent-wash); border-color: var(--accent-line); color: #1e3a5f; }

/* Fristen */
.frist { display: flex; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.frist:last-child { border-bottom: none; }
.frist-datum { font-variant-numeric: tabular-nums; font-weight: 600; width: 92px; flex-shrink: 0; }
.frist-text { flex: 1; }
.frist-text small { display: block; color: var(--text-muted); font-size: 11.5px; margin-top: 2px; max-width: 70ch; }
.frist.rot .frist-datum { color: var(--err); }
.frist.gelb .frist-datum { color: var(--warn); }
.frist.vorbei { opacity: .5; }

/* Checkliste */
.check { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: none; }
.check input { width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0; }
.check-text { flex: 1; }
.check-text b { font-size: 13.5px; }
.check-text p { color: var(--text-secondary); margin-top: 3px; font-size: 12.5px; max-width: 78ch; }
.check.fertig .check-text b { color: var(--text-muted); text-decoration: line-through; }

/* Anmeldung */
.login { max-width: 320px; margin: 14vh auto; padding: 0 20px; }
.login h1 { margin-bottom: 6px; }
.login p { color: var(--text-secondary); margin-bottom: 20px; font-size: 13px; }
.login button { width: 100%; margin-top: 10px; padding: 9px; }

/* Verlaufsbalken */
.balken { display: flex; align-items: flex-end; gap: 3px; height: 90px; margin-top: 10px; }
.balken-monat { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; }
.balken-stab { width: 100%; background: var(--accent); min-height: 1px; }
.balken-stab.minus { background: var(--err); }
.balken-monat small { font-size: 9px; color: var(--text-muted); }

/* Verfahrensdoku */
.doku-abschnitt { margin-bottom: 18px; }
.doku-abschnitt b { display: block; font-size: 13px; margin-bottom: 4px; }
.doku-abschnitt p { color: var(--text-secondary); max-width: 82ch; line-height: 1.65; }

/* Handy */
@media (max-width: 860px) {
  :root { --nav-w: 0px; }
  .nav {
    position: static; width: auto; height: auto; border-right: none;
    border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap;
    padding: 6px; margin-top: var(--head-h);
  }
  .nav-gruppe { display: none; }
  .nav-item { width: auto; padding: 6px 11px; border-left: none; border-bottom: 2px solid transparent; font-size: 12px; }
  .nav-item.active { border-left: none; border-bottom-color: var(--accent); }
  main { margin: 0; padding: 18px 14px 60px; }
  .topbar { padding: 0 14px; }
  .topbar-tabs { margin-left: 12px; }
  .apptab { padding: 0 10px; font-size: 10px; }
  .brand-sub { display: none; }
}

/* Voranmeldung: Tabelle im Aufbau des amtlichen Vordrucks */
.vordruck td { vertical-align: middle; }
.vordruck .abschnitt td {
  background: var(--bg-sunken); font-size: 11px; font-weight: 600; letter-spacing: .02em;
  color: var(--text-secondary); padding-top: 12px;
}
.vordruck .zeile-nr { color: var(--text-muted); font-variant-numeric: tabular-nums; width: 42px; }
.vordruck .kz { font-family: var(--mono); font-size: 12px; color: var(--accent); width: 34px; white-space: nowrap; }
.vordruck .text { font-size: 12.5px; min-width: 240px; }
.vordruck .wert { text-align: right; width: 150px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vordruck .wert.gerechnet { background: var(--bg-sunken); font-weight: 500; }
.vordruck .wert input { width: 120px; text-align: right; padding: 4px 6px; }
.vordruck .wert input[type=checkbox] { width: auto; }
.vordruck .summe td { font-weight: 600; border-top: 1px solid var(--line-strong); }
.vordruck .kz83 td { background: var(--accent-wash); font-weight: 700; }
.vordruck .herkunft { display: block; font-size: 10px; color: var(--text-muted); font-weight: 400; }
.status-liste { display: grid; gap: 6px; margin: 8px 0 4px; }
.status-liste div { display: flex; gap: 10px; align-items: baseline; font-size: 13px; }
.status-liste .chip { min-width: 64px; text-align: center; }
