/* =============================================================================
   Sanitätsdienst-Planung – zentrales Stylesheet
   Aufbau: Schrift → Tokens → Basis → Gerüst → Bausteine → Seiten → Media Queries
   Grundsatz: ruhiges, dichtes Arbeitswerkzeug. Eine Akzentfarbe, sparsam eingesetzt.
   ============================================================================= */

/* ---------- Schrift (selbst gehostet, SIL OFL – siehe fonts/OFL-LICENSE.txt) ---------- */
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/source-sans-3-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(fonts/source-sans-3-latin-600-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/source-sans-3-latin-700-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/source-sans-3-latin-ext-400-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(fonts/source-sans-3-latin-ext-600-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/source-sans-3-latin-ext-700-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- Tokens (Rollen, nicht Farbnamen) ---------- */
:root {
  --ink: #1b1f24;
  --muted: #5b626d;          /* 6,1:1 auf Weiß, 5,6:1 auf --bg */
  --line: #e6e8eb;
  --line-strong: #cfd4da;
  --bg: #f3f4f6;
  --card: #ffffff;
  --hover: #f7f8f9;
  --brand: #e30613;          /* Rotkreuz-Rot */
  --brand-ink: #b0000e;      /* Text/Links in Akzentfarbe, 6,7:1 auf Weiß */
  --brand-tint: #fdeced;
  --dark: #23272e;           /* Seitenleiste, Primärschaltfläche, aktive Segmente */
  --dark-2: #2f343c;
  --dark-3: #3b414a;
  --dark-muted: #a9b0ba;
  --focus: #ff3b47;

  --ok-bg: #e5f3e9;    --ok: #1d6431;
  --minor-bg: #fff3d4; --minor: #6e4b00;
  --major-bg: #fde4e2; --major: #9a1a12;
  --info-bg: #e4eefa;  --info: #0b4a85;
  --closed: #a8160f;

  --r-ctl: 4px;
  --r-card: 6px;
  --font: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-family: var(--font); font-size: 15px; line-height: 1.45; color: var(--ink); font-variant-numeric: tabular-nums; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); }
h1 { font-size: 23px; font-weight: 600; margin: 0; line-height: 1.25; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 10px; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 8px; }
p { margin: 0 0 10px; }
a { color: var(--brand-ink); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
code { background: var(--bg); border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; font-size: 13px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
img, svg { vertical-align: middle; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Hilfsklassen */
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { align-items: flex-end; }
.stack { display: grid; gap: 12px; align-content: start; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.right, .num { text-align: right; }
.pre { white-space: pre-line; }
.full { grid-column: 1 / -1; }
.mt { margin-top: 12px; }
.mt-lg { margin-top: 28px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Gerüst ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 250px; flex: none; background: var(--dark); color: #fff;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; padding: 16px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; padding: 2px 6px 12px; }
.brand-logo { width: 36px; height: 36px; border-radius: 4px; background: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 15px; letter-spacing: .5px; color: #fff; }
.brand-name { font-weight: 700; line-height: 1.2; }
.brand-sub { font-size: 12px; color: var(--dark-muted); line-height: 1.25; }
.env-hint { margin: 0 6px 12px; border: 1px solid #c99a2e; color: #ffd57a; border-radius: 4px; font-size: 12px; font-weight: 600; padding: 3px 8px; }
.nav { display: grid; gap: 2px; margin: 4px 0 16px; }
.nav a {
  display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 12px;
  color: #e6e9ed; text-decoration: none; border-radius: 4px; position: relative;
}
.nav a:hover { background: var(--dark-2); }
.nav a[aria-current="page"] { background: var(--dark-3); font-weight: 600; color: #fff; }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background: var(--brand); }
.nav a[aria-current="page"] .icon { color: #ff5a63; }
.quick { padding: 0 6px; margin-bottom: 16px; }
.quick label { display: block; font-size: 12px; color: var(--dark-muted); font-weight: 600; margin-bottom: 4px; }
.quick input { width: 100%; background: var(--dark-2); border: 1px solid var(--dark-3); color: #fff; }
.quick input::placeholder { color: var(--dark-muted); }
.userbox { margin-top: auto; border-top: 1px solid var(--dark-3); padding: 12px 6px 0; display: grid; gap: 4px; }
.userbox a { color: #fff; font-weight: 600; text-decoration: none; }
.userbox .linkbtn { color: var(--dark-muted); padding: 0; min-height: 32px; justify-content: flex-start; }
.userbox .linkbtn:hover { color: #fff; }

.main { flex: 1; min-width: 0; padding: 22px 28px 56px; }
.main-inner { max-width: 1400px; margin: 0 auto; }

.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; margin-bottom: 16px; }
.pagehead .titles { flex: 1; min-width: 260px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.crumbs a { color: var(--muted); }
.crumbs span[aria-hidden] { margin: 0 4px; }
.pagehead .sub { color: var(--muted); margin-top: 2px; font-size: 14px; }
.pagehead .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- Bausteine: Karten ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px 18px; margin-bottom: 16px; min-width: 0; }
.card.flush { padding: 0; }
.card.accent { border-top: 3px solid var(--brand); }
.card.accent-info { border-top: 3px solid var(--info); }
.cardhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.cardhead h2 { margin: 0; flex: 1; }
.card > .cardhead { margin: -16px -18px 12px; }
.card.flush > .cardhead { margin: 0; }
.cardbody { padding: 12px 18px; }
.cardfoot { padding: 10px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.items { margin: 0; padding: 0; list-style: none; }
.item { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.item:first-child { padding-top: 0; }
.item:last-child { border-bottom: 0; padding-bottom: 0; }
.item .grow { flex: 1; min-width: 180px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; }
.grid.narrow { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid > * { min-width: 0; }
.grid > .card { margin-bottom: 0; }
.grid + .card, .grid + section, .grid + .grid { margin-top: 16px; }

/* Kennzahlenleiste */
.stats { display: flex; flex-wrap: wrap; padding: 0; }
.stats > * { flex: 1 1 140px; display: flex; align-items: baseline; gap: 8px; padding: 12px 18px; color: inherit; text-decoration: none; border-right: 1px solid var(--line); }
.stats > *:last-child { border-right: 0; }
.stats a:hover { background: var(--hover); }
.stats .val { font-size: 24px; font-weight: 600; line-height: 1.1; }
.stats .lbl { color: var(--muted); font-size: 13px; }

/* Kennwertlisten */
dl.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 6px 16px; margin: 0; }
dl.kv dt { color: var(--muted); font-size: 13px; padding-top: 1px; }
dl.kv dd { margin: 0; min-width: 0; }

/* ---------- Tabellen ---------- */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; }
table.list th, table.list td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.list th:first-child, table.list td:first-child { padding-left: 0; }
table.list th:last-child, table.list td:last-child { padding-right: 0; }
.card.flush table.list th:first-child, .card.flush table.list td:first-child { padding-left: 18px; }
.card.flush table.list th:last-child, .card.flush table.list td:last-child { padding-right: 18px; }
table.list thead th { font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
table.list tbody tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover td { background: var(--hover); }
table.list td.num, table.list th.num { text-align: right; white-space: nowrap; width: 1%; }
table.list td.num { color: var(--muted); }
table.list td.actions { text-align: right; white-space: nowrap; width: 1%; }
table.list .main-col { width: 100%; max-width: 0; }
.cell-title { font-weight: 600; color: var(--ink); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.cell-title:hover { text-decoration: underline; }
.cell-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.list tr.group th { background: var(--bg); color: var(--ink); font-size: 13px; font-weight: 600; padding-top: 10px; border-bottom: 1px solid var(--line); }
table.list tr.mark td:first-child { box-shadow: inset 3px 0 0 var(--info); }
table.list tr.struck td { color: var(--muted); }
table.list tr.struck .cell-title { text-decoration: line-through; color: var(--muted); }
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]::after { content: "⇅"; margin-left: 4px; color: var(--line-strong); font-weight: 400; }
th[aria-sort="ascending"]::after { content: "↑"; color: var(--ink); }
th[aria-sort="descending"]::after { content: "↓"; color: var(--ink); }
.tabletools { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.tablefoot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
table.kvt td { padding: 6px 0; border-bottom: 1px solid var(--line); }
table.kvt td:last-child { text-align: right; }
table.kvt tr.sum td { border-top: 2px solid var(--ink); border-bottom: 0; font-weight: 600; }

/* ---------- Schaltflächen ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 14px; border-radius: var(--r-ctl);
  font: 600 14px/1.2 var(--font); text-decoration: none; cursor: pointer;
  background: var(--card); color: var(--ink); border: 1px solid var(--line-strong); white-space: nowrap;
}
.btn:hover { background: var(--hover); border-color: #b9c0c8; }
.btn-primary { background: var(--dark); color: #fff; border-color: var(--dark); }
.btn-primary:hover { background: #111418; border-color: #111418; }
.btn-accent { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-accent:hover { background: #c40510; border-color: #c40510; }
.btn-danger { color: var(--major); border-color: #f2b8b3; }
.btn-danger:hover { background: var(--major-bg); border-color: #e9918a; }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn-icon { width: 38px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.linkbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 6px; background: none; border: 0; font: 600 14px var(--font); color: var(--brand-ink); cursor: pointer; text-decoration: none; }
.linkbtn:hover { text-decoration: underline; }
.linkbtn.danger { color: var(--major); }
form.inline { display: inline; }

/* Segmentauswahl */
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); overflow: hidden; background: var(--card); flex-wrap: wrap; }
.seg > a, .seg > button { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; text-decoration: none; color: var(--ink); font: 600 14px var(--font); background: none; border: 0; border-right: 1px solid var(--line); cursor: pointer; }
.seg > *:last-child { border-right: 0; }
.seg > a:hover { background: var(--hover); }
.seg > [aria-current="true"], .seg > .active { background: var(--dark); color: #fff; }
.seg .count { font-weight: 400; color: var(--muted); }
.seg > [aria-current="true"] .count { color: #c9ced6; }

/* ---------- Formulare ---------- */
label { font-size: 13px; font-weight: 600; color: var(--muted); }
label.field { display: grid; gap: 4px; min-width: 0; align-content: start; }
input, select, textarea {
  font: 400 15px var(--font); color: var(--ink); background: #fff;
  border: 1px solid var(--line-strong); border-radius: var(--r-ctl);
  padding: 7px 10px; min-height: 38px; max-width: 100%;
}
textarea { min-height: 70px; resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--brand); }
input:disabled, select:disabled, textarea:disabled { background: var(--bg); color: var(--muted); }
label.field input, label.field select, label.field textarea { width: 100%; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--dark); }
label.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; color: var(--ink); font-size: 15px; min-height: 32px; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; }
.formgrid .full { grid-column: 1 / -1; }
fieldset { border: 1px solid var(--line); border-radius: var(--r-card); padding: 10px 14px 14px; margin: 0; min-width: 0; }
legend { font-size: 13px; font-weight: 600; color: var(--ink); padding: 0 4px; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.filterbar { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; margin-bottom: 16px; }
.filterbar .search { flex: 1 1 260px; }
.filterbar .search input { width: 100%; }
.formactions { position: sticky; bottom: 0; background: var(--card); border-top: 1px solid var(--line); margin: 16px -18px -16px; padding: 12px 18px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; border-radius: 0 0 var(--r-card) var(--r-card); }
input.num, .num input { text-align: right; }
input.w-xs { width: 5rem; }
input.w-sm { width: 7rem; }
.hint { font-size: 13px; color: var(--muted); }

/* ---------- Status und Hinweise ---------- */
.badge { display: inline-block; font-size: 12.5px; font-weight: 600; border-radius: 3px; padding: 1px 7px; white-space: nowrap; line-height: 1.5; text-decoration: none; }
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-minor { background: var(--minor-bg); color: var(--minor); }
.b-major { background: var(--major-bg); color: var(--major); }
.b-info { background: var(--info-bg); color: var(--info); }
.b-closed { background: var(--closed); color: #fff; }
.b-neutral { background: var(--bg); color: var(--muted); border: 1px solid var(--line); padding: 0 6px; }
.tag { display: inline-block; font-size: 13px; background: var(--brand-tint); border: 1px solid #f5b9bd; color: var(--brand-ink); border-radius: 3px; padding: 0 6px; }
.flash { padding: 10px 14px; border-left: 3px solid currentColor; border-radius: var(--r-ctl); margin-bottom: 16px; }
.flash a { color: inherit; font-weight: 600; }
.flash-success { background: var(--ok-bg); color: var(--ok); }
.flash-warning, .flash-info { background: var(--minor-bg); color: var(--minor); }
.flash-error { background: var(--major-bg); color: var(--major); }
.empty { color: var(--muted); padding: 6px 0; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 50; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--dark); color: #fff; border-radius: var(--r-card); padding: 10px 14px; box-shadow: 0 6px 20px rgba(0,0,0,.18); border-left: 3px solid var(--ok-bg); }
.toast.error { border-left-color: #ff8a80; }

dialog { border: 0; border-radius: var(--r-card); padding: 20px; max-width: min(600px, calc(100vw - 32px)); box-shadow: 0 12px 40px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(20, 22, 26, .4); }

/* ---------- Seite: Veranstaltungen ---------- */
.staff { display: inline-flex; gap: 4px; }

/* ---------- Seite: Auftrag ---------- */
.anchors { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; margin: -6px 0 16px; }
.anchors a { color: var(--muted); }
.section-head { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 8px 0; margin: 12px 0 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.section-head h2 { margin: 0; flex: 1; }
.maurer-figures { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--r-card); margin: 8px 0; overflow: hidden; }
.maurer-figures > div { padding: 8px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; align-items: baseline; gap: 6px; margin: 0 -1px -1px 0; }
.maurer-figures .val { font-size: 22px; font-weight: 600; }
.maurer-figures .lbl { font-size: 13px; color: var(--muted); }
table.positions td { padding: 6px 6px; vertical-align: middle; }
table.positions td:first-child { padding-left: 18px; }
table.positions td:last-child { padding-right: 18px; }
table.positions input, table.positions select { min-height: 34px; padding: 5px 8px; }
table.positions .label-in { width: 100%; min-width: 280px; }
.totals-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; padding: 12px 18px; }
.doc-row .grow { min-width: 200px; }
.event-block { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.event-block:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }

/* ---------- Seite: Anmeldung ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(400px, 100%); }
.login-card .brand { color: var(--ink); padding: 0 0 16px; }
.login-card .brand-sub { color: var(--muted); }

/* ---------- Media Queries ---------- */
@media (max-width: 1100px) {
  .grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .side { position: static; height: auto; width: auto; padding: 12px; }
  .brand { padding-bottom: 8px; }
  .nav { display: flex; flex-wrap: wrap; margin-bottom: 8px; }
  .nav a { min-height: 44px; }
  .nav a[aria-current="page"]::before { left: 6px; right: 6px; top: auto; bottom: 0; width: auto; height: 3px; }
  .quick { margin-bottom: 8px; }
  .userbox { margin-top: 4px; grid-auto-flow: column; justify-content: start; gap: 16px; align-items: center; }
  .main { padding: 16px 16px 48px; }
}
@media (max-width: 760px) {
  table.list.cards thead { display: none; }
  table.list.cards tr { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 10px 18px; border-bottom: 1px solid var(--line); }
  table.list.cards tr.group { display: block; padding: 0; }
  table.list.cards td { display: block; border: 0; padding: 0 !important; width: auto !important; max-width: none !important; text-align: left; }
  table.list.cards td.c-lead { grid-row: span 3; color: var(--muted); font-size: 13px; }
  table.list.cards td.c-empty { display: none; }
  table.list.cards tr:hover td { background: none; }
}
@media (max-width: 640px) {
  .filterbar > *, .filterbar .search { flex: 1 1 100%; }
  .pagehead .actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .pagehead .actions > * { width: 100%; }
  .section-head, .formactions, .side { position: static; }
  .stats > * { flex-basis: 50%; border-bottom: 1px solid var(--line); }
}
@media print {
  .side, .pagehead .actions, .filterbar, .anchors, form button { display: none !important; }
  .main { padding: 0; }
  .card { border: 0; padding: 0; }
}

/* Nachträge: aktive Kennzahl, Kopfzeilen-Formulare */
.stats > [aria-current="true"] { box-shadow: inset 0 -3px 0 var(--brand); }
.stats > [aria-current="true"] .val { color: var(--ink); }
.cardhead .field input { min-width: 220px; }
.cardhead form, .cardhead .row { margin: 0; }
details summary { cursor: pointer; }
del { text-decoration-color: var(--muted); }
.cardbody.empty { padding: 12px 18px; }

/* Reiter (Auftrag): Linie unten, aktiver Reiter mit 3 px Akzentbalken */
.tabs { display: flex; flex-wrap: wrap; gap: 0 4px; border-bottom: 1px solid var(--line-strong); margin-bottom: 16px; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; margin-bottom: -1px;
  color: var(--muted); font-weight: 600; text-decoration: none; border-bottom: 3px solid transparent; }
.tabs a:hover { color: var(--ink); background: var(--hover); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brand); }
.tabs .count { font-weight: 400; color: var(--muted); font-size: 13px; }
@media (max-width: 640px) {
  .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tabs a { white-space: nowrap; }
}
.signature-preview { border: 1px dashed var(--line-strong); border-radius: var(--r-card); padding: 12px; background: #fff; display: inline-block; }
.signature-img { max-height: 90px; max-width: 100%; }
input[type="file"] { padding: 6px; }
.items a[aria-current="true"] { color: var(--brand-ink); }
.items a[aria-current="true"]::before { content: "› "; }

/* ---------- Systemseite: Auslastungsbalken ---------- */
.meterrow { display: flex; align-items: center; gap: 10px; margin: 4px 0 6px; }
meter { flex: 1; height: 12px; min-width: 120px; border-radius: 6px; background: var(--line); border: 0; appearance: none; -webkit-appearance: none; }
meter::-webkit-meter-bar { background: var(--line); border: 0; border-radius: 6px; height: 12px; }
meter::-webkit-meter-optimum-value { background: var(--ok); border-radius: 6px; }
meter::-webkit-meter-suboptimum-value { background: #b7841c; border-radius: 6px; }
meter::-webkit-meter-even-less-good-value { background: var(--major); border-radius: 6px; }
meter:-moz-meter-optimum::-moz-meter-bar { background: var(--ok); }
meter:-moz-meter-sub-optimum::-moz-meter-bar { background: #b7841c; }
meter:-moz-meter-sub-sub-optimum::-moz-meter-bar { background: var(--major); }
meter::-moz-meter-bar { border-radius: 6px; }

/* ---------- Öffentliches Formular (QR-Code Laufzettel) ---------- */
.public-card { width: min(560px, 100%); }
.formgrid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-error { color: var(--major); font-size: 0.9em; }
[aria-invalid="true"] { border-color: var(--major); }
.check span { line-height: 1.35; }
.public-card .btn-primary { width: 100%; justify-content: center; padding-block: 12px; }

/* ---------- Rückmeldung nach dem Dienst (Handy zuerst) ---------- */
.rp h1 { font-size: 1.45rem; margin: 0 0 8px; }
.rp-event { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface, #fff); margin-bottom: 14px; }
.rp-event span { color: var(--muted); font-size: 0.95rem; }
.rp-form { display: grid; gap: 14px; }
.rp-sec { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface, #fff); }
.rp-sec h2 { font-size: 1.05rem; margin: 0; }
.rp-sec .hint { margin: 0; }
.rp-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rp input, .rp textarea, .rp select { font-size: 16px; min-height: 44px; }   /* kein Zoom auf iOS */
.rp-members { display: grid; gap: 8px; }
.rp-member { display: grid; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.rp-member.is-off { background: var(--hover); }
.rp-member.is-off .rp-name { color: var(--muted); text-decoration: line-through; }
.rp-toggle { display: flex; align-items: center; gap: 10px; min-height: 40px; font-weight: 600; }
.rp-toggle input[type=checkbox] { width: 24px; height: 24px; min-height: 0; flex: none; accent-color: var(--ink); }
.rp-newname { flex: 1; font-weight: 400; }
.rp-times { display: grid; grid-template-columns: 1fr auto 1fr auto; align-items: center; gap: 6px; }
.rp-times input { width: 100%; }
.rp-times input.is-own { border-color: var(--ink); font-weight: 600; }
.rp-times input:disabled { opacity: 0.45; }
.rp-hours { font-size: 0.85rem; color: var(--muted); min-width: 64px; text-align: right; }
.rp-add { width: 100%; justify-content: center; min-height: 44px; }
.rp-stepper { display: grid; grid-template-columns: 44px 1fr 44px; gap: 6px; }
.rp-stepper button { min-height: 44px; font-size: 1.3rem; border: 1px solid var(--line); border-radius: 6px; background: var(--hover); color: var(--ink); }
.rp-stepper button[hidden] { display: none; }
.rp-stepper input { text-align: center; }
.rp-stepper:has(button[hidden]) { grid-template-columns: 1fr; }
.rp-confirm { display: flex; gap: 10px; align-items: flex-start; line-height: 1.35; }
.rp-confirm input { width: 24px; height: 24px; min-height: 0; flex: none; margin-top: 2px; accent-color: var(--ink); }
.rp-submit { position: sticky; bottom: 0; padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg, #f3f4f6) 30%); }
.rp-submit .btn { width: 100%; justify-content: center; min-height: 50px; font-size: 1.05rem; }
.public-card:has(.rp) { width: min(560px, 100%); }
@media (max-width: 380px) { .rp-times { grid-template-columns: 1fr auto 1fr; } .rp-hours { grid-column: 1 / -1; text-align: left; } }
html:has(.rp) { scroll-padding-bottom: 110px; scroll-padding-top: 16px; }
