/* Büro › Buchhaltung (buchhaltung.js, buchhaltung-berichte.js) – nutzt die Tabellen und Fenster der Seite Kaufmännisch */
#fibuShell .km-tools select, #fibuShell .km-tools input[type="search"], #fibuShell .km-tools input[type="date"] { width: auto; min-width: 110px; height: 36px; border-radius: 10px; }
#fibuShell .km-tools input[type="search"] { min-width: 220px; }
#fibuShell .km-tools button { width: auto; height: 36px; min-height: 36px; padding: 0 14px; border-radius: 10px; font-size: 13px; font-weight: 600; white-space: nowrap; }
#fibuShell .fb-seg button { height: 32px; min-height: 32px; }
.fb-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.fb-content { display: block; padding-bottom: 40px; }
.fb-titel { margin: 18px 0 8px; font-size: 15px; }
.fb-kopf { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.fb-kopf .fb-titel { margin: 0; }
.fb-abschnitt { margin-bottom: 22px; padding-bottom: 14px; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.fb-abschnitt:last-child { border-bottom: 0; }
.fb-knoepfe { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 0; }
.fb-knoepfe button, .fb-knoepfe input { width: auto; height: 36px; min-height: 36px; padding: 0 14px; border-radius: 10px; font-size: 13px; font-weight: 600; }
.fb-abschnitt > .btb-hint { margin-bottom: 10px; line-height: 1.45; }

/* Kacheln der Übersicht */
.fb-kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 6px 0 14px; }
.fb-kachel { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel-solid); }
.fb-kachel span { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.fb-kachel strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.fb-kachel small { color: var(--muted); font-size: 12px; }
.fb-kachel.is-minus strong { color: var(--danger, #dc2626); }

/* Zu erledigen */
.fb-punkte { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.fb-punkt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border: 1px solid var(--border); border-left-width: 4px; border-radius: 10px; background: var(--panel-solid); font-size: 13.5px; }
.fb-punkt button { width: auto; flex: 0 0 auto; height: 32px; min-height: 32px; padding: 0 12px; }
.fb-punkt-knoepfe { display: inline-flex; gap: 6px; flex: 0 0 auto; }
.fb-punkt.is-ok { border-left-color: #16a34a; }
.fb-punkt.is-info { border-left-color: var(--accent); }
.fb-punkt.is-warn { border-left-color: #d97706; }
.fb-punkt.is-fehler { border-left-color: var(--danger, #dc2626); }
.fb-hinweise { margin: 8px 0 12px; font-size: 13px; }
.fb-hinweise summary { cursor: pointer; font-weight: 600; }
.fb-hinweise ul, .fb-liste { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.fb-liste small { color: var(--muted); }
.fb-fehler { color: var(--danger, #dc2626) !important; }
.fb-ok { color: #15803d !important; }
.fb-offen { color: #b45309; font-weight: 600; }
.fb-link { all: unset; cursor: pointer; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.fb-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Übersicht: Monate */
.fb-monate td { vertical-align: middle; }
.fb-monate + .btb-hint { margin: 8px 0 14px; line-height: 1.45; }
.fb-monate tr.is-zu td { color: var(--muted); }
.fb-monate button.ghost { width: auto; height: 28px; min-height: 28px; padding: 0 10px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.fb-monate .fb-klein { margin-left: 6px; }
.fb-chip { all: unset; display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: color-mix(in srgb, var(--border) 55%, transparent); color: var(--muted); }
button.fb-chip { cursor: pointer; }
.fb-chip.is-ok { background: color-mix(in srgb, #16a34a 18%, transparent); color: #15803d; }
.fb-chip.is-warn { background: color-mix(in srgb, #d97706 18%, transparent); color: #b45309; }
.fb-chip.is-fehler { background: color-mix(in srgb, #dc2626 16%, transparent); color: var(--danger, #dc2626); }
html[data-theme-mode="dark"] .fb-chip.is-ok { color: #4ade80; }
html[data-theme-mode="dark"] .fb-chip.is-warn { color: #fbbf24; }
html[data-theme-mode="dark"] .fb-chip.is-fehler { color: #f87171; }

/* Journal, Kontoblatt */
.fb-journal .fb-zeile td, .fb-kontoblatt .fb-zeile td { border-bottom: 0; padding-top: 3px; padding-bottom: 3px; }
.fb-journal .fb-erste td { border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent); padding-top: 7px; }
.fb-journal tr[data-fb-buchung], .fb-kontoblatt tr[data-fb-buchung], .km-table tr[data-fb-buchung], .fb-konto-zeile { cursor: pointer; }
.fb-journal tr[data-fb-buchung]:hover td, .fb-kontoblatt tr[data-fb-buchung]:hover td, .fb-konto-zeile:hover td { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.fb-konto-zeile:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.fb-nr { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.fb-journal td:nth-child(2), .fb-journal td:nth-child(3), .fb-kontoblatt td:nth-child(1), .fb-kontoblatt td:nth-child(3) { white-space: nowrap; }
.fb-ohne-vj .fb-vj { display: none; }
.fb-text { min-width: 200px; }
.fb-kontoname { color: var(--muted); }
.km-table td small.fb-p { display: inline; margin-left: 6px; }
.fb-journal .is-storno td, .fb-journal .is-storniert td, .fb-kontoblatt .is-storniert td, .km-table tr.is-storniert td { color: var(--muted); }
.fb-journal .is-storniert .fb-text { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.fb-quelle { margin: 10px 0 4px; font-size: 13px; }

/* Saldenliste, Bilanz, GuV */
.fb-ebene td { font-weight: 700; background: color-mix(in srgb, var(--border) 35%, transparent); }
.fb-summe-zeile td, .fb-guv-kopf td { font-weight: 700; }
.fb-summe-zeile td { border-top: 1px solid var(--border); }
.fb-unter td:first-child { padding-left: 22px; }
.fb-zwei { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 18px; align-items: start; }
.fb-bilanz th:nth-child(2), .fb-bilanz th:nth-child(3) { width: 130px; }
.fb-vj { color: var(--muted); }
.fb-posten-konten { margin-top: 2px; font-size: 12px; color: var(--muted); }
.fb-posten-konten summary { cursor: pointer; }
.fb-posten-konten div { display: flex; gap: 6px; padding: 1px 0; }
.fb-posten-konten div span { margin-left: auto; font-variant-numeric: tabular-nums; }
.an-neg { color: var(--danger, #dc2626); }

/* Fenster und Formulare */
.fb-dialog.is-breit { width: min(1180px, calc(100vw - 24px)); max-width: none; }
.fb-dialog .km-detail-body { max-height: calc(100vh - 210px); overflow: auto; }
.fb-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px 14px; margin-bottom: 12px; }
.fb-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; }
.fb-form label small { font-weight: 400; color: var(--muted); line-height: 1.4; }
.fb-form .fb-breit { grid-column: 1 / -1; }
.fb-konten-form { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.fb-eingabe td { vertical-align: top; }
.fb-eingabe input, .fb-eingabe select { width: 100%; min-width: 0; height: 34px; }
.fb-eingabe input.num { text-align: right; }
.fb-eingabe td:nth-child(1) { width: 150px; }
.fb-eingabe td:nth-child(2) { width: 130px; }
.fb-eingabe td:nth-child(3), .fb-eingabe td:nth-child(4) { width: 120px; }
.fb-eingabe td:nth-child(5) { width: 210px; }
.fb-eingabe .hidden { display: none; }
.fb-summe { margin: 10px 0; font-size: 14px; }
.fb-summe .is-ok { color: #15803d; font-weight: 700; }
.fb-summe .is-fehler { color: var(--danger, #dc2626); font-weight: 700; }
.fb-einrichten { padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel-solid); margin-bottom: 18px; }
.fb-einrichten .fb-titel { margin-top: 0; }
.fb-vorschlaege { padding: 10px 14px; border: 1px solid var(--border); border-left: 4px solid #d97706; border-radius: 10px; margin-bottom: 14px; }
.fb-vorschlaege .fb-titel { margin-top: 0; }

@media (max-width: 760px) {
  #fibuShell .km-tools { margin-left: 0; width: 100%; }
  #fibuShell .km-tools input[type="search"] { min-width: 0; flex: 1 1 140px; }
  .fb-content { overflow-x: auto; }
  .fb-zwei { grid-template-columns: 1fr; }
  .fb-punkt { flex-direction: column; align-items: flex-start; }
}
