/* Buchhaltung – Ergänzungen zum PMT-Stylesheet (pmt/assets/style.css).
   Es gelten die Farben und Schriften des PMT; hier stehen nur Elemente, die es dort nicht gibt. */

.main > h1:first-of-type { margin-bottom: .35rem; }
.untertitel { margin: 0 0 1.25rem; color: var(--muted); }
.klein { font-size: .84rem; color: var(--muted); }
.nowrap { white-space: nowrap; }

/* Zähler offener Vorschläge in der Seitenleiste */
.zaehler { display: inline-block; min-width: 1.4rem; margin-left: .3rem; padding: 0 .35rem; border-radius: 99px; background: var(--rot); color: #fff;
  font-size: .75rem; font-weight: 650; text-align: center; line-height: 1.35rem; vertical-align: 1px; }

/* Filterzeile: Schnellwahl und Drucken */
.filters .field { min-width: 150px; }
.filters .field.schalt { min-width: 0; }
.filters select { min-width: 220px; }
.schnellwahl { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1rem; margin: -.2rem 0 0; font-size: .9rem; }
.schnellwahl .btn { margin-left: auto; }

/* Status */
.status.s-definitiv { background: var(--accent); color: var(--accent-ink); }
.status.s-vorschlag { background: var(--warn-soft); color: var(--ink); }
.status.s-fehler { background: var(--alarm-soft); color: var(--alarm); }
.status.s-storno { background: var(--soft); color: var(--muted); font-weight: 450; }

/* Tabellen */
.data tr[data-href] { cursor: pointer; }
.data tr.storniert td { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.data tr.gruppe th { background: none; color: var(--rot); font-family: var(--font-display); font-size: 1rem; font-weight: 500; padding-top: 1rem; border-bottom: 2px solid var(--blau); }
.data tr.gruppenkopf td { font-weight: 600; border-bottom: 0; padding-bottom: .2rem; }
.data td.einzug { padding-left: 1.6rem; }
.data tr.zwischensumme td { font-weight: 600; border-top: 1px solid var(--ink-2); }
.data tr.summe td { font-weight: 700; border-top: 2px solid var(--ink-2); border-bottom: 3px double var(--ink-2); }
.data th.check, .data td.check { width: 1%; }
.data tr.ohne td { color: var(--muted); }
.data .hinweis { display: block; color: var(--muted); font-size: .84rem; }
.data tr.aktuell td { background: color-mix(in srgb, var(--blau) 25%, transparent); }
.zeilenaktion { display: block; margin-top: .35rem; font-size: .85rem; }

/* Bilanz zweispaltig */
.bilanz { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; align-items: start; }

/* Prüfansicht: Buchung | Beleg */
.pruefen { display: grid; grid-template-columns: minmax(330px, 5fr) 7fr; gap: 1.5rem; align-items: start; }
.belegansicht { position: sticky; top: 108px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.belegansicht .kopf { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem .8rem; font-size: .88rem; background: var(--soft); border-bottom: 1px solid var(--line); }
.belegansicht iframe { display: block; width: 100%; height: calc(100vh - 170px); min-height: 520px; border: 0; background: #fff; }
.belegansicht img { display: block; max-width: 100%; margin: 0 auto; }
.belegansicht .empty { padding: 1.2rem; }
.konfidenz { display: inline-block; width: 90px; height: 6px; border-radius: 3px; background: var(--soft); overflow: hidden; vertical-align: middle; margin-right: .4rem; }
.konfidenz span { display: block; height: 100%; background: var(--accent-mid); }
.card h3 { margin-bottom: .6rem; }
.card dl.kv { font-size: .9rem; }

/* Ablagefeld für Uploads */
.ablage { display: block; padding: 1.4rem; margin-bottom: 1rem; text-align: center; color: var(--ink-2); cursor: pointer;
  background: var(--paper); border: 2px dashed var(--blau); border-radius: var(--radius); }
.ablage:hover, .ablage.aktiv { border-color: var(--accent); background: var(--soft); }
.ablage strong { color: var(--accent); }

/* Diagramm Monatsverlauf */
.diagramm { width: 100%; height: auto; margin: .4rem 0 .8rem; }
.diagramm text { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.diagramm .achse { stroke: var(--ink-2); }
.diagramm .raster { stroke: var(--line); }
.diagramm .ertrag { fill: var(--blau); }
.diagramm .aufwand { fill: var(--rot); }
.diagramm .liquid { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 5 3; }
.legend i { display: inline-block; width: 14px; height: 10px; border-radius: 2px; margin-right: .35rem; vertical-align: -1px; }
.legend i.ertrag { background: var(--blau); }
.legend i.aufwand { background: var(--rot); }
.legend i.liquid { height: 0; border-top: 2px dashed var(--accent); border-radius: 0; vertical-align: 3px; }

/* Druckkopf: nur auf Papier */
.druckkopf { display: none; }
.seitenumbruch { break-before: page; }

@media (max-width: 900px) {
  .pruefen, .bilanz { grid-template-columns: 1fr; }
  .belegansicht { position: static; }
  .belegansicht iframe { height: 70vh; }
}

@page { size: A4; margin: 14mm 14mm 16mm; }
@media print {
  body { font-size: 9.5pt; }
  .druckkopf { display: block; }
  .druckkopf .sheet-logo { height: 26px; width: auto; max-width: 45%; object-fit: contain; object-position: right center; margin: 0; }
  .data tbody tr:hover { background: none; }
  .main > h1:first-of-type, .main > .untertitel, .schnellwahl, .flash, .ablage, .belegansicht, .zaehler, .keindruck { display: none !important; }
  .data { font-size: 8.8pt; }
  .data th, .data td { padding: .18rem .35rem; }
  .data thead th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .data thead { display: table-header-group; }
  .pruefen { display: block; }
  .diagramm rect, .legend i { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  h2 { break-after: avoid; }
}
.data td.meta { display: table-cell; }

/* Begrüssungsseite */
.willkommen { max-width: 640px; margin: 2.5rem auto; }
.willkommen h1 { margin-bottom: 1.1rem; }
.willkommen-text { font-size: 1.02rem; line-height: 1.6; }
.willkommen-text > :first-child { margin-top: 0; }
.willkommen-text p { margin: 0 0 .9rem; }
.willkommen-text h2, .willkommen-text h3 { color: var(--rot); margin: 1.4rem 0 .5rem; }
.willkommen-text ul, .willkommen-text ol { margin: 0 0 .9rem; padding-left: 1.4rem; }
.willkommen-aktion { margin-top: 1.6rem; }
.willkommen-aktion .btn { padding: .6rem 1.4rem; font-size: 1rem; }

/* Texteditor in der Verwaltung */
.editor { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.editor:focus-within { border-color: var(--accent); }
.editor-leiste { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; padding: .45rem; border-bottom: 1px solid var(--line); background: var(--soft); border-radius: var(--radius) var(--radius) 0 0; }
.editor-leiste .btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.editor-leiste .btn:disabled { opacity: .45; cursor: default; }
.editor-trenner { width: 1px; align-self: stretch; margin: 0 .2rem; background: var(--line); }
.editor-flaeche { min-height: 16rem; padding: .8rem 1rem; outline: none; overflow-wrap: anywhere; }
