/* Lageverfolgung – Grundstil. Farben als Tokens, hell/dunkel. */
:root {
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --bg: #f3f5f8;
  --panel: #ffffff;
  --panel-2: #f7f8fa;
  --group-bg: #eef1f5;
  --text: #1b2430;
  --muted: #5d6877;
  --line: #d9dee5;
  --line-soft: #e8ebf0;
  --line-strong: #aeb7c3;
  --accent: #2f5d8a;
  --accent-a: rgba(47, 93, 138, .18);
  --accent-t: #fff;
  --danger: #c62828;
  --warn-bg: #fff4d6;
  --warn-t: #7a5600;
  --shade-night: rgba(30, 50, 90, .07);
  --shade-we: rgba(120, 120, 120, .07);
  --now: #d62d2d;
  --hline: #e08a00;
  --shadow: 0 8px 28px rgba(15, 25, 40, .16);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1116; --panel: #151a21; --panel-2: #1a2029; --group-bg: #1c232d; --text: #e6eaf0; --muted: #98a3b2;
    --line: #29313c; --line-soft: #20262f; --line-strong: #3d4756; --accent: #6ea8e0; --accent-a: rgba(110, 168, 224, .22);
    --accent-t: #0b1520; --danger: #ff6b6b; --warn-bg: #3a2f10; --warn-t: #ffd572; --shade-night: rgba(0, 0, 0, .28);
    --shade-we: rgba(255, 255, 255, .03); --now: #ff5252; --hline: #ffb341; --shadow: 0 8px 28px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1116; --panel: #151a21; --panel-2: #1a2029; --group-bg: #1c232d; --text: #e6eaf0; --muted: #98a3b2;
  --line: #29313c; --line-soft: #20262f; --line-strong: #3d4756; --accent: #6ea8e0; --accent-a: rgba(110, 168, 224, .22);
  --accent-t: #0b1520; --danger: #ff6b6b; --warn-bg: #3a2f10; --warn-t: #ffd572; --shade-night: rgba(0, 0, 0, .28);
  --shade-we: rgba(255, 255, 255, .03); --now: #ff5252; --hline: #ffb341; --shadow: 0 8px 28px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1 { font-size: 22px; margin: 0 0 14px; }
h2 { font-size: 16px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.pad { padding: 24px; }
.spacer { flex: 1; }
.app { min-height: 100%; display: flex; flex-direction: column; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 7px;
  border: 1px solid var(--line-strong); background: var(--panel); cursor: pointer; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:disabled { opacity: .45; cursor: default; }
.btn:focus-visible, .seg-btn:focus-visible, .ico:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-t); font-weight: 600; }
.btn-danger { color: var(--danger); border-color: transparent; background: transparent; }
.btn-danger:hover:not(:disabled) { border-color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-xs { height: 24px; padding: 0 8px; font-size: 12px; }
.btn-icon { width: 30px; padding: 0; font-size: 16px; }
.btn-block { width: 100%; }
.btn[aria-pressed="true"] { background: var(--accent-a); border-color: var(--accent); }
.linkbtn { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; text-decoration: underline; }
.ico { width: 22px; height: 22px; border: 0; border-radius: 5px; background: transparent; cursor: pointer; color: var(--muted); font-size: 13px; line-height: 1; }
.ico:hover { background: var(--accent-a); color: var(--text); }

/* Kopfleiste */
.topbar { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line); flex: none; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; color: var(--text); text-decoration: none; letter-spacing: .2px; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: var(--accent);
  background-image: linear-gradient(var(--accent-t), var(--accent-t)), linear-gradient(var(--accent-t), var(--accent-t)), linear-gradient(var(--accent-t), var(--accent-t));
  background-size: 11px 2px, 15px 2px, 8px 2px; background-position: 4px 6px, 4px 10px, 4px 14px; background-repeat: no-repeat; }
.brand-lg { font-size: 20px; margin-bottom: 18px; }
.user { color: var(--muted); font-size: 13px; }
.pill { font-size: 12px; padding: 2px 9px; border-radius: 99px; }
.pill-warn { background: var(--warn-bg); color: var(--warn-t); font-weight: 600; }
.main { flex: 1; min-height: 0; }
.main-full { display: flex; flex-direction: column; }

/* Übersicht */
.dash { max-width: 1100px; margin: 0 auto; padding: 28px 16px 48px; display: grid; gap: 32px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.product { text-align: left; display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); cursor: pointer; min-height: 128px; }
.product:hover:not(:disabled) { border-color: var(--accent); box-shadow: var(--shadow); }
.product-name { font-weight: 700; font-size: 15px; }
.product-desc { color: var(--muted); font-size: 13px; flex: 1; }
.product-cta { color: var(--accent); font-weight: 600; font-size: 13px; }
.product.soon { cursor: default; opacity: .6; }
.product.soon .product-cta { color: var(--muted); }
.doc-list { display: grid; gap: 8px; }
.doc-card { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding-right: 10px; }
.doc-card:hover { border-color: var(--accent); }
.doc-link { flex: 1; display: grid; grid-template-columns: 130px 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; color: var(--text); text-decoration: none; }
.doc-type { font-size: 12px; font-weight: 600; color: var(--accent); }
.doc-name { font-weight: 600; }
.ico-del:hover { color: var(--danger); }
.empty-state { padding: 28px; text-align: center; background: var(--panel); border: 1px dashed var(--line-strong); border-radius: 10px; }
.note { font-size: 12px; color: var(--muted); border-left: 3px solid var(--line-strong); padding-left: 10px; margin: 0; }
@media (max-width: 640px) { .doc-link { grid-template-columns: 1fr; gap: 2px; } }

/* Login */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 19px; }
.auth-form { display: grid; gap: 12px; margin-top: 8px; }
.auth-links { display: flex; justify-content: space-between; margin-top: 14px; font-size: 13px; }
.auth-msg { color: var(--danger); font-size: 13px; min-height: 1em; }
.auth-msg.ok { color: var(--accent); }
.otp { font-size: 24px; letter-spacing: 8px; text-align: center; font-variant-numeric: tabular-nums; }
.qr { display: grid; place-items: center; background: #fff; border-radius: 10px; padding: 10px; width: max-content; margin: 8px auto; }
.secret code { word-break: break-all; font-size: 13px; }
.secret summary { cursor: pointer; font-size: 13px; color: var(--accent); }

/* Formulare */
.fld { display: grid; gap: 4px; min-width: 0; }
.fld-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.fld-hint { font-size: 12px; color: var(--muted); }
.fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .fld-row { grid-template-columns: 1fr; } }
input:not([type=checkbox]):not([type=radio]):not([type=color]), select, textarea {
  width: 100%; height: 36px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--panel-2); }
