/* ÖzMed.SOP — Muster 2 „Kanzlei": Marineblau, kühler Grund, tiefblaue Seitenleiste.
   Formsprache aus ÖzMed.plan V2: Systemschrift, EINE Radius-Skala (Karten 14,
   Felder und Knöpfe 8), EINE Kontrollhöhe (38px), Farbe nur als Akzent. */
:root {
  --navy: #1e3a5f; --navy-dark: #16304f; --navy-mid: #2a4f7e; --navy-soft: #e8eef7; --navy-line: #cfdbea;
  --bg: #eff2f6; --card: #ffffff; --field: #ffffff;
  --text: #1c2735; --muted: #5c6a7d; --border: #dfe5ed;
  --green: #2e7d5b; --amber: #b9770b; --red: #c0392b;
  --green-soft: #e6f3ec; --amber-soft: #fdf3e0; --red-soft: #fbe9e7;
  --side-bg: #16304f; --side-text: #cfdcec; --side-muted: #9fb6d0; --side-active: rgba(255,255,255,.11); --side-line: rgba(255,255,255,.1);
  --side-w: 236px;
  --shadow: 0 1px 2px rgba(30,58,95,.05), 0 8px 24px rgba(30,58,95,.05);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  /* Flächen und Linien, die früher fest im CSS standen */
  --on-navy: #ffffff; --focus: #8fb3e0; --btn-hover: #f6f8fb;
  --surface-2: #f7f9fc; --surface-3: #f1f3f6; --th-bg: #eef1f5; --table-line: #c9d3df;
  --tag-bg: #eaeff6; --tag-text: #536073; --hinweis-bg: #f3f5f8; --baustein-bg: #fbfcfe;
  --green-line: #c5e3d3; --amber-line: #eedbb3; --red-line: #f0c9c4;
  --blue: #2a4f86; --blue-soft: #e6eef8; --blue-line: #c9d8ec;
  --dialog-shadow: 0 20px 60px rgba(20,30,45,.3); --backdrop: rgba(22,48,79,.45);
}
/* Dunkelmodus: die Seitenleiste bleibt marineblau, der Inhalt wird dunkelgrau-blau,
   Akzente heller. Das Attribut setzt ein Skript im Kopf von base.html vor dem ersten
   Zeichnen (Wahl „System / Hell / Dunkel" je Browser). PDFs bleiben hell. */
