:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #d6d9df;
  --primary: #1e3a8a;
  --primary-2: #2748a8;
  --primary-soft: #e8edfb;
  --danger: #b91c1c;
  --danger-soft: #fdecec;
  --ok: #047857;
  --ok-soft: #e3f6ee;
  --warn: #92400e;
  --warn-soft: #fff4e0;
  --u1: #b91c1c; --u2: #c2410c; --u3: #1d4ed8; --u4: #4b5563;
  --radius: 12px;
  --tap: 48px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
[hidden] { display: none !important; }

.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--primary); color: #fff;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; }
.brand img { border-radius: 6px; }
.net { background: #f59e0b; color: #1f2937; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }

main { max-width: 600px; margin: 0 auto; padding: 16px 16px calc(120px + env(safe-area-inset-bottom)); }

h1 { font-size: 22px; margin: 4px 0 12px; }
h2 { font-size: 17px; margin: 0 0 8px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }

label.field { display: block; font-weight: 600; margin: 12px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=search], textarea {
  width: 100%; min-height: var(--tap); padding: 12px; font: inherit; color: inherit;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
textarea { min-height: 180px; resize: vertical; }
input:focus, textarea:focus, button:focus-visible { outline: 3px solid #93b4ff; outline-offset: 1px; }
.counter { text-align: right; font-size: 13px; color: var(--muted); margin-top: 4px; }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 10px 16px; font: inherit; font-weight: 600;
  border: 1px solid transparent; border-radius: 10px; cursor: pointer;
  background: var(--primary); color: #fff; text-decoration: none;
}
button:active { transform: translateY(1px); }
button:disabled { opacity: .55; cursor: default; }
.btn-block { width: 100%; }
.btn-secondary { background: #fff; color: var(--primary); border-color: var(--line); }
.btn-danger { background: #fff; color: var(--danger); border-color: #f1c4c4; }
.btn-link { background: none; color: var(--primary); padding: 6px 4px; min-height: 36px; font-weight: 600; }
.btn-big { min-height: 64px; font-size: 18px; }
.stack > * + * { margin-top: 10px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

.msg { padding: 12px; border-radius: 10px; margin: 12px 0; font-size: 15px; }
.msg-err { background: var(--danger-soft); color: var(--danger); }
.msg-ok { background: var(--ok-soft); color: var(--ok); }
.msg-warn { background: var(--warn-soft); color: var(--warn); }

/* Stappen */
.stephead { margin-bottom: 12px; }
.stephead .count { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.progress { height: 6px; background: #e3e6ec; border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress > div { height: 100%; background: var(--primary); border-radius: 99px; transition: width .2s; }

.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  background: var(--card); border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
.actionbar .inner { max-width: 600px; margin: 0 auto; display: flex; gap: 10px; }
.actionbar .inner > * { flex: 1; }
.actionbar .inner > .grow { flex: 2; }

/* Foto's */
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.photo { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #e5e7eb; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo button {
  position: absolute; top: 4px; right: 4px; min-height: 0; width: 34px; height: 34px; padding: 0;
  border-radius: 50%; background: rgba(17, 24, 39, .75); font-size: 18px; line-height: 1;
}
.filebtn { position: relative; overflow: hidden; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }

/* TAG */
.crumbs { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 8px 0; font-size: 14px; }
.crumbs button { min-height: 32px; padding: 4px 8px; background: var(--primary-soft); color: var(--primary); font-weight: 600; border-radius: 8px; }
.crumbs span { color: var(--muted); }
.list { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.list button {
  display: flex; width: 100%; justify-content: space-between; align-items: center; text-align: left;
  background: #fff; color: var(--text); border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  min-height: 56px; padding: 10px 14px; font-weight: 400;
}
.list button:last-child { border-bottom: 0; }
.list button.sel { background: var(--primary-soft); }
.list .code { font-weight: 700; }
.list .desc { color: var(--muted); font-size: 14px; display: block; }
.list .chev { color: var(--muted); font-size: 22px; padding-left: 10px; }
.list .path { color: var(--muted); font-size: 12px; display: block; }
.selected-tag { border: 2px solid var(--primary); background: var(--primary-soft); border-radius: 10px; padding: 12px; margin: 10px 0; }
.selected-tag .code { font-weight: 700; font-size: 18px; }

/* Urgentie */
.urg { display: grid; gap: 10px; }
.urg label {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px; cursor: pointer;
  border: 2px solid var(--line); border-radius: 12px; background: #fff; border-left-width: 8px;
}
.urg label.u1 { border-left-color: var(--u1); } .urg label.u2 { border-left-color: var(--u2); }
.urg label.u3 { border-left-color: var(--u3); } .urg label.u4 { border-left-color: var(--u4); }
.urg label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); border-left-width: 8px; }
.urg input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--primary); }
.urg b { font-size: 17px; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; color: #fff; }
.badge.u1 { background: var(--u1); } .badge.u2 { background: var(--u2); } .badge.u3 { background: var(--u3); } .badge.u4 { background: var(--u4); }

/* Overzicht */
.ov-sec { border-bottom: 1px solid var(--line); padding: 12px 0; }
.ov-sec:last-child { border-bottom: 0; }
.ov-head { display: flex; justify-content: space-between; align-items: center; }
.ov-label { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.ov-val { margin-top: 4px; white-space: pre-wrap; word-break: break-word; }

/* Wachtrij */
.q-item { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.q-item:last-child { border-bottom: 0; }

.result-icon { width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 12px auto; font-size: 38px; color: #fff; }
.result-icon.ok { background: var(--ok); }
.result-icon.wait { background: #d97706; }
.report-no { font-size: 26px; font-weight: 800; letter-spacing: .02em; }
