/* ==========================================================================
   MOTIC Fleet Control — Design-System (Etappe 1)
   Layout: feste linke Leiste (248 px) + fließender Inhalt. Dunkle Leitstand-
   Oberfläche mit leichtem Grünstich, Teal als einziger Akzent; Statusfarben
   (gut / Warnung / kritisch / lädt / info) sind davon getrennt.
   ========================================================================== */

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

:root {
  color-scheme: dark;

  /* Flächen */
  --bg: #070908;
  --surface: #0c110f;
  --surface-2: #111816;
  --surface-3: #16201c;
  --line: #1c2622;
  --line-2: #27332e;

  /* Schrift */
  --ink: #e8eeeb;
  --ink-2: #9fb1aa;
  --ink-3: #647870;

  /* Akzent */
  --teal: #00c9a7;
  --teal-2: #37e2c3;
  --teal-dim: rgba(0, 201, 167, 0.12);
  --teal-line: rgba(0, 201, 167, 0.35);
  --teal-ink: #04211b;

  /* Status (getrennt vom Akzent) */
  --good: #55d38c;
  --warn: #f0b53c;
  --crit: #f06b6b;
  --info: #6fb0ff;
  --charge: #8ad2ff;
  --good-dim: rgba(85, 211, 140, 0.14);
  --warn-dim: rgba(240, 181, 60, 0.14);
  --crit-dim: rgba(240, 107, 107, 0.14);
  --info-dim: rgba(111, 176, 255, 0.14);
  --charge-dim: rgba(138, 210, 255, 0.14);

  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --fs-0: 11.5px;
  --fs-1: 12.5px;
  --fs-2: 14px;
  --fs-3: 15.5px;
  --fs-4: 19px;
  --fs-5: 26px;
  --fs-6: 34px;

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;

  --rail: 248px;
  --topbar: 60px;
  --gutter: 28px;

  --shadow-pop: 0 18px 48px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.4);
  --focus: 0 0 0 3px rgba(0, 201, 167, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-2);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg.ic { width: 18px; height: 18px; flex: none; }
svg.ic.sm { width: 15px; height: 15px; }
svg.ic.lg { width: 22px; height: 22px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 0.92em; }
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* --------------------------------------------------------------------------
   App-Gerüst
   -------------------------------------------------------------------------- */
.app { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100%; }
.rail {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 20px 14px 16px;
  overflow-y: auto;
  z-index: 30;
}
.rail-brand { display: flex; flex-direction: column; gap: 6px; padding: 2px 10px 18px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.rail-brand .logo { width: 108px; height: auto; display: block; color: #fff; }
.rail-brand .logo-mark { display: none; width: 26px; height: auto; color: #fff; }
.rail-brand .product { font-size: var(--fs-0); font-weight: 500; color: var(--teal); letter-spacing: 0.08em; }

.rail-group { margin-top: 14px; }
.rail-group-h {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 10px 6px; font-size: var(--fs-0); font-weight: 500; color: var(--ink-3);
}
.rail-group-h .tag { font-size: 10.5px; }
.rail a.item {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--ink-2); font-size: var(--fs-2); font-weight: 500;
  text-decoration: none;
  position: relative;
}
.rail a.item:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.rail a.item.on { background: var(--teal-dim); color: var(--ink); }
.rail a.item.on::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 3px; background: var(--teal); }
.rail a.item .ic { color: var(--ink-3); }
.rail a.item.on .ic { color: var(--teal); }
.rail a.item .lock { margin-left: auto; color: var(--ink-3); width: 14px; height: 14px; }
.rail a.item.locked { color: var(--ink-3); }
.rail a.item.locked .ic { color: var(--ink-3); opacity: 0.8; }
.rail a.item .label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.rail-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.tenant {
  display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line);
}
.tenant .ic-box { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--teal-dim); color: var(--teal); }
.tenant b { display: block; font-size: var(--fs-1); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tenant span { display: block; font-size: var(--fs-0); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--topbar);
  display: flex; align-items: center; gap: 14px;
  padding: 0 var(--gutter);
  background: rgba(7, 9, 8, 0.85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: var(--fs-4); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.topbar .spacer { flex: 1; }
.topbar .burger { display: none; }
.topbar .search { position: relative; width: 260px; }
.topbar .search .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.topbar .search input { width: 100%; padding: 8px 12px 8px 34px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font-size: var(--fs-1); }
.topbar .search input::placeholder { color: var(--ink-3); }
.topbar .search input:focus { outline: none; border-color: var(--teal-line); box-shadow: var(--focus); }
.iconbtn {
  position: relative; width: 36px; height: 36px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: var(--ink-2); display: grid; place-items: center;
}
.iconbtn:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.iconbtn .count { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--warn); color: #1a1200; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }
.userchip { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--ink); }
.userchip:hover { background: var(--surface-2); border-color: var(--line); }
.userchip .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--teal); color: var(--teal-ink); font-weight: 700; font-size: 12px; display: grid; place-items: center; }
.userchip .who { text-align: left; line-height: 1.15; }
.userchip .who b { display: block; font-size: var(--fs-1); font-weight: 600; }
.userchip .who span { display: block; font-size: var(--fs-0); color: var(--ink-3); }

