/* Layout: Leitstand – dunkle Kopfleiste, zweispaltiges Störungsboard, Status als farbiger Randstreifen. Mobil: Reiter unten wie eine App. */
:root {
  --bg: #eceff3;
  --surface: #ffffff;
  --surface-2: #f5f7f9;
  --ink: #16202a;
  --muted: #5a6776;
  --line: #d6dce3;
  --line-2: #e6eaef;
  --bar: #18222d;
  --bar-ink: #e9eef3;
  --bar-muted: #93a3b4;
  --brand: #f2c230;
  --brand-ink: #18222d;
  --focus: #2f6fdf;

  --neu: #d3302f;      --neu-bg: #fdecec;   --neu-ink: #a31f1e;
  --wip: #e07a10;      --wip-bg: #fff1e2;   --wip-ink: #9a4d00;
  --done: #23955a;     --done-bg: #e5f5ec;  --done-ink: #17663d;
  --info: #2f63c9;     --info-bg: #e7eefc;  --info-ink: #214a99;

  --f-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --f-body: "IBM Plex Sans", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r: 10px;
  --shadow: 0 1px 2px rgba(22, 32, 42, .06), 0 2px 8px rgba(22, 32, 42, .05);
  --shadow-lg: 0 18px 48px rgba(10, 18, 26, .28);
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  padding-top: env(safe-area-inset-top, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e141a; --surface: #161f28; --surface-2: #1b2530; --ink: #e5ebf1; --muted: #93a2b2;
    --line: #2a3643; --line-2: #222d38; --bar: #0a0f14; --bar-ink: #e5ebf1; --bar-muted: #8394a6;
    --brand: #f2c230; --brand-ink: #18222d; --focus: #6aa0ff;
    --neu: #f05453; --neu-bg: #3a1a1b; --neu-ink: #ff9d9c;
    --wip: #f19433; --wip-bg: #3a2614; --wip-ink: #ffc185;
    --done: #3dbb77; --done-bg: #14301f; --done-ink: #8fe0b2;
    --info: #6c9bff; --info-bg: #182641; --info-ink: #a9c4ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 18px 48px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e141a; --surface: #161f28; --surface-2: #1b2530; --ink: #e5ebf1; --muted: #93a2b2;
  --line: #2a3643; --line-2: #222d38; --bar: #0a0f14; --bar-ink: #e5ebf1; --bar-muted: #8394a6;
  --brand: #f2c230; --brand-ink: #18222d; --focus: #6aa0ff;
  --neu: #f05453; --neu-bg: #3a1a1b; --neu-ink: #ff9d9c;
  --wip: #f19433; --wip-bg: #3a2614; --wip-ink: #ffc185;
  --done: #3dbb77; --done-bg: #14301f; --done-ink: #8fe0b2;
  --info: #6c9bff; --info-bg: #182641; --info-ink: #a9c4ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 18px 48px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bar); }
body.noscroll { overflow: hidden; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.sm { font-size: 13px; }
small { font-size: 12.5px; color: var(--muted); }
.mono, .tno { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
code { font-family: var(--f-mono); background: var(--surface-2); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line-2); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 16px; }
.stack.tight { gap: 8px; }

/* ---------- Kopfleiste ---------- */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--bar); color: var(--bar-ink); }
.topbar-in { display: flex; align-items: center; gap: 20px; height: 56px; max-width: 1280px; margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font: 700 22px/1 var(--f-display); letter-spacing: .02em; white-space: nowrap; }
.brand svg { width: 26px; height: 26px; }
.tabs { display: flex; gap: 2px; flex: 1; min-width: 0; }
.tab { position: relative; display: flex; align-items: center; gap: 7px; padding: 0 13px; height: 56px; text-decoration: none; color: var(--bar-muted); font-weight: 500; font-size: 14.5px; }
.tab:hover { color: var(--bar-ink); }
.tab.on { color: var(--bar-ink); box-shadow: inset 0 -3px 0 var(--brand); }
.badge { min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--neu); color: #fff; font: 600 11.5px/19px var(--f-body); text-align: center; font-variant-numeric: tabular-nums; }
.me { position: relative; margin-left: auto; }
.me-btn { display: flex; align-items: center; gap: 9px; background: none; border: 0; color: var(--bar-ink); cursor: pointer; padding: 6px 4px; border-radius: 8px; }
.me-btn:hover { background: rgba(255, 255, 255, .06); }
.me-name { font-size: 14px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font: 700 13px/1 var(--f-body); flex: none; letter-spacing: .02em; }
.av.sm { width: 24px; height: 24px; font-size: 10.5px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.av.sm.me { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); width: 250px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 6px; z-index: 40; }
.menu-who { padding: 10px 10px 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 6px; display: grid; gap: 2px; }
.menu-who span { font-size: 12.5px; color: var(--muted); }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 7px; cursor: pointer; text-align: left; }
.menu button:hover { background: var(--surface-2); }
.demo-band { background: var(--brand); color: var(--brand-ink); font-size: 13px; }
.demo-reset { color: inherit; text-decoration: underline; font-size: inherit; padding: 0; margin-left: 6px; }
.demo-in { max-width: 1280px; margin: 0 auto; padding: 6px var(--gutter-r) 6px var(--gutter-l); }

