/* Buchhaltung › Belege (Bauplan Buchhaltung BU5–BU13): Aufbau wie die Lexware-Seite „Alle Belege“ in der Optik von OfficeOmni
   (Ecken 3 px, Haarlinien, Blau nur Hauptknopf und Fokus). Vorsatz bh-. */

/* ── Leiste der Ansichten ─────────────────────────────────────────────── */
.bh-flaeche .bh-leiste { display: flex; flex-direction: column; gap: 1px; padding: 10px 8px;
  background: var(--flaeche-2); overflow-y: auto; }
.bh-neu { position: relative; margin: 0 0 10px; }
.bh-neu-knopf { width: 100%; height: 32px; }
.bh-neu-menue { position: absolute; z-index: 20; top: 36px; left: 0; right: 0; display: flex; flex-direction: column; padding: 4px 0; background: var(--flaeche);
  border: 1px solid var(--linie-stark); border-radius: 3px; box-shadow: 0 6px 18px rgb(0 0 0 / .12); }
.bh-neu-menue a { padding: 7px 12px; color: var(--tinte); text-decoration: none; font-size: 13px; }
.bh-neu-menue a:hover, .bh-neu-menue a:focus-visible { background: var(--flaeche-2); }
.bh-ansicht { display: flex; align-items: center; gap: 9px; height: 34px; padding: 0 10px; border: 0; border-radius: 3px; background: transparent; color: var(--tinte-2);
  font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.bh-ansicht:hover { background: var(--flaeche); }
.bh-ansicht.gewaehlt { background: var(--flaeche); color: var(--tinte); font-weight: 600; box-shadow: inset 3px 0 0 var(--akzent); }
.bh-ansicht .t { flex: 1 1 auto; }
.bh-zahl { min-width: 20px; padding: 0 6px; border-radius: 9px; background: var(--flaeche-2); color: var(--tinte-3); font-size: 11.5px; font-weight: 600; text-align: center;
  line-height: 18px; border: 1px solid var(--linie); }
.bh-zahl.alarm { background: var(--alarm-grund); color: var(--alarm); border-color: transparent; }
.bh-trenner { height: 1px; margin: 6px 4px; background: var(--linie); }

/* ── Kopf und Werkzeuge ───────────────────────────────────────────────── */
.bh-kopf .oo-suche, .bh-kopf .af-suche { flex: 0 1 440px; }
.bh-werkzeuge { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--linie); }
.bh-segment { display: inline-flex; border: 1px solid var(--linie-stark); border-radius: 3px; overflow: hidden; }
.bh-seg { height: 26px; padding: 0 10px; border: 0; border-right: 1px solid var(--linie); background: var(--flaeche); color: var(--tinte-3); font: inherit; font-size: 12px;
  cursor: pointer; }
.bh-seg:last-child { border-right: 0; }
.bh-seg.an { background: var(--flaeche-2); color: var(--tinte); font-weight: 600; }
.bh-filter-knopf.an { color: var(--tinte); font-weight: 600; }
.bh-folge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--tinte-3); }
.bh-folge select { height: 26px; border: 1px solid var(--linie-stark); border-radius: 3px; background: var(--flaeche); color: var(--tinte); font: inherit; font-size: 12px; }
/* Filter als Symbol mit der Zahl der Filter als Plakette (am Handy statt des Knopfs mit Text, HB1). */
.bh-filter-symbol { position: relative; }
.bh-punkt { position: absolute; top: 2px; right: 2px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px; background: var(--tinte-1);
  color: var(--flaeche); font-size: 10px; font-weight: 600; line-height: 15px; text-align: center; }
/* Handy-Fassungen (Bauplan Handy-Ansicht HB1, HB6): im Markup immer da, zu sehen nur am Handy (Block „Handy“ unten). */
.bh-kopf .bh-filter-symbol, .bh-fuss .bh-neu-laden-fuss, .bh-kopf .hs-handy-knopf { display: none; }
.bh-werkzeuge .bh-ansicht-chip, .bh-zeitraum-knopf .bh-zeitraum-kurz, .bh-werkzeuge .bh-chip-pfeil { display: none; }

