/* ═══════════════════════════════════════════════════════════════════════════
   Firmen-Dashboard — Gestaltung
   Am Rechner: Seitenleiste links.  Am Handy: Reiterleiste unten.
   Hell und dunkel folgen dem System, lassen sich aber umschalten.
   ═══════════════════════════════════════════════════════════════════════════ */

:root{
  /* Die Farben stammen aus den beiden Logos: Klarvias Cyan und das Navy von
     Lenz. --f1 ist Klarvia, --f2 ist Lenz — das zieht sich durch alle Zahlen,
     Balken und Punkte, damit man die Firmen nie verwechselt. */
  --ground:#EDF1F5; --surface:#FFFFFF; --surface-2:#F4F7FA; --field:#FAFCFD;
  --ink:#13202C; --ink-2:#394A5A; --muted:#68798B;
  --hair:#DAE1E9; --hair-2:#C1CCD7;
  --accent:#1B6C99; --accent-deep:#124E73; --accent-wash:#1B6C9914;
  --f1:#1B9AC3; --f2:#2E5A82; --f3:#7B5EA7; --f4:#4E8C6A;
  --marke-a:#45BCDD; --marke-b:#1F3D5C;
  --warn:#B45309; --warn-wash:#B4530914;
  --bad:#B4252E; --bad-wash:#B4252E12;
  --shadow:0 1px 2px rgba(19,32,44,.04), 0 8px 24px -14px rgba(19,32,44,.18);
  --sans:-apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,"Helvetica Neue",Arial,sans-serif;
  --mono:ui-monospace,"SF Mono",SFMono-Regular,Menlo,"Cascadia Mono","DejaVu Sans Mono",monospace;
  --r:10px;          /* Felder und Knöpfe */
  --r-karte:18px;    /* Karten — das prägt den Eindruck am stärksten */
  --leiste:238px;
  color-scheme:light;
}

/* ── Dunkel ───────────────────────────────────────────────────────────────
   Zweimal aufgeführt: einmal für die Systemeinstellung, einmal für den
   Schalter in den Einstellungen. Beide Listen müssen gleich bleiben —
   wer hier eine Farbe ändert, ändert sie unten mit.                      */
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --ground:#0C131A; --surface:#141E27; --surface-2:#1A2631; --field:#0F1921;
    --ink:#E5ECF2; --ink-2:#B9C7D3; --muted:#8294A4;
    --hair:#22303C; --hair-2:#334656;
    --accent:#4BA8D8; --accent-deep:#7CC7EC; --accent-wash:#4BA8D81f;
    --f1:#4FC5E4; --f2:#7BA7D0; --f3:#A98FD0; --f4:#78B08F;
    --marke-a:#5FCBE8; --marke-b:#3E6D96;
    --warn:#D3A24A; --warn-wash:#D3A24A1a;
    --bad:#E4707A; --bad-wash:#E4707A1a;
    --shadow:0 1px 2px rgba(0,0,0,.4), 0 10px 28px -16px rgba(0,0,0,.75);
    color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --ground:#0C131A; --surface:#141E27; --surface-2:#1A2631; --field:#0F1921;
  --ink:#E5ECF2; --ink-2:#B9C7D3; --muted:#8294A4;
  --hair:#22303C; --hair-2:#334656;
  --accent:#4BA8D8; --accent-deep:#7CC7EC; --accent-wash:#4BA8D81f;
  --f1:#4FC5E4; --f2:#7BA7D0; --f3:#A98FD0; --f4:#78B08F;
  --marke-a:#5FCBE8; --marke-b:#3E6D96;
  --warn:#D3A24A; --warn-wash:#D3A24A1a;
  --bad:#E4707A; --bad-wash:#E4707A1a;
  --shadow:0 1px 2px rgba(0,0,0,.4), 0 10px 28px -16px rgba(0,0,0,.75);
  color-scheme:dark;
}

*{box-sizing:border-box; margin:0; padding:0}
[hidden]{display:none !important}
html{-webkit-text-size-adjust:100%}
body{
  background:var(--ground); color:var(--ink);
  font-family:var(--sans); font-size:16.5px; line-height:1.55;
  -webkit-font-smoothing:antialiased;
  min-height:100dvh;
}
a{color:var(--accent-deep)}
button{font:inherit; color:inherit}

/* ── Grundgerüst ──────────────────────────────────────────────────────── */
.app{display:grid; grid-template-columns:var(--leiste) 1fr; min-height:100dvh}

.seite{
  grid-column:2; min-width:0;
  padding:clamp(18px,2.4vw,34px) clamp(14px,2.6vw,38px) 90px;
}
.blatt{max-width:1180px; margin:0 auto; display:flex; flex-direction:column; gap:18px}

