/* Bausteine der Nobellayer Buchhaltung. Nur var(--…) aus tokens.css – keine festen Farben. */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: var(--weight-base) var(--text-base)/var(--leading-base) var(--font-sans);
}
h1, h2, h3 { font-family: var(--font-heading); margin: 0; color: var(--text); }
h1 { font-size: var(--text-xl); line-height: var(--leading-xl); font-weight: var(--weight-xl); }
h2 { font-size: var(--text-lg); line-height: var(--leading-lg); font-weight: var(--weight-lg); }
h3 { font-size: var(--text-md); line-height: var(--leading-md); font-weight: var(--weight-md); }
a { color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.nur-vorleser { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sym { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sym-sm { width: 16px; height: 16px; }
.betrag { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.betrag.minus { color: var(--danger); }
.leise { color: var(--text-muted); }
.klein { font-size: var(--text-sm); line-height: var(--leading-sm); }
.xklein { font-size: var(--text-xs); line-height: var(--leading-xs); font-weight: var(--weight-xs); }

/* ── Knopf ── */
.knopf {
  --k-h: var(--control-height);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--k-h); padding: 0 var(--space-4); border-radius: var(--radius-md);
  border: 1px solid transparent; font: 600 var(--text-sm)/1 var(--font-sans); cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: background var(--motion-fast) var(--motion-ease), border-color var(--motion-fast);
}
.knopf.sm { --k-h: 32px; padding: 0 var(--space-3); }
.knopf.lg { --k-h: 48px; padding: 0 var(--space-6); font-size: var(--text-base); }
.knopf.primaer { background: var(--primary); color: var(--on-primary); }
.knopf.primaer:hover { background: var(--primary-hover); }
.knopf.akzent { background: var(--accent); color: var(--on-accent); }
.knopf.akzent:hover { filter: brightness(.92); }
.knopf.sekundaer { background: var(--surface); color: var(--text); border-color: var(--border-input); }
.knopf.sekundaer:hover { background: var(--surface-hover); }
.knopf.leise { background: transparent; color: var(--text); }
.knopf.leise:hover { background: var(--surface-hover); }
.knopf.gefahr { background: var(--danger); color: var(--on-primary); }
.knopf.gefahr:hover { filter: brightness(.92); }
.knopf.symbol { width: var(--k-h); padding: 0; flex: none; }
.knopf:active { transform: translateY(1px); }
.knopf:disabled, .knopf[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; filter: none; }
.knopf[aria-busy="true"] { cursor: progress; }
.knopf[aria-busy="true"]::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: drehen .7s linear infinite;
}
@keyframes drehen { to { transform: rotate(360deg); } }

/* ── Hauptmenü ── */
.hauptmenue { position: sticky; top: 0; z-index: 30; height: var(--nav-height); background: var(--nav-bg); color: var(--on-nav); }
.hauptmenue .innen { display: flex; align-items: center; gap: var(--space-2); height: 100%; max-width: var(--content-max); margin: 0 auto; padding: 0 var(--space-4); }
.marke { display: flex; align-items: center; gap: var(--space-2); font: 800 var(--text-md)/1 var(--font-heading); color: var(--on-nav); text-decoration: none; margin-right: var(--space-4); }
.marke i { width: 10px; height: 10px; border-radius: 50%; background: var(--brand-glut); }
.menue-liste { display: flex; gap: var(--space-1); list-style: none; margin: 0; padding: 0; height: 100%; }
.menue-liste > li { position: relative; display: flex; }
.menue-punkt {
  display: flex; align-items: center; gap: var(--space-1); padding: 0 var(--space-3); height: 100%;
  color: var(--nav-muted); text-decoration: none; background: none; border: 0; font: 500 var(--text-sm) var(--font-sans);
  border-bottom: 3px solid transparent; cursor: pointer;
}
.menue-punkt:hover { color: var(--on-nav); }
.menue-punkt[aria-current="page"] { color: var(--on-nav); border-bottom-color: var(--nav-active); }
.untermenue {
  position: absolute; top: 100%; left: 0; min-width: 200px; padding: var(--space-2) 0; margin: 0; list-style: none;
  background: var(--surface); color: var(--text); border-radius: var(--radius-md); box-shadow: var(--shadow-pop);
}
.untermenue[hidden] { display: none; }
.untermenue a { display: block; padding: var(--space-2) var(--space-4); color: var(--text); text-decoration: none; }
.untermenue a:hover, .untermenue a:focus-visible { background: var(--surface-hover); }
.untermenue hr { border: 0; border-top: 1px solid var(--border); margin: var(--space-2) 0; }
.menue-rechts { margin-left: auto; display: flex; gap: var(--space-1); }
.menue-rechts .knopf { color: var(--nav-muted); }
.menue-rechts .knopf:hover { background: var(--primary-hover); color: var(--on-nav); }
.menue-schalter { display: none; }
@media (max-width: 959px) {
  .hauptmenue .menue-schalter { display: inline-flex; color: var(--on-nav); }
  .hauptmenue .menue-schalter:hover { background: var(--primary-hover); }
  .menue-liste { display: none; position: absolute; top: var(--nav-height); left: 0; right: 0; height: auto; flex-direction: column; background: var(--nav-bg); padding: var(--space-2) 0; }
  .menue-liste.offen { display: flex; }
  .menue-liste > li { flex-direction: column; }
  .menue-punkt { height: 44px; border-bottom: 0; border-left: 3px solid transparent; }
  .menue-punkt[aria-current="page"] { border-left-color: var(--nav-active); }
  .untermenue { position: static; box-shadow: none; background: var(--primary-hover); }
  .untermenue a { color: var(--on-nav); padding-left: var(--space-8); }
}

/* ── Seite ── */
.seite { max-width: var(--content-max); margin: 0 auto; padding: var(--space-6) var(--space-4) var(--space-10); }
.seitenkopf { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-5); }
.seitenkopf .aktionen { margin-left: auto; display: flex; gap: var(--space-2); }

/* ── Karte / Kachel ── */
.karte { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: var(--space-5); }
.karte > h2, .karte > h3 { margin-bottom: var(--space-3); }
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-4); }
.kennzahl .wert { font: 800 var(--text-xl)/var(--leading-xl) var(--font-heading); font-variant-numeric: tabular-nums; }
.kennzahl .name { color: var(--text-muted); font-size: var(--text-sm); }
.aufgaben { list-style: none; margin: 0; padding: 0; }
.aufgaben li { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) 0; border-top: 1px solid var(--border); }
.aufgaben li:first-child { border-top: 0; }
.aufgaben a { margin-left: auto; }

