/* Webshops centraal - tokens volgen het gevalideerde datavisualisatie-palet. */
:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f3f2ee;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, 0.1);
  --accent: #0b0b0b;
  --accent-ink: #ffffff;
  --shop-1: #2a78d6;
  --shop-2: #eb6834;
  --shop-3: #1baf7a;
  --shop-4: #eda100;
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --good-ink: #006300;
  --critical-ink: #b42828;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.05);
  --radius: 12px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #242423;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --muted: #898781;
    --grid: #2c2c2a;
    --baseline: #383835;
    --border: rgba(255, 255, 255, 0.1);
    --accent: #ffffff;
    --accent-ink: #0b0b0b;
    --shop-1: #3987e5;
    --shop-2: #d95926;
    --shop-3: #199e70;
    --shop-4: #c98500;
    --good-ink: #0ca30c;
    --critical-ink: #e66767;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #242423;
  --ink: #ffffff;
  --ink-2: #c3c2b7;
  --muted: #898781;
  --grid: #2c2c2a;
  --baseline: #383835;
  --border: rgba(255, 255, 255, 0.1);
  --accent: #ffffff;
  --accent-ink: #0b0b0b;
  --shop-1: #3987e5;
  --shop-2: #d95926;
  --shop-3: #199e70;
  --shop-4: #c98500;
  --good-ink: #0ca30c;
  --critical-ink: #e66767;
  --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--page);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.ink-2 { color: var(--ink-2); }
.hidden { display: none !important; }

/* ── shell ─────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 20px;
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; text-decoration: none; }
.brand-dots { display: inline-flex; gap: 3px; margin-right: 8px; vertical-align: 1px; }
.brand-dots i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: 7px 12px; border-radius: 8px; text-decoration: none; color: var(--ink-2); white-space: nowrap; font-weight: 500;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active { background: var(--surface-2); color: var(--ink); }
.topbar-actions { display: flex; gap: 6px; }
main { max-width: 1240px; margin: 0 auto; padding: 20px 20px 96px; }

h1 { font-size: 22px; letter-spacing: -0.02em; margin: 4px 0 16px; }
h2 { font-size: 15px; margin: 0 0 12px; letter-spacing: -0.01em; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; }

/* ── controls ──────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  cursor: pointer; font-weight: 500; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { opacity: 0.88; }
.btn.danger { color: var(--critical-ink); }
.btn.small { min-height: 30px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: 10px; flex-wrap: wrap; }
.seg button {
  border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; cursor: pointer; color: var(--ink-2); font-weight: 500;
}
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; color: var(--ink-2); font-weight: 500;
}
.chip.active { border-color: var(--ink); color: var(--ink); }
.chip:disabled { opacity: 0.45; cursor: default; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.field small { color: var(--muted); font-size: 12px; }
input[type="text"], input[type="search"], input[type="password"], input[type="number"], input[type="email"], select, textarea {
  width: 100%; min-height: 38px; padding: 8px 11px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface);
}
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .chip:focus-visible, .seg button:focus-visible {
  outline: 2px solid var(--shop-1); outline-offset: 1px;
}
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--ink); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .grow { flex: 1; min-width: 200px; }

/* ── cards & grids ─────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.grid { display: grid; gap: 14px; }
.grid.kpi { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 14px; }
.grid.shops { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-bottom: 14px; }
.grid.two { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .grid.two { grid-template-columns: 1fr; } }

.kpi .label { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; margin-top: 4px; }
.kpi .value.hero { font-size: 34px; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
a.kpi { text-decoration: none; }
a.kpi:hover { border-color: var(--baseline); }

.shop-tile { position: relative; padding-left: 20px; }
.shop-tile::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0;
  background: var(--c);
}
.shop-tile .name { font-weight: 650; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.shop-tile .domain { font-size: 12px; color: var(--muted); }
.shop-tile .rev { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; margin: 10px 0 8px; }
.shop-tile dl { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; margin: 0; font-size: 13px; }
.shop-tile dt { color: var(--ink-2); }
.shop-tile dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.shop-tile .note { font-size: 13px; color: var(--muted); margin-top: 10px; }

/* ── chart ─────────────────────────────────────────────── */
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend b { color: var(--ink); font-weight: 600; }
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; overflow: visible; }
.chart-wrap .axis-label { fill: var(--muted); font-size: 11px; }
.chart-wrap .gridline { stroke: var(--grid); stroke-width: 1; }
.chart-wrap .baseline { stroke: var(--baseline); stroke-width: 1; }
.chart-wrap .band-hover { fill: var(--surface-2); opacity: 0; }
.chart-wrap .hit:hover + .band-hover, .chart-wrap .band-hover.on { opacity: 1; }
.tooltip {
  position: absolute; pointer-events: none; z-index: 5; min-width: 170px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  padding: 10px 12px; font-size: 13px;
}
.tooltip .t-head { font-weight: 600; margin-bottom: 6px; }
.tooltip .t-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tooltip .t-row span:first-child { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.tooltip .t-total { border-top: 1px solid var(--grid); margin-top: 6px; padding-top: 6px; font-weight: 600; }

/* ── tables / lists ────────────────────────────────────── */
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em;
  padding: 8px 10px; border-bottom: 1px solid var(--grid);
}
table.list td { padding: 11px 10px; border-bottom: 1px solid var(--grid); vertical-align: top; }
table.list tr.row { cursor: pointer; }
table.list tr.row:hover td { background: var(--surface-2); }
table.list .right, table.list th.right { text-align: right; }
.cell-strong { font-weight: 600; }
.cell-sub { font-size: 12px; color: var(--muted); }
.shop-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }

