/* =====================================================================
   Sachverständigenbüro Daum – Gutachtenverwaltung Baumaschinen
   Bildschirm- und Druck-Stylesheet
   ===================================================================== */

:root {
  --navy: #1e3553;
  --navy-hell: #2c4a70;
  --blau: #2f6fb3;
  --blau-hell: #e8f0fa;
  --gruen: #2e8b57;
  --gruen-hell: #e6f4ec;
  --rot: #c0392b;
  --rot-hell: #fbeaea;
  --gelb: #d9a300;
  --gelb-hell: #fff6d6;
  --grau: #7f8c8d;
  --grau-hell: #eef0f2;
  --linie: #d5dae0;
  --text: #1c2430;
  --text-schwach: #5b6675;
  --hintergrund: #f3f5f8;
  --weiss: #ffffff;
  --schatten: 0 1px 3px rgba(0,0,0,.08), 0 4px 14px rgba(0,0,0,.06);
  --radius: 8px;
  --sidebar-breite: 268px;
  --schrift: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body { font-family: var(--schrift); font-size: 14px; color: var(--text); background: var(--hintergrund); }
h1, h2, h3, h4 { margin: 0 0 .5em; color: var(--navy); font-weight: 600; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15px; } h4 { font-size: 14px; }
a { color: var(--blau); }
p { margin: 0 0 .7em; }
[hidden] { display: none !important; }
.klein { font-size: 12px; color: var(--text-schwach); }
.rechts { text-align: right; }
.zentriert { text-align: center; }
.fett { font-weight: 600; }
.abstand { margin-top: 16px; }
.nowrap { white-space: nowrap; }

/* ---------- Grundlayout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-breite); background: var(--navy); color: #e6ecf3; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; flex-shrink: 0; z-index: 30;
}
.sidebar-kopf { padding: 16px 16px 10px; border-bottom: 1px solid rgba(255,255,255,.12); display: flex; justify-content: space-between; align-items: center; }
.marke { display: flex; gap: 10px; align-items: center; }
.marke-logo { width: 42px; height: 42px; border-radius: 6px; background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.marke-logo img { max-width: 100%; max-height: 100%; }
.marke-name { font-weight: 700; font-size: 14px; line-height: 1.2; }
.marke-sub { font-size: 11px; opacity: .75; }
.hauptmenu { display: flex; flex-direction: column; padding: 8px 0; flex: 1; }
.hauptmenu a { color: #dbe4ef; text-decoration: none; padding: 9px 16px; display: flex; align-items: center; gap: 10px; font-size: 13.5px; border-left: 3px solid transparent; }
.hauptmenu a:hover { background: rgba(255,255,255,.07); }
.hauptmenu a.aktiv { background: rgba(255,255,255,.12); border-left-color: #8fc1ff; color: #fff; font-weight: 600; }
.hauptmenu .ico { width: 20px; text-align: center; opacity: .85; font-size: 14px; }
.sidebar-fuss { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.12); font-size: 12px; }
.sidebar-fuss .klein { color: #b7c3d2; }
.speicher-status { font-weight: 600; margin-bottom: 4px; color: #9fe0b5; }
.speicher-status.speichert { color: #ffd66b; }

.hauptbereich { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.kopfleiste { background: var(--weiss); border-bottom: 1px solid var(--linie); padding: 10px 20px; display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 20; }
.kopf-titel { font-size: 18px; font-weight: 600; color: var(--navy); white-space: nowrap; }
.kopf-suche { flex: 1; position: relative; max-width: 560px; }
.kopf-suche input { width: 100%; padding: 8px 12px; border: 1px solid var(--linie); border-radius: 20px; font-size: 13px; }
.suche-ergebnis { position: absolute; top: 40px; left: 0; right: 0; background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten); max-height: 380px; overflow-y: auto; z-index: 50; }
.suche-ergebnis .treffer { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--grau-hell); display: flex; gap: 10px; align-items: center; }
.suche-ergebnis .treffer:hover { background: var(--blau-hell); }
.suche-ergebnis .treffer .typ { font-size: 11px; background: var(--grau-hell); padding: 2px 6px; border-radius: 4px; min-width: 70px; text-align: center; }
.kopf-aktionen { margin-left: auto; display: flex; gap: 8px; }
.view { padding: 20px; max-width: 1500px; width: 100%; }
.nur-mobil { display: none; }

/* ---------- Schaltflächen ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--linie); background: var(--weiss); color: var(--text); border-radius: 6px; cursor: pointer; font-size: 13.5px; font-family: inherit; line-height: 1.2; }
.btn:hover { background: var(--grau-hell); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--blau); border-color: var(--blau); color: #fff; }
.btn-primary:hover { background: #25599a; }
.btn-gruen { background: var(--gruen); border-color: var(--gruen); color: #fff; }
.btn-gruen:hover { background: #24704a; }
.btn-rot { background: var(--rot); border-color: var(--rot); color: #fff; }
.btn-rot:hover { background: #9e2f24; }
.btn-klein { padding: 4px 9px; font-size: 12px; }
.btn-gross { padding: 12px 20px; font-size: 15px; font-weight: 600; }
.btn-icon { background: none; border: none; font-size: 18px; cursor: pointer; color: inherit; padding: 4px 8px; border-radius: 6px; }
.btn-icon:hover { background: rgba(0,0,0,.08); }
.btn-leiste { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.btn-leiste.rechts { justify-content: flex-end; }

/* ---------- Karten, Raster ---------- */
.karte { background: var(--weiss); border-radius: var(--radius); box-shadow: var(--schatten); padding: 18px 20px; margin-bottom: 18px; }
.karte-kopf { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.karte-kopf h2, .karte-kopf h3 { margin: 0; }
.raster { display: grid; gap: 14px; }
.raster-2 { grid-template-columns: repeat(2, 1fr); }
.raster-3 { grid-template-columns: repeat(3, 1fr); }
.raster-4 { grid-template-columns: repeat(4, 1fr); }
.kachel { background: var(--weiss); border-radius: var(--radius); box-shadow: var(--schatten); padding: 14px 16px; cursor: pointer; border-left: 5px solid var(--blau); }
.kachel:hover { background: var(--blau-hell); }
.kachel .zahl { font-size: 28px; font-weight: 700; color: var(--navy); }
.kachel .label { font-size: 12.5px; color: var(--text-schwach); }
.kachel.gruen { border-left-color: var(--gruen); }
.kachel.rot { border-left-color: var(--rot); }
.kachel.gelb { border-left-color: var(--gelb); }
.kachel.grau { border-left-color: var(--grau); }

/* ---------- Formulare ---------- */
.form-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 16px; }
.feld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.feld.breit { grid-column: 1 / -1; }
.feld.halb { grid-column: span 2; }
.feld label { font-size: 12.5px; color: var(--text-schwach); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.feld label .pflicht { color: var(--rot); }
.feld label .hilfe { cursor: help; color: var(--blau); font-weight: 700; border: 1px solid var(--blau); border-radius: 50%; width: 15px; height: 15px; font-size: 10px; display: inline-flex; align-items: center; justify-content: center; }
.feld input, .feld select, .feld textarea {
  padding: 8px 10px; border: 1px solid var(--linie); border-radius: 6px; font-size: 13.5px; font-family: inherit; background: var(--weiss); color: var(--text); width: 100%;
}
.feld textarea { min-height: 80px; resize: vertical; line-height: 1.45; }
.feld input:focus, .feld select:focus, .feld textarea:focus { outline: 2px solid #9cc3f0; border-color: var(--blau); }
.feld input.fehlt, .feld select.fehlt, .feld textarea.fehlt { border-color: var(--rot); background: #fff8f8; }
.feld input:disabled, .feld select:disabled, .feld textarea:disabled { background: var(--grau-hell); color: var(--text-schwach); }
.feld .unterhilfe { font-size: 11.5px; color: var(--text-schwach); }
.feld.check { flex-direction: row; align-items: center; gap: 8px; }
.feld.check input { width: auto; }
.feld.check label { font-weight: 500; color: var(--text); }
.feld .waehrung { position: relative; }
fieldset.gruppe { border: 1px solid var(--linie); border-radius: var(--radius); padding: 12px 16px 16px; margin: 0 0 16px; }
fieldset.gruppe legend { font-weight: 600; color: var(--navy); padding: 0 6px; }
.status-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.status-checks label { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; padding: 3px 8px; border-radius: 14px; background: var(--grau-hell); cursor: pointer; }
.status-checks label.an { background: var(--blau-hell); font-weight: 600; }
.status-checks label.an.rot { background: var(--rot-hell); color: var(--rot); }
.status-checks label.an.gruen { background: var(--gruen-hell); color: var(--gruen); }
.status-checks label.an.gelb { background: var(--gelb-hell); color: #7a5b00; }
.status-checks label.an.grau { background: #e1e4e8; color: #444; }

/* ---------- Tabellen ---------- */
.tabelle { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--weiss); }
.tabelle th, .tabelle td { padding: 8px 10px; border-bottom: 1px solid var(--grau-hell); text-align: left; vertical-align: top; }
.tabelle th { background: #f7f9fb; color: var(--text-schwach); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .3px; white-space: nowrap; }
.tabelle tr.klickbar { cursor: pointer; }
.tabelle tr.klickbar:hover { background: var(--blau-hell); }
.tabelle td.zahl, .tabelle th.zahl { text-align: right; white-space: nowrap; }
.tabelle input, .tabelle select, .tabelle textarea { width: 100%; padding: 5px 7px; border: 1px solid var(--linie); border-radius: 4px; font-family: inherit; font-size: 13px; }
.tabelle tfoot td { font-weight: 600; background: #f7f9fb; }
.tabelle-scroll { overflow-x: auto; }
.tabelle tr.gruen-zeile { background: var(--gruen-hell); }
.tabelle tr.rot-zeile { background: var(--rot-hell); }
.tabelle tr.gelb-zeile { background: var(--gelb-hell); }
.tabelle tr.grau-zeile { background: var(--grau-hell); color: var(--text-schwach); }

/* ---------- Status-Kennzeichnungen ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--grau-hell); color: #444; }
.badge.gruen { background: var(--gruen-hell); color: var(--gruen); }
.badge.rot { background: var(--rot-hell); color: var(--rot); }
.badge.gelb { background: var(--gelb-hell); color: #7a5b00; }
.badge.blau { background: var(--blau-hell); color: var(--blau); }
.badge.grau { background: #e1e4e8; color: #555; }
.badge.navy { background: var(--navy); color: #fff; }

.hinweis { padding: 10px 14px; border-radius: 6px; margin: 8px 0 14px; font-size: 13px; border-left: 4px solid var(--blau); background: var(--blau-hell); }
.hinweis.warn { border-left-color: var(--gelb); background: var(--gelb-hell); }
.hinweis.fehler { border-left-color: var(--rot); background: var(--rot-hell); }
.hinweis.ok { border-left-color: var(--gruen); background: var(--gruen-hell); }
.hinweis ul { margin: 6px 0 0 18px; padding: 0; }

/* ---------- Registerkarten ---------- */
.tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 2px solid var(--linie); margin-bottom: 16px; }
.tabs button { background: none; border: none; padding: 9px 13px; font-size: 13.5px; cursor: pointer; color: var(--text-schwach); border-bottom: 3px solid transparent; margin-bottom: -2px; font-family: inherit; display: inline-flex; gap: 6px; align-items: center; }
.tabs button.aktiv { color: var(--navy); border-bottom-color: var(--blau); font-weight: 600; }
.tabs button:hover { color: var(--navy); }
.tabs .punkt { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.punkt.gruen { background: var(--gruen); } .punkt.rot { background: var(--rot); } .punkt.gelb { background: var(--gelb); } .punkt.grau { background: var(--grau); }

.fortschritt { height: 8px; background: var(--grau-hell); border-radius: 4px; overflow: hidden; margin: 6px 0 10px; }
.fortschritt > div { height: 100%; background: var(--gruen); transition: width .3s; }

.gutachten-kopf { background: var(--weiss); border-radius: var(--radius); box-shadow: var(--schatten); padding: 14px 20px; margin-bottom: 16px; display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
.gutachten-kopf .titel { font-size: 18px; font-weight: 700; color: var(--navy); }
.gutachten-kopf .meta { font-size: 12.5px; color: var(--text-schwach); }
.gutachten-kopf .aktionen { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Listen & Filter ---------- */
.filterleiste { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filterleiste input, .filterleiste select { padding: 7px 10px; border: 1px solid var(--linie); border-radius: 6px; font-family: inherit; font-size: 13px; }
.filterleiste input[type=search] { min-width: 260px; }
.leer { padding: 30px; text-align: center; color: var(--text-schwach); }

/* ---------- Fotos ---------- */
.dropzone { border: 2px dashed var(--linie); border-radius: var(--radius); padding: 26px; text-align: center; color: var(--text-schwach); background: #fafbfc; cursor: pointer; }
.dropzone.aktiv { border-color: var(--blau); background: var(--blau-hell); }
.foto-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.foto-karte { background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.foto-karte.ausgeschlossen { opacity: .55; }
.foto-karte .bild { position: relative; background: #222; height: 160px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.foto-karte .bild img { max-width: 100%; max-height: 100%; object-fit: contain; }
.foto-karte .nr { position: absolute; top: 6px; left: 6px; background: rgba(0,0,0,.7); color: #fff; padding: 2px 7px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.foto-karte .warn { position: absolute; top: 6px; right: 6px; background: var(--gelb); color: #000; padding: 2px 7px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.foto-karte .inhalt { padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.foto-karte select, .foto-karte textarea, .foto-karte input { width: 100%; padding: 5px 7px; border: 1px solid var(--linie); border-radius: 4px; font-family: inherit; font-size: 12.5px; }
.foto-karte textarea { min-height: 56px; resize: vertical; }
.foto-karte .fuss { display: flex; gap: 4px; flex-wrap: wrap; }
.foto-karte .fuss .btn { padding: 3px 7px; font-size: 11.5px; }
.bildeditor { display: grid; grid-template-columns: 1fr 260px; gap: 16px; }
.bildeditor canvas { max-width: 100%; border: 1px solid var(--linie); background: #333; cursor: crosshair; display: block; }
.bildeditor .werkzeuge { display: flex; flex-direction: column; gap: 8px; }
.bildeditor .werkzeuge .btn.aktiv { background: var(--blau-hell); border-color: var(--blau); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(20,30,45,.55); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal-box { background: var(--weiss); border-radius: 10px; width: 100%; max-width: 760px; max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.modal-box.gross { max-width: 1100px; }
.modal-kopf { padding: 14px 18px; border-bottom: 1px solid var(--linie); display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 16px; color: var(--navy); }
.modal-inhalt { padding: 18px; overflow-y: auto; flex: 1; min-height: 0; }
.modal-fuss { padding: 12px 18px; border-top: 1px solid var(--linie); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

.toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 6px; box-shadow: var(--schatten); font-size: 13px; max-width: 360px; animation: einblenden .25s; }
.toast.ok { background: var(--gruen); } .toast.fehler { background: var(--rot); } .toast.warn { background: var(--gelb); color: #000; }
@keyframes einblenden { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.protokoll { font-size: 12.5px; }
.protokoll li { padding: 4px 0; border-bottom: 1px solid var(--grau-hell); }
.tooltip { position: relative; }
.vorschlag-box { background: var(--blau-hell); border-left: 4px solid var(--blau); padding: 10px 12px; border-radius: 6px; margin: 8px 0; font-size: 13px; white-space: pre-wrap; }
.vorschlag-box .btn-leiste { margin: 8px 0 0; }
.kapitel-liste { list-style: none; padding: 0; margin: 0; }
.kapitel-liste li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid var(--grau-hell); background: var(--weiss); }
.kapitel-liste li.inaktiv { opacity: .5; }
.kapitel-liste li .titel { flex: 1; }
.kapitel-liste li input[type=text] { flex: 1; }
.logo-vorschau { border: 1px dashed var(--linie); padding: 12px; background: #fff; display: inline-block; max-width: 100%; }
.logo-vorschau img { max-width: 320px; max-height: 120px; display: block; }
.signatur-vorschau img { max-height: 90px; border: 1px dashed var(--linie); padding: 6px; background: #fff; }
.zwei-spalten { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ampel { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.ampel.gruen { background: var(--gruen); } .ampel.rot { background: var(--rot); } .ampel.gelb { background: var(--gelb); } .ampel.grau { background: var(--grau); } .ampel.blau { background: var(--blau); }
.pflichtliste li.ok { color: var(--gruen); } .pflichtliste li.fehlt { color: var(--rot); font-weight: 600; }
.pflichtliste { list-style: none; padding: 0; margin: 0; columns: 2; }
.pflichtliste li { padding: 3px 0; break-inside: avoid; }
.hilfetext { line-height: 1.55; max-width: 900px; }
.hilfetext h2 { margin-top: 24px; }
.hilfetext code { background: var(--grau-hell); padding: 1px 5px; border-radius: 3px; }
.messfeld { position: absolute; left: -9999px; top: 0; width: 175mm; visibility: hidden; font-family: "Segoe UI", Arial, Helvetica, sans-serif; font-size: 10.5pt; line-height: 1.4; color: #000; }
.tab-hinweis { display: flex; gap: 8px; align-items: center; }

/* ---------- Import / Kalkulationsprüfung / KI ---------- */
.import-log { list-style: none; padding: 0; margin: 10px 0 0; max-height: 220px; overflow-y: auto; font-size: 12.5px; }
.import-log li { padding: 3px 0; border-bottom: 1px solid var(--grau-hell); }
.import-kontrolle { display: grid; grid-template-columns: minmax(280px, 42%) 1fr; gap: 16px; min-height: 60vh; }
.import-links { border-right: 1px solid var(--linie); padding-right: 12px; min-width: 0; }
.import-rechts { min-width: 0; }
.import-canvaswrap { position: relative; overflow: auto; max-height: 68vh; border: 1px solid var(--linie); background: #666; }
.import-canvas { display: block; background: #fff; }
.import-overlay { position: absolute; left: 0; top: 0; pointer-events: none; }
.import-mark { position: absolute; border: 2px solid rgba(47,111,179,.7); background: rgba(47,111,179,.12); pointer-events: auto; cursor: pointer; border-radius: 2px; }
.import-mark.unsicher { border-color: rgba(217,163,0,.9); background: rgba(217,163,0,.18); }
.import-mark.aktiv { border-color: var(--rot); background: rgba(192,57,43,.2); box-shadow: 0 0 0 2px rgba(192,57,43,.35); }
.import-text { white-space: pre-wrap; font-family: Consolas, "Courier New", monospace; font-size: 12px; background: #fafbfc; border: 1px solid var(--linie); padding: 10px; max-height: 68vh; overflow: auto; margin: 0; }
.ocr-unsicher { background: var(--gelb-hell); }
.zuordnung-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 12px; margin-bottom: 10px; }
.zuordnung-raster label { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.import-tabelle th, .import-tabelle td { padding: 4px 5px; font-size: 12px; }
.import-tabelle input, .import-tabelle select { padding: 3px 5px; font-size: 12px; }
.import-tabelle input.korrigiert { border-color: var(--gelb); background: var(--gelb-hell); }
.import-tabelle select.vorschlag, .tabelle select.vorschlag { border-color: var(--gelb); background: var(--gelb-hell); }
.tabelle tr.aktiv-zeile { outline: 2px solid var(--blau); background: var(--blau-hell); }
.modal-box.import-modal { max-width: 96vw; height: 94vh; }
.ka-raster { display: grid; grid-template-columns: 30% 1fr 30%; gap: 14px; align-items: start; }
.ka-links, .ka-mitte, .ka-rechts { min-width: 0; }
.ka-links .import-canvaswrap { max-height: 78vh; }
.ka-tabelle th, .ka-tabelle td { padding: 5px 6px; font-size: 12px; }
.ka-tabs { display: none; }
@media (max-width: 1250px) {
  .ka-raster { grid-template-columns: 1fr; }
  .ka-tabs { display: flex; }
  .ka-links, .ka-mitte, .ka-rechts { display: none; }
  .ka-links.ka-aktiv, .ka-mitte.ka-aktiv, .ka-rechts.ka-aktiv { display: block; }
  .import-kontrolle { grid-template-columns: 1fr; }
  .import-links { border-right: none; padding-right: 0; }
  .import-canvaswrap { max-height: 40vh; }
}
.d-tab.kalk { font-size: 7pt; table-layout: fixed; width: 100%; word-wrap: break-word; overflow-wrap: anywhere; }
.d-tab.kalk th, .d-tab.kalk td { padding: .8mm .8mm; }
.d-tab.kalk col.c-pos { width: 6mm; } .d-tab.kalk col.c-bg { width: 17mm; } .d-tab.kalk col.c-bt { width: 26mm; } .d-tab.kalk col.c-an { width: 14mm; } .d-tab.kalk col.c-me { width: 8mm; } .d-tab.kalk col.c-eh { width: 11mm; } .d-tab.kalk col.c-ep { width: 12mm; } .d-tab.kalk col.c-ra { width: 8mm; } .d-tab.kalk col.c-zu { width: 8mm; } .d-tab.kalk col.c-ge { width: 13mm; } .d-tab.kalk col.c-s { width: 4.5mm; } .d-tab.kalk col.c-fo { width: 8mm; } .d-tab.kalk col.c-bm { width: 26mm; }
.d-tab.kalk th { font-size: 6.5pt; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .raster-4 { grid-template-columns: repeat(2, 1fr); }
  .raster-3 { grid-template-columns: repeat(2, 1fr); }
  .zwei-spalten { grid-template-columns: 1fr; }
  .bildeditor { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .nur-mobil { display: inline-flex; }
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; width: 280px; }
  .sidebar.offen { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .kopfleiste { padding: 8px 12px; }
  .kopf-titel { font-size: 15px; }
  .kopf-suche input { font-size: 12px; }
  .view { padding: 12px; }
  .raster-2, .raster-3, .raster-4 { grid-template-columns: 1fr 1fr; }
  .form-raster { grid-template-columns: 1fr; }
  .feld.halb { grid-column: auto; }
  .pflichtliste { columns: 1; }
  .kopf-aktionen .btn { padding: 6px 10px; font-size: 12px; }
}
@media (max-width: 520px) {
  .raster-2, .raster-3, .raster-4 { grid-template-columns: 1fr; }
  .kopf-suche { display: none; }
}

/* =====================================================================
   DRUCKAUSGABE – Seitenaufbau DIN A4
   Die Anwendung erzeugt echte Einzelseiten (.seite) mit fester Höhe;
   Kopf- und Fußzeile werden auf jeder Seite ausgegeben.
   ===================================================================== */
.druck { position: fixed; inset: 0; background: #5a6472; z-index: 90; overflow-y: auto; }
.druck-leiste { position: sticky; top: 0; background: var(--navy); color: #fff; padding: 10px 20px; display: flex; justify-content: space-between; align-items: center; z-index: 5; gap: 10px; flex-wrap: wrap; }
.druck-leiste .klein { color: #cfd8e3; margin-left: 12px; }
.druck-seiten { padding: 24px 0 60px; display: flex; flex-direction: column; align-items: center; gap: 18px; }

.seite {
  width: 210mm; height: 297mm; background: #fff; color: #000; position: relative; overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,.35);
  font-family: "Segoe UI", Arial, Helvetica, sans-serif; font-size: 10.5pt; line-height: 1.4;
  padding: 0; page-break-after: always; break-after: page;
}
.seite:last-child { page-break-after: auto; break-after: auto; }
.seite-kopf { position: absolute; top: 12mm; left: 20mm; right: 15mm; }
.seite-fuss { position: absolute; bottom: 10mm; left: 20mm; right: 15mm; font-size: 8pt; color: #333; border-top: .4pt solid #555; padding-top: 2mm; display: flex; justify-content: space-between; gap: 6mm; }
.seite-inhalt { position: absolute; left: 20mm; right: 15mm; overflow: hidden; }
.seite-inhalt > * { break-inside: avoid; }

/* Großer Briefkopf auf Seite 1 */
.briefkopf { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1.2pt solid #1e3553; padding-bottom: 3mm; }
.briefkopf .logo img { max-height: 24mm; max-width: 70mm; display: block; }
.briefkopf .buero { text-align: right; font-size: 8.5pt; line-height: 1.35; }
.briefkopf .buero .name { font-size: 12pt; font-weight: 700; color: #1e3553; }
.briefkopf .buero .sv { font-weight: 600; }
/* Kleine Kopfzeile Folgeseiten */
.kopfzeile-klein { display: flex; justify-content: space-between; align-items: center; border-bottom: .8pt solid #1e3553; padding-bottom: 1.5mm; font-size: 8pt; color: #333; }
.kopfzeile-klein .logo img { max-height: 10mm; max-width: 35mm; display: block; }
.kopfzeile-klein .mitte { flex: 1; padding: 0 5mm; }
.kopfzeile-klein b { color: #1e3553; }

.wasserzeichen { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) rotate(-35deg); font-size: 80pt; font-weight: 800; color: rgba(192,57,43,.13); letter-spacing: 8pt; pointer-events: none; z-index: 0; white-space: nowrap; }
.entwurf-marke { color: #c0392b; font-weight: 700; }
.seite-inhalt { z-index: 1; }

/* Deckblatt */
.deckblatt .titel { font-size: 22pt; font-weight: 700; color: #1e3553; margin: 4mm 0 1mm; letter-spacing: .5pt; }
.deckblatt .untertitel { font-size: 14pt; color: #2c4a70; margin-bottom: 7mm; }
.deckblatt table { width: 100%; border-collapse: collapse; font-size: 10.5pt; }
.deckblatt td { padding: 1.5mm 2mm; border-bottom: .4pt solid #bbb; vertical-align: top; }
.deckblatt td:first-child { width: 52mm; color: #444; font-weight: 600; }
.deckblatt .status { margin-top: 6mm; font-size: 11pt; }
.deckblatt .vertraulich { margin-top: 5mm; font-size: 9pt; color: #444; border: .5pt solid #999; padding: 3mm; }

/* Textkapitel */
.d-h1 { font-size: 13pt; font-weight: 700; color: #1e3553; margin: 5mm 0 2mm; border-bottom: .6pt solid #1e3553; padding-bottom: 1mm; }
.d-h2 { font-size: 11pt; font-weight: 700; color: #1e3553; margin: 3.5mm 0 1.5mm; }
.d-p { margin: 0 0 2.2mm; text-align: justify; hyphens: auto; }
.d-p.vor { font-size: 9pt; color: #333; }
.d-ul { margin: 0 0 2.5mm 5mm; padding: 0; }
.d-ul li { margin-bottom: .8mm; }
.d-tab { width: 100%; border-collapse: collapse; font-size: 9pt; margin: 1.5mm 0 3mm; }
.d-tab th, .d-tab td { border: .4pt solid #666; padding: 1.4mm 1.8mm; vertical-align: top; }
.d-tab th { background: #e9eef4; text-align: left; font-weight: 600; color: #1e3553; }
.d-tab td.z, .d-tab th.z { text-align: right; white-space: nowrap; }
.d-tab tr.summe td { font-weight: 700; background: #f3f5f8; }
.d-tab.kv { font-size: 8.5pt; }
.d-tab .st-gruen { background: #e6f4ec; }
.d-tab .st-gelb { background: #fff6d6; }
.d-tab .st-rot { background: #fbeaea; }
.d-tab .st-grau { background: #eeeeee; color: #444; }
.d-kv { display: grid; grid-template-columns: 62mm 1fr; gap: 1mm 4mm; margin-bottom: 3mm; }
.d-kv .k { color: #444; font-weight: 600; }
.d-kv .k, .d-kv .v { padding: .8mm 0; border-bottom: .3pt dotted #aaa; }
.d-kvt { width: 100%; border-collapse: collapse; margin-bottom: 3mm; font-size: 10pt; }
.d-kvt td { padding: .8mm 1mm .8mm 0; border-bottom: .3pt dotted #aaa; vertical-align: top; }
.d-kvt td.k { width: 62mm; color: #444; font-weight: 600; }
.d-inhalt li { display: flex; justify-content: space-between; padding: 1.2mm 0; border-bottom: .3pt dotted #999; }
.d-inhalt { list-style: none; padding: 0; margin: 0; }
.d-foto-zeile { display: grid; grid-template-columns: 1fr 1fr; gap: 5mm; margin-bottom: 4mm; }
.d-foto { break-inside: avoid; }
.d-foto .rahmen { border: .5pt solid #777; background: #fafafa; height: 62mm; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.d-foto img { max-width: 100%; max-height: 100%; object-fit: contain; }
.d-foto .text { font-size: 8.5pt; margin-top: 1.2mm; line-height: 1.3; }
.d-foto .text b { color: #1e3553; }
.d-foto.gross { grid-column: 1 / -1; }
.d-foto.gross .rahmen { height: 120mm; }
.d-unterschrift { margin-top: 12mm; display: flex; gap: 15mm; align-items: flex-end; }
.d-unterschrift .feld { width: 75mm; border-top: .6pt solid #000; padding-top: 1.5mm; font-size: 9.5pt; }
.d-unterschrift .feld .bild { height: 22mm; display: flex; align-items: flex-end; margin-bottom: 1mm; }
.d-unterschrift .feld .bild img { max-height: 22mm; max-width: 70mm; }
.d-unterschrift .stempel img { max-height: 28mm; max-width: 60mm; }
.d-warn { border-left: 2pt solid #c0392b; background: #fbeaea; padding: 2mm 3mm; margin: 2mm 0 3mm; font-size: 9.5pt; }
.d-info { border-left: 2pt solid #2f6fb3; background: #e8f0fa; padding: 2mm 3mm; margin: 2mm 0 3mm; font-size: 9.5pt; }
.d-ampel { display: inline-block; width: 3mm; height: 3mm; border-radius: 50%; margin-right: 1.5mm; vertical-align: middle; border: .3pt solid #555; }
.d-ampel.gruen { background: #2e8b57; } .d-ampel.rot { background: #c0392b; } .d-ampel.gelb { background: #d9a300; } .d-ampel.grau { background: #999; }

@page { size: A4 portrait; margin: 0; }
@media print {
  html, body { background: #fff !important; height: auto; }
  .app, .toasts, .modal, .nicht-drucken, .messfeld { display: none !important; }
  .druck { position: static; background: #fff; overflow: visible; }
  .druck-seiten { padding: 0; gap: 0; display: block; }
  .seite { box-shadow: none; margin: 0; width: 210mm; height: 297mm; page-break-after: always; break-after: page; }
  .seite:last-child { page-break-after: auto; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}