/* ── Etikett und Zähler ── */
.etikett { display: inline-flex; align-items: center; gap: 6px; padding: 2px var(--space-2); border-radius: var(--radius-pill); font: 600 var(--text-xs)/var(--leading-xs) var(--font-sans); background: var(--neutral-bg); color: var(--text); }
.etikett::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.etikett.offen, .etikett.teilbezahlt { background: var(--info-bg); color: var(--info); }
.etikett.ueberfaellig, .etikett.pruefen { background: var(--warning-bg); color: var(--warning); }
.etikett.bezahlt, .etikett.zugeordnet { background: var(--success-bg); color: var(--success); }
.etikett.abgelehnt { background: var(--danger-bg); color: var(--danger); }
.etikett.storniert { text-decoration: line-through; color: var(--text-muted); }
.zaehler { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--neutral-bg); color: var(--text); font: 600 var(--text-xs)/1 var(--font-sans); font-variant-numeric: tabular-nums; }
.zaehler.warnung { background: var(--warning-bg); color: var(--warning); }
.zaehler.akzent { background: var(--accent); color: var(--on-accent); }

/* ── Felder ── */
.feld { display: grid; gap: var(--space-1); }
.feld > label, .feld > .beschriftung { font: 600 var(--text-sm)/var(--leading-sm) var(--font-sans); }
.feld .pflicht { color: var(--danger); }
.eingabe {
  width: 100%; min-height: var(--control-height); padding: 0 var(--space-3);
  background: var(--surface); color: var(--text); border: 1px solid var(--border-input); border-radius: var(--radius-sm);
  font: var(--text-base)/1.2 var(--font-sans);
}
textarea.eingabe { padding: var(--space-2) var(--space-3); min-height: 88px; resize: vertical; line-height: var(--leading-base); }
select.eingabe { padding-right: var(--space-8); }
.eingabe:hover { border-color: var(--text-muted); }
.eingabe:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.eingabe:disabled { background: var(--surface-alt); color: var(--text-muted); cursor: not-allowed; }
.eingabe[readonly] { background: var(--surface-alt); border-color: transparent; }
.eingabe[aria-invalid="true"] { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.feld .hilfe { color: var(--text-muted); font-size: var(--text-sm); }
.feld .fehlertext { display: flex; gap: var(--space-1); align-items: center; color: var(--danger); font-size: var(--text-sm); }
.eingabe.betrag-eingabe { text-align: right; font-variant-numeric: tabular-nums; }
.mit-symbol { position: relative; }
.mit-symbol .sym { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.mit-symbol .eingabe { padding-left: 38px; }
.mit-einheit { display: flex; }
.mit-einheit .eingabe { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.mit-einheit .einheit { display: grid; place-items: center; padding: 0 var(--space-3); border: 1px solid var(--border-input); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--surface-alt); color: var(--text-muted); }
.raster { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ── Kontaktauswahl (Combobox) ── */
.combo { position: relative; }
.combo-liste { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); max-height: 280px; overflow: auto; margin: 0; padding: var(--space-1) 0; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-pop); }
.combo-liste[hidden] { display: none; }
.combo-liste li { padding: var(--space-2) var(--space-3); cursor: pointer; }
.combo-liste li[aria-selected="true"], .combo-liste li:hover { background: var(--surface-hover); }
.combo-liste .neu { color: var(--accent); font-weight: 600; border-top: 1px solid var(--border); }

/* ── Reiter ── */
.reiter { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--border); margin-bottom: var(--space-4); overflow-x: auto; }
.reiter [role="tab"] { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); border: 0; background: none; color: var(--text-muted); font: 600 var(--text-sm) var(--font-sans); border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.reiter [role="tab"]:hover { color: var(--text); }
.reiter [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.reiter.kacheln-reiter { border: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.reiter.kacheln-reiter [role="tab"] { justify-content: flex-start; border-bottom: 0; border-right: 1px solid var(--border); padding: var(--space-4); color: var(--text); }
.reiter.kacheln-reiter [role="tab"]:last-child { border-right: 0; }
.reiter.kacheln-reiter [role="tab"][aria-selected="true"] { background: var(--accent-soft); box-shadow: inset 0 -3px 0 var(--accent); }

/* ── Dreispalten-Ansicht ── */
.spalten { display: grid; grid-template-columns: var(--filter-width) minmax(0, 1fr) var(--detail-width); gap: var(--space-4); align-items: start; }
@media (max-width: 1279px) { .spalten { grid-template-columns: var(--filter-width) minmax(0, 1fr); } .spalten > .details { grid-column: 1 / -1; } }
@media (max-width: 959px) { .spalten { grid-template-columns: 1fr; } }

/* ── Filtermenü ── */
.filter { list-style: none; margin: 0; padding: var(--space-2); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.filter a { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-size: var(--text-sm); }
.filter a:hover { background: var(--surface-hover); }
.filter a[aria-current="true"] { background: var(--accent-soft); font-weight: 700; }
.filter .zaehler { margin-left: auto; }
.filter .unter a { padding-left: var(--space-8); color: var(--text-muted); }
.filter .unter a[aria-current="true"] { color: var(--text); }
.filter hr { border: 0; border-top: 1px solid var(--border); margin: var(--space-2) 0; }

/* ── Liste ── */
.liste { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.liste-kopf { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.liste-kopf .rechts { margin-left: auto; display: flex; gap: var(--space-2); align-items: center; }
.zeilen { list-style: none; margin: 0; padding: 0; }
.zeile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); min-height: var(--row-height); padding: var(--space-2) var(--space-4); border-top: 1px solid var(--border); cursor: pointer; position: relative; }
.zeile:first-child { border-top: 0; }
.zeile:hover { background: var(--surface-hover); }
.zeile[aria-selected="true"] { background: var(--surface-selected); }
.zeile[aria-selected="true"]::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.zeile:focus-visible { outline-offset: -2px; }
.zeile .titel { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zeile .unterzeile { color: var(--text-muted); font-size: var(--text-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zeile .rechts { text-align: right; display: grid; gap: 2px; justify-items: end; }
.zeile .rechts .betrag { font-weight: 700; }
.zeile .warnhinweis { color: var(--warning); }
.kasten { width: 18px; height: 18px; accent-color: var(--accent); }
.sammelleiste { position: sticky; bottom: 0; display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--primary); color: var(--on-primary); border-radius: var(--radius-md); box-shadow: var(--shadow-pop); margin-top: var(--space-3); flex-wrap: wrap; }
.sammelleiste[hidden] { display: none; }
.sammelleiste .knopf.leise { color: var(--on-primary); }
.sammelleiste .knopf.leise:hover { background: var(--primary-hover); }
.seiten { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border); color: var(--text-muted); font-size: var(--text-sm); }

/* ── Detailspalte ── */
.details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4); position: sticky; top: calc(var(--nav-height) + var(--space-4)); }
.details .werkzeuge { display: flex; gap: var(--space-1); margin-bottom: var(--space-3); }
.details .vorschau { aspect-ratio: 3 / 4; max-height: 220px; margin: var(--space-3) auto; display: grid; place-items: center; background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-muted); }
.schluessel-wert { display: grid; grid-template-columns: auto 1fr; gap: var(--space-1) var(--space-3); margin: 0; font-size: var(--text-sm); }
.schluessel-wert dt { color: var(--text-muted); }
.schluessel-wert dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.block-titel { margin: var(--space-4) 0 var(--space-2); padding-top: var(--space-3); border-top: 1px solid var(--border); font: 700 var(--text-xs)/1 var(--font-sans); letter-spacing: .04em; color: var(--text-muted); text-transform: uppercase; }
.details-leer { text-align: center; color: var(--text-muted); padding: var(--space-8) var(--space-4); }

/* ── Positionstabelle ── */
.positionen { width: 100%; border-collapse: collapse; }
.positionen th { text-align: left; font: 600 var(--text-xs)/var(--leading-xs) var(--font-sans); color: var(--text-muted); padding: var(--space-2); }
.positionen td { padding: var(--space-2); vertical-align: top; border-top: 1px solid var(--border); }
.positionen .nr { width: 32px; color: var(--text-muted); padding-top: 18px; }
.positionen .menge { width: 90px; } .positionen .einheit-sp { width: 110px; } .positionen .preis { width: 130px; } .positionen .rabatt { width: 90px; }
.positionen .summe { width: 120px; padding-top: 18px; font-weight: 700; }
.positionen .zeilenaktion { width: 96px; white-space: nowrap; }
.positionen-aktionen { display: flex; gap: var(--space-2); justify-content: center; flex-wrap: wrap; padding: var(--space-3); }
.summenleiste { display: flex; justify-content: flex-end; align-items: baseline; gap: var(--space-4); padding: var(--space-4) var(--space-5); background: var(--primary); color: var(--on-primary); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.summenleiste .betrag { font: 800 var(--text-xl)/1 var(--font-heading); font-variant-numeric: tabular-nums; }
@media (max-width: 759px) {
  .positionen thead { display: none; }
  .positionen tr { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); padding: var(--space-3) 0; border-top: 1px solid var(--border); }
  .positionen td { border: 0; padding: 0; width: auto !important; }
  .positionen td.artikel { grid-column: 1 / -1; } .positionen .nr { display: none; }
  .positionen td label.nur-vorleser { position: static; width: auto; height: auto; clip: auto; display: block; margin-bottom: 2px; font-size: var(--text-xs); color: var(--text-muted); }
  .positionen .summe, .positionen .zeilenaktion { padding-top: var(--space-2); }
}

/* ── Hinweisbox ── */
.hinweis { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--info-bg); color: var(--text); border-left: 4px solid var(--info); }
.hinweis > .sym { color: var(--info); margin-top: 2px; }
.hinweis.warnung { background: var(--warning-bg); border-left-color: var(--warning); } .hinweis.warnung > .sym { color: var(--warning); }
.hinweis.fehler { background: var(--danger-bg); border-left-color: var(--danger); } .hinweis.fehler > .sym { color: var(--danger); }
.hinweis.erfolg { background: var(--success-bg); border-left-color: var(--success); } .hinweis.erfolg > .sym { color: var(--success); }
.hinweis p { margin: 0; }

