/* ═════════════════════════════════════════════════════════════════════
   APPLE-GUI DESIGN SYSTEM
   Extrahiert 1:1 aus dem Driftwire-Frontend. Diese Datei komplett an den
   Anfang jedes neuen <style>-Blocks kopieren, dann NUR neue, projekt­-
   eigene Klassen ergänzen. Bestehende Klassen/Werte NICHT verändern -
   genau diese Werte machen den Look aus.
   ═════════════════════════════════════════════════════════════════════ */

/* ── Design-Token ─────────────────────────────────────────────────── */
:root{
  --bg:#f5f5f7;
  --surface:#ffffff;
  --surface-2:#fafafc;
  --surface-3:#f0f0f3;
  --chrome:rgba(251,251,253,.72);

  --line:rgba(0,0,0,.09);
  --line-2:rgba(0,0,0,.055);
  --line-3:rgba(0,0,0,.16);

  --tx:#1d1d1f;
  --tx-2:#6e6e73;
  --tx-3:#8e8e93;
  --tx-4:#aeaeb2;

  --accent:#0071e3;
  --accent-2:#0077ed;
  --accent-soft:rgba(0,113,227,.10);
  --accent-line:rgba(0,113,227,.28);

  --green:#1a8038;   --green-soft:rgba(40,175,80,.12);
  --red:#d70015;     --red-soft:rgba(255,59,48,.11);
  --amber:#9a6300;   --amber-soft:rgba(255,159,10,.14);

  --r-xs:7px; --r-sm:10px; --r:14px; --r-lg:18px; --r-xl:24px;
  --pill:980px;

  --sh-1:0 1px 1px rgba(0,0,0,.03), 0 1px 3px rgba(0,0,0,.045);
  --sh-2:0 2px 6px rgba(0,0,0,.045), 0 12px 32px rgba(0,0,0,.06);
  --sh-3:0 24px 64px rgba(0,0,0,.20), 0 2px 8px rgba(0,0,0,.10);

  --sans:"Inter",-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Roboto,sans-serif;
  --mono:ui-monospace,"SF Mono",SFMono-Regular,"JetBrains Mono","Cascadia Mono",Menlo,monospace;

  --side:256px;
}
/* Dark Mode ausschließlich über die Klasse `dunkel` auf <html>, NIE über
   eine reine prefers-color-scheme-Media-Query — sonst gibt es zwei
   Quellen für dieselbe Entscheidung. Ein kleines Inline-Script setzt die
   Klasse vor dem ersten Bild aus System-Präferenz oder gespeicherter Wahl:
     <script>
       if(matchMedia('(prefers-color-scheme: dark)').matches ||
          localStorage.getItem('theme')==='dunkel')
         document.documentElement.classList.add('dunkel');
     </script>
*/
:root.dunkel{
    --bg:#000000;
    --surface:#161618;
    --surface-2:#1c1c1e;
    --surface-3:#242426;
    --chrome:rgba(24,24,26,.72);

    --line:rgba(255,255,255,.10);
    --line-2:rgba(255,255,255,.065);
    --line-3:rgba(255,255,255,.20);

    --tx:#f5f5f7;
    --tx-2:#a1a1a6;
    --tx-3:#86868b;
    --tx-4:#5c5c61;

    --accent:#0a84ff;
    --accent-2:#3d9bff;
    --accent-soft:rgba(10,132,255,.16);
    --accent-line:rgba(10,132,255,.38);

    --green:#30d158;   --green-soft:rgba(48,209,88,.15);
    --red:#ff453a;     --red-soft:rgba(255,69,58,.15);
    --amber:#ffb340;   --amber-soft:rgba(255,179,64,.15);

    --sh-1:0 1px 2px rgba(0,0,0,.5);
    --sh-2:0 2px 8px rgba(0,0,0,.45);
    --sh-3:0 24px 64px rgba(0,0,0,.7);
}

/* ── Reset & Basis ────────────────────────────────────────────────── */
*{box-sizing:border-box; margin:0; padding:0}
[hidden]{display:none !important}
html{-webkit-text-size-adjust:100%; scroll-behavior:smooth}
body{
  background:var(--bg); color:var(--tx);
  font-family:var(--sans); font-size:14px; line-height:1.47;
  letter-spacing:-.004em;
  -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
  font-variant-numeric:tabular-nums;
}
button,input,textarea,select{font:inherit; color:inherit; letter-spacing:inherit}
a{color:var(--accent); text-decoration:none}
a:hover{text-decoration:underline}
::selection{background:var(--accent-soft)}
:focus-visible{outline:2px solid var(--accent); outline-offset:2px; border-radius:6px}

