/* inkdoc – eigenes Stylesheet, keine externen Abhängigkeiten. Design abgeleitet vom Prototyp. */
:root {
  --bg: #F4F4F1; --card: #FFFFFF; --line: #E3E4DE; --line2: #EEEFEA; --text: #1C211E; --text2: #46504A;
  --muted: #6B746E; --accent: #2E7D5B; --accent-dark: #215C43; --accent-bg: #E3EFE8; --accent-line: #C9DED2;
  --warn: #7A4F00; --warn-bg: #FBEFD2; --bad: #9B2318; --bad-bg: #FBE3E0; --side: #FAFAF7;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 Manrope, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Layout */
.shell { display: flex; min-height: 100vh; }
.side { width: 232px; flex: none; display: flex; flex-direction: column; gap: 4px; padding: 18px 12px; border-right: 1px solid var(--line); background: var(--side); }
.side-logo { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); margin-top: auto; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 28px; border-bottom: 1px solid var(--line); background: #fff; }
.content { padding: 28px; display: flex; flex-direction: column; gap: 20px; }
.center { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.mobile-only { display: none; }
.scrim { position: fixed; inset: 0; z-index: 29; background: rgba(20, 24, 20, .45); }
.burger { display: none; width: 44px; height: 44px; padding: 10px; border: 0; background: none; border-radius: 10px; cursor: pointer; flex-direction: column; justify-content: center; gap: 5px; }
.burger span { display: block; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s; }
.burger:hover { background: #ECEDE8; }
@media (max-width: 760px) {
  /* Seitenleiste wird zur Schublade: außerhalb geparkt, fährt mit .nav-open von links herein */
  .side { position: fixed; top: 0; bottom: 0; left: 0; z-index: 30; width: min(280px, 85vw);
    transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 0 rgba(0,0,0,0); }
  body.nav-open .side { transform: translateX(0); box-shadow: 8px 0 32px rgba(0,0,0,.18); }
  body.nav-open { overflow: hidden; }
  .burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .mobile-only { display: inline; }
  .burger { display: flex; }  /* nach .mobile-only, damit flex gewinnt */
  .topbar { padding: 8px 12px; gap: 10px; }
  .topbar .in { display: none; }
  .content { padding: 16px; }
  h1 { font-size: 22px; }
}
}

/* Bausteine */
.logo { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.logo b { color: var(--accent); font-weight: 800; }
.logo-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.avatar { width: 34px; height: 34px; border-radius: 999px; background: var(--text); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; flex: none; }
.avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.nav { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 0 14px; border-radius: 10px; color: var(--text2); font-weight: 600; }
.nav:hover { background: #ECEDE8; color: var(--text); }
.nav.on { background: var(--accent-bg); color: var(--accent-dark); }
.lab { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.card.pad { padding: 18px 20px; }
.card.hint { border-color: var(--accent-line); background: #F3F8F5; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 10px; border: 1px solid #D9DBD4; background: #fff; color: var(--text); font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--bg); }
.btn-p { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-p:hover { background: var(--accent-dark); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn-link { background: none; border: 0; padding: 0; min-height: 0; color: var(--muted); font-size: 12px; cursor: pointer; }
.btn-link:hover { color: var(--text); background: none; }
.in { width: 100%; min-height: 46px; padding: 0 14px; border: 1px solid #D9DBD4; border-radius: 10px; background: #fff; }
.in:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.in.quiet { background: var(--bg); border-color: var(--bg); max-width: 420px; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.wrap { white-space: normal; padding: 8px 12px; }
.ok { color: var(--accent-dark); background: var(--accent-bg); }
.warn { color: var(--warn); background: var(--warn-bg); }
.bad { color: var(--bad); background: var(--bad-bg); }
.mute { color: var(--muted); background: var(--line2); }
.kpi { font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1; margin-top: 10px; }
.sub { color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 800; }
.title { font-size: 17px; font-weight: 800; }
.mt1 { margin-top: 4px; } .mt2 { margin-top: 8px; } .mt3 { margin-top: 12px; } .mt4 { margin-top: 16px; }
.mb2 { margin-bottom: 6px; } .mb4 { margin-bottom: 20px; }
.head { padding: 18px 20px 12px; }
.empty { padding: 0 20px 24px; color: var(--muted); font-size: 14px; }

[hidden] { display: none !important; }

/* Raster */
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: 2fr 1.4fr auto; }
@media (max-width: 1000px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.row.end { align-items: flex-end; }
.grow { flex: 1; min-width: 260px; }
.cols { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.cols > .wide { flex: 999 1 520px; min-width: 0; overflow: hidden; }
.cols > .narrow { flex: 1 1 300px; min-width: 280px; display: flex; flex-direction: column; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.panel { width: 100%; max-width: 480px; padding: 32px; text-align: left; }
.bar { width: 100%; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 10px; }
.bar > span { display: block; height: 100%; background: var(--accent); }
.progress-wrap { width: 180px; }

/* Tabellen */
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 520px; }
.th { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.td { font-size: 14px; padding: 12px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.td.right { text-align: right; }
.who { display: flex; align-items: center; gap: 10px; }
.who .name { display: block; font-weight: 700; }
.who .mail { display: block; font-size: 12px; color: var(--muted); }
.codebox { display: block; margin-top: 8px; padding: 12px; font-size: 13px; word-break: break-all; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.req { color: var(--bad); }
.row.nowrap { flex-wrap: nowrap; }
.row.nowrap .grow { min-width: 0; }

/* Sitzungs-Stepper */
.stepper { display: flex; gap: 6px; padding: 6px; border-radius: 12px; background: #E9EAE5; }
.step { display: flex; align-items: center; gap: 10px; flex: 1; padding: 12px 14px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--muted); }
.step.on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.step.done { color: var(--accent-dark); }
.num { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 999px; border: 2px solid currentColor; font-size: 13px; font-weight: 800; flex: none; }
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 760px) { .checks { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px; border: 1px solid #D9DBD4; border-radius: 10px; background: #fff; font-size: 15px; cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check .box { width: 22px; height: 22px; border-radius: 6px; border: 2px solid #B4B8AF; flex: none; }
.check:has(input:checked) { border-color: var(--accent); background: var(--accent-bg); }
.check:has(input:checked) .box { border-color: var(--accent); background: var(--accent); }
.sigwrap { position: relative; }
.sig { width: 100%; height: 140px; border: 2px dashed #C9CCC4; border-radius: 10px; background: #fff; touch-action: none; display: block; }
.sig.signed { border-style: solid; border-color: var(--accent); }
.sigwrap [data-clear] { position: absolute; right: 8px; bottom: 8px; }

/* Kalender-Tagesansicht */
.cal { display: grid; grid-template-columns: 64px repeat(var(--cols), minmax(180px, 1fr)); min-width: 100%; }
.cal-head { padding: 12px 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--side); }
.cal-head:first-child { border-left: 0; }
.cal-hours { border-right: 1px solid var(--line); }
.cal-hour { height: 60px; padding: 4px 8px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line2); }
.cal-col { position: relative; border-left: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0 59px, var(--line2) 59px 60px); }
.cal-item { position: absolute; left: 6px; right: 6px; padding: 6px 10px; border-radius: 8px; border-left: 4px solid; font-size: 13px; overflow: hidden; display: block; }
.cal-item.ok { background: var(--accent-bg); border-color: var(--accent-dark); }
.cal-item.warn { background: var(--warn-bg); border-color: var(--warn); }
.cal-item.bad { background: var(--bad-bg); border-color: var(--bad); }
.cal-item.mute { background: var(--line2); border-color: var(--muted); }

/* Materialauswahl in der Sitzung */
.units { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1000px) { .units { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .units { grid-template-columns: 1fr; } }
.unit { width: 100%; text-align: left; padding: 12px 14px; border-radius: 10px; border: 1px solid #D9DBD4; background: #fff; cursor: pointer; min-height: 96px; }
.unit:hover { border-color: var(--accent); background: var(--accent-bg); }
.unit.warn { border-color: #E8C77A; }

/* Körperkarte */
.bodymap { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.bm-view { width: 120px; }
.bm-area { position: relative; width: 120px; height: 260px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: crosshair; overflow: hidden; }
.bm-area svg { width: 100%; height: 100%; fill: #E9EAE5; stroke: #C9CCC4; stroke-width: .6; }
.bm-area:hover svg { fill: #E3EFE8; }
.bm-dot { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 999px; background: var(--bad); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--bad); display: none; pointer-events: none; }
.bm-side { display: flex; flex-direction: column; gap: 8px; align-self: center; }
.qrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line2); }
.qrow .seg { display: inline-flex; border: 1px solid #D9DBD4; border-radius: 10px; overflow: hidden; }
.qrow .seg label { padding: 0 16px; min-height: 42px; display: inline-flex; align-items: center; cursor: pointer; font-weight: 600; }
.qrow .seg input { position: absolute; opacity: 0; width: 0; height: 0; }
.qrow .seg label:has(input[value=nein]:checked) { background: var(--accent-bg); color: var(--accent-dark); }
.qrow .seg label:has(input[value=ja]:checked) { background: var(--bad-bg); color: var(--bad); }
.qrow .extra { grid-column: 1 / -1; display: none; gap: 10px; flex-wrap: wrap; align-items: center; padding: 6px 0 2px; }
.qrow:has(input[value=ja]:checked) .extra { display: flex; }

/* Handy: Listenzeilen dürfen umbrechen, Text bekommt die volle Breite (steht am Ende, damit es die
   Desktop-Regel .row.nowrap überstimmt) */
@media (max-width: 760px) {
  .row.nowrap { flex-wrap: wrap; }
  .row.nowrap .grow { flex-basis: 100%; }
}