/* ── Ablagefläche ── */
.ablage { display: grid; justify-items: center; gap: var(--space-2); padding: var(--space-6); border: 2px dashed var(--border-input); border-radius: var(--radius-lg); background: var(--surface); text-align: center; color: var(--text-muted); transition: background var(--motion-fast), border-color var(--motion-fast); }
.ablage.darueber { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.ablage.fehler { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); }
.ablage input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ablage .sym { width: 32px; height: 32px; }

/* ── Leerzustand ── */
.leer { display: grid; justify-items: center; gap: var(--space-3); padding: var(--space-10) var(--space-6); text-align: center; }
.leer .sym { width: 64px; height: 64px; color: var(--brand-eiche); stroke-width: 2.5; }
.leer p { margin: 0; max-width: 42ch; color: var(--text-muted); }

/* ── Kontokarte ── */
.kontokarte { display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-3); align-items: center; padding: var(--space-3) 0; border-top: 1px solid var(--border); }
.kontokarte:first-of-type { border-top: 0; }
.rund { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--neutral-bg); color: var(--text); flex: none; }
.rund.etsy { background: var(--accent-soft); color: var(--accent); }

/* ── Vorschlag ── */
.vorschlag { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-1) var(--space-1) var(--space-1) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface-alt); font-size: var(--text-sm); }
.vorschlag .sicher { color: var(--success); font-weight: 600; }
.vorschlag .knopf { --k-h: 28px; border-radius: var(--radius-pill); }

