/* StemCare
   Leitmotiv: Tag 0. Die rote Raute der Stammzellgabe taucht in Marke, Timeline und Kalender auf;
   alles andere bleibt ruhig und klinisch. */
:root {
  --paper: #f3f5f2;
  --surface: #ffffff;
  --ink: #1b2733;
  --muted: #5c6b77;
  --line: #d9dfda;
  --grid: #e8ece8;
  --side: #1f3040;
  --side-ink: #c9d5de;
  --primary: #176b5e;
  --primary-dark: #11554b;
  --d0: #d3293e;
  --amber: #e7a416;
  --ok: #2e7d5b;
  --bad: #b3261e;
  --radius: 6px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.45 var(--font); color: var(--ink); background: var(--paper); font-variant-numeric: tabular-nums; }
h1, h2 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.muted { color: var(--muted); }
.lede { color: var(--muted); margin-top: 4px; max-width: 70ch; }
.code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; }
.form-error { color: var(--bad); min-height: 1.4em; font-size: 13px; }

/* ---------------------------------------------------------------- Rahmen */
.shell { display: grid; grid-template-columns: 220px 1fr; height: 100vh; }
.side { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; padding: 20px 14px; }
.brand, .brand-lg { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.brand { color: #fff; font-size: 15px; padding: 0 8px 22px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button {
  text-align: left; background: none; border: 0; color: var(--side-ink);
  padding: 9px 10px; border-radius: var(--radius); cursor: pointer; border-left: 3px solid transparent;
}
.nav button:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav button.on { background: rgba(255, 255, 255, 0.1); color: #fff; border-left-color: var(--d0); }
.me { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding: 0 8px; font-size: 13px; }
.me strong { color: #fff; font-weight: 600; }
.me span { opacity: 0.75; margin-bottom: 8px; }
.me .link { color: var(--side-ink); text-align: left; }
.main { overflow: auto; padding: 26px 32px 40px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar.left { justify-content: flex-start; margin-top: 12px; }
.back { margin-bottom: 8px; padding-left: 0; }

/* ---------------------------------------------------------------- Bedienelemente */
.btn {
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius);
  padding: 7px 14px; cursor: pointer; line-height: 1.3;
}
.btn:hover { border-color: #b8c1ba; background: #fafbfa; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.danger { color: var(--bad); border-color: #e6c3c0; }
.btn.danger:hover { background: #fdf3f2; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.ghost { border-color: transparent; background: none; color: var(--primary); }
.btn.ghost:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: default; }
.push { margin-left: auto; }
.link { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

input[type="text"], input[type="password"], input[type="date"], input[type="number"], input[type="search"], input[type="email"], input[type="tel"], input[type="url"], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius); padding: 7px 10px; background: var(--surface);
}
.toolbar input[type="search"], .toolbar select { width: auto; min-width: 190px; }
input:disabled, select:disabled, textarea:disabled { background: #f2f4f2; color: var(--ink); opacity: 1; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.seg-btn { background: none; border: 0; padding: 7px 14px; cursor: pointer; }
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn.on { background: var(--side); color: #fff; }

.check { display: flex; align-items: center; gap: 8px; }
.check.inline { font-size: 13px; color: var(--muted); }
.legend.tp span::before, .legend.cs span::before, .legend.ms span::before, .legend.tk span::before {
  content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 6px; vertical-align: -1px;
}
.legend.tp span::before { background: var(--d0); transform: rotate(45deg); }
.legend.ms span::before { background: var(--primary); border-radius: 50%; }
.legend.tk span::before { background: var(--amber); border-radius: 2px; }

.chip { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: #e9edf0; color: #33424f; white-space: nowrap; }
.chip.big { font-size: 13px; padding: 4px 12px; }
.chip.pr-high { background: #fbeed3; color: #7a5200; }
.chip.pr-urgent { background: #f9dde0; color: #8f1d2c; }
.chip.pr-low { background: #eef0f2; color: #5c6b77; }
.chip.tk-todo { background: #e4e9f2; color: #2c4a7a; }
.chip.tk-doing { background: #fbeed3; color: #7a5200; }
.chip.tk-review { background: #ece5f4; color: #55337a; }
.chip.tk-done { background: #e3f0e6; color: #1f6a3f; }

/* ---------------------------------------------------------------- Tabellen, Panels, Listen */
.tbl { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tbl th { text-align: left; font-weight: 600; font-size: 13px; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfa; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--grid); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #f6f9f7; }
.empty-cell { text-align: center; color: var(--muted); padding: 28px; }
.row-actions { white-space: nowrap; text-align: right; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 8px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; white-space: pre-wrap; }

.rows { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: auto 1fr 130px 150px auto; align-items: center; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--grid); }
.row:last-child { border-bottom: 0; }
.row.done .row-title { color: var(--muted); text-decoration: line-through; }
.row-rel { color: var(--muted); font-size: 13px; }
.row-date.late, .due.late { color: var(--bad); font-weight: 600; }
.empty { text-align: center; padding: 64px 20px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty p { color: var(--muted); margin-top: 6px; }

/* ---------------------------------------------------------------- Timeline */
.tl { --rowh: 66px; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); max-height: calc(100vh - 170px); }
.tl-inner { position: relative; min-width: max-content; }
.tl-row { display: flex; height: var(--rowh); border-bottom: 1px solid var(--grid); }
.tl-row:last-of-type { border-bottom: 0; }
.tl-headrow { height: 48px; position: sticky; top: 0; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--line); }
.tl-label {
  position: sticky; left: 0; z-index: 3; flex: none; width: var(--lw); text-align: left;
  background: var(--surface); border: 0; border-right: 1px solid var(--line);
  padding: 8px 14px; display: flex; flex-direction: column; justify-content: center; gap: 2px; cursor: pointer;
}
.tl-label:hover { background: #f6f9f7; }
.tl-corner { cursor: default; color: var(--muted); font-size: 13px; justify-content: flex-end; }
.tl-corner:hover { background: var(--surface); }
.tl-name { font-weight: 600; }
.tl-sub { display: flex; align-items: center; gap: 8px; }
.tl-kind { font-size: 12px; color: var(--muted); }
.tl-track {
  position: relative; flex: none;
  background-image: linear-gradient(to right, var(--grid) 1px, transparent 1px);
  background-size: calc(7 * var(--ppd)) 100%;
}
.tl-axis { background-image: none; }
.tl-month { position: absolute; top: 4px; padding-left: 6px; font-weight: 600; font-size: 13px; border-left: 1px solid var(--line); height: 20px; overflow: hidden; white-space: nowrap; }
.tl-tick { position: absolute; bottom: 4px; padding-left: 3px; font-size: 11px; color: var(--muted); border-left: 1px solid var(--grid); }
.tl-today-tag { position: absolute; top: 26px; transform: translateX(-50%); font-size: 11px; font-weight: 600; background: var(--amber); color: #3b2a00; padding: 0 6px; border-radius: 8px; }
.tl-today { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--amber); z-index: 2; pointer-events: none; opacity: 0.85; }
.tl-bar { position: absolute; top: 31px; height: 8px; border-radius: 4px; background: #c9d6e6; }
.tl-ms {
  position: absolute; top: 28px; width: 14px; height: 14px; margin-left: -7px; padding: 0; cursor: pointer;
  border-radius: 50%; background: var(--surface); border: 2px solid var(--primary);
}
.tl-ms.done { background: var(--primary); }
.tl-ms.late { border-color: var(--bad); background: #fbe3e1; }
.tl-ms:hover { transform: scale(1.25); }
.tl-ms.has-ico { top: 25px; width: 20px; height: 20px; margin-left: -10px; display: flex; align-items: center; justify-content: center; color: var(--primary); }
.tl-ms.has-ico.done { color: #fff !important; }
.tl-ms.has-ico.late { color: var(--bad); }
.tl-ms .ms-ico { display: block; }
.ev .ms-ico { vertical-align: -2px; margin-right: 3px; }
.ms-ico-wrap { display: inline-flex; vertical-align: -3px; margin-right: 6px; color: var(--primary); }
.ms-ico-wrap .ico { width: 15px; height: 15px; }
.icon-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-opt { min-width: 36px; height: 36px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line, #cfd8e3); border-radius: 8px; background: var(--surface); color: var(--text, inherit); cursor: pointer; }
.icon-opt:hover { border-color: var(--primary); }
.icon-opt[aria-pressed="true"] { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary) inset; color: var(--primary); }
.icon-none { font-size: 12px; }
.tl-d0 {
  position: absolute; top: 26px; width: 18px; height: 18px; margin-left: -9px; padding: 0; cursor: pointer;
  background: var(--d0); border: 2px solid var(--surface); transform: rotate(45deg); z-index: 1;
}
.tl-d0-date { position: absolute; top: 6px; transform: translateX(-50%); font-size: 11px; font-weight: 600; color: var(--d0); }

/* ---------------------------------------------------------------- Kalender */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--surface); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.dow { padding: 8px 10px; font-size: 13px; font-weight: 600; color: var(--muted); background: #fafbfa; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.day { min-height: 112px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.day.other { background: #f8f9f8; }
.day.other .dnum { color: #a2adb5; }
.day.today { box-shadow: inset 0 0 0 2px var(--amber); }
.dnum { font-size: 12px; color: var(--muted); }
.day.today .dnum { color: #3b2a00; font-weight: 700; }
.ev { text-align: left; border: 0; cursor: pointer; padding: 2px 6px; font-size: 12px; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.ev.tp { background: #fbe3e0; color: #8f1d2c; font-weight: 600; }
.ev.cs { background: transparent; color: #8f1d2c; border: 1.5px dashed var(--d0); font-weight: 600; }
.ev.tp { border-left: 4px solid var(--d0); }
.ev.ms { background: #dcebe8; color: #0f4b41; border-left: 3px solid var(--primary); }
.ev.tk { background: #fbeed3; color: #5c3f00; border-left: 3px solid var(--amber); }
.ev.done { opacity: 0.55; text-decoration: line-through; }

/* ---------------------------------------------------------------- Kanban */
.board { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 14px; align-items: start; }
.col { background: #e9eee9; border-radius: var(--radius); padding: 10px; }
.col > header { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; }
.col > header .btn { margin-left: auto; }
.count { background: #d4dcd5; border-radius: 10px; padding: 0 8px; font-size: 12px; color: var(--muted); }
.col-body { display: flex; flex-direction: column; gap: 8px; min-height: 90px; border-radius: 4px; padding: 2px; }
.col-body.over { outline: 2px dashed var(--primary); outline-offset: -2px; background: color-mix(in srgb, var(--primary) 6%, transparent); }
.card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid #aeb9b2; border-radius: 5px; padding: 9px 11px; cursor: pointer; }
.card:hover { border-color: #b8c1ba; }
.card[draggable="true"] { cursor: grab; }
.card.drag { opacity: 0.45; }
.card.prio-high { border-left-color: var(--amber); }
.card.prio-urgent { border-left-color: var(--d0); }
.card.prio-low { border-left-color: #d3dad5; }
.card-title { font-weight: 550; overflow-wrap: anywhere; }
.card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 7px; font-size: 12px; color: var(--muted); }
.avatar { margin-left: auto; width: 24px; height: 24px; border-radius: 50%; background: var(--side); color: #fff; font-size: 11px; display: grid; place-items: center; }

/* ---------------------------------------------------------------- Dialoge, Formulare */
dialog.modal { border: 0; border-radius: 8px; padding: 24px 26px; width: min(600px, 92vw); box-shadow: 0 18px 50px rgba(20, 30, 40, 0.3); color: var(--ink); }
dialog.modal::backdrop { background: rgba(20, 30, 40, 0.45); }
dialog.modal h2 { margin-bottom: 14px; font-size: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field.check { flex-direction: row; align-items: center; gap: 8px; }
.field .lbl { font-size: 13px; color: var(--muted); }
.field small { color: var(--muted); font-size: 12px; }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.actions .push { margin-right: auto; margin-left: 0; }
form > .lede { margin-bottom: 14px; }

#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--side); color: #fff; padding: 10px 16px; border-radius: var(--radius); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); max-width: 420px; }
.toast.error { background: var(--bad); }

/* ---------------------------------------------------------------- Anmeldung */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--side); }
.auth-card { width: min(420px, 100%); background: var(--surface); border-radius: 8px; padding: 30px 32px; display: flex; flex-direction: column; gap: 14px; }
.brand-lg { font-size: 15px; color: var(--ink); margin-bottom: 4px; }
.auth-card h1 { font-size: 20px; }
.auth-foot { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; margin-top: 4px; }
.auth-foot .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%; }
.admin-body .panel-head .lede { margin: 0; }

/* ---------------------------------------------------------------- Durchsuchbares Dropdown */
.combo { position: relative; min-width: 0; }
.toolbar .combo { width: 250px; }
.combo-input { width: 100%; }
.combo-list {
  position: absolute; z-index: 60; top: 100%; left: 0; right: 0; min-width: 100%;
  margin: 3px 0 0; padding: 4px 0; list-style: none; max-height: 260px; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(20, 30, 40, 0.18);
}
.combo-list[hidden] { display: none; }
.combo-opt, .combo-none { padding: 6px 10px; cursor: pointer; overflow-wrap: anywhere; }
.combo-none { color: var(--muted); cursor: default; }
.combo-opt.on { background: #e3efec; }
.combo-opt.sel { font-weight: 600; }

/* ---------------------------------------------------------------- Spender und Untersuchungen */
.chip.ds-angefragt { background: #fbeed3; color: #7a5200; }
.chip.ds-verfuegbar { background: #e1f0ee; color: #12574c; }
.chip.ds-freigegeben { background: #e3f0e6; color: #1f6a3f; font-weight: 600; }
.chip.ds-nicht_verfuegbar { background: #eceaea; color: #6b5a5a; }
.card.ds-angefragt { border-left-color: var(--amber); }
.card.ds-verfuegbar { border-left-color: var(--primary); }
.card.ds-freigegeben { border-left-color: var(--ok); }
.card.ds-nicht_verfuegbar { border-left-color: #c3c9c5; }
.card.ds-nicht_verfuegbar .card-title { color: var(--muted); }

.chip.res-negativ, .chip.res-unauffaellig { background: #e3f0e6; color: #1f6a3f; }
.chip.res-positiv { background: #fbeed3; color: #7a5200; }
.chip.res-grenzwertig { background: #fbeed3; color: #7a5200; }
.chip.res-auffaellig { background: #f9dde0; color: #8f1d2c; }
.chip.res-ausstehend { background: #e9edf0; color: #4c5b66; }
.tbl td.wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.combo-input {
  padding-right: 28px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235c6b77' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center;
}

.toolbar.filters { margin-bottom: 14px; }
.th-sort { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: inherit; cursor: pointer; white-space: nowrap; }
.th-sort:hover { color: var(--ink); }
.admin-body > .lede { margin-bottom: 14px; }

.field[hidden] { display: none; }
.tabs-row { margin-bottom: 14px; }
.seg.wrap { flex-wrap: wrap; }

.prewrap { white-space: pre-wrap; margin: 0; line-height: 1.5; }
.chip.dg-erstdiagnose { background: #e1ecf7; color: #1d4f7d; }
.chip.dg-rezidiv { background: #f9dde0; color: #8f1d2c; }
.row.dash { grid-template-columns: 76px 1fr 160px 120px 90px 90px 86px; }
.row.dash .row-title { text-align: left; justify-self: start; }
.small { font-size: 12px; }
input[type="color"] { height: 36px; padding: 2px 4px; cursor: pointer; }

.form-sub { font-weight: 600; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.hla-block + .hla-block { margin-top: 22px; }
.hla-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.hla-actions { display: flex; gap: 8px; }
.hla-tbl { max-width: 860px; }
.hla-locus { text-align: left; font-weight: 600; }
.hla-cell { font-variant-numeric: tabular-nums; }
.hla-cell.hla-mm { background: #f9dde0; color: #8f1d2c; font-weight: 700; box-shadow: inset 3px 0 0 #c0392b; }
.chip.hla-ok { background: #e3f0e6; color: #1f6a3f; }
.chip.hla-warn { background: #fbeed3; color: #7a5200; }
.chip.hla-bad { background: #f9dde0; color: #8f1d2c; }
.chip.hla-unk { background: #e9edf0; color: #4c5b66; }

/* Logo und Navigationsbaum */
.logo { display: block; flex: none; border-radius: 8px; }
.brand-lg .logo { border-radius: 9px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-parent { display: flex; align-items: center; gap: 8px; }
.nav-parent.active-group { color: #fff; }
.nav-parent .caret { width: 0; height: 0; border-left: 5px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform 0.12s; }
.nav-parent[aria-expanded="true"] .caret { transform: rotate(90deg); }
.nav-sub { display: flex; flex-direction: column; gap: 1px; margin-left: 16px; padding-left: 8px; border-left: 1px solid rgba(255, 255, 255, 0.16); }
.nav-sub[hidden] { display: none; }
.nav .nav-sub button { padding: 6px 10px; font-size: 13px; }
.nav button[aria-current="page"] { font-weight: 600; }
.multi { display: flex; flex-direction: column; gap: 4px; max-height: 190px; overflow: auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.multi-opt { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.brand .logo { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22); }

/* ---------------------------------------------------------------- Regeleditor, Farbwahl */
.rules-box { margin-top: 28px; }
.cond-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.cond-row { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1.2fr) auto; gap: 6px; align-items: center; }
.cond-row.sc-row { grid-template-columns: minmax(0, 1.4fr) minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.2fr) auto; }
.cond-row select[hidden], .cond-row input[hidden] { display: none; }
.color-pick { display: flex; align-items: center; gap: 10px; }
.ms-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: baseline; }
.chip.arch { background: #e4e7ea; color: #4a5560; font-size: 11px; margin-left: 6px; }
.chip.auto { background: #e7eefb; color: #274a8a; font-size: 11px; margin-left: 6px; }

/* Kalender: Woche und Jahr */
.cal.week .day { min-height: 340px; }
.cal.week .dnum { font-weight: 600; color: var(--text, #1d2a30); }
.legend.cs span::before { background: transparent; border: 2px dashed var(--d0); border-radius: 3px; }
.year { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.mini { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.mini-title { border: 0; background: none; font-weight: 700; font-size: 14px; cursor: pointer; padding: 2px 4px; text-transform: capitalize; color: inherit; }
.mini-title:hover { text-decoration: underline; }
.mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-top: 6px; }
.mdow { font-size: 11px; color: var(--muted); text-align: center; }
.mday { border: 0; background: none; cursor: pointer; font-size: 12px; padding: 2px 0 1px; border-radius: 4px; min-height: 30px; display: flex; flex-direction: column; align-items: center; color: inherit; }
.mday:hover { background: #eef2ef; }
.mday.has { font-weight: 700; background: #f3f6f4; }
.mday.today { box-shadow: inset 0 0 0 2px var(--amber); }
.dots { display: flex; gap: 2px; margin-top: 2px; }
.dot { width: 6px; height: 6px; border-radius: 50%; border: 1.5px solid transparent; display: inline-block; box-sizing: border-box; }
.dot.tk { border-radius: 1px; }

.io-result { margin-top: 18px; }
.io-result ul { padding-left: 20px; }

.tbl tr.done td { opacity: 0.6; }
.task-list { max-width: 100%; }

/* Status-Voraussetzungen */
.checklist { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.checklist li { display: flex; gap: 8px; align-items: baseline; }
.checklist .mark { font-weight: 700; width: 1.2em; text-align: center; }
.checklist li.ok .mark { color: #1f8f5a; }
.checklist li.open .mark { color: #c0392b; }
.ok-text { color: #1f8f5a; font-weight: 600; }

/* v11: einklappbares HLA-Panel, dynamische Status */
details.collapsible > summary.panel-head { cursor: pointer; list-style: none; margin-bottom: 0; flex-wrap: wrap; gap: 8px 12px; }
details.collapsible > summary.panel-head::-webkit-details-marker { display: none; }
details.collapsible > summary.panel-head::before { content: '\25B8'; color: var(--muted, #6b7a90); transition: transform .15s; }
details.collapsible[open] > summary.panel-head::before { transform: rotate(90deg); }
details.collapsible[open] > summary.panel-head { margin-bottom: 12px; }
.hla-sum { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: auto; font-size: 13px; }
.chip.dyn { font-weight: 600; margin-left: 4px; border: 1px solid currentColor; }
.dyn-box { display: inline-flex; gap: 4px; }

.nav button { display: flex; align-items: center; gap: 10px; }
.nav .ico { flex: none; opacity: 0.85; }
.nav .nav-sub button { gap: 8px; }
.nav .nav-sub .ico { width: 14px; height: 14px; }

/* v11: Spender-Panel, Konditionierungs-Raute, Transplantationsliste */
.sp-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(220px, 2fr); gap: 24px; align-items: start; }
.sp-side { display: flex; flex-direction: column; gap: 16px; }
.sp-blood { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.sp-diag > strong { display: block; margin-bottom: 4px; }
.tbl.compact td { padding: 4px 8px; }
@media (max-width: 1100px) { .sp-grid { grid-template-columns: 1fr; } }
.tl-cs {
  position: absolute; top: 26px; width: 16px; height: 16px; margin-left: -8px; padding: 0; cursor: pointer;
  background: #f2c230; border: 2px solid var(--surface); transform: rotate(45deg); z-index: 1;
}
.tl-cs-date { position: absolute; top: 46px; transform: translateX(-50%); font-size: 11px; font-weight: 600; color: #a77b00; }

/* v12: Historie */
dialog.modal.wide { width: min(1000px, 94vw); }
.hist-tools { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; margin-bottom: 12px; }
.hist-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; max-height: 60vh; }
.hist-list { list-style: none; margin: 0; padding: 0; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.hist-item { width: 100%; text-align: left; background: none; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; cursor: pointer; }
.hist-item:hover { background: color-mix(in srgb, var(--primary) 5%, white); }
.hist-item.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 9%, white); }
.hist-detail { overflow: auto; }
.hist-detail h3 { font-size: 15px; margin: 0 0 4px; }
.hist-old { color: #8a3b34; background: #fbeceb; }
.hist-new { color: #1d6b43; background: #e9f6ee; }
.hist-actions { margin-top: 14px; }
.hist-tools label { display: inline-flex; align-items: center; gap: 8px; }

/* v13: kompakte Milestones/Aufgaben in der Transplantationsdetailansicht */
.mt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; margin-bottom: 16px; }
.mt-grid > .panel { margin-bottom: 0; }
@media (max-width: 1250px) { .mt-grid { grid-template-columns: 1fr; } }
.panel.compact { padding: 12px 14px; }
.panel.compact .panel-head { margin-bottom: 6px; }
.panel.compact h2 { font-size: 15px; }
.panel.compact .rows .row { padding: 3px 0; font-size: 13px; gap: 8px; }
.panel.compact .chip { font-size: 11px; padding: 1px 7px; }
.btn.icon-only { padding: 3px 6px; }
.panel.compact .rows .row { grid-template-columns: auto minmax(0, 1fr) auto auto auto; }
.panel.compact .row-rel { min-width: 0; }
[hidden] { display: none !important; }
