/* Quicksand liegt als eigene Datei in assets/schriften/ - die Sicherheitsrichtlinie
   erlaubt keine fremden Quellen, und so erfaehrt auch kein fremder Server, wann die
   Buchhaltung aufgemacht wird. Eine variable Fassung deckt 300 bis 700 ab; Google
   liefert fuer 600 und 700 ohnehin dieselbe Datei. font-display: swap sorgt dafuer,
   dass bei fehlender Datei sofort die Ersatzschrift erscheint statt unsichtbarem Text. */
@font-face {
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(schriften/quicksand.woff2) format('woff2');
}

:root {
  --grund: #f5f4f3;
  --flaeche: #ffffff;
  --text: #1a1715;
  --leise: #6f6763;
  --linie: #eae7e5;
  --akzent: #c74b32;
  --akzent-text: #ffffff;
  --akzent-weich: #fdece9;
  --akzent-blass: #fda688;
  --gut: #0a6e4d;
  --gut-flaeche: #e5f5ef;
  --offen: #5b6472;
  --offen-flaeche: #eef0f4;
  --warn: #8a4b08;
  --warn-flaeche: #fbecd6;
  --fehler: #9b2318;
  --fehler-flaeche: #fbe3df;
  --neutral-flaeche: #efedeb;
  --radius: 14px;
  --schatten: 0 1px 2px rgba(26, 23, 21, .05);
  --schrift-anzeige: 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Die dunklen Werte stehen zweimal: fuer Geraete, die dunkel eingestellt sind, und
   fuer die ausdrueckliche Wahl in der App. Der Waechter :not([data-farbschema="hell"])
   sorgt dafuer, dass "hell" die Geraeteeinstellung uebergeht und nicht umgekehrt.
   Koralle ist der einzige warme Ton: --warn und --fehler tragen echte Warnungen und
   Fehler, der Zustand "offen" ist neutral (--offen). */
@media (prefers-color-scheme: dark) {
  :root:not([data-farbschema="hell"]) {
    --grund: #141210;
    --flaeche: #1e1b19;
    --text: #f3efec;
    --leise: #a09892;
    --linie: #2e2a27;
    --akzent: #e2715c;
    --akzent-text: #2a1410;
    --akzent-weich: #39241f;
    --akzent-blass: #fdc2a8;
    --gut: #4cc49a;
    --gut-flaeche: #16302a;
    --offen: #9aa4b2;
    --offen-flaeche: #262b32;
    --warn: #f0bd7a;
    --warn-flaeche: #3a2c18;
    --fehler: #f3a299;
    --fehler-flaeche: #40201c;
    --neutral-flaeche: #2a2724;
    --schatten: none;
  }
}
:root[data-farbschema="dunkel"] {
  --grund: #141210;
  --flaeche: #1e1b19;
  --text: #f3efec;
  --leise: #a09892;
  --linie: #2e2a27;
  --akzent: #e2715c;
  --akzent-text: #2a1410;
  --akzent-weich: #39241f;
  --akzent-blass: #fdc2a8;
  --gut: #4cc49a;
  --gut-flaeche: #16302a;
  --offen: #9aa4b2;
  --offen-flaeche: #262b32;
  --warn: #f0bd7a;
  --warn-flaeche: #3a2c18;
  --fehler: #f3a299;
  --fehler-flaeche: #40201c;
  --neutral-flaeche: #2a2724;
  --schatten: none;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { max-width: 1180px; margin: 0 auto; padding: 28px 20px 72px; }
.schmal { max-width: 460px; margin: 0 auto; }
h1, h2, h3, .kennzahlen strong { font-family: var(--schrift-anzeige); }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 8px 0 16px; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; margin: 28px 0 10px; }
a { color: var(--akzent); }
.leise { color: var(--leise); font-size: 0.9rem; }
.unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rechts { text-align: right; font-variant-numeric: tabular-nums; }
.zahlspalte { font-variant-numeric: tabular-nums; white-space: nowrap; }
.plus { color: var(--gut); }
.achtung { color: var(--warn); }
pre { white-space: pre-wrap; word-break: break-word; font: 0.82rem/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; margin: 6px 0; }
code { font: 0.85rem ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Kopf */
.kopf { background: var(--flaeche); border-bottom: 1px solid var(--linie); position: sticky; top: 0; z-index: 5; }
.kopf-innen { max-width: 1180px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 8px 20px; flex-wrap: wrap; }
/* Die Marke ist ein eingebettetes SVG; die drei Klassen holen ihre Farben aus den
   Variablen, damit das Zeichen hell und dunkel ohne zweite Datei mitgeht. */
.marke { display: inline-flex; align-items: center; text-decoration: none; }
.kopf-rechts a { color: var(--leise); text-decoration: none; padding: 6px 10px; border-radius: 8px; }
.kopf-rechts a:hover { color: var(--text); background: var(--neutral-flaeche); }
.kopf-rechts a.aktiv { color: var(--text); background: var(--neutral-flaeche); font-weight: 600; }
.marke svg { display: block; height: 30px; width: auto; }
.marke-symbol { fill: var(--akzent); }
.marke-reiter { fill: var(--akzent-blass); }
.marke-wort { fill: var(--text); }
.kopf nav { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.kopf nav a { padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--leise); font-size: 0.95rem; }
.kopf nav a:hover { color: var(--text); background: var(--neutral-flaeche); }
.kopf nav a.aktiv { color: var(--text); background: var(--neutral-flaeche); font-weight: 600; }
.kopf-rechts { display: flex; align-items: center; gap: 12px; font-size: 0.9rem; }

/* Der Mandant im Kopf: Name, Klick, Menue. <details> traegt es ohne JavaScript. */
.mandant { color: var(--text); font-weight: 650; }
.mandantenwahl { position: relative; }
.mandantenwahl > summary {
  cursor: pointer; list-style: none; padding: 6px 10px; border-radius: 8px;
  display: flex; align-items: center; gap: 7px;
}
.mandantenwahl > summary::-webkit-details-marker { display: none; }
.mandantenwahl > summary::after {
  content: ""; width: 6px; height: 6px; border-right: 1.5px solid var(--leise);
  border-bottom: 1.5px solid var(--leise); transform: rotate(45deg) translateY(-2px);
}
.mandantenwahl > summary:hover, .mandantenwahl[open] > summary { background: var(--neutral-flaeche); }
.mandantenwahl > summary:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
.mandantenwahl-menue {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 210px;
  padding: 6px; border: 1px solid var(--linie); border-radius: 12px;
  background: var(--flaeche); box-shadow: var(--schatten);
}
.mandantenwahl-titel { margin: 4px 10px 4px; font-size: 0.78rem; color: var(--leise); }
.kopf-rechts .mandantenwahl-menue a, .mandantenwahl-menue button {
  display: block; width: 100%; box-sizing: border-box; margin: 0; text-align: left;
  padding: 8px 10px; border: 0; border-radius: 8px; background: none;
  color: var(--text); text-decoration: none; font-size: 0.92rem; cursor: pointer;
}
.kopf-rechts .mandantenwahl-menue a:hover, .mandantenwahl-menue button:hover { background: var(--neutral-flaeche); }
.mandantenwahl-menue form + a { border-top: 1px solid var(--linie); border-radius: 0 0 8px 8px; margin-top: 4px; padding-top: 10px; }
.zahl { display: inline-block; min-width: 1.5em; padding: 0 6px; border-radius: 999px; background: var(--akzent); color: var(--akzent-text); font-size: 0.78rem; font-weight: 600; text-align: center; }

/* Formulare */
label { display: block; font-size: 0.9rem; font-weight: 600; margin: 12px 0 4px; }
input, select, button { font: inherit; color: inherit; }
input:not([type=radio]):not([type=file]):not([type=hidden]), select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--linie); border-radius: 8px; background: var(--flaeche);
}
input[type=file] { max-width: 100%; }
:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
.knopf {
  position: relative; display: inline-block; padding: 9px 16px; border: 1px solid var(--linie); border-radius: 8px; background: var(--flaeche);
  cursor: pointer; text-decoration: none; color: var(--text); font-weight: 600; margin: 12px 0 0; text-align: center;
}
.knopf:hover { border-color: var(--akzent); }
.knopf.primaer { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); }
.knopf.klein { padding: 5px 10px; font-size: 0.85rem; margin: 0; }
.knopf:focus-within { outline: 2px solid var(--akzent); outline-offset: 2px; }
button.link { background: none; border: 0; padding: 0; color: var(--akzent); text-decoration: underline; cursor: pointer; font-size: 0.85rem; }
form.inline { display: inline; }
.reihe { display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.reihe input { flex: 1 1 180px; width: auto; }
.zweispaltig { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
fieldset.wahl { border: 0; padding: 0; margin: 14px 0 0; display: flex; gap: 8px; flex-wrap: wrap; }
fieldset.wahl legend { font-size: 0.9rem; font-weight: 600; padding: 0; margin-bottom: 4px; }
fieldset.wahl label { margin: 0; font-weight: 500; padding: 8px 14px; border: 1px solid var(--linie); border-radius: 999px; background: var(--flaeche); cursor: pointer; }
fieldset.wahl label:has(input:checked) { border-color: var(--akzent); background: var(--gut-flaeche); }
input.code { font-size: 1.6rem; letter-spacing: 0.3em; text-align: center; font-variant-numeric: tabular-nums; }

/* Karten und Meldungen */
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 20px; margin: 0 0 18px; box-shadow: var(--schatten); }
.karte > :first-child { margin-top: 0; }
.karte.leer { text-align: center; color: var(--leise); padding: 32px 16px; }
.ablage.ziehen, tr.ziehen { outline: 2px dashed var(--akzent); outline-offset: -2px; background: var(--gut-flaeche); }
.meldung { padding: 10px 14px; border-radius: 8px; margin: 0 0 12px; background: var(--gut-flaeche); color: var(--gut); }
.meldung.fehler { background: var(--fehler-flaeche); color: var(--fehler); }
.meldung.hinweis { background: var(--warn-flaeche); color: var(--warn); }
.meldung a { color: inherit; }
.warnung { color: var(--warn); font-size: 0.85rem; margin-top: 6px; }
/* Eine Buchung, die mit ihren Belegen nicht aufgeht, ist offen, keine Warnung. */
.deckung-offen { color: var(--offen); font-size: 0.85rem; margin-top: 6px; }

/* Übersicht */
.monate { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.monate .gruppe { grid-column: 1 / -1; margin: 12px 0 0; color: var(--leise); font-size: 0.95rem; }
.monat { display: block; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--text); }
.monat:hover { border-color: var(--akzent); }
.monat-kopf { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 1.05rem; }
.monat-zahlen { color: var(--leise); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
progress { width: 100%; height: 6px; margin: 10px 0 8px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 999px; background: var(--neutral-flaeche); overflow: hidden; display: block; }
progress::-webkit-progress-bar { background: var(--neutral-flaeche); }
progress::-webkit-progress-value { background: var(--gut); }
progress::-moz-progress-bar { background: var(--gut); }

/* Monat */
.titelzeile { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.titelzeile h2 { margin: 0; }
.blaettern { display: flex; gap: 16px; font-size: 0.9rem; }
.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 16px; }
.kennzahlen div { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 10px 14px; }
.kennzahlen span { display: block; color: var(--leise); font-size: 0.8rem; }
.kennzahlen strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.holen ul { margin: 0; padding: 0; list-style: none; }
.holen li { padding: 6px 0; border-top: 1px solid var(--linie); }
.holen li:first-child { border-top: 0; }
.filter { display: flex; gap: 4px; margin: 0 0 10px; }
.filter a { padding: 5px 12px; border-radius: 999px; text-decoration: none; color: var(--leise); font-size: 0.9rem; border: 1px solid transparent; }
.filter a.aktiv { color: var(--text); background: var(--flaeche); border-color: var(--linie); font-weight: 600; }

.tabelle-rahmen { position: relative; overflow-x: auto; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); margin-bottom: 16px; }
table.buchungen { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.buchungen th { text-align: left; font-size: 0.78rem; font-weight: 600; color: var(--leise); padding: 9px 12px; border-bottom: 1px solid var(--linie); white-space: nowrap; }
.buchungen th.rechts { text-align: right; }
.buchungen td { padding: 10px 12px; border-bottom: 1px solid var(--linie); vertical-align: top; }
.buchungen tr:last-child td { border-bottom: 0; }
.buchungen td.nr { color: var(--leise); font-variant-numeric: tabular-nums; width: 1%; }
.buchungen td.tag { white-space: nowrap; font-variant-numeric: tabular-nums; width: 1%; }
.buchungen td.text { min-width: 220px; }
.buchungen td.aktion { min-width: 170px; }
.buchungen small { display: block; color: var(--leise); font-size: 0.78rem; }
.buchungen details summary { cursor: pointer; color: var(--leise); font-size: 0.8rem; }
.zeile-belegt td.nr { box-shadow: inset 3px 0 0 var(--gut); }
.zeile-offen td.nr { box-shadow: inset 3px 0 0 var(--offen); }
.zeile-unklar td.nr { box-shadow: inset 3px 0 0 var(--fehler); }
.tipp { margin-top: 4px; font-size: 0.82rem; color: var(--warn); }
.notiz { margin-top: 4px; font-size: 0.85rem; padding: 4px 8px; background: var(--neutral-flaeche); border-radius: 6px; display: inline-block; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; white-space: nowrap; background: var(--neutral-flaeche); color: var(--leise); }
.chip-belegt { background: var(--gut-flaeche); color: var(--gut); }
.chip-offen { background: var(--offen-flaeche); color: var(--offen); }
.chip-unklar { background: var(--fehler-flaeche); color: var(--fehler); }
/* Die drei Zustaende einer Periode muessen sich auf einen Blick trennen lassen:
   gefuellt schiefergrau (wird erfasst), umrandet (liegt beim Steuerberater),
   gefuellt gruen (abgerechnet). Koralle bleibt dem vorbehalten, was die App will. */
.chip-periode-offen { background: var(--offen-flaeche); color: var(--offen); }
.chip-periode-abgegeben { background: none; border: 1px solid var(--linie); color: var(--leise); padding: 1px 8px; }
.chip-periode-abgerechnet { background: var(--gut-flaeche); color: var(--gut); }
.saldenliste { margin: 14px 0 0; font-size: 0.9rem; }

/* Eine erledigte Buchungszeile liegt auf derselben hellen Fläche wie ihr Chip und
   tritt damit einen Schritt zurück. Offen bleibt weiß - gesucht wird nicht das
   Erledigte, sondern das, was noch fehlt. Nicht die ganze Zeile in Vollgrün: dann
   verlören die Chips darin ihren Kontrast, das Auswahlfeld sähe aus wie ein leerer
   Kasten, und ein Quartal mit sechzig Buchungen wäre eine Wand. */
.monatsliste tr.zeile-belegt { background: var(--gut-flaeche); }

/* Die schlichte Tabelle: volle Breite, Luft in den Zellen, eine Linie je Zeile.
   Sie traegt die Steuerzeilen, die Perioden, "Zuletzt bearbeitet" und den Vergleich
   mit den Zahlen des Steuerberaters - und hatte bis dahin keine einzige Regel. */
.liste { width: 100%; border-collapse: collapse; }
.liste th { text-align: left; font-weight: 600; font-size: 0.78rem; color: var(--leise);
            padding: 0 12px 6px 0; }
.liste td { padding: 8px 12px 8px 0; border-top: 1px solid var(--linie); vertical-align: top; }
.liste th:last-child, .liste td:last-child { padding-right: 0; }
.liste tbody tr:first-child td { border-top: 0; }

/* Das Umsatzdiagramm: je Periode zwei Saeulen, darunter Name, Umsatz und Zustand.
   Koralle bleibt dem vorbehalten, was die App will - hier gruen fuer das, was
   hereinkommt, und schiefergrau fuer das, was hinausgeht. */
.diagramm { display: flex; align-items: flex-end; gap: 2px; }
/* min-width: 0 - ohne sie laesst sich eine Flex-Spalte nicht unter die Breite ihres
   Inhalts druecken, und zwoelf Monate schieben die ganze Seite nach rechts. */
.diagramm-bein { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column;
                 align-items: center; gap: 2px; }
.saeulen { width: 100%; height: 120px; display: block; }
.balken-umsatz { fill: var(--gut); }
.balken-ausgaben { fill: var(--offen); }
.balken-blass { opacity: .42; }
.diagramm-bein strong, .diagramm-bein .betrag { max-width: 100%; overflow: hidden;
                 text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; }
/* Nicht .diagramm-bein span: das faerbte auch den Zustands-Chip auf --leise um. */
.diagramm-bein .betrag { color: var(--leise); font-variant-numeric: tabular-nums; }
.diagramm-legende { margin: 10px 0 0; font-size: .78rem; }

/* Die Aufgabenliste: eine Zahl in einer Pille, die Beschreibung, der Knopf rechts. */
.aufgaben { list-style: none; margin: 0; padding: 0; }
.aufgaben li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--linie); }
.aufgaben li:first-child { border-top: 0; padding-top: 4px; }
.pille { min-width: 2.4em; padding: 4px 10px; border-radius: 999px; background: var(--offen-flaeche);
  color: var(--offen); font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.aufgabe-text { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.aufgabe-text .leise { font-size: .85rem; }

/* Der Kennzahlenstreifen der Periodenkarte: vier Kacheln, auf dem Handy zwei
   nebeneinander. Eigener Name - .kennzahlen gehoert der Monatsseite und saehe
   mit diesen Regeln anders aus, als sie aussehen soll. */
.periode-kennzahlen { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0 10px; }
.periode-kennzahlen.zwei { grid-template-columns: 1fr 1fr; }
.kennzahl { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 10px; background: var(--neutral-flaeche); }
.kennzahl-name { font-size: 0.78rem; color: var(--leise); }
.kennzahl-wert { font-family: var(--schrift-anzeige); font-size: 1.25rem; font-weight: 600; }
.kennzahl-neben { font-size: 0.75rem; color: var(--leise); }

/* Die Periodenkarte: Kopf mit Chip, darunter die Knoepfe, dann die Formulare. */
.periode-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.periode-kopf h2 { margin: 0; }
.periode-kopf h2 .leise { font-weight: 400; font-size: 0.85rem; }
.periode-knoepfe { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
.periode-knoepfe form { margin: 0; }
.periode .formular { border: 0; box-shadow: none; padding: 0; margin: 14px 0 0; background: none; }
.periode .formular + .formular { border-top: 1px solid var(--linie); padding-top: 14px; }
.beleg-zeile { display: flex; gap: 8px; align-items: baseline; margin-bottom: 4px; }
a.beleg { font-size: 0.85rem; word-break: break-all; }
.aktion form.hochladen { margin-bottom: 6px; }
.aktion select { padding: 4px 8px; font-size: 0.85rem; }
.notizform form { display: flex; gap: 6px; margin-top: 4px; }
.notizform input { padding: 4px 8px !important; font-size: 0.85rem; }

/* Eingang */
.eingang-karte { display: grid; grid-template-columns: 120px 1fr; gap: 16px; }
.vorschau img { width: 120px; height: 150px; object-fit: cover; border-radius: 8px; border: 1px solid var(--linie); display: block; }
.vorschau .pdf { display: flex; align-items: center; justify-content: center; width: 120px; height: 150px; border: 1px solid var(--linie); border-radius: 8px; font-size: 0.85rem; text-align: center; padding: 8px; }
.zuordnen { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; margin-top: 8px; }
.zuordnen label { flex-basis: 100%; margin: 4px 0 0; }
.zuordnen select { flex: 1 1 240px; width: auto; }

/* Erfassen */
ul.letzte { list-style: none; padding: 0; margin: 0 0 12px; }
ul.letzte li { padding: 7px 0; border-top: 1px solid var(--linie); }
ul.letzte li:first-child { border-top: 0; }

@media (max-width: 640px) {
  main { padding: 14px 16px 56px; }
  .zweispaltig { grid-template-columns: 1fr; }
  /* Vier Chips nebeneinander messen 388 Pixel und sprengen die Karte, bevor eine
     Spalte schmaler werden kann. Der Zustand steht auf der Periodenseite; hier
     bleibt die Zahl, und die laufende Periode bleibt an der kräftigen Farbe zu
     erkennen. */
  .diagramm-bein .chip { display: none; }
  /* Vier bis sechs Spalten passen auf kein Telefon. Die Tabelle rollt dann fuer sich,
     statt die ganze Seite nach rechts zu schieben. */
  .liste { display: block; overflow-x: auto; }
  .eingang-karte { grid-template-columns: 1fr; }
  .kopf { position: static; }
  .kopf-innen { gap: 6px 12px; }
  .kopf nav { flex: 1 1 0; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .kopf nav::-webkit-scrollbar { display: none; }
  .kopf nav a { white-space: nowrap; }
  .kopf-rechts { width: 100%; justify-content: space-between; }
  .periode-kennzahlen { grid-template-columns: 1fr 1fr; }
  /* Buchungen als Karten statt als breite Tabelle */
  .monatsliste thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .monatsliste, .monatsliste tbody { display: block; }
  .monatsliste tr { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; padding: 12px 12px 12px 14px; border-bottom: 1px solid var(--linie); position: relative; }
  .monatsliste tr:last-child { border-bottom: 0; }
  .monatsliste td { padding: 0; border: 0; width: auto !important; min-width: 0 !important; }
  .monatsliste td.nr { box-shadow: none; }
  /* Grün gegen Schiefergrau auf drei Pixel waren zwei dunkle, entsättigte Farben -
     untereinander nicht zu unterscheiden. Jetzt ist der Unterschied "kräftig gegen
     blass": acht Pixel, und der offene Zustand bleibt hell. */
  .monatsliste tr::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; }
  .monatsliste tr.zeile-belegt::before { background: var(--gut); }
  .monatsliste tr.zeile-offen::before { background: var(--linie); }
  .monatsliste tr.zeile-unklar::before { background: var(--fehler); }
  .monatsliste td.text { grid-column: 1 / -1; grid-row: 2; }
  .monatsliste td.zahlspalte { grid-column: 3; grid-row: 1; font-weight: 600; }
  .monatsliste td:nth-child(5) { grid-column: 1 / -1; grid-row: 3; }
  .monatsliste td.aktion { grid-column: 1 / -1; grid-row: 4; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
  .monatsliste td.aktion form.hochladen { margin: 0; }
  .monatsliste td.aktion select { width: auto; }
}
@media (prefers-reduced-motion: no-preference) {
  .knopf, .monat, .kopf nav a { transition: border-color .15s, background-color .15s; }
}

/* Hinweis auf die Steuererfassung am Beleg */
.steuer-link {
  font-size: 0.85rem;
  white-space: nowrap;
}

/* Warum ein Beleg im Eingang noch offen ist – ruhig gesetzt, kein Warnton. */
.grund { margin-top: 4px; font-style: italic; }

/* Ein Befehl zum Abtippen-nicht-Muessen: Schrift wie im Terminal, Knopf daneben. */
.befehl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.befehl code { flex: 1 1 260px; padding: 6px 10px; background: var(--neutral-flaeche); border-radius: 6px; font-size: 0.85rem; overflow-x: auto; }

/* Die offenen Belege ueber der Monatsliste: zum Ziehen auf eine Zeile. */
.belegkarten { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.belegkarte { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--linie); border-radius: 8px; background: var(--neutral-flaeche); cursor: grab; font-size: 0.85rem; max-width: 100%; }
.belegkarte:active { cursor: grabbing; }
.belegkarte.wandert { opacity: 0.45; }
