/* Abrechnungsschreiben – dieselbe Gestaltung für die Vorschau im Portal und für das PDF.
   Übernommen aus dem Prototyp (.doc), Akzentfarbe Navy. Papier bleibt auch im Dunkelmodus weiß. */
.doc {
  --doc-bg: #FFFFFF; --doc-ink: #141A1C; --doc-muted: #4A5568; --doc-line: #CFD6D6; --doc-accent: #0B1B33;
  background: var(--doc-bg); color: var(--doc-ink); border: 1px solid #D9DFEA; border-radius: 3px; padding: 44px 48px;
  font-family: "Archivo", system-ui, sans-serif; font-size: 12.5px; line-height: 1.5; min-width: 0;
  box-shadow: 0 1px 0 #D9DFEA, 0 12px 28px -18px rgba(0,0,0,.35);
}
@media (max-width: 600px) { .doc { padding: 22px 16px; } }
.doc .sender { font-size: 9.5px; color: var(--doc-muted); border-bottom: 1px solid var(--doc-line); padding-bottom: 3px; display: inline-block; margin-bottom: 6px; }
.doc .addr { min-height: 92px; }
.doc .meta { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.doc .meta dl { display: grid; grid-template-columns: auto auto; gap: 2px 14px; margin: 0; font-size: 11.5px; }
.doc .meta dt { color: var(--doc-muted); }
.doc .meta dd { margin: 0; font-family: "IBM Plex Mono", ui-monospace, monospace; }
.doc h2 { font-size: 17px; margin: 26px 0 4px; color: var(--doc-ink); letter-spacing: -0.01em; }
.doc h4 { font-size: 12px; margin: 18px 0 6px; text-transform: uppercase; letter-spacing: .06em; color: var(--doc-accent); }
.doc p { margin: 6px 0; }
.doc .dt { overflow-x: auto; }
.doc table { border-collapse: collapse; width: 100%; font-size: 11.5px; }
.doc th { background: none; color: var(--doc-muted); border-bottom: 1.5px solid var(--doc-ink); font-size: 9.5px; padding: 5px 6px;
  text-transform: uppercase; letter-spacing: .06em; font-weight: 600; text-align: left; white-space: nowrap; }
.doc td { border-bottom: 1px solid var(--doc-line); padding: 5px 6px; white-space: normal; vertical-align: middle; text-align: left; }
/* Zahlen in Archivo mit Tabellenziffern: bündig und schmal genug für A4 (Plex Mono wäre zu breit) */
.doc td.n, .doc th.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.doc tr.sub td { color: var(--doc-muted); font-size: 10.5px; border-bottom: 0; padding-top: 0; }
.doc tr.tot td { border-top: 1.5px solid var(--doc-ink); border-bottom: 0; font-weight: 600; }
.doc tr.res td { font-size: 14px; font-weight: 700; border-bottom: 3px double var(--doc-ink); }
.doc .box { border: 1px solid var(--doc-line); padding: 10px 12px; margin-top: 10px; border-radius: 2px; break-inside: avoid; }
.doc .small { font-size: 10.5px; color: var(--doc-muted); }
.doc ul { margin: 4px 0; padding-left: 18px; }
.doc .sign { margin-top: 36px; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.doc .sign div { border-top: 1px solid var(--doc-ink); padding-top: 3px; min-width: 200px; font-size: 10.5px; color: var(--doc-muted); }
.doc tr { break-inside: avoid; }
.doc h4, .doc h2 { break-after: avoid; }

/* PDF: A4, Ränder wie im Prototyp, ohne Rahmen und Schatten */
@page { size: A4; margin: 16mm 16mm 14mm 20mm; }
body.pdf { margin: 0; background: #FFFFFF; }
body.pdf .doc { border: 0; box-shadow: none; padding: 0; border-radius: 0; }
body.pdf .doc .dt { overflow: visible; }
body.pdf .doc table { font-size: 10.5px; }
body.pdf .doc td, body.pdf .doc th { padding: 4px 5px; }

/* v0.10.4: Probeabrechnung – diagonales Wasserzeichen auf jeder PDF-Seite, Hinweis, Gegenüberstellung Excel ↔ Portal */
.probe-zeichen { position: fixed; top: 42%; left: -10%; right: -10%; transform: rotate(-35deg); text-align: center; font: 700 54px "Archivo", system-ui, sans-serif;
  color: rgba(180, 35, 24, 0.16); letter-spacing: 0.04em; pointer-events: none; z-index: 10; white-space: nowrap; }
.probe-blatt { font-family: "Archivo", system-ui, sans-serif; font-size: 11px; color: #141A1C; }
.probe-titel { font-size: 17px; font-weight: 700; margin: 0 0 6px; }
.probe-hinweis { background: #FBEFD9; color: #8A5A0F; border-radius: 6px; padding: 8px 10px; font-weight: 700; margin: 0 0 8px; }
.probe-vermerk { background: #FDE4E1; color: #B42318; border-radius: 6px; padding: 6px 10px; font-weight: 700; margin: 6px 0; }
.probe-klein { color: #4A5568; margin: 0 0 10px; }
.probe-blatt h3 { font-size: 13px; margin: 14px 0 6px; }
.probe-pruef { margin: 0; padding-left: 16px; }
.probe-pruef .probe-bad strong { color: #B42318; } .probe-pruef .probe-warn strong { color: #8A5A0F; }
.probe-tabelle { border-collapse: collapse; width: 100%; }
.probe-tabelle th, .probe-tabelle td { border-bottom: 1px solid #CFD6D6; padding: 4px 6px; text-align: left; vertical-align: top; }
.probe-tabelle .n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.probe-tabelle tr.probe-summe td { font-weight: 700; border-top: 1.5px solid #141A1C; }
.probe-tabelle tr[data-abweichung] td:nth-child(4) { color: #B42318; font-weight: 700; }
.probe-gegen h3 { font-size: 12px; margin: 12px 0 4px; }
body.pdf .probe-schreiben { break-before: page; }
body.pdf .probe-gegen { break-inside: avoid; }
