/* Taxio Komponenten. Baut ausschließlich auf tokens.css auf. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font-ui); font-size: var(--fs-body); line-height: var(--lh-body);
  font-weight: 500; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Typografie ---------- */
.display, .h1, .h2, .h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: var(--ls-display); margin: 0; }
.display { font-size: var(--fs-hero); line-height: var(--lh-display); }
.h1 { font-size: var(--fs-h1); line-height: 1; }
.h2 { font-size: var(--fs-h2); line-height: 1.02; }
.h3 { font-size: var(--fs-h3); line-height: 1.05; letter-spacing: -0.01em; }
.display em, .h1 em, .h2 em { font-style: italic; }
.lead { font-size: var(--fs-lead); line-height: 1.32; font-weight: 500; margin: 0; max-width: 34em; }
.muted { color: var(--fg-muted); }
.subtle { color: var(--fg-subtle); }
.small { font-size: var(--fs-small); }
.tiny { font-size: var(--fs-tiny); }
.label { font-size: var(--fs-small); font-weight: 600; color: var(--fg-muted); letter-spacing: .01em; }

/* Beträge: Garamond mit Tabellenziffern, Minus als echtes Minuszeichen */
.num { font-family: var(--font-display); font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1, "lnum" 1; letter-spacing: 0; white-space: nowrap; }
.num-xl { font-size: var(--fs-num-xl); line-height: 1; }
.num-l { font-size: 1.5rem; line-height: 1.1; }
.num-m { font-size: 1.1875rem; }
.code { font-family: var(--font-ui); font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: .02em; }

/* ---------- Layout ---------- */
.wrap { width: min(100% - 2rem, var(--maxw)); margin-inline: auto; }
.stack > * + * { margin-top: var(--stack, var(--s-4)); }
.row { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- Navigation ---------- */
.nav {
  margin: var(--s-5) auto 0; width: min(100% - 2rem, 912px);
  display: flex; align-items: center; gap: var(--s-4);
  padding: 10px 10px 10px 20px; border: 1.5px solid var(--leinen); border-radius: var(--r-md);
  background: var(--bg);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-size: 1.75rem; letter-spacing: -0.02em; line-height: 1; }
.brand .mark { width: 34px; height: 34px; border-radius: 10px; background: var(--tinte); color: var(--papier); display: grid; place-items: center; }
.brand .mark svg { width: 24px; height: 24px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--leinen); border-radius: var(--r-pill); }
.seg a { padding: 7px 15px; border-radius: var(--r-pill); text-decoration: none; font-weight: 600; font-size: .9375rem; line-height: 1; color: var(--fg); transition: background var(--t-fast); }
.seg a[aria-current="page"] { background: var(--surface); box-shadow: 0 0 0 1px var(--line-soft); }
.seg a:not([aria-current]):hover { background: rgba(255,255,247,.55); }
.kanzlei { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: .9375rem; padding: 6px 6px 6px 14px; border-radius: var(--r-pill); text-decoration: none; }
.kanzlei:hover { background: var(--surface-sunk); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--leinen); color: var(--tinte); display: grid; place-items: center; font-family: var(--font-display); font-size: 1.05rem; }

/* ---------- Buttons ---------- */
.btn {
  --b-bg: transparent; --b-fg: var(--fg); --b-bd: var(--tinte);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px; border-radius: var(--r-sm);
  border: 1.5px solid var(--b-bd); background: var(--b-bg); color: var(--b-fg);
  font: 600 1rem/1 var(--font-ui); text-decoration: none; cursor: pointer;
  transition: background var(--t-fast), transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast);
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { --b-bg: var(--cta-bg); box-shadow: 0 2px 0 var(--tinte); }
.btn-primary:hover { --b-bg: var(--cta-bg-hover); }
.btn-primary:active { box-shadow: 0 1px 0 var(--tinte); }
.btn-secondary { --b-bg: var(--surface); }
.btn-secondary:hover { --b-bg: var(--papier-tief); }
.btn-ghost { --b-bd: transparent; padding: 0 14px; }
.btn-ghost:hover { --b-bg: var(--surface-sunk); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: .9375rem; }
.btn[disabled], .btn[aria-disabled="true"] { --b-bg: var(--surface-sunk); --b-fg: var(--fg-subtle); --b-bd: var(--line); box-shadow: none; cursor: not-allowed; }