/* ---------- Seiteninhalt ---------- */
.wrap { max-width: 1280px; margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); padding-block: 24px 48px; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.view-head h1 { font: 700 34px/1.05 var(--f-display); letter-spacing: .005em; }
.sub { color: var(--muted); margin-top: 4px; display: flex; gap: 14px; flex-wrap: wrap; }
.tally { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-variant-numeric: tabular-nums; }
.tally::before { content: ""; width: 9px; height: 9px; border-radius: 50%; }
.tally.new { color: var(--neu-ink); } .tally.new::before { background: var(--neu); }
.tally.wip { color: var(--wip-ink); } .tally.wip::before { background: var(--wip); }

/* ---------- Schaltflächen ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 8px; border: 1px solid transparent; font-weight: 600; font-size: 14.5px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: filter .12s, background .12s; }
.btn .ic { width: 17px; height: 17px; }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13.5px; }
.btn.big { height: 46px; font-size: 15.5px; }
.btn.primary { background: var(--ink); color: var(--surface); }
.btn.primary:hover { filter: brightness(1.15); }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.take { background: var(--wip); color: #fff; }
.btn.take:hover { filter: brightness(1.06); }
.btn.done { background: var(--done); color: #fff; }
.btn.done:hover { filter: brightness(1.06); }
.btn.danger { background: var(--neu); color: #fff; }
.danger-text { color: var(--neu-ink) !important; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.sm { width: 28px; height: 28px; }
.icon-btn.sm .ic { width: 15px; height: 15px; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 4px 0; color: var(--muted); cursor: pointer; font-size: 13.5px; }
.link-btn:hover { color: var(--ink); }
.link-btn .ic { width: 15px; height: 15px; }

/* ---------- Filter ---------- */
.filterbar { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; margin-bottom: 20px; }
.search { position: relative; flex: 1 1 280px; min-width: 0; display: flex; align-items: center; }
.search .ic { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search input { width: 100%; height: 42px; padding: 0 12px 0 40px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font-size: 16px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button, .seg label { border: 0; background: none; height: 34px; padding: 0 14px; border-radius: 6px; cursor: pointer; font-weight: 500; font-size: 14px; color: var(--muted); display: inline-flex; align-items: center; }
.seg button:hover, .seg label:hover { color: var(--ink); }
.seg .on, .seg .on:hover { background: var(--ink); color: var(--surface); }
.seg.full { display: flex; }
.seg.full label { flex: 1; justify-content: center; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.fgroup { display: flex; flex-wrap: wrap; gap: 10px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; flex-basis: 100%; }
.chip-btn { height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13px; cursor: pointer; }
.chip-btn:hover { color: var(--ink); border-color: var(--muted); }

/* ---------- Störungsboard ---------- */
.board { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.col { display: grid; gap: 10px; min-width: 0; }
.col h2 { display: flex; align-items: center; gap: 9px; font: 700 15px/1 var(--f-body); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 4px 2px 6px; }
.cnt { font-family: var(--f-mono); font-weight: 500; letter-spacing: 0; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; font-size: 12.5px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.neu { background: var(--neu); box-shadow: 0 0 0 3px var(--neu-bg); }
.dot.bearbeitung { background: var(--wip); box-shadow: 0 0 0 3px var(--wip-bg); }
.dot.erledigt { background: var(--done); width: 8px; height: 8px; margin-right: 6px; }

.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-left-width: 5px; border-radius: var(--r); padding: 13px 15px 12px; box-shadow: var(--shadow); cursor: pointer; display: grid; gap: 7px; min-width: 0; transition: border-color .12s, transform .12s; }
.card:hover { transform: translateY(-1px); }
.card.st-neu { border-left-color: var(--neu); }
.card.st-bearbeitung { border-left-color: var(--wip); }
.card-top { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.card-top .tno { font-weight: 600; font-size: 13px; }
.st-neu .card-top .tno { color: var(--neu-ink); }
.st-bearbeitung .card-top .tno { color: var(--wip-ink); }
.age { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 5px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line-2); white-space: nowrap; }
.card-title { font-size: 16px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 13.5px; }
.card-meta span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.card-meta .ic { width: 15px; height: 15px; }
.card-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 3px; padding-top: 9px; border-top: 1px dashed var(--line-2); }
.who { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; }
.who.wait { color: var(--neu-ink); font-weight: 500; }
.counts { display: inline-flex; gap: 10px; color: var(--muted); font-size: 13px; margin-left: auto; font-variant-numeric: tabular-nums; }
.counts span { display: inline-flex; align-items: center; gap: 3px; }
.counts .ic { width: 14px; height: 14px; }
.card-foot .btn { margin-left: 0; }
.empty { padding: 26px 18px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r); background: color-mix(in srgb, var(--surface) 50%, transparent); list-style: none; }

/* ---------- Dialoge ---------- */
#modal-root { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px var(--gutter-r) 24px var(--gutter-l); }
.modal-back { position: absolute; inset: 0; background: rgba(8, 13, 18, .55); }
.modal { position: relative; width: 100%; max-height: calc(100dvh - 48px); background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; animation: pop .16s ease-out; }
.modal.wide { max-width: 760px; }
.modal.narrow { max-width: 560px; }
.modal-form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
@keyframes pop { from { transform: translateY(10px); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 14px 22px; border-bottom: 1px solid var(--line-2); border-top: 5px solid var(--line-2); }
.modal-head h2 { font: 700 23px/1.1 var(--f-display); }
.modal-head.st-neu { border-top-color: var(--neu); }
.modal-head.st-bearbeitung { border-top-color: var(--wip); }
.modal-head.st-erledigt { border-top-color: var(--done); }
.head-id { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.head-id .tno { font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px; font-size: 13px; font-weight: 600; }
.pill.st-neu { background: var(--neu-bg); color: var(--neu-ink); }
.pill.st-bearbeitung { background: var(--wip-bg); color: var(--wip-ink); }
.pill.st-erledigt { background: var(--done-bg); color: var(--done-ink); }
.pill.admin { background: var(--surface-2); border: 1px solid var(--line); height: 22px; font-size: 12px; }
.modal-body { padding: 20px 22px 24px; overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1; min-height: 0; }
.modal-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px 12px 22px; border-top: 1px solid var(--line-2); background: var(--surface-2); padding-bottom: max(12px, env(safe-area-inset-bottom, 0px)); }
.detail-title { font-size: 21px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.detail-title + .pre { margin-top: 8px; }
.facts { display: flex; flex-wrap: wrap; gap: 1px; margin: 18px 0 4px; background: var(--line-2); border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.facts div { flex: 1 1 200px; background: var(--surface); padding: 10px 14px; min-width: 0; }
.facts dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.facts dd { margin: 2px 0 0; font-weight: 500; overflow-wrap: anywhere; }
.blk { margin-top: 22px; }
.blk h3 { display: flex; align-items: center; gap: 7px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.blk h3 .ic { width: 16px; height: 16px; }
.blk.resolved { background: var(--done-bg); color: var(--done-ink); border-radius: var(--r); padding: 12px 14px; }
.blk.resolved h3 { color: inherit; }
.tbl-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.end { text-align: right; }
.mat-add { display: grid; grid-template-columns: 1fr 70px 90px auto; gap: 8px; margin-top: 10px; }
.mat-add.row-in { grid-template-columns: 1fr 70px 90px; margin-top: 0; }
.mat-add input, .mat-add select { height: 40px; width: 100%; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); min-width: 0; font-size: 16px; }
.history summary { cursor: pointer; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.events { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; font-size: 13.5px; }
.events li { display: grid; grid-template-columns: 120px 1fr; gap: 10px; }
.events time { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Formulare ---------- */
.fld { display: grid; gap: 6px; min-width: 0; }
.fld > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.fld em { font-weight: 400; font-style: normal; opacity: .8; }
.fld input, .fld select, .fld textarea, .row > input { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 16px; }
.fld textarea { resize: vertical; line-height: 1.45; }
.fld.inline { display: flex; align-items: center; gap: 8px; }
.fld.inline > span { white-space: nowrap; font-weight: 500; }
.fld.inline input, .fld.inline select { width: auto; min-height: 38px; padding: 6px 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); }
.form-err { color: var(--neu-ink); background: var(--neu-bg); padding: 9px 12px; border-radius: 8px; font-size: 14px; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }

/* ---------- Kommentare ---------- */
.comments, .feed { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 12px; }
.comment { display: grid; grid-template-columns: 24px 1fr; gap: 10px; }
.c-body { min-width: 0; }
.c-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; min-height: 24px; }
.c-head time { color: var(--muted); font-size: 12.5px; }
.c-head .icon-btn { margin-left: auto; opacity: .55; }
.c-head .icon-btn:hover { opacity: 1; }
.c-body p { margin-top: 2px; }
.composer { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; min-width: 0; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); resize: none; font-size: 16px; line-height: 1.45; }
.board-composer { display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 22px; box-shadow: var(--shadow); }
.board-composer textarea { min-width: 0; border: 0; background: none; resize: vertical; font-size: 16px; padding: 5px 0; min-height: 52px; }
.board-composer textarea:focus { outline: none; }
.feed { max-width: 760px; gap: 0; }
.feed .comment { grid-template-columns: 32px 1fr; padding: 14px 0; border-bottom: 1px solid var(--line); }
.feed .av.sm { width: 32px; height: 32px; font-size: 12px; }

/* ---------- Archiv ---------- */
.arch-table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.ar { display: grid; grid-template-columns: 70px 120px 92px minmax(140px, 1fr) minmax(180px, 2fr) 190px 46px; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line-2); font-size: 14px; cursor: pointer; }
.ar:last-child { border-bottom: 0; }
.ar:not(.head):hover { background: var(--surface-2); }
.ar.head { cursor: default; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.ar > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar .tno { color: var(--done-ink); font-weight: 600; }
.c-when { font-variant-numeric: tabular-nums; color: var(--muted); }
.c-done { font-variant-numeric: tabular-nums; }
.c-mat { color: var(--muted); display: inline-flex; align-items: center; justify-content: flex-end; gap: 3px; }
.c-mat .ic { width: 14px; height: 14px; }

/* ---------- To-dos ---------- */
.newlist { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.newlist input { flex: 1 1 260px; min-width: 0; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 16px; }
.todo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.todo-grid > .empty { grid-column: 1 / -1; }
.todo-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); display: grid; min-width: 0; }
.todo-card header { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px 10px; align-items: flex-start; }
.todo-card h3 { font: 700 21px/1.15 var(--f-display); overflow-wrap: anywhere; }
.prog { display: grid; gap: 4px; justify-items: end; flex: none; }
.prog-n { font-family: var(--f-mono); font-size: 12.5px; color: var(--muted); }
.bar { width: 64px; height: 5px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--done); }
.todo-items { list-style: none; margin: 0; padding: 0 8px; }
.todo-items li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 6px; padding: 4px 8px; border-radius: 7px; }
.todo-items li:hover { background: var(--surface-2); }
.todo-items label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 4px 0; min-width: 0; overflow-wrap: anywhere; }
.todo-items input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--done); flex: none; }
.todo-items .done label span { color: var(--muted); text-decoration: line-through; }
.todo-items small { grid-column: 1; padding-left: 28px; margin-top: -4px; }
.todo-items .icon-btn { grid-row: 1; grid-column: 2; opacity: 0; }
.todo-items li:hover .icon-btn, .todo-items .icon-btn:focus-visible { opacity: .7; }
.item-add { display: flex; gap: 6px; padding: 6px 12px 4px 16px; }
.item-add input { flex: 1; min-width: 0; height: 36px; border: 0; border-bottom: 1px dashed var(--line); background: none; padding: 0 2px; font-size: 16px; }
.item-add input:focus { outline: none; border-bottom-color: var(--ink); }
.todo-card footer { display: flex; justify-content: space-between; gap: 10px; padding: 8px 16px 10px; margin-top: 6px; border-top: 1px solid var(--line-2); }
.todo-card footer .row { gap: 14px; }
.todo-thread { padding: 4px 16px 16px; border-top: 1px solid var(--line-2); padding-top: 14px; }

