:root {
  --bg: #faf7f0; --card: #ffffff; --text: #22201b; --muted: #6f6a5f; --line: #e8e2d4;
  --accent: #f5b301; --accent-ink: #3a2a00; --red: #c8283d; --green: #1f8a4c; --blue: #2563eb;
  --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #16150f; --card: #211f18; --text: #f1ede3; --muted: #a39d8e; --line: #36332a;
    --accent: #f5b301; --accent-ink: #1a1300; --red: #ff6b7d; --green: #4ccb83; --blue: #7aa7ff;
    --shadow: none; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--blue); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h2 { font-size: 1.1rem; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px 80px; }
.pad { padding: 2rem 0; } .center { text-align: center; } .muted { color: var(--muted); }
.small { font-size: .85rem; } .right { text-align: right; } .nowrap { white-space: nowrap; }

header.top { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
/* Streep in de drie kleuren van het BouwInfosys-logo */
header.top::after, .login.card::before { content: ""; display: block; height: 4px;
  background: linear-gradient(90deg, #8ac926 0 33.3%, #00a6fb 33.3% 66.6%, #f99f0c 66.6% 100%); }
header.top .bar { max-width: 760px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 10px; }
header.top img { width: 30px; height: 30px; }
header.top .title { font-weight: 700; font-size: 1.1rem; flex: 1; }
nav.tabs { max-width: 760px; margin: 0 auto; padding: 0 12px; display: flex; gap: 4px; overflow-x: auto; }
nav.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 8px 10px; color: var(--muted);
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
nav.tabs button.active { color: var(--text); border-color: var(--accent); }
nav.tabs .badge { background: var(--red); color: #fff; border-radius: 99px; font-size: .72rem; padding: 1px 6px; margin-left: 4px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 14px 0; box-shadow: var(--shadow); }
.card.hl { border-color: var(--accent); border-width: 2px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

label { display: block; font-weight: 600; font-size: .9rem; margin: 10px 0 4px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 1rem; margin: 6px 0; cursor: pointer; }
input[type=text], input[type=password], input[type=url], input[type=email], input[type=date], textarea, select {
  width: 100%; font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { min-height: 80px; resize: vertical; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }

button, .btn { font: inherit; font-weight: 600; border-radius: 10px; border: 1px solid var(--line); background: var(--card);
  color: var(--text); padding: 9px 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
button:hover, .btn:hover { filter: brightness(.97); }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.danger { color: var(--red); }
button.ok { background: var(--green); border-color: var(--green); color: #fff; }
button.sm { padding: 5px 10px; font-size: .85rem; }
button:disabled { opacity: .5; cursor: default; }

.datebar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; }
.datebar .d { font-weight: 700; font-size: 1.15rem; text-align: center; }

.status { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.status .box { background: var(--bg); border-radius: 12px; padding: 12px; }
.status .lbl { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.status .val { font-size: 1.25rem; font-weight: 700; }
.countdown { font-variant-numeric: tabular-nums; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
tr:last-child td { border-bottom: 0; }
.tbl-wrap { overflow-x: auto; }

.pill { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); white-space: nowrap; }
.pill.paid { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); border-color: transparent; }
.pill.open { background: color-mix(in srgb, var(--red) 13%, transparent); color: var(--red); border-color: transparent; }
.pill.role { background: color-mix(in srgb, var(--accent) 25%, transparent); border-color: transparent; }

.order-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.order-item:last-child { border-bottom: 0; }
.order-item .who { font-weight: 700; }
.order-item .what { white-space: pre-wrap; word-break: break-word; }
.order-item .side { text-align: right; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }

.summary { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; background: var(--bg); padding: 12px; border-radius: 10px; font-size: .92rem; }
.log { font-size: .85rem; color: var(--muted); max-height: 220px; overflow: auto; }
.log div { padding: 3px 0; }

.login { max-width: 360px; margin: 10vh auto 0; padding: 0 16px; }
.login img { width: 72px; display: block; margin: 0 auto 10px; }
.err { color: var(--red); font-weight: 600; min-height: 1.4em; }

#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(120px); background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 10px; font-weight: 600; transition: transform .2s; max-width: calc(100% - 32px); z-index: 20; }
#toast.show { transform: translateX(-50%) translateY(0); }
@media (max-width: 520px) { .status { grid-template-columns: 1fr; } .hide-sm { display: none; } }

/* ---- Menu-kiezer & mandje ---- */
.picker { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
input[type=search] { width: 100%; font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 4px; scrollbar-width: thin; }
.chip { white-space: nowrap; border-radius: 99px; padding: 6px 12px; font-size: .88rem; }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.menu-list { max-height: 60vh; overflow-y: auto; margin-top: 6px; overscroll-behavior: contain; }
h3.sub { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 14px 0 4px; position: sticky; top: 0; background: var(--card); padding: 4px 0; z-index: 1; }
.menu-item { border-bottom: 1px solid var(--line); }
.menu-item.open { background: var(--bg); border-radius: 10px; border-bottom-color: transparent; margin: 4px 0; }
.mi-head { width: 100%; border: 0; background: none; border-radius: 10px; padding: 10px 6px; display: flex; gap: 10px; align-items: center; text-align: left; font-weight: 500; }
.mi-head .plus { width: 28px; height: 28px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.menu-item.out .mi-head { opacity: .5; }
.opts { padding: 0 8px 12px; }
fieldset { border: 0; margin: 6px 0; padding: 0; }
legend { font-weight: 700; font-size: .9rem; margin-bottom: 2px; }
.extras { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 12px; }
input[type=radio] { width: 20px; height: 20px; accent-color: var(--accent); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.stepper button { border: 0; border-radius: 0; padding: 7px 12px; background: none; }
.stepper span { min-width: 24px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.stepper.sm button { padding: 3px 9px; }
.cart-line { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.cart-total { display: flex; justify-content: space-between; padding: 10px 0 2px; }
.warn { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: .9rem; }

/* Inloggen / registreren */
.login h2 { margin: 12px 0 4px; }
.btn.wide, button.wide { width: 100%; justify-content: center; margin-top: 12px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; margin: 16px 0 4px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.notice { background: color-mix(in srgb, var(--accent) 16%, var(--card)); border: 1px solid var(--accent); border-radius: 10px; padding: 10px 12px; font-size: .92rem; }
button.linkish { background: none; border: none; color: var(--blue); font-weight: 500; padding: 8px 0 0; width: 100%; text-align: center; }

/* BouwInfosys */
.login.card { overflow: hidden; }
.login.card::before { margin: 0 -16px 16px; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 18px auto 4px; color: var(--muted); font-size: .8rem; }
.brand img { width: 150px; height: auto; background: #fff; border-radius: 8px; padding: 6px 10px; box-sizing: content-box; }

/* Hint voor meldingen */
.card.hint { position: relative; border-color: var(--accent); padding-right: 44px; }
.card.hint .close { position: absolute; top: 10px; right: 10px; }