/* ---------- Felder ---------- */
.field { display: grid; gap: 6px; }
.field label { font-size: var(--fs-small); font-weight: 600; }
.field .hint { font-size: var(--fs-tiny); color: var(--fg-muted); }
.input, .select {
  min-height: 48px; padding: 0 14px; border-radius: var(--r-sm);
  border: 1.5px solid var(--line); background: var(--surface); color: var(--fg);
  font: 500 1rem var(--font-ui); transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input:hover, .select:hover { border-color: var(--tinte-55); }
.input:focus, .select:focus { outline: none; border-color: var(--tinte); box-shadow: 0 0 0 4px rgba(107, 63, 209, .18); }
.input.code { letter-spacing: .06em; }
.field.is-error .input { border-color: var(--err-fg); }
.field.is-error .hint { color: var(--err-fg); }

/* ---------- Badges / Ampel ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 8px;
  border-radius: var(--r-pill); font-size: var(--fs-tiny); font-weight: 600; line-height: 1; white-space: nowrap;
}
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge-ok { color: var(--ok-fg); background: transparent; box-shadow: inset 0 0 0 1px rgba(11,74,64,.28); }
.badge-warn { color: var(--warn-fg); background: transparent; box-shadow: inset 0 0 0 1px rgba(138,82,0,.35); }
.badge-err { color: var(--err-fg); background: var(--err-bg); }
.badge-neutral { color: var(--fg-muted); background: var(--leinen); }

/* ---------- Karten ---------- */
.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: var(--s-5); }
.card-sunk { background: var(--surface-sunk); border-color: transparent; }
.card-dark { background: var(--tanne); color: var(--papier); border-color: transparent; }
.card-dark .muted { color: rgba(255, 255, 235, .72); }

/* ---------- Hinweis ---------- */
.note { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 16px 18px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line-soft); color: var(--fg); }
.note svg { width: 20px; height: 20px; margin-top: 2px; color: var(--warn-fg); }
.note-err { border-color: rgba(155,44,44,.3); }
.note-err svg { color: var(--err-fg); }
.note strong { font-weight: 700; }

/* ---------- Drop-Zone ---------- */
.drop {
  position: relative; display: grid; justify-items: center; gap: 14px; text-align: center;
  padding: 44px 32px 36px; border-radius: var(--r-lg);
  border: 1.5px solid var(--tinte); background: var(--surface);
  box-shadow: 0 3px 0 var(--tinte);
  transition: background var(--t-base), transform var(--t-base) var(--ease-spring), box-shadow var(--t-base);
}
.drop-doc { width: 76px; height: 88px; color: var(--tinte); transition: transform var(--t-base) var(--ease-spring); }
.drop-title { font-family: var(--font-display); font-size: 2.25rem; line-height: 1; letter-spacing: -0.02em; margin: 6px 0 0; }
.drop-meta { font-size: var(--fs-small); color: var(--fg-muted); margin: 0; max-width: 38em; }
.drop-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.drop.is-hover { background: var(--flieder); transform: translateY(-3px); box-shadow: 0 6px 0 var(--tinte); }
.drop.is-hover .drop-doc { transform: translateY(-6px) rotate(-4deg); }
.drop.is-error { border-color: var(--err-fg); box-shadow: 0 3px 0 var(--err-fg); }
.drop.is-busy { background: var(--surface); }

/* Fortschritt in der Drop-Zone */
.steps { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 10px; width: min(100%, 440px); text-align: left; }
.steps li { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 12px; font-weight: 600; color: var(--fg-subtle); transition: color var(--t-base); }
.steps li .tick { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; transition: background var(--t-base), border-color var(--t-base); }
.steps li .tick svg { width: 12px; height: 12px; opacity: 0; transform: scale(.4); transition: opacity var(--t-fast), transform var(--t-base) var(--ease-spring); color: var(--papier); }
.steps li .val { font-family: var(--font-display); font-weight: 400; font-size: 1.125rem; color: var(--fg-muted); }
.steps li.is-done { color: var(--fg); }
.steps li.is-done .tick { background: var(--tanne); border-color: var(--tanne); }
.steps li.is-done .tick svg { opacity: 1; transform: none; }
.steps li.is-active { color: var(--fg); }
.steps li.is-active .tick { border-color: var(--tinte); border-top-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Statuspille (dunkel, wie das Wispr-Statuslabel) */
.pill-status {
  display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 18px 0 14px; border-radius: var(--r-pill);
  background: var(--tanne); color: var(--papier); font-weight: 600; font-size: .9375rem;
}
.pill-status .spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,235,.35); border-top-color: var(--papier); animation: spin .8s linear infinite; }

