/* ==========================================================================
   Buchhaltung (views/buchhaltung*.js). Nur Variablen aus css/app.css, Rundungen über --r-*.
   ========================================================================== */
.bh-reiter { margin-bottom: 18px; }
.bh-reiter .count { margin-left: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-klein); background: var(--warn-soft); color: var(--warn); font-size: 10.5px; font-style: normal; font-weight: 700; display: inline-grid; place-items: center; }
.bh-inhalt { display: flex; flex-direction: column; gap: 16px; }
.bh-kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.bh-zwei { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.bh-karte .card-head .row { margin-left: auto; }
.bh-aktionen { display: flex; flex-wrap: wrap; gap: 8px; }
.bh-aktionen .count, .btn .count { margin-left: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-klein); background: var(--accent-soft); color: var(--accent-text); font-size: 10.5px; font-style: normal; font-weight: 700; display: inline-grid; place-items: center; }
.bh-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bh-filter .select { width: auto; min-width: 120px; }
.bh-filter .input.grow { min-width: 200px; flex: 1; }
.bh-ansicht { margin-top: 4px; }
.bh-csv { justify-content: flex-end; margin-bottom: -8px; }

/* Zu erledigen */
.bh-todo-punkt { gap: 12px; }
.bh-todo-ic { width: 34px; height: 34px; flex: none; border-radius: var(--r-mittel); display: grid; place-items: center; background: var(--inset); color: var(--ink-2); }
.bh-todo-punkt.warn .bh-todo-ic { background: var(--warn-soft); color: var(--warn); }
.bh-todo-punkt.crit .bh-todo-ic { background: var(--crit-soft); color: var(--crit-text); }

/* Journal und Tabellen */
table.t tr.klickbar { cursor: pointer; }
table.t tr.klickbar:hover td { background: var(--hover); }
.bh-journal td:nth-child(4) { max-width: 320px; }
.bh-journal td:first-child, .bh-journal td:nth-child(2) { white-space: nowrap; }
tr.bh-storno td, tr.bh-storniert td { color: var(--ink-3); }
tr.bh-storniert td:nth-child(3) { text-decoration: line-through; }
.bh-bwa td:first-child { min-width: 180px; }
.bh-bwa .bh-ergebnis td { font-weight: 650; }
.bh-zwischen { margin: 18px 0 8px; }
.bh-gruppe { border-bottom: 1px solid var(--line); }
.bh-gruppe > summary { display: flex; align-items: center; gap: 12px; padding: 12px 4px; cursor: pointer; list-style: none; }
.bh-gruppe > summary::-webkit-details-marker { display: none; }
.bh-gruppe > summary::before { content: '›'; color: var(--ink-3); transition: transform var(--dauer-2); display: inline-block; width: 10px; }
.bh-gruppe[open] > summary::before { transform: rotate(90deg); }
.bh-gruppe .table-wrap { margin: 0 0 12px 22px; }

/* Buchungsdetail */
.bh-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 13.5px; }
.bh-dl dt { color: var(--ink-3); }
.bh-dl dd { margin: 0; }

/* Buchungssatz */
.bh-satz { display: flex; flex-direction: column; gap: 8px; }
.bh-satz-zeile { display: grid; grid-template-columns: minmax(0, 2.4fr) 110px 140px minmax(0, 1.2fr) 36px; gap: 8px; align-items: center; }
.bh-satz-summe { font-size: 13.5px; font-weight: 600; padding: 6px 10px; border-radius: var(--r-klein); }
.bh-satz-summe.ok { background: var(--pos-soft); color: var(--pos); }
.bh-satz-summe.nein { background: var(--warn-soft); color: var(--warn); }
.input.num { text-align: right; font-variant-numeric: tabular-nums; }
.bh-stapel td { padding: 6px; }
.bh-stapel .input, .bh-stapel .select { min-width: 110px; }

/* Bank direkt buchen */
.bh-bank-zeile { flex-wrap: wrap; }
.bh-bank-zeile .num { min-width: 110px; text-align: right; }
.bh-bank-wahl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; width: 100%; justify-content: flex-end; }
.bh-bank-wahl .select { width: auto; max-width: 220px; }
.bh-vorschlag { color: var(--accent-text); }

/* Festschreiben */
.bh-fest { align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }

/* Rechnungen */
.bh-pos { display: flex; flex-direction: column; gap: 8px; }
.bh-pos-zeile { display: grid; grid-template-columns: minmax(0, 3fr) 80px 110px 120px 90px minmax(0, 1.6fr) 36px; gap: 8px; align-items: center; }
.bh-pos-summen { min-width: 260px; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.bh-pos-summen > div { display: flex; justify-content: space-between; gap: 16px; }
.bh-pos-summen .bh-brutto { border-top: 1px solid var(--line-2); padding-top: 6px; font-size: 15px; }

/* Dokumente (Rechnung, Erinnerung, Verfahrensdokumentation) */
.bh-doc { max-width: 760px; margin: 0 auto; color: var(--ink); }
.bh-doc-absender { font-size: 11.5px; color: var(--ink-3); border-bottom: 1px solid var(--line); padding-bottom: 4px; display: inline-block; }
.bh-doc-an { margin: 18px 0 26px; line-height: 1.5; }
.bh-doc-datum { text-align: right; margin-bottom: 18px; }
.bh-doc-meta { margin: 8px 0 18px; }
.bh-doc .t td, .bh-doc .t th { font-size: 13px; }
.bh-doc-fuss { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 8px; }
.bh-doku { white-space: pre-wrap; font: 13px/1.55 var(--font, inherit); margin: 0; }

@media (max-width: 640px) { .bh-kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .bh-kacheln .metric-tile .big { font-size: 20px; } }
@media (max-width: 900px) {
  .bh-zwei { grid-template-columns: minmax(0, 1fr); }
  .bh-satz-zeile { grid-template-columns: minmax(0, 1fr) 100px; }
  .bh-satz-zeile > :nth-child(3) { grid-column: 1; }
  .bh-pos-zeile { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .bh-pos-zeile > :first-child, .bh-pos-zeile > :nth-child(6) { grid-column: 1 / -1; }
  .bh-filter .select, .bh-filter .input.grow { flex: 1 1 140px; }
}
@media print {
  .bh-doc { color: #000; max-width: none; }
}
