/* Mängelmelder – Grundlayout. System-Schriften, Hell/Dunkel nach Systemeinstellung. */

:root {
  color-scheme: light dark;
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-2: #eef1f4;
  --text: #16202a;
  --muted: #5a6672;
  --border: #d4dae0;
  --primary: #0d5bd7;
  --primary-hover: #0a4cb4;
  --on-primary: #ffffff;
  --focus: #ffb300;
  --red: #c4231c;
  --red-bg: #fdecea;
  --orange: #b35400;
  --orange-bg: #fff1e0;
  --green: #22783a;
  --green-bg: #e7f5ea;
  --blue-bg: #e7f0ff;
  --topbar: #0f2a44;
  --on-topbar: #ffffff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 4px 14px rgb(0 0 0 / .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --tap: 48px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1317;
    --surface: #171f26;
    --surface-2: #202a33;
    --text: #e5eaee;
    --muted: #9aa6b2;
    --border: #2e3a45;
    --primary: #5b9bff;
    --primary-hover: #7aafff;
    --on-primary: #071225;
    --red: #ff7066;
    --red-bg: #3b1b19;
    --orange: #ffa64d;
    --orange-bg: #3a2814;
    --green: #6fd283;
    --green-bg: #17321f;
    --blue-bg: #172a45;
    --topbar: #0a1a2a;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 4px 14px rgb(0 0 0 / .3);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.45 var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
}
img, video { max-width: 100%; }
a { color: var(--primary); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.sr-only, .visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.loading { padding: 3rem 1rem; text-align: center; color: var(--muted); }
.noscript { padding: 2rem; text-align: center; }

/* ---------- Kopfleiste */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: .5rem 1rem; flex-wrap: wrap;
  padding: .5rem max(1rem, env(safe-area-inset-right)) .5rem max(1rem, env(safe-area-inset-left));
  padding-top: max(.5rem, env(safe-area-inset-top));
  background: var(--topbar); color: var(--on-topbar);
}
.brand { display: flex; align-items: center; gap: .5rem; color: inherit; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.brand img { display: block; border-radius: 6px; }
.nav { display: flex; gap: .25rem; overflow-x: auto; flex: 1 1 auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 .85rem; border-radius: 999px;
  color: var(--on-topbar); text-decoration: none; white-space: nowrap; opacity: .85;
}
.nav a:hover { opacity: 1; background: rgb(255 255 255 / .1); }
.nav a.active { opacity: 1; background: rgb(255 255 255 / .18); font-weight: 600; }
.userbox { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.userbox a { color: var(--on-topbar); text-decoration: none; opacity: .9; font-size: .9rem; }
.userbox .btn { background: transparent; color: var(--on-topbar); border-color: rgb(255 255 255 / .35); }
@media (max-width: 720px) {
  .nav { order: 3; flex-basis: 100%; }
  .userbox .uname { display: none; }
}

/* ---------- Seiten */
.main { padding: 1rem max(1rem, env(safe-area-inset-left)) 3rem; }
.page { margin: 0 auto; }
.page.narrow { max-width: 720px; }
.page.wide { max-width: 1500px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem;
}
.stack > * + * { margin-top: .75rem; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; }
.empty { padding: 2rem 1rem; text-align: center; color: var(--muted); }

/* ---------- Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; padding: .5rem 1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); background: var(--red); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { min-height: 36px; padding: .3rem .7rem; font-size: .9rem; }
.btn-lg { min-height: 56px; font-size: 1.05rem; padding: .75rem 1.25rem; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 1.5rem; cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }

/* ---------- Formulare */
.field { display: flex; flex-direction: column; gap: .3rem; }
.field > span { font-weight: 600; font-size: .92rem; }
.field small { color: var(--muted); }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  min-height: var(--tap); padding: .55rem .75rem; width: 100%;
}
textarea { min-height: 110px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: var(--primary); }
.form-error {
  color: var(--red); background: var(--red-bg); border-radius: var(--radius-sm);
  padding: .6rem .8rem; font-weight: 600; margin: .5rem 0;
}
.check { display: flex; align-items: center; gap: .5rem; min-height: 40px; cursor: pointer; }
.check input { width: 20px; height: 20px; }

/* ---------- Badges */
.badge {
  display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 999px;
  font-size: .8rem; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--text);
}
.badge::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: currentColor; display: none; }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-blue { background: var(--blue-bg); color: var(--primary); }
.badge-red::before, .badge-orange::before, .badge-green::before { display: inline-block; }
.chips-static { display: flex; flex-wrap: wrap; gap: .3rem; }
.chip-static { padding: .1rem .5rem; border-radius: 6px; background: var(--surface-2); font-size: .82rem; }

