/* Haushaltsbuch - schlicht, ruhig, gut lesbar; hell und dunkel. */
:root {
  --grund: #f6f7f9; --flaeche: #ffffff; --text: #1d2430; --leise: #5d6878; --linie: #dde2ea;
  --akzent: #1f5f8b; --akzent-text: #ffffff; --gut: #1c7c4d; --warn: #b4531a; --gefahr: #b42323;
  --radius: 10px; --schatten: 0 1px 2px rgba(20, 30, 50, .06), 0 2px 8px rgba(20, 30, 50, .05);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #12161c; --flaeche: #1b2129; --text: #e6eaf0; --leise: #9aa5b4; --linie: #2c3540;
    --akzent: #5aa3d6; --akzent-text: #0c1a26; --gut: #4cc38a; --warn: #e39457; --gefahr: #ef6b6b;
    --schatten: none;
  }
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0; background: var(--grund); color: var(--text);
  font: 1rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: var(--akzent); }
h1 { font-size: 1.5rem; margin: 0 0 .75rem; }
h2 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; }
.karte h2 { margin-top: 0; }

.kopf {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem;
  padding: .75rem 1.25rem; background: var(--flaeche); border-bottom: 1px solid var(--linie);
}
.marke { display: inline-flex; align-items: center; gap: .5rem; font-weight: 650; color: var(--text); text-decoration: none; }
.marke-zeichen {
  display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 8px;
  background: var(--akzent); color: var(--akzent-text); font-size: .85rem; font-weight: 700; letter-spacing: .02em;
}
.navi { display: flex; flex-wrap: wrap; gap: .25rem; flex: 1 1 auto; scrollbar-width: none; }
.navi a { padding: .35rem .65rem; border-radius: 7px; color: var(--leise); text-decoration: none; }
.navi a:hover { color: var(--text); background: var(--grund); }
.navi a[aria-current="page"] { color: var(--text); background: var(--grund); font-weight: 600; }
.abmelden { margin: 0; }

.inhalt { max-width: 100rem; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.hinweis { color: var(--leise); max-width: 46rem; }
.leise { color: var(--leise); margin: .25rem 0 0; }
.nebenweg { margin-top: 1.25rem; font-size: .925rem; }

.karte {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: var(--schatten);
}
.karte-schmal { max-width: 28rem; margin: 3rem auto; }
.karte-link { display: block; color: inherit; text-decoration: none; }
.karte-link:hover { border-color: var(--akzent); }
.raster { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(16rem, 100%), 1fr)); margin-top: 1rem; }
.liste-leise { margin: 0; padding-left: 1.1rem; }

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 2.5rem; padding: .5rem 1rem; border-radius: 8px; border: 1px solid var(--linie);
  background: var(--flaeche); color: var(--text); font: inherit; cursor: pointer;
}
.knopf:hover { border-color: var(--akzent); }
.knopf:disabled { opacity: .6; cursor: progress; }
.knopf-haupt { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); font-weight: 600; }
.knopf-leise { min-height: 2rem; padding: .25rem .7rem; color: var(--leise); }
.knopf-gefahr { color: var(--gefahr); }
.karte-schmal .knopf-haupt { width: 100%; margin-top: .5rem; }

.formular { display: grid; gap: .9rem; }
.formular label { display: grid; gap: .3rem; font-weight: 550; }
input, .feld {
  font: inherit; color: var(--text); background: var(--grund); border: 1px solid var(--linie);
  border-radius: 8px; padding: .5rem .65rem; min-height: 2.5rem; min-width: 0;
}
input:focus-visible, .knopf:focus-visible, a:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }

.meldung { margin: 1rem 0 0; padding: .6rem .8rem; border-radius: 8px; background: var(--grund); }
.meldung[data-art="fehler"] { color: var(--gefahr); }
.meldung[data-art="ok"] { color: var(--gut); }

.zeile { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: 1rem; }
.zeile .feld { flex: 1 1 14rem; }
.inline { display: inline-flex; gap: .4rem; align-items: center; margin: 0; flex-wrap: wrap; }

.tabelle-rahmen { overflow-x: auto; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); }
.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th, .tabelle td { padding: .55rem .75rem; text-align: left; border-bottom: 1px solid var(--linie); vertical-align: middle; }
.tabelle tr:last-child td { border-bottom: 0; }
.tabelle th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--leise); font-weight: 600; }
.tabelle-klein td { font-size: .9rem; }
.zeile-warn td { color: var(--warn); }