/* ---------- Verwaltung ---------- */
.card-like { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.users td, .users th { padding-inline: 16px; }
.users tr:last-child td { border-bottom: 0; }
.users tr.inactive td { opacity: .6; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 20px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: grid; gap: 10px; align-content: start; justify-items: start; }
.panel h2 { font: 700 21px/1.1 var(--f-display); }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; }

.sel { height: 42px; padding: 0 34px 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font-size: 16px; max-width: 100%; }
.locs td, .locs th { padding-inline: 16px; }
.locs tr:last-child td { border-bottom: 0; }
.locs tr.inactive td { opacity: .6; }
.c-devs { max-width: 360px; font-size: 13.5px; }
.open-n { display: inline-block; min-width: 22px; padding: 1px 6px; border-radius: 6px; background: var(--neu-bg); color: var(--neu-ink); font-weight: 600; text-align: center; }
.fld > label:first-child { font-size: 13px; font-weight: 600; color: var(--muted); }
.free-loc { margin-top: 2px; padding: 10px; border: 1px dashed var(--line); border-radius: 8px; background: var(--surface-2); }
.check.sm { font-size: 14px; font-weight: 500; }
.check.sm input { width: 18px; height: 18px; }
.devs-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.devs-head > span:first-child { font-size: 13px; font-weight: 600; color: var(--muted); }
.devs-head .row { gap: 14px; }
.dchips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; min-height: 52px; max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); align-content: flex-start; }
.dchip { display: inline-flex; align-items: center; gap: 2px; padding: 0 2px 0 10px; height: 30px; border-radius: 15px; background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; font-weight: 500; max-width: 100%; }
.dchip button { display: inline-grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; flex: none; }
.dchip button:hover { background: var(--neu-bg); color: var(--neu-ink); }
.dchip .ic { width: 13px; height: 13px; }
.dev-add { display: flex; gap: 8px; }
.dev-add input { flex: 1; min-width: 0; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 16px; }
.range-box summary { cursor: pointer; font-size: 13.5px; color: var(--muted); padding: 4px 0; }
.range-box[open] summary { margin-bottom: 8px; }
.range-row { display: grid; grid-template-columns: 1fr 64px auto 64px auto; gap: 8px; align-items: center; }
.range-row input { height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 16px; min-width: 0; }