::-webkit-scrollbar{width:11px; height:11px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{
  background:var(--line-3); border-radius:99px;
  border:3px solid transparent; background-clip:content-box;
}
::-webkit-scrollbar-thumb:hover{background:var(--tx-4); background-clip:content-box; border:3px solid transparent}

/* ── Grundgerüst: Sidebar + Hauptbereich ──────────────────────────── */
.shell{display:flex; min-height:100vh}

.side{
  position:fixed; inset:0 auto 0 0; width:var(--side); z-index:30;
  display:flex; flex-direction:column;
  padding:18px 12px 14px;
  background:var(--chrome);
  -webkit-backdrop-filter:saturate(180%) blur(24px);
  backdrop-filter:saturate(180%) blur(24px);
  border-right:1px solid var(--line-2);
}
.brand{display:flex; align-items:center; gap:10px; padding:2px 10px 20px}
.glyph{
  width:28px; height:28px; flex:none; border-radius:8px;
  background:linear-gradient(155deg,#5ad2fb 0%,#0a84ff 46%,#6b4ef9 100%);
  box-shadow:0 1px 2px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.35);
  display:grid; place-items:center;
}
.glyph svg{width:17px; height:17px; stroke:#fff; stroke-width:2.1; fill:none;
  stroke-linecap:round; stroke-linejoin:round}
.glyph svg .dot{fill:#fff; stroke:none}
.brand .nm{font-size:14px; font-weight:600; letter-spacing:-.015em; line-height:1.2}
.brand .sb{font-size:11px; color:var(--tx-3); letter-spacing:-.003em; margin-top:1px}

.navgrp{padding:0 0 4px}
.navgrp .cap{
  font-size:10.5px; font-weight:600; letter-spacing:.055em; text-transform:uppercase;
  color:var(--tx-4); padding:12px 12px 6px;
}
.nav{display:flex; align-items:center; gap:10px; width:100%;
  padding:7px 10px; border:0; background:none; border-radius:var(--r-xs);
  font-size:13.5px; font-weight:450; color:var(--tx-2); cursor:pointer;
  text-align:left; transition:background .13s ease, color .13s ease;
}
.nav svg{width:17px; height:17px; flex:none; stroke:currentColor; fill:none;
  stroke-width:1.65; stroke-linecap:round; stroke-linejoin:round; opacity:.85}
.nav:hover{background:var(--line-2); color:var(--tx)}
.nav.on{background:var(--accent); color:#fff; font-weight:520}
.nav.on svg{opacity:1; stroke-width:1.8}
.nav .grow{flex:1}
.nav .mark{width:6px; height:6px; border-radius:50%; background:var(--accent); flex:none}
.nav .mark.warn{background:var(--amber)}
.nav .mark.hot{background:var(--red)}
.nav.on .mark{background:#fff}

.side-foot{margin-top:auto; padding-top:12px}
.statuscard{
  display:flex; align-items:center; gap:9px;
  padding:10px 11px; border-radius:var(--r);
  background:var(--surface); border:1px solid var(--line-2);
  box-shadow:var(--sh-1);
}
.statuscard .beacon{width:8px; height:8px; border-radius:50%; flex:none; background:var(--tx-4)}
.statuscard.good .beacon{background:var(--green); box-shadow:0 0 0 3px var(--green-soft)}
.statuscard.bad .beacon{background:var(--red); box-shadow:0 0 0 3px var(--red-soft); animation:puls 2.2s ease-in-out infinite}
@keyframes puls{0%,100%{opacity:1}50%{opacity:.45}}
.statuscard .t{font-size:12.5px; font-weight:550; letter-spacing:-.008em; line-height:1.25}
.statuscard .s{font-size:10.5px; color:var(--tx-3); margin-top:1px}

.main{flex:1; min-width:0; margin-left:var(--side)}
.toolbar{
  position:sticky; top:0; z-index:20;
  display:flex; align-items:flex-end; gap:16px;
  padding:26px 40px 18px;
  background:linear-gradient(var(--bg) 62%,transparent);
}
.toolbar.stuck{
  padding-top:14px; padding-bottom:14px; align-items:center;
  background:var(--chrome);
  -webkit-backdrop-filter:saturate(180%) blur(22px);
  backdrop-filter:saturate(180%) blur(22px);
  border-bottom:1px solid var(--line-2);
}
.toolbar h1{font-size:26px; font-weight:640; letter-spacing:-.028em; line-height:1.15}
.toolbar.stuck h1{font-size:17px; letter-spacing:-.018em}
.toolbar .lede{font-size:13px; color:var(--tx-3); margin-top:3px; max-width:64ch}
.toolbar.stuck .lede{display:none}
.toolbar .grow{flex:1}
.stamp{font-size:11.5px; color:var(--tx-4); white-space:nowrap; padding-bottom:4px}
.toolbar.stuck .stamp{padding-bottom:0}

.wrap{padding:6px 40px 96px; max-width:1240px}

/* ── Karten ───────────────────────────────────────────────────────── */
.card{
  background:var(--surface); border:1px solid var(--line-2);
  border-radius:var(--r-lg); box-shadow:var(--sh-1);
  margin-bottom:20px; overflow:hidden;
}
.card-h{display:flex; align-items:center; gap:9px; flex-wrap:wrap;
  padding:15px 20px; border-bottom:1px solid var(--line-2)}
.card-h h2{font-size:14.5px; font-weight:600; letter-spacing:-.014em}
.card-h .grow{flex:1}
.card-h .aside{font-size:11.5px; color:var(--tx-4)}
.card-b{padding:18px 20px}
.card-b.flush{padding:0}
.card-f{padding:11px 20px; border-top:1px solid var(--line-2);
  background:var(--surface-2); font-size:12px; color:var(--tx-3);
  display:flex; align-items:center; gap:10px}
.card-f .grow{flex:1}

.grid{display:grid; gap:20px; margin-bottom:20px}
.grid.two{grid-template-columns:1fr 1fr}
.grid.lead{grid-template-columns:minmax(0,1.55fr) minmax(0,1fr)}
.grid > .card{margin-bottom:0}

/* ── Kennzahlen-Kacheln (KPI) ─────────────────────────────────────── */
.kpis{display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:20px}
.kpi{background:var(--surface); border:1px solid var(--line-2);
  border-radius:var(--r-lg); padding:16px 18px 15px; box-shadow:var(--sh-1); min-width:0}
.kpi .k{font-size:10.5px; font-weight:600; letter-spacing:.055em;
  text-transform:uppercase; color:var(--tx-3)}
.kpi .v{margin-top:8px; font-size:29px; font-weight:600; letter-spacing:-.03em;
  line-height:1.05; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.kpi .v.nil{color:var(--tx-4); font-weight:520}
.kpi .v .u{font-size:16px; font-weight:500; color:var(--tx-3); letter-spacing:-.01em}
.kpi .s{margin-top:7px; font-size:11.5px; color:var(--tx-4)}
.kpi .s b{font-weight:550; color:var(--tx-3)}

.up{color:var(--green)} .down{color:var(--red)} .flat{color:var(--tx-3)}

/* ── Chips, Badges ────────────────────────────────────────────────── */
.chip{display:inline-flex; align-items:center; gap:5px;
  height:22px; padding:0 9px; border-radius:var(--pill);
  background:var(--surface-3); color:var(--tx-2);
  font-size:11.5px; font-weight:500; letter-spacing:-.004em; white-space:nowrap}
.chip.key{background:var(--accent-soft); color:var(--accent)}
.chip.good{background:var(--green-soft); color:var(--green)}
.chip.warn{background:var(--amber-soft); color:var(--amber)}
.chip.bad{background:var(--red-soft); color:var(--red)}
.chip .dot{width:6px; height:6px; border-radius:50%; background:currentColor; opacity:.9}

.badge{display:inline-flex; align-items:center; height:21px; padding:0 8px;
  border-radius:6px; font-size:11px; font-weight:600; letter-spacing:.005em;
  background:var(--surface-3); color:var(--tx-2)}
.badge.good{background:var(--green-soft); color:var(--green)}
.badge.warn{background:var(--amber-soft); color:var(--amber)}
.badge.bad{background:var(--red-soft); color:var(--red)}
.badge.key{background:var(--accent-soft); color:var(--accent)}

/* ── Bedienelemente ───────────────────────────────────────────────── */
.btn{display:inline-flex; align-items:center; justify-content:center; gap:6px;
  height:32px; padding:0 15px; border:0; border-radius:var(--pill);
  font-size:13px; font-weight:520; letter-spacing:-.006em; cursor:pointer;
  background:var(--surface-3); color:var(--tx);
  transition:background .13s ease, opacity .13s ease, transform .08s ease;
  white-space:nowrap}
.btn:hover{background:var(--line)}
.btn:active{transform:scale(.975)}
.btn:disabled{opacity:.42; cursor:default; transform:none}
.btn.pri{background:var(--accent); color:#fff}
.btn.pri:hover{background:var(--accent-2)}
.btn.dan{background:var(--red-soft); color:var(--red)}
.btn.dan:hover{background:var(--red); color:#fff}
.btn.solid-dan{background:var(--red); color:#fff}
.btn.solid-dan:hover{filter:brightness(1.08)}
.btn.sm{height:27px; padding:0 11px; font-size:12px}
.btn.ghost{background:transparent; color:var(--accent)}
.btn.ghost:hover{background:var(--accent-soft)}

.inp{height:32px; width:100%; padding:0 12px;
  background:var(--surface-2); color:var(--tx);
  border:1px solid var(--line); border-radius:var(--r-xs);
  font-size:13px; transition:border-color .13s ease, box-shadow .13s ease, background .13s ease}
.inp::placeholder{color:var(--tx-4)}
.inp:hover{border-color:var(--line-3)}
.inp:focus{outline:0; border-color:var(--accent); background:var(--surface);
  box-shadow:0 0 0 3.5px var(--accent-soft)}
.inp.mono{font-family:var(--mono); font-size:12px; letter-spacing:-.01em}
textarea.inp{height:auto; min-height:104px; padding:10px 12px; resize:vertical;
  font-family:var(--mono); font-size:12px; line-height:1.65}
select.inp{width:auto; min-width:172px; cursor:pointer}

.seg{display:inline-flex; padding:2px; gap:2px; border-radius:9px; background:var(--surface-3)}
.seg button{border:0; background:transparent; cursor:pointer; border-radius:7px;
  height:25px; padding:0 11px; font-size:12px; font-weight:500; color:var(--tx-2);
  transition:background .14s ease, color .14s ease, box-shadow .14s ease}
.seg button:hover{color:var(--tx)}
.seg button.on{background:var(--surface); color:var(--tx); font-weight:550;
  box-shadow:0 1px 2px rgba(0,0,0,.10)}

.sw{position:relative; display:inline-block; width:42px; height:25px; flex:none}
.sw input{position:absolute; opacity:0; width:0; height:0}
.sw i{position:absolute; inset:0; border-radius:var(--pill); background:var(--line-3);
  cursor:pointer; transition:background .22s cubic-bezier(.4,.1,.2,1)}
.sw i::after{content:""; position:absolute; top:2px; left:2px; width:21px; height:21px;
  border-radius:50%; background:#fff;
  box-shadow:0 1px 3px rgba(0,0,0,.25), 0 0 0 .5px rgba(0,0,0,.05);
  transition:transform .22s cubic-bezier(.4,.1,.2,1)}
.sw input:checked + i{background:#30d158}
.sw input:checked + i::after{transform:translateX(17px)}
.sw input:disabled + i{opacity:.4; cursor:not-allowed}
.sw.danger input:checked + i{background:var(--red)}

/* ── Tabellen ─────────────────────────────────────────────────────── */
.tw{overflow-x:auto; -webkit-overflow-scrolling:touch}
table{width:100%; border-collapse:collapse; font-size:13px}
thead th{position:sticky; top:0; padding:9px 14px; text-align:left; white-space:nowrap;
  font-size:10.5px; font-weight:600; letter-spacing:.05em; text-transform:uppercase;
  color:var(--tx-4); background:var(--surface-2); border-bottom:1px solid var(--line-2)}
thead th.r{text-align:right}
tbody td{padding:11px 14px; border-bottom:1px solid var(--line-2);
  vertical-align:middle; white-space:nowrap}
tbody tr:last-child td{border-bottom:0}
tbody tr{transition:background .1s ease}
tbody tr:hover{background:var(--surface-2)}
tbody tr.dim td{opacity:.5}
tbody tr.flagged{background:var(--amber-soft)}
td.r{text-align:right}
.num{font-family:var(--mono); font-size:12px; letter-spacing:-.015em}
.num.zero{color:var(--tx-4)}
.nme{font-weight:550; letter-spacing:-.008em}
.nme.anon{color:var(--tx-4); font-weight:450; font-style:italic}
.sub{color:var(--tx-4); font-size:12px}

/* ── Avatar mit Initialen (deterministische Farbe je Identität) ──────
   --h wird per Hash aus dem Namen/Key berechnet, siehe references/
   components.md. Fällt ein Bild aus, bleibt der Farbkreis mit Initialen
   stehen statt einer leeren Lücke. */
.ava{position:relative; width:28px; height:28px; flex:none; border-radius:50%;
  display:grid; place-items:center; overflow:hidden;
  background:hsl(var(--h,210) 60% 50% / .16); color:hsl(var(--h,210) 55% 42%);
  box-shadow:inset 0 0 0 1px var(--line-2);
  font-size:9.5px; font-weight:700; letter-spacing:.01em; line-height:1;
  font-family:var(--sans); user-select:none}
.ava img{position:absolute; inset:0; width:100%; height:100%; object-fit:cover;
  background:var(--surface-2)}
.ava.tap{cursor:pointer}
.ava.tap:hover{filter:brightness(1.08)}
.ava.sm{width:22px; height:22px; font-size:8.5px}

/* ── Leerzustände & Hinweise ──────────────────────────────────────── */
.empty{padding:52px 24px; text-align:center}
.empty .ic{width:44px; height:44px; margin:0 auto 14px; border-radius:12px;
  background:var(--surface-3); display:grid; place-items:center}
.empty .ic svg{width:21px; height:21px; stroke:var(--tx-4); fill:none;
  stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round}
.empty .h{font-size:14px; font-weight:550; letter-spacing:-.012em}
.empty .s{margin-top:5px; font-size:12.5px; color:var(--tx-3); max-width:44ch;
  margin-left:auto; margin-right:auto}

.note{display:flex; gap:10px; align-items:flex-start;
  padding:11px 14px; border-radius:var(--r-sm);
  background:var(--surface-2); font-size:12.5px; color:var(--tx-2); overflow-wrap:anywhere}
.note.amber{background:var(--amber-soft); color:var(--amber)}
.note .ic{flex:none; width:15px; height:15px; margin-top:1px}
.note .ic svg{width:15px; height:15px; stroke:currentColor; fill:none; stroke-width:1.7;
  stroke-linecap:round; stroke-linejoin:round}

/* ── Schlüssel/Wert-Zeilen (Detailansichten, Einstellungen) ──────── */
.kv{display:flex; align-items:center; flex-wrap:wrap; gap:7px 14px;
  padding:10px 20px; border-bottom:1px solid var(--line-2); font-size:13px}
.kv:last-child{border-bottom:0}
.kv > span:first-child{color:var(--tx-3); flex:0 1 auto; min-width:0}
.kv .grow{flex:1 0 12px}
.kv .val{font-weight:500; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.kv .chips{display:flex; gap:6px; flex-wrap:wrap}

.kvh{display:flex; align-items:center; gap:9px; padding:9px 20px;
  background:var(--surface-2); border-top:1px solid var(--line-2); border-bottom:1px solid var(--line-2)}
.kvh:first-child{border-top:0}
.kvh .n{font-size:11px; font-weight:600; letter-spacing:.055em; text-transform:uppercase; color:var(--tx-3)}
.kvh .grow{flex:1}

.opt{align-items:center; padding:13px 20px}
.opt .ot{display:flex; flex-direction:column; gap:2px; flex:1 1 210px}
.opt .ot b{font-size:13px; font-weight:550; color:var(--tx); letter-spacing:-.008em}
.opt .ot i{font-style:normal; font-size:11.5px; line-height:1.45; color:var(--tx-4)}

/* ── Fortschrittsbalken ───────────────────────────────────────────── */
.meter{height:5px; border-radius:99px; background:var(--surface-3); overflow:hidden}
.meter i{display:block; height:100%; border-radius:99px; background:var(--accent);
  transition:width .4s cubic-bezier(.4,0,.2,1)}
.meter i.good{background:var(--green)}

/* ── Dichte Ansicht (kompakte Abstände per Klasse auf <html>) ─────── */
:root.dicht .card-h{padding:11px 16px}
:root.dicht .card-b{padding:13px 16px}
:root.dicht .kv,:root.dicht .opt{padding:7px 16px}
:root.dicht .kvh{padding:6px 16px}
:root.dicht tbody td{padding:7px 14px}
:root.dicht .kpi{padding:12px 14px 11px}
:root.dicht .kpi .v{font-size:24px}
:root.dicht .card,:root.dicht .grid,:root.dicht .kpis{margin-bottom:14px}

/* ── Bewegung reduzieren (Klasse `ruhig` auf <html>) ──────────────── */
:root.ruhig *,:root.ruhig *::before,:root.ruhig *::after{
  transition-duration:0s !important; animation-duration:0s !important;
  animation-iteration-count:1 !important; scroll-behavior:auto !important;
}

/* ── Modal / Dialog (Bestätigungen, kurze Formulare) ──────────────── */
.modal{position:fixed; inset:0; z-index:70; display:grid; place-items:center;
  padding:24px; background:rgba(0,0,0,.4);
  -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px);
  animation:fade .18s ease}
@keyframes fade{from{opacity:0}to{opacity:1}}
.modal-box{width:min(430px,100%); max-height:100%; overflow:auto;
  background:var(--surface); border:1px solid var(--line-2);
  border-radius:var(--r-lg); box-shadow:var(--sh-3);
  animation:rise .24s cubic-bezier(.2,.9,.3,1)}
@keyframes rise{from{opacity:0; transform:translateY(14px) scale(.985)}to{opacity:1; transform:none}}
.modal-h{display:flex; align-items:center; gap:11px; padding:18px 20px 0}
.modal-h .ic{width:30px; height:30px; flex:none; border-radius:50%;
  display:grid; place-items:center; background:var(--accent-soft); color:var(--accent)}
.modal-h .ic svg{width:17px; height:17px; fill:none; stroke:currentColor;
  stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round}
.modal-h h3{font-size:15px; font-weight:600; letter-spacing:-.015em}
.modal-b{padding:13px 20px 0; font-size:13px; line-height:1.62; color:var(--tx-2)}
.modal-b b{color:var(--tx); font-weight:600}
.modal-f{display:flex; flex-direction:column; gap:9px; padding:16px 20px 18px}

/* ── Vollflächiges Sheet (Detailansicht, z.B. Chart, Foto, Editor) ── */
.sheet{position:fixed; inset:0; z-index:60; display:grid; place-items:center;
  padding:28px; background:rgba(0,0,0,.34);
  -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px);
  animation:fade .18s ease}
.sheet-box{width:min(1180px,100%); height:min(720px,100%);
  display:flex; flex-direction:column; overflow:hidden;
  background:var(--surface); border:1px solid var(--line-2);
  border-radius:var(--r-xl); box-shadow:var(--sh-3);
  animation:rise .24s cubic-bezier(.2,.9,.3,1)}
.sheet-h{display:flex; align-items:center; gap:10px; flex:none;
  padding:12px 16px; border-bottom:1px solid var(--line-2)}
.sheet-h .grow{flex:1}
.sheet-c{position:relative; flex:1; min-height:0; overflow:auto; padding:20px}

/* ── Responsive: Sidebar wird zur horizontalen Leiste ─────────────── */
@media (max-width:1080px){
  .grid.two,.grid.lead{grid-template-columns:1fr}
  .kpis{grid-template-columns:repeat(2,1fr)}
}
@media (max-width:860px){
  :root{--side:0px}
  .side{position:sticky; inset:auto; width:auto; flex-direction:row; align-items:center;
    gap:6px; padding:9px 14px; border-right:0; border-bottom:1px solid var(--line-2);
    overflow-x:auto}
  .brand{padding:0 10px 0 0}
  .brand .sb{display:none}
  .navgrp{display:contents}
  .navgrp .cap{display:none}
  .nav{width:auto; padding:6px 11px; white-space:nowrap}
  .nav svg{display:none}
  .side-foot{margin:0 0 0 auto; padding:0}
  .statuscard{padding:6px 10px}
  .statuscard .s{display:none}
  .main{margin-left:0}
  .toolbar{padding:20px 20px 14px}
  .toolbar h1{font-size:22px}
  .wrap{padding:4px 20px 72px}
  .kpis{grid-template-columns:1fr 1fr; gap:10px}
  .kv > span:first-child{width:130px}
  .hide-sm{display:none}
}