@media (max-width: 40rem) {
  .kopf { padding: .6rem .9rem; }
  .navi { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .navi a { white-space: nowrap; }
  .inhalt { padding: 1rem .9rem 2.5rem; }
  .karte-schmal { margin: 1.5rem auto; }
}

/* ---------- Daten (Schema 002) ---------- */
.klein { font-size: .85rem; }
.neg { color: var(--gefahr); }
.gut { color: var(--gut); }
.schlecht { color: var(--gefahr); font-weight: 600; }
.warn { color: var(--warn); }
.abstand { margin-top: 1rem; }
select, .feld-schmal { font: inherit; color: var(--text); background: var(--grund); border: 1px solid var(--linie); border-radius: 8px; padding: .45rem .6rem; min-height: 2.5rem; }
.feld-schmal { flex: 0 0 auto; }

.kopfzeile { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; }
.kopfzeile h1 { margin-bottom: .25rem; }
.jahre { display: flex; flex-wrap: wrap; gap: .25rem; margin: .25rem 0 .75rem; }
.jahre a { padding: .25rem .55rem; border-radius: 7px; color: var(--leise); text-decoration: none; border: 1px solid transparent; }
.jahre a:hover { border-color: var(--linie); color: var(--text); }
.jahre a[aria-current="page"] { background: var(--akzent); color: var(--akzent-text); font-weight: 600; }

.zahl { text-align: right; white-space: nowrap; }
.tabelle.monate { font-size: .85rem; }
.tabelle.monate th, .tabelle.monate td { padding: .3rem .45rem; }
.tabelle.monate thead th { position: sticky; top: 0; background: var(--flaeche); z-index: 1; }
.tabelle.monate tbody th { font-weight: 500; white-space: nowrap; position: sticky; left: 0; background: var(--flaeche); text-transform: none; letter-spacing: 0; font-size: .85rem; color: var(--text); }
.tabelle.monate td a, .tabelle.buchungen a { color: inherit; text-decoration: none; }
.tabelle.monate td a:hover { color: var(--akzent); text-decoration: underline; }
.tabelle .plan { background: color-mix(in srgb, var(--grund) 70%, transparent); color: var(--leise); }
.tabelle tr.gruppe th { background: var(--grund); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--leise); padding-top: .6rem; }
.tabelle tr.zwischensumme th, .tabelle tr.zwischensumme td { font-weight: 600; border-top: 1px solid var(--linie); }
.tabelle tr.stand th, .tabelle tr.stand td { font-weight: 700; background: var(--grund); }
.tabelle tr.abgleich th, .tabelle tr.abgleich td { font-size: .8rem; color: var(--leise); }
.tabelle td.summe { font-weight: 600; }

.filter { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; margin: .5rem 0 1rem; }
.filter label { display: grid; gap: .2rem; font-size: .85rem; color: var(--leise); }
.filter label.breit { flex: 1 1 14rem; }
.tabelle.buchungen td { font-size: .9rem; }
.notiz { font-size: .8rem; color: var(--leise); margin-top: .15rem; }
.zeile-korrektur td { background: color-mix(in srgb, var(--warn) 10%, transparent); }

.zwei { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr)); }
.pruefliste { margin: .25rem 0 .75rem; padding-left: 1.2rem; }
.pruefliste li { margin: .2rem 0; }
.betrag-gross { font-size: 1.6rem; font-weight: 650; margin: .4rem 0 .1rem; }
.konto-karte h2 { margin-bottom: 0; }

.befunde { display: grid; gap: .8rem; }
.befund header { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .4rem; }
.befund h2 { margin: .1rem 0 .4rem; font-size: 1.05rem; }
.befund p { margin: .3rem 0; }
.befund-rot { border-left: 4px solid var(--gefahr); }
.befund-orange { border-left: 4px solid var(--warn); }
.befund-gelb { border-left: 4px solid #c9a227; }
.befund-frage { border-left: 4px solid var(--akzent); }
.abzeichen { display: inline-block; font-size: .75rem; padding: .1rem .5rem; border-radius: 999px; border: 1px solid var(--linie); color: var(--leise); }
.abzeichen-rot { color: var(--gefahr); border-color: currentColor; }
.abzeichen-orange { color: var(--warn); border-color: currentColor; }
.abzeichen-frage { color: var(--akzent); border-color: currentColor; }
.status-erledigt { color: var(--gut); border-color: currentColor; }
.erledigung { white-space: pre-line; font-size: .9rem; background: var(--grund); padding: .4rem .6rem; border-radius: 8px; }
.tabelle tbody th { text-transform: none; letter-spacing: 0; font-size: inherit; color: var(--text); font-weight: 500; }
.tabelle tr.stand th { font-weight: 700; }
.zeile .feld.feld-schmal { flex: 0 0 auto; }
