/* Dashboard-Design (Helpingbrands-Standard) – siehe SKILL.md
   Hell, weich, runde Karten, schwarze Pillen als Akzent, grün/orange nur für Zahlen-Signale.
   Alle Farben sind Tokens; Dunkelmodus unten. Keine festen Höhen an Textboxen. */

:root {
  --bg-1: #fbeee8;            /* Seitenverlauf links oben (Pfirsich) */
  --bg-2: #e6f4ec;            /* Seitenverlauf rechts oben (Mint) */
  --bg-base: #f4f5f3;
  --shell: #ffffff;           /* große Hülle um alles */
  --panel: #f6f6f4;           /* Fläche hinter den Karten */
  --card: #ffffff;
  --chip: #f0f0ee;            /* runde Icon-Buttons, Suche, Filter */
  --line: #ececea;
  --ink: #0b0b0b;             /* Text + schwarze Pillen */
  --ink-2: #1d1d1d;
  --muted: #5f6460;           /* ≥ 4,5:1 auf Weiß */
  --on-ink: #ffffff;
  --green: #16a34a;           /* Balken-Badges, Gauge */
  --green-ink: #0f7a38;       /* grüner Text auf hellem Grund (Kontrast) */
  --green-soft: #dcf4e4;
  --orange: #f0551f;
  --orange-ink: #b8400f;
  --orange-soft: #fde6dc;
  --blue-ink: #14609e;
  --blue-soft: #e1f1fc;
  --hatch: rgba(0, 0, 0, .045);
  --shadow-shell: 0 30px 60px -20px rgba(40, 50, 45, .22), 0 6px 18px rgba(40, 50, 45, .06);
  --shadow-card: 0 1px 0 rgba(0, 0, 0, .02);

  --r-shell: 36px;
  --r-panel: 30px;
  --r-card: 24px;
  --r-tile: 18px;
  --r-pill: 999px;

  --font: "Inter", "Inter Variable", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg-1:#2a1d19; --bg-2:#162a20; --bg-base:#0e0f0e; --shell:#151616; --panel:#101111; --card:#1b1c1c; --chip:#262827; --line:#2b2d2c; --ink:#f4f4f2; --ink-2:#e8e8e6; --muted:#a3a8a4; --on-ink:#0b0b0b; --green-ink:#5fd68a; --green-soft:#16301f; --orange-ink:#ff9a72; --orange-soft:#38211a; --blue-ink:#7cc0f0; --blue-soft:#162a38; --hatch:rgba(255,255,255,.05); --shadow-shell:0 30px 60px -20px #000; }
}
:root[data-theme="dark"] { --bg-1:#2a1d19; --bg-2:#162a20; --bg-base:#0e0f0e; --shell:#151616; --panel:#101111; --card:#1b1c1c; --chip:#262827; --line:#2b2d2c; --ink:#f4f4f2; --ink-2:#e8e8e6; --muted:#a3a8a4; --on-ink:#0b0b0b; --green-ink:#5fd68a; --green-soft:#16301f; --orange-ink:#ff9a72; --orange-soft:#38211a; --blue-ink:#7cc0f0; --blue-soft:#162a38; --hatch:rgba(255,255,255,.05); --shadow-shell:0 30px 60px -20px #000; }

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light dark; }
body {
  margin: 0; min-height: 100dvh; color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.4;
  background:
    radial-gradient(900px 500px at 0% 0%, var(--bg-1), transparent 70%),
    radial-gradient(900px 500px at 100% 0%, var(--bg-2), transparent 70%),
    var(--bg-base);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3, .num { letter-spacing: -.025em; }
button { font: inherit; color: inherit; cursor: pointer; }

/* ---------- Hülle ---------- */
.shell {
  max-width: 1480px; margin: clamp(8px, 3vw, 40px) auto; background: var(--shell);
  border-radius: var(--r-shell); box-shadow: var(--shadow-shell); padding: 16px;
  display: grid; grid-template-columns: 252px 1fr; grid-template-rows: auto 1fr; gap: 0 20px;
}
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 4px 8px 16px; }
.topbar .grow { flex: 1; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 232px; }
.logo { width: 48px; height: 48px; border-radius: 50%; background: var(--ink); color: var(--on-ink); display: grid; place-items: center; font-weight: 700; }
.brand b { font-size: 15px; font-weight: 600; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.tag { background: var(--green-soft); color: var(--green-ink); font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: var(--r-pill); margin-left: 6px; }
.search { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px; background: var(--chip); border-radius: var(--r-pill); padding: 0 18px; height: 46px; color: var(--muted); }
.search input { flex: 1; border: 0; background: none; font: inherit; color: var(--ink); outline: none; min-width: 0; }
.search kbd { font: inherit; font-size: 12px; }

/* ---------- Buttons ---------- */
.btn-round { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--chip); display: inline-grid; place-items: center; flex: none; }
.btn-round.sm { width: 40px; height: 40px; }
.btn-pill { height: 44px; padding: 0 20px; border-radius: var(--r-pill); border: 0; background: var(--chip); display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.btn-ink { background: var(--ink); color: var(--on-ink); box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }
.btn-round:focus-visible, .btn-pill:focus-visible, .nav a:focus-visible, .search input:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.btn-round:active, .btn-pill:active { transform: scale(.97); }
@media (prefers-reduced-motion: no-preference) { .btn-round, .btn-pill { transition: transform .14s ease-out, background-color .18s ease-out; } }
@media (hover: hover) { .btn-round:hover, .btn-pill:not(.btn-ink):hover { background: var(--line); } }

/* ---------- Seitenleiste ---------- */
.side { padding: 4px 8px 8px; display: flex; flex-direction: column; min-height: 0; }
.crumbs { color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.crumbs b { color: var(--ink); font-weight: 500; }
.hello { font-size: 28px; line-height: 1.12; font-weight: 600; margin-bottom: 20px; }
.nav-group { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 8px; }
.nav-label { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 10px; }
.nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 16px; border-radius: var(--r-pill); color: var(--ink); text-decoration: none; font-weight: 500; }
.nav a[aria-current="page"] { background: var(--ink); color: var(--on-ink); box-shadow: inset 0 1px 0 rgba(255,255,255,.16); }
.nav .count { margin-left: auto; background: var(--orange); color: #fff; font-size: 11px; font-weight: 600; min-width: 20px; height: 20px; border-radius: var(--r-pill); display: grid; place-items: center; padding: 0 6px; }
.nav svg { width: 18px; height: 18px; flex: none; }
.me { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--chip); display: grid; place-items: center; font-weight: 600; flex: none; }

/* ---------- Inhalt ---------- */
.content { background: var(--panel); border-radius: var(--r-panel); padding: 14px; display: grid; gap: 14px; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-content: start; min-width: 0; }
.card { background: var(--card); border-radius: var(--r-card); padding: 18px; box-shadow: var(--shadow-card); min-width: 0; position: relative; overflow: hidden; }
.card.wide { grid-column: 1; }
.card.hero { background: linear-gradient(115deg, var(--orange-soft) 0%, var(--card) 38%, var(--green-soft) 100%); }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head h2 { font-size: 20px; font-weight: 500; margin-right: auto; }
.card-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--chip); display: grid; place-items: center; flex: none; }
.dots { letter-spacing: 3px; font-weight: 700; }

