:root {
[hidden] { display: none !important; }
  --text: #1c2430; --leise: #5d6673; --linie: #dde1e6; --flaeche: #f5f6f8; --karte: #fff;
  --akzent: #1f4e79; --mehr: #b3261e; --mehr-bg: #fbe9e7; --minder: #2e7d32; --minder-bg: #e8f5e9;
  --umg: #5c6bc0; --umg-bg: #eceefa; --ausweis: #8d6e00; --ausweis-bg: #fff6d6; --warn-bg: #fff4e0; --warn: #9a5b00;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--text); background: var(--flaeche); }
button { font: inherit; cursor: pointer; border: 1px solid var(--akzent); background: var(--akzent); color: #fff; padding: 6px 12px; border-radius: 6px; }
button.sekundaer { background: #fff; color: var(--akzent); }
button.link { background: none; border: none; color: var(--akzent); padding: 4px; text-decoration: underline; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; padding: 5px 7px; border: 1px solid #c4cad2; border-radius: 5px; background: #fff; }
input[type=number] { text-align: right; }
h1 { font-size: 22px; font-weight: 500; margin: 0 0 4px; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 10px; }
h3 { font-size: 15px; font-weight: 600; margin: 14px 0 8px; }
.leise { color: var(--leise); }
.klein { font-size: 12.5px; }
.fehler { color: var(--mehr); min-height: 1em; }
.anmeldung { display: grid; place-items: center; min-height: 100vh; }
.login { width: min(380px, 92vw); display: grid; gap: 10px; }
.login label { display: grid; gap: 4px; }
.kopf { position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid var(--linie); display: flex; align-items: center; gap: 16px; padding: 8px 16px; flex-wrap: wrap; }
.kopf .titel { font-size: 15px; }
.reiter { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.reiter button { background: none; color: var(--text); border: none; border-bottom: 3px solid transparent; border-radius: 0; padding: 8px 10px; }
.reiter button.aktiv { border-bottom-color: var(--akzent); color: var(--akzent); font-weight: 600; }
.rechts { display: flex; gap: 10px; align-items: center; }
main { padding: 16px; max-width: 1500px; margin: 0 auto; }
.fuss { text-align: center; padding: 18px; font-size: 12px; }
.karte { background: var(--karte); border: 1px solid var(--linie); border-radius: 8px; padding: 14px 16px; margin-bottom: 14px; }
.raster { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 14px; }
.kpi { background: #fff; border: 1px solid var(--linie); border-radius: 8px; padding: 12px 14px; }
.kpi .wert { font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; margin: 2px 0; }
.kpi .label { font-size: 12.5px; color: var(--leise); }
.kpi .unter { font-size: 12.5px; color: var(--leise); }
.kpi.hervor { border-left: 4px solid var(--akzent); }
.kpi.warn { border-left: 4px solid var(--warn); background: var(--warn-bg); }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 1000px) { .zwei { grid-template-columns: 1fr; } }
.tabelle-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 5px 8px; border-bottom: 1px solid var(--linie); text-align: left; vertical-align: top; }
th { font-size: 12.5px; color: var(--leise); font-weight: 600; background: #fafbfc; position: sticky; top: 0; }
td.z, th.z { text-align: right; white-space: nowrap; }
tr.summe td { font-weight: 600; background: #f3f5f8; }
tr.zwischen td { font-weight: 600; border-top: 2px solid var(--akzent); }
tr.ergebnis td { font-weight: 700; border-top: 2px solid var(--text); }
tr.klickbar { cursor: pointer; }
tr.klickbar:hover td { background: #f7f9fc; }
.neg { color: var(--mehr); }
.pos { color: var(--minder); }
.art-mehr td { background: var(--mehr-bg); }
.art-minder td { background: var(--minder-bg); }
.art-umg td { background: var(--umg-bg); }
.art-ausweis td { background: var(--ausweis-bg); }
.marke { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 10px; background: #eef1f5; color: var(--leise); white-space: nowrap; }
.marke.mehr { background: var(--mehr-bg); color: var(--mehr); }
.marke.minder { background: var(--minder-bg); color: var(--minder); }
.marke.umg { background: var(--umg-bg); color: var(--umg); }
.marke.ausweis { background: var(--ausweis-bg); color: var(--ausweis); }
.marke.warn { background: var(--warn-bg); color: var(--warn); }
.marke.ok { background: var(--minder-bg); color: var(--minder); }
.hinweis { background: var(--warn-bg); border: 1px solid #f1d7a8; border-radius: 6px; padding: 8px 12px; margin: 8px 0; font-size: 13px; }
.leiste { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.leiste label { display: flex; gap: 6px; align-items: center; }
.formular { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 18px; align-items: start; }
.formular label { display: grid; grid-template-rows: minmax(2.7em, auto) auto auto; align-content: start; gap: 4px; font-size: 13px; line-height: 1.3; color: var(--leise); }
.formular label > input, .formular label > select, .formular .zahlfeld, .formular label > .leiste { height: 34px; box-sizing: border-box; width: 100%; }
.formular label > .klein { line-height: 1.35; }
.zahlfeld { display: inline-flex; align-items: center; border: 1px solid #c4cad2; border-radius: 5px; background: #fff; overflow: hidden; }
.zahlfeld input.zahl { border: 0; flex: 1; min-width: 0; text-align: right; font-variant-numeric: tabular-nums; height: 100%; }
.zahlfeld .einheit { padding: 0 8px; color: var(--leise); font-size: 12.5px; border-left: 1px solid #e3e7ec; background: #f6f7f9; align-self: stretch; display: flex; align-items: center; }
td .zahlfeld { width: 100%; min-width: 130px; height: 30px; }
.warnz { color: #9a5b00; font-weight: 600; }
.dialog { position: fixed; inset: 0; background: rgba(20,30,40,.4); display: grid; place-items: center; z-index: 20; }
.dialog-karte { background: #fff; border-radius: 10px; width: min(1100px, 96vw); max-height: 92vh; overflow: auto; padding: 18px 20px; position: relative; }
.schliessen { position: absolute; right: 10px; top: 8px; background: none; color: var(--text); border: none; font-size: 24px; }
.dtabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 6px 0 14px; }
.dtabs button { background: #fff; color: var(--akzent); }
.dtabs button.aktiv { background: var(--akzent); color: #fff; }
.chart { width: 100%; height: auto; display: block; }
.chart text { font-size: 11px; fill: var(--leise); }
.legende { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--leise); }
.legende i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
details > summary { cursor: pointer; }
.kommentar { font-size: 12.5px; border-left: 3px solid var(--linie); padding-left: 8px; margin: 4px 0; }
.lade { padding: 40px; text-align: center; color: var(--leise); }

th.sortierbar { cursor: pointer; user-select: none; }
th.sortierbar:hover { color: var(--text, #1d2733); background: #eef2f6; }
th.sortierbar .pfeil { font-size: 10px; color: #9aa4b0; }
th.sortierbar.aktiv .pfeil { color: #1f4e79; }

table.din .aufklapp { width: 20px; height: 20px; padding: 0; margin-right: 8px; border: 1px solid #b9c2cc; border-radius: 4px; background: #fff; color: #1f4e79; font-weight: 700; line-height: 18px; cursor: pointer; vertical-align: middle; }
table.din .aufklapp:hover { background: #eef2f6; }
table.din .aufklapp-platz { display: inline-block; width: 28px; }
table.din tr.din-e1 td { background: #f6f8fa; }
table.din tr.din-e3 td { font-size: 12.5px; }
table.din .kg { display: inline-block; min-width: 44px; color: var(--leise); font-variant-numeric: tabular-nums; }
button.klein { font-size: 12px; padding: 3px 8px; }

/* ---------- Reporting ---------- */
.b-steuerung { margin-bottom: 16px; }
.b-wahl { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin-bottom: 12px; }
.b-wahl-k { display: grid; gap: 3px; padding: 10px 12px; border: 1px solid var(--linie); border-radius: 8px; cursor: pointer; background: #fff; }
.b-wahl-k input { display: none; }
.b-wahl-k span { font-size: 12px; color: var(--leise); line-height: 1.35; }
.b-wahl-k.aktiv { border-color: var(--akzent); box-shadow: inset 0 0 0 1px var(--akzent); background: #f3f7fb; }
.b-param { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.b-param label { display: flex; gap: 6px; align-items: center; }
#bericht-rahmen { background: #e9ecf0; padding: 24px 0; border-radius: 8px; overflow-x: auto; }
.bericht { --b-navy: #1f4e79; --b-text: #1c2430; --b-leise: #6b7785; --b-linie: #e3e7ec; --b-flaeche: #f5f7fa;
  width: 210mm; min-height: 297mm; margin: 0 auto; background: #fff; padding: 16mm 15mm; box-shadow: 0 2px 14px rgba(0,0,0,.12);
  font: 9.5pt/1.45 -apple-system, "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif; color: var(--b-text); font-variant-numeric: tabular-nums; }
.bericht.quer { width: 297mm; min-height: 210mm; }
.b-titel { border-bottom: 2px solid var(--b-navy); padding-bottom: 12px; margin-bottom: 18px; }
.b-absender { font-size: 8pt; letter-spacing: .06em; text-transform: uppercase; color: var(--b-leise); }
.b-titel h1 { font-size: 24pt; font-weight: 300; color: var(--b-navy); margin: 6px 0 2px; letter-spacing: -.01em; }
.b-untertitel { margin: 0 0 10px; color: var(--b-leise); font-size: 10.5pt; }
.b-meta { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 0; }
.b-meta div { display: flex; gap: 6px; } .b-meta dt { color: var(--b-leise); } .b-meta dd { margin: 0; font-weight: 600; }
.b-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 18px; }
.b-kpis.drei { grid-template-columns: repeat(3, 1fr); }
.b-kpi { background: var(--b-flaeche); border-radius: 6px; padding: 9px 11px; border-top: 3px solid #c6d0db; break-inside: avoid; }
.b-kpi.hervor { border-top-color: var(--b-navy); } .b-kpi.gut { border-top-color: #2e7d32; } .b-kpi.warn { border-top-color: #c77700; }
.b-kpi-l { font-size: 7.5pt; text-transform: uppercase; letter-spacing: .05em; color: var(--b-leise); }
.b-kpi-w { font-size: 14pt; font-weight: 600; margin: 3px 0 2px; white-space: nowrap; }
.b-kpi-u { font-size: 7.5pt; color: var(--b-leise); line-height: 1.3; }
.b-abschnitt { margin: 0 0 18px; }
.b-abschnitt h2 { font-size: 12pt; font-weight: 600; color: var(--b-navy); margin: 0 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--b-linie); break-after: avoid; }
.b-abschnitt h3 { font-size: 10pt; margin: 12px 0 6px; }
.b-hinweis { font-size: 7.5pt; color: var(--b-leise); margin: 5px 0 0; }
.b-liste { margin: 0; padding-left: 16px; } .b-liste li { margin: 0 0 4px; }
.b-tab { width: 100%; border-collapse: collapse; font-size: 8.5pt; }
.b-tab.b-klein { font-size: 7.8pt; }
.b-tab th { text-align: left; font-weight: 600; color: var(--b-leise); font-size: 7.5pt; text-transform: uppercase; letter-spacing: .03em; padding: 5px 6px; border-bottom: 1.5px solid var(--b-navy); vertical-align: bottom; }
.b-tab td { padding: 4px 6px; border-bottom: 1px solid var(--b-linie); vertical-align: top; }
.b-tab .z { text-align: right; white-space: nowrap; }
.b-tab tr { break-inside: avoid; }
.b-tab thead { display: table-header-group; }
.b-th-u { text-transform: none; font-weight: 400; letter-spacing: 0; }
.b-tab tr.b-gruppe td { background: var(--b-flaeche); font-weight: 600; border-top: 1px solid #cfd6de; }
.b-tab tr.b-e2z td { color: #333d48; } .b-e2 { padding-left: 12px; display: inline-block; } .b-e3 { padding-left: 26px; display: inline-block; color: #4a5562; }
.b-tab tr.b-e3z td { font-size: 7.5pt; border-bottom-color: #f0f2f5; }
.b-kg { display: inline-block; min-width: 38px; color: var(--b-leise); }
.b-tab tr.b-summe td { font-weight: 700; border-top: 1.5px solid var(--b-navy); border-bottom: none; }
.b-tab tr.b-zwischen td { font-weight: 600; background: var(--b-flaeche); }
.b-tab tr.b-start td { font-weight: 600; }
.b-tab tr.b-ergebnis td { font-weight: 700; color: #fff; background: var(--b-navy); }
.b-tab tr.b-ergebnis .b-neg, .b-tab tr.b-ergebnis .b-mehr { color: #ffd2cc; } .b-tab tr.b-ergebnis .b-minder { color: #c8f0ca; }
.b-tab tr.b-bank td { background: #fff8eb; }
.b-neg { color: #b3261e; } .b-mehr { color: #b3261e; } .b-minder { color: #2e7d32; } .b-leise { color: var(--b-leise); }
.b-marke { display: inline-block; font-size: 6.8pt; line-height: 1.25; padding: 1px 5px; border-radius: 3px; background: #f6e3bf; color: #7a4b00; margin-top: 2px; }
.bericht.quer .b-tab.b-klein { font-size: 7.4pt; table-layout: fixed; }
.bericht.quer .b-tab.b-klein td, .bericht.quer .b-tab.b-klein th { padding: 3px 4px; }
.b-status { display: inline-block; font-size: 7pt; padding: 0 5px; border-radius: 3px; }
.b-status.ok { background: #e3f1e4; color: #1d5e21; } .b-status.frei { background: #e8eef5; color: #1f4e79; } .b-status.warn { background: #f6e3bf; color: #7a4b00; }
.b-balken { display: grid; gap: 4px; margin-top: 6px; }
.b-balken-z { display: grid; grid-template-columns: 34% 1fr 22%; gap: 8px; align-items: center; font-size: 8pt; break-inside: avoid; }
.b-balken-s { background: var(--b-flaeche); height: 10px; border-radius: 2px; overflow: hidden; } .b-balken-s span { display: block; height: 100%; border-radius: 2px; }
.b-balken-w { text-align: right; white-space: nowrap; }
.b-stapel { display: flex; height: 16px; border-radius: 3px; overflow: hidden; margin: 4px 0 6px; } .b-stapel span { display: block; height: 100%; }
.b-legende { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 8pt; margin-bottom: 10px; }
.b-legende i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.b-chart .chart { width: 100%; height: auto; font-size: 11px; } .b-chart .legende { font-size: 8pt; }
.b-zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media print {
  body { background: #fff; }
  .kopf, .fuss, .b-steuerung, #dialog, .nur-bildschirm { display: none !important; }
  main { padding: 0; max-width: none; }
  #bericht-rahmen { background: none; padding: 0; }
  .bericht, .bericht.quer { width: auto; min-height: 0; margin: 0; padding: 0; box-shadow: none; }
  .b-neu { break-before: page; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Zahlungen ↔ Kosten */
table.kred tr.detail > td { background: #fafbfc; padding: 6px 8px 12px; }
table.innen { margin: 4px 0 8px; font-size: 12.5px; }
table.innen th { background: none; }
table.kred .aufklapp { width: 22px; height: 22px; padding: 0; line-height: 1; }

/* Eigene Kostenaufstellungen T. Lucas (nur nach DIN-Kostengruppen) */
option.tl-stand { color: #9a5a00; background: #fff4e0; font-weight: 600; }
select:has(option.tl-stand:checked) { color: #9a5a00; background-color: #fff4e0; border-color: #e0a54a; font-weight: 600; }

.kurven-wahl { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 10px; font-size: 13px; }
.kurven-wahl label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.kurven-wahl i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; }

/* Zeitraum-Regler */
.zeitregler { margin: 4px 0 12px; padding: 10px 12px 6px; background: #f7f9fb; border: 1px solid var(--linie, #e3e7ec); border-radius: 8px; }
.zr-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; }
.zr-schnell { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.zr-spur { position: relative; height: 26px; margin: 8px 9px 0; }
.zr-spur::before { content: ''; position: absolute; left: 0; right: 0; top: 11px; height: 4px; border-radius: 2px; background: #dfe4ea; }
.zr-band { position: absolute; top: 11px; height: 4px; border-radius: 2px; background: #1f4e79; }
.zr-spur input[type=range] { position: absolute; left: -9px; width: calc(100% + 18px); top: 0; height: 26px; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.zr-spur input[type=range]::-webkit-slider-runnable-track { background: transparent; height: 26px; }
.zr-spur input[type=range]::-moz-range-track { background: transparent; }
.zr-spur input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 18px; height: 18px; margin-top: 4px; border-radius: 50%; background: #fff; border: 2px solid #1f4e79; box-shadow: 0 1px 3px rgba(0,0,0,.2); cursor: grab; }
.zr-spur input[type=range]::-moz-range-thumb { pointer-events: auto; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid #1f4e79; cursor: grab; }
.zr-skala { display: flex; justify-content: space-between; font-size: 11px; color: var(--leise, #6b7785); margin: 2px 0 0; }

/* Liquiditätsplan: aufklappbare Zeilen */
tr.liq-gruppe .aufklapp { width: 20px; height: 20px; padding: 0; margin-right: 8px; font-size: 13px; line-height: 1; vertical-align: -3px; }
tr.liq-gruppe .aufklapp-platz { display: inline-block; width: 28px; }
tr.liq-detail td { font-size: 12.5px; color: #3c4652; background: #fafbfc; border-bottom-color: #eef1f4; }
tr.liq-detail td:first-child { padding-left: 38px; max-width: 520px; }
.liq-name { font-weight: 500; }
th.sortierbar { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortierbar:hover { text-decoration: underline; }
table.sens-matrix td { min-width: 110px; }
table.sens-matrix td.sens-aktiv { outline: 2px solid var(--akzent, #1f4e79); outline-offset: -2px; }
