:root {
  --rot: #8b1e2d;
  --rot-hell: #f6e9eb;
  --rot-dunkel: #6d1522;
  --ink: #1d1b1a;
  --ink-2: #57524f;
  --ink-3: #8a8480;
  --flaeche: #ffffff;
  --grund: #f5f3f1;
  --linie: #e6e1dd;
  --linie-2: #d6d0cb;
  --plus: #0b7a34;
  --minus: #b3261e;
  --warn: #9a5b00;
  --warn-bg: #fff4dc;
  --fehler-bg: #fdeceb;
  --info-bg: #eef3fb;
  --radius: 10px;
  --schatten: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
  --nav-h: 64px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px; line-height: 1.45; color: var(--ink); background: var(--grund);
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
a { color: var(--rot); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 8px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.muted { color: var(--ink-3); }
.klein { font-size: 13px; }
.versteckt { display: none !important; }

/* ---------- Kopf / Navigation ---------- */
header.kopf {
  position: sticky; top: 0; z-index: 20; background: var(--flaeche); border-bottom: 1px solid var(--linie);
  display: flex; align-items: center; gap: 18px; padding: 0 24px; height: 60px;
}
.marke { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; white-space: nowrap; }
.marke img { width: 34px; height: 40px; object-fit: contain; }
.marke small { display: block; font-weight: 400; color: var(--ink-3); font-size: 12px; line-height: 1.1; }
nav.haupt { display: flex; gap: 4px; flex: 1; }
nav.haupt { overflow-x: auto; }
nav.haupt a, .navmehr a { white-space: nowrap;
  color: var(--ink-2); padding: 8px 12px; border-radius: 8px; font-weight: 500; text-decoration: none;
}
nav.haupt a.aktiv { background: var(--rot-hell); color: var(--rot); }
nav.haupt a:hover { background: var(--grund); }
.kopf-rechts { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.rolle { font-size: 12px; padding: 3px 8px; border-radius: 99px; background: var(--grund); color: var(--ink-2); }

nav.unten { display: none; }

main { max-width: 1240px; margin: 0 auto; padding: 24px 24px 80px; }

/* ---------- Bausteine ---------- */
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 18px; box-shadow: var(--schatten); }
.karte + .karte { margin-top: 16px; }
.gitter { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.seitenkopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.zeile { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.abstand { margin-top: 16px; }

button, .knopf {
  font: inherit; font-weight: 500; border: 1px solid var(--linie-2); background: var(--flaeche); color: var(--ink);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none; min-height: 38px; white-space: nowrap;
}
button:hover, .knopf:hover { background: var(--grund); text-decoration: none; }
button.primaer, .knopf.primaer { background: var(--rot); border-color: var(--rot); color: #fff; }
button.primaer:hover { background: var(--rot-dunkel); }
button.gefahr { color: var(--minus); border-color: #e9c3c0; }
button.gefahr:hover { background: var(--fehler-bg); }
button.flach { border-color: transparent; background: transparent; color: var(--rot); padding: 6px 8px; }
button:disabled { opacity: .5; cursor: default; }
button svg, .knopf svg { width: 18px; height: 18px; }

label.feld { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); font-weight: 500; min-width: 0; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--flaeche); border: 1px solid var(--linie-2); border-radius: 8px;
  padding: 8px 10px; min-height: 40px; width: 100%; min-width: 0;
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--rot); outline-offset: -1px; border-color: var(--rot); }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--rot); }
label.check { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; }
.hinweis-feld { font-size: 12px; color: var(--ink-3); font-weight: 400; }
.betrag-input { font-size: 20px; font-weight: 600; text-align: right; }

.segment { display: inline-flex; background: var(--grund); border: 1px solid var(--linie); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.segment button { border: 0; background: transparent; min-height: 34px; padding: 6px 14px; color: var(--ink-2); }
.segment button.an { background: var(--flaeche); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.segment button.an[data-art=Ausgabe] { color: var(--minus); }
.segment button.an[data-art=Einnahme] { color: var(--plus); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 13px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--linie-2); background: var(--flaeche); cursor: pointer; min-height: 0; }
.chip:hover { border-color: var(--rot); color: var(--rot); background: var(--flaeche); }

.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 99px; background: var(--grund); color: var(--ink-2); border: 1px solid var(--linie); white-space: nowrap; }
.badge.offen { background: var(--warn-bg); color: var(--warn); border-color: #f1d9a6; }
.badge.bezahlt { background: #e7f4ec; color: var(--plus); border-color: #c4e3cf; }
.badge.storniert { text-decoration: line-through; }

.plus { color: var(--plus); }
.minus { color: var(--minus); }
.betrag { text-align: right; white-space: nowrap; font-weight: 600; }

/* ---------- Kacheln ---------- */
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.kachel { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--schatten); }
.kachel .titel { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.kachel .wert { font-size: 24px; font-weight: 650; margin-top: 2px; letter-spacing: -.01em; }
.kachel .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.kachel.haupt { border-color: var(--rot); box-shadow: inset 0 0 0 1px var(--rot); }

/* ---------- Hinweise ---------- */
.hinweise { display: flex; flex-direction: column; gap: 8px; }
.hinweis { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.hinweis svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.hinweis .text { flex: 1; }
.hinweis.warnung { background: var(--warn-bg); color: #5c3b00; }
.hinweis.fehler { background: var(--fehler-bg); color: #6d1611; }
.hinweis.info { background: var(--info-bg); color: #1d3b66; }
.hinweis.ok { background: #e7f4ea; color: #1d4d2b; }
.erkennung-box { text-align: left; }
.erkennung-box:empty { display: none; }
.hinweis button { min-height: 30px; padding: 4px 10px; font-size: 13px; }

/* ---------- Tabellen ---------- */
table.tab { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tab th { text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; padding: 8px 10px; border-bottom: 1px solid var(--linie); }
table.tab td { padding: 8px 10px; border-bottom: 1px solid var(--linie); vertical-align: top; }
table.tab tr:last-child td { border-bottom: 0; }
table.tab th.r, table.tab td.r { text-align: right; }
table.tab tfoot td { font-weight: 650; border-top: 2px solid var(--linie-2); }
.tab-scroll { overflow-x: auto; }

/* ---------- Buchungsliste ---------- */
.filter { display: grid; grid-template-columns: 110px minmax(180px, 2fr) repeat(3, minmax(130px, 1fr)); gap: 10px; margin-bottom: 12px; }
.summen { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); margin: 4px 0 12px; }
.summen b { color: var(--ink); }
.liste { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); overflow: hidden; box-shadow: var(--schatten); }
.liste-kopf, .eintrag {
  display: grid; grid-template-columns: 92px 70px minmax(0, 2.2fr) minmax(0, 1.4fr) 110px 120px 46px;
  gap: 10px; padding: 9px 14px; align-items: center;
}
.liste-kopf { font-size: 12px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid var(--linie); background: #fbfaf9; }
.eintrag { border-bottom: 1px solid var(--linie); color: var(--ink); text-decoration: none; font-size: 14px; }
.eintrag:last-child { border-bottom: 0; }
.eintrag:hover { background: #fbf7f7; text-decoration: none; }
.eintrag .haupt { min-width: 0; }
.eintrag .haupt .p { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eintrag .haupt .b, .eintrag .kat { color: var(--ink-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eintrag .nr { color: var(--ink-3); font-size: 13px; }
.eintrag .icons { display: flex; gap: 4px; justify-content: flex-end; color: var(--ink-3); }
.eintrag .icons svg { width: 16px; height: 16px; }
.eintrag .icons .an { color: var(--rot); }
.fehlt { color: var(--minus); font-style: italic; }
.leer { padding: 40px; text-align: center; color: var(--ink-3); }

/* ---------- Formular ---------- */
.formular { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.felder { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.felder.f4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.s2 { grid-column: span 2; } .s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s6 { grid-column: span 6; }
.vorschlag { background: var(--info-bg); color: #1d3b66; border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.erweitert-gitter { display: grid; grid-template-columns: 110px 1fr 1fr; gap: 8px; align-items: center; }
.erweitert-gitter .k { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.aktionen { display: flex; gap: 8px; flex-wrap: wrap; justify-content: space-between; margin-top: 16px; }
.aktionen .links, .aktionen .rechts { display: flex; gap: 8px; flex-wrap: wrap; }
.kk-liste { max-height: 260px; overflow: auto; border: 1px solid var(--linie); border-radius: 8px; margin-top: 8px; }
.kk-liste label { display: grid; grid-template-columns: 22px 80px 1fr 90px; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--linie); font-size: 13px; align-items: center; cursor: pointer; }
.kk-liste label:last-child { border-bottom: 0; }

.beleg-box { border: 2px dashed var(--linie-2); border-radius: var(--radius); padding: 16px; text-align: center; }
.beleg-box.drueber { border-color: var(--rot); background: var(--rot-hell); }
.beleg-vorschau { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; justify-content: center; }
.beleg-vorschau .datei { position: relative; width: 74px; height: 96px; border: 1px solid var(--linie); border-radius: 6px; overflow: hidden; background: var(--grund); display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--ink-2); }
.beleg-vorschau .datei img { width: 100%; height: 100%; object-fit: cover; }
.beleg-vorschau .datei button { position: absolute; top: 2px; right: 2px; min-height: 0; padding: 0 6px; font-size: 12px; border-radius: 99px; }
.beleg-vorhanden { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: var(--grund); border-radius: 8px; padding: 10px 12px; text-align: left; margin-bottom: 12px; flex-wrap: wrap; }
.beleg-vorhanden svg { width: 18px; height: 18px; vertical-align: -4px; color: var(--rot); }
.beleg-frame { width: 100%; height: 420px; border: 1px solid var(--linie); border-radius: 8px; margin-top: 10px; background: #fff; }

/* ---------- Dialog / Toast ---------- */
dialog { border: 0; border-radius: 14px; padding: 0; max-width: min(560px, 94vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(20,10,10,.35); }
dialog .inhalt { padding: 20px; }
dialog .knopfleiste { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 20px; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 100; box-shadow: 0 6px 24px rgba(0,0,0,.25); opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 92vw; }
#toast.zeigen { opacity: 1; }
#toast.fehler { background: var(--minus); }

/* ---------- Login ---------- */
.login { max-width: 360px; margin: 12vh auto; text-align: center; }
.login img { width: 84px; height: 100px; object-fit: contain; }
.login form { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; text-align: left; }

/* ---------- Einstellungen ---------- */
.edit-tab input, .edit-tab select { min-height: 34px; padding: 5px 8px; font-size: 14px; }
.edit-tab td { padding: 4px 6px; }
.edit-tab tr.inaktiv input:not([type=checkbox]) { color: var(--ink-3); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--linie); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--ink-2); }
.tabs button.an { border-bottom-color: var(--rot); color: var(--rot); }

.positionen { display: grid; grid-template-columns: minmax(0, 1fr) 80px 120px 110px 36px; gap: 8px; align-items: center; }
.positionen .kopf { font-size: 12px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; }

body.nur-lesen .nur-admin { display: none !important; }
body:not(.nur-lesen) .nur-lesen-sicht { display: none !important; }

/* ---------- V2: Liste, Auswahl, Druck ---------- */
.listenleiste { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.listenleiste .summen { margin: 0; }
.nur-handy { display: none !important; }
.auswahlleiste { position: sticky; top: 64px; z-index: 10; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  background: var(--rot-hell); border: 1px solid #e9c9ce; border-radius: var(--radius); padding: 8px 12px; margin-bottom: 10px; }
.auswahlleiste #auswahl-text { font-weight: 600; margin-right: auto; }
table.buchungstab tbody tr { cursor: pointer; }
table.buchungstab tbody tr:hover { background: #fbf7f7; }
table.buchungstab tbody tr.gewaehlt { background: var(--rot-hell); }
table.buchungstab td { vertical-align: middle; }
table.buchungstab .p { font-weight: 550; }
table.buchungstab .b { color: var(--ink-2); font-size: 13px; }
table.buchungstab .sp-betrag { font-weight: 600; white-space: nowrap; }
table.buchungstab .sp-datum { white-space: nowrap; }
table.buchungstab .icons { display: inline-flex; gap: 4px; color: var(--ink-3); }
table.buchungstab .icons svg { width: 16px; height: 16px; }
table.buchungstab .icons .an { color: var(--rot); }
th.sortierbar { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortierbar:hover { color: var(--rot); }
.sel-zelle { width: 34px; }
.klein-seg button { min-height: 32px; padding: 4px 12px; }
.spaltenwahl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; margin-top: 8px; }
.liste.sel-modus .eintrag { padding-left: 44px; position: relative; }
.liste.sel-modus .eintrag input.sel { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); }
.prognose-tab td { padding: 6px 10px; }
.beleg-vorschau .vorher-nachher { width: 100%; }
.vorher-nachher { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.vorher-nachher figure { margin: 0; border: 1px solid var(--linie); border-radius: 8px; overflow: hidden; background: #fafafa; cursor: pointer; position: relative; }
.vorher-nachher figure.an { outline: 3px solid var(--rot); }
.vorher-nachher img { width: 100%; max-height: 360px; object-fit: contain; display: block; background: #eee; }
.vorher-nachher figcaption { font-size: 12px; padding: 4px 8px; color: var(--ink-2); }
.kandidat { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 10px 12px; border: 1px solid var(--linie); border-radius: 8px; align-items: center; }
.kandidat + .kandidat { margin-top: 8px; }
.kandidat.top { border-color: var(--rot); box-shadow: inset 0 0 0 1px var(--rot); }
.abgleich-posten { display: grid; grid-template-columns: 96px minmax(0, 1fr) 120px auto; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--linie); align-items: center; font-size: 14px; }
.abgleich-posten:last-child { border-bottom: 0; }
.abgleich-posten .txt { color: var(--ink-2); font-size: 13px; }
details.karte summary { cursor: pointer; font-weight: 600; }

/* ---------- Handy ---------- */
@media (max-width: 860px) {
  header.kopf { padding: 0 14px; height: 54px; }
  nav.haupt, .kopf-rechts .knopf-text { display: none; }
  .marke img { width: 28px; height: 34px; }
  main { padding: 14px 12px calc(var(--nav-h) + 28px); }
  nav.unten {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--flaeche); border-top: 1px solid var(--linie); height: calc(var(--nav-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
  }
  nav.unten a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--ink-3); text-decoration: none; }
  nav.unten a svg { width: 22px; height: 22px; }
  nav.unten a.aktiv { color: var(--rot); }
  nav.unten a.neu span.kreis { width: 46px; height: 46px; border-radius: 50%; background: var(--rot); color: #fff; display: flex; align-items: center; justify-content: center; margin-top: -14px; box-shadow: 0 4px 12px rgba(139,30,45,.35); }
  nav.unten a.neu span.kreis svg { width: 26px; height: 26px; }
  .g2, .g3, .formular { grid-template-columns: 1fr; }
  .felder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .s3, .s4, .s6 { grid-column: span 2; }
  .s2 { grid-column: span 1; }
  .s2.voll { grid-column: span 2; }
  .filter { grid-template-columns: 1fr 1fr; }
  .filter .suche { grid-column: span 2; order: -1; }
  .liste-kopf { display: none; }
  .eintrag { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "haupt betrag" "meta icons"; gap: 2px 10px; padding: 10px 12px; }
  .eintrag .haupt { grid-area: haupt; }
  .eintrag .betrag { grid-area: betrag; }
  .eintrag .datum, .eintrag .nr, .eintrag .kat, .eintrag .konto { display: none; }
  .felder.f4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nur-desktop { display: none !important; }
  .segment { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; }
  .segment button { padding: 6px 4px; font-size: 13.5px; justify-content: center; }
  .aktionen .rechts { flex: 1; justify-content: flex-end; }
  .aktionen .rechts .primaer { flex: 1; justify-content: center; }
  .nur-handy { display: inline-flex !important; }
  .auswahlleiste { top: 58px; }
  .vorher-nachher img { max-height: 260px; }
  .abgleich-posten { grid-template-columns: 1fr auto; }
  .abgleich-posten .txt { grid-column: span 2; }
  .eintrag .meta { display: block !important; grid-area: meta; font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .eintrag .icons { grid-area: icons; }
  .kachel .wert { font-size: 20px; }
  .kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  h1 { font-size: 20px; }
  .positionen { grid-template-columns: minmax(0, 1fr) 60px 90px 30px; }
  .positionen .pos-summe { display: none; }
  .beleg-vorhanden svg { width: 18px; height: 18px; vertical-align: -4px; color: var(--rot); }
.beleg-frame { height: 300px; }
  .aktionen { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 6px); background: var(--grund); padding: 8px 0; z-index: 5; }
}
.eintrag .meta { display: none; }

#ab-konto { width: auto; }

.feldausschnitte { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.feldausschnitte figure { margin: 0; border: 1px solid var(--linie); border-radius: 8px; overflow: hidden; background: #fff; }
.feldausschnitte figcaption { font-size: 12px; color: var(--ink-3); padding: 3px 8px; background: var(--grund); }
.feldausschnitte img { display: block; width: 100%; max-height: 150px; object-fit: contain; object-position: left center; }

.abr-gitter { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.abr-karte { color: var(--ink); text-decoration: none; display: block; }
.abr-karte + .abr-karte { margin-top: 0; }
.abr-karte:hover { border-color: var(--rot); text-decoration: none; }
.abr-karte.inaktiv { opacity: .6; }
.badge.fest { background: var(--rot-hell); color: var(--rot); border-color: #e9c9ce; }
.badge.auto { background: #fff; color: var(--ink-2); border-style: dashed; }
a.badge:hover { text-decoration: none; border-color: var(--rot); }

.seitenkopf select, .listenleiste select { width: auto; }
@media (max-width: 1400px) {
  nav.haupt a { padding: 8px 9px; }
  .kopf-rechts .knopf-text { display: none; }
}

/* ---------- Inline-Bearbeitung ---------- */
tr.edit-zeile > td { padding: 0 !important; background: #fbf6f6; border-bottom: 2px solid var(--rot); cursor: default; }
table.buchungstab tbody tr.offen { background: var(--rot-hell); }
.inline-edit { padding: 14px 16px; background: #fbf6f6; border-top: 1px solid #ecd6d9; cursor: default; }
.liste .inline-edit { border-bottom: 2px solid var(--rot); }
.ie-gitter { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px 12px; }
.ie-gitter .ie-breit { grid-column: span 2; }
.ie-gitter .betrag-input { font-size: 16px; }
.ie-gitter .ie-3 { grid-column: span 3; }
.ie-gitter .ie-voll { grid-column: 1 / -1; }
.ie-checks { display: flex; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 6px 22px; }
.ie-kopf { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ie-betrag { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px dashed #ecd6d9; }
.ie-reihe { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px 12px; margin-bottom: 4px; }
.ie-erweitert { display: grid; grid-template-columns: 120px repeat(4, minmax(0, 1fr)); gap: 6px 10px; align-items: center; max-width: 820px; }
.ie-erweitert .k { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.ie-leiste { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.eintrag.offen { background: var(--rot-hell); }
@media (max-width: 860px) {
  .ie-gitter { grid-template-columns: 1fr 1fr; }
  .ie-gitter .ie-breit, .ie-gitter .ie-3 { grid-column: span 2; }
  .ie-reihe { grid-template-columns: 1fr 1fr; }
  .ie-erweitert { grid-template-columns: 70px repeat(4, minmax(0, 1fr)); gap: 4px 6px; }
  .ie-erweitert input { padding-left: 6px; padding-right: 6px; }
  .inline-edit { padding: 12px; }
}

/* ---------- Stapel-Scan ---------- */
.fortschritt { height: 10px; background: var(--grund); border-radius: 99px; overflow: hidden; margin: 12px auto; max-width: 420px; }
.fortschritt div { height: 100%; background: var(--rot); transition: width .4s; }
.stapel-liste .karte + .karte { margin-top: 12px; }
.stapel-dok { display: grid; grid-template-columns: 200px minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
.stapel-dok.uebersprungen { opacity: .55; }
.stapel-dok.erledigt { grid-template-columns: 90px 1fr; align-items: center; padding: 10px 14px; background: #f6fbf7; }
.sd-thumbs { display: flex; gap: 6px; flex-wrap: wrap; cursor: pointer; }
.sd-thumbs img { width: 92px; border: 1px solid var(--linie); border-radius: 4px; background: #fff; }
.klein-thumbs img { width: 38px; }
.sd-kand .kandidat { padding: 8px 10px; }
@media (max-width: 1100px) { .stapel-dok { grid-template-columns: 140px minmax(0, 1fr); } .sd-kand { grid-column: span 2; } .sd-thumbs img { width: 64px; } }
@media (max-width: 600px) { .stapel-dok { grid-template-columns: 1fr; } .sd-kand { grid-column: auto; } }

svg:not([width]) { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