textarea { height: auto; resize: vertical; }
.chk { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.swatch { width: 24px; height: 24px; border-radius: 6px; border: 2px solid transparent; cursor: pointer; padding: 0; }
.swatch[aria-checked="true"] { border-color: var(--text); box-shadow: 0 0 0 2px var(--panel) inset; }
.swatch-none { width: auto; padding: 0 6px; font-size: 11px; background: var(--panel-2); border: 1px dashed var(--line-strong); }
.swatch-custom { width: 30px; height: 26px; border: 0; padding: 0; background: none; cursor: pointer; }
.tpl-list { display: grid; gap: 8px; }
.tpl { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.tpl:has(input:checked) { border-color: var(--accent); background: var(--accent-a); }
.tpl > span { display: grid; gap: 2px; }

/* Dialoge, Menü, Toast */
.dlg { border: 1px solid var(--line); border-radius: 12px; padding: 0; background: var(--panel); color: var(--text); width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow); }
.dlg::backdrop { background: rgba(10, 15, 25, .45); }
.dlg-form { padding: 20px; display: grid; gap: 14px; }
.dlg-title { margin: 0; font-size: 17px; }
.dlg-body { display: grid; gap: 12px; }
.dlg-text { margin: 0; }
.dlg-err { color: var(--danger); font-size: 13px; min-height: 0; }
.dlg-err:empty { display: none; }
.dlg-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.menu { position: fixed; z-index: 50; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow); padding: 5px; min-width: 230px; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.menu-item { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.menu-item:hover, .menu-item:focus { background: var(--accent-a); outline: none; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translate(-50%, 20px); opacity: 0; transition: .25s; z-index: 60;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; max-width: calc(100vw - 32px); box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-error { background: var(--danger); color: #fff; }

/* ---------- Synchromatrix ---------- */
.sm { flex: 1; min-height: 0; display: flex; flex-direction: column; height: calc(100vh - 52px); }
.sm-toolbar { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.sm-titles { display: grid; min-width: 180px; flex: 1; }
.doc-title { border: 1px solid transparent !important; background: transparent !important; font-size: 17px; font-weight: 700; height: 30px !important; padding: 0 6px !important; }
.doc-title:hover, .doc-title:focus { border-color: var(--line-strong) !important; }
.sm-sub { font-size: 12px; color: var(--muted); padding-left: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 7px; overflow: hidden; }
.seg-btn { border: 0; background: var(--panel); padding: 0 10px; height: 28px; cursor: pointer; font-size: 13px; border-right: 1px solid var(--line); }
.seg-btn:last-child { border-right: 0; }
.seg-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-t); font-weight: 600; }
.search { width: 150px !important; height: 30px !important; }
.save-status { font-size: 12px; color: var(--muted); min-width: 92px; text-align: right; }
.save-status[data-s="error"] { color: var(--danger); font-weight: 600; }
.save-status[data-s="saving"], .save-status[data-s="dirty"] { color: var(--hline); }
.classif { text-align: center; font-size: 11px; font-weight: 700; letter-spacing: 1.5px; padding: 3px; background: var(--panel-2); border-bottom: 1px solid var(--line); color: var(--muted); }

.sm-scroll { flex: 1; overflow: auto; position: relative; background: var(--panel); overscroll-behavior: contain; }
.sm-grid { position: relative; min-height: 100%; }
.sm-head { display: flex; position: sticky; top: 0; z-index: 8; background: var(--panel); border-bottom: 1px solid var(--line-strong); }
.sm-corner { position: sticky; left: 0; z-index: 9; width: var(--lw); flex: none; background: var(--panel); border-right: 1px solid var(--line-strong);
  display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 6px 8px; }
.corner-title { font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.sm-corner .btn { align-self: flex-start; }
.sm-scales { position: relative; flex: none; }
.scale { position: relative; }
.scale-top { height: 26px; border-bottom: 1px solid var(--line); }
.scale-tick { height: 34px; }
.scale .cell { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line); overflow: hidden; white-space: nowrap; padding: 0 6px;
  display: flex; align-items: center; font-size: 12px; }
.scale-top .cell { font-weight: 700; }
.scale-tick .cell { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }
.scale-tick .cell.we { color: var(--danger); }
.scale .two { line-height: 1.1; text-align: center; width: 100%; font-size: 11px; }
.minor-lbl { position: absolute; bottom: 3px; font-size: 9px; color: var(--muted); transform: translateX(-50%); opacity: .8; }

.sm-body { position: relative; }
.sm-bg { position: absolute; top: 0; bottom: 0; pointer-events: none; z-index: 1; }
.vl { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line-soft); }
.vl.minor { background: var(--line-soft); opacity: .55; }
.vl.major { background: var(--line-strong); }
.shade { position: absolute; top: 0; bottom: 0; }
.shade.night { background: var(--shade-night); }
.shade.weekend { background: var(--shade-we); }
.nowline { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--now); z-index: 3; }
.hline { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed var(--hline); z-index: 3; }
.hline span { position: sticky; top: 64px; display: inline-block; margin-left: 3px; font-size: 10px; font-weight: 800; color: var(--hline); }

.srow { display: flex; border-bottom: 1px solid var(--line-soft); position: relative; }
.srow-group { background: var(--group-bg); border-bottom-color: var(--line); }
.lbl { position: sticky; left: 0; z-index: 5; width: var(--lw); flex: none; background: var(--panel); border-right: 1px solid var(--line-strong);
  display: flex; align-items: center; gap: 7px; padding: 0 6px 0 10px; min-width: 0; }
.lbl-group { background: var(--group-bg); border-left: 4px solid var(--c); padding-left: 4px; font-weight: 700; }
.lbl-group .lbl-name { cursor: default; }
.caret { border: 0; background: none; cursor: pointer; width: 20px; color: var(--muted); padding: 0; }
.lbl-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbl-count { font-size: 11px; color: var(--muted); font-weight: 600; }
.lbl-text { display: grid; min-width: 0; flex: 1; line-height: 1.2; }
.lbl-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbl-lane { padding-left: 22px; cursor: default; }
.lbl-group .lbl-name { flex: 1; }
.dot { width: 9px; height: 9px; border-radius: 3px; background: var(--c); flex: none; }
.lbl-bell { font-size: 11px; margin-left: 4px; flex: none; }
.ntfy-topic { display: flex; gap: 8px; align-items: center; padding: 8px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; }
.ntfy-topic code { flex: 1; font-size: 15px; font-weight: 700; word-break: break-all; }
.lbl-acts { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: flex; gap: 2px; padding-left: 6px;
  background: inherit; opacity: 0; transition: opacity .12s; }
.lbl:hover .lbl-acts, .lbl:focus-within .lbl-acts { opacity: 1; }
@media (hover: none) { .lbl-acts { opacity: 1; } }

.track { position: relative; z-index: 2; flex: none; cursor: cell; touch-action: pan-x pan-y; }
.track-group { cursor: default; }
.ev { position: absolute; height: 20px; font: 600 12px var(--font); display: flex; align-items: center; cursor: grab; user-select: none; touch-action: none; }
.ev-bar { background: var(--c); color: var(--t); border-radius: 4px; box-shadow: 0 1px 2px rgba(0, 0, 0, .18); }
.ev-in { padding: 0 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; pointer-events: none; }
.ev-out { position: absolute; left: calc(100% + 4px); white-space: nowrap; color: var(--text); pointer-events: none; }
.ev-ms { width: 6px; background: var(--c); border-radius: 2px; }
.ev-ms .ev-out { left: 11px; }
.hdl { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; z-index: 1; }
.hdl-l { left: 0; } .hdl-r { right: 0; }
.prio1.ev-bar { outline: 2px solid var(--danger); outline-offset: 1px; }
.prio-badge { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: var(--danger); color: #fff; font-size: 10px; margin-right: 4px; }
.ist { position: absolute; height: 3px; border-radius: 2px; background: var(--st-ok); pointer-events: none; z-index: 1; }
.ist.late { background: var(--hline); }
.ist.run { background-image: repeating-linear-gradient(90deg, transparent 0 4px, rgba(255, 255, 255, .55) 4px 6px); }
.ev.ist-done.ev-bar { opacity: .8; }
.tip-ok { color: var(--st-ok); font-weight: 600; }
.tip-late { color: var(--hline); font-weight: 600; }
.ev.dim { opacity: .2; }
.ev.hit { outline: 2px solid var(--hline); outline-offset: 2px; }
.ev:focus-visible { outline: 2px solid var(--hline); outline-offset: 2px; z-index: 5; }
.ev.dragging { opacity: .85; z-index: 20; cursor: grabbing; box-shadow: var(--shadow); }
.ghost { position: absolute; top: 4px; bottom: 4px; background: var(--accent-a); border: 1px dashed var(--accent); border-radius: 4px; pointer-events: none; }
.empty { padding: 24px; position: sticky; left: 0; }
.sm-tip { position: fixed; z-index: 40; pointer-events: none; opacity: 0; transition: opacity .1s; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 11px; box-shadow: var(--shadow); font-size: 12px; max-width: 320px; display: grid; gap: 2px; }
.sm-tip.show { opacity: 1; }
.sm-tip strong { font-size: 13px; }
.tip-note { white-space: pre-wrap; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }

@media (max-width: 700px) {
  .sm-toolbar { gap: 8px; }
  .search { width: 110px !important; }
  .save-status { min-width: 0; }
}

/* KI-Erfassung */
.btn-ki { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.dlg-wide { width: min(760px, calc(100vw - 32px)); }
.ki textarea { min-height: 220px; font-size: 13px; line-height: 1.5; }
.ki-intro { margin: -6px 0 0; }
.ki-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ki-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13px; }
.ki-steps .btn { height: 28px; padding: 0 10px; font-size: 13px; margin-left: 4px; }
.ki-open { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ki-prov { width: auto !important; }
.ki-key summary { cursor: pointer; font-size: 13px; color: var(--accent); margin-bottom: 8px; }
.ki-busy { justify-items: center; text-align: center; padding: 36px 20px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
.ki-sum { margin: 0; }
.ki-hints { background: var(--warn-bg); color: var(--warn-t); border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.ki-hints ul { margin: 4px 0 0; padding-left: 18px; }
.ki-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); }
.ki-list { list-style: none; margin: 0; padding: 0; max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.ki-list li { border-bottom: 1px solid var(--line-soft); }
.ki-list li:last-child { border-bottom: 0; }
.ki-list label { display: grid; grid-template-columns: auto 150px 1fr; gap: 10px; align-items: start; padding: 8px 10px; cursor: pointer; }
.ki-list input { margin-top: 3px; }
.ki-time { font-variant-numeric: tabular-nums; font-size: 13px; white-space: nowrap; }
.ki-main { display: grid; gap: 1px; min-width: 0; }
.ki-new { color: var(--accent); font-style: normal; font-weight: 600; }
.ki-bad { opacity: .5; }
@media (max-width: 560px) { .ki-list label { grid-template-columns: auto 1fr; } .ki-time { grid-column: 2; } .ki-main { grid-column: 2; } }

/* ---------- Patientenübersicht ---------- */
:root { --p1: #c62828; --p2: #e0a000; --p3: #2e8b57; --p-t: #fff; --st-open: #2f5d8a; --st-res: #d9822b; --st-ok: #2e8b57; --st-dead: #4b5563; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --p1: #ef5350; --p2: #f2b84b; --p3: #4caf7a; --p-t: #0b1520; --st-open: #6ea8e0; --st-res: #f0a35a; --st-ok: #4caf7a; --st-dead: #9aa4b2; } }
:root[data-theme="dark"] { --p1: #ef5350; --p2: #f2b84b; --p3: #4caf7a; --p-t: #0b1520; --st-open: #6ea8e0; --st-res: #f0a35a; --st-ok: #4caf7a; --st-dead: #9aa4b2; }
.pt-zone { width: auto !important; height: 30px !important; padding: 0 8px !important; font-size: 13px; }
.pt-kpis { display: flex; gap: 8px; padding: 10px 12px; background: var(--panel-2); border-bottom: 1px solid var(--line); overflow-x: auto; flex: none; }
.pt-kpi { display: grid; min-width: 96px; padding: 6px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.pt-kpi b { font-size: 20px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.pt-kpi span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.pt-kpi.k-p1 { border-color: var(--p1); } .pt-kpi.k-p1 b { color: var(--p1); }
.pt-kpi.k-warn { border-color: var(--hline); } .pt-kpi.k-warn b { color: var(--hline); }
.pt-kpi.k-ok b { color: var(--st-ok); }
.pt-scroll { flex: 1; min-height: 0; overflow: auto; }
.pt-empty { margin: 24px; }
.pt-table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--panel); }
.pt-table th { position: sticky; top: 0; z-index: 1; background: var(--panel-2); text-align: left; font-size: 12px; color: var(--muted); font-weight: 600;
  padding: 8px 10px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.pt-sort { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.pt-sort:hover { color: var(--text); }
.pt-table td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.pt-row { cursor: pointer; }
.pt-row:hover, .pt-row:focus-visible { background: var(--accent-a); outline: none; }
.pt-row.st-gerettet, .pt-row.st-verstorben { color: var(--muted); }
.pt-row.is-overdue td:first-child { box-shadow: inset 4px 0 0 var(--hline); }
.pt-nr { font-weight: 700; white-space: nowrap; }
.pt-num { text-align: right; font-variant-numeric: tabular-nums; }
.pt-mono { font-variant-numeric: tabular-nums; }
.pt-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pt-note { max-width: 260px; }
.pt-late { color: var(--hline); font-weight: 700; font-size: 12px; }
.pt-none { text-align: center; padding: 20px !important; }
.pt-prio { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-weight: 700; color: var(--p-t); }
.pt-prio.p1 { background: var(--p1); } .pt-prio.p2 { background: var(--p2); color: #1b2430; } .pt-prio.p3 { background: var(--p3); }
.pt-st { white-space: nowrap; }
.pt-st .btn { margin-left: 6px; }
.pt-chip { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; border: 1px solid currentColor; }
.pt-chip.st-vermutet, .pt-chip.st-geortet { color: var(--st-open); }
.pt-chip.st-rettung { color: var(--st-res); }
.pt-chip.st-gerettet { color: var(--st-ok); }
.pt-chip.st-verstorben { color: var(--st-dead); }
.pt-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.pt-tin { display: flex; gap: 6px; }
.pt-tin input { min-width: 0; }
@media (max-width: 520px) { .pt-grid3 { grid-template-columns: 1fr 1fr; } }

/* ---------- Statusübersicht ---------- */
:root { --a-ok: #2e8b57; --a-ok-bg: rgba(46, 139, 87, .14); --a-warn: #a86f00; --a-warn-bg: rgba(224, 160, 0, .18); --a-bad: #c62828; --a-bad-bg: rgba(198, 40, 40, .14); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --a-ok: #4caf7a; --a-ok-bg: rgba(76, 175, 122, .18); --a-warn: #f2b84b; --a-warn-bg: rgba(242, 184, 75, .16); --a-bad: #ef5350; --a-bad-bg: rgba(239, 83, 80, .18); } }
:root[data-theme="dark"] { --a-ok: #4caf7a; --a-ok-bg: rgba(76, 175, 122, .18); --a-warn: #f2b84b; --a-warn-bg: rgba(242, 184, 75, .16); --a-bad: #ef5350; --a-bad-bg: rgba(239, 83, 80, .18); }
.st-scroll { flex: 1; min-height: 0; overflow: auto; }
.st-wrap { padding: 16px; display: grid; gap: 22px; max-width: 1500px; }
.st-sec h2 { margin: 0 0 8px; }
.st-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.st-h h2 { margin: 0; flex: 1; }
.st-tw { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.st-table, .st-list { border-collapse: collapse; font-size: 13px; width: 100%; }
.st-table th, .st-table td, .st-list th, .st-list td { border-bottom: 1px solid var(--line-soft); padding: 0; }
.st-table thead th { background: var(--panel-2); font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 8px; text-align: center; border-bottom: 1px solid var(--line-strong); }
.st-fh { min-width: 110px; border-left: 1px solid var(--line); }
.st-fh div { color: var(--text); font-size: 13px; }
.st-stand { display: block; font-weight: 400; font-size: 11px; }
.st-si th { font-size: 11px !important; padding: 3px 8px !important; }
.st-lbl { text-align: left !important; padding: 6px 10px !important; font-weight: 600; white-space: nowrap; min-width: 170px; position: sticky; left: 0; background: var(--panel); z-index: 1; }
thead .st-lbl { background: var(--panel-2); }
.st-sub .st-lbl { font-weight: 400; padding-left: 22px !important; color: var(--muted); }
.st-strong .st-lbl, .st-strong td { font-weight: 700; }
.st-cell { border-left: 1px solid var(--line-soft); }
.st-mittel .st-cell:nth-child(even) { border-left-color: var(--line); }
.st-in { width: 100% !important; min-width: 56px; height: 32px !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; text-align: center; font-variant-numeric: tabular-nums; padding: 0 4px !important; }
.st-in:focus { background: var(--accent-a) !important; outline: 2px solid var(--accent) !important; outline-offset: -2px; }
.st-calc { text-align: center; font-variant-numeric: tabular-nums; padding: 6px 8px !important; border-left: 1px solid var(--line-soft); background: var(--panel-2); white-space: nowrap; }
.st-tot { border-left: 2px solid var(--line-strong) !important; font-weight: 700; }
.a-ok { background: var(--a-ok-bg) !important; color: var(--a-ok); }
.a-warn { background: var(--a-warn-bg) !important; color: var(--a-warn); }
.a-bad { background: var(--a-bad-bg) !important; color: var(--a-bad); }
.st-ist.a-ok .st-in, .st-ist.a-warn .st-in, .st-ist.a-bad .st-in { color: inherit; font-weight: 700; }
.st-legend { margin: 6px 0 0; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.st-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-left: 6px; }
.st-dot.a-ok { background: var(--a-ok) !important; } .st-dot.a-warn { background: var(--a-warn) !important; } .st-dot.a-bad { background: var(--a-bad) !important; }
.st-cols { display: grid; grid-template-columns: 3fr 2fr; gap: 22px; align-items: start; }
@media (max-width: 1000px) { .st-cols { grid-template-columns: 1fr; } }
.st-list th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 7px 10px; background: var(--panel-2); }
.st-list td { padding: 7px 10px; vertical-align: top; }
.st-strongtxt { font-weight: 700; }
.st-acts { white-space: nowrap; text-align: right; }
.st-acts .btn { margin-right: 4px; }
.st-done td { color: var(--muted); text-decoration: line-through; }
.st-done .st-acts { text-decoration: none; }

/* Druck / PDF */
@media print {
  .st-scroll { overflow: visible !important; }
  .st-acts, .st-h .btn, .st-h .chk { display: none !important; }
  .st-lbl { position: static; }
  .a-ok, .a-warn, .a-bad, .st-dot { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pt-st .btn, .pt-kpis .k-warn { display: none !important; }
  .pt-scroll { overflow: visible !important; }
  .pt-table th { position: static; }
  .pt-prio, .pt-chip { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { size: A3 landscape; margin: 8mm; }
  .topbar, .sm-toolbar .sm-tools, .sm-toolbar > .btn, .lbl-acts, .sm-corner .btn, .nowline, .sm-tip { display: none !important; }
  body, .sm-scroll, .sm-head, .sm-corner, .lbl, .srow-group, .lbl-group { background: #fff !important; color: #000 !important; }
  .sm, .sm-scroll { height: auto !important; overflow: visible !important; }
  .sm-head { position: static; }
  .lbl, .sm-corner { position: static; }
  .ev-bar, .ev-ms, .ist, .shade, .dot, .prio-badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
