/* ==========================================================================
   eMech · Thomann Nutzfahrzeuge · System 02
   Gestaltung nach «eMech Mockup Anforderungen»: Grau, Schwarz, ein Blau.
   ========================================================================== */

:root {
  --bg: #f3f3f3;
  --bg-2: #e9e9e9;
  --bg-3: #dcdcdc;
  --field: #ffffff;
  --ink: #1b1b1b;
  --ink-2: #444444;
  --muted: #767676;
  --line: #cfcfcf;
  --line-soft: #e0e0e0;
  --solid: #1b1b1b;
  --on-solid: #ffffff;
  --blue: #00508c;
  --blue-btn: #00508c;
  --on-blue: #ffffff;
  --blue-soft: #e1eaf3;
  --stage: #d9d9d9;
  --hatch: #c9c9c9;
  --shadow: 0 30px 60px -20px rgba(0, 0, 0, .28), 0 2px 6px rgba(0, 0, 0, .08);
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1d1d1d; --bg-2: #272727; --bg-3: #333333; --field: #2b2b2b;
    --ink: #f1f1f1; --ink-2: #c8c8c8; --muted: #969696; --line: #3d3d3d; --line-soft: #2f2f2f;
    --solid: #f1f1f1; --on-solid: #1b1b1b; --blue: #5b9be0; --blue-btn: #2d6db0; --on-blue: #ffffff;
    --blue-soft: #1f2d3b; --stage: #111111; --hatch: #3a3a3a; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1d1d1d; --bg-2: #272727; --bg-3: #333333; --field: #2b2b2b;
  --ink: #f1f1f1; --ink-2: #c8c8c8; --muted: #969696; --line: #3d3d3d; --line-soft: #2f2f2f;
  --solid: #f1f1f1; --on-solid: #1b1b1b; --blue: #5b9be0; --blue-btn: #2d6db0; --on-blue: #ffffff;
  --blue-soft: #1f2d3b; --stage: #111111; --hatch: #3a3a3a; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }

/* ---------------------------------------------------------------- Typografie */
.display, .h1 {
  font-weight: 800;
  font-variation-settings: "wdth" 112;
  letter-spacing: -.025em;
  line-height: 1.05;
}
.h1 { font-size: 26px; }
.h2 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow--blue { color: var(--blue); }
.eyebrow--ink { color: var(--ink); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.xsmall { font-size: 11px; }
.strong { font-weight: 700; }
.blue { color: var(--blue); }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.mono { font-family: var(--mono); }
.brand-mark { display: inline-block; width: 12px; height: 12px; background: var(--blue); flex: none; }

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: flex; align-items: center; justify-content: flex-start; gap: 8px;
  min-height: 44px; padding: 10px 14px;
  border: 1px solid var(--ink); border-radius: 0;
  background: transparent; color: var(--ink);
  font-weight: 700; font-size: 13px; text-align: left;
  transition: background .12s, color .12s, transform .08s;
}
.btn:active { transform: translateY(1px); }
.btn:hover { background: var(--bg-2); }
.btn--primary { background: var(--blue-btn); border-color: var(--blue-btn); color: var(--on-blue); }
.btn--primary:hover { background: var(--blue-btn); filter: brightness(1.12); }
.btn--solid { background: var(--solid); border-color: var(--solid); color: var(--on-solid); }
.btn--solid:hover { background: var(--solid); filter: brightness(1.15); }
.btn--center { justify-content: center; text-align: center; }
.btn--sm { min-height: 32px; padding: 6px 10px; font-size: 12px; }
.btn--xs { min-height: 26px; padding: 3px 8px; font-size: 11px; }
.btn--inline { display: inline-flex; }
.btn--ghost { border-color: transparent; color: var(--blue); padding-left: 0; padding-right: 0; }
.btn--ghost:hover { background: transparent; text-decoration: underline; }
.btn .kbd { margin-left: auto; font-weight: 500; opacity: .75; font-size: 12px; }
.btn-stack { display: grid; gap: 10px; }
.btn-pair { display: grid; grid-template-columns: 1fr 1fr; }
.btn-pair .btn + .btn { border-left-width: 0; }
.btn-pair .btn--primary + .btn { border-left-width: 1px; }
.link { color: var(--blue); font-weight: 700; font-size: 13px; }

/* ---------------------------------------------------------------- Tags */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  height: 20px; padding: 0 7px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid var(--ink); color: var(--ink); white-space: nowrap;
}
.tag--solid { background: var(--solid); border-color: var(--solid); color: var(--on-solid); }
.tag--blue { background: var(--blue-btn); border-color: var(--blue-btn); color: var(--on-blue); }
.tag--oblue { border-color: var(--blue); color: var(--blue); }
.tag--plain { border-color: transparent; padding: 0; color: var(--blue); }
.tag--muted { border-color: var(--line); color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.dot { width: 8px; height: 8px; display: inline-block; background: var(--blue); }
.dot--pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* ---------------------------------------------------------------- Segment / Filter */
.seg { display: inline-flex; flex-wrap: wrap; }
.seg button, .seg a {
  border: 1px solid var(--blue); background: transparent; color: var(--blue);
  padding: 5px 9px; font-size: 11px; font-weight: 700; margin-right: -1px; white-space: nowrap;
}
.seg .is-active { background: var(--blue-btn); border-color: var(--blue-btn); color: var(--on-blue); position: relative; }
.seg--ink button { border-color: var(--line); color: var(--ink); background: var(--field); flex: 1; padding: 10px; font-size: 12px; }
.seg--ink .is-active { background: var(--solid); border-color: var(--solid); color: var(--on-solid); }
.seg--ink .is-active + .is-active, .seg--ink [data-theme-set].is-blue { background: var(--blue-btn); color: var(--on-blue); border-color: var(--blue-btn); }
.seg--full { display: flex; width: 100%; }

/* ---------------------------------------------------------------- Listen / Zeilen */
.section-label { padding: 20px 16px 8px; }
.list { border-top: 1px solid var(--line); }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-bottom: 1px solid var(--line);
  position: relative; background: transparent;
}
a.row:hover { background: var(--bg-2); }
.row__main { flex: 1; min-width: 0; }
.row__title { font-weight: 600; font-size: 14px; }
.row__sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.row__aside { text-align: right; flex: none; font-weight: 700; font-variant-numeric: tabular-nums; }
.row--active { background: var(--bg-2); }
.row--active::before, .callout::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--blue);
}
.row--muted .row__title { color: var(--muted); font-weight: 500; }
.row .chev { color: var(--muted); font-size: 16px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.kv > :last-child { font-weight: 700; text-align: right; }

.callout {
  position: relative; background: var(--bg-2); padding: 12px 14px 12px 16px; font-size: 12.5px;
}
.callout__title { font-weight: 700; font-size: 13px; margin-bottom: 3px; }
.callout--plain::before { background: var(--ink); }

.pad { padding: 16px; }
.pad-x { padding-left: 16px; padding-right: 16px; }
.gap-s { display: grid; gap: 8px; }
.gap-m { display: grid; gap: 14px; }
.flex { display: flex; align-items: center; gap: 8px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; }
.mt-s { margin-top: 8px; } .mt-m { margin-top: 16px; } .mt-l { margin-top: 24px; }
.hr { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------------------------------------------------------------- KPI */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--bg-2); border-bottom: 1px solid var(--line); }
.kpi { padding: 14px 16px; }
.kpi + .kpi { border-left: 1px solid var(--line); }
.kpi__v { font-size: 22px; font-weight: 800; font-variation-settings: "wdth" 108; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi__v--blue { color: var(--blue); }
.kpi__s { font-size: 11px; color: var(--muted); }

/* ---------------------------------------------------------------- Formular */
.field { display: block; }
.field__label { display: block; margin-bottom: 6px; }
.field__label.between { display: flex; }
.input, .textarea, .select {
  width: 100%; border: 1px solid var(--line); background: var(--field); border-radius: 0;
  padding: 11px 12px; font-size: 14px; outline: none;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.input--lg { font-size: 17px; font-weight: 700; }
.textarea { min-height: 84px; resize: vertical; }
.input-group { display: grid; grid-template-columns: 1fr 1fr; }
.input-group .input + .input { border-left: 0; }
.pflicht { color: var(--blue); font-weight: 700; }
.field--required .input { border-left: 3px solid var(--blue); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.date-box { border: 1px solid var(--line); background: var(--field); padding: 7px 11px; }
.date-box .eyebrow { font-size: 8.5px; }
.date-box strong { display: block; font-size: 15px; margin-top: 2px; }

/* Checkbox (eckig) */
.check { display: inline-block; width: 18px; height: 18px; border: 1.5px solid var(--ink); flex: none; position: relative; }
.check.is-on, [aria-checked="true"] > .check { background: var(--solid); border-color: var(--solid); }
.check--blue { border-color: var(--blue); }

/* Schalter */
.switch {
  width: 34px; height: 22px; border: 1.5px solid var(--blue-btn); background: var(--field);
  position: relative; flex: none; padding: 0;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; background: var(--line);
  transition: left .15s, background .15s;
}
.switch[aria-pressed="true"] { background: var(--blue-btn); }
.switch[aria-pressed="true"]::after { left: 14px; background: var(--field); }
.switch[aria-pressed="false"] { border-color: var(--line); }

/* OK / NOK */
.oknok { display: inline-flex; flex: none; }
.oknok button {
  width: 40px; height: 32px; border: 1px solid var(--line); background: var(--field);
  font-size: 10px; font-weight: 800; letter-spacing: .06em; color: var(--muted);
}
.oknok button + button { border-left: 0; }
.oknok button.is-ok { background: var(--solid); border-color: var(--solid); color: var(--on-solid); }
.oknok button.is-nok { background: var(--blue-btn); border-color: var(--blue-btn); color: var(--on-blue); }

/* Fortschritt */
.bar { height: 8px; background: var(--bg-3); position: relative; overflow: hidden; }
.bar > span { position: absolute; inset: 0 auto 0 0; background: var(--solid); }
.bar > span.blue { background: var(--blue-btn); }
.bar--thin { height: 4px; }
.bar--split { display: flex; }
.bar--split > span { position: static; height: 100%; }

/* ---------------------------------------------------------------- Anlagen-Kacheln */
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.thumb {
  aspect-ratio: 1; background: var(--bg-3); position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 6px; font-size: 9.5px; font-weight: 600;
}
.thumb::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, transparent 40%, rgba(0,0,0,.08)); }
.thumb__type { position: absolute; top: 5px; left: 5px; font-size: 8px; font-weight: 800; letter-spacing: .1em; background: var(--solid); color: var(--on-solid); padding: 2px 4px; }
.thumb--video .thumb__type { background: var(--blue-btn); color: var(--on-blue); }
.thumb--audio { background: var(--bg-2); }
.thumb--audio .wave { position: absolute; inset: 26px 6px 20px; display: flex; align-items: center; gap: 2px; }
.wave i { flex: 1; background: var(--blue); display: block; }
.thumb--add { background: transparent; border: 1px dashed var(--muted); align-items: center; justify-content: center; font-size: 22px; font-weight: 300; color: var(--muted); }
.thumb--add::before { display: none; }

.capture { display: grid; grid-template-columns: repeat(3, 1fr); }
.capture button {
  border: 1px solid var(--line); background: var(--field); padding: 14px 6px 10px; margin-right: -1px;
  display: grid; justify-items: center; gap: 6px; font-size: 11.5px; font-weight: 700;
}
.capture button:hover { background: var(--bg-2); }
.capture svg { width: 22px; height: 22px; stroke: var(--ink); fill: none; stroke-width: 1.6; }
.capture button.is-rec { background: var(--blue-btn); color: var(--on-blue); border-color: var(--blue-btn); }
.capture button.is-rec svg { stroke: var(--on-blue); }

/* ---------------------------------------------------------------- Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--solid); color: var(--on-solid); padding: 11px 16px; font-size: 13px; font-weight: 600;
  z-index: 100; transition: opacity .18s, transform .18s; pointer-events: none; max-width: 90vw;
  display: flex; gap: 10px; align-items: center;
}
.toast::before { content: ""; width: 8px; height: 8px; background: var(--blue); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.phone .toast { position: absolute; bottom: 96px; }

/* ==========================================================================
   MOBILE · Mechaniker-App im Geräterahmen
   ========================================================================== */
.m-stage { min-height: 100vh; background: var(--stage); display: flex; justify-content: center; align-items: flex-start; gap: 48px; padding: 40px 24px; }
.m-side { width: 260px; position: sticky; top: 40px; color: var(--ink); }
.m-side .display { font-size: 34px; }
.m-side nav { margin-top: 22px; display: grid; }
.m-side nav a { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; display: flex; justify-content: space-between; }
.m-side nav a span { color: var(--muted); font-size: 11px; font-family: var(--mono); }
.m-side nav a:hover { color: var(--blue); }
.m-side nav a.is-active { color: var(--blue); font-weight: 700; }

.phone {
  width: 390px; height: 844px; flex: none; background: var(--bg); border-radius: 54px; position: relative;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(0,0,0,.08); overflow: hidden;
  display: flex; flex-direction: column; outline: 10px solid #101010; outline-offset: 0;
}
.phone__status { height: 50px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 12px 34px 0 42px; font-weight: 700; font-size: 15px; position: relative; z-index: 5; background: var(--bg); }
.phone__island { position: absolute; top: 11px; left: 50%; transform: translateX(-50%); width: 122px; height: 35px; border-radius: 20px; background: #000; }
.phone__icons { display: flex; gap: 5px; align-items: center; }
.phone__icons svg { height: 12px; fill: var(--ink); }
.phone__screen { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; scrollbar-width: none; }
.phone__screen::-webkit-scrollbar { display: none; }
.phone__home { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); width: 134px; height: 5px; border-radius: 3px; background: var(--ink); opacity: .85; z-index: 6; }

.tabbar { flex: none; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); background: var(--bg-2); padding-bottom: 26px; }
.tabbar a { padding: 16px 0 14px; text-align: center; font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); position: relative; }
.tabbar a.is-active { color: var(--ink); font-weight: 800; }
.tabbar a.is-active::after { content: ""; position: absolute; left: 14%; right: 14%; bottom: 0; height: 2px; background: var(--ink); }

