/* Icke KLR – Dashboard. Steuerpult: oben die Monatsleiste mit Reifegrad, darunter Kacheln,
   dann Ergebnis → Kostenstellen → Erträge → Personal → Gewinnverwendung → Steuern → Finanzierung.
   Schriften kommen vom System: keine Anfrage an fremde Server. */
:root {
  --bg: #eef2f1; --surface: #fcfcfb; --surface-2: #f3f6f5;
  --ink: #101a19; --ink-2: #46514e; --muted: #75817e;
  --rule: #dde3e1; --axis: #c2cac7;
  --accent: #0e5a61; --accent-ink: #ffffff; --accent-wash: #dbebec;
  --neg: #b3261e; --neg-bar: #e34948;
  --schaetz: #865800; --schaetz-wash: #f5e8cc;
  --ok: #0b6b3a; --ok-wash: #dcefe3;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300;
  --font-head: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --r: 6px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0e1313; --surface: #171d1d; --surface-2: #1c2323;
  --ink: #eef3f2; --ink-2: #b7c2bf; --muted: #8b9794;
  --rule: #2a3332; --axis: #3b4645;
  --accent: #63b5bc; --accent-ink: #0b1414; --accent-wash: #173233;
  --neg: #f08a80; --neg-bar: #e66767;
  --schaetz: #e2b45a; --schaetz-wash: #302815;
  --ok: #4cc58a; --ok-wash: #15301f;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300;
  color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0e1313; --surface: #171d1d; --surface-2: #1c2323;
  --ink: #eef3f2; --ink-2: #b7c2bf; --muted: #8b9794;
  --rule: #2a3332; --axis: #3b4645;
  --accent: #63b5bc; --accent-ink: #0b1414; --accent-wash: #173233;
  --neg: #f08a80; --neg-bar: #e66767;
  --schaetz: #e2b45a; --schaetz-wash: #302815;
  --ok: #4cc58a; --ok-wash: #15301f;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300;
  color-scheme: dark; }

* { box-sizing: border-box; }
html { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 14px; line-height: 1.45; }
[hidden] { display: none !important; }
.huelle { max-width: 1120px; margin: 0 auto; padding-inline: 16px; padding-block: 20px 64px; display: flex; flex-direction: column; gap: 20px; }
.inhalt { display: flex; flex-direction: column; gap: 20px; }
h1, h2, h3 { font-family: var(--font-head); margin: 0; text-wrap: balance; }
h1 { font-size: clamp(1.5rem, 3.6vw, 2.1rem); font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; font-weight: 700; }
h3 { font-size: 0.92rem; font-weight: 700; }
p { margin: 0; max-width: 70ch; }
code { font-size: .9em; }
.leise { color: var(--ink-2); font-size: 0.86rem; }
.klein { color: var(--muted); font-size: 0.78rem; }
.zahl { font-variant-numeric: tabular-nums; white-space: nowrap; }
.neg { color: var(--neg); }