@media (max-width: 760px) {
  table.list thead { display: none; }
  table.list, table.list tbody, table.list tr, table.list td { display: block; width: 100%; }
  table.list tr.row { border-bottom: 1px solid var(--grid); padding: 10px 2px; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; }
  table.list td { border: 0; padding: 0; }
  table.list td.m-hide { display: none; }
  table.list td.right { text-align: right; }
}

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); color: var(--ink-2); white-space: nowrap;
}
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); display: inline-block; }
.pill.good i { background: var(--good); }
.pill.warning i { background: var(--warning); }
.pill.serious i { background: var(--serious); }
.pill.critical i { background: var(--critical); }
.pill.info i { background: var(--shop-1); }

.pager { display: flex; gap: 8px; justify-content: space-between; align-items: center; margin-top: 12px; color: var(--ink-2); font-size: 13px; }

/* ── order detail ──────────────────────────────────────── */
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.items .item { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--grid); }
.items .item:last-child { border-bottom: 0; }
.thumb { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--surface-2); display: block; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin-top: 12px; font-size: 14px; }
.totals .grand { font-weight: 700; font-size: 16px; border-top: 1px solid var(--grid); padding-top: 8px; margin-top: 4px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; margin: 0; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; word-break: break-word; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 9px 0; border-bottom: 1px solid var(--grid); font-size: 14px; }
.timeline li:last-child { border-bottom: 0; }
.timeline .meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.note-box { background: var(--surface-2); border-radius: 9px; padding: 10px 12px; font-size: 14px; white-space: pre-wrap; }

/* ── products ──────────────────────────────────────────── */
.grid.products { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.product-card { padding: 0; overflow: hidden; cursor: pointer; text-decoration: none; display: block; }
.product-card:hover { border-color: var(--baseline); }
.product-card .img { aspect-ratio: 4 / 5; background: var(--surface-2); width: 100%; object-fit: cover; display: block; }
.product-card .body { padding: 10px 12px 12px; }
.product-card .pname { font-weight: 600; font-size: 14px; line-height: 1.3; }
.product-card .pmeta { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 13px; }
.badges { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.photo { position: relative; border-radius: 10px; overflow: hidden; background: var(--surface-2); aspect-ratio: 4 / 5; border: 1px solid var(--border); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .tag { position: absolute; left: 6px; top: 6px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; }
.photo .ctrl { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; padding: 5px; gap: 4px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.55)); }
.photo .ctrl button { border: 0; border-radius: 6px; background: rgba(255, 255, 255, 0.92); color: #0b0b0b; width: 28px; height: 28px; cursor: pointer; font-size: 13px; }
.photo.add { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 6px; cursor: pointer; color: var(--ink-2); border-style: dashed; font-size: 13px; text-align: center; padding: 8px; }
.photo.add input { display: none; }
.photo.busy::after { content: "Uploaden…"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.45); color: #fff; font-size: 13px; }
table.variants { width: 100%; border-collapse: collapse; font-size: 14px; }
table.variants th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 6px; }
table.variants td { padding: 4px 6px; }
table.variants input, table.variants select { min-height: 34px; padding: 5px 8px; }
@media (max-width: 640px) {
  table.variants thead { display: none; }
  table.variants tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--grid); }
  table.variants td { padding: 0; }
}
.savebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px;
  background: color-mix(in srgb, var(--page) 92%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--border);
}

/* ── dialogs & toasts ──────────────────────────────────── */
dialog {
  border: 1px solid var(--border); border-radius: 14px; padding: 0; background: var(--surface); color: var(--ink);
  width: min(460px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.4); }
dialog form { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
dialog h3 { margin: 0; font-size: 17px; }
dialog .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
.toast { background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); font-size: 14px; }
.toast.error { background: var(--critical); color: #fff; }
.banner { border-radius: 10px; padding: 10px 14px; background: var(--surface-2); font-size: 14px; margin-bottom: 14px; }

/* ── login ─────────────────────────────────────────────── */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login .card { width: min(380px, 100%); padding: 24px; }
.login h1 { margin: 0 0 4px; }
.login form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.error-text { color: var(--critical-ink); font-size: 14px; min-height: 1em; }
.loading { color: var(--muted); padding: 30px 0; text-align: center; }