.m-top { padding: 4px 16px 0; display: flex; justify-content: space-between; align-items: center; min-height: 26px; font-size: 13px; }
.m-top .back { color: var(--muted); }
.m-top .back::before { content: "← "; }
.m-top a.action { color: var(--blue); font-weight: 700; }
.m-head { padding: 6px 16px 16px; border-bottom: 1px solid var(--line); }
.m-head .h1 { margin-bottom: 3px; }
.m-head--grey { background: var(--bg-2); }
.m-head__row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.m-foot { padding: 14px 16px 24px; font-size: 11.5px; color: var(--muted); }

.quote { font-size: 15px; line-height: 1.45; }

/* Kalender */
.cal { background: var(--bg-2); padding: 12px 16px 14px; border-bottom: 1px solid var(--line); }
.cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal__dow { text-align: center; font-size: 9.5px; font-weight: 700; color: var(--muted); padding-bottom: 4px; }
.cal__d { aspect-ratio: 1.15; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--muted); }
.cal__d--werkstatt { background: var(--solid); color: var(--on-solid); }
.cal__d--pikett { background: var(--blue-btn); color: var(--on-blue); }
.cal__d--kurs { background: #8d8d8d; color: #fff; }
.cal__d--frei { color: var(--muted); font-weight: 500; }
.cal__d--today { outline: 2px solid var(--blue); outline-offset: 1px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 10.5px; color: var(--ink-2); margin-top: 10px; }
.legend i { display: inline-block; width: 9px; height: 9px; margin-right: 5px; vertical-align: -1px; }

/* Chat */
.chat { padding: 14px 16px; display: grid; gap: 12px; }
.bubble { max-width: 86%; padding: 11px 13px; font-size: 13px; line-height: 1.45; }
.bubble--me { justify-self: end; background: var(--solid); color: var(--on-solid); }
.bubble--bot { background: var(--bg-2); border-left: 3px solid var(--blue); }
.bubble--bot .src { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 8px; font-size: 11px; }
.bubble--other { background: var(--bg-2); }
.bubble__meta { font-size: 10.5px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.bubble--typing { width: 64px; display: flex; gap: 4px; }
.bubble--typing i { width: 6px; height: 6px; background: var(--muted); animation: pulse 1s infinite; }
.bubble--typing i:nth-child(2) { animation-delay: .2s; } .bubble--typing i:nth-child(3) { animation-delay: .4s; }
.composer { display: flex; padding: 10px 16px 14px; gap: 0; border-top: 1px solid var(--line); background: var(--bg); position: sticky; bottom: 0; }
.composer .input { border-right: 0; font-size: 13px; }
.context-chips { display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.chip { border: 1px solid var(--line); background: var(--field); padding: 5px 9px; font-size: 11px; font-weight: 600; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.chip--on { border-color: var(--blue); color: var(--blue); }
.chip--on::before { content: ""; width: 6px; height: 6px; background: var(--blue); }

/* Timer */
.timer { font-size: 44px; font-weight: 800; font-variation-settings: "wdth" 108; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.timer-card { background: var(--solid); color: var(--on-solid); padding: 18px 16px; }
.timer-card .eyebrow { color: inherit; opacity: .6; }
.timer-card .bar { background: rgba(127,127,127,.35); }
.timer-card .bar > span { background: var(--blue); }
.timer-card.is-paused .timer { opacity: .45; }

/* Video */
.video { height: 210px; background: #8a8a8a; position: relative; color: #fff; display: flex; align-items: flex-end; padding: 14px 16px; font-size: 12px; overflow: hidden; }
.video::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 60% 45%, #a8a8a8, #6d6d6d 70%); }
.video > * { position: relative; }
.video__rec { position: absolute; top: 12px; left: 16px; font-size: 10px; letter-spacing: .12em; font-weight: 700; }
.video__rec::before { content: ""; display: inline-block; width: 7px; height: 7px; background: #fff; margin-right: 6px; animation: pulse 1.2s infinite; }
.scrub { height: 22px; background: var(--bg-3); position: relative; margin: 16px 16px 6px; }
.scrub span { position: absolute; top: 0; bottom: 0; left: 34%; width: 16%; background: var(--blue-btn); }
.scrub-lbl { display: flex; justify-content: space-between; font-size: 10.5px; padding: 0 16px; color: var(--muted); }

/* Menü Mehr */
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.menu-grid a { padding: 16px; border-bottom: 1px solid var(--line); min-height: 88px; display: flex; flex-direction: column; justify-content: space-between; }
.menu-grid a:nth-child(odd) { border-right: 1px solid var(--line); }
.menu-grid a:hover { background: var(--bg-2); }
.menu-grid .t { font-weight: 700; font-size: 14px; }
.menu-grid .s { font-size: 11px; color: var(--muted); }
.menu-grid .badge { align-self: flex-start; }

.profile { display: flex; gap: 12px; align-items: center; }
.avatar { width: 44px; height: 44px; background: var(--solid); color: var(--on-solid); display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; }
.avatar--sm { width: 26px; height: 26px; font-size: 10px; }
.avatar--blue { background: var(--blue-btn); color: var(--on-blue); }

/* Wochen-Saldo Balken */
.weekbars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; align-items: end; height: 110px; padding: 0 16px; }
.weekbar { display: grid; gap: 4px; height: 100%; grid-template-rows: 1fr auto; }
.weekbar__col { position: relative; background: var(--bg-3); }
.weekbar__col span { position: absolute; left: 0; right: 0; bottom: 0; background: var(--solid); }
.weekbar__col::after { content: ""; position: absolute; left: -3px; right: -3px; bottom: var(--soll); border-top: 1.5px dashed var(--blue); }
.weekbar--today .weekbar__col span { background: var(--blue-btn); }
.weekbar__l { text-align: center; font-size: 10.5px; font-weight: 700; color: var(--muted); }

@media (max-width: 720px) {
  .m-stage { padding: 0; background: var(--bg); display: block; }
  .m-side { display: none; }
  .phone { width: 100%; height: 100vh; height: 100dvh; border-radius: 0; box-shadow: none; outline: 0; }
  .phone__status, .phone__home { display: none; }
  .phone__screen { padding-top: env(safe-area-inset-top); }
  .tabbar { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}
@media (max-width: 1000px) and (min-width: 721px) { .m-side { display: none; } }

/* ==========================================================================
   DESKTOP · Leitstand / Werkstattplaner
   ========================================================================== */
.d-shell { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }
.d-nav { background: var(--bg-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.d-logo { display: flex; align-items: center; gap: 10px; padding: 22px 20px; border-bottom: 1px solid var(--line); font-weight: 800; font-size: 16px; font-variation-settings: "wdth" 108; }
.d-nav__group { padding: 18px 0 4px 20px; }
.d-nav a.d-link { display: flex; justify-content: space-between; align-items: center; padding: 9px 20px; font-size: 13px; color: var(--ink-2); position: relative; }
.d-nav a.d-link:hover { background: var(--bg-3); color: var(--ink); }
.d-nav a.d-link.is-active { background: var(--bg); color: var(--ink); font-weight: 700; }
.d-nav a.d-link.is-active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--blue); }
.d-nav .count { font-size: 10px; font-weight: 700; background: var(--blue-btn); color: var(--on-blue); padding: 1px 6px; }
.d-nav__foot { margin-top: auto; padding: 16px 20px 20px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.d-nav__foot .seg--ink button { padding: 7px; font-size: 11.5px; }

.d-main { min-width: 0; display: flex; flex-direction: column; }
.d-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; padding: 26px 28px 20px; border-bottom: 1px solid var(--line); }
.d-head .h1 { font-size: 30px; margin-top: 6px; }
.d-actions { display: flex; gap: 0; }
.d-actions .btn + .btn { margin-left: 8px; }
.d-kpis { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border-bottom: 1px solid var(--line); }
.d-kpis .kpi { padding: 16px 28px; }
.d-kpis .kpi__v { font-size: 26px; }
.d-body { display: grid; grid-template-columns: 1fr 320px; flex: 1; }
.d-body--full { grid-template-columns: 1fr; }
.d-content { padding: 22px 28px 40px; min-width: 0; }
.d-aside { background: var(--bg-2); border-left: 1px solid var(--line); padding: 22px 20px 40px; }
.d-aside .section { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.d-aside .section:last-child { border-bottom: 0; }
.d-aside .item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.d-aside .item:last-child { border-bottom: 0; }
.d-aside .item__t { font-weight: 700; font-size: 13px; }
.d-aside .item__s { font-size: 11.5px; color: var(--muted); margin: 2px 0 8px; }
.d-section-label { margin-bottom: 10px; }
.d-section-label + table, .d-section-label + .gantt { margin-top: 0; }
.d-note { font-size: 11.5px; color: var(--muted); line-height: 1.5; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 9.5px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 8px 0; border-bottom: 1px solid var(--ink); }
.table td { padding: 11px 10px 11px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: color-mix(in srgb, var(--bg-2) 60%, transparent); }
.table td.strong { font-weight: 700; }
.table .row-active td { background: var(--bg-2); }
.table .row-active td:first-child { box-shadow: inset 3px 0 0 var(--blue); padding-left: 10px; }
.table--tight td { padding-top: 8px; padding-bottom: 8px; }

.split-bar { display: flex; height: 26px; font-size: 10.5px; font-weight: 700; }
.split-bar > div { display: flex; align-items: center; padding: 0 8px; white-space: nowrap; overflow: hidden; }

/* Gantt / Plantafel */
.gantt { --h: 11; border-top: 1px solid var(--ink); }
.gantt__head, .gantt__row { display: grid; grid-template-columns: 170px 1fr 150px; align-items: stretch; }
.gantt--noaside .gantt__head, .gantt--noaside .gantt__row { grid-template-columns: 150px 1fr; }
.gantt__head { font-size: 10px; font-weight: 700; color: var(--muted); letter-spacing: .08em; }
.gantt__head > div { padding: 8px 0; }
.gantt__hours { display: grid; grid-template-columns: repeat(var(--h), 1fr); }
.gantt__hours span { border-left: 1px solid var(--line-soft); padding-left: 4px; }
.gantt__row { border-top: 1px solid var(--line); min-height: 52px; }
.gantt__label { padding: 9px 10px 9px 0; display: flex; flex-direction: column; justify-content: center; }
.gantt__label b { font-size: 13px; }
.gantt__label small { font-size: 10.5px; color: var(--muted); }
.gantt__lane {
  position: relative; margin: 8px 0;
  background-image: linear-gradient(to right, var(--line-soft) 1px, transparent 1px);
  background-size: calc(100% / var(--h)) 100%;
  transition: background-color .15s, box-shadow .15s;
}
.gantt__lane.is-over { background-color: var(--blue-soft); box-shadow: inset 0 0 0 1.5px var(--blue); }
.gantt__lane--locked { background: repeating-linear-gradient(-45deg, var(--hatch) 0 2px, transparent 2px 8px); }
.gantt__lane--free { border: 1px dashed var(--muted); background: none; }
.gantt__now { position: absolute; top: -8px; bottom: -8px; width: 2px; background: var(--blue); z-index: 3; }
.gantt__now::before { content: attr(data-l); position: absolute; top: -26px; left: -15px; background: var(--bg); padding: 1px 3px; font-size: 9px; font-weight: 800; color: var(--blue); }
.blk {
  position: absolute; top: 0; bottom: 0; padding: 0 8px; display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--solid); color: var(--on-solid); border-right: 2px solid var(--bg); cursor: grab;
}
.blk small { font-weight: 500; opacity: .75; overflow: hidden; text-overflow: ellipsis; }
.blk--run { background: var(--blue-btn); color: var(--on-blue); }
.blk--done { background: var(--bg-3); color: var(--ink-2); }
.blk--intern { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.blk--pikett { background: transparent; color: var(--blue); box-shadow: inset 0 0 0 1.5px var(--blue); font-size: 9px; }
.blk--absenz { background: repeating-linear-gradient(-45deg, var(--hatch) 0 2px, var(--bg-2) 2px 8px); color: var(--ink-2); cursor: default; font-weight: 600; }
.blk--warn { box-shadow: inset 0 0 0 2px var(--blue), inset 0 0 0 4px var(--bg); }
.blk--warn::after { content: "!"; margin-left: auto; background: var(--blue-btn); color: #fff; width: 14px; height: 14px; display: grid; place-items: center; font-size: 10px; flex: none; }
.blk--new { animation: blkIn .35s ease-out; }
@keyframes blkIn { from { opacity: 0; transform: scaleX(.6); transform-origin: left; } }
.gantt__cap { padding: 8px 0 8px 14px; display: flex; flex-direction: column; justify-content: center; gap: 4px; font-size: 11px; border-left: 1px solid var(--line); }
.gantt__cap .between > span:last-child { font-weight: 700; font-variant-numeric: tabular-nums; }
.gantt__cap .over { color: var(--blue); }

.plan-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 16px; flex-wrap: wrap; }
.plan-group { margin-bottom: 28px; }
.plan-group__h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }

.pool { display: grid; gap: 8px; }
.card {
  background: var(--bg); border: 1px solid var(--line); padding: 10px 12px; position: relative; cursor: grab;
  transition: transform .1s, box-shadow .1s;
}
.card:hover { border-color: var(--ink); }
.card.is-dragging { opacity: .4; }
.card--prio { border-left: 3px solid var(--blue); }
.card__top { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; }
.card__t { font-weight: 700; font-size: 13px; margin: 3px 0 2px; }
.card__s { font-size: 11px; color: var(--muted); }
.card__grip { position: absolute; right: 8px; bottom: 8px; width: 10px; height: 10px; background: radial-gradient(var(--muted) 1px, transparent 1.2px) 0 0/4px 4px; opacity: .7; }

.capbars { display: grid; grid-template-columns: repeat(9, 1fr); gap: 3px; align-items: end; height: 150px; }
.capbar { background: var(--solid); position: relative; }
.capbar--over { background: var(--blue-btn); }
.capbar--low { background: var(--bg-3); }
.caplabels { display: grid; grid-template-columns: repeat(9, 1fr); gap: 3px; font-size: 10.5px; color: var(--muted); margin-top: 6px; }
.caplabels .on { color: var(--blue); font-weight: 700; }
.capbars::after { content: ""; }
.capline { position: relative; }
.capline::before { content: "100 %"; position: absolute; right: 0; top: -14px; font-size: 9px; color: var(--muted); font-weight: 700; }

.inbox { display: grid; grid-template-columns: 380px 1fr; border-top: 1px solid var(--ink); min-height: 520px; }
.inbox__list { border-right: 1px solid var(--line); }
.inbox__item { display: block; padding: 13px 16px 13px 0; border-bottom: 1px solid var(--line); position: relative; cursor: pointer; }
.inbox__item:hover { background: var(--bg-2); }
.inbox__item.is-active { background: var(--bg-2); padding-left: 12px; box-shadow: inset 3px 0 0 var(--blue); }
.inbox__detail { padding: 18px 0 18px 28px; }

/* Startseite */
.landing { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; padding: 36px 48px; gap: 36px; }
.landing .display { font-size: clamp(56px, 9vw, 120px); }
.entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.entry { border-top: 2px solid var(--ink); padding-top: 18px; display: grid; gap: 16px; align-content: start; }
.entry:hover .h1 { color: var(--blue); }
.entry ul { list-style: none; padding: 0; margin: 0; display: grid; border-top: 1px solid var(--line); }
.entry li { padding: 9px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; font-size: 13px; }
.entry li span:last-child { color: var(--muted); font-family: var(--mono); font-size: 11px; }

@media (max-width: 1100px) {
  .d-body { grid-template-columns: 1fr; }
  .d-aside { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 820px) {
  .d-shell { grid-template-columns: 1fr; }
  .d-nav { position: static; height: auto; }
  .d-nav__group, .d-nav__foot { display: none; }
  .d-nav nav { display: flex; overflow-x: auto; }
  .d-head { flex-direction: column; align-items: flex-start; padding: 20px 16px; }
  .d-content { padding: 18px 16px; overflow-x: auto; }
  .d-kpis { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
  .entry-grid { grid-template-columns: 1fr; }
  .landing { padding: 24px 16px; }
  .inbox { grid-template-columns: 1fr; }
}

/* Anmeldung */
.login { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; padding: 32px 24px; gap: 24px; }
.login__box { align-self: center; justify-self: center; width: 100%; max-width: 360px; }
.login .display { font-size: 64px; }
.logout-form { margin: 0; }
.logout-form button { width: 100%; }