/* ── Panel (von rechts) ── */
.panel { position: fixed; inset: 0 0 0 auto; width: min(var(--panel-width), 100vw); max-width: 100vw; max-height: 100vh; height: 100vh; margin: 0; padding: 0; border: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow-panel); display: grid; grid-template-rows: auto 1fr auto; }
.panel:not([open]) { display: none; }
.panel::backdrop { background: color-mix(in srgb, var(--overlay) 40%, transparent); }
.panel-kopf, .panel-fuss { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border); }
.panel-kopf h2 { font-size: var(--text-md); }
.panel-kopf .knopf { margin-left: auto; }
.panel-inhalt { overflow: auto; padding: var(--space-5); display: grid; gap: var(--space-4); align-content: start; }
.panel-fuss { border-bottom: 0; border-top: 1px solid var(--border); background: var(--surface-alt); justify-content: space-between; }
.panel[open] { animation: hereingleiten var(--motion-slow) var(--motion-ease); }
@keyframes hereingleiten { from { transform: translateX(24px); opacity: 0; } }

/* ── Dialog ── */
.dialog { width: min(520px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); color: var(--text); background: var(--surface); }
.dialog::backdrop { background: color-mix(in srgb, var(--overlay) 40%, transparent); }
.dialog form { display: grid; gap: var(--space-4); padding: var(--space-5); }
.dialog .knopfreihe { display: flex; justify-content: flex-end; gap: var(--space-2); }