.content { padding: 22px var(--gutter) 40px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* Demo-Paketumschalter (Segmentsteuerung) */
.seg { display: inline-flex; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.seg .seg-label { font-size: var(--fs-0); color: var(--ink-3); padding: 0 8px 0 10px; }
.seg button { border: 0; background: transparent; color: var(--ink-2); font-size: var(--fs-1); font-weight: 500; padding: 5px 11px; border-radius: 999px; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--teal); color: var(--teal-ink); font-weight: 600; }
.seg.small button { padding: 3px 9px; font-size: var(--fs-0); }

/* --------------------------------------------------------------------------
   Bausteine
   -------------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; min-width: 0; }
.card.tight { padding: 0; overflow: hidden; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card.tight .card-h { padding: 14px 18px 0; }
.card-h h2, .card-h h3 { font-size: var(--fs-2); font-weight: 600; color: var(--ink); }
.card-h .sub { font-size: var(--fs-1); color: var(--ink-3); margin-top: 1px; }
.card-h .actions { display: flex; align-items: center; gap: 8px; }
.card-h a.more { font-size: var(--fs-1); font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.main-side { grid-template-columns: minmax(0, 2fr) minmax(280px, 0.8fr); }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Statusleiste (Kennzahlen) */
.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.strip .stat { background: var(--surface); padding: 13px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.strip .stat .v { font-size: var(--fs-5); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 6px; }
.strip .stat .v small { font-size: var(--fs-1); font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.strip .stat .l { font-size: var(--fs-1); color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.strip .stat.good .v { color: var(--good); }
.strip .stat.warn .v { color: var(--warn); }
.strip .stat.crit .v { color: var(--crit); }
.strip .stat.teal .v { color: var(--teal); }
.strip .stat.charge .v { color: var(--charge); }
.strip .stat.dim .v { color: var(--ink-2); }

/* Tabellen */
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-1); }
.tbl th { text-align: left; font-weight: 500; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--ink); vertical-align: middle; white-space: nowrap; }
.tbl td.wrap { white-space: normal; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.link { cursor: pointer; }
.tbl tbody tr.link:hover td { background: var(--surface-2); }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl .num { font-variant-numeric: tabular-nums; }
.tbl-wrap { overflow-x: auto; }
.vid { font-weight: 600; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.vid .ic.warn { color: var(--warn); } .vid .ic.crit { color: var(--crit); } .vid .ic.info { color: var(--info); }

/* Punkte, Pillen, Tags */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); flex: none; }
.dot.moving { background: var(--teal); }
.dot.ready { background: var(--good); }
.dot.charging { background: var(--charge); }
.dot.offline { background: var(--ink-3); }
.dot.warn { background: var(--warn); }
.dot.crit { background: var(--crit); }
.dot.live { box-shadow: 0 0 0 3px rgba(0, 201, 167, 0.18); }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: var(--fs-0); font-weight: 600; line-height: 1.6; white-space: nowrap; background: var(--surface-3); color: var(--ink-2); }
.pill .ic { width: 12px; height: 12px; }
.pill.moving { background: var(--teal-dim); color: var(--teal); }
.pill.ready { background: var(--good-dim); color: var(--good); }
.pill.charging { background: var(--charge-dim); color: var(--charge); }
.pill.offline { background: var(--surface-3); color: var(--ink-2); }
.pill.warn { background: var(--warn-dim); color: var(--warn); }
.pill.crit { background: var(--crit-dim); color: var(--crit); }
.pill.info { background: var(--info-dim); color: var(--info); }
.pill.teal { background: var(--teal-dim); color: var(--teal); }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 5px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em; border: 1px solid var(--line-2); color: var(--ink-2); background: transparent; white-space: nowrap; }
.tag.standard { color: var(--ink-2); border-color: var(--line-2); }
.tag.fleet { color: var(--teal); border-color: var(--teal-line); }
.tag.intelligent { color: var(--teal-2); border-color: var(--teal-line); background: var(--teal-dim); }
.tag .ic { width: 11px; height: 11px; }