/* ── Kennzahlen ───────────────────────────────────────────────────────── */
.bh-kennzahlen { flex: 0 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--linie); }
.bh-kennzahlen.zu { display: flex; }
.bh-kennzahl { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--linie); border-radius: 3px; background: var(--flaeche); }
.bh-kz-titel { font-size: 11.5px; color: var(--tinte-3); text-transform: none; }
.bh-kz-wert { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--tinte); }
.bh-kz-unter { font-size: 11.5px; color: var(--tinte-4); font-variant-numeric: tabular-nums; }
.bh-kennzahlen-satz { grid-column: 1 / -1; font-size: 12px; color: var(--tinte-3); display: inline-flex; gap: 6px; align-items: center; }
/* Die Zeile „Saldo · Offen“ gibt es nur am Handy (HB3, Block „Handy“ unten). */
.bh-kz-kurz { display: none; }

/* ── Liste ────────────────────────────────────────────────────────────── */
.bh-rein { color: var(--ok); }
.bh-raus { color: var(--alarm); }
.bh-offen { color: var(--warn); }
.bh-ueberfaellig { color: var(--alarm); font-weight: 600; }
.bh-storniert { opacity: .55; }
.bh-storniert .bh-k-betrag { text-decoration: line-through; }
/* ☠️ min-width 0: die Karte ist ein Flex-Element ihrer Zelle; ohne darf sie nicht schmaler als ihr Inhalt werden, und am Handy
   schnitt die Zelle Betrag und Marken rechts ab (Prüfung im Browser 14.11.2026). */