/* ── Toast ── */
.toasts { position: fixed; right: var(--space-4); bottom: var(--space-4); z-index: 50; display: grid; gap: var(--space-2); width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: var(--space-3); align-items: center; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-pop); animation: hereingleiten var(--motion-base) var(--motion-ease); }
.toast.fehler { background: var(--danger); }
.toast .knopf { margin-left: auto; color: var(--on-primary); }

/* ── Skelett ── */
.skelett { display: block; height: 14px; border-radius: var(--radius-sm); background: var(--neutral-bg); animation: pulsieren 1.4s ease-in-out infinite; }
@keyframes pulsieren { 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .skelett, .knopf[aria-busy="true"]::before, .panel[open], .toast { animation: none; } }

/* ── Hilfsklassen für die App (keine Inline-Stile wegen CSP) ── */
.breit { width: 100%; }
.flex-1 { flex: 1; min-width: 0; }
.reihe { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.reihe.ende { justify-content: flex-end; }
.stapel { display: grid; gap: var(--space-4); }
.stapel-klein { display: grid; gap: var(--space-2); }
.abstand-oben { margin-top: var(--space-5); }
.abstand-unten { margin-bottom: var(--space-4); }
.zentriert { text-align: center; }
.fett { font-weight: 700; }
.ohne-rand { border: 0; }
.schmal { max-width: var(--form-max); }
.sehr-schmal { max-width: 460px; margin: var(--space-10) auto; }
.zwei-spalten { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr) var(--detail-width); align-items: start; }
@media (max-width: 1100px) { .zwei-spalten { grid-template-columns: 1fr; } }
.pdf-rahmen { width: 100%; height: min(80vh, 1100px); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.kopf-status { display: flex; align-items: center; gap: var(--space-2); }
.zeile.einfach { grid-template-columns: minmax(0, 1fr) auto; }
.zeile.mit-rund { grid-template-columns: auto minmax(0, 1fr) auto; }
.liste-fuss { padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border); }
.textfeld-klein { min-height: 64px; }
.unauffaellig { color: var(--text-muted); font-size: var(--text-sm); }
.ladeblock { display: grid; gap: var(--space-2); padding: var(--space-5); }
.ladeblock .skelett:nth-child(2) { width: 70%; }
.ladeblock .skelett:nth-child(3) { width: 45%; }
.vorschau-tabelle { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.vorschau-tabelle th, .vorschau-tabelle td { padding: var(--space-1) var(--space-2); border-top: 1px solid var(--border); text-align: left; }
.vorschau-tabelle td.betrag { text-align: right; }
.positionen input.eingabe { min-width: 0; }
.dialog.breit-dialog { width: min(720px, calc(100vw - 32px)); }
.kachel-link { color: inherit; text-decoration: none; display: block; }
.kachel-link:hover .karte { border-color: var(--border-input); }
.ende-meldung { max-width: 520px; margin: 20vh auto; text-align: center; }
.reiter > a { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); color: var(--text-muted); font: 600 var(--text-sm) var(--font-sans); border-bottom: 3px solid transparent; text-decoration: none; white-space: nowrap; }
.reiter > a:hover { color: var(--text); }
.reiter > a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
#inhalt:focus { outline: none; }
.positionen { table-layout: fixed; }
.positionen-aktionen { align-items: center; }
.positionen-aktionen .feld { width: 160px; }
.positionen-aktionen .einheit { white-space: nowrap; }
@media (max-width: 759px) { .positionen { table-layout: auto; } }
.zeile.fest { cursor: default; }
.zeile.fest:hover { background: none; }
.qr-code { width: 200px; max-width: 100%; margin: var(--space-3) 0; padding: var(--space-2); background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); }
.qr-code svg { display: block; width: 100%; height: auto; }
.schluessel { font-size: var(--text-base); letter-spacing: .05em; word-break: break-all; }
.schritte { padding-left: var(--space-5); }
.notfall-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--space-2); list-style: none; padding: 0; }
.notfall-codes code { display: block; padding: var(--space-2); text-align: center; font-size: var(--text-base); background: var(--surface-hover); border-radius: var(--radius-sm); }
@media print { .hauptmenue, .knopf, label.reihe { display: none !important; } }
/* Belegerfassung */
.beleg-pruefen { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.beleg-vorschau { position: sticky; top: var(--space-4); }
.beleg-datei { display: block; width: 100%; height: min(78vh, 900px); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); object-fit: contain; }
img.beleg-datei { height: auto; max-height: 78vh; }
.eb-positionen { width: 100%; border-collapse: collapse; }
.eb-positionen th, .eb-positionen td { padding: var(--space-1) var(--space-1); text-align: left; vertical-align: middle; }
.eb-positionen td.preis { width: 9rem; }
.eb-positionen select[name="steuersatz"] { width: 5.5rem; }
.knopfreihe-links { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.knopf.gefahr-text { color: var(--danger); }
@media (max-width: 900px) {
  .beleg-pruefen { grid-template-columns: 1fr; }
  .beleg-vorschau { position: static; }
  .beleg-datei { height: 60vh; }
}
.beleg-pruefen > * { min-width: 0; }
.eb-positionen { table-layout: fixed; }
.eb-positionen th:nth-child(2), .eb-positionen td.preis { width: 8.5rem; }
.eb-positionen th:nth-child(3) { width: 5.5rem; }
.eb-positionen th:nth-child(4), .eb-positionen td.zeilenaktion { width: 2.75rem; }
.eb-positionen select[name="kategorie_id"] { width: 100%; text-overflow: ellipsis; }
.eb-positionen select[name="steuersatz"] { width: 100%; }
/* Auswertung (EÜR) */
.spalten-zwei { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--space-5); align-items: start; }
.tabelle.euer { width: 100%; border-collapse: collapse; }
.tabelle.euer td { padding: var(--space-2) 0; border-top: 1px solid var(--border); }
.tabelle.euer tr:first-child td { border-top: 0; }
.tabelle.euer td.betrag { text-align: right; white-space: nowrap; padding-left: var(--space-3); }
.tabelle.euer tr.gruppe td { font-weight: 600; }
.tabelle.euer tr.unter td { border-top: 0; padding-top: 0; color: var(--text-muted); font-size: var(--text-sm); }
.tabelle.euer tr.unter td:first-child { padding-left: var(--space-4); }
.tabelle.euer tr.summe td { font-weight: 700; border-top: 2px solid var(--text); }
.kennzahl .wert.minus { color: var(--danger); }
.balken { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; margin: var(--space-2) 0; }
.balken span { display: block; height: 100%; background: var(--accent); width: 0; }
.jahre { gap: var(--space-1); flex-wrap: wrap; }
.anlagen-tabelle th { text-align: left; font-size: var(--text-sm); color: var(--text-muted); font-weight: 600; padding-bottom: var(--space-2); }
.anlagen-tabelle th.betrag { text-align: right; }