/* ── Seitenleiste ─────────────────────────────────────────────────────── */
.nav{
  grid-column:1; position:sticky; top:0; align-self:start;
  height:100dvh; overflow-y:auto;
  background:var(--surface); border-right:1px solid var(--hair);
  display:flex; flex-direction:column; gap:4px; padding:20px 12px;
}
.marke{
  display:flex; align-items:center; gap:10px;
  padding:4px 10px 18px; margin-bottom:6px;
  border-bottom:1px solid var(--hair);
}
.marke b{font-size:17px; font-weight:740; letter-spacing:-.015em; line-height:1.2}
.marke small{display:block; font-size:12px; color:var(--muted); font-weight:500; letter-spacing:.02em}
.markenpunkt{width:26px; height:26px; border-radius:6px; flex:none;
  background:linear-gradient(135deg,var(--accent),var(--accent-deep))}

.navknopf{
  display:flex; align-items:center; gap:11px;
  padding:10px 11px; border:0; border-radius:var(--r); background:none;
  text-align:left; cursor:pointer; color:var(--ink-2);
  font-size:15px; font-weight:560; letter-spacing:-.005em; width:100%;
}
.navknopf:hover{background:var(--surface-2); color:var(--ink)}
.navknopf[aria-current="page"]{background:var(--accent-wash); color:var(--accent-deep); font-weight:660}
.navknopf svg{width:19px; height:19px; flex:none; stroke-width:1.7}
.navknopf .kennz{
  margin-left:auto; font-size:12px; font-weight:700; font-variant-numeric:tabular-nums;
  background:var(--bad); color:#fff; border-radius:99px; padding:1px 7px; min-width:20px; text-align:center;
}
.navspalt{flex:1}
.navfuss{border-top:1px solid var(--hair); padding-top:10px; margin-top:8px}

/* ── Kopf einer Ansicht ───────────────────────────────────────────────── */
.kopf{
  display:flex; flex-wrap:wrap; align-items:flex-end; justify-content:space-between;
  gap:12px 22px; border-bottom:2px solid var(--ink); padding-bottom:12px;
}
.kopf h1{font-size:clamp(23px,3.4vw,33px); font-weight:760; letter-spacing:-.02em; line-height:1.12}
.kopf .lede{color:var(--muted); font-size:14.5px; margin-top:3px; max-width:62ch}
.kopfwerkzeug{display:flex; flex-wrap:wrap; gap:8px; align-items:center}

.augenbraue{
  font-size:11.5px; font-weight:730; letter-spacing:.1em; text-transform:uppercase;
  color:var(--muted);
}

/* ── Karten ───────────────────────────────────────────────────────────── */
.karte{
  background:var(--surface); border:1px solid var(--hair); border-radius:var(--r-karte);
  box-shadow:var(--shadow); padding:clamp(16px,2vw,24px); min-width:0;
}
.karte > h2{
  font-size:15px; font-weight:720; letter-spacing:-.01em; margin-bottom:2px;
  display:flex; align-items:center; gap:9px;
}
.karte > .unter{font-size:13px; color:var(--muted); margin-bottom:14px}

.gitter{display:grid; gap:16px}
.gitter--3{grid-template-columns:repeat(auto-fit,minmax(215px,1fr))}
.gitter--2{grid-template-columns:repeat(auto-fit,minmax(290px,1fr))}

/* ── Kennzahl ─────────────────────────────────────────────────────────── */
.kennzahl{display:flex; flex-direction:column; gap:3px}
.kennzahl .titel{
  font-size:12px; font-weight:680; letter-spacing:.07em; text-transform:uppercase; color:var(--muted);
}
.kennzahl .wert{
  font-size:clamp(25px,3.1vw,33px); font-weight:730; letter-spacing:-.025em;
  font-variant-numeric:tabular-nums; line-height:1.05;
}
.kennzahl .wert .eh{font-size:.62em; font-weight:640; color:var(--muted); margin-left:2px}
.kennzahl .fuss{font-size:12.5px; color:var(--muted)}
.kennzahl--stark .wert{color:var(--accent-deep)}
.kennzahl--warn .wert{color:var(--warn)}
.kennzahl--schlecht .wert{color:var(--bad)}

/* ── Balken ───────────────────────────────────────────────────────────── */
.balken{height:7px; border-radius:99px; background:var(--surface-2); overflow:hidden; display:flex}
.balken i{display:block; height:100%}