/* ---------- Login */
.login-wrap { display: grid; place-items: center; min-height: 70vh; }
.login-card { width: 100%; max-width: 400px; }
.login-card .brand-big { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.login-card .brand-big h1 { margin: 0; }
.login-card .field { margin-bottom: .9rem; }
.hint { background: var(--blue-bg); border-radius: var(--radius-sm); padding: .6rem .8rem; }

/* ---------- Meldeformular */
.step { border: 0; padding: 0; margin: 0 0 1.25rem; min-width: 0; }
.step legend { font-weight: 700; font-size: 1.05rem; margin-bottom: .6rem; padding: 0; display: flex; align-items: center; gap: .5rem; }
.step-no {
  display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%;
  background: var(--primary); color: var(--on-primary); font-size: .9rem;
}
.step legend small { font-weight: 400; color: var(--muted); }

.veh-tools { display: flex; gap: .5rem; margin-bottom: .5rem; }
.veh-tools input { flex: 1; }
.veh-list { display: grid; gap: .4rem; max-height: 50vh; overflow-y: auto; padding: 2px; }
.veh-group { font-size: .8rem; font-weight: 700; text-transform: uppercase; color: var(--muted); margin: .5rem 0 .1rem; letter-spacing: .04em; }
.veh-item {
  display: grid; grid-template-columns: auto 1fr auto; gap: .1rem .75rem; align-items: center; text-align: left;
  min-height: 60px; padding: .55rem .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
}
.veh-item:hover { border-color: var(--primary); }
.veh-no { font-weight: 800; font-size: 1.1rem; grid-row: span 2; min-width: 3.6rem; }
.veh-name { font-weight: 600; }
.veh-plate { color: var(--muted); font-size: .88rem; grid-column: 2; }
.veh-item .badge { grid-row: 1 / span 2; grid-column: 3; }
.veh-selected {
  display: flex; align-items: center; gap: .75rem; padding: .75rem .9rem;
  border: 2px solid var(--primary); border-radius: var(--radius); background: var(--blue-bg);
}
.veh-selected .veh-no { font-size: 1.4rem; }
.veh-selected .grow { flex: 1; min-width: 0; }

.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: flex; align-items: center; min-height: 52px; padding: .5rem .75rem; border-radius: var(--radius-sm);
  border: 2px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 600; line-height: 1.2;
  -webkit-tap-highlight-color: transparent;
}
.chip span::before { content: "☐"; margin-right: .5rem; font-size: 1.1rem; color: var(--muted); }
.chip input:checked + span { border-color: var(--primary); background: var(--blue-bg); }
.chip input:checked + span::before { content: "☑"; color: var(--primary); }
.chip input:focus-visible + span { outline: 3px solid var(--focus); }

.ready-options { display: grid; gap: .5rem; }
.ready-opt { position: relative; }
.ready-opt input { position: absolute; opacity: 0; pointer-events: none; }
.ready-opt > span {
  display: grid; grid-template-columns: auto 1fr; gap: 0 .75rem; align-items: center; min-height: 64px;
  padding: .6rem .9rem; border: 2px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer;
}
.ready-opt .dot { grid-row: span 2; width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 3px solid currentColor; }
.ready-opt .t { font-weight: 700; }
.ready-opt .d { color: var(--muted); font-size: .9rem; }
.ready-red > span { color: var(--red); }
.ready-orange > span { color: var(--orange); }
.ready-green > span { color: var(--green); }
.ready-opt .t, .ready-opt .d { color: var(--text); }
.ready-opt .d { color: var(--muted); }
.ready-opt input:checked + span { border-color: currentColor; }
.ready-red input:checked + span { background: var(--red-bg); }
.ready-orange input:checked + span { background: var(--orange-bg); }
.ready-green input:checked + span { background: var(--green-bg); }
.ready-opt input:checked + span .dot { background: currentColor; }
.ready-opt input:focus-visible + span { outline: 3px solid var(--focus); }

.file-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.upload-progress { width: 100%; height: 12px; margin-bottom: .5rem; }
.submit-bar { position: sticky; bottom: 0; padding: .75rem 0 max(.75rem, env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); }
.success-card { text-align: center; padding: 2rem 1rem; }
.success-card .big { font-size: 3rem; line-height: 1; margin-bottom: .5rem; }
.success-card .nr { font-size: 1.6rem; font-weight: 800; }

