:root {
  --accent: #1f6f5c;
  --bg: #f6f5f1;
  --card: #ffffff;
  --text: #1d1f1e;
  --muted: #666b68;
  --line: #e2e0d9;
  --danger: #a4332b;
  --ok: #2d7a3e;
  --radius: 10px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text);
}
header.top {
  background: var(--accent); color: #fff; padding: 14px 16px 0;
}
header.top h1 { margin: 0 0 10px; font-size: 1.25rem; font-weight: 650; }
header.top .who { font-size: .85rem; opacity: .85; float: right; margin-top: 4px; }
nav.tabs { display: flex; gap: 4px; overflow-x: auto; }
nav.tabs a {
  color: #fff; text-decoration: none; padding: 8px 12px; border-radius: 8px 8px 0 0;
  opacity: .8; white-space: nowrap; font-size: .95rem;
}
nav.tabs a.on { background: var(--bg); color: var(--text); opacity: 1; font-weight: 600; }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
h2 { font-size: 1.15rem; margin: 18px 0 10px; }
h3 { font-size: 1rem; margin: 0 0 4px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin: 0 0 10px;
}
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.muted { color: var(--muted); font-size: .9rem; }
.small { font-size: .85rem; }
.tag {
  display: inline-block; font-size: .75rem; padding: 1px 8px; border-radius: 99px;
  background: #eceae3; color: var(--muted); margin-right: 4px;
}
.tag.mine { background: var(--accent); color: #fff; }
.tag.warn { background: #fbe9d6; color: #8a4a12; }
.tag.full { background: #e6efe8; color: var(--ok); }
.day { font-weight: 650; margin: 18px 0 6px; color: var(--muted); font-size: .9rem; }
.day::first-letter { text-transform: uppercase; }
button, .btn {
  font: inherit; border: 1px solid var(--accent); background: var(--accent); color: #fff;
  padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: .9rem;
}
button.ghost { background: transparent; color: var(--accent); }
button.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
button:disabled { opacity: .5; cursor: default; }
form.stack { display: grid; gap: 8px; }
label { display: grid; gap: 2px; font-size: .9rem; color: var(--muted); }
input, select, textarea {
  font: inherit; color: var(--text); padding: 7px 9px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; width: 100%;
}
textarea { min-height: 140px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
.doc-body { white-space: pre-wrap; font-family: Georgia, "Times New Roman", serif; line-height: 1.6; }
.copy { display: flex; gap: 6px; }
.copy input { font-size: .85rem; }
details summary { cursor: pointer; color: var(--accent); margin: 6px 0; }
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: #222; color: #fff; padding: 9px 16px; border-radius: 8px; font-size: .9rem;
  max-width: calc(100% - 32px); z-index: 10;
}
.toast.err { background: var(--danger); }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.hero { max-width: 560px; margin: 50px auto; padding: 0 16px; }
.hero h1 { font-size: 1.8rem; margin: 0 0 8px; }
a { color: var(--accent); }
input[type=color] { height: 38px; padding: 3px; }

/* ── Overzicht ── */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0 0 12px; }
.tile {
  display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--radius); text-decoration: none;
  background: var(--card); border: 1px solid var(--line); color: var(--text);
}
.tile strong { font-size: 1.7rem; line-height: 1.1; color: var(--accent); }
.tile span { font-size: .85rem; color: var(--muted); }
.tile.warn strong { color: #a0560f; }
.tile.bad strong { color: var(--danger); }
.tile.good strong { color: var(--ok); }
.line { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-top: 1px solid var(--line); font-size: .92rem; }
.line:first-of-type { border-top: 0; }
a.plain { text-decoration: none; color: inherit; display: block; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
.pre { white-space: pre-wrap; }

/* ── Tags ── */
.tag.bad { background: #f6dcd9; color: var(--danger); }
.tag.good { background: #e6efe8; color: var(--ok); }

/* ── Onderhoud ── */
.card.task { border-left: 4px solid var(--line); }
.card.task.te-laat { border-left-color: var(--danger); }
.card.task.binnenkort { border-left-color: #e0a15a; }
ul.log { margin: 6px 0 0; padding-left: 18px; font-size: .88rem; }

/* ── Aanmelden ── */
.scroll { overflow-x: auto; }
table.entries { border-collapse: collapse; width: 100%; font-size: .9rem; margin-top: 6px; }
table.entries th, table.entries td { text-align: left; padding: 6px 8px; border-top: 1px solid var(--line); vertical-align: top; }
table.entries th { font-size: .8rem; color: var(--muted); font-weight: 600; }
a.btn.ghostlink { background: transparent; color: var(--accent); text-decoration: none; white-space: nowrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ── Prikbord ── */
.card.pinned { border-color: var(--accent); }

/* ── Demo ── */
.demobar {
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center;
  background: #2b2b2b; color: #fff; padding: 6px 16px; font-size: .85rem;
}
.demobar a { color: #ffd98a; }
.hero.wide { max-width: 760px; }
.personas { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 16px 0; }
button.persona {
  display: grid; gap: 4px; justify-items: start; text-align: left; padding: 14px;
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius);
}
button.persona:hover { border-color: var(--accent); }
button.persona strong { font-size: 1.1rem; }

/* ── Voorraad ── */
.card.flush { padding: 0; overflow: hidden; }
.card.callout { border-left: 4px solid var(--accent); }
details.stockrow { border-top: 1px solid var(--line); padding: 0 14px; }
details.stockrow:first-child { border-top: 0; }
details.stockrow > summary {
  display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center;
  color: var(--text); padding: 9px 0; margin: 0; list-style: none;
}
details.stockrow > summary::-webkit-details-marker { display: none; }
details.stockrow[open] { background: #fbfaf7; padding-bottom: 10px; }
.stockrow .qty strong { font-size: 1.05rem; }
.countrow {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 8px 14px; border-top: 1px solid var(--line);
}
.countrow:first-child { border-top: 0; }
.countrow.changed { background: #fff7e8; }
.countrow .name { line-height: 1.25; }
.stepper { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }
.stepper input { width: 76px; text-align: center; font-size: 1.05rem; padding: 7px 4px; }
button.step { width: 40px; height: 40px; padding: 0; font-size: 1.3rem; line-height: 1; }
.card.sticky { position: sticky; bottom: 8px; box-shadow: 0 4px 18px rgba(0,0,0,.12); }
.card.sticky input { flex: 1; min-width: 160px; }
.scanwrap { display: grid; gap: 6px; }
.scanvideo { width: 100%; max-height: 260px; object-fit: cover; border-radius: 8px; background: #000; }
input.orderqty { width: 80px; padding: 4px 6px; }

@media print {
  .demobar, header.top, .noprint, .toast, button { display: none !important; }
  body { background: #fff; }
  main { max-width: none; padding: 0; }
  .card { border: 0; padding: 0; }
  body[data-print] .ordercard:not(.print-me) { display: none; }
  body[data-print] .ordercard { break-inside: avoid; }
  input.orderqty { border: 0; padding: 0; font-weight: 600; }
}
a.btn { display: inline-block; text-decoration: none; }
.ordercard table.entries td:last-child, .ordercard table.entries th:last-child { width: 76px; }
input.orderqty { width: 68px; }

/* ── Voorraad: subnavigatie, verkoop ── */
nav.subnav { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 6px; padding-bottom: 2px; }
nav.subnav a {
  white-space: nowrap; text-decoration: none; font-size: .9rem; padding: 5px 12px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
}
nav.subnav a.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
button.chip { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 99px; padding: 4px 11px; font-size: .85rem; }
button.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.salelayout { display: grid; grid-template-columns: 1fr 300px; gap: 12px; align-items: start; }
@media (max-width: 700px) { .salelayout { grid-template-columns: 1fr; } }
.saletiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
button.saletile {
  position: relative; display: grid; gap: 6px; align-content: space-between; text-align: left; min-height: 78px;
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px;
}
button.saletile:active { border-color: var(--accent); }
button.saletile.zero { opacity: .6; }
button.saletile b { font-size: .92rem; line-height: 1.2; font-weight: 600; }
button.saletile .meta { display: flex; justify-content: space-between; gap: 6px; font-size: .78rem; color: var(--muted); }
.inbon {
  position: absolute; top: -7px; right: -7px; min-width: 24px; height: 24px; border-radius: 99px; padding: 0 6px;
  background: var(--accent); color: #fff; font-size: .8rem; font-weight: 700; display: grid; place-items: center;
}
.card.bon { position: sticky; top: 8px; }
@media (max-width: 700px) { .card.bon { position: sticky; bottom: 8px; top: auto; box-shadow: 0 4px 18px rgba(0,0,0,.12); } }
.line.total { border-top: 2px solid var(--line); margin: 6px 0 8px; padding-top: 8px; }
button.step.sm { width: 30px; height: 30px; font-size: 1rem; }
details.stockrow.inactive { opacity: .55; }