/* Kennzahl */
.num { font-size: 40px; font-weight: 600; line-height: 1.05; }
.delta { color: var(--green-ink); font-weight: 600; font-size: 13px; }
.delta.neg { color: var(--orange-ink); }
.sub { color: var(--muted); font-size: 13px; }

/* Badges */
.badge { display: inline-block; white-space: nowrap; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: var(--r-pill); color: #fff; background: var(--green); }
.badge.neg { background: var(--orange); }
.status { display: inline-block; padding: 6px 14px; border-radius: var(--r-pill); font-weight: 500; }
.status.ok { background: var(--green-soft); color: var(--green-ink); }
.status.bad { background: var(--orange-soft); color: var(--orange-ink); }
.status.wait { background: var(--blue-soft); color: var(--blue-ink); }

/* Balkendiagramm: Balken sind gestreift, der gewählte ist schwarz */
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 12px; align-items: end; height: 220px; padding-top: 8px; border-bottom: 1px dashed var(--line); }
.bar { position: relative; border-radius: 22px; min-height: 40px; border: 0; padding: 0;
  background: repeating-linear-gradient(135deg, var(--hatch) 0 6px, transparent 6px 12px), var(--chip); }
.bar[aria-pressed="true"] { background: repeating-linear-gradient(135deg, #000 0 6px, #232323 6px 12px); }
.bar .badge { position: absolute; left: 50%; top: 38%; transform: translateX(-50%); }
.bar-labels { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 12px; text-align: center; color: var(--muted); padding-top: 10px; }
.tip { background: var(--ink); color: var(--on-ink); border-radius: 14px; padding: 10px 14px; font-size: 12px; display: inline-block; }

/* Gauge (siehe vorlage.html für das SVG) */
.gauge { position: relative; display: grid; place-items: center; margin-bottom: 18px; }
.gauge .val { position: absolute; bottom: 4%; text-align: center; }
.gauge .val b { display: block; font-size: 44px; font-weight: 600; letter-spacing: -.03em; line-height: 1; }

/* Kachel-Paare */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { background: var(--panel); border-radius: var(--r-tile); padding: 14px; display: grid; gap: 14px; }
.tile .row { display: flex; justify-content: space-between; align-items: center; color: var(--muted); }
.tile b { font-size: 28px; font-weight: 600; letter-spacing: -.03em; }

/* Hinweisleiste (schwarz, Schließen-Knopf) */
.toast { display: flex; align-items: center; gap: 12px; background: var(--ink); color: var(--on-ink); border-radius: var(--r-pill); padding: 10px 10px 10px 18px; margin-top: 12px; }
.toast span { flex: 1; }
.toast button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: inherit; }

/* Tabelle */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 560px; font-size: 13px; }
th:first-child, td:first-child { width: 28px; padding-right: 0; }
.thumb { width: 40px; height: 40px; }
th { text-align: left; color: var(--muted); font-weight: 400; padding: 10px 8px; }
td { padding: 12px 8px; border-top: 1px solid var(--line); white-space: nowrap; }
td small { display: block; color: var(--muted); }
.cell { display: flex; align-items: center; gap: 12px; }
.thumb { width: 46px; height: 46px; border-radius: 14px; background: var(--chip); display: grid; place-items: center; flex: none; }
.who { display: flex; align-items: center; gap: 8px; }
.who .avatar { width: 28px; height: 28px; font-size: 11px; }
.check { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--line); background: var(--card); accent-color: var(--green); }