/* ---------- Vorschaubilder & Lightbox */
.thumbs { display: flex; flex-wrap: wrap; gap: .5rem; }
.thumb {
  position: relative; width: 84px; height: 84px; padding: 0; border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); cursor: zoom-in;
}
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.thumb-play {
  position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 1.6rem;
  text-shadow: 0 1px 4px #000; pointer-events: none;
}
.thumb-remove {
  position: absolute; top: 2px; right: 2px; width: 30px; height: 30px; border-radius: 50%; border: 0;
  background: rgb(0 0 0 / .65); color: #fff; font-size: 1.1rem; cursor: pointer; line-height: 1;
}
.thumb-busy { position: absolute; left: 0; right: 0; bottom: 0; background: rgb(0 0 0 / .55); color: #fff; font-size: .7rem; text-align: center; }
.lightbox { padding: 0; border: 0; background: rgb(0 0 0 / .92); color: #fff; width: 100vw; height: 100vh; max-width: none; max-height: none; }
.lightbox::backdrop { background: rgb(0 0 0 / .9); }
.lightbox .lb-stage { position: absolute; inset: 56px 0 56px; display: grid; place-items: center; }
.lightbox .lb-stage img, .lightbox .lb-stage video { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox .lb-bar { position: absolute; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: .5rem; }
.lightbox .lb-top { top: 0; }
.lightbox .lb-bottom { bottom: 0; justify-content: center; gap: 1rem; }
.lightbox .icon-btn { color: #fff; background: rgb(255 255 255 / .12); }

/* ---------- Meldungskarten */
.report-card { border-left: 6px solid var(--border); }
.report-card.r-nicht { border-left-color: var(--red); }
.report-card.r-eingeschraenkt { border-left-color: var(--orange); }
.report-card.r-kann_warten { border-left-color: var(--green); }
.rc-head { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; margin-bottom: .4rem; }
.rc-head .nr { font-weight: 800; }
.rc-veh { font-weight: 700; font-size: 1.05rem; }
.rc-meta { display: flex; flex-wrap: wrap; gap: .2rem 1rem; color: var(--muted); font-size: .88rem; margin: .4rem 0; }
.rc-desc { margin: .5rem 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.rc-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--border); }
.rc-actions select { width: auto; min-width: 160px; flex: 0 1 auto; }
.rc-reject { background: var(--red-bg); color: var(--text); border-radius: var(--radius-sm); padding: .6rem .8rem; margin-top: .5rem; }

/* Fortschritt (Fahrersicht) */
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: .25rem; margin: .75rem 0 .25rem; counter-reset: s; }
.stepper li { list-style: none; text-align: center; font-size: .78rem; color: var(--muted); position: relative; padding-top: 1.6rem; line-height: 1.2; }
.stepper li::before {
  content: ""; position: absolute; top: .35rem; left: 50%; transform: translateX(-50%);
  width: 1rem; height: 1rem; border-radius: 50%; background: var(--surface); border: 3px solid var(--border); z-index: 1;
}
.stepper li::after { content: ""; position: absolute; top: .72rem; left: -50%; width: 100%; height: 3px; background: var(--border); }
.stepper li:first-child::after { display: none; }
.stepper li.done { color: var(--text); }
.stepper li.done::before { background: var(--green); border-color: var(--green); }
.stepper li.done::after { background: var(--green); }
.stepper li.current { color: var(--text); font-weight: 700; }
.stepper li.current::before { background: var(--primary); border-color: var(--primary); }
.stepper li.current::after { background: var(--green); }
.stepper li.warn::before { background: var(--orange); border-color: var(--orange); }
.stepper { padding: 0; }

/* ---------- Werkstatt */
.ws-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.ws-head h1 { margin: 0; margin-right: auto; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1rem; }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi {
  display: flex; flex-direction: column; gap: .2rem; text-align: left; padding: .9rem 1rem; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  font: inherit; color: var(--text);
}
.kpi:hover { border-color: var(--primary); }
.kpi .v { font-size: 2rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: .88rem; font-weight: 600; }
.kpi.alert { background: var(--red-bg); border-color: var(--red); }
.kpi.alert .v { color: var(--red); }
.kpi.warn .v { color: var(--orange); }

.tabs { display: flex; gap: .25rem; border-bottom: 2px solid var(--border); margin-bottom: 1rem; overflow-x: auto; }
.tabs a {
  display: inline-flex; align-items: center; gap: .4rem; padding: .7rem 1rem; text-decoration: none; color: var(--muted);
  font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap;
}
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }
.tabs .count { background: var(--surface-2); color: var(--text); border-radius: 999px; padding: 0 .5rem; font-size: .8rem; }
.tabs .count.hot { background: var(--red); color: #fff; }

.inbox-list { display: grid; gap: .75rem; }
@media (min-width: 1100px) { .inbox-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; align-items: start; }
@media (max-width: 1100px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .board { grid-template-columns: 1fr; } }
.board-col { background: var(--surface-2); border-radius: var(--radius); padding: .6rem; min-height: 120px; }
.board-col h2 { font-size: .95rem; display: flex; align-items: center; justify-content: space-between; margin: .2rem .2rem .6rem; }
.board-col .cards { display: grid; gap: .5rem; }
.order-card {
  display: block; width: 100%; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--border);
  border-radius: var(--radius-sm); padding: .6rem .7rem; box-shadow: var(--shadow);
}
.order-card:hover { border-color: var(--primary); }
.order-card.r-nicht { border-left-color: var(--red); }
.order-card.r-eingeschraenkt { border-left-color: var(--orange); }
.order-card.r-kann_warten { border-left-color: var(--green); }
.oc-top { display: flex; justify-content: space-between; align-items: center; gap: .4rem; }
.oc-veh { font-weight: 600; margin: .2rem 0; }
.oc-meta { color: var(--muted); font-size: .82rem; }

table.data { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
table.data th, table.data td { padding: .6rem .7rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
table.data th { font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: var(--surface-2); }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: var(--surface-2); }
table.data tr.inactive td { opacity: .55; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
@media (max-width: 700px) {
  table.data.responsive thead { display: none; }
  table.data.responsive tr { display: block; border-bottom: 1px solid var(--border); padding: .4rem 0; }
  table.data.responsive td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .3rem .7rem; }
  table.data.responsive td::before { content: attr(data-label); font-weight: 600; color: var(--muted); }
}
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }

/* Seitenleiste Auftrag */
.panel-backdrop { position: fixed; inset: 0; background: rgb(0 0 0 / .35); z-index: 40; }
.panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); z-index: 41;
  background: var(--bg); border-left: 1px solid var(--border); box-shadow: -8px 0 30px rgb(0 0 0 / .2);
  display: flex; flex-direction: column;
}
.panel-head {
  display: flex; align-items: center; gap: .5rem; padding: .6rem .75rem; padding-top: max(.6rem, env(safe-area-inset-top));
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.panel-head h2 { margin: 0; flex: 1; font-size: 1.15rem; }
.panel-body { overflow-y: auto; padding: 1rem; padding-bottom: max(2rem, env(safe-area-inset-bottom)); flex: 1; }
.panel-body section { margin-bottom: 1.25rem; }
.panel-body section > h3 { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
@media (max-width: 800px) { .panel { width: 100vw; border-left: 0; } }
.status-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; }
.status-seg .btn { min-height: 48px; font-size: .9rem; }
.status-seg .btn.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.inline-form { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); align-items: end; margin-top: .5rem; }
.inline-form .wide { grid-column: 1 / -1; }
.events { list-style: none; padding: 0; margin: 0; font-size: .88rem; }
.events li { padding: .35rem 0; border-bottom: 1px dashed var(--border); }
.done-box { background: var(--green-bg); border-radius: var(--radius-sm); padding: .75rem; }