.bh-karte { display: flex; align-items: center; gap: 12px; height: 100%; padding: 0 12px 0 8px; flex: 1 1 auto; min-width: 0; }
.bh-kaestchen { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: var(--akzent); }
.bh-nr-zelle { display: inline-flex; align-items: center; gap: 8px; }
.bh-k-links { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bh-k-kontakt { font-weight: 600; font-size: 14px; color: var(--tinte); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bh-k-unter { font-size: 12px; color: var(--tinte-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bh-k-rechts { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.bh-k-betrag { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bh-k-marken { display: flex; gap: 4px; }
.bh-aufheben { pointer-events: auto; }

/* ── Auswahl und Fuß ──────────────────────────────────────────────────── */
.bh-auswahl { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 6px 10px; border-top: 1px solid var(--linie);
  background: var(--flaeche-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* ── Rechts: Beleg ────────────────────────────────────────────────────── */
.bh-flaeche .bh-akte, .bh-flaeche .bh-keiner { min-height: 0; border-left: 1px solid var(--linie); background: var(--flaeche); overflow-y: auto; }
.bh-keiner { display: flex; align-items: center; justify-content: center; padding: 24px; color: var(--tinte-3); text-align: center; font-size: 14px; }
.bh-a-kopf { display: flex; align-items: flex-start; gap: 8px; padding: 12px 14px 4px; }
.bh-a-kopf h2 { margin: 0; font-size: 16px; }
.bh-a-unter { font-size: 12px; color: var(--tinte-3); margin-top: 2px; }

/* ── Zeitraum und Filterfenster ───────────────────────────────────────── */
.bh-zeitraum .bh-z-bezug, .bh-zeitraum .bh-z-schnell, .bh-zeitraum .bh-z-jahr, .bh-zeitraum .bh-z-felder { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.bh-z-felder label, .bh-f-zeile label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--tinte-3); }
.bh-z-felder input, .bh-f-zeile input, .bh-f-zeile select { height: 28px; padding: 0 8px; border: 1px solid var(--linie-stark); border-radius: 3px; background: var(--flaeche); color: var(--tinte); font: inherit; }
.bh-wahl { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--tinte-2); margin-right: 10px; }
.bh-f-zeile { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
/* „Sortieren nach“ im Filterfenster nur am Handy (HB5, Block „Handy“ unten); sonst steht die Auswahl in der Werkzeugzeile. */
.bh-f-zeile.bh-f-folge { display: none; }
.bh-f-gruppe { border: 0; border-top: 1px solid var(--linie); margin: 0; padding: 8px 0 4px; display: flex; flex-wrap: wrap; gap: 4px 0; }
.bh-f-gruppe legend { padding: 0 6px 0 0; font-size: 12px; font-weight: 600; color: var(--tinte-3); }
.bh-f-laedt, .bh-f-hinweis { font-size: 12px; color: var(--tinte-3); display: flex; gap: 6px; align-items: center; }
/* ☠️ Der Dialog ist fixiert und mit bis zu 60 Kategorien höher als der Bildschirm: ohne eigene Höhengrenze und Rollfläche ließ sich
   der Rest nicht erreichen (15.11.2026). Wie .zf-dlg; die Knöpfe bleiben beim Rollen unten stehen (sticky). ☠️ Der Dialog hat unten
   keinen eigenen Innenabstand (padding-bottom 0), den hält der Fuß selbst: ein Fuß mit negativem Rand schob sich am Ende der Liste
   über die letzte Zeile (im Browser gemessen, „Mit USt-IdNr.“ war angeschnitten). */
.oo-dialog.bh-filterfenster { top: 6vh; width: min(720px, 96vw); max-height: 88vh; overflow-y: auto; padding-bottom: 0; }
.oo-dialog.bh-filterfenster .knoepfe { position: sticky; bottom: 0; margin-top: 8px; padding: 10px 0 14px; border-top: 1px solid var(--linie); background: var(--flaeche); }

/* ── Schmal ───────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .bh-kennzahlen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bh-folge span { display: none; }
}
.bh-massendialog { width: min(720px, calc(100vw - 32px)); }
.bh-m-felder { display: flex; flex-direction: column; gap: 6px; }
.bh-m-zeile { display: grid; grid-template-columns: 18px 150px minmax(0, 1fr); gap: 8px; align-items: center; }
.bh-m-vorschau { margin: 8px 0 0; font-size: 12.5px; }
.bh-rueckgaengig { display: flex; align-items: center; gap: 10px; }

/* ── Handy (bis 640 px; Bauplan 2026-11-25-web-app-handy-ansicht HB1–HB6) ─────────────────────────────── */
@media (max-width: 640.98px) {
  /* Suchzeile (HB1): Suche über die restliche Breite, Filter als Symbol, rechts „Scannen“; Leiste, „Neu laden“ und Akte nicht. */
  .bh-kopf { padding: 8px 12px; gap: 8px; }
  .bh-kopf .bh-leiste-knopf, .bh-kopf .bh-neu-laden, .bh-kopf .bh-akte-knopf, .bh-kopf > .af-fuell, .bh-werkzeuge .bh-filter-knopf { display: none; }
  .bh-kopf .af-suche { flex: 1 1 auto; min-width: 0; }
  /* 16 px: bei kleinerer Schrift vergrößert Safari beim Tippen die ganze Seite. */
  .bh-kopf .af-suche input { height: 36px; font-size: 16px; }
  .bh-kopf .kn { height: 36px; }
  .bh-kopf .bh-filter-symbol { display: inline-flex; flex: 0 0 36px; width: 36px; }
  .bh-kopf .hs-handy-knopf { display: inline-flex; flex: 0 0 auto; padding: 0 12px; font-size: 14px; font-weight: 600; text-decoration: none; }
  /* oo.css nimmt bis 860 px jedem Hauptknopf im Kopf die Beschriftung (.af-kopf .kn-haupt span); dieser heißt „Scannen“ (HB1). */
  .bh-kopf .hs-handy-knopf span { display: inline; }
  /* Fuß (HB6): „Neu laden“ neben der Zahl der Belege. */
  .bh-fuss .bh-neu-laden-fuss { display: inline-flex; width: 32px; height: 32px; }
  /* Chipzeile (HB2): eine Zeile, die seitlich rollt; Zahlstatus und Zeitraum sehen aus wie Chips (R4, R5). */
  .bh-werkzeuge { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 6px; padding: 6px 12px; }
  .bh-werkzeuge::-webkit-scrollbar { display: none; }
  .bh-werkzeuge > * { flex: 0 0 auto; }
  .bh-werkzeuge .bh-seg[data-status="Alle"], .bh-werkzeuge .bh-folge, .bh-werkzeuge .bh-segment.klein, .bh-werkzeuge .af-spaltenwahl,
    .bh-werkzeuge > .af-fuell, .bh-zeitraum-knopf .bh-zeitraum-lang { display: none; }
  /* Bis 640 px Fensterbreite zeigt die Liste mit gemerkter „Tabelle“ noch Spalten, solange sie breiter als 600 px ist
     (BelegeSpalten.KartenBis): dann bleiben Darstellung und Spaltenwahl erreichbar (Schlussdurchsicht; sonst kam man bei 601 bis
     640 px nicht zurück zu „Kompakt“). Bei Karten bleiben beide verborgen. */
  .af-mitte:has(.af-rollen:not(.af-karten)) .bh-werkzeuge .bh-segment.klein { display: inline-flex; }
  .af-mitte:has(.af-rollen:not(.af-karten)) .bh-werkzeuge .af-spaltenwahl { display: block; }
  .bh-werkzeuge .bh-ansicht-chip { display: inline-flex; }
  .bh-zeitraum-knopf .bh-zeitraum-kurz { display: inline; }
  .bh-werkzeuge .bh-chip-pfeil { display: inline-flex; color: var(--tinte-5); }
  .bh-werkzeuge .bh-segment { gap: 6px; border: 0; border-radius: 0; overflow: visible; }
  .bh-werkzeuge .bh-seg, .bh-werkzeuge .bh-seg:last-child { height: 32px; padding: 0 10px; border: 1px solid var(--linie-stark); border-radius: 3px;
    background: var(--flaeche); color: var(--tinte-3); font-size: 13px; white-space: nowrap; }
  .bh-werkzeuge .bh-seg.an { border-color: var(--tinte-5); background: var(--flaeche-2); color: var(--tinte-1); font-weight: 600; }
  .bh-werkzeuge .bh-zeitraum-knopf { height: 32px; padding: 0 10px; border: 1px solid var(--linie-stark); border-radius: 3px; background: var(--flaeche);
    color: var(--tinte-3); font-size: 13px; }
  .bh-werkzeuge .bh-zeitraum-knopf.gesetzt { border-color: var(--tinte-5); background: var(--flaeche-2); color: var(--tinte-1); font-weight: 600; }
  /* „Filter zurücksetzen“ als Chip mit ✕ (der Name steht im title und aria-label). */
  .bh-werkzeuge .af-aufheben { flex: 0 0 32px; width: 32px; height: 32px; padding: 0; justify-content: center; }
  .bh-werkzeuge .af-aufheben span { display: none; }
  .bh-werkzeuge .af-aufheben .sym { display: block; }
  /* Kennzahlen (HB3): eine Zeile „Saldo · Offen“ mit ▾ zwischen zwei Haarlinien; ein Tipp zeigt die vier Karten (2 × 2), ▴ klappt zu. */
  .bh-kennzahlen { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 8px; padding: 0 12px; background: var(--grund); }
  .bh-kennzahlen.auf { gap: 8px; padding-bottom: 8px; }
  .bh-kennzahlen:not(.auf) .bh-kennzahl { display: none; }
  .bh-kennzahlen-satz { min-height: 36px; }
  /* Bei großen Beträgen bricht die Zeile zwischen den Paaren „Wort Betrag“ um, statt über den Rand zu laufen (Schlussdurchsicht). */
  .bh-kz-kurz { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; min-width: 0; min-height: 36px;
    padding: 4px 0; border: 0;
    background: transparent; color: var(--tinte-3); font: inherit; font-size: 13px; text-align: left; white-space: nowrap; cursor: pointer;
    font-variant-numeric: tabular-nums; }
  .bh-kz-kurz .bh-kz-kurz-saldo, .bh-kz-kurz .bh-kz-kurz-offen { color: var(--tinte-1); font-weight: 600; }
  .bh-kz-kurz .bh-kz-kurz-offen.bh-offen { color: var(--warn); }
  .bh-kz-kurz-trenner { color: var(--tinte-5); }
  .bh-kz-kurz-paar { display: inline-flex; gap: 6px; white-space: nowrap; }
  .bh-kz-kurz .sym { flex: 0 0 auto; margin-left: auto; color: var(--tinte-5); transition: transform .15s; }
  .bh-kennzahlen.auf .bh-kz-kurz .sym { transform: rotate(180deg); }
  /* Karten der Liste ohne Kästchen (HB4): Mehrfachauswahl, Massenänderung und Massenzahlung gibt es erst ab 641 px. */
  .bh-kaestchen, .bh-auswahl { display: none; }
  /* Sortierung im Filterfenster (HB5). */
  .bh-f-zeile.bh-f-folge { display: flex; }
  .bh-f-folge label, .bh-f-folge select { width: 100%; }
}