/* Balken */
.bar { position: relative; height: 6px; width: 72px; border-radius: 4px; background: var(--surface-3); display: inline-block; vertical-align: middle; overflow: hidden; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--teal); }
.bar.good i { background: var(--good); }
.bar.warn i { background: var(--warn); }
.bar.crit i { background: var(--crit); }
.bar.charge i { background: var(--charge); }
.soc { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 8px; border: 1px solid transparent; font-size: var(--fs-1); font-weight: 600; line-height: 1.2; white-space: nowrap; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.btn.primary { background: var(--teal); color: var(--teal-ink); }
.btn.primary:hover { background: var(--teal-2); }
.btn.secondary { background: var(--surface-2); border-color: var(--line-2); color: var(--ink); }
.btn.secondary:hover { background: var(--surface-3); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.danger { background: var(--crit-dim); color: var(--crit); }
.btn.sm { padding: 5px 10px; font-size: var(--fs-0); }
.btn.lg { padding: 11px 18px; font-size: var(--fs-2); }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn .ic { width: 15px; height: 15px; }

/* Chips (Filter) */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--ink-2); font-size: var(--fs-1); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { color: var(--ink); background: var(--surface-2); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .n { font-variant-numeric: tabular-nums; opacity: 0.75; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { background: transparent; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 10px 14px; color: var(--ink-2); font-weight: 500; font-size: var(--fs-2); display: inline-flex; align-items: center; gap: 8px; flex: none; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--teal); }
.tabs button .tag { margin-left: 2px; }
.tab-panel { padding-top: 16px; }

/* Formulare */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: var(--fs-1); font-weight: 500; color: var(--ink-2); }
.field .input { position: relative; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; color: var(--ink); font-size: var(--fs-2);
}
.field input::placeholder { color: var(--ink-3); }
.field input:focus, .field select:focus { outline: none; border-color: var(--teal-line); box-shadow: var(--focus); }
.field .input .ic-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 6px; background: transparent; border: 0; color: var(--ink-3); display: grid; place-items: center; }
.field .input .ic-btn:hover { color: var(--ink); background: var(--surface-2); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-1); color: var(--ink-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--teal); margin: 0; }
.switch { position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); flex: none; cursor: pointer; transition: background 0.15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--ink-2); transition: transform 0.15s, background 0.15s; }
.switch.on { background: var(--teal); border-color: var(--teal); }
.switch.on::after { transform: translateX(16px); background: var(--teal-ink); }