/* Hinweisbanner bei kritischen Meldungen */
.alert-banner {
  position: sticky; top: 0; z-index: 35; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  padding: .8rem 1rem; background: var(--red); color: #fff; font-weight: 700;
  animation: pulse 1.2s ease-in-out 3;
}
.alert-banner .msg { flex: 1; min-width: 200px; }
.alert-banner .btn { background: #fff; color: var(--red); border-color: #fff; }
.alert-banner .btn-ghost { background: transparent; color: #fff; border-color: rgb(255 255 255 / .6); }
@keyframes pulse { 50% { filter: brightness(1.25); } }
@media (prefers-reduced-motion: reduce) { .alert-banner { animation: none; } }

/* Toasts */
.toasts { position: fixed; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100; display: grid; gap: .5rem; width: min(480px, calc(100vw - 2rem)); }
.toast { padding: .75rem 1rem; border-radius: var(--radius-sm); background: #1d2731; color: #fff; box-shadow: var(--shadow); font-weight: 600; }
.toast.error { background: var(--red); }
.toast.ok { background: #1f7a39; }

/* Dialoge */
.dlg {
  border: 0; border-radius: var(--radius); padding: 0; width: min(520px, calc(100vw - 1.5rem));
  background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgb(0 0 0 / .35);
}
.dlg::backdrop { background: rgb(0 0 0 / .45); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
.dlg-head h2 { margin: 0; font-size: 1.15rem; }
.dlg-body { padding: 1rem; display: grid; gap: .8rem; max-height: 70vh; overflow-y: auto; }
.dlg-foot { display: flex; justify-content: flex-end; gap: .5rem; padding: .75rem 1rem; border-top: 1px solid var(--border); }

/* QR-Scanner */
.scanner video { width: 100%; border-radius: var(--radius-sm); background: #000; aspect-ratio: 1; object-fit: cover; }

/* Toolbar */
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: .75rem; }
.toolbar input[type="search"] { flex: 1 1 240px; width: auto; }
.subtabs { display: flex; gap: .4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.subtabs a { padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--border); text-decoration: none; color: var(--text); font-weight: 600; }
.subtabs a.active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.panel-body section > .field { margin-top: .75rem; }