.kopf { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.kopf .titel { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kopf-rechts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.jahre { display: flex; gap: 4px; }
.jahre a { color: var(--ink-2); text-decoration: none; padding: 4px 8px; border-radius: var(--r); border: 1px solid var(--rule); }
.jahre a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.augen { font-family: var(--font-head); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.entwurf { background: var(--schaetz-wash); color: var(--schaetz); border-radius: var(--r); padding: 10px 14px; font-size: 0.86rem; display: flex; gap: 10px; align-items: baseline; }
.entwurf strong { font-family: var(--font-head); white-space: nowrap; }

/* Monatsleiste mit Reifegrad */
.leiste { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); padding-block: 8px; }
.leiste-innen { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 2px; }
.mon { flex: 1 0 auto; min-width: 54px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); border-radius: var(--r);
  padding: 6px 8px; font: 600 0.82rem var(--font-body); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.mon:hover { border-color: var(--axis); }
.mon:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible, .schalter input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.mon[aria-current="page"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.mon.jahr { min-width: 76px; }
.mon .unter-text { color: inherit; opacity: .8; font-size: 0.74rem; font-weight: 500; }
.reife { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.reife.abgeschlossen { background: currentColor; }
.legende-reife .reife.abgeschlossen { background: var(--ink); }
.reife.vorläufig { border: 2px solid var(--schaetz); background: linear-gradient(90deg, var(--schaetz) 50%, transparent 50%); }
.mon[aria-current="page"] .reife.vorläufig { border-color: var(--accent-ink); background: linear-gradient(90deg, var(--accent-ink) 50%, transparent 50%); }
.reife.offen { border: 1.5px solid var(--muted); }
.mon[aria-current="page"] .reife.offen { border-color: var(--accent-ink); }
.legende-reife { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; }
.legende-reife span { display: inline-flex; align-items: center; gap: 6px; }

/* Kacheln */
.kacheln { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 639px) { .kacheln > .kachel:last-child:nth-child(even) { grid-column: 1 / -1; } }
.kacheln.drei { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.kacheln.eigene { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
/* Ab Tablet drei Spalten: die große Kachel nimmt zwei, daneben eine, darunter zwei Reihen zu drei. */
@media (min-width: 640px) { .kacheln { grid-template-columns: repeat(3, minmax(0, 1fr)); } .kacheln .kachel.held { grid-column: span 2; } }
.kachel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kachel .wert { font-weight: 700; font-size: 1.35rem; letter-spacing: -0.01em; }
.kachel.held { grid-column: 1 / -1; background: var(--accent-wash); border-color: transparent; }
.kachel .wert.leer { color: var(--muted); }
.kachel.held .wert { font-size: clamp(2rem, 6vw, 3rem); line-height: 1.05; }
.kachel .stand { color: var(--muted); font-size: 0.74rem; margin-top: auto; padding-top: 4px; }
.marke { display: inline-flex; align-items: center; gap: 4px; font-size: 0.7rem; font-weight: 600; padding: 1px 7px; border-radius: 999px; white-space: nowrap; vertical-align: 1px; }
.marke.schaetz { background: var(--schaetz-wash); color: var(--schaetz); }
.marke.plan, .marke.ok { background: var(--ok-wash); color: var(--ok); }
.marke.offen { background: var(--surface-2); color: var(--muted); border: 1px solid var(--rule); }

/* Abschnitte */
.tafel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
details.tafel { display: block; }
.tafel-kopf { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; }
.zwei { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 20px; }
@media (max-width: 420px) { .zwei { grid-template-columns: 1fr; } }
.bild { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.rollt { overflow-x: auto; }
svg { display: block; width: 100%; height: auto; max-width: 100%; }
svg.mini { width: 96px; display: inline-block; vertical-align: middle; }
.legende { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.8rem; color: var(--ink-2); }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.legende b { color: var(--ink); font-weight: 600; }
.fleck { width: 10px; height: 10px; border-radius: 2px; flex: none; display: inline-block; }
.strich { width: 14px; height: 2px; border-radius: 1px; flex: none; display: inline-block; }
.fleck.vor { margin-right: 8px; vertical-align: -1px; }
.c1 { background: var(--s1); } .c2 { background: var(--s2); } .c3 { background: var(--s3); }
.c4 { background: var(--s4); } .c5 { background: var(--s5); } .c6 { background: var(--s6); }

table { border-collapse: collapse; width: 100%; font-size: 0.86rem; }
th, td { padding: 7px 8px; border-bottom: 1px solid var(--rule); text-align: right; }
th:first-child, td:first-child { text-align: left; min-width: 14rem; }
thead th { font-family: var(--font-head); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 700; border-bottom: 1.5px solid var(--axis); white-space: nowrap; }
td { font-variant-numeric: tabular-nums; }
tr.gruppe td { font-weight: 700; background: var(--surface-2); }
tr.unter td:first-child { padding-left: 28px; color: var(--ink-2); }
tr.summe td { font-weight: 700; border-top: 1.5px solid var(--axis); border-bottom: none; }
tr.pruef td, tr.zwischen td { color: var(--ink-2); }
tr.hervor td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
section.persoenlich { border-color: var(--accent-wash); }
.umbau { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface-2); }
.umbau-zahlen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.umbau-zahlen .wert { font-weight: 700; font-size: 1.15rem; }
details.aufklapp { gap: 0; }
details.aufklapp > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 6px; }
details.aufklapp > summary::-webkit-details-marker { display: none; }
details.aufklapp > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; display: inline-block; }
details.aufklapp[open] > summary::before { transform: rotate(90deg); }
details.aufklapp[open] > summary { margin-bottom: 12px; }
.aufklapp-titel { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; }

/* G5-Treffen: drei Tage nebeneinander, darin die Blöcke als Karten */
.g5-stand { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: baseline; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: 14px 16px; }
.g5-zahl { display: flex; flex-direction: column; gap: 2px; }
.g5-zahl b { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.g5-weg { flex-basis: 100%; }
.g5-tage { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; align-items: start; }
.g5-tag { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.g5-tag > h2 { border-bottom: 2px solid var(--accent); padding-bottom: 6px; }
.g5-block { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; scroll-margin-top: 90px; }
.g5-block:target { border-color: var(--accent); }
.g5-punkte { margin: 0; padding-left: 1.1em; display: flex; flex-direction: column; gap: 4px; }
.g5-punkte ul { margin: 2px 0 0; padding-left: 1.1em; color: var(--ink-2); font-size: 0.86rem; }
.g5-todos ul { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.g5-todos li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; align-items: start; border-top: 1px solid var(--rule); padding-top: 6px; }
.g5-todos li .klein { grid-column: 1; }
.g5-todos li .marke { grid-column: 2; grid-row: 1; }
.g5-aktion > summary { cursor: pointer; color: var(--accent); font-size: 0.86rem; font-weight: 600; }
.g5-aktion form { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.g5-aktion input[type="text"], .g5-aktion select { font: inherit; padding: 6px 8px; border: 1px solid var(--axis); border-radius: var(--r); background: var(--surface-2); color: var(--ink); }
.g5-aktion label { font-size: 0.82rem; color: var(--ink-2); }
.haken { display: flex; gap: 8px; align-items: flex-start; }
.g5-kachel { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: baseline; }
.huelle > .meldung { margin: 0; }
.auf { background: none; border: none; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; padding: 0; display: inline-flex; align-items: center; gap: 6px; text-align: left; }
.auf .pfeil { display: inline-block; transition: transform .15s; color: var(--muted); }
.auf[aria-expanded="false"] .pfeil { transform: rotate(-90deg); }
.anteil { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.anteil .bahn { width: 72px; height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.anteil .bahn i { display: block; height: 100%; background: var(--s1); border-radius: 3px; }
.breit th:not(:first-child), .breit td:not(:first-child) { min-width: 74px; }
td.offen-zelle { color: var(--muted); }

.schalter { display: flex; flex-wrap: wrap; gap: 8px; }
.schalter label { cursor: pointer; }
.schalter input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.schalter label > span { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--rule); border-radius: 999px; padding: 4px 11px; font-size: 0.82rem; background: var(--surface); color: var(--ink-2); }
.schalter input:checked + span { color: var(--ink); border-color: var(--axis); background: var(--surface-2); }
.schalter input:not(:checked) + span .fleck { background: transparent !important; outline: 1.5px solid var(--axis); }
.schalter .davon { color: var(--muted); font-size: 0.74rem; }
.schalter b { font-weight: 600; color: var(--ink); }

.liste { display: flex; flex-direction: column; gap: 8px; }
.zeile { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; }
.zeile .bahn { grid-column: 1 / -1; height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.zeile .bahn i { display: block; height: 100%; border-radius: 4px; }
.zeile.summe-zeile { border-top: 1.5px solid var(--axis); padding-top: 6px; font-weight: 700; }

.monatskopf { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.monatskopf h2 { font-size: 1.4rem; }
.monatskopf .blaettern { display: flex; gap: 6px; margin-left: auto; }
.knopf { border: 1px solid var(--rule); background: var(--surface); color: var(--ink); border-radius: var(--r); padding: 6px 12px; font: 600 0.82rem var(--font-body); cursor: pointer; }
.knopf:hover { border-color: var(--axis); }
.knopf[disabled] { opacity: .45; cursor: default; }
.knopf.haupt { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.leer { background: var(--surface); border: 1px dashed var(--axis); border-radius: var(--r); padding: 28px 20px; display: flex; flex-direction: column; gap: 8px; }
.fehler-box { background: var(--surface); border: 1px solid var(--neg); color: var(--ink); border-radius: var(--r); padding: 16px; }

.tip { position: fixed; z-index: 20; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--axis); border-radius: var(--r);
  padding: 8px 10px; font-size: 0.8rem; box-shadow: 0 6px 18px rgba(0,0,0,.12); min-width: 160px; max-width: 260px; }
.tip .t-kopf { color: var(--muted); font-size: 0.74rem; margin-bottom: 4px; }
.tip .t-zeile { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.tip .t-zeile .n { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.tip .t-zeile .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.fuss { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--rule); padding-top: 14px; }
.fuss ul { margin: 0; padding-left: 1.1em; color: var(--ink-2); font-size: 0.84rem; display: flex; flex-direction: column; gap: 3px; }

/* Anmeldung */
body.anmeldung { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.anmelde-karte { width: min(360px, 100%); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.anmelde-karte form { display: flex; flex-direction: column; gap: 8px; }
.anmelde-karte label { font-weight: 600; font-size: 0.86rem; }
.anmelde-karte input { font: inherit; padding: 8px 10px; border: 1px solid var(--axis); border-radius: var(--r); background: var(--surface-2); color: var(--ink); }
.meldung.fehler { color: var(--neg); font-size: 0.86rem; }
.meldung.ok { color: var(--ok); font-size: 0.86rem; }
a { color: var(--accent); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
