:root {
  --bg: #f4f4f2; --surface: #fff; --surface-2: #fafaf9; --line: #e3e2de;
  --text: #0b0b0b; --text-2: #52514e; --muted: #8a8984;
  --accent: #2a78d6; --accent-ink: #fff;
  --good: #0e7a3a; --good-bg: #e3f4e8; --warn: #8a5a00; --warn-bg: #fdf1d6;
  --bad: #b42318; --bad-bg: #fde8e6; --info-bg: #e7f0fb;
  --radius: 10px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 1px 1px rgba(0,0,0,.04);
  font-family: "Inter", "Segoe UI", system-ui, sans-serif; font-size: 14px; color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 16px; } h2 { font-size: 16px; margin: 0 0 12px; } h3 { font-size: 14px; margin: 0 0 8px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; } .grow { flex: 1; }
.grid { display: grid; gap: 16px; } .g2 { grid-template-columns: 2fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); } .halves { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .g2, .g3, .g4, .halves { grid-template-columns: 1fr; } }

/* Karten, Tabellen, Formulare */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > h2 { padding: 16px 18px 0; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
tr.click:hover td { background: var(--surface-2); cursor: pointer; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
label { display: block; font-weight: 500; margin-bottom: 4px; font-size: 13px; }
input, select, textarea { width: 100%; padding: 8px 10px; border: 1px solid #c9c8c3; border-radius: 8px; font: inherit; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
input[type=checkbox], input[type=radio] { width: auto; margin-right: 6px; }
input[type=color] { padding: 2px; height: 36px; }
textarea { min-height: 90px; resize: vertical; }
.field { margin-bottom: 14px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid #c9c8c3;
  background: #fff; color: var(--text); font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(.94); }
.btn.dark { background: #1f1f1e; border-color: #1f1f1e; color: #fff; }
.btn.danger { color: var(--bad); border-color: #f0b4ae; }
.btn.sm { padding: 4px 10px; font-size: 12px; } .btn.block { width: 100%; justify-content: center; padding: 12px; }
.inline { display: inline; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 500;
  background: #ecebe8; color: var(--text-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.good { background: var(--good-bg); color: var(--good); } .badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); } .badge.info { background: var(--info-bg); color: #1d5fae; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; }
.flash.ok { background: var(--good-bg); color: var(--good); border-color: #b5e0c3; }
.flash.error { background: var(--bad-bg); color: var(--bad); border-color: #f4c0ba; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.thumb { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: #ecebe8; border: 1px solid var(--line); display: block; }

/* Admin-Layout */
.admin { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: #1a1a19; color: #d8d7d2; padding: 14px 10px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.side .brand { color: #fff; font-weight: 700; font-size: 16px; padding: 6px 10px 14px; display: block; }
.side select { background: #2b2b29; color: #fff; border-color: #3a3a37; margin-bottom: 14px; }
.side a.nav { display: flex; justify-content: space-between; color: #d8d7d2; padding: 8px 10px; border-radius: 7px; margin-bottom: 2px; }
.side a.nav:hover { background: #2b2b29; text-decoration: none; }
.side a.nav.on { background: #34342f; color: #fff; font-weight: 600; }
.side .count { background: var(--accent); color: #fff; border-radius: 99px; padding: 0 7px; font-size: 11px; line-height: 18px; }
.side .sep { border-top: 1px solid #2f2f2c; margin: 12px 4px; }
.main { padding: 24px 32px 60px; max-width: 1280px; width: 100%; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.topbar h1 { margin: 0; }
@media (max-width: 800px) { .admin { grid-template-columns: 1fr; } .side { position: static; height: auto; } .main { padding: 16px; } }

/* KPIs + Diagramm */
.kpi .label { color: var(--text-2); font-size: 13px; }
.kpi .value { font-size: 26px; font-weight: 650; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .delta { font-size: 12px; margin-top: 2px; color: var(--text-2); }
.delta .up { color: var(--good); } .delta .down { color: var(--bad); }
.viz-root { --surface-1: #fff; --series-1: #2a78d6; --grid: #ecebe8; --text-secondary: #52514e; position: relative; }
.viz-root svg { display: block; width: 100%; height: 240px; overflow: visible; }
.viz-root .bar { fill: var(--series-1); }
.viz-root .hit { fill: transparent; cursor: pointer; }
.viz-root .hit:hover + .bar, .viz-root g:hover .bar { filter: brightness(.85); }
.viz-root .axis { fill: var(--text-secondary); font-size: 11px; }
.viz-root .gridline { stroke: var(--grid); stroke-width: 1; }
.viz-tip { position: absolute; pointer-events: none; background: #1f1f1e; color: #fff; padding: 6px 10px; border-radius: 6px;
  font-size: 12px; white-space: nowrap; transform: translate(-50%, -110%); display: none; z-index: 5; }
.seg { display: inline-flex; border: 1px solid #c9c8c3; border-radius: 8px; overflow: hidden; }
.seg a { padding: 6px 12px; color: var(--text); border-right: 1px solid #c9c8c3; }
.seg a:last-child { border-right: 0; } .seg a.on { background: #1f1f1e; color: #fff; }
.seg a:hover { text-decoration: none; }
.meter { height: 6px; background: #ecebe8; border-radius: 3px; overflow: hidden; margin-top: 4px; }
.meter > span { display: block; height: 100%; background: var(--series-1, #2a78d6); border-radius: 3px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 8px 0 8px 18px; border-left: 2px solid var(--line); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.sum td { border: 0; padding: 4px 0; } .sum .total td { font-weight: 700; font-size: 16px; border-top: 1px solid var(--line); padding-top: 10px; }

/* Storefront */
.store { --accent: var(--shop-accent, #2a78d6); background: #fff; min-height: 100vh; display: flex; flex-direction: column; }
.store header { border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 10; }
.store .wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; width: 100%; }
.store header .wrap { display: flex; align-items: center; gap: 20px; height: 64px; }
.store .logo { font-weight: 800; font-size: 20px; color: var(--text); letter-spacing: -.3px; }
.store .cartlink { position: relative; font-weight: 600; color: var(--text); }
.store .cartlink b { background: var(--accent); color: #fff; border-radius: 99px; padding: 1px 7px; font-size: 11px; margin-left: 4px; }
.hero { background: var(--surface-2); border-bottom: 1px solid var(--line); padding: 44px 0; }
.hero h1 { font-size: 34px; margin: 0 0 8px; letter-spacing: -.5px; } .hero p { color: var(--text-2); max-width: 640px; margin: 0; font-size: 16px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 24px 0; }
.chips a { padding: 6px 14px; border: 1px solid var(--line); border-radius: 99px; color: var(--text); }
.chips a.on { background: var(--text); color: #fff; border-color: var(--text); } .chips a:hover { text-decoration: none; border-color: var(--text); }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px; margin-bottom: 50px; }
.pcard { color: var(--text); display: block; } .pcard:hover { text-decoration: none; }
.pcard .img { aspect-ratio: 1; background: #f0efec; border-radius: 12px; overflow: hidden; position: relative; display: grid; place-items: center; color: var(--muted); font-size: 40px; }
.pcard .img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.pcard:hover .img img { transform: scale(1.04); }
.pcard .t { margin-top: 10px; font-weight: 500; } .pcard .pr { margin-top: 2px; }
.tag { position: absolute; top: 10px; left: 10px; background: var(--bad); color: #fff; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; }
.tag.dark { background: #1f1f1e; }
s.old { color: var(--muted); margin-left: 6px; }
.price-sale { color: var(--bad); font-weight: 600; }
.pdp { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; padding: 36px 0 60px; }
.pdp .img { aspect-ratio: 1; border-radius: 14px; background: #f0efec; overflow: hidden; display: grid; place-items: center; font-size: 80px; color: var(--muted); }
.pdp .img img { width: 100%; height: 100%; object-fit: cover; }
.pdp h1 { font-size: 30px; letter-spacing: -.4px; } .pdp .price { font-size: 22px; margin-bottom: 18px; }
.qty { width: 80px; }
@media (max-width: 800px) { .pdp { grid-template-columns: 1fr; gap: 20px; } }
.store footer { border-top: 1px solid var(--line); padding: 26px 0; color: var(--muted); margin-top: auto; background: var(--surface-2); }
.checkout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; padding: 30px 0 60px; }
.checkout aside { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 20px; align-self: start; position: sticky; top: 84px; }
@media (max-width: 800px) { .checkout { grid-template-columns: 1fr; } .checkout aside { position: static; } }
.payopt { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 8px; cursor: pointer; font-weight: 500; }
.payopt:has(input:checked) { border-color: var(--accent); background: var(--info-bg); }
.steps { display: flex; gap: 8px; margin: 18px 0; flex-wrap: wrap; }
.steps span { flex: 1; min-width: 120px; padding: 10px; border-radius: 8px; background: #ecebe8; color: var(--muted); text-align: center; font-weight: 500; font-size: 13px; }
.steps span.on { background: var(--good-bg); color: var(--good); }
.steps span.bad { background: var(--bad-bg); color: var(--bad); }

/* Auth / Startseite */
.center { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth { width: 100%; max-width: 400px; }
.landing { max-width: 1000px; margin: 0 auto; padding: 50px 20px; }
.landing .big { font-size: 42px; letter-spacing: -1px; margin: 0 0 10px; }