/* Ranglisten-Zeilen (Top Market) */
.rank { display: grid; gap: 10px; }
.rank-row { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: var(--r-tile); padding: 14px 16px; background: var(--card); }
.rank-row.first { border: 2px solid var(--ink); }
.rank-row .grow { flex: 1; color: var(--muted); }
.rank-row b { font-weight: 600; }

/* Produkt-Kacheln (erste dunkel gestreift) */
.prod { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.prod > div { border-radius: var(--r-tile); padding: 12px; min-height: 150px; display: flex; flex-direction: column; justify-content: flex-end; background: var(--card); border: 1px solid var(--line); }
.prod > div:first-child { background: repeating-linear-gradient(135deg, #000 0 6px, #232323 6px 12px); color: #fff; border: 0; }
.prod small { color: var(--muted); } .prod > div:first-child small { color: #cfd3d0; } .prod > div:first-child .delta { color: #6fe39a; }

/* ---------- Responsiv ---------- */
@media (max-width: 1100px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }               /* auf schmalen Schirmen: Menü hinter einen Knopf legen */
  .content { grid-template-columns: 1fr; }
  .brand { min-width: 0; }
}
@media (max-width: 560px) {
  .topbar .search, .topbar .hide-sm { display: none; }
  .num { font-size: 32px; }
  .bars { gap: 6px; height: 180px; }
  .tiles { grid-template-columns: 1fr; }
}