/* ── Tabelle ──────────────────────────────────────────────────────────── */
.tabhuelle{overflow-x:auto; margin:0 -4px; padding:0 4px}
table.tab{width:100%; border-collapse:collapse; font-variant-numeric:tabular-nums}
table.tab th{
  text-align:left; font-size:11.5px; font-weight:720; letter-spacing:.07em;
  text-transform:uppercase; color:var(--muted);
  padding:0 10px 8px; border-bottom:1px solid var(--hair-2); white-space:nowrap;
}
table.tab td{padding:10px; border-bottom:1px solid var(--hair); font-size:15px; vertical-align:middle}
table.tab tr:last-child td{border-bottom:0}
table.tab .z{text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap}
table.tab tfoot td{font-weight:700; border-top:2px solid var(--hair-2); border-bottom:0}
table.tab tbody tr:hover{background:var(--surface-2)}

.punkt{width:9px; height:9px; border-radius:99px; display:inline-block; flex:none; margin-right:7px}

/* ── Felder ───────────────────────────────────────────────────────────── */
label.feld{display:flex; flex-direction:column; gap:5px; min-width:0}
label.feld > span{font-size:13.5px; font-weight:620; color:var(--ink-2)}
label.feld .hinweis{font-size:12px; font-weight:450; color:var(--muted); display:block}