/* Belegerfassung: Kategorie-Filter neben der Suche */
.liste-kopf .eb-kat { width: auto; max-width: 16rem; flex: 0 1 auto; }

/* Auswertung: klickbare Kennzahlen und Zeilen, Seitenfenster mit Einzelposten */
.kennzahl-knopf { display: grid; gap: var(--space-1); text-align: left; font: inherit; color: inherit; cursor: pointer; }
.kennzahl-knopf:hover { border-color: var(--accent); }
.kennzahl-knopf:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kennzahl-knopf .mehr { color: var(--accent); display: inline-flex; align-items: center; gap: var(--space-1); margin-top: var(--space-1); }
.kennzahl-knopf .mehr svg { width: 1em; height: 1em; }
.tabellen-link { all: unset; cursor: pointer; text-decoration: underline; text-decoration-color: var(--border-input); text-underline-offset: 3px; }
.tabellen-link:hover { color: var(--accent); text-decoration-color: currentColor; }
.tabellen-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.tabelle.euer th { text-align: left; font-size: var(--text-sm); color: var(--text-muted); font-weight: 600; padding: var(--space-2) 0; }
.tabelle.euer th.betrag { text-align: right; padding-left: var(--space-3); }
.detail-gruppe h3 { font-size: var(--text-sm); margin: 0 0 var(--space-2); padding-bottom: var(--space-1); border-bottom: 1px solid var(--border); }
.detail-liste { list-style: none; margin: 0; padding: 0; }
.detail-posten { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-2) 0; border-top: 1px solid var(--border); }
.detail-posten:first-child { border-top: 0; }
.detail-posten a { color: inherit; }