/* Listen */
.list { display: flex; flex-direction: column; }
.list .li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list .li:last-child { border-bottom: 0; }
.list .li .t { font-weight: 600; font-size: var(--fs-2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.list .li .d { font-size: var(--fs-1); color: var(--ink-2); margin-top: 2px; line-height: 1.45; }
.list .li .m { font-size: var(--fs-0); color: var(--ink-3); margin-top: 5px; display: flex; gap: 10px; flex-wrap: wrap; }
.sev { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.sev.warn { background: var(--warn-dim); color: var(--warn); }
.sev.crit { background: var(--crit-dim); color: var(--crit); }
.sev.info { background: var(--info-dim); color: var(--info); }
.sev.good { background: var(--good-dim); color: var(--good); }
.sev.teal { background: var(--teal-dim); color: var(--teal); }

/* Kennwert-Zeilen */
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; font-size: var(--fs-1); }
.kv dt { color: var(--ink-2); margin: 0; }
.kv dd { margin: 0; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.kv dd.good { color: var(--good); } .kv dd.warn { color: var(--warn); } .kv dd.crit { color: var(--crit); }

/* Hinweiskasten */
.note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-1); color: var(--ink-2); line-height: 1.45; }
.note .ic { color: var(--ink-3); margin-top: 1px; }
.note.teal { background: var(--teal-dim); border-color: var(--teal-line); color: var(--ink); }
.note.teal .ic { color: var(--teal); }
.note.warn { background: var(--warn-dim); border-color: rgba(240, 181, 60, 0.35); color: var(--ink); }
.note.warn .ic { color: var(--warn); }

/* Leere Zustände */
.empty { padding: 26px 16px; text-align: center; color: var(--ink-3); font-size: var(--fs-1); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty .ic { width: 26px; height: 26px; color: var(--good); }

/* --------------------------------------------------------------------------
   Paket-Gating (gesperrte Bereiche)
   -------------------------------------------------------------------------- */
.gate { position: relative; }
.gate.is-locked > :not(.gate-cover) { filter: blur(3px) saturate(0.6); opacity: 0.35; pointer-events: none; user-select: none; }
.gate-cover { display: none; }
.gate.is-locked > .gate-cover {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  position: absolute; inset: 0; padding: 16px; z-index: 2;
}
.gate-cover .lockbox { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--ink-2); margin-bottom: 4px; }
.gate-cover b { font-size: var(--fs-2); font-weight: 600; }
.gate-cover span { font-size: var(--fs-1); color: var(--ink-2); max-width: 36ch; }
.gate-cover .btn { margin-top: 6px; }
.gate.card.is-locked, .card .gate.is-locked { min-height: 150px; }
.gate.stack.is-locked > .gate-cover { justify-content: flex-start; padding-top: 150px; }

/* --------------------------------------------------------------------------
   Modal / Toast
   -------------------------------------------------------------------------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 80; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-bg.open { display: flex; }
.modal { width: min(980px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); padding: 22px 24px; }
.modal-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.modal-h h2 { font-size: var(--fs-4); }
.modal-h p { color: var(--ink-2); font-size: var(--fs-1); margin-top: 3px; max-width: 70ch; }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.plan { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; background: var(--surface-2); display: flex; flex-direction: column; gap: 12px; position: relative; }
.plan.current { border-color: var(--teal-line); background: linear-gradient(180deg, rgba(0, 201, 167, 0.08), transparent 60%), var(--surface-2); }
.plan .ph { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan h3 { font-size: var(--fs-3); font-weight: 600; }
.plan .price { font-size: var(--fs-5); font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.plan .price small { font-size: var(--fs-0); font-weight: 500; color: var(--ink-3); margin-left: 6px; letter-spacing: 0; }
.plan .lead { font-size: var(--fs-1); color: var(--ink-2); min-height: 2.9em; }
.plan ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: var(--fs-1); color: var(--ink); }
.plan ul li { display: flex; gap: 8px; align-items: flex-start; line-height: 1.4; }
.plan ul li .ic { color: var(--teal); width: 14px; height: 14px; margin-top: 2px; }
.plan ul li.inherit { color: var(--ink-2); }
.plan .pf { margin-top: auto; padding-top: 6px; }
.plan .pf .btn { width: 100%; }
.plan-total { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-1); color: var(--ink-2); }
.plan-total b { color: var(--ink); font-size: var(--fs-2); font-variant-numeric: tabular-nums; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: var(--fs-1); font-weight: 600; box-shadow: var(--shadow-pop); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 90; display: flex; align-items: center; gap: 8px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .ic { color: var(--teal-ink); background: var(--teal); border-radius: 50%; padding: 2px; width: 18px; height: 18px; }

/* Dropdown-Menü */
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow-pop); padding: 6px; display: none; z-index: 40; }
.menu.open { display: block; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 6px; background: transparent; border: 0; color: var(--ink-2); font-size: var(--fs-1); text-align: left; text-decoration: none; }
.menu a:hover, .menu button:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.menu .sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu .hd { padding: 6px 10px 8px; font-size: var(--fs-0); color: var(--ink-3); }

