:root {
  /* Farbwelt BBservice / Linda Bellmann (bb-bellmann.de) */
  --bg: #f5f4fa;
  --panel: #ffffff;
  --ink: #2a2e30;
  --muted: #6b6b6b;
  --line: #e7e4f1;
  --brand: #6e6aa1;
  --brand-dk: #585488;
  --accent: #8883bf;
  --ring: rgba(136,131,191,.22);
  --ok-bg: #e6f4ea; --ok-ink: #1e7d3a;
  --err-bg: #fdecec; --err-ink: #b3261e;
  --chip: #efedf8;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(42,46,48,.06), 0 4px 16px rgba(110,106,161,.07);

  /* ---- 17.10.2026, Umbau Schritt 4: Token fuer das dunkle Thema ----
     Diese Werte standen vorher als feste Farben mitten in den Regeln; ein dunkles Thema
     konnte sie nicht erreichen. Benannt ist jetzt die AUFGABE, nicht der Farbton. */
  --auf-marke: #ffffff;      /* Text auf der Markenfarbe - bleibt immer weiss */
  --flaeche-2: #fafbfc;      /* abgesetzte Flaeche: Knopf-Hover, inaktive Zeile */
  --flaeche-3: #f4f4f6;      /* eine Stufe tiefer: Rahmen um Vorschauen */
  --eingabe-bg: #ffffff;     /* Hintergrund von Eingabefeldern */
  --label-ink: #3a4451;      /* Feldbeschriftung, etwas dunkler als --ink */
  --marke-zart-ink: #585488;    /* Text auf --marke-zart - dreht mit dem Thema */
  --marke-zart: #f1eff8;     /* zarter Markenton: Kontozeichen */
  --marke-zart-2: #ede9fe;   /* eine Stufe kraeftiger: Treffer-Hover */
  --chip-off-bg: #f0f1f3;    /* abgeschalteter Chip */
  --chip-off-ink: #5f6770;   /* war #8a929c - auf --chip-off-bg nur 2.78:1, zu blass zum Lesen */
  --warn-bg: #fff6e5;        /* Warnhinweis am Rand */
  --warn-ink: #8a5f0e;       /* war #9a6b12: nur 4.36:1 auf --warn-bg */
  --warn-line: #f0d9a8;

  /* Signalflaechen: kraeftiger Grund, der WEISSE Schrift traegt (--auf-marke).
     Absichtlich in beiden Themen gleich - die Flaeche leuchtet selbst und haengt
     nicht am Hintergrund der Seite. NICHT --ok-ink/--err-ink verwenden: das sind
     Textfarben, die im Dunkeln hell werden und dann weisse Schrift nicht tragen. */
  --signal-ok: #1e7d3a;      /* gruener Knopf: Forderung bezahlt */
  --signal-err: #b3261e;     /* roter Knopf, Instanz-Banner */
  --zebra: #fafaf9;          /* jede zweite Zeile in langen Tabellen (SuSa) */

  /* Markenfarbe als FLAECHE - nicht zu verwechseln mit --brand, das die Marke
     als TEXT ist. --brand wird im Dunkeln heller (damit Text lesbar bleibt);
     eine Flaeche mit weisser Schrift braucht genau das Gegenteil. Darum in
     beiden Themen derselbe Wert - gerechnet: 4.95:1 gegen Weiss. */
  --marke-flaeche: #6e6aa1;     /* Knopf, aktiver Menueeintrag, Plakette */

  /* Hinweis-Kasten (blau): die dritte Familie neben --ok-* und --warn-*.
     Stand bis zum 18.10.2026 als feste Farbe in den Masken - im dunklen Thema
     hiess das heller Text auf hellblauem Grund, 1.13:1. */
  --info-bg: #eef6ff;
  --info-line: #cfe0f5;
  --info-ink: #2b5ea7;     /* Text im Hinweis-Kasten */

  /* Summenzeile langer Tabellen (SuSa): kraeftiger als --marke-zart, damit
     sie sich von den Datenzeilen abhebt. */
  --summe-bg: #e8e6f2;
  --summe-line: #c8c4e0;
  --marke-flaeche-dk: #585488;  /* derselbe Ton eine Stufe dunkler: Hover */
  --ablage-bg: #f5f8fc;      /* Ablagefeld fuer Dateien */
  --ablage-over: #eef4fb;    /* waehrend eine Datei darueber haengt */
  --hinweis-bg: #2a2e30;     /* Hinweis-Kasten unten: eigene Token, weil er NICHT an */
  --hinweis-ink: #ffffff;    /* --ink haengen darf (im Dunkeln waere das weiss auf hell) */
  --schleier: rgba(0,0,0,.55);
  --zahl: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

header.topbar {
  background: linear-gradient(95deg, #6e6aa1 0%, #585488 100%);
  color: var(--auf-marke); padding: 13px 26px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: 0 2px 12px rgba(110,106,161,.18);
}
header.topbar a.brand { display: flex; align-items: center; }
header.topbar img.logo { height: 40px; width: auto; display: block; }
header.topbar .sub { color: #ece9f7; font-size: 13px; letter-spacing: .2px;
  border-left: 1px solid rgba(255,255,255,.35); padding-left: 16px; }
header.topbar nav { margin-left: auto; display: flex; gap: 20px; }
header.topbar nav a { color: #ece9f7; font-size: 14px; font-weight: 500; }
header.topbar nav a:hover { color: var(--auf-marke); text-decoration: none; }

/* Mandanten-Subnavigation (auf allen Mandanten-Seiten) */
.subnav { background: var(--panel); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
.subnav-inner { max-width: 1560px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.subnav a { padding: 12px 13px; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.subnav a:hover { color: var(--ink); text-decoration: none; }
.subnav a.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.subnav a.subnav-back { margin-left: auto; color: var(--brand); }

main { max-width: 1560px; margin: 28px auto; padding: 0 24px; }

/* ── Linke Seitenleiste (innerhalb eines Mandanten) ───────────────────── */
:root { --sb-w: 266px; }
body.with-sidebar main { margin: 28px auto 28px var(--sb-w); max-width: 1440px; padding: 0 34px; }

.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sb-w); z-index: 50;
  background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; overflow-y: auto;
  box-shadow: 2px 0 18px rgba(110,106,161,.05);
}
.sb-brand { background: linear-gradient(95deg, #6e6aa1 0%, #585488 100%);
  padding: 14px 18px; display: flex; align-items: center; }
.sb-brand img.logo { height: 34px; width: auto; display: block; }
/* Marken-Stapel: Linda oben (weiß auf violett), Partner (Büroservice Stolze, farbig) darunter auf weißem Feld */
.brand-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.partner-logo { background: #fff; border-radius: 7px; padding: 4px 9px; display: inline-flex; }
.partner-logo img { height: 24px; width: auto; display: block; }
/* In der Seitenleiste: Partner-Logo füllt die volle Breite (gleicher Abstand links wie rechts) */
.sb-brand .brand-stack { width: 100%; }
.sb-brand .partner-logo { width: 100%; box-sizing: border-box; justify-content: center; padding: 9px 12px; }
.sb-brand .partner-logo img { width: 100%; height: auto; }
/* Einzelnes Bearbeiter-Logo (Ramona, farbig) als alleinige Marke → weißes Feld in voller Breite */
.sb-brand .solo-logo { width: 100%; box-sizing: border-box; background: #fff; border-radius: 7px;
  padding: 9px 12px; display: flex; justify-content: center; }
.sb-brand .solo-logo img { max-width: 100%; max-height: 44px; width: auto; height: auto; display: block; }
.sb-mandant { padding: 13px 18px 11px; border-bottom: 1px solid var(--line); }
.sb-mandant-name { font-weight: 700; font-size: 16px; color: var(--ink); line-height: 1.25; }
.sb-mandant-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }

.sb-nav { flex: 1; padding: 9px 10px; display: flex; flex-direction: column; gap: 1px; }
.sb-item { display: block; padding: 8px 12px; border-radius: 8px;
  color: var(--ink); font-size: 14.5px; font-weight: 500; }
.sb-item:hover { background: var(--chip); text-decoration: none; }
.sb-item.active { background: var(--marke-flaeche); color: var(--auf-marke); }

.sb-row { display: flex; align-items: center; gap: 2px; border-radius: 8px; padding-right: 6px; }
.sb-row .sb-item { flex: 1; }
.sb-row:hover { background: var(--chip); }
.sb-row.active { background: var(--marke-flaeche); }
.sb-row.active .sb-item, .sb-row.active:hover { background: transparent; color: var(--auf-marke); }
.sb-row.active:hover { background: var(--marke-flaeche); }

.sb-badge { background: var(--marke-flaeche); color: var(--auf-marke); font-size: 11px; font-weight: 700;
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; }
.sb-row.active .sb-badge { background: var(--auf-marke); color: var(--marke-flaeche); }

.sb-caret { border: 0; background: transparent; cursor: pointer; color: var(--muted);
  font-size: 11px; padding: 5px 6px; border-radius: 6px; line-height: 1; transition: transform .15s; }
.sb-caret:hover { background: rgba(0,0,0,.06); color: var(--ink); }
.sb-row.active .sb-caret { color: var(--auf-marke); }
.sb-group:not(.open) .sb-caret { transform: rotate(-90deg); }

.sb-sub { display: none; flex-direction: column; gap: 1px;
  margin: 2px 0 5px 15px; padding-left: 10px; border-left: 2px solid var(--line); }
.sb-group.open .sb-sub { display: flex; }
.sb-sub a { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 10px; border-radius: 7px; color: var(--muted); font-size: 13.5px; }
.sb-sub a:hover { background: var(--chip); color: var(--ink); text-decoration: none; }
.sb-sub a.active { color: var(--brand); font-weight: 600; background: var(--chip); }
.sb-c { font-size: 11px; color: var(--muted); background: var(--marke-zart); border-radius: 8px; padding: 1px 6px; }

/* Bank-Untermenü: Konto-Überschrift „Bezeichnung -IBAN4" + eingerückte Links */
.sb-konto { font-size: 12px; font-weight: 700; color: var(--ink); padding: 7px 10px 2px; }
.sb-konto + .sb-konto { margin-top: 2px; }
.sb-konto-link { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 5px 10px 5px 22px; border-radius: 7px; color: var(--muted); font-size: 13px; }
.sb-konto-link:hover { background: var(--chip); color: var(--ink); text-decoration: none; }
.sb-konto-link.active { color: var(--brand); font-weight: 600; background: var(--chip); }

/* Beleg-Bearbeiten: Formular links, Dokument rechts */
.beleg-edit { display: flex; gap: 20px; align-items: flex-start; }
.beleg-edit-form { flex: 0 0 480px; max-width: 480px; }
.beleg-edit--wide .beleg-edit-form { flex-basis: 600px; max-width: 640px; }   /* Splitbuchung (Tabelle) */
.beleg-edit-doc { flex: 1; position: sticky; top: 16px; }
.beleg-edit-doc iframe { width: 100%; height: min(82vh, 1000px); border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--flaeche-3); }
@media (max-width: 1000px) {
  .beleg-edit { flex-direction: column; }
  .beleg-edit-form, .beleg-edit--wide .beleg-edit-form { flex: 1 1 auto; max-width: none; width: 100%; }
  .beleg-edit-doc { position: static; width: 100%; }
  .beleg-edit-doc iframe { height: 70vh; }
}

.sb-footer { border-top: 1px solid var(--line); padding: 12px 16px;
  display: flex; flex-direction: column; gap: 9px; }
.sb-footer a { font-size: 13.5px; color: var(--brand); font-weight: 500; }

@media (max-width: 860px) {
  .sidebar { position: static; width: auto; flex-direction: column; box-shadow: none; }
  body.with-sidebar main { margin: 20px auto; max-width: none; padding: 0 16px; }
}

/* ── Konto-Typeahead (Buchen) ─────────────────────────────────────────── */
.ks-dd { position: absolute; z-index: 3000; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(42,46,48,.18); max-height: 280px; overflow-y: auto;
  font-size: 13px; padding: 4px; }
.ks-item { display: flex; gap: 10px; align-items: baseline; padding: 6px 9px; border-radius: 6px; cursor: pointer; }
.ks-item:hover, .ks-item.ks-on { background: var(--chip); }
.ks-nr { font-weight: 700; color: var(--brand); min-width: 52px; font-variant-numeric: tabular-nums; }
.ks-name { color: var(--ink); }
/* Kurztext aus dem Kontenlexikon unter dem markierten Treffer (06.11.2026) */
.ks-dd { max-width: min(560px, 94vw); }
.ks-item { flex-wrap: wrap; }
.ks-kurz { display: none; flex-basis: 100%; padding-left: 62px; font-size: 12.5px; line-height: 1.4;
  color: var(--muted); }
.ks-item:hover .ks-kurz, .ks-item.ks-on .ks-kurz { display: block; }
.ks-mehr { text-decoration: underline; }
.ks-empty { padding: 7px 9px; color: var(--muted); }
.ks-ki { padding: 7px 9px; margin-top: 2px; border-top: 1px solid var(--line); color: var(--brand);
  cursor: pointer; font-weight: 600; }
.ks-ki:hover { background: var(--marke-zart-2); }
td .aktionen { display: flex; gap: 6px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }

.page-head { display: flex; align-items: center; margin-bottom: 20px; gap: 16px; }
.page-head h1 { font-size: 22px; margin: 0; }
.page-head .spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 500;
}
.btn:hover { background: var(--flaeche-2); text-decoration: none; }
.btn-primary { background: var(--marke-flaeche); border-color: var(--marke-flaeche); color: var(--auf-marke); }
.btn-primary:hover { background: var(--marke-flaeche-dk); border-color: var(--marke-flaeche-dk); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-danger:hover { background: var(--err-bg); border-color: var(--err-ink); color: var(--err-ink); }

.panel { background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); }
td { word-break: break-word; overflow-wrap: break-word; min-width: 0; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
/* Sticky-Kopf: Spaltenkoepfe der Listentabellen bleiben beim Scrollen unter der Filterzeile sichtbar */
body.with-sidebar main table thead th { position: sticky; top: var(--stick-h, 50px); z-index: 12;
  background: var(--panel); box-shadow: inset 0 -1px 0 var(--line); }
.viewhead { position: sticky; top: 0; z-index: 40; background: var(--bg);
  box-shadow: 0 10px 16px -12px rgba(42,46,48,.25); }
tr:last-child td { border-bottom: none; }
tr.inaktiv td { color: var(--muted); background: var(--flaeche-2); }
td .name { font-weight: 600; }
td .name a { color: var(--ink); }

.chip { display: inline-block; padding: 2px 9px; border-radius: 99px;
  background: var(--chip); font-size: 12px; color: var(--muted); font-weight: 500; }
.chip.ok { background: var(--ok-bg); color: var(--ok-ink); }
.chip.off { background: var(--chip-off-bg); color: var(--chip-off-ink); }

.flash { padding: 11px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.flash.ok { background: var(--ok-bg); color: var(--ok-ink); }
.flash.error { background: var(--err-bg); color: var(--err-ink); }

.empty { text-align: center; padding: 48px 24px; color: var(--muted); }

.card { padding: 24px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; color: var(--label-ink); }
/* Gedaempfter Hinweis. Stand bis zum 18.10.2026 NUR als ".field .hint" da -
   also nur innerhalb eines Formularfelds. 103 der 117 Verwendungen stehen
   woanders; dort tat die Klasse nichts, und die Masken haben es mit
   style="color:var(--muted)" von Hand nachgebaut.
   Bewusst OHNE Schriftgroesse: Die Masken sind sich uneinig (27x 13px, 6x 12px,
   59x gar nichts), und eine Groesse hier wuerde 59 Stellen kleiner machen. */
.hint { color: var(--muted); }
.field .hint { font-size: 12px; color: var(--muted); }
/* Alle Texteingaben, nicht nur [type=text]: Bis 21.09.2026 stand hier allein
   `input[type=text]` -- Passwort-, Datums-, Zahl-, Such- und E-Mail-Felder fielen
   durch und erschienen im rohen Browser-Stil (21 px statt 43 px hoch, Arial,
   grauer Inset-Rahmen). Aufgefallen an der neuen Anmeldemaske, betroffen waren
   38 Felder. Ausgenommen bleiben Kasten-, Auswahl- und Dateifelder: die haben
   ihre eigene Darstellung. */
/* Farbe gehoert ALLEN Eingabefeldern, nicht nur denen in einem .field.
   (18.10.2026) Bis hierher hingen alle Regeln an .field - 91 von 234 Feldern
   stehen aber woanders: in Tabellen, Filterzeilen, Suchfeldern. Die zeigten den
   Browser-Standard, also weissen Grund mit schwarzer Schrift. Im hellen Thema
   faellt das kaum auf; im dunklen ist jedes davon ein Leuchtkasten.
   Aufgefallen an den Kontofeldern der Belegpruefung.
   Die GROESSE bleibt unten bei .field: Die Felder draussen bringen eigene Masse
   mit (width:80px, padding:6px 9px), und 9px Polster wuerden jede Tabellenzeile
   sprengen. */
input[type=text], input[type=password], input[type=date], input[type=month],
input[type=number], input[type=email], input[type=search], input[type=tel],
input[type=url], input:not([type]), select, textarea {
  background: var(--eingabe-bg); color: var(--ink);
}
/* Wer tippt, muss sehen, wohin. Galt vorher auch nur im .field. */
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring);
}

/* Polster, Rahmen und Radius sind Sache des Formular-Layouts. */
.field input[type=text], .field input[type=password], .field input[type=date],
.field input[type=month], .field input[type=number], .field input[type=email],
.field input[type=search], .field input[type=tel], .field input[type=url],
.field input:not([type]),
.field select, .field textarea {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit;
}
.field.check { flex-direction: row; align-items: center; gap: 9px; }
.field.check label { font-weight: 500; }
fieldset { border: none; padding: 0; margin: 0 0 6px; }
fieldset legend { font-size: 12px; text-transform: uppercase; letter-spacing: .4px;
  color: var(--muted); font-weight: 600; padding-bottom: 4px; }
.form-actions { display: flex; gap: 12px; margin-top: 24px; padding-top: 20px;
  border-top: 1px solid var(--line); }
.section-title { grid-column: 1/-1; font-size: 14px; text-transform: uppercase;
  letter-spacing: .6px; color: var(--brand); font-weight: 700;
  margin-top: 28px; padding: 7px 0 9px 12px; border-left: 4px solid var(--accent);
  border-bottom: 2px solid var(--accent); background: linear-gradient(90deg, var(--chip), transparent 60%); }
.section-title:first-child { margin-top: 4px; }
.inline-form { display: inline; }

/* Export-Optionen: jede Zeile mit Abstand + Trennlinie */
.export-block { display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 18px 0; border-bottom: 1px solid var(--line); }
.export-block:first-child { padding-top: 0; }

/* Upload-Dropzone */
.dropzone { display: block; border: 2px dashed var(--line); border-radius: var(--radius);
  background: var(--flaeche-2); padding: 32px 24px; text-align: center; cursor: pointer; transition: .15s; }
.dropzone:hover { border-color: var(--brand); background: var(--ablage-bg); }
.dropzone.over { border-color: var(--brand); background: var(--ablage-over); }
.dropzone .link { color: var(--brand); text-decoration: underline; }
.dropzone .hint { margin-top: 8px; font-size: 12px; color: var(--muted); }
.filelist { margin-top: 14px; display: flex; flex-direction: column; gap: 4px; }
.fileitem { font-size: 13px; color: var(--ink); background: var(--chip);
  border-radius: 6px; padding: 4px 10px; display: inline-block; }

/* Aufklappbares Bearbeiten (Bank-Direktbuchung) */
details.editbox { display: inline-block; }
details.editbox > summary { list-style: none; cursor: pointer; }
details.editbox > summary::-webkit-details-marker { display: none; }
details.editbox[open] > summary { background: var(--flaeche-2); }


/* Kontosuche: eigene Konten des Mandanten vs. Vorschlaege aus dem Kontenrahmen */
.ks-item.ks-eigen .ks-nr { font-weight: 700; }
.ks-neu {
  margin-left: auto; font-size: 10.5px; color: var(--warn-ink);
  background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 4px; padding: 0 5px;
}

/* === Soforthilfe (16.10.2026, Muster aus SAS) ===================================
   „?“ neben der Überschrift schaltet sie ein (static/soforthilfe.js). Solange sie läuft,
   ist ALLES Erklärte dauerhaft markiert — nicht nur bei :hover, denn auf dem Tablet gibt
   es kein Hover. `outline` statt Rahmen: verschiebt nichts im Layout. */
.hilfe-modus-btn { min-width: 34px; font-weight: 700; color: var(--brand); }
.hilfe-modus-btn.aktiv { background: var(--marke-flaeche); border-color: var(--brand); color: var(--auf-marke); }
.hilfe-modus-btn-h1 { margin-left: 12px; vertical-align: middle; }
.hilfe-modus-btn-frei { float: right; margin: 0 0 8px 12px; }
body.hilfe-modus, body.hilfe-modus * { cursor: help !important; }
body.hilfe-modus [data-hilfe] {
  outline: 2px solid var(--accent); outline-offset: 1px;
  background-color: var(--ring); border-radius: 6px;
}
body.hilfe-modus [data-hilfe]:hover,
body.hilfe-modus [data-hilfe]:active { background-color: var(--marke-flaeche); color: var(--auf-marke); }
#hilfe-leiste {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 9999;
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  background: var(--hinweis-bg); color: var(--hinweis-ink); border-radius: 12px;
  padding: 10px 12px 10px 16px; box-shadow: 0 6px 24px rgba(0,0,0,.25);
  font-size: 14px; line-height: 1.4;
}
#hilfe-leiste .text { min-width: 0; }
#hilfe-leiste.warnt { background: var(--err-ink); }
#hilfe-leiste button {
  flex: 0 0 auto; min-height: 44px; padding: 0 18px; border: 0; border-radius: 9px;
  background: var(--marke-flaeche); color: var(--auf-marke); font: inherit; font-weight: 600; cursor: pointer;
}
@media (max-width: 480px) { #hilfe-leiste { font-size: 13px; } }

/* Hilfeseite */
.hilfe-suchzeile { margin: 14px 0 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hilfe-suchzeile input { width: 100%; max-width: 420px; }
.hilfe-themen { display: flex; flex-direction: column; gap: 12px; max-width: 900px; }
.hilfe-thema { padding: 14px 18px; }
.hilfe-thema summary { cursor: pointer; font-weight: 600; font-size: 15px; }
.hilfe-inhalt { margin-top: 10px; }
.hilfe-inhalt p { margin: 0 0 10px; line-height: 1.55; scroll-margin-top: 16px;
  transition: background-color 1.2s ease; border-radius: 6px; }
.hilfe-highlight { background-color: rgba(136,131,191,.30) !important; }
mark.hilfe-treffer { background: var(--marke-flaeche); color: var(--auf-marke); border-radius: 3px; padding: 0 1px; }


/* =====================================================================
   Umbau Schritt 4: dunkles Thema                          (17.10.2026)
   =====================================================================
   Drei Zustaende: ohne Angabe gilt die Systemeinstellung, mit
   data-theme="dark"/"light" die ausdrueckliche Wahl. Die Media-Abfrage ist
   mit :not([data-theme="light"]) abgesichert, damit ein dunkles
   Betriebssystem die Wahl "hell" nicht ueberstimmt.

   --auf-marke bleibt weiss: Text auf der Markenfarbe, und die bleibt lila.
   --brand wird heller, weil #6e6aa1 auf dunklem Grund zu wenig Kontrast hat.
   -------------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #15171d;
    --panel: #1d2028;
    --ink: #e5e8ec;
    --muted: #9aa1ac;
    --line: #2f333e;
    --brand: #a9a3dc;
    --brand-dk: #8b84c4;
    --accent: #9c95d4;
    --ring: rgba(169,163,220,.26);
    --ok-bg: #16301f;  --ok-ink: #6fc79d;
    --err-bg: #3a1d1a; --err-ink: #ee8c84;
    --chip: #272533;
    --shadow: 0 1px 3px rgba(0,0,0,.34), 0 4px 16px rgba(0,0,0,.26);
    --flaeche-2: #23262f;
    --flaeche-3: #191c22;
    --eingabe-bg: #171a20;
    --label-ink: #b8bfc9;
    --marke-zart-ink: #a9a3dc;  /* heller, weil --marke-zart hier dunkel ist */
    --marke-zart: #262440;
    --marke-zart-2: #302c52;
    --chip-off-bg: #24272f;
    --chip-off-ink: #8a929c;
    --warn-bg: #352b14;
    --warn-ink: #e0b65c;
    --warn-line: #574a22;
    --signal-ok: #1e7d3a;    /* bleibt gleich - traegt weisse Schrift */
    --signal-err: #b3261e;
    --marke-flaeche: #6e6aa1;    /* bleibt gleich - traegt weisse Schrift */
    --info-bg: #1e2a3a;      /* 11.8:1 gegen --ink, 5.6:1 gegen --muted */
    --info-line: #32465f;
    --info-ink: #8ab4e8;   /* 6.75:1 gegen --info-bg */
    --summe-bg: #2a2740;
    --summe-line: #3d3a5c;
    --marke-flaeche-dk: #585488;
    --zebra: #22252c;        /* eine Spur heller als --panel, sonst verschwindet
                                der Streifen im Dunkeln */
    --ablage-bg: #1b2330;
    --ablage-over: #203044;
    --hinweis-bg: #e5e8ec;
    --hinweis-ink: #15171d;
    --schleier: rgba(0,0,0,.7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #15171d;
  --panel: #1d2028;
  --ink: #e5e8ec;
  --muted: #9aa1ac;
  --line: #2f333e;
  --brand: #a9a3dc;
  --brand-dk: #8b84c4;
  --accent: #9c95d4;
  --ring: rgba(169,163,220,.26);
  --ok-bg: #16301f;  --ok-ink: #6fc79d;
  --err-bg: #3a1d1a; --err-ink: #ee8c84;
  --chip: #272533;
  --shadow: 0 1px 3px rgba(0,0,0,.34), 0 4px 16px rgba(0,0,0,.26);
  --flaeche-2: #23262f;
  --flaeche-3: #191c22;
  --eingabe-bg: #171a20;
  --label-ink: #b8bfc9;
  --marke-zart-ink: #a9a3dc;
  --marke-zart: #262440;
  --marke-zart-2: #302c52;
  --chip-off-bg: #24272f;
  --chip-off-ink: #8a929c;
  --warn-bg: #352b14;
  --warn-ink: #e0b65c;
  --warn-line: #574a22;
  --signal-ok: #1e7d3a;
  --signal-err: #b3261e;
  --marke-flaeche: #6e6aa1;
  --marke-flaeche-dk: #585488;
  --info-bg: #1e2a3a;
  --info-line: #32465f;
  --info-ink: #8ab4e8;
  --summe-bg: #2a2740;
  --summe-line: #3d3a5c;
  --zebra: #22252c;
  --ablage-bg: #1b2330;
  --ablage-over: #203044;
  --hinweis-bg: #e5e8ec;
  --hinweis-ink: #15171d;
  --schleier: rgba(0,0,0,.7);
}

/* =====================================================================
   Zahlen in Festbreite                                    (17.10.2026)
   ---------------------------------------------------------------------
   In einer Buchhaltung liest man Spalten, nicht Saetze: Betraege muessen
   untereinander stehen und gleich breite Ziffern haben. tabular-nums
   erzwingt das auch bei Schriften, die sonst proportionale Ziffern haben.
   -------------------------------------------------------------------- */
td.num, th.num, .num, .betrag, .zahl {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
table { font-variant-numeric: tabular-nums; }
.mono, code, .zahl-mono { font-family: var(--zahl); }

/* =====================================================================
   "Als Naechstes" - die eine Sache, die jetzt dran ist    (17.10.2026)
   ---------------------------------------------------------------------
   Rene, 17.10.2026: "Am besten so, dass der nächste Schritt immer gleich
   angezeigt wird." Nicht acht gleich grosse Kacheln, sondern eine grosse
   und darunter die Warteschlange.
   -------------------------------------------------------------------- */
.jetzt-karte {
  background: var(--ok-bg);
  border: 1.5px solid var(--ok-ink);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex; flex-wrap: wrap; gap: 16px;
  align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.jetzt-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.jetzt-kennung {
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ok-ink);
}
.jetzt-titel { font-size: 19px; font-weight: 650; letter-spacing: -.01em; }
.jetzt-warum { font-size: 13.5px; color: var(--muted); }
.jetzt-karte .btn, .jetzt-karte a.knopf {
  background: var(--ok-ink); color: var(--panel);
  border: 0; border-radius: 9px; padding: 12px 20px;
  font-size: 14.5px; font-weight: 600; min-height: 48px;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
}
.jetzt-karte .btn:hover, .jetzt-karte a.knopf:hover {
  text-decoration: none; filter: brightness(1.08);
}
/* Nichts zu tun: der Kasten tritt zurueck, statt eine Null zu zeigen. */
.jetzt-karte.fertig { background: var(--flaeche-2); border-color: var(--line); }
.jetzt-karte.fertig .jetzt-kennung { color: var(--muted); }

/* ---- Die Warteschlange darunter ---- */
.schlange {
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--panel);
}
.schlange .reihe {
  display: grid; grid-template-columns: 34px 1fr auto 18px;
  gap: 13px; align-items: center; padding: 13px 15px;
  border-bottom: 1px solid var(--line); color: inherit;
}
.schlange .reihe:last-child { border-bottom: 0; }
.schlange a.reihe:hover { background: var(--flaeche-2); text-decoration: none; }
.schlange .reihe.ruht { background: var(--flaeche-2); }
.reihe-marke {
  width: 26px; height: 26px; border-radius: 7px;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.reihe-marke.jetzt { background: var(--ok-bg); color: var(--ok-ink); }
.reihe-marke.warte { background: var(--warn-bg); color: var(--warn-ink); }
.reihe-marke.ruht { background: var(--chip-off-bg); color: var(--chip-off-ink); }
.reihe-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.reihe-titel { font-size: 14.5px; font-weight: 550; }
.reihe-sub { font-size: 12.5px; color: var(--muted); }
.reihe-zahl {
  font-size: 15px; font-weight: 500; text-align: right;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.reihe-zahl small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
.reihe-pfeil { color: var(--muted); font-size: 18px; text-align: center; }
@media (max-width: 620px) {
  .schlange .reihe { grid-template-columns: 26px 1fr auto; gap: 10px; }
  .reihe-pfeil { display: none; }
}

/* ---- Fortschritt: wie weit ist der Mandant? ---- */
.fortschritt { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.fortschritt .balken {
  height: 7px; border-radius: 99px; background: var(--line);
  overflow: hidden; display: flex;
}
.fortschritt .balken i { display: block; height: 100%; }
.fortschritt .balken i.fertig { background: var(--ok-ink); }
.fortschritt .balken i.offen { background: var(--warn-ink); }
.fortschritt .balken-text {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 12.5px; color: var(--muted); flex-wrap: wrap;
}

/* =====================================================================
   "Was fehlt noch" beim einzelnen Beleg                   (17.10.2026)
   ---------------------------------------------------------------------
   Die Pruefungen, die der Code heute erst NACH dem Abschicken meldet,
   stehen hier vorher. Abgehakt, was steht; offen, was fehlt.
   -------------------------------------------------------------------- */
.fehlt { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
         margin-bottom: 18px; background: var(--panel); }
.fehlt-kopf {
  background: var(--flaeche-2); padding: 11px 15px;
  border-bottom: 1px solid var(--line); font-size: 13.5px; font-weight: 600;
}
.fehlt-zeile {
  display: grid; grid-template-columns: 22px 1fr auto; gap: 11px;
  align-items: center; padding: 11px 15px;
  border-bottom: 1px solid var(--line); font-size: 14px;
}
.fehlt-zeile:last-child { border-bottom: 0; }
.fehlt-haken {
  width: 19px; height: 19px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
}
.fehlt-haken.ok { background: var(--ok-bg); color: var(--ok-ink); }
.fehlt-haken.offen { background: var(--warn-bg); color: var(--warn-ink); }
.fehlt-haken.fehler { background: var(--err-bg); color: var(--err-ink); }
.fehlt-weg {
  font-size: 12px; font-weight: 500; color: var(--brand);
  border: 1px solid var(--line); border-radius: 7px; padding: 6px 11px;
  min-height: 32px; display: inline-flex; align-items: center; white-space: nowrap;
}
.fehlt-weg:hover { background: var(--marke-zart); text-decoration: none; }
@media (max-width: 560px) {
  .fehlt-zeile { grid-template-columns: 22px 1fr; }
  .fehlt-weg { grid-column: 2; justify-self: start; margin-top: 4px; }
}

/* ---- Der Umschalter fuer das Thema (sitzt in der Seitenleiste) ---- */
.thema-schalter {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--flaeche-2); border: 1px solid var(--line); border-radius: 9px;
}
.thema-schalter button {
  border: 0; background: transparent; color: var(--muted);
  font: inherit; font-size: 12px; padding: 6px 10px; border-radius: 6px;
  cursor: pointer; min-height: 32px;
}
.thema-schalter button[aria-pressed="true"] {
  background: var(--panel); color: var(--ink); font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}


/* =====================================================================
   Mandant wechseln per Klick auf den Namen               (17.10.2026)
   ---------------------------------------------------------------------
   Rene: "Ich klicke auf den angezeigten Mandanten und kann dann einen
   neuen wählen." Ohne JavaScript ueber <details>/<summary>.
   -------------------------------------------------------------------- */
.mandant-wahl { display: inline-block; position: relative; }
.mandant-wahl > summary {
  display: inline-flex; align-items: center; gap: 7px;
  cursor: pointer; list-style: none;
  color: var(--muted); font-weight: 400; font-size: inherit;
  padding: 2px 9px 2px 4px; border-radius: 8px;
  border: 1px solid transparent; min-height: 36px;
}
.mandant-wahl > summary::-webkit-details-marker { display: none; }
.mandant-wahl > summary::after {
  content: "\25be"; font-size: .62em; opacity: .75;   /* kleines Dreieck */
}
.mandant-wahl > summary:hover {
  color: var(--ink); background: var(--marke-zart); border-color: var(--line);
}
.mandant-wahl[open] > summary {
  color: var(--ink); background: var(--marke-zart); border-color: var(--line);
}
.mandant-wahl > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.mandant-wahl-liste {
  position: absolute; z-index: 300; top: calc(100% + 6px); left: 0;
  min-width: 290px; max-width: min(420px, 90vw);
  max-height: min(70vh, 460px); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.14);
  padding: 6px; display: flex; flex-direction: column; gap: 1px;
}
.mandant-wahl-kopf {
  font: 600 10.5px/1 var(--zahl); letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
  padding: 9px 10px 7px;
}
.mandant-wahl-eintrag {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 11px 10px; border-radius: 8px;
  font-size: 15px; font-weight: 500; color: var(--ink); text-decoration: none;
  min-height: 44px;                      /* Tap-Ziel, auch auf dem Tablet */
}
.mandant-wahl-eintrag:hover { background: var(--flaeche-2); text-decoration: none; }
.mandant-wahl-eintrag small {
  font-size: 11.5px; font-weight: 400; color: var(--muted); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.mandant-wahl-eintrag.jetzt { background: var(--marke-zart); color: var(--marke-zart-ink); cursor: default; }
.mandant-wahl-alle {
  margin-top: 4px; padding: 10px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--brand); text-decoration: none; min-height: 40px;
  display: flex; align-items: center;
}
.mandant-wahl-alle:hover { text-decoration: underline; }
@media (max-width: 560px) {
  .mandant-wahl-liste { position: static; min-width: 0; width: 100%; box-shadow: none; }
}


/* =====================================================================
   Klassen statt Inline-Stile                             (17.10.2026)
   ---------------------------------------------------------------------
   Gemessen: 1406 Stilangaben in 64 Masken, 544 verschiedene Muster. Die
   haeufigsten sind hier als Klasse hinterlegt; 223 Stellen sind darauf
   umgestellt. Der lange Schwanz (524 Muster mit unter acht Vorkommen)
   bleibt vorerst stehen - eine Klasse fuer einen Einzelfall ist keine
   Ordnung, sondern eine zweite Stelle zum Nachsehen.
   -------------------------------------------------------------------- */

/* Gedaempfter Text: Hinweise, Einheiten, Nebenangaben.
   War 194x als style="color:var(--muted)" in 30 Masken. */
.leise { color: var(--muted); font-weight: 400; }

/* Nicht umbrechen: Datum, Kontonummer, Betrag in einer Tabellenzelle. */
.nowrap { white-space: nowrap; }

/* .num steht weiter oben (Zahlen in Festbreite, rechtsbuendig) und
   ersetzt text-align:right - dort war bisher KEIN tabular-nums gesetzt,
   die Ziffern standen also nicht untereinander. */


/* =====================================================================
   Sprungziele der "Noch zu klaeren"-Liste                 (18.10.2026)
   ---------------------------------------------------------------------
   Rene: "wenn ich den druecke passiert nichts. Wozu ist der da?"
   Die Knoepfe waren Anker auf ids, die es nicht gab - sechs Stueck, alle
   tot. Jetzt gibt es die Ziele; damit man auch SIEHT, wo man gelandet
   ist, hebt :target sie kurz hervor. Ohne das wirkt der Knopf wieder,
   als haette er nichts getan.
   -------------------------------------------------------------------- */
.sprungziel {
  /* Nicht unter der klebenden Kopfzeile landen. --stick-h setzt base.html
     zur Laufzeit; 90px ist die Rueckfallebene. */
  scroll-margin-top: calc(var(--stick-h, 90px) + 16px);
}
.sprungziel:target {
  outline: 2px solid var(--marke-flaeche);
  outline-offset: 5px;
  border-radius: var(--radius);
  animation: ziel-blinken 1.4s ease-out 1;
}
@keyframes ziel-blinken {
  0%, 55% { outline-color: var(--marke-flaeche); }
  100%    { outline-color: transparent; }
}
/* Wer "Bewegung reduzieren" eingestellt hat, bekommt den Umriss ohne
   Verlauf - sichtbar bleibt er trotzdem. */
@media (prefers-reduced-motion: reduce) {
  .sprungziel:target { animation: none; }
}


/* =====================================================================
   Gedaempfter Text in drei Groessen                       (18.10.2026)
   ---------------------------------------------------------------------
   127 Stellen setzten color:var(--muted) zusammen mit einer Groesse.
   Gemessen sind das drei Rollen, nicht drei Zufaelle - darum drei
   Klassen und nicht eine mit Varianten. Die Werte sind genau die
   bisherigen: im Aussehen aendert sich nichts.
   -------------------------------------------------------------------- */

/* Beschriftung neben einem Bedienelement: "Zeitraum:", "Konto:". */
.beschriftung { color: var(--muted); font-size: 13px; }

/* Nebenangabe in der zweiten Zeile einer Listen- oder Tabellenzeile:
   Verwendungszweck, IBAN, Buchungssatz. */
.nebenangabe { color: var(--muted); font-size: 12px; }

/* Mikro-Beschriftung in dichten Tabellen: "Gegenkonto", "an". */
.spaltenmarke { color: var(--muted); font-size: 11px; }


/* Untertitel direkt unter einer Ueberschrift: rueckt heran und laesst nach
   unten Luft. Stand an 24 Stellen als eigener Rand da, mit sechs verschiedenen
   Werten zwischen -6/-8px oben und 12-18px unten - gewachsen, nicht
   entschieden. (18.10.2026) */
.unter-titel { margin: -8px 0 16px; }


/* Kopfzeile innerhalb eines Kastens: "Offene Posten", "Abgelegte Dokumente".
   Stand an 13 Stellen in 11 Masken als eigener Stil da. (18.10.2026)
   Nicht .fehlt-kopf - der gehoert zur "Noch zu klaeren"-Liste und ist enger
   und kleiner. */
.block-kopf {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}


/* Betragsspalte in der Summen- und Saldenliste. Stand 16x als eigener Stil da.
   (18.10.2026)
   --zahl statt "monospace": derselbe Schriftstapel wie im Rest der Anwendung
   (SFMono, Consolas, Menlo) statt des nackten Browser-Standards. */
.zahl-spalte {
  font-family: var(--zahl);
  font-variant-numeric: tabular-nums;
  padding: 4px 8px;
  text-align: right;
}
/* Trennlinie zwischen zwei Spaltengruppen. */
.zahl-spalte.trenner { border-left: 2px solid var(--summe-line); }


/* Zwischenueberschrift in einem Kasten. Bis zum 18.10.2026 gab es fuer h2
   KEINE Regel - 30 von 35 Ueberschriften trugen darum einen eigenen Stil, in
   zwei Groessen und sieben Abstaenden, und die fuenf ohne Stil zeigten den
   Browser-Standard (24px, fett).
   Die Werte sind die haeufigsten der bisherigen: 16px und 0 0 6px. Was davon
   abweicht, steht weiter als Inline-Stil da und ueberschreibt diese Regel. */
h2 {
  font-size: 16px;
  font-weight: 650;
  margin: 0 0 6px;
  line-height: 1.3;
}


/* Jedes Klappelement zeigt den Handzeiger. (18.10.2026)
   Bis hierher stand cursor:pointer an 19 von 31 <summary> als Inline-Stil -
   und bei den uebrigen zwoelf fehlte er. Dort sah ein aufklappbarer Abschnitt
   aus wie gewoehnlicher Text, und wer das nicht wusste, klickte nicht.
   Regeln gab es nur fuer zwei Sonderfaelle (details.editbox, .hilfe-thema). */
summary { cursor: pointer; }


/* Text, der auf einen Fehlstand hinweist: fehlgeschlagene Suche, fehlende
   Vorsteuer, Ausgaben. Stand 12x als color:var(--err-ink) da. (18.10.2026) */
.fehler-text { color: var(--err-ink); }