/* ---------- Tabellen ---------- */
.table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.table th { text-align: left; font-size: var(--fs-tiny); font-weight: 600; color: var(--fg-muted); padding: 10px 14px; border-bottom: 1.5px solid var(--tinte); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table th.r, .table td.r { text-align: right; }
.table tbody tr:hover td { background: rgba(230, 228, 207, .35); }
.table tr.is-diff td { background: var(--err-bg); }
.table tr.total td { border-top: 1.5px solid var(--tinte); border-bottom: 0; font-weight: 700; }
.table .num { font-size: 1.125rem; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- Modal ---------- */
.scrim { position: fixed; inset: 0; background: rgba(26, 26, 26, .38); display: grid; place-items: center; padding: 16px; }
.modal { width: min(100%, 560px); background: var(--bg); border: 1.5px solid var(--tinte); border-radius: var(--r-lg); box-shadow: 0 4px 0 var(--tinte); padding: 32px; }
.modal .h3 { margin-bottom: 8px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 28px; flex-wrap: wrap; }

/* ---------- Konto-Kachel ---------- */
.konto { display: grid; gap: 18px; }
.konto-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.konto-name { font-family: var(--font-display); font-weight: 400; font-size: 1.75rem; line-height: 1; letter-spacing: -0.02em; margin: 0; }
.konto-flow { display: grid; grid-template-columns: auto auto 1fr; grid-template-rows: auto auto; column-gap: 14px; row-gap: 6px; align-items: baseline; }
.konto-flow .lab { grid-row: 1; font-size: var(--fs-small); font-weight: 600; color: var(--fg-muted); white-space: nowrap; }
.konto-flow .val { grid-row: 2; align-self: end; line-height: 1; }
.konto-flow .arrow { grid-row: 2; width: 24px; height: 12px; color: var(--fg-subtle); align-self: center; }
.konto-foot { display: flex; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: var(--fs-small); color: var(--fg-muted); }
.konto-foot b { color: var(--fg); font-weight: 600; }

@media (max-width: 720px) {
  .nav { padding: 8px 8px 8px 14px; gap: 8px; }
  .nav .seg { display: none; }
  .kanzlei span:first-child { display: none; }
  .btn { min-height: 48px; }
  .drop { padding: 32px 20px 28px; }
  .drop-title { font-size: 1.875rem; }
  .modal { padding: 24px; }
}

.menu-btn { display: none; width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; color: var(--fg); place-items: center; cursor: pointer; }
.menu-btn svg { width: 18px; height: 18px; }
@media (max-width: 720px) {
  .nav { border-color: transparent; padding-left: 0; padding-right: 0; background: transparent; }
  .nav .seg { display: none; }
  .menu-btn { display: grid; }
  .nav .seg a { padding: 7px 11px; font-size: .875rem; }
  .brand-word, .brand > :not(svg) { }
}


.nav-wide { width: min(100% - 2rem, var(--maxw)); }

/* ---------- Kassenzettel (Saldenprobe) und Datei-Chip ---------- */
.receipt { width: 340px; background: var(--surface); border: 1.5px solid var(--tinte); border-radius: 10px; padding: 20px 24px 22px; position: relative; }
.r-head { display: flex; justify-content: space-between; margin: 0 0 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--tinte-20); font-size: var(--fs-tiny); font-weight: 600; color: var(--fg-muted); }
.r-head span:first-child { font-family: var(--font-display); font-size: 1.25rem; font-weight: 400; color: var(--fg); letter-spacing: -0.01em; line-height: 1; }
.receipt dl { margin: 0; }
.receipt dl > div { display: flex; justify-content: space-between; align-items: baseline; padding: 3px 0; }
.receipt dt { font-size: var(--fs-small); color: var(--fg-muted); }
.receipt dd { margin: 0; font-family: var(--font-display); font-variant-numeric: tabular-nums lining-nums; font-size: 1.1875rem; }
.receipt .tot { margin-top: 8px; padding-top: 10px; border-top: 1.5px solid var(--tinte); }
.receipt .tot dt { color: var(--fg); font-weight: 600; }
.receipt .tot dd { font-size: 2rem; line-height: 1; padding-bottom: 4px; border-bottom: 4px double var(--tinte); }
.r-ok { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; font-size: var(--fs-small); font-weight: 600; color: var(--tanne); }
.r-ok .ck { width: 20px; height: 20px; border-radius: 50%; background: var(--tanne); color: var(--papier); display: grid; place-items: center; }
.r-ok .ck svg { width: 12px; height: 12px; }
.r-ok mark { background: linear-gradient(transparent 18%, var(--flieder) 18%, var(--flieder) 88%, transparent 88%); color: var(--tanne); padding: 0 4px; margin-left: -2px; }
.file { display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 12px; border-radius: 14px; background: var(--leinen); color: var(--tinte); }
.file-ico { width: 40px; height: 48px; border-radius: 6px; background: var(--surface); color: var(--tinte); box-shadow: inset 0 0 0 1.5px var(--tinte); display: grid; place-items: end center; padding-bottom: 7px; font: 700 .6875rem var(--font-ui); letter-spacing: .04em; clip-path: polygon(0 0, 70% 0, 100% 22%, 100% 100%, 0 100%); }
.file b { display: block; font-weight: 600; font-size: .9375rem; }
.file span span { display: block; font-size: var(--fs-tiny); color: var(--fg-muted); margin-top: 2px; }