/* --------------------------------------------------------------------------
   Diagramme (Inline-SVG)
   -------------------------------------------------------------------------- */
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--font); font-size: 11px; fill: var(--ink-3); }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--line-2); stroke-width: 1; }
.chart .series { fill: none; stroke: var(--teal); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: url(#tealFade); }
.chart .forecast { fill: none; stroke: var(--warn); stroke-width: 2; stroke-dasharray: 5 4; }
.chart .limit { stroke: var(--crit); stroke-width: 1.2; stroke-dasharray: 4 4; }
.chart .limit-t { fill: var(--crit); font-weight: 500; }
.chart .cbar { fill: var(--teal); }
.chart .cbar.today { fill: var(--teal-dim); stroke: var(--teal); stroke-width: 1.5; }
.chart .cbar:hover { fill: var(--teal-2); }
.chart .val { fill: var(--ink-2); font-weight: 500; }
.chart .pt { fill: var(--teal); stroke: var(--surface); stroke-width: 2; }
.chart .pt.warn { fill: var(--warn); }
.chart .lbl { fill: var(--ink-2); font-weight: 500; }
.chart .lbl.warn { fill: var(--warn); }
.chart .cbar.over { fill: var(--warn); }
.chart .ref { stroke: var(--ink-2); stroke-width: 1.2; stroke-dasharray: 4 3; }
.chart .ref-t { fill: var(--ink-2); font-weight: 500; }
.bar i + i { position: absolute; top: 0; bottom: 0; }

/* Modulkopf (Fleet-/Intelligent-Seiten) */
.mod-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.mod-head h2 { font-size: var(--fs-5); font-weight: 600; letter-spacing: -0.02em; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mod-head .ic-box { width: 42px; height: 42px; border-radius: 12px; background: var(--teal-dim); color: var(--teal); display: grid; place-items: center; }
.mod-head p { color: var(--ink-2); max-width: 70ch; line-height: 1.55; margin-top: 10px; }
.state-dot { display: inline-flex; align-items: center; gap: 7px; }
.mini-stat { display: flex; flex-direction: column; gap: 2px; }
.mini-stat b { font-size: var(--fs-4); font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.mini-stat span { font-size: var(--fs-0); color: var(--ink-3); }

/* Fahrzeug-Schema (Draufsicht) */
.schema { width: 100%; height: auto; display: block; }
.schema .body { fill: var(--surface-2); stroke: var(--line-2); stroke-width: 1.5; }
.schema .cabin { fill: var(--surface-3); stroke: var(--line-2); stroke-width: 1.5; }
.schema .glass { fill: var(--teal-dim); stroke: var(--teal-line); stroke-width: 1; }
.schema .wheel { fill: var(--surface-3); stroke: var(--ink-3); stroke-width: 1.5; }
.schema .wheel.ok { stroke: var(--good); }
.schema .wheel.warn { stroke: var(--warn); fill: var(--warn-dim); }
.schema .wheel.crit { stroke: var(--crit); fill: var(--crit-dim); }
.schema .axle { stroke: var(--line-2); stroke-width: 2; }
.schema text { font-family: var(--font); font-size: 12px; fill: var(--ink-2); }
.schema text.v { font-size: 14px; font-weight: 600; fill: var(--ink); }
.schema text.v.warn { fill: var(--warn); }
.schema text.v.crit { fill: var(--crit); }
.schema text.k { fill: var(--ink-3); font-size: 11.5px; }
.schema .sensor { fill: var(--surface); stroke: var(--teal); stroke-width: 1.5; }
.schema .sensor.warn { stroke: var(--warn); }
.schema .lead { stroke: var(--line-2); stroke-width: 1; }
.schema .arrow { fill: var(--ink-3); }

/* Ladezustand-Ring */
.ring { position: relative; width: 132px; height: 132px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { fill: none; stroke: var(--surface-3); stroke-width: 9; }
.ring .fill { fill: none; stroke: var(--teal); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset 0.6s ease; }
.ring .fill.warn { stroke: var(--warn); } .ring .fill.crit { stroke: var(--crit); } .ring .fill.charge { stroke: var(--charge); }
.ring .c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.ring .c b { font-size: var(--fs-5); font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ring .c span { font-size: var(--fs-0); color: var(--ink-3); margin-top: 4px; }

/* Schematische Karte */
.map { width: 100%; height: auto; display: block; border-radius: 10px; background: var(--surface-2); }
.map .water { fill: #0a1518; }
.map .park { fill: #0d1611; }
.map .rail-line { stroke: #1f2a27; stroke-width: 3; stroke-dasharray: 10 6; fill: none; }
.map .road { stroke: #1f2a26; stroke-width: 2.5; fill: none; stroke-linecap: round; }
.map .road.main { stroke: #2b3833; stroke-width: 5; }
.map .road-name { font-family: var(--font); font-size: 10px; fill: var(--ink-3); letter-spacing: 0.02em; }
.map .place { font-family: var(--font); font-size: 10.5px; fill: var(--ink-2); font-weight: 500; }
.map .depot { fill: var(--surface); stroke: var(--teal); stroke-width: 2; }
.map .depot-r { fill: none; stroke: var(--teal-line); stroke-width: 1.5; stroke-dasharray: 4 4; }
.map .veh { cursor: pointer; }
.map .veh circle.m { fill: var(--teal); stroke: var(--bg); stroke-width: 2.5; }
.map .veh.ready circle.m { fill: var(--good); }
.map .veh.charging circle.m { fill: var(--charge); }
.map .veh.offline circle.m { fill: var(--ink-3); }
.map .veh.warn circle.m { fill: var(--warn); }
.map .veh.crit circle.m { fill: var(--crit); }
.map .veh circle.halo { fill: none; stroke: var(--teal); stroke-width: 1.5; opacity: 0; }
.map .veh.moving circle.halo { opacity: 0.45; animation: halo 2.4s ease-out infinite; }
.map .veh text { font-family: var(--font); font-size: 10.5px; font-weight: 600; fill: var(--ink); paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; }
.map .veh.selected circle.m { stroke: var(--ink); }
.map .geo { fill: rgba(0, 201, 167, 0.06); stroke: var(--teal-line); stroke-width: 1.5; stroke-dasharray: 6 4; }
.map .geo-t { font-family: var(--font); font-size: 10px; fill: var(--teal); }
.map .route { fill: none; stroke: var(--teal); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; opacity: 0.9; }
.map .route-pt { fill: var(--bg); stroke: var(--teal); stroke-width: 2.5; }
.map .route-pt.end { fill: var(--teal); }
@keyframes halo { 0% { r: 7; opacity: 0.5; } 100% { r: 16; opacity: 0; } }
.map-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: var(--fs-0); color: var(--ink-2); }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }

/* Responsiv */
@media (max-width: 1180px) {
  :root { --rail: 68px; --gutter: 20px; }
  .rail { padding: 16px 10px; }
  .rail-brand { padding: 2px 6px 14px; align-items: center; }
  .rail-brand .logo { display: none; }
  .rail-brand .logo-mark { display: block; }
  .rail-brand .product { display: none; }
  .rail-group-h { justify-content: center; padding: 0 0 6px; }
  .rail-group-h .gl { display: none; }
  .rail a.item { justify-content: center; padding: 10px 0; }
  .rail a.item .label, .rail a.item .lock { display: none; }
  .rail a.item.locked .ic { opacity: 0.5; }
  .rail-foot .tenant { grid-template-columns: 1fr; justify-items: center; padding: 6px; }
  .rail-foot .tenant div { display: none; }
  .grid.main-side { grid-template-columns: 1fr; }
  .topbar .search { width: 200px; }
  .topbar .userchip .who { display: none; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: fixed; left: 0; top: 0; width: 248px; transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: var(--shadow-pop); }
  .rail.open { transform: none; }
  .rail .rail-brand .logo { display: block; }
  .rail .rail-brand .logo-mark { display: none; }
  .rail .rail-brand .product { display: block; }
  .rail .rail-brand { align-items: flex-start; padding: 2px 10px 18px; }
  .rail-group-h { justify-content: space-between; padding: 0 10px 6px; }
  .rail-group-h .gl { display: inline; }
  .rail a.item { justify-content: flex-start; padding: 8px 10px; }
  .rail a.item .label, .rail a.item .lock { display: inline; }
  .rail-foot .tenant { grid-template-columns: 34px 1fr; justify-items: stretch; padding: 8px 10px; }
  .rail-foot .tenant div { display: block; }
  .rail-scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 25; display: none; }
  .rail-scrim.open { display: block; }
  .topbar .burger { display: grid; }
  .topbar .search { display: none; }
  .topbar .seg .seg-label { display: none; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .plans { grid-template-columns: 1fr; }
  :root { --gutter: 16px; }
}
@media (max-width: 560px) {
  .topbar { gap: 8px; }
  .topbar h1 { font-size: var(--fs-3); }
  .topbar .seg[data-plan-seg] { display: none; }
  .strip { grid-template-columns: repeat(2, 1fr); }
}
