/* ==========================================================================
   VORDRUCKE · Bildschirm und Druck (DIN A4 hochkant, einheitlicher Kopf/Fuß)
   ========================================================================== */

/* ---------- Übersicht ---------- */
.doc-legend { margin: -4px 0 18px; color: var(--text-2); font-size: 13.5px; }
.doc-legend span { display: inline-flex; align-items: center; gap: 8px; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 14px; }
a.docc { display: flex; gap: 16px; padding: 16px; border-radius: 20px; text-decoration: none; color: inherit; background: var(--glass-bg); border: 1px solid var(--glass-border, rgba(0,0,0,.08)); box-shadow: var(--lg-shadow, none); transition: transform .18s ease, box-shadow .18s ease; }
a.docc:hover { transform: translateY(-2px); }
.docc-paper { flex: none; width: 58px; height: 80px; border-radius: 6px; background: #fff; border: 1px solid rgba(0,0,0,.12); box-shadow: 0 4px 12px rgba(0,0,0,.10); padding: 8px 7px; display: flex; flex-direction: column; gap: 4px; position: relative; }
.docc-paper span { display: block; height: 3px; border-radius: 2px; background: #d3dbd6; }
.docc-paper .dp-l { width: 55%; background: var(--accent); height: 4px; }
.docc-paper .dp-t { width: 85%; background: #aebdb5; margin-bottom: 3px; }
.docc-paper .short { width: 60%; }
.docc-paper b { position: absolute; right: 5px; bottom: 4px; font-size: 8px; color: var(--accent); letter-spacing: .06em; }
.docc-b { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.docc-top { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.docc-nr { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; color: var(--text-2); }
.docc-lock, .lockchip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--t-rot, #c0392b); }
.docc-b h3 { margin: 0; font-size: 16.5px; line-height: 1.25; }
.docc-b p { margin: 0; color: var(--text-2); font-size: 13.5px; line-height: 1.45; }
.docc-f { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.docc-f .chip, .doc-info .chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 10px; border-radius: 99px; background: var(--chip-bg, rgba(0,0,0,.05)); color: var(--text-2); font-weight: 600; }

/* ---------- Dokumentseite ---------- */
.doc-info { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.doc-bar { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; }

/* Das „Blatt“ auf dem Bildschirm */
.vd { max-width: 860px; margin: 0 auto 18px; background: #fff; color: #1b1f1d; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.16), 0 0 0 1px rgba(0,0,0,.06); padding: 0; overflow: hidden; }
:root[data-theme="dark"] .vd { box-shadow: 0 10px 40px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.08); }
.vd * { font-family: var(--font); }
.vh { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; padding: 18px 26px 14px; border-bottom: 3px solid #2f5d46; }
.vh-logo { height: 26px; width: auto; display: block; }
.vh-t small { display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #5c6a62; font-weight: 600; }
.vh-t h1 { margin: 2px 0 0; font-family: var(--head); font-style: italic; font-weight: 900; font-size: 22px; line-height: 1.15; letter-spacing: -.01em; color: #14201a; }
.vh-m { margin: 0; display: grid; gap: 3px; font-size: 11.5px; text-align: right; }
.vh-m div { display: flex; gap: 6px; justify-content: flex-end; }
.vh-m dt { color: #5c6a62; } .vh-m dd { margin: 0; font-weight: 700; }
.vbody { padding: 16px 26px 20px; display: flex; flex-direction: column; gap: 14px; }
.vfoot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 18px; padding: 10px 26px 12px; border-top: 1px solid #cfd8d2; font-size: 10.5px; color: #5c6a62; }

.vfields { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 12px 16px; }
.vf { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.vf > span { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #5c6a62; }
.vf input[type=text], .vf input[type=date], .vf input[type=time], .vf select, .vf textarea { width: 100%; font: 500 15px/1.35 var(--font); color: #14201a; background: #f5f8f6; border: 1px solid #cdd7d1; border-radius: 8px; padding: 9px 11px; min-height: 40px; }
.vf textarea { resize: vertical; overflow: hidden; }
.vf input:focus, .vf select:focus, .vf textarea:focus { outline: 2px solid #2f5d46; outline-offset: 1px; background: #fff; }
.vf.wahl .opts { display: flex; flex-wrap: wrap; gap: 8px; }
.vf.wahl label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; padding: 7px 12px 7px 8px; border-radius: 99px; border: 1px solid #cdd7d1; background: #f5f8f6; font-size: 14px; }
.vf.wahl input { position: absolute; opacity: 0; pointer-events: none; }
.vf.wahl i { width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid #8ea298; display: grid; place-items: center; color: transparent; background: #fff; }
.vf.wahl b { font-weight: 600; }
.vf.wahl input:checked + i { background: #2f5d46; border-color: #2f5d46; color: #fff; }
.vf.wahl input:focus-visible + i { outline: 2px solid #2f5d46; outline-offset: 2px; }
.vf .val { border-bottom: 1px solid #9aa9a0; min-height: 6.2mm; font-size: 12px; padding: 1px 2px; white-space: pre-wrap; }
.vf .val.ta { border: 1px solid #9aa9a0; padding: 2mm; }
.vf.wahl .opts b { font-size: 12px; font-weight: 600; margin-right: 4mm; }

.vsec { margin: 4px 0 -4px; font-family: var(--head); font-style: italic; font-weight: 900; font-size: 15px; padding: 6px 10px; background: #e6eee9; border-left: 4px solid #2f5d46; color: #14201a; }
.vtext { margin: 0; font-size: 13px; line-height: 1.5; color: #33403a; }
.vtext .tbc { background: #fff3c4; border-radius: 4px; padding: 0 4px; }

.vgroup { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 14px 18px; align-items: start; }
.vgroup > div { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.vr-t { margin: 0 0 6px; font-family: var(--head); font-style: italic; font-weight: 900; font-size: 14px; color: #14201a; }
.vr .tbl-wrap { overflow-x: auto; }
.vtab { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
.vtab th, .vtab td { border: 1px solid #aab8b0; padding: 0; height: 32px; }
.vtab thead th { background: #2f5d46; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .03em; padding: 6px 6px; text-align: left; height: auto; border-color: #2f5d46; }
.vtab th.lbl { text-align: left; font-weight: 600; padding: 4px 8px; background: #f3f7f4; white-space: nowrap; }
.vtab tr.grp th { background: #dfe9e3; text-align: left; padding: 4px 8px; font-size: 12px; height: auto; }
.vtab td.off { background: repeating-linear-gradient(135deg, #eef1ef 0 4px, #e1e6e3 4px 5px); }
.vtab td.nr, .vtab th.nr { width: 28px; text-align: center; color: #5c6a62; font-size: 11.5px; }
.vtab td input { width: 100%; border: 0; background: transparent; font: 500 13.5px var(--font); color: #14201a; padding: 6px 8px; height: 100%; min-height: 30px; }
.vtab td input:focus { outline: 2px solid #2f5d46; outline-offset: -2px; background: #f5faf7; }
.vtab td span { display: block; padding: 2px 6px; font-size: 12px; }
.vr.kompakt .vtab th, .vr.kompakt .vtab td { height: 24px; }
.vr.kompakt .vtab td input { min-height: 22px; padding: 2px 6px; }

.vp { margin: 0; }
.vp ul { list-style: none; margin: 0; padding: 0; border: 1px solid #cdd7d1; border-radius: 10px; overflow: hidden; }
.vp li { border-bottom: 1px solid #e2e9e5; }
.vp li:last-child { border-bottom: 0; }
.vp li > label { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; cursor: pointer; }
.vp li input { position: absolute; opacity: 0; }
.vp .cbox { width: 24px; height: 24px; border-radius: 8px; border: 2px solid #8ea298; display: grid; place-items: center; color: transparent; background: #fff; transition: all .15s; }
.vp li.done .cbox { background: #2f5d46; border-color: #2f5d46; color: #fff; }
.vp li.done .cl-t { color: #6a7a71; text-decoration: line-through; text-decoration-color: rgba(0,0,0,.25); }
.vp li input:focus-visible + .cbox { outline: 2px solid #2f5d46; outline-offset: 2px; }
.vp .cl-t { font-size: 14.5px; line-height: 1.4; }
.vp .cl-time { font-size: 12px; font-weight: 700; color: #2f5d46; min-width: 40px; text-align: right; }
.vp li.pop .cbox { animation: vdpop .5s ease; }
@keyframes vdpop { 0% { transform: scale(.7); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
.vp a { color: inherit; text-decoration: none; } .vp a:hover { text-decoration: underline; }
.vp .bx { font-size: 15px; }

.vsign { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 36px; margin-top: 14px; }
.vsign i { display: block; border-bottom: 1px solid #5c6a62; height: 34px; }
.vsign span { font-size: 11px; color: #5c6a62; display: block; padding-top: 4px; }

.lockcard { max-width: 420px; margin: 20px auto; text-align: center; padding: 28px 24px; }
.lock-ico { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 18px; display: grid; place-items: center; background: rgba(192,57,43,.12); color: var(--t-rot, #c0392b); }
.lockcard h2 { margin: 6px 0; }
.lockcard p { color: var(--text-2); margin: 0 0 14px; }
.lock-form { display: grid; gap: 12px; text-align: left; }
.lock-form .vf > span { color: var(--text-2); }
.lock-form input { font-size: 20px; letter-spacing: .3em; text-align: center; background: var(--glass-bg-hover, rgba(0,0,0,.05)); border: 1px solid var(--glass-border, rgba(0,0,0,.12)); color: var(--text); border-radius: 12px; padding: 10px; width: 100%; }
.lock-err { color: var(--t-rot, #c0392b) !important; font-weight: 600; min-height: 1.3em; margin: 10px 0 0 !important; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }

@media (max-width: 720px) {
  .vh { grid-template-columns: 1fr; gap: 8px; padding: 14px 16px 10px; }
  .vh-m { text-align: left; } .vh-m div { justify-content: flex-start; }
  .vbody { padding: 14px 14px 16px; }
  .vfoot { padding: 10px 14px; flex-direction: column; }
  .vfields { grid-template-columns: 1fr; }
  .vfields .vf { grid-column: auto !important; }
  .vgroup { grid-template-columns: 1fr; }
}

/* ---------- Druck: DIN A4 hochkant ---------- */
#printArea .vprint { display: block; }
  .vprint { font-family: var(--font); color: #000; font-size: 9.5pt; }
  .vprint * { box-sizing: border-box; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .vsheet { width: 100%; border-collapse: collapse; height: auto; }
  .vsheet > thead > tr > td, .vsheet > tfoot > tr > td, .vsheet > tbody > tr > td { padding: 0; vertical-align: top; }
  .vsheet > tbody > tr > td { height: 100%; }
  .vsheet > thead { display: table-header-group; } .vsheet > tfoot { display: table-footer-group; }
  .vprint .vh { padding: 0 0 3mm; gap: 5mm; border-bottom: 0.9mm solid #2f5d46; margin-bottom: 4mm; }
  .vprint .vh-logo { height: 6mm; }
  .vprint .vh-t small { font-size: 6.5pt; } .vprint .vh-t h1 { font-size: 13.5pt; line-height: 1.15; }
  .vprint .vh-m { font-size: 7.5pt; }
  .vprint .vbody { padding: 0; gap: 3mm; }
  .vprint .vf .val.ta { min-height: 9mm; }
  .vprint .vfoot { padding: 2mm 0 0; margin-top: 4mm; font-size: 7pt; border-top: 0.3mm solid #9aa9a0; }
  .vprint .vfields { gap: 3mm 5mm; }
  .vprint .vf > span { font-size: 6.8pt; }
  .vprint .vf .val { font-size: 9.5pt; min-height: 6.4mm; }
  .vprint .vsec { font-size: 10pt; padding: 1.2mm 2.5mm; margin: 0; background: #e6eee9 !important; }
  .vprint .vtext { font-size: 8.5pt; }
  .vprint .vr-t { font-size: 9.5pt; margin-bottom: 1.4mm; break-after: avoid; }
  .vprint .vtab { font-size: 8.5pt; }
  .vprint .vtab th, .vprint .vtab td { height: 6.6mm; border: 0.25mm solid #556; }
  .vprint .vtab thead th { background: #2f5d46 !important; color: #fff !important; font-size: 7pt; padding: 1mm 1.5mm; height: auto; }
  .vprint .vtab tr.grp th { background: #dfe9e3 !important; font-size: 8pt; padding: 0.8mm 2mm; height: auto; }
  .vprint .vtab th.lbl { background: #f3f7f4 !important; padding: 0.6mm 1.8mm; font-size: 8.5pt; }
  .vprint .vtab td.off { background: #e4e8e5 !important; }
  .vprint .vtab td span { padding: 0 1.5mm; font-size: 8.5pt; }
  .vprint .vtab th, .vprint .vtab td { line-height: 1.1; }
  .vprint .vr.kompakt .vtab th, .vprint .vr.kompakt .vtab td { height: 4.9mm; }
  .vprint .vtab tr { break-inside: avoid; }
  .vprint .vr { break-inside: avoid; }
  .vprint .vgroup { gap: 4.5mm 6mm; }
  .vprint .vp ul { border: 0.25mm solid #556; border-radius: 0; }
  .vprint .vp li { display: grid; grid-template-columns: 6mm 1fr 16mm; align-items: center; gap: 2mm; padding: 1mm 2.5mm; border-bottom: 0.2mm solid #99a; break-inside: avoid; }
  .vprint .vp li:last-child { border-bottom: 0; }
  .vprint .vp .cl-t { font-size: 9pt; line-height: 1.22; } .vprint .vp .bx { font-size: 11pt; line-height: 1; }
  .vprint .vp .cl-time { line-height: 1; }
  .vprint .vp .cl-time { border-bottom: 0.2mm solid #889; min-height: 4.5mm; font-size: 8pt; }
  .vprint .vsign { grid-template-columns: repeat(2, 1fr); gap: 3mm 14mm; margin-top: 3mm; break-inside: avoid; }
  .vprint .vsign i { height: 8mm; } .vprint .vsign span { font-size: 7pt; }
  .vprint a { color: inherit; text-decoration: none; }

/* ---- Regelungen: Paragraphen und feste Tabellen ---- */
.vpar { break-inside: avoid; }
.vpar h3 { margin: 0 0 6px; font-family: var(--head); font-style: italic; font-weight: 900; font-size: 14px; color: #14201a; display: flex; gap: 8px; align-items: baseline; }
.vpar h3 span { color: #2f5d46; }
.vpar ol { margin: 0; padding: 0; list-style: none; counter-reset: abs; display: grid; gap: 4px; }
.vpar li { counter-increment: abs; display: grid; grid-template-columns: 26px 1fr; font-size: 13px; line-height: 1.5; color: #33403a; }
.vpar li::before { content: "(" counter(abs) ")"; color: #5c6a62; font-variant-numeric: tabular-nums; }
.vtab.vstat td, .vtab.vstat th.lbl { padding: 5px 8px; height: auto; vertical-align: top; font-size: 12.5px; line-height: 1.4; white-space: normal; }
  .vprint .vpar h3 { font-size: 10pt; margin-bottom: 1mm; }
  .vprint .vpar { margin-bottom: 0; }
  .vprint .vpar ol { gap: 0.8mm; }
  .vprint .vpar li { font-size: 8.4pt; line-height: 1.32; grid-template-columns: 6mm 1fr; }
  .vprint .vtab.vstat td, .vprint .vtab.vstat th.lbl { padding: 1mm 1.8mm; height: auto; font-size: 8.2pt; line-height: 1.25; }

/* ---------- Querformat (Vorschau und Druck): Checklisten laufen in zwei Spalten ---------- */
.vd.quer { max-width: 1120px; }
.vd.quer .vbody, .vprint.quer .vbody { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; align-items: start; }
.vd.quer .vbody > :not(.vp), .vprint.quer .vbody > :not(.vp) { grid-column: 1 / -1; }
.vprint.quer .vbody { gap: 3mm 8mm; }
.doc-bar .seg { margin: 0; }

  .vprint.quer .vh { padding-bottom: 2mm; margin-bottom: 2.5mm; }
  .vprint.quer .vbody { gap: 2mm 8mm; }
  .vprint.quer .vf .val.ta { min-height: 6mm; }
  .vprint.quer .vp li { padding: .6mm 2.5mm; }
  .vprint.quer .vfoot { margin-top: 2mm; }

/* ---------- Mappen-Stil: dieselben Schriften wie die Mappe (Inter + Inter Display Black Italic), kräftig ---------- */
.vd .vh-t h1, .vd .vsec, .vd .vr-t, .vd .vpar h3, .vprint .vh-t h1, .vprint .vsec, .vprint .vr-t, .vprint .vpar h3 { font-family: var(--head); font-style: italic; font-weight: 900; }
.vprint { font-weight: 500; }
.vprint .vf > span, .vd .vf > span { font-weight: 600; }
.vprint .vh-t small { font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.vprint .vh-m dd, .vprint .vfoot { font-weight: 600; }
.vprint .vp .cl-t { font-weight: 600; }
.vprint .vtab thead th, .vprint .vtab th.lbl { font-weight: 600; }
.vprint .vtab tr.grp th { font-family: var(--head); font-style: italic; font-weight: 900; }
/* Druckmappe: eine Seite je Blatt, automatisch eingepasst */
.pfit { position: relative; overflow: hidden; break-after: page; page-break-after: always; }
.pfit:last-child { break-after: auto; page-break-after: auto; }
.pfit > .vprint { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
@page { size: A4 portrait; margin: 11mm 11mm 13mm 11mm; }
/* Notfallkarte als Druckblatt */
.vprint .pocket { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4mm; }
.vprint .pk { border: 0.3mm solid #556; border-radius: 1.5mm; padding: 3mm 3.5mm; font-size: 9pt; line-height: 1.3; background: #fff; break-inside: avoid; }
.vprint .pk h3 { font: italic 900 11pt/1.2 var(--head); margin: 0 0 1.5mm; display: flex; gap: 2mm; align-items: center; }
.vprint .pk p { margin: 0 0 1.2mm; } .vprint .pk ol { margin: 0; padding-left: 4.5mm; } .vprint .pk li { margin: 0.6mm 0; }
.vprint .pk-red { border-color: #b00; } .vprint .pk-red h3, .vprint .pk-112 { color: #b00; }
.vprint .pk-112 { font: italic 900 30pt/1 var(--head); margin: 0 0 1.5mm; }
.vprint .pk-wide { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 6mm; }
.vprint .pk-qr svg { width: 26mm; height: 26mm; } .vprint .pk .muted { color: #556; font-size: 8pt; }
.vprint .tbc { background: none; border: 0; padding: 0; color: #444; }
/* Druckmappe-Karte */
.dm { margin: 0 0 22px; }
.dm h2 { display: flex; align-items: center; gap: 10px; font-size: 20px; margin: 0 0 4px; }
.dm .chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.dm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 4px 16px; margin: 6px 0 12px; }
.dm-list .chk { padding: 6px 0; }