/* ---------- Störungsarten / Bestellungen ---------- */
.ft-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ftc { height: 38px; padding: 0 14px; border-radius: 19px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 500; font-size: 14.5px; cursor: pointer; }
.ftc:hover { border-color: var(--muted); }
.ftc.on, .ftc.on:hover { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.admin-tabs { margin-bottom: 18px; }
.mat-more { margin-top: 10px; }
.counts .c-ord { color: var(--info-ink); }
.tally.ord { color: var(--info-ink); } .tally.ord::before { background: var(--info); }
.tally.del { color: var(--done-ink); } .tally.del::before { background: var(--done); }
.opill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.os-bestellt { background: var(--info-bg); color: var(--info-ink); }
.os-geliefert { background: var(--done-bg); color: var(--done-ink); }
.os-verbaut { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.os-storniert { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }
.modal-head.os-bestellt-top { border-top-color: var(--info); }
.modal-head.os-geliefert-top { border-top-color: var(--done); }
.modal-head.os-head { border-top-color: var(--info); }
.btn.deliv { background: var(--info); color: #fff; }
.btn.deliv:hover { filter: brightness(1.08); }
.link-btn.strong { color: var(--ink); font-weight: 600; text-align: left; }
.olist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.olist li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; background: var(--surface); }
.olist li:hover { background: var(--surface-2); }
.olist .tno { color: var(--info-ink); font-weight: 600; font-size: 13px; }
.o-what { display: grid; min-width: 0; }
.o-what strong { font-weight: 600; overflow-wrap: anywhere; }
.for-ticket { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 14px; }
.for-ticket .ic { color: var(--wip); margin-top: 2px; }
.ord-grid { display: grid; grid-template-columns: 1fr 90px 100px; gap: 14px; }
.ord-grid .g-l { grid-column: 1 / 2; }
.ord-grid .g-r { grid-column: 2 / 4; }
.ord-grid .g-full { grid-column: 1 / -1; }
.ord-grid input[readonly] { background: var(--surface-2); color: var(--muted); }
.ostep { list-style: none; margin: 16px 0 6px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.ostep li { position: relative; display: grid; justify-items: center; gap: 2px; font-size: 13.5px; font-weight: 600; color: var(--muted); text-align: center; }
.ostep li span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); z-index: 1; margin-bottom: 4px; }
.ostep li::before { content: ""; position: absolute; top: 7px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.ostep li:first-child::before { display: none; }
.ostep li.ok { color: var(--ink); }
.ostep li.ok span { background: var(--done); border-color: var(--done); }
.ostep li.ok::before { background: var(--done); }
.ostep small { font-weight: 400; min-height: 1.2em; }
.hint { margin-top: 14px; }
.or { display: grid; grid-template-columns: 74px 110px minmax(160px, 1.4fr) minmax(130px, 1fr) minmax(150px, 1.3fr) 100px; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line-2); font-size: 14px; cursor: pointer; }
.or:last-child { border-bottom: 0; }
.or:not(.head):hover { background: var(--surface-2); }
.or.head { cursor: default; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.or > span { min-width: 0; display: grid; overflow: hidden; }
.or > span > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.or > span:not(.c-st) { text-overflow: ellipsis; }
.or small { font-size: 12.5px; color: var(--muted); }
.or .tno { color: var(--info-ink); font-weight: 600; }
.or .c-mat2 strong { font-weight: 600; }
.or .c-st { justify-items: start; }
.or.fresh { background: var(--info-bg); box-shadow: inset 4px 0 0 var(--info); }
.or.fresh:hover { background: var(--info-bg); }
.filter-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px; border-radius: 9px; background: var(--info-bg); color: var(--info-ink); font-size: 14px; }
.filter-note .ic { flex: none; }
.filter-note span { flex: 1 1 220px; }
.filter-note.subtle { background: none; color: var(--muted); padding: 0 2px; font-size: 13px; }
.mat-pick { display: grid; gap: 6px; min-width: 0; }
.mat-pick select, .mat-pick input { width: 100%; min-width: 0; }
.ord-grid .mat-pick select, .ord-grid .mat-pick input { min-height: 42px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 16px; }
.nowrap { white-space: nowrap; }
.modal.mid { max-width: 680px; }

/* ---------- Anmeldung ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px var(--gutter-r) 24px var(--gutter-l); background:
  linear-gradient(var(--bar) 0 220px, var(--bg) 220px); }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 28px 26px; display: grid; gap: 16px; }
.login-brand { display: flex; align-items: center; gap: 10px; font: 700 26px/1 var(--f-display); }
.login-brand svg { width: 32px; height: 32px; }
.login h1 { font-size: 18px; font-weight: 600; }
.demo-logins { border-top: 1px solid var(--line-2); padding-top: 14px; display: grid; gap: 8px; font-size: 13.5px; color: var(--muted); }
.wrap-row { flex-wrap: wrap; }

/* ---------- Bestätigung & Meldungen ---------- */
.confirm-layer { position: fixed; inset: 0; z-index: 70; background: rgba(8, 13, 18, .5); display: grid; place-items: center; padding: 16px var(--gutter-r) 16px var(--gutter-l); }
.confirm { background: var(--surface); border-radius: 12px; padding: 20px; max-width: 420px; width: 100%; box-shadow: var(--shadow-lg); display: grid; gap: 18px; }
.confirm p { font-weight: 500; }
#toasts { position: fixed; z-index: 80; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; justify-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--ink); color: var(--surface); padding: 11px 16px; border-radius: 9px; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500; transition: opacity .4s, transform .4s; }
.toast.err { background: var(--neu); color: #fff; }
.toast.out { opacity: 0; transform: translateY(6px); }

/* ---------- Untere Navigation (Handy) ---------- */
.bottomnav { display: none; }

@media (max-width: 860px) {
  .tabs { display: none; }
  .me-name { display: none; }
  .topbar-in { height: 52px; }
  .bottomnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--surface); border-top: 1px solid var(--line);
    padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
  .bn { position: relative; flex: 1; display: grid; justify-items: center; gap: 2px; padding: 8px 2px 7px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 500; }
  .bn .ic { width: 23px; height: 23px; }
  .bn.on { color: var(--ink); }
  .bn.on .ic { stroke-width: 2.3; }
  .bn .badge { position: absolute; top: 4px; left: calc(50% + 6px); }
  .wrap { padding-block: 18px calc(96px + env(safe-area-inset-bottom, 0px)); }
  #toasts { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .view-head h1 { font-size: 29px; }
  .board { grid-template-columns: 1fr; gap: 20px; }
  .ar { grid-template-columns: auto 1fr auto; grid-template-areas: "no cat when" "desc desc desc" "loc loc loc" "done done mat"; gap: 3px 10px; padding: 12px 14px; }
  .ar.head { display: none; }
  .ar .tno { grid-area: no; } .ar > span:nth-child(3) { grid-area: cat; justify-self: start; } .ar .c-when { grid-area: when; }
  .ar .c-desc { grid-area: desc; white-space: normal; font-weight: 600; }
  .ar .c-loc { grid-area: loc; color: var(--muted); font-size: 13.5px; }
  .ar .c-done { grid-area: done; font-size: 13.5px; } .ar .c-mat { grid-area: mat; }
  .or { grid-template-columns: auto 1fr auto; grid-template-areas: "no when st" "mat mat mat" "sup sup sup" "for for for"; gap: 3px 10px; padding: 12px 14px; }
  .or.head { display: none; }
  .or .tno { grid-area: no; } .or .c-when { grid-area: when; display: flex; gap: 6px; } .or .c-st { grid-area: st; }
  .or .c-mat2 { grid-area: mat; } .or .c-sup { grid-area: sup; display: flex; gap: 6px; flex-wrap: wrap; } .or .c-for { grid-area: for; }
  .cat th:nth-child(3), .cat td:nth-child(3), .cat th:nth-child(4), .cat td:nth-child(4) { display: none; }
  .users th:nth-child(5), .users td:nth-child(5), .users th:nth-child(2), .users td:nth-child(2) { display: none; }
  .locs th:nth-child(3), .locs td:nth-child(3), .locs th:nth-child(5), .locs td:nth-child(5), .locs th:nth-child(6), .locs td:nth-child(6) { display: none; }
  .locs td, .locs th { padding-inline: 12px; }
  .btn-lbl { display: none; }
  .users td, .users th { padding-inline: 12px; }
}
@media (max-width: 600px) {
  #modal-root { padding: 0; place-items: end stretch; }
  .modal, .modal.wide, .modal.narrow { max-width: none; max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 12px); border-radius: 14px 14px 0 0; }
  .modal-body { padding: 16px 16px 22px; }
  .modal-head { padding-left: 16px; }
  .modal-foot { padding-left: 16px; padding-right: 16px; }
  .modal-foot > .row:last-child { flex: 1; justify-content: flex-end; }
  .grid2 { grid-template-columns: 1fr; }
  .mat-add { grid-template-columns: 1fr 64px 84px; }
  .mat-add > button { grid-column: 1 / -1; }
  .ord-grid { grid-template-columns: 1fr 1fr; }
  .ord-grid .g-l, .ord-grid .g-r { grid-column: 1 / -1; }
  .ord-grid .g-mat { grid-column: 1 / -1; }
  .admin-tabs { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .admin-tabs button { justify-content: center; padding: 0 8px; }
  .users th:nth-child(4), .users td:nth-child(4) { display: none; }
  .filterbar .seg:not(.full) { width: 100%; }
  .filterbar > .sel { width: 100%; }
  .range-row { grid-template-columns: 1fr 56px auto 56px; }
  .range-row .btn { grid-column: 1 / -1; }
  .filterbar .seg button { flex: 1; justify-content: center; padding: 0 8px; }
  .fgroup { width: 100%; }
  .fld.inline { flex: 1 1 140px; display: grid; gap: 4px; }
  .facts div { flex-basis: 140px; }
  .fld.inline input, .fld.inline select { flex: 1; min-width: 0; }
  .view-head { align-items: stretch; }
  .view-head > .btn { width: 100%; }
  .events li { grid-template-columns: 1fr; gap: 0; }
  .todo-grid { grid-template-columns: 1fr; }
  .todo-items .icon-btn { opacity: .5; }
  .board-composer { grid-template-columns: 1fr; }
  .board-composer .av { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
