:root {
  --bg: #f6f6f3; --card: #ffffff; --ink: #1d1d1b; --quiet: #6b6b66; --line: #e3e2dc;
  --accent: #2a5bd7; --accent-ink: #fff; --good: #1f8a4c; --warn: #b7791f; --bad: #c0392b;
  --chip: #efeee9; --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #151514; --card: #1f1f1d; --ink: #ecebe6; --quiet: #9a9993; --line: #33332f;
    --accent: #6f95f2; --accent-ink: #0d0d0c; --chip: #2a2a27; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
header { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
nav { display: flex; gap: 4px; overflow-x: auto; padding: 8px 12px; max-width: 1200px; margin: 0 auto; align-items: center; }
nav a { white-space: nowrap; padding: 6px 10px; border-radius: 8px; color: var(--ink); }
nav a.aktiv { background: var(--chip); font-weight: 600; }
nav a.plus { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
nav .rechts { margin-left: auto; }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 12px; text-align: center; }
main { max-width: 1200px; margin: 0 auto; padding: 16px; }
h1 { font-size: 22px; margin: 4px 0 16px; }
h2 { font-size: 17px; margin: 24px 0 8px; }
.karte { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: block; color: var(--ink); }
.kpi:hover { text-decoration: none; border-color: var(--accent); }
.kpi .zahl { font-size: 24px; font-weight: 650; }
.kpi .txt { color: var(--quiet); font-size: 13px; }
.kpi.warn .zahl { color: var(--warn); }
.kpi.bad .zahl { color: var(--bad); }
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--quiet); background: var(--chip); }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
.tabelle { overflow-x: auto; border-radius: var(--radius); }
.leise { color: var(--quiet); font-size: 13px; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--chip); font-size: 12px; white-space: nowrap; }
.chip.bestellt { background: #fdecc8; color: #7a4d00; }
.chip.lager { background: #d6f0df; color: #135c33; }
.chip.fba { background: #dbe6fd; color: #1c3f99; }
.chip.aufkaeufer { background: #f2dcf7; color: #6b2580; }
.chip.verkauft { background: var(--chip); color: var(--quiet); }
.chip.unklar, .chip.fehlt { background: #fadad7; color: #8f1d12; }
.chip.liegt_vor { background: #fdecc8; color: #7a4d00; }
.chip.gebucht, .chip.bezahlt { background: #d6f0df; color: #135c33; }
.chip.rg_gestellt { background: #fde3c8; color: #8a4500; }
.chip.offen { background: #fadad7; color: #8f1d12; }
@media (prefers-color-scheme: dark) {
  .chip.bestellt, .chip.liegt_vor { background: #4a3a14; color: #f5d58c; }
  .chip.lager, .chip.gebucht, .chip.bezahlt { background: #173b26; color: #9be0b4; }
  .chip.fba { background: #1d2c55; color: #aac2fb; }
  .chip.aufkaeufer { background: #3d2146; color: #e4b4f2; }
  .chip.unklar, .chip.fehlt, .chip.offen { background: #4d1c17; color: #f5aba3; }
  .chip.rg_gestellt { background: #4d3014; color: #f6c38e; }
}
form.inline { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 2px 0; }
input, select, textarea, button { font: inherit; color: var(--ink); }
input, select, textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
input.klein { width: 70px; }
input.mittel { width: 120px; }
button, .knopf { background: var(--chip); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; cursor: pointer; color: var(--ink); display: inline-block; }
button.primaer, .knopf.primaer { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button:hover, .knopf:hover { filter: brightness(.96); text-decoration: none; }
.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.feld label { display: block; font-size: 13px; color: var(--quiet); margin-bottom: 3px; }
.feld input, .feld select, .feld textarea { width: 100%; }
.feld.breit { grid-column: 1 / -1; }
.check { display: flex; gap: 8px; align-items: center; }
.meldung { background: #d6f0df; color: #135c33; padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; }
.fehler { background: #fadad7; color: #8f1d12; padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; }
.filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.filter a { padding: 5px 10px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); color: var(--ink); }
.filter a.aktiv { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.treffer { font-size: 13px; margin-top: 4px; }
details summary { cursor: pointer; color: var(--accent); }
.sn { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
@media (max-width: 640px) {
  main { padding: 12px; }
  .nur-gross { display: none; }
  th, td { padding: 7px 8px; }
}
td.n, th.n { white-space: nowrap; }
.feld.check input { width: auto; }
.feld.check { grid-column: 1 / -1; }
td form.inline { flex-wrap: nowrap; }
@media (max-width: 640px) { td form.inline { flex-wrap: wrap; } }
