/* =====================================================================
   fibu.fjordtax.de – helles, ruhiges Layout
   Weiß, weiche Grauflächen statt Rahmen, Schwarz für Aktionen,
   Rost nur für das, was Aufmerksamkeit braucht.
   ===================================================================== */
:root {
  --bg: #ffffff;
  --ink: #131417;
  --text: #16181b;
  --muted: #7b7e83;
  --faint: #a4a6aa;
  --soft: #f4f4f3;
  --soft-2: #ebebea;
  --line: #e8e8e7;
  --rust: #a6442d; --rust-weak: #f7e9e4;
  --green: #2c7a4b; --green-weak: #e7f3ec;
  --amber: #96600a; --amber-weak: #fbf1df;
  --blue: #2f5f9e; --blue-weak: #e8eff8;
  --r: 22px; --r-sm: 14px;
  --font: Geist, Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --top: 72px;
  --tab: 0px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1 { font-size: 30px; line-height: 1.12; letter-spacing: -.03em; margin: 0; font-weight: 650; text-wrap: balance; }
h2 { font-size: 17px; margin: 0; font-weight: 600; letter-spacing: -.015em; }
h3 { font-size: 19px; margin: 0 0 14px; font-weight: 650; letter-spacing: -.02em; }
p { margin: 0; }
small { font-size: 12.5px; }
.muted { color: var(--muted); }
.rust { color: var(--rust); }
.green { color: var(--green); }
.mono { font-family: var(--mono); font-size: .93em; letter-spacing: .01em; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Kopfzeile ---------- */
.top { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); }
.top-in { max-width: 1440px; margin: 0 auto; height: var(--top); display: flex; align-items: center; gap: 18px; padding: 0 max(20px, env(safe-area-inset-left)) 0 max(20px, env(safe-area-inset-right)); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.02em; font-size: 17px; white-space: nowrap; }
.brand-mark { width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 20px; height: 20px; }
.brand small { font-weight: 450; color: var(--muted); font-size: 15px; letter-spacing: -.01em; }
.mandant-chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px 0 14px; border-radius: 999px; background: var(--soft); font-weight: 550; font-size: 14.5px; max-width: 280px; }
.mandant-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mandant-chip .ic { width: 15px; height: 15px; color: var(--muted); transform: rotate(-90deg); }
.mandant-chip:hover { background: var(--soft-2); }
.nav { display: flex; gap: 4px; margin: 0 auto; }
.nav a { height: 38px; display: inline-flex; align-items: center; gap: 8px; padding: 0 15px; border-radius: 999px; color: var(--muted); font-weight: 550; font-size: 14.5px; white-space: nowrap; transition: background .15s, color .15s; }
.nav a:hover { color: var(--ink); background: var(--soft); }
.nav a.on { color: var(--ink); background: var(--soft); }
.nav-gruppe { height: 38px; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px 0 15px; border-radius: 999px; color: var(--muted); font-weight: 550; font-size: 14.5px; white-space: nowrap; transition: background .15s, color .15s; }
.nav-gruppe:hover, .nav-gruppe.on, .nav-gruppe[aria-expanded="true"] { color: var(--ink); background: var(--soft); }
.nav-gruppe .chev .ic { width: 14px; height: 14px; transform: rotate(-90deg); }
.nav a .zahl { margin-left: 2px; }
.top-actions { display: flex; gap: 6px; align-items: center; }
.round { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; color: var(--muted); transition: background .15s, color .15s; }
.round:hover, .round.on { background: var(--soft); color: var(--ink); }
.round-ink { background: var(--ink); color: #fff; }
.round-ink:hover { background: #000; color: #fff; }

/* Berater-Leiste beim Mandanten */
.berater-bar { background: var(--ink); color: #fff; font-size: 13.5px; }
.berater-bar-in { max-width: 1440px; margin: 0 auto; min-height: 38px; display: flex; align-items: center; gap: 14px; padding: 4px max(20px, env(safe-area-inset-left)); }
.berater-bar a { color: #fff; opacity: .75; display: inline-flex; align-items: center; gap: 6px; }
.berater-bar a:hover { opacity: 1; }
.berater-bar .ic { width: 15px; height: 15px; }
.berater-bar strong { font-weight: 600; }
.berater-bar .spacer { flex: 1; }

/* ---------- Seite ---------- */
.page { max-width: 1200px; margin: 0 auto; padding: 28px max(20px, env(safe-area-inset-left)) 120px max(20px, env(safe-area-inset-right)); }
.page-breit { max-width: 1440px; }
.page-schmal { max-width: 760px; }
.kopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin: 8px 0 26px; }
.kopf p { color: var(--muted); margin-top: 6px; font-size: 15px; }
.kopf .actions { margin-left: auto; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sec { margin: 34px 0 12px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 10px; }
.sec .zahl { font-size: 12px; }
.back { display: inline-flex; gap: 4px; align-items: center; color: var(--muted); font-weight: 500; margin: 0 0 6px -4px; font-size: 14.5px; }
.back:hover { color: var(--ink); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 999px; background: var(--soft); color: var(--ink); font-weight: 550; font-size: 14.5px; white-space: nowrap; transition: background .15s, transform .05s, opacity .15s; }
.btn:hover { background: var(--soft-2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: #000; }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--soft); }
.btn-rust { background: var(--rust-weak); color: var(--rust); }
.btn-rust:hover { background: #f1d9d1; }
.btn-white { background: #fff; }
.btn-sm { height: 34px; padding: 0 13px; font-size: 13.5px; gap: 6px; }
.btn-sm .ic { width: 16px; height: 16px; }
.btn-lg { height: 54px; padding: 0 26px; font-size: 16px; }
.btn-block { width: 100%; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 50%; color: var(--muted); flex: none; }
.icon-btn:hover { background: var(--soft-2); color: var(--ink); }

/* ---------- Chips, Segmente, Badges ---------- */
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 0 15px; border-radius: 999px; background: var(--soft); color: var(--ink); font-size: 14px; font-weight: 550; white-space: nowrap; }
.chip:hover { background: var(--soft-2); }
.chip.on { background: var(--ink); color: #fff; }
.chip .zahl { margin-left: 2px; }
.chip.on .zahl { background: rgba(255, 255, 255, .2); color: #fff; }
.seg { display: inline-flex; padding: 4px; background: var(--soft); border-radius: 999px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button, .seg a { height: 36px; padding: 0 16px; border-radius: 999px; font-weight: 550; font-size: 14px; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.seg .on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 3px 10px -4px rgba(0, 0, 0, .14); }
.zahl { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--rust-weak); color: var(--rust); font-size: 12px; font-weight: 650; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.zahl-grau { background: var(--soft-2); color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--soft-2); color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.badge-green { background: var(--green-weak); color: var(--green); }
.badge-amber { background: var(--amber-weak); color: var(--amber); }
.badge-rust { background: var(--rust-weak); color: var(--rust); }
.badge-blue { background: var(--blue-weak); color: var(--blue); }
.badge-ink { background: var(--ink); color: #fff; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot-green { background: var(--green); } .dot-rust { background: var(--rust); } .dot-amber { background: #d29a2b; } .dot-ink { background: var(--ink); }

/* ---------- Flächen & Listen ---------- */
.flaeche { background: var(--soft); border-radius: var(--r); padding: 22px; }
.flaeche-weiss { background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.flaeche-kopf { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.liste { background: var(--soft); border-radius: var(--r); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.zeile { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; min-height: 60px; transition: background .12s; }
a.zeile:hover, button.zeile:hover, .zeile.klick:hover { background: rgba(255, 255, 255, .7); cursor: pointer; }
button.zeile { width: 100%; text-align: left; }
.zeile.on { background: #fff; }
.zeile-icon { width: 40px; height: 40px; border-radius: 12px; background: #fff; display: grid; place-items: center; flex: none; color: var(--muted); overflow: hidden; }
.zeile-icon img { width: 100%; height: 100%; object-fit: cover; }
.zeile-main { flex: 1; min-width: 0; }
.zeile-titel, .zeile-meta { display: block; }
.zeile-titel { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.zeile-meta { color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zeile-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; text-align: right; }
.zeile-betrag { font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.zeile-betrag.neg { color: var(--text); }
.zeile-betrag.pos { color: var(--green); }
.zeile-actions { display: flex; gap: 6px; flex: none; }
.leer { text-align: center; color: var(--muted); padding: 44px 20px; }
.leer .ic { width: 34px; height: 34px; stroke-width: 1.4; color: var(--faint); margin-bottom: 10px; }
.leer strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }

/* Kennzahlen */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--soft); border-radius: 18px; padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.kpi dt { font-size: 12.5px; color: var(--muted); font-weight: 550; }
.kpi dd { margin: 0; font-size: 24px; font-weight: 650; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.kpi.warn dd { color: var(--rust); }
a.kpi:hover { background: var(--soft-2); }

/* ---------- Monat / Checkliste ---------- */
.monatwahl { display: inline-flex; align-items: center; gap: 2px; background: var(--soft); border-radius: 999px; padding: 4px; }
.monatwahl a, .monatwahl button { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.monatwahl a:hover, .monatwahl button:hover { background: #fff; color: var(--ink); }
.monatwahl strong { padding: 0 10px; min-width: 128px; text-align: center; font-weight: 600; font-size: 14.5px; }
.monatwahl .flip { transform: rotate(180deg); }
.fortschritt { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; background: var(--soft); border-radius: var(--r); padding: 18px 20px; margin-bottom: 10px; }
.fortschritt.fertig { background: var(--green-weak); }
.fortschritt.zu { background: var(--ink); color: #fff; }
.fortschritt.zu p { color: rgba(255, 255, 255, .65); }
.fortschritt strong { font-size: 17px; letter-spacing: -.015em; }
.fortschritt p { color: var(--muted); font-size: 14px; margin-top: 2px; }
.ring { --p: 0; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--ink) calc(var(--p) * 1%), var(--soft-2) 0); position: relative; flex: none; }
.ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--soft); }
.fertig .ring { background: conic-gradient(var(--green) calc(var(--p) * 1%), #cfe6d8 0); }
.fertig .ring::before { background: var(--green-weak); }
.zu .ring { background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255, 255, 255, .2) 0); }
.zu .ring::before { background: var(--ink); }
.ring span { position: relative; font-weight: 650; font-size: 14px; font-variant-numeric: tabular-nums; }
.schritte { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.schritt { display: grid; grid-template-columns: 30px 1fr auto; gap: 14px; align-items: center; background: var(--soft); border-radius: 18px; padding: 13px 14px 13px 16px; min-height: 64px; }
.schritt-nr { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid #c9cacb; font-weight: 650; font-size: 13px; color: var(--muted); }
.schritt-nr .ic { width: 15px; height: 15px; stroke-width: 2.6; }
.schritt.ok .schritt-nr { background: var(--ink); border-color: var(--ink); color: #fff; }
.schritt.ok .schritt-text strong { color: var(--muted); font-weight: 550; }
.schritt.offen { background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); }
.schritt.offen .schritt-nr { border-color: var(--rust); color: var(--rust); }
.schritt.laeuft .schritt-nr { border-style: dashed; }
.schritt-text { min-width: 0; }
.schritt-text strong { display: block; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.schritt-text small { color: var(--muted); font-size: 13.5px; display: block; }
.schritt-aktion { display: flex; gap: 6px; align-items: center; }
.haken { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); cursor: pointer; user-select: none; }
.haken input { width: 18px; height: 18px; accent-color: var(--ink); margin: 0; }

/* ---------- Start (Mandant) ---------- */
.hallo { margin: 8px 0 22px; }
.hallo p { color: var(--muted); margin-bottom: 4px; font-size: 14.5px; }
.scan-cta { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; width: 100%; padding: 18px 20px; border-radius: var(--r); background: var(--ink); color: #fff; text-align: left; margin-bottom: 12px; transition: transform .08s, background .15s; }
.scan-cta:active { transform: scale(.99); }
.scan-cta:hover { background: #000; }
.scan-cta-icon { width: 52px; height: 52px; border-radius: 50%; background: #fff; color: var(--ink); display: grid; place-items: center; }
.scan-cta-icon .ic { width: 26px; height: 26px; stroke-width: 1.8; }
.scan-cta strong { display: block; font-size: 18px; letter-spacing: -.02em; }
.scan-cta small { color: rgba(255, 255, 255, .6); font-size: 13.5px; }
.schnell { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 28px; }
.schnell a, .schnell button { background: var(--soft); border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; text-align: left; min-height: 96px; }
.schnell a:hover, .schnell button:hover { background: var(--soft-2); }
.schnell .ic { width: 22px; height: 22px; }
.schnell strong { font-size: 14.5px; font-weight: 600; line-height: 1.25; }
.schnell small { color: var(--muted); font-size: 12.5px; }

/* Upload-Warteschlange */
.queue { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + var(--tab) + env(safe-area-inset-bottom)); z-index: 55; background: var(--ink); color: #fff; border-radius: 18px; padding: 10px 12px 10px 16px; display: flex; align-items: center; gap: 12px; box-shadow: 0 14px 34px rgba(0, 0, 0, .28); font-size: 14px; max-width: calc(100vw - 32px); }
.queue-bar { width: 90px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.queue-bar i { display: block; height: 100%; background: #fff; transition: width .3s; }

/* Ablage / Dropzone */
.drop { border-radius: var(--r); background: var(--soft); padding: 34px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; transition: background .15s, box-shadow .15s; cursor: pointer; }
.drop:hover { background: var(--soft-2); }
.drop.ueber { background: #fff; box-shadow: inset 0 0 0 2px var(--ink); }
.drop .ic { width: 30px; height: 30px; stroke-width: 1.5; }
.drop strong { font-size: 16px; }
.drop small { color: var(--muted); }

/* Zahlungshinweis nach dem Scannen */
.hinweis-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.hinweis-chips button { height: 54px; border-radius: 16px; background: var(--soft); font-weight: 550; display: flex; align-items: center; justify-content: center; gap: 8px; }
.hinweis-chips button.on { background: var(--ink); color: #fff; }

/* ---------- Beleg-Detail ---------- */
.beleg-layout > * { min-width: 0; }
.beleg-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.vorschau { position: sticky; top: calc(var(--top) + 16px); background: var(--soft); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100dvh - var(--top) - 40px); overflow: auto; }
.vorschau img { width: 100%; border-radius: 10px; display: block; background: #fff; }
.vorschau iframe { width: 100%; height: calc(100dvh - var(--top) - 70px); border: 0; border-radius: 10px; background: #fff; }
.daten { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; font-size: 14.5px; }
.daten dt { color: var(--muted); }
.daten dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.hinweisbox { border-radius: 16px; padding: 12px 14px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.hinweisbox .ic { margin-top: 1px; }
.hinweisbox-rust { background: var(--rust-weak); color: var(--rust); }
.hinweisbox-amber { background: var(--amber-weak); color: var(--amber); }
.hinweisbox-green { background: var(--green-weak); color: var(--green); }
.hinweisbox-grau { background: var(--soft); color: var(--muted); }

/* ---------- Formulare ---------- */
.felder { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.felder .span2 { grid-column: 1 / -1; }
.feld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.feld > span { font-size: 13px; font-weight: 550; color: var(--muted); }
.feld small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
input, select, textarea { font: inherit; color: var(--text); }
.feld input:not([type=checkbox]):not([type=radio]), .feld select, .feld textarea, .inp {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 13px; border: 0; background: #fff; box-shadow: inset 0 0 0 1px #e1e1df; font-size: 15px; transition: box-shadow .15s; }
.feld textarea { height: auto; min-height: 84px; padding: 11px 14px; resize: vertical; line-height: 1.45; }
.flaeche .feld input:not([type=checkbox]), .flaeche .feld select, .flaeche .feld textarea { box-shadow: none; }
.feld input:focus, .feld select:focus, .feld textarea:focus, .inp:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--ink); }
.feld select, select.inp { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237b7e83' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; cursor: pointer; padding: 4px 0; }
.check input { width: 19px; height: 19px; accent-color: var(--ink); margin: 1px 0 0; flex: none; }
.check small { display: block; color: var(--muted); }
.schalter { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: #fff; cursor: pointer; }
.flaeche .schalter { background: #fff; }
.schalter strong { display: block; font-weight: 550; }
.schalter small { color: var(--muted); font-size: 13px; }
.schalter input { appearance: none; width: 46px; height: 28px; border-radius: 999px; background: var(--soft-2); position: relative; flex: none; cursor: pointer; transition: background .2s; margin: 0; }
.schalter input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.schalter input:checked { background: var(--ink); }
.schalter input:checked::after { transform: translateX(18px); }
.form-fuss { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.suche { height: 42px; border-radius: 999px; border: 0; background: var(--soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17' viewBox='0 0 24 24' fill='none' stroke='%237b7e83' stroke-width='1.9' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M20 20l-4.2-4.2'/%3E%3C/svg%3E") no-repeat 15px center; padding: 0 16px 0 42px; font-size: 14.5px; width: 260px; max-width: 100%; }
.suche:focus { outline: none; background-color: #fff; box-shadow: inset 0 0 0 1.5px var(--ink); }

/* ---------- Tabellen ---------- */
.tabelle-wrap { background: var(--soft); border-radius: var(--r); padding: 6px; overflow-x: auto; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.tbl th { text-align: left; font-weight: 550; color: var(--muted); font-size: 12.5px; padding: 10px 10px 8px; white-space: nowrap; }
.tbl td { padding: 9px 10px; border-top: 1px solid rgba(0, 0, 0, .045); vertical-align: middle; }
.tbl tbody tr:first-child td { border-top: 0; }
.tbl tbody tr:hover td { background: rgba(255, 255, 255, .6); }
.tbl tbody tr.klick { cursor: pointer; }
.tbl td:first-child, .tbl th:first-child { padding-left: 14px; border-radius: 12px 0 0 12px; }
.tbl td:last-child, .tbl th:last-child { padding-right: 14px; border-radius: 0 12px 12px 0; }
.tbl tfoot td { font-weight: 650; border-top: 1px solid var(--line); }
.tbl .t { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl tr.pruefen td { background: #fdf6f3; }
.tbl tr.gesperrt td { color: var(--muted); }
.tbl input.zelle { width: 100%; min-width: 0; height: 32px; padding: 0 8px; border-radius: 9px; border: 0; background: transparent; font: inherit; font-variant-numeric: tabular-nums; }
.tbl input.zelle:hover { background: #fff; }
.tbl input.zelle:focus { outline: none; background: #fff; box-shadow: inset 0 0 0 1.5px var(--ink); }
.tbl input.zelle.leer { background: var(--rust-weak); }
.tbl input.zelle.num { text-align: right; }
.tbl .w-konto { width: 92px; } .tbl .w-bu { width: 56px; } .tbl .w-betrag { width: 116px; } .tbl .w-datum { width: 96px; }

/* ---------- Dialog / Bottom-Sheet ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 70; background: rgba(15, 16, 18, .38); display: grid; place-items: center; padding: 20px; animation: fadeIn .15s; }
.modal { background: #fff; border-radius: 26px; padding: 26px; width: min(560px, 100%); max-height: calc(100dvh - 40px); overflow: auto; box-shadow: 0 30px 70px rgba(0, 0, 0, .25); animation: popIn .2s cubic-bezier(.2, .9, .3, 1.2); }
.modal-breit { width: min(860px, 100%); }
.modal h3 { margin-bottom: 6px; }
.modal .lead { color: var(--muted); margin-bottom: 18px; font-size: 14.5px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes sheetIn { from { transform: translateY(100%); } }

.toast { position: fixed; left: 50%; bottom: calc(28px + var(--tab) + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 90; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 14.5px; opacity: 0; transition: opacity .2s, transform .2s; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast-err { background: var(--rust); }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .7s linear infinite; display: inline-block; flex: none; }
.spin.dunkel, .btn:not(.btn-ink) .spin { border-color: rgba(0, 0, 0, .12); border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }
.laden { display: grid; place-items: center; min-height: 40vh; }

/* Menü */
.menu { position: absolute; z-index: 60; background: #fff; border-radius: 18px; padding: 6px; min-width: 240px; max-height: 70vh; overflow: auto; box-shadow: 0 18px 44px rgba(0, 0, 0, .18), 0 0 0 1px rgba(0, 0, 0, .04); animation: popIn .14s; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 12px; font-size: 14.5px; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--soft); }
.menu .on { font-weight: 600; }
.menu .menu-kopf { padding: 8px 12px 4px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }

/* ---------- Mobile Tab-Leiste ---------- */
.tabbar { display: none; }

/* ---------- Abgleich ---------- */
.paar { display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; }
.paar:hover { background: rgba(255, 255, 255, .7); }
.paar-pfeil { color: var(--faint); display: grid; place-items: center; }
.paar .zeile-main small { display: block; }

.aktionen-zeile { flex-basis: 100%; display: flex; gap: 6px; flex-wrap: wrap; padding-left: 54px; min-width: 0; }
.aktionen-zeile .btn { max-width: 100%; }
.aktionen-zeile .btn span, .aktionen-zeile .btn { overflow: hidden; text-overflow: ellipsis; }

/* ---------- Berater ---------- */
.mandanten-tbl td .status { display: flex; gap: 6px; flex-wrap: wrap; }
.mandant-name { font-weight: 600; letter-spacing: -.01em; }
.ampel { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 550; }

/* ---------- Kasse ---------- */
.kassenstand { display: flex; align-items: baseline; gap: 10px; }
.kassenstand strong { font-size: 32px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

/* ---------- Schmal ---------- */
@media (max-width: 1100px) {
  .nav a { padding: 0 11px; }
  .nav a .ic, .nav-gruppe > .ic { display: none; }
}
@media (max-width: 900px) {
  :root { --top: 60px; --tab: 72px; }
  .nav, .top-actions .nur-desktop { display: none; }
  .top-in { gap: 10px; }
  .brand small { display: none; }
  .mandant-chip { margin-left: auto; max-width: 52vw; }
  .page { padding-top: 16px; padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  h1 { font-size: 26px; }
  .kopf { margin: 4px 0 18px; align-items: flex-start; }
  .kopf .actions { margin-left: 0; width: 100%; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .beleg-layout { grid-template-columns: minmax(0, 1fr); }
  .vorschau { position: static; max-height: none; }
  .vorschau iframe { height: 70vh; }
  .felder { grid-template-columns: 1fr; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; height: calc(var(--tab) + env(safe-area-inset-bottom)); padding: 6px 6px env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); box-shadow: 0 -1px 0 var(--line); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 550; color: var(--muted); position: relative; }
  .tabbar .ic { width: 23px; height: 23px; }
  .tabbar .on { color: var(--ink); }
  .tabbar .tab-scan { align-self: start; }
  .tabbar .tab-scan span { width: 58px; height: 58px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; margin-top: -2px; box-shadow: 0 8px 20px rgba(0, 0, 0, .25); }
  .tabbar .tab-scan .ic { width: 26px; height: 26px; }
  .tabbar .punkt { position: absolute; top: 4px; left: calc(50% + 8px); min-width: 17px; height: 17px; border-radius: 999px; background: var(--rust); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
  .modal-bg { place-items: end stretch; padding: 0; }
  .modal { width: 100%; border-radius: 26px 26px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); max-height: 92dvh; animation: sheetIn .25s cubic-bezier(.2, .9, .3, 1); }
  .modal::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--soft-2); margin: -8px auto 16px; }
  .modal-actions { position: sticky; bottom: -22px; background: #fff; padding-top: 10px; }
  .modal-actions .btn { flex: 1; }
  .zeile { padding: 10px 10px; gap: 12px; }
  .zeile-icon { width: 38px; height: 38px; }
  .schnell a, .schnell button { min-height: 88px; padding: 12px 13px; }
  .schritt { grid-template-columns: 28px 1fr; }
  .schritt-aktion { grid-column: 2; }
  .paar { grid-template-columns: 1fr; gap: 4px; }
  .paar-pfeil { transform: rotate(90deg); justify-content: start; padding-left: 10px; }
  .tbl-mobil-karten thead { display: none; }
  .tbl-mobil-karten, .tbl-mobil-karten tbody, .tbl-mobil-karten tr, .tbl-mobil-karten td { display: block; }
  .tbl-mobil-karten tr { padding: 10px 6px; border-top: 1px solid rgba(0, 0, 0, .05); }
  .tbl-mobil-karten td { border: 0 !important; padding: 2px 8px !important; }
  .suche { width: 100%; }
  .berater-bar .lang { display: none; }
  .berater-bar-in { min-height: 34px; font-size: 13px; }
  .aktionen-zeile { padding-left: 0; padding-top: 4px; }
  .kopf .actions { gap: 6px; }
  .kopf .actions .btn { height: 38px; padding: 0 14px; font-size: 14px; }
  .kopf p { font-size: 14px; }
  .monatwahl strong { min-width: 112px; font-size: 14px; padding: 0 4px; }
  .monatwahl a, .monatwahl button { width: 32px; height: 32px; }
  .kpi { padding: 12px 14px; border-radius: 16px; }
  .kpi dd { font-size: 20px; }
  .kpis { gap: 8px; }
  .scan-cta { padding: 14px 16px; gap: 14px; }
  .scan-cta-icon { width: 46px; height: 46px; }
  .scan-cta strong { font-size: 17px; }
  .hallo { margin: 4px 0 16px; }
}
@media (max-width: 420px) {
  .schnell { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .schnell strong { font-size: 13.5px; }
  .schnell small { display: none; }
}
@media print { .top, .tabbar, .berater-bar, .actions { display: none !important; } }

/* ---------- Reiter & Aufklapper ---------- */
.reiter-kopf { margin-bottom: 14px; }
.aufklapp { margin-top: 16px; border-top: 1px solid rgba(0, 0, 0, .06); padding-top: 4px; }
.aufklapp > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 10px 2px; font-weight: 550; font-size: 14.5px; }
.aufklapp > summary::-webkit-details-marker { display: none; }
.aufklapp > summary::before { content: ""; width: 7px; height: 7px; border-right: 1.75px solid var(--muted); border-bottom: 1.75px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; margin: 0 4px 0 2px; }
.aufklapp[open] > summary::before { transform: rotate(45deg); }
.aufklapp > .felder { padding: 6px 0 4px; }
.felder .aufklapp { margin-top: 2px; }

/* Beleg-Detail: Vorschau auf dem Desktop immer sichtbar, mobil als Reiter */
.reiter [data-reiter="bild"] { display: none; }
@media (min-width: 901px) { .beleg-layout .vorschau[hidden] { display: flex !important; } }
@media (max-width: 900px) {
  .reiter [data-reiter="bild"] { display: inline-flex; }
  .beleg-layout { display: flex; flex-direction: column-reverse; align-items: stretch; gap: 14px; }
}

/* ---------- Freigabe der Kontierung ---------- */
.summen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.summe { background: var(--soft); border-radius: 16px; padding: 10px 14px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.summe span { font-size: 12.5px; color: var(--muted); font-weight: 550; }
.summe strong { font-size: 18px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summe-privat strong { color: var(--rust); }
.freigabe-liste { background: var(--soft); border-radius: var(--r); padding: 4px; }
.freigabe-zeile { min-height: 54px; padding: 8px 8px 8px 14px; }
.freigabe-zeile + .freigabe-zeile { box-shadow: 0 -1px 0 rgba(0, 0, 0, .05); border-radius: 0; }
.seg-klein { background: #fff; padding: 3px; flex: none; box-shadow: inset 0 0 0 1px var(--line); }
.seg-klein button { height: 30px; padding: 0 12px; font-size: 13px; }
.seg-klein .on { background: var(--ink); color: #fff; box-shadow: none; }
.seg-klein button[data-kat="privat"].on { background: var(--rust); }
.seg-klein button:disabled { cursor: default; }
.seg-klein button:disabled:not(.on) { opacity: .45; }
.freigabe-fuss { position: sticky; bottom: 12px; margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 18px;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: 999px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 10px 30px -10px rgba(0, 0, 0, .25); }
.rust { color: var(--rust); }
td small.fw { display: block; color: var(--muted); font-size: 11.5px; font-weight: 500; }
@media (max-width: 900px) {
  .freigabe-zeile { flex-wrap: wrap; gap: 6px 10px; padding: 10px; }
  .freigabe-zeile .zeile-main { flex-basis: 100%; }
  .freigabe-zeile .seg-klein { width: 100%; }
  .freigabe-zeile .seg-klein button { flex: 1; justify-content: center; }
  .freigabe-fuss { bottom: calc(var(--tab) + env(safe-area-inset-bottom) + 10px); padding: 6px; }
  .freigabe-fuss .muted { display: none; }
  .freigabe-fuss .btn { flex: 1; }
  .summe { padding: 9px 11px; }
  .summe strong { font-size: 15px; }
}

/* ---------- Kompakt auf Laptop/Desktop: möglichst ohne Scrollen ---------- */
.feld-notiz { margin-top: 12px; }
@media (min-width: 901px) {
  :root { --top: 60px; }
  .page { padding-top: 18px; padding-bottom: 48px; }
  h1 { font-size: 25px; }
  .kopf { margin: 2px 0 16px; }
  .kopf p { margin-top: 3px; font-size: 14px; }
  .back { margin-bottom: 2px; font-size: 13.5px; }
  .flaeche { padding: 16px 18px; }
  .flaeche-kopf { margin-bottom: 10px; }
  .stack { gap: 10px; }
  .zeile { min-height: 50px; padding: 8px 12px; }
  .zeile-icon { width: 34px; height: 34px; border-radius: 10px; }
  .kpis { margin-bottom: 14px; gap: 10px; }
  .kpi { padding: 11px 14px; }
  .kpi dd { font-size: 21px; }
  .leer { padding: 28px 20px; }
  .reiter-kopf { margin-bottom: 10px; }
  .hinweisbox { padding: 9px 12px; font-size: 13.5px; }
  .felder { gap: 10px 14px; }
  /* Start: Scan + Schnellzugriffe in einer Zeile */
  .hallo { margin: 2px 0 14px; }
  .hallo h1 { font-size: 25px; }
  .start-oben { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 2fr); gap: 10px; margin-bottom: 18px; }
  .start-oben .scan-cta { margin: 0; height: 100%; padding: 14px 16px; }
  .start-oben .scan-cta-icon { width: 44px; height: 44px; }
  .start-oben .scan-cta strong { font-size: 16px; }
  .start-oben .schnell { margin: 0; }
  .schnell a, .schnell button { min-height: 0; padding: 12px 14px; gap: 6px; }
  .fortschritt { padding: 12px 16px; gap: 14px; margin-bottom: 8px; }
  .fortschritt strong { font-size: 15.5px; }
  .fortschritt p { font-size: 13.5px; }
  .schritte { gap: 6px; }
  .schritt { min-height: 50px; padding: 8px 12px 8px 14px; border-radius: 14px; }
  .schritt-text strong { font-size: 14.5px; }
  .schritt-text small { font-size: 13px; }
  /* Beleg-Detail: Bild exakt im Fenster, Daten zweispaltig */
  .beleg-layout { gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .vorschau { top: calc(var(--top) + 12px); height: calc(100dvh - var(--top) - 110px); max-height: none; padding: 8px; min-height: 340px; }
  .vorschau > a { flex: none; height: 100%; display: flex; align-items: center; justify-content: center; }
  .vorschau img { width: 100%; height: 100%; object-fit: contain; background: transparent; }
  .vorschau iframe { flex: 1; height: auto; min-height: 0; }
  .daten { gap: 6px 14px; font-size: 14px; }
}
@media (min-width: 901px) and (max-height: 820px) {
  .page { padding-top: 12px; }
  .kopf { margin-bottom: 12px; }
  h1, .hallo h1 { font-size: 22px; }
}
