:root {
  --bg: #0c0c0b;
  --panel: #151513;
  --line: #2a2a28;
  --ink: #f5f1e8;
  --muted: #a9a49a;
  --accent: #f89005;
  --accent-ink: #1a1200;
  --red: #e0533d;
  --green: #4caf7d;
  --amber: #d9a441;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 780px; margin: 0 auto; padding: 24px 18px 64px; }
.head { text-align: center; padding: 12px 0 20px; }
.logo { max-width: 260px; height: auto; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px 26px;
}
.card.wide { max-width: none; }

h1 { font-size: 26px; line-height: 1.25; margin: 0 0 12px; color: var(--accent); }
h2 { font-size: 17px; margin: 32px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.lead { color: var(--muted); margin: 0 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.badge {
  display: inline-block; margin: 0 0 14px; padding: 5px 12px;
  background: rgba(248,144,5,.14); border: 1px solid rgba(248,144,5,.4);
  color: var(--accent); border-radius: 999px; font-size: 13px; font-weight: 600;
}

.opens {
  margin: 18px 0; padding: 16px 18px; text-align: center;
  background: rgba(248,144,5,.08); border: 1px solid rgba(248,144,5,.32);
  border-radius: 10px; color: var(--muted);
}
.opens strong { display: inline-block; margin-top: 4px; font-size: 19px; color: var(--accent); }

.error {
  background: rgba(224,83,61,.12); border: 1px solid rgba(224,83,61,.45);
  color: #ffb4a5; padding: 12px 14px; border-radius: 8px; margin: 0 0 18px;
}

/* ---------- tijdsloten ---------- */
.slots { display: grid; gap: 8px; }

.slot {
  display: grid;
  grid-template-columns: 1fr auto 84px;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,.025);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.slot.soldout { opacity: .45; grid-template-columns: 1fr auto; }
.slot-time { font-weight: 600; font-size: 17px; }
.slot-state { font-size: 13px; color: var(--muted); }
.slot-state.low { color: var(--amber); font-weight: 600; }

input.qty {
  width: 100%; padding: 9px 10px; text-align: center;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; color: var(--ink); font-size: 16px;
}
input.qty:focus, input:focus, textarea:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent;
}

.summary {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 16px; padding: 14px 16px;
  background: rgba(248,144,5,.08); border: 1px solid rgba(248,144,5,.32);
  border-radius: 10px;
}
.summary strong { color: var(--accent); font-size: 20px; }

/* ---------- formulier ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.span2 { grid-column: 1 / -1; }
label { font-size: 14px; color: var(--muted); }
.req { color: var(--accent); }

input[type=text], input[type=email], input[type=password], input:not([type]), textarea {
  padding: 10px 12px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; color: var(--ink); font: inherit; width: 100%;
}
textarea { resize: vertical; }

.check { display: flex; gap: 10px; align-items: flex-start; margin: 22px 0 4px; color: var(--ink); font-size: 14px; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--accent); }
a { color: var(--accent); }

.btn {
  display: inline-block; padding: 12px 22px; border: 0; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.big { width: 100%; margin-top: 18px; padding: 15px; font-size: 17px; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }

.codeform { display: flex; flex-direction: column; gap: 10px; max-width: 340px; margin-top: 18px; }

/* ---------- bevestiging ---------- */
.ref {
  text-align: center; padding: 22px; margin: 22px 0;
  background: rgba(248,144,5,.08); border: 1px solid rgba(248,144,5,.32); border-radius: 12px;
}
.ref span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.ref strong { font-size: 32px; letter-spacing: 3px; color: var(--accent); }

.recap { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.recap td { padding: 10px 4px; border-bottom: 1px solid var(--line); }
.recap td:last-child { text-align: right; }
.recap .total td { font-weight: 700; color: var(--accent); border-bottom: 0; }

/* ---------- admin ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 18px 0 6px; }
.stat { background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.stat span { display: block; font-size: 12px; color: var(--muted); }
.stat strong { font-size: 24px; color: var(--accent); }

table.data { width: 100%; border-collapse: collapse; font-size: 14px; display: block; overflow-x: auto; }
table.data th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }

.bar { width: 120px; height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); }

.tag { padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.tag.green { background: rgba(76,175,125,.16); color: var(--green); }
.tag.red   { background: rgba(224,83,61,.16); color: var(--red); }
.tag.amber { background: rgba(217,164,65,.16); color: var(--amber); }
.tag.grey  { background: rgba(255,255,255,.07); color: var(--muted); }

.foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 28px; }

@media (max-width: 560px) {
  .card { padding: 22px 16px; }
  .grid { grid-template-columns: 1fr; }
  .slot { grid-template-columns: 1fr 76px; grid-template-areas: "time qty" "state qty"; gap: 4px 12px; }
  .slot-time { grid-area: time; }
  .slot-state { grid-area: state; }
  input.qty { grid-area: qty; }
  .slot.soldout { grid-template-columns: 1fr auto; grid-template-areas: "time state"; }
}

/* ---------- rapportage ---------- */
.wrap.wrap-wide { max-width: 1180px; }
.wrap.wrap-full { max-width: none; padding-left: 20px; padding-right: 20px; }

/* menu als duidelijke knoppen */
.reportnav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 6px 0 12px;
}
.navbtn {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 16px; min-height: 56px; justify-content: center;
  border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255,255,255,.025);
  color: var(--ink); text-decoration: none;
}
.navbtn:hover { border-color: var(--accent); background: rgba(248,144,5,.07); }
.navbtn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.navbtn.on .navsub { color: rgba(26,18,0,.72); }
.navbtn.export { border-color: rgba(63,185,119,.45); }
.navbtn.export .navtitle { color: #3fb977; }
.navbtn.on.export .navtitle { color: var(--accent-ink); }
.navtitle { font-weight: 700; font-size: 15px; }
.navsub { font-size: 12px; color: var(--muted); }

.whoami { margin: 0 0 22px; font-size: 13px; color: var(--muted); }
.whoami strong { color: var(--ink); }

/* panelen rond elke grafiek */
.panel {
  background: rgba(255,255,255,.02);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px 14px;
  margin-bottom: 16px;
}
.panel h2 { margin-top: 0; border-bottom: 0; padding-bottom: 0; font-size: 16px; }
.panel > .muted.small:first-of-type { margin-top: -4px; }
.chartgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; }
.chartgrid .panel { margin-bottom: 16px; }

/* kengetallen */
.stat em { display: block; font-style: normal; font-size: 12px; color: var(--muted); margin-top: 2px; }

/* grafieken */
.chartwrap { overflow-x: auto; margin: 4px 0 6px; padding-bottom: 4px; }
.chartwrap svg { display: block; max-width: 100%; height: auto; }
.chartwrap g { transition: opacity .12s; }
.chartwrap g:hover { opacity: .8; }

/* ringen */
.donutbox { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.donutbox svg { flex: 0 0 auto; }
.donutbox g { transition: opacity .12s; }
.donutbox g:hover { opacity: .82; }
.donutlegend, .caplegend { list-style: none; margin: 0; padding: 0; flex: 1 1 190px; min-width: 180px; }
.donutlegend li, .caplegend li {
  display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: 13px;
  border-bottom: 1px solid var(--line);
}
.donutlegend li:last-child, .caplegend li:last-child { border-bottom: 0; }
.swatch { width: 12px; height: 12px; border-radius: 3px; flex: 0 0 auto; }
.donutlegend .lbl, .caplegend .lbl { flex: 1 1 auto; }
.donutlegend .val { font-weight: 700; font-variant-numeric: tabular-nums; }
.donutlegend .pct, .caplegend .pct { color: var(--muted); font-size: 12px; min-width: 58px; text-align: right; }
.caplegend { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 18px; margin-top: 10px; }

/* filters */
.filters {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: end;
  padding: 16px; margin-bottom: 18px;
  background: rgba(255,255,255,.025); border: 1px solid var(--line); border-radius: 10px;
}
.filters .field { flex: 1 1 190px; }
.filters .field:has(button) { flex: 0 0 auto; }
.filters button { white-space: nowrap; }
.filters select {
  padding: 10px 12px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; color: var(--ink); font: inherit; width: 100%;
}
.filters .clear { align-self: center; font-size: 13px; }

/* tabellen */
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.num.has { color: var(--accent); font-weight: 600; }
table.data td.strong { font-weight: 700; }
table.data td.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
table.data td.notes { white-space: normal; min-width: 200px; max-width: 320px; }
table.data tbody tr:hover td { background: rgba(255,255,255,.03); }

/* aanmelden */
.card.login { max-width: 420px; margin: 0 auto; }
.loginform { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.loginform .btn.big { margin-top: 4px; }

@media (max-width: 640px) {
  /* Op een telefoon mag het logo niet het halve scherm opeten. */
  .head { padding: 6px 0 12px; }
  .logo { max-width: 150px; }
  .reportnav { grid-template-columns: 1fr 1fr; }
  .navbtn { min-height: 52px; padding: 10px 12px; }
  .navsub { display: none; }
  .panel { padding: 14px 12px 10px; }
  .donutbox { justify-content: center; }
  .wrap.wrap-full { padding-left: 12px; padding-right: 12px; }
}

/* ---------- aftelklok ---------- */
.opens {
  margin: 20px 0; padding: 20px 18px; text-align: center;
  background: rgba(248,144,5,.07); border: 1px solid rgba(248,144,5,.3);
  border-radius: 12px;
}
.opens-when { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.opens-when strong { display: inline-block; margin-top: 4px; font-size: 19px; color: var(--accent); }

.countdown { display: flex; justify-content: center; gap: 10px; margin: 18px 0 12px; }
.cd {
  min-width: 68px; padding: 10px 6px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
}
.cd span {
  display: block; font-size: 30px; font-weight: 700; line-height: 1.1;
  color: var(--accent); font-variant-numeric: tabular-nums;
}
.cd em { display: block; margin-top: 3px; font-style: normal; font-size: 11px;
  color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }

.opens-note { margin: 0; font-size: 13px; color: var(--muted); }

@media (max-width: 420px) {
  .countdown { gap: 6px; }
  .cd { min-width: 0; flex: 1 1 0; padding: 8px 2px; }
  .cd span { font-size: 24px; }
  .cd em { font-size: 10px; }
}

/* ---------- beheer ---------- */
.ok {
  background: rgba(63,185,119,.12); border: 1px solid rgba(63,185,119,.45);
  color: #9fdcb8; padding: 12px 14px; border-radius: 8px; margin: 0 0 18px;
}
.btn.small { padding: 7px 13px; font-size: 13px; border-radius: 7px; }
form.inline { display: flex; gap: 6px; align-items: center; margin: 0; }
form.inline input[type=number] {
  padding: 7px 8px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 7px; color: var(--ink); font: inherit; text-align: center;
}
h3.sub { font-size: 15px; margin: 26px 0 10px; color: var(--ink); }
.slotgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.slotrow {
  display: grid; grid-template-columns: 1fr auto 72px; align-items: center; gap: 8px;
  padding: 8px 12px; background: rgba(255,255,255,.025);
  border: 1px solid var(--line); border-radius: 8px;
}
.slotrow label { font-weight: 600; font-size: 15px; color: var(--ink); }
.slotrow .vrij { font-size: 12px; color: var(--muted); }
.slotrow input {
  padding: 7px 6px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 7px; color: var(--ink); font: inherit; text-align: center; width: 100%;
}
@media (max-width: 640px) {
  .slotgrid { grid-template-columns: 1fr; }
}