input[type="text"], input[type="number"], input[type="date"], input[type="search"], select, textarea{
  font:inherit; font-size:15.5px; font-variant-numeric:tabular-nums;
  background:var(--field); color:var(--ink);
  border:1px solid var(--hair-2); border-radius:var(--r);
  padding:9px 11px; width:100%; min-width:0;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible{
  outline:2px solid var(--accent); outline-offset:1px;
}
input[type="checkbox"]{width:19px; height:19px; accent-color:var(--accent)}
.rechts{text-align:right}

.zeile{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:9px 0; border-bottom:1px solid var(--hair);
}
.zeile:last-child{border-bottom:0}
.zeile > .bez{font-size:14.5px; color:var(--ink-2); min-width:0}
.zeile > .bez .hinweis{display:block; font-size:12px; color:var(--muted)}
.zeile > .wert{font-variant-numeric:tabular-nums; font-weight:640; white-space:nowrap}
.zeile input, .zeile select{max-width:190px}

/* ── Knöpfe ───────────────────────────────────────────────────────────── */
.knopf{
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  border:1px solid var(--hair-2); background:var(--surface); color:var(--ink);
  border-radius:var(--r); padding:8px 14px; cursor:pointer;
  font-size:14.5px; font-weight:620; letter-spacing:-.005em; white-space:nowrap;
}
.knopf:hover{background:var(--surface-2); border-color:var(--muted)}
.knopf svg{width:17px; height:17px; stroke-width:1.9}
.knopf--voll{background:var(--accent); border-color:var(--accent); color:#fff}
.knopf--voll:hover{background:var(--accent-deep); border-color:var(--accent-deep)}
.knopf--leise{border-color:transparent; background:none; color:var(--muted)}
.knopf--leise:hover{background:var(--surface-2); color:var(--ink)}
.knopf--gefahr{color:var(--bad); border-color:transparent}
.knopf--gefahr:hover{background:var(--bad-wash); border-color:var(--bad)}
.knopf--klein{padding:5px 10px; font-size:13.5px}
.knopf[disabled]{opacity:.45; cursor:not-allowed}

/* ── Reiter ───────────────────────────────────────────────────────────── */
.reiter{display:flex; gap:2px; border-bottom:1px solid var(--hair); overflow-x:auto; min-width:0}
.reiter button{
  border:0; background:none; cursor:pointer; padding:9px 14px;
  font-size:14.5px; font-weight:620; color:var(--muted); white-space:nowrap;
  border-bottom:2px solid transparent; margin-bottom:-1px;
}
.reiter button:hover{color:var(--ink)}
.reiter button[aria-selected="true"]{color:var(--ink); border-bottom-color:var(--akzent,var(--accent))}

/* ── Monatswähler ─────────────────────────────────────────────────────── */
.monatsleiste{display:flex; align-items:center; gap:6px; flex-wrap:wrap}
.monatsgitter{display:grid; grid-template-columns:repeat(6,1fr); gap:5px}
.monatsknopf{
  border:1px solid var(--hair); background:var(--surface); border-radius:var(--r);
  padding:9px 4px; cursor:pointer; font-size:13px; font-weight:620; color:var(--muted);
  display:flex; flex-direction:column; align-items:center; gap:2px; min-width:0;
}
.monatsknopf:hover{border-color:var(--hair-2); color:var(--ink)}
.monatsknopf[aria-current="true"]{border-color:var(--accent); background:var(--accent-wash); color:var(--accent-deep)}
.monatsknopf .mini{font-size:11px; font-weight:600; font-variant-numeric:tabular-nums; opacity:.8}
.monatsknopf.leer{opacity:.5}
.monatsknopf.leer .mini::before{content:"—"}

/* ── Kategorien (ausklappbar) ─────────────────────────────────────────── */
details.kat{border-bottom:1px solid var(--hair)}
details.kat:last-of-type{border-bottom:0}
details.kat > summary{
  list-style:none; cursor:pointer; display:flex; align-items:center; gap:10px;
  padding:11px 2px; font-size:14.5px; font-weight:620;
}
details.kat > summary::-webkit-details-marker{display:none}
.katpfeil{width:15px; height:15px; flex:none; transition:transform .16s; color:var(--muted)}
details.kat[open] > summary .katpfeil{transform:rotate(90deg)}
.katzahl{margin-left:auto; font-variant-numeric:tabular-nums; font-weight:700; font-size:15px}
.katanz{font-size:12.5px; color:var(--muted); font-weight:500}
.katinhalt{padding:2px 0 12px}

/* ── Ausgabenzeile ────────────────────────────────────────────────────── */
.ausgabe{
  display:grid; grid-template-columns:1fr 118px 96px 34px; gap:7px;
  align-items:center; padding:4px 0;
}
.ausgabe input, .ausgabe select{padding:7px 9px; font-size:15px}
.ausgabe .weg{
  border:0; background:none; color:var(--muted); cursor:pointer;
  font-size:19px; line-height:1; padding:6px; border-radius:var(--r);
}
.ausgabe .weg:hover{color:var(--bad); background:var(--bad-wash)}

/* ── Merker / Fähnchen ────────────────────────────────────────────────── */
.merker{
  display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:680;
  padding:2px 8px; border-radius:99px; background:var(--surface-2); color:var(--muted);
  letter-spacing:.01em; white-space:nowrap;
}
.merker--gut{background:var(--accent-wash); color:var(--accent-deep)}
.merker--warn{background:var(--warn-wash); color:var(--warn)}
.merker--schlecht{background:var(--bad-wash); color:var(--bad)}

/* ── Hinweiskasten ────────────────────────────────────────────────────── */
.notiz{
  font-size:13.5px; color:var(--ink-2); background:var(--surface-2);
  border-left:2px solid var(--hair-2); padding:11px 14px; border-radius:0 var(--r) var(--r) 0;
}
.notiz--warn{background:var(--warn-wash); border-left-color:var(--warn)}
.notiz b{font-weight:700}

.leerzustand{text-align:center; padding:34px 16px; color:var(--muted)}
.leerzustand svg{width:34px; height:34px; opacity:.45; margin-bottom:10px; stroke-width:1.5}
.leerzustand p{font-size:14.5px; max-width:42ch; margin:0 auto 14px}

/* ── Diagramm ─────────────────────────────────────────────────────────── */
.diagramm{width:100%; height:auto; display:block; overflow:visible}
.diagramm .achse{stroke:var(--hair-2); stroke-width:1}
.diagramm .netz{stroke:var(--hair); stroke-width:1; stroke-dasharray:2 4}
.diagramm .beschriftung{fill:var(--muted); font-size:11px; font-family:var(--sans)}
.legende{display:flex; flex-wrap:wrap; gap:8px 18px; font-size:13px; color:var(--ink-2); margin-top:12px}
.legende span{display:inline-flex; align-items:center; gap:6px}

/* ── Belege ───────────────────────────────────────────────────────────── */
.belegknopf{
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px;
  width:100%; min-height:132px; cursor:pointer;
  border:2px dashed var(--hair-2); border-radius:8px; background:var(--surface-2);
  color:var(--accent-deep); font-size:16px; font-weight:680; letter-spacing:-.01em;
}
.belegknopf:hover{border-color:var(--accent); background:var(--accent-wash)}
.belegknopf svg{width:34px; height:34px; stroke-width:1.5}

.beleggitter{
  display:grid; grid-template-columns:repeat(auto-fill,minmax(148px,1fr)); gap:12px;
}
.belegkachel{
  position:relative; display:flex; flex-direction:column; cursor:pointer; padding:0;
  border:1px solid var(--hair); border-radius:var(--r); background:var(--surface-2);
  overflow:hidden; text-align:left;
}
.belegkachel:hover{border-color:var(--accent)}
.belegkachel img{width:100%; aspect-ratio:3/4; object-fit:cover; display:block; background:var(--field)}
.belegersatz{
  display:grid; place-items:center; aspect-ratio:3/4; color:var(--muted); background:var(--field);
}
.belegersatz svg{width:36px; height:36px; stroke-width:1.4}
.belegfuss{
  display:flex; flex-direction:column; gap:2px; padding:8px 9px;
  font-size:12.5px; line-height:1.35; border-top:1px solid var(--hair);
}
.belegfuss b{font-weight:700; font-variant-numeric:tabular-nums}
.belegfuss span{color:var(--muted); display:flex; align-items:center; overflow:hidden;
  white-space:nowrap; text-overflow:ellipsis}
.belegoffen{color:var(--warn) !important; font-weight:640}
.beleghaken{
  position:absolute; top:7px; right:7px; width:23px; height:23px; border-radius:99px;
  background:var(--accent); color:#fff; display:grid; place-items:center;
}
.beleghaken svg{width:14px; height:14px; stroke-width:2.6}
.belegvoll{
  width:100%; max-height:52vh; object-fit:contain; display:block;
  border-radius:var(--r); background:var(--field); border:1px solid var(--hair);
}

/* ── Kurze Rückmeldung unten ──────────────────────────────────────────── */
.brot{
  position:fixed; left:50%; transform:translateX(-50%); z-index:90;
  bottom:calc(84px + env(safe-area-inset-bottom));
  background:var(--ink); color:var(--ground);
  padding:10px 18px; border-radius:99px;
  font-size:14px; font-weight:620; box-shadow:var(--shadow);
  pointer-events:none; opacity:0; transition:opacity .18s;
}
.brot[data-an="true"]{opacity:1}
@media (prefers-reduced-motion:reduce){ .brot{transition:none} }

/* ── Dialog ───────────────────────────────────────────────────────────── */
dialog{
  margin:auto; border:1px solid var(--hair-2); border-radius:8px; padding:0;
  background:var(--surface); color:var(--ink); box-shadow:var(--shadow);
  max-width:min(520px,92vw); width:100%;
}
dialog::backdrop{background:rgba(10,14,12,.5); backdrop-filter:blur(2px)}
.dialogkopf{padding:18px 20px 0}
.dialogkopf h2{font-size:18px; font-weight:730; letter-spacing:-.015em}
.dialogkopf p{font-size:14px; color:var(--muted); margin-top:4px}
.dialogleib{padding:16px 20px; display:flex; flex-direction:column; gap:13px}
.dialogfuss{display:flex; gap:8px; justify-content:flex-end; padding:0 20px 18px}

/* ── Reiterleiste unten (nur Handy) ───────────────────────────────────── */
.unterleiste{display:none}

/* ═══ Handy ═══════════════════════════════════════════════════════════════
   Ans Ende gestellt, damit diese Regeln bei gleicher Spezifität gewinnen. */
@media (max-width:820px){
  body{font-size:17px}
  .app{grid-template-columns:1fr}
  .nav{display:none}
  .seite{grid-column:1; padding:16px 14px calc(78px + env(safe-area-inset-bottom))}
  .blatt{gap:18px}

  .kopf{border-bottom-width:1px}
  .kopf h1{font-size:25px}
  .kopfwerkzeug{width:100%}
  .kopfwerkzeug .knopf{flex:1}

  .gitter--3, .gitter--2{grid-template-columns:1fr}
  .kennzahl .wert{font-size:30px}

  /* Felder untereinander, volle Breite — 16px gegen das Zoomen in Safari */
  input[type="text"], input[type="number"], input[type="date"], input[type="search"],
  select, textarea{font-size:16px !important; padding:11px 12px; min-height:44px}
  .zeile{flex-direction:column; align-items:stretch; gap:6px}
  .zeile > .wert{text-align:right}
  .zeile input, .zeile select{max-width:none}

  /* Ausgabenzeile bricht um: Name oben, Betrag und Vorsteuer darunter */
  .ausgabe{
    grid-template-columns:1fr 96px 34px;
    grid-template-areas:"name name name" "betrag vorst weg";
    gap:6px; padding:8px 0; border-bottom:1px solid var(--hair);
  }
  .ausgabe > :nth-child(1){grid-area:name}
  .ausgabe > :nth-child(2){grid-area:betrag}
  .ausgabe > :nth-child(3){grid-area:vorst}
  .ausgabe > :nth-child(4){grid-area:weg; justify-self:end}
  .ausgabe .weg{min-height:44px; min-width:44px; display:grid; place-items:center}

  .beleggitter{grid-template-columns:repeat(2,1fr); gap:10px}
  .belegknopf{min-height:150px; font-size:17px}
  .monatsgitter{grid-template-columns:repeat(3,1fr); gap:6px}
  .monatsknopf{padding:11px 4px; min-height:52px}

  /* Alles, was getippt wird, mindestens 44 px hoch — darunter trifft der
     Daumen daneben. Gilt auch für die kleinen Knöpfe. */
  .knopf{min-height:44px; padding:10px 15px}
  .knopf--klein{min-height:44px; padding:9px 13px}
  .reiter button{min-height:44px; padding:11px 15px}
  input[type="checkbox"]{width:24px; height:24px}
  details.kat > summary{padding:14px 2px; min-height:48px}

  table.tab td{padding:11px 8px; font-size:15.5px}
  table.tab th{padding:0 8px 8px}

  dialog{max-width:100vw; width:100%; margin:auto auto 0;
    border-radius:12px 12px 0 0; border-bottom:0}

  /* Reiterleiste unten */
  .unterleiste{
    display:grid; grid-auto-flow:column; grid-auto-columns:1fr;
    position:fixed; left:0; right:0; bottom:0; z-index:40;
    background:var(--surface); border-top:1px solid var(--hair);
    padding:5px 2px calc(5px + env(safe-area-inset-bottom));
  }
  .unterleiste button{
    border:0; background:none; cursor:pointer; color:var(--muted);
    display:flex; flex-direction:column; align-items:center; gap:2px;
    padding:6px 2px; font-size:10.5px; font-weight:640; letter-spacing:.01em;
    min-height:50px; position:relative;
  }
  .unterleiste button svg{width:22px; height:22px; stroke-width:1.75}
  .unterleiste button[aria-current="page"]{color:var(--accent-deep)}
  .unterleiste .kennz{
    position:absolute; top:2px; right:calc(50% - 20px);
    font-size:10px; font-weight:750; background:var(--bad); color:#fff;
    border-radius:99px; padding:0 5px; min-width:16px; text-align:center;
  }
}

@media (max-width:400px){
  .monatsgitter{grid-template-columns:repeat(2,1fr)}
  .ausgabe{grid-template-columns:1fr 80px 34px}
}

@media print{
  .nav, .unterleiste, .kopfwerkzeug, .knopf{display:none !important}
  body{background:#fff; font-size:11pt}
  .karte{box-shadow:none; break-inside:avoid}
}

/* ── Anmeldung ────────────────────────────────────────────────────────────
   Steht allein auf der Seite, bevor die Navigation gebaut wird.          */
.anmeldung{
  max-width:330px; margin:12vh auto 0;
  display:flex; flex-direction:column; gap:14px;
  background:var(--surface); border:1px solid var(--hair);
  border-radius:var(--r); padding:26px; box-shadow:var(--shadow);
}
.anmeldung .marke{margin-bottom:6px}

/* ── To-Dos ───────────────────────────────────────────────────────────────
   Eingabezeile oben, Liste darunter. Am Handy bricht die Zeile um.      */
.todoform{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
.todoform input[type="text"]{flex:1; min-width:180px}
.todoform select{max-width:170px}
.todoform input[type="date"]{max-width:160px}

.todoliste{list-style:none; display:flex; flex-direction:column}
.todo{
  display:flex; align-items:flex-start; gap:12px;
  padding:11px 2px; border-bottom:1px solid var(--hair);
}
.todoliste .todo:last-child{border-bottom:none}
.todo > input[type="checkbox"]{margin-top:3px; flex-shrink:0}
.todotext{flex:1; min-width:0; display:flex; flex-direction:column}
.todotext .was{line-height:1.4}
.todotext .wer{font-size:12.5px; color:var(--muted); display:flex; align-items:center; gap:5px}
.todo--fertig .was{text-decoration:line-through; color:var(--muted)}
.todo .merker{flex-shrink:0; margin-top:2px}

@media (max-width:720px){
  .todoform input[type="text"]{min-width:100%}
  .todoform select, .todoform input[type="date"]{max-width:none; flex:1}
}

/* ── Kleinunternehmergrenze ───────────────────────────────────────────── */
.karte--warn{border-color:var(--warn); background:var(--warn-wash)}
.grenzbalken{
  height:8px; border-radius:99px; background:var(--surface-2);
  overflow:hidden; margin:14px 0 8px;
}
.grenzbalken i{display:block; height:100%; background:var(--warn); border-radius:99px}

/* ═══ Gestaltung im Stil eines Finanz-Dashboards ═══════════════════════════
   Große Rundungen, eine farbig gefüllte Karte als Blickfang, Trendpfeile
   gegenüber dem Vormonat. Die Regeln stehen am ENDE der Datei, damit sie
   bei gleicher Spezifität gewinnen.                                       */

/* ── Begrüßung ────────────────────────────────────────────────────────── */
.gruss{
  display:flex; justify-content:space-between; align-items:flex-start;
  gap:16px; flex-wrap:wrap; margin-bottom:2px;
}
.gruss h1{
  font-size:clamp(24px,3.4vw,34px); font-weight:760; letter-spacing:-.025em;
  line-height:1.1;
}
.gruss .lede{color:var(--muted); font-size:14.5px; margin-top:4px}

/* ── Gefüllte Akzentkarte ─────────────────────────────────────────────────
   Nur EINE pro Ansicht. Zwei Blickfänge sind keiner.                     */
.karte--akzent{
  background:linear-gradient(145deg, var(--accent) 0%, var(--accent-deep) 100%);
  border-color:transparent; color:#fff;
}
.karte--akzent .kennzahl .titel,
.karte--akzent .kennzahl .fuss,
.karte--akzent .unter{color:rgba(255,255,255,.76)}
.karte--akzent .kennzahl .wert{color:#fff}
.karte--akzent > h2{color:#fff}
.karte--akzent .trend{background:rgba(255,255,255,.18); color:#fff}

/* ── Trend gegenüber dem Vormonat ─────────────────────────────────────── */
.trend{
  display:inline-flex; align-items:center; gap:4px;
  font-size:12px; font-weight:700; padding:2px 8px; border-radius:99px;
  background:var(--surface-2); color:var(--muted);
  font-variant-numeric:tabular-nums; white-space:nowrap;
}
.trend--rauf{background:var(--accent-wash); color:var(--accent-deep)}
.trend--runter{background:var(--bad-wash); color:var(--bad)}
.kennzahl .kopfzeile{display:flex; align-items:center; justify-content:space-between; gap:10px}

/* ── Statuspunkt in Tabellen ──────────────────────────────────────────── */
.statuspunkt{
  display:inline-flex; align-items:center; gap:7px; white-space:nowrap; font-size:13.5px;
}
.statuspunkt::before{
  content:""; width:7px; height:7px; border-radius:99px; background:var(--muted); flex:none;
}
.statuspunkt--gut::before{background:var(--accent)}
.statuspunkt--warn::before{background:var(--warn)}
.statuspunkt--schlecht::before{background:var(--bad)}

/* ── Feinschliff, der aus den runden Karten folgt ─────────────────────── */
.karte--warn{border-radius:var(--r-karte)}
.monatsknopf{border-radius:12px}
.merker{border-radius:99px}
.knopf{border-radius:99px; padding:9px 16px}
.knopf--klein{padding:6px 12px}
.reiter{border-bottom:none; gap:6px}
.reiter button{
  border-bottom:none; border-radius:99px; padding:7px 14px;
  background:var(--surface-2); font-size:13.5px;
}
.reiter button[aria-selected="true"]{
  background:var(--accent); color:#fff;
}
.reiter button[aria-selected="true"]:hover{background:var(--accent-deep); color:#fff}
.anmeldung{border-radius:var(--r-karte); padding:30px}
dialog{border-radius:var(--r-karte)}
.grenzbalken{height:9px}

/* ── Untere Leiste bei vielen Einträgen ───────────────────────────────────
   Neun Einträge und 375 Pixel vertragen keine neun Wörter nebeneinander.
   Unter 560 px bleiben die Symbole, benannt wird nur der gewählte Eintrag.
   Das Antippziel bleibt dabei in voller Größe erhalten.                  */
@media (max-width:560px){
  .unterleiste button{padding:8px 1px; gap:0}
  .unterleiste button .navtext{display:none}
  .unterleiste button[aria-current="page"] .navtext{
    display:block; font-size:9.5px; margin-top:2px;
    max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  }
  .unterleiste button svg{width:23px; height:23px}
  .unterleiste .kennz{right:calc(50% - 17px)}
}

/* ── Aufträge ─────────────────────────────────────────────────────────── */
.formzeile{display:flex; gap:10px; flex-wrap:wrap; margin-bottom:12px}
.formzeile input{flex:1; min-width:180px}
.knopfzeile{display:flex; gap:8px; flex-wrap:wrap; margin-top:12px}
.zahlen-zeile{display:flex; gap:16px; flex-wrap:wrap; font-size:13.5px; color:var(--muted); margin-top:4px}
.fotogitter{
  display:grid; grid-template-columns:repeat(auto-fill,minmax(110px,1fr));
  gap:8px; margin-top:12px;
}
.fotogitter img{
  width:100%; aspect-ratio:1; object-fit:cover;
  border-radius:12px; border:1px solid var(--hair); display:block;
}

/* ═══ Aufschliff: mehr Kontur, weniger Flächigkeit ════════════════════════
   Angelehnt an die Vorlagen: kräftige Kopfzeile, Karten mit sichtbarer
   Hierarchie, farbige Akzente nur dort, wo eine Zahl zählt.             */

/* Die Seite bekommt einen leichten Verlauf — nimmt dem Grau die Härte. */
body{
  background:var(--bg);
  background-image:radial-gradient(1200px 600px at 100% -10%, rgba(80,160,230,.08), transparent 60%);
  background-attachment:fixed;
}

/* Kopfzeile: größer, mit feiner Trennlinie statt harter Kante. */
.kopf{padding-bottom:18px; border-bottom:1px solid var(--hair)}
/* Kein Verlauf im Text: Scheitert die Verlaufsangabe (z. B. weil color-mix
   nicht greift), bleibt `color:transparent` stehen und die Überschrift ist
   unsichtbar. Ein Effekt, der im Fehlerfall den Inhalt verschluckt, ist den
   Gewinn nicht wert. */
.gruss h1{color:var(--ink)}

/* Karten heben sich beim Überfahren leicht an — gibt der Fläche Tiefe. */
.karte{transition:box-shadow .18s ease, transform .18s ease, border-color .18s ease}
.karte:hover{
  box-shadow:0 1px 2px rgba(19,32,44,.05), 0 14px 36px -18px rgba(19,32,44,.3);
  border-color:var(--hair-2);
}
.karte--akzent:hover{transform:translateY(-2px)}

/* Kennzahlen: Ziffern schmaler und selbstbewusster. */
.kennzahl .wert{letter-spacing:-.035em}
.kennzahl .titel{font-size:11.5px; opacity:.85}

/* Die gefüllte Karte bekommt Licht von oben links. */
.karte--akzent{
  position:relative; overflow:hidden;
  box-shadow:0 10px 30px -14px rgba(60,140,210,.45);
}
.karte--akzent::after{
  content:""; position:absolute; inset:0;
  background:radial-gradient(420px 180px at 15% -30%, rgba(255,255,255,.28), transparent 70%);
  pointer-events:none;
}
.karte--akzent > *{position:relative; z-index:1}

/* Seitenleiste: aktiver Eintrag mit Markierung statt nur Farbe. */
.navknopf{position:relative; border-radius:10px}
.navknopf[aria-current="page"]{background:var(--surface-2); font-weight:650}
.navknopf[aria-current="page"]::before{
  content:""; position:absolute; left:0; top:18%; bottom:18%;
  width:3px; border-radius:0 3px 3px 0; background:var(--accent);
}

/* Tabellen: Kopfzeile abgesetzt, Zeilen luftiger. */
table.tab thead th{background:var(--surface-2); padding:10px; border-radius:0}
table.tab thead th:first-child{border-radius:8px 0 0 8px}
table.tab thead th:last-child{border-radius:0 8px 8px 0}
table.tab td{padding:12px 10px}

/* ── Assistent ───────────────────────────────────────────────────────── */
.sprachzeile{display:flex; gap:10px; align-items:flex-end; flex-wrap:wrap}
.sprachfeld{
  flex:1; min-width:220px; resize:none; font-size:16.5px; line-height:1.45;
  padding:13px 15px; border-radius:var(--r-karte);
}
.sprachzeile .knopf{min-height:48px; padding:12px 20px}

.beispielzeile{display:flex; gap:7px; flex-wrap:wrap; margin-top:12px}
.beispiel{
  border:1px dashed var(--hair-2); background:none; color:var(--muted);
  border-radius:99px; padding:5px 12px; font:inherit; font-size:12.5px; cursor:pointer;
}
.beispiel:hover{border-style:solid; border-color:var(--accent); color:var(--accent-deep)}

.assistent-antwort{display:flex; flex-direction:column; gap:12px}
.assistent-verstanden .was{
  font-size:19px; font-weight:680; letter-spacing:-.015em; margin-top:4px; line-height:1.35;
}
.assistent-frage{display:flex; gap:12px; align-items:flex-start}
.assistent-frage svg{width:22px; height:22px; color:var(--warn); flex:none; margin-top:1px}
.assistent-fertig{display:flex; gap:10px; align-items:center; font-size:16px; font-weight:620}
.assistent-fertig svg{width:22px; height:22px; color:var(--accent); flex:none}

.berichtsteil{margin-top:14px}
.berichtsteil ul{margin:6px 0 0; padding-left:20px}
.berichtsteil li{margin-bottom:4px; font-size:14.5px}

@media (max-width:560px){
  .sprachzeile .knopf{width:100%}
  .kennzahl .wert{font-size:28px}
}