:root[data-theme="dark"] {
  --navy: #9ec1ec; --navy-dark: #7fa6d9; --navy-mid: #6f9ad6; --navy-soft: #223049; --navy-line: #35507a;
  --bg: #151b24; --card: #1d2530; --field: #19212c;
  --text: #e4e9f0; --muted: #97a4b6; --border: #2e3947;
  --green: #5cc492; --amber: #e0a94a; --red: #ef7a6a;
  --green-soft: #16302a; --amber-soft: #332a17; --red-soft: #3a2321;
  --shadow: 0 1px 2px rgba(0,0,0,.25), 0 8px 24px rgba(0,0,0,.25);
  --on-navy: #0e1726; --btn-hover: #27313d;
  --surface-2: #222c38; --surface-3: #27313d; --th-bg: #27313d; --table-line: #3a4655;
  --tag-bg: #27313d; --tag-text: #b4c0d0; --hinweis-bg: #222c38; --baustein-bg: #19212c;
  --green-line: #24503f; --amber-line: #55431f; --red-line: #5a2f2a;
  --blue: #9ec1ec; --blue-soft: #1f2d44; --blue-line: #34507a;
  --dialog-shadow: 0 20px 60px rgba(0,0,0,.6); --backdrop: rgba(0,0,0,.55);
}
* { box-sizing: border-box; }
html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--navy); }
h1 { font-size: 1.45rem; margin: 4px 0 18px; letter-spacing: -.015em; font-weight: 700; }
h2 { font-size: 1.02rem; margin: 0 0 10px; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: .95rem; margin: 0 0 6px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.ic { vertical-align: -3px; flex: none; }
.nur-vorlesen { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---------- Hülle ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { flex: 0 0 var(--side-w); width: var(--side-w); position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; background: var(--side-bg); color: var(--side-text); padding: 18px 12px 14px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; padding: 4px 4px 18px; color: inherit; }
.brand-mark img { width: 36px; height: 36px; display: block; flex: none; }
.brand-text { line-height: 1.15; }
.brand-text b { display: block; color: #f0f5fb; font-size: .95rem; letter-spacing: -.01em; }
.brand-text i { font-style: normal; font-size: .78rem; color: var(--side-muted); }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; }
.side-item { display: flex; align-items: center; gap: 11px; color: var(--side-text); text-decoration: none;
  padding: 10px 12px; border-radius: 10px; font-size: .95rem; border: none; background: transparent; font: inherit; cursor: pointer; width: 100%; text-align: left;
  transition: background 150ms var(--ease-out), color 150ms var(--ease-out), transform 150ms var(--ease-out); }
.side-item .ic { color: var(--side-muted); }
.side-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: hover) and (pointer: fine) {
  .side-item:hover { background: rgba(255,255,255,.07); color: #fff; }
  .side-item.logout:hover { background: rgba(192,57,43,.25); color: #fff; }
}
.side-item:active { transform: scale(.98); }
.side-item.active { background: var(--side-active); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 0 #8fb3e0; }
.side-item.active .ic { color: #fff; }
.side-item.quiet { color: var(--side-muted); font-size: .9rem; }
.side-item .nav-badge { margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 20px; background: #d4574a; color: #fff; font-size: .74rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.side-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--side-line); display: flex; flex-direction: column; gap: 2px; }
.side-foot form { margin: 0; }
.thema { display: flex; gap: 2px; padding: 3px; margin: 4px 0 6px; border-radius: 9px; background: rgba(255,255,255,.06); }
.thema button { flex: 1 1 0; height: 26px; border: none; border-radius: 7px; background: transparent; color: var(--side-muted); font: inherit; font-size: .74rem; font-weight: 600; cursor: pointer;
  transition: background 150ms var(--ease-out), color 150ms var(--ease-out); }
.thema button[aria-pressed="true"] { background: rgba(255,255,255,.14); color: #fff; }
@media (hover: hover) and (pointer: fine) { .thema button:hover { color: #fff; } }
.brand-text i { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 163px; }
main { flex: 1 1 auto; min-width: 0; padding: 26px 32px 60px; max-width: 1180px; }
main.allein { max-width: 460px; margin: 8vh auto 0; padding: 24px 20px; }

/* ---------- Kopf und Karten ---------- */
.kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.kopf h1 { margin: 0; }
.kopf .unter { color: var(--muted); font-size: .92rem; margin-top: 3px; }
.kopf .aktionen { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card.dicht { padding: 12px 14px; }
.cards2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 14px; align-items: start; }
.zeile { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.zeile.rechts { justify-content: flex-end; }
.abstand { margin-top: 14px; }
.hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }

/* ---------- Knöpfe und Felder ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font: inherit; font-size: .92rem; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background 150ms var(--ease-out), transform 120ms var(--ease-out), box-shadow 150ms var(--ease-out); }
.btn:hover { background: var(--btn-hover); }
.btn:active { transform: translateY(1px); }
.btn.primaer { background: var(--navy); border-color: var(--navy); color: var(--on-navy); }
.btn.primaer:hover { background: var(--navy-mid); }
.btn.gefahr { color: var(--red); }
.btn.gefahr:hover { background: var(--red-soft); }
.btn.klein { height: 30px; padding: 0 10px; font-size: .84rem; }
.btn.leise { border-color: transparent; background: transparent; color: var(--muted); }
.btn.leise:hover { background: var(--navy-soft); color: var(--navy); }
.btn:disabled { opacity: .5; cursor: default; }
label { display: block; font-size: .88rem; font-weight: 600; margin: 0 0 5px; }
label .hilfe { font-weight: 400; color: var(--muted); }
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--border); border-radius: 8px; background: var(--field); color: var(--text); font: inherit; font-size: .95rem; }
textarea { height: auto; min-height: 96px; padding: 9px 11px; line-height: 1.5; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--navy-mid); }
.feld { margin-bottom: 14px; }
.felder2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 720px) { .felder2 { grid-template-columns: 1fr; } }
.kreuz { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: .92rem; margin: 4px 0; }
.kreuz input { width: 17px; height: 17px; margin: 0; accent-color: var(--navy); }
.kreuze { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.hinweis-text { font-size: .86rem; color: var(--muted); margin-top: 5px; }

/* ---------- Meldungen und Status ---------- */
.flashes { margin: 0 0 16px; }
.flash { padding: 12px 15px; border-radius: 10px; margin-bottom: 8px; background: var(--card); border-left: 5px solid var(--navy); box-shadow: var(--shadow); }
.flash.success { border-left-color: var(--green); }
.flash.error { border-left-color: var(--red); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 20px; font-size: .8rem; font-weight: 600; background: var(--navy-soft); color: var(--navy); border: 1px solid var(--navy-line); white-space: nowrap; }
.chip.gruen { background: var(--green-soft); color: var(--green); border-color: var(--green-line); }
.chip.gelb { background: var(--amber-soft); color: var(--amber); border-color: var(--amber-line); }
.chip.rot { background: var(--red-soft); color: var(--red); border-color: var(--red-line); }
.chip.grau { background: var(--surface-3); color: var(--muted); border-color: var(--border); }
.chip .sdot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.tag { display: inline-block; font-size: .78rem; padding: 2px 9px; border-radius: 20px; background: var(--tag-bg); color: var(--tag-text); border: 1px solid var(--border); margin: 2px 3px 2px 0; }
.tag.aussen { border-style: dashed; }
.nummer { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .82rem; font-weight: 600; letter-spacing: .02em; color: var(--navy); background: var(--navy-soft); padding: 3px 8px; border-radius: 5px; white-space: nowrap; }

/* ---------- SOP-Liste ---------- */
.gruppe-titel { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 22px 0 8px; }
.gruppe-titel:first-child { margin-top: 0; }
.sop-karte { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; text-decoration: none; color: inherit; }
.sop-karte .ttl { font-weight: 600; font-size: 1rem; }
.sop-karte .sub { color: var(--muted); font-size: .86rem; margin-top: 2px; }
.sop-karte .rechts { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.sop-karte:hover { border-color: var(--navy-line); }
.leer { text-align: center; padding: 48px 20px; color: var(--muted); }
.leer b { display: block; color: var(--text); font-size: 1.05rem; margin-bottom: 6px; }

/* ---------- Dokumentansicht ---------- */
.doku { display: grid; grid-template-columns: 250px 1fr; gap: 22px; align-items: start; }
@media (max-width: 960px) { .doku { grid-template-columns: 1fr; } .gliederung { position: static; } }
.gliederung { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; }
.gliederung a { display: block; text-decoration: none; color: var(--text); font-size: .88rem; padding: 5px 8px; border-radius: 6px; line-height: 1.35; }
.gliederung a:hover { background: var(--navy-soft); }
.gliederung a.e2 { padding-left: 22px; color: var(--muted); }
.gliederung .nr { color: var(--navy); font-weight: 600; margin-right: 6px; font-variant-numeric: tabular-nums; }
.deckblatt { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 20px; }
.deckblatt div b { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.abschnitt { padding: 6px 0 10px; scroll-margin-top: 16px; }
.abschnitt h2 { font-size: 1.18rem; color: var(--navy); margin: 22px 0 8px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.abschnitt h3 { font-size: 1.02rem; color: var(--navy); margin: 18px 0 6px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.abschnitt .meta { font-size: .78rem; color: var(--muted); font-weight: 400; margin-left: auto; display: flex; gap: 8px; align-items: center; }
.sop-absatz { margin: 0 0 10px; max-width: 78ch; }
.sop-hinweis { margin: 0 0 12px; padding: 10px 14px; background: var(--hinweis-bg); border-left: 3px solid var(--navy); border-radius: 0 8px 8px 0; max-width: 78ch; }
.sop-liste { margin: 0 0 12px; padding-left: 24px; max-width: 78ch; }
.sop-liste li { margin-bottom: 4px; }
.tabelle-rahmen { overflow-x: auto; margin: 0 0 14px; }
.sop-tabelle { border-collapse: collapse; width: 100%; font-size: .92rem; }
.sop-tabelle th, .sop-tabelle td { border: 1px solid var(--table-line); padding: 6px 9px; text-align: left; vertical-align: top; }
.sop-tabelle th { background: var(--th-bg); font-weight: 600; }
.sop-baustein { border: 1px dashed var(--navy-line); border-radius: 10px; padding: 8px 12px 2px; margin: 0 0 12px; background: var(--baustein-bg); }
.sop-baustein-kopf { font-size: .76rem; font-weight: 600; color: var(--navy); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
a.verweis { color: var(--navy); text-decoration: underline; text-decoration-color: var(--navy-line); text-underline-offset: 2px; }
a.verweis:hover { text-decoration-color: var(--navy); }
.verweis-fehlt { color: var(--red); font-weight: 600; }
.stichtag { border-bottom: 2px dotted var(--amber); font-weight: 600; color: var(--text); }
.faellig-zeile { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); }
.faellig-zeile:last-child { border-bottom: none; }
.faellig-zeile .was { font-size: .95rem; }
.faellig-zeile .wo { color: var(--muted); font-size: .84rem; }
.faellig-zeile form { margin: 0; }
.zustand { font-size: .74rem; font-weight: 700; padding: 1px 7px; border-radius: 20px; }
.zustand.neu { background: var(--green-soft); color: var(--green); }
.zustand.geaendert { background: var(--amber-soft); color: var(--amber); }
.entwurf-leiste { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: 12px; background: var(--amber-soft); border: 1px solid var(--amber-line); margin-bottom: 16px; }
.entwurf-leiste b { color: var(--amber); }
.abschnitt-werkzeuge { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.abschnitt-werkzeuge form { margin: 0; display: inline; }
.einfuegen { border: 1px dashed var(--border); border-radius: 10px; padding: 10px 12px; margin: 8px 0 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--baustein-bg); }
.einfuegen input[type=text] { width: auto; flex: 1 1 220px; }

/* ---------- Editor ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .editor { grid-template-columns: 1fr; } }
.editor-spalte { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.block { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; background: var(--card); }
.block-kopf { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--border); background: var(--surface-2); border-radius: 10px 10px 0 0; }
.block-kopf .art { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--navy); margin-right: auto; }
.block-kopf .btn.klein { height: 26px; padding: 0 8px; }
.block-inhalt { padding: 10px; }
.block-inhalt textarea { min-height: 70px; font-size: .95rem; }
.werkzeugleiste { display: flex; gap: 4px; margin-bottom: 6px; }
.werkzeugleiste .btn.klein { height: 26px; padding: 0 9px; font-size: .8rem; }
.tab-editor { overflow-x: auto; }
.tab-editor table { border-collapse: collapse; width: 100%; }
.tab-editor td, .tab-editor th { border: 1px solid var(--border); padding: 2px; vertical-align: top; }
.tab-editor th { background: var(--th-bg); }
.tab-editor textarea { min-height: 38px; height: 38px; padding: 6px 8px; font-size: .88rem; border: 1px solid transparent; border-radius: 6px; resize: vertical; }
.tab-editor textarea:focus { border-color: var(--navy-mid); }
.tab-editor .spalten-werkzeuge { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.block-neu { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 8px 0 4px; }
.block-neu span { font-size: .84rem; color: var(--muted); margin-right: 4px; }
.speichern-leiste { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; position: sticky; bottom: 0; background: var(--bg); padding: 12px 0 4px; border-top: 1px solid var(--border); margin-top: 10px; }
.speichern-leiste .stand { font-size: .86rem; color: var(--muted); }
.speichern-leiste .stand.offen { color: var(--amber); font-weight: 600; }
.vorschau { min-height: 200px; }
.vorschau h2 { color: var(--navy); font-size: 1.15rem; margin: 0 0 12px; }

/* ---------- Dialog ---------- */
dialog { border: none; background: var(--card); color: var(--text); border-radius: 14px; padding: 0; box-shadow: var(--dialog-shadow); width: min(640px, 94vw); }
dialog::backdrop { background: var(--backdrop); }
.dialog-kopf { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.dialog-kopf h2 { margin: 0; }
.dialog-inhalt { padding: 16px 18px; max-height: 60vh; overflow-y: auto; }
.dialog-fuss { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.ziel-liste a { display: block; padding: 6px 8px; border-radius: 6px; text-decoration: none; color: var(--text); font-size: .9rem; }
.ziel-liste a:hover { background: var(--navy-soft); }
.ziel-liste .nr { color: var(--navy); font-weight: 600; margin-right: 8px; font-variant-numeric: tabular-nums; }

/* ---------- Vergleich ---------- */
.vergleich { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 900px) { .vergleich { grid-template-columns: 1fr; } }
.vergleich pre { white-space: pre-wrap; font: inherit; font-size: .88rem; margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); line-height: 1.45; }
.vergleich .alt pre { background: var(--red-soft); border-color: var(--red-line); }
.vergleich .neu pre { background: var(--green-soft); border-color: var(--green-line); }
.vergleich b { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 4px; }

/* ---------- Tabellen der Verwaltung ---------- */
table.liste { border-collapse: collapse; width: 100%; font-size: .92rem; }
table.liste th, table.liste td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.liste th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
table.liste tr:last-child td { border-bottom: none; }
table.liste form { margin: 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
table.liste input[type=text] { width: auto; min-width: 140px; height: 32px; }

/* ---------- Anmeldung ---------- */
.anmeldung { text-align: center; margin-bottom: 18px; }
.anmeldung img { width: 72px; height: 72px; border-radius: 18px; background: var(--side-bg); padding: 8px; box-shadow: var(--shadow); }
.anmeldung h1 { margin: 12px 0 2px; }

/* ---------- schmal ---------- */
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar { position: static; width: 100%; height: auto; flex: none; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; }
  .brand { padding: 4px 6px; }
  .brand-text i { display: none; }
  .side-nav { flex-direction: row; flex-wrap: wrap; flex: 1 1 100%; }
  .side-item { width: auto; padding: 8px 11px; font-size: .9rem; }
  .side-foot { margin: 0; border: none; padding: 0; flex-direction: row; margin-left: auto; align-items: center; }
  .thema { margin: 0 6px 0 0; min-width: 150px; }
  main { padding: 16px 14px 40px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Kompetenzmatrix ---------- */
.reiter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.reiter a { text-decoration: none; color: var(--muted); padding: 6px 12px; border-radius: 20px; border: 1px solid var(--border); background: var(--card); font-size: .88rem; font-weight: 500; }
.reiter a.an { background: var(--navy); border-color: var(--navy); color: var(--on-navy); }
.matrix-rahmen { overflow-x: auto; }
table.matrix { border-collapse: collapse; width: 100%; font-size: .9rem; }
table.matrix th, table.matrix td { border: 1px solid var(--border); padding: 0; vertical-align: middle; }
table.matrix th { background: var(--th-bg); padding: 8px 10px; text-align: left; font-weight: 600; white-space: nowrap; }
table.matrix th.person { text-align: center; min-width: 96px; }
table.matrix td.taet { padding: 6px 10px; min-width: 240px; }
table.matrix td.zelle { text-align: center; min-width: 96px; }
table.matrix td.zelle button { width: 100%; height: 40px; border: none; background: transparent; font: inherit; font-size: .86rem; cursor: pointer; color: var(--muted); border-radius: 0; }
table.matrix td.zelle button.ja { color: var(--green); font-weight: 600; background: var(--green-soft); }
table.matrix td.zelle button.fehlt { color: var(--red); font-weight: 600; background: var(--red-soft); }
table.matrix td.zelle button:hover { outline: 2px solid var(--navy-mid); outline-offset: -2px; }
.befund { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.befund:last-child { border-bottom: none; }
.befund .was { font-size: .95rem; }
.befund .wo { color: var(--muted); font-size: .84rem; }

/* ---- Stufe 4: Vorschläge und Einreichungen (09.09.2026) ---- */
.chip.blau { background: var(--blue-soft); color: var(--blue); border-color: var(--blue-line); }
.vorschlag-karte { border-left: 4px solid var(--blue); }
.vorschlag-text { white-space: pre-wrap; font-size: .92rem; line-height: 1.5; margin: 6px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); max-width: 78ch; }
.vorschlag-kopf { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: .88rem; color: var(--muted); }
.vorschlag-kopf b { color: var(--text); }
.vorschlag-entscheid { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end; margin-top: 10px; }
.vorschlag-entscheid input[type=text] { min-width: 260px; }
.abschnitt-vorschlag { margin: 8px 0 12px; padding: 8px 12px; border-radius: 8px; background: var(--blue-soft); border: 1px solid var(--blue-line); font-size: .88rem; }
.abschnitt-vorschlag b { color: var(--blue); }
.abschnitt-vorschlag p { margin: 4px 0 0; white-space: pre-wrap; }

/* ---- Vorlagen: Formular-Bausteine (14.09.2026) ---- */
.sop-liste.ankreuz { list-style: none; padding-left: 4px; }
.sop-liste.ankreuz li::before { content: "\25A1"; margin-right: 8px; font-size: 1.1em; }
.sop-tabelle tr.leerzeile td { background: transparent; }
.unterschrift-zeile { display: flex; gap: 28px; flex-wrap: wrap; margin: 22px 0 14px; max-width: 78ch; }
.unterschrift-feld { flex: 1 1 180px; display: flex; flex-direction: column; gap: 4px; }
.unterschrift-feld span { border-bottom: 1px solid var(--text); height: 28px; }
.unterschrift-feld small { color: var(--muted); font-size: .8rem; }

/* ---- Import und Vorlagen (14.09.2026) ---- */
.ablage { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 16px; border: 1.5px dashed var(--navy-line); border-radius: 12px; background: var(--surface-2); cursor: pointer; text-align: center; }
.ablage input[type=file] { max-width: 100%; }
.import-abschnitt { border-bottom: 1px solid var(--border); padding: 8px 0; }
.import-abschnitt:last-child { border-bottom: none; }
.import-abschnitt summary { cursor: pointer; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.import-inhalt { padding: 8px 4px 4px 14px; }
.import-kind { margin: 10px 0 0; padding-left: 10px; border-left: 2px solid var(--border); }
.import-kind > b { display: block; margin-bottom: 4px; color: var(--navy); }
.gliederung a.aktiv-stand { background: var(--navy-soft); font-weight: 600; }
.doku > article { min-width: 0; }
.vorlage-blatt .sop-absatz, .vorlage-blatt .sop-hinweis { overflow-wrap: anywhere; }
.vorlage-blatt .sop-tabelle th, .vorlage-blatt .sop-tabelle td { min-width: 4.2em; }
.vorlage-blatt .tabelle-rahmen { overflow-x: auto; }
.gliederung .deckblatt a { display: inline; padding: 0; }
.felder-block { margin: 6px 0 16px; max-width: 78ch; }
.felder-zeile { display: flex; gap: 14px; margin-bottom: 10px; }
.feld-schreib { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.feld-schreib small { color: var(--muted); font-size: .8rem; }
.feld-schreib span { border-bottom: 1px solid var(--text); height: 26px; }
