/* =========================================================
   Facialiskliniek UZ Gent — Botulinetoxine-registratie
   ========================================================= */
:root {
  --uz-blue: #1e64c8;
  --uz-blue-600: #1853a8;
  --uz-blue-50: #eef4fd;
  --uz-blue-100: #dbe8fb;
  --navy: #06232e;
  --ink: #0f172a;
  --ink-2: #334155;
  --ink-3: #5b6778;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --border: #e3e8ef;
  --border-2: #d4dbe5;
  --danger: #c92a2a;
  --success: #2b8a3e;

  --side-r: #1e64c8;
  --side-l: #0b8a7a;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;

  --sh-1: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 1px rgba(15, 23, 42, .03);
  --sh-2: 0 6px 24px -8px rgba(15, 23, 42, .14), 0 2px 6px -2px rgba(15, 23, 42, .06);
  --sh-3: 0 24px 64px -16px rgba(6, 35, 46, .28);

  --ease: cubic-bezier(.22, .8, .26, 1);
  --t: 180ms;
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--ink-3); font-weight: 500; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -48px; background: var(--navy); color: #fff; padding: 10px 14px; border-radius: var(--r-sm); z-index: 1000; text-decoration: none; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--uz-blue) 55%, transparent); outline-offset: 2px; border-radius: 6px; }

.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico--lg { width: 34px; height: 34px; stroke-width: 1.5; }

/* ================= HERO ================= */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fe 100%);
  border-bottom: 1px solid var(--border);
}
.hero__bg { position: absolute; inset: 0; pointer-events: none; }
.hero__orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; }
.hero__orb--1 { width: 520px; height: 520px; right: -120px; top: -260px; background: radial-gradient(circle, #9cc2f5 0%, transparent 70%); animation: drift 18s var(--ease) infinite alternate; }
.hero__orb--2 { width: 420px; height: 420px; right: 26%; top: -200px; background: radial-gradient(circle, #a8e3da 0%, transparent 70%); opacity: .4; animation: drift 22s var(--ease) infinite alternate-reverse; }
.hero__grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(30,100,200,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(30,100,200,.06) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse 70% 90% at 80% 0%, #000 0%, transparent 70%);
}
@keyframes drift { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(-60px, 40px, 0) scale(1.08); } }

.hero__inner {
  position: relative;
  max-width: 1480px; margin: 0 auto;
  padding: 18px 28px 22px;
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 18px 48px;
}
.hero__brand { display: flex; align-items: center; gap: 18px; }
.hero__logo { height: 44px; width: auto; }
.hero__divider { width: 1px; height: 36px; background: var(--border-2); }
.hero__dept { display: flex; flex-direction: column; line-height: 1.25; font-weight: 700; color: var(--navy); }
.hero__dept .muted { font-size: 14px; }

.hero__copy { max-width: 900px; justify-self: end; text-align: left; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 10px; padding: 5px 12px 5px 10px;
  font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--uz-blue-600); background: var(--uz-blue-50); border: 1px solid var(--uz-blue-100); border-radius: 999px;
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--uz-blue); box-shadow: 0 0 0 0 rgba(30,100,200,.5); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(30,100,200,.45); } 70% { box-shadow: 0 0 0 9px rgba(30,100,200,0); } 100% { box-shadow: 0 0 0 0 rgba(30,100,200,0); } }
.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(24px, 2.4vw, 34px); line-height: 1.1; letter-spacing: -.025em; font-weight: 800; color: var(--navy);
}
.grad { background: linear-gradient(90deg, var(--uz-blue) 0%, #0b8a7a 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { margin: 0 0 12px; color: var(--ink-2); font-size: 15.5px; max-width: 700px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.steps li { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink-2); font-size: 15px; }
.steps span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 12px; font-weight: 700; }

/* ================= LAYOUT ================= */
.app {
  max-width: 1480px; margin: 0 auto;
  padding: 24px 28px 32px;
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(420px, 1fr) minmax(300px, 360px);
  gap: 20px;
  align-items: start;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  padding: 18px;
  min-width: 0;
}
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card__head h2 { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 17px; font-weight: 700; color: var(--navy); letter-spacing: -.01em; }
.card__head h2 .ico { color: var(--uz-blue); }
.card--patient, .card--sum { position: sticky; top: 16px; }

/* ================= FORM ================= */
.form { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.req { color: var(--danger); }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="number"], input[type="search"], select, textarea {
  width: 100%; min-height: 44px;
  padding: 10px 12px;
  border: 1.5px solid var(--border-2); border-radius: var(--r-md);
  background: #fff;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
textarea { resize: vertical; min-height: 84px; }
input:hover, select:hover, textarea:hover { border-color: #b8c3d3; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--uz-blue); box-shadow: 0 0 0 4px rgba(30,100,200,.14); }
.field.invalid input { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(201,42,42,.10); }
.err { margin: 0; min-height: 0; font-size: 13px; color: var(--danger); font-weight: 600; }
.err:empty { display: none; }
.more { border: 1px dashed var(--border-2); border-radius: var(--r-md); padding: 0 12px; }
.more[open] { padding-bottom: 12px; }
.more summary { cursor: pointer; padding: 11px 0; font-weight: 600; color: var(--ink-2); font-size: 14px; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform var(--t) var(--ease); margin-right: 4px; }
.more[open] summary::after { transform: rotate(-135deg); }
.more .field { margin-top: 10px; }
.more .field-row .field { margin-top: 0; }
.more .field-row { margin-top: 10px; }
.privacy { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 0; padding: 10px 12px; font-size: 13px; color: var(--ink-3); background: var(--bg); border-radius: var(--r-md); }
.privacy .ico { width: 16px; height: 16px; margin-top: 2px; color: var(--success); }

/* ================= BUTTONS ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  border-radius: var(--r-md); border: 1.5px solid transparent;
  font-weight: 650; font-size: 15px; cursor: pointer; user-select: none;
  background: transparent; color: var(--ink);
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease), transform 120ms var(--ease), box-shadow var(--t) var(--ease);
  touch-action: manipulation;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .42; cursor: not-allowed; }
.btn--sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn--lg { min-height: 52px; font-size: 16px; }
.btn--block { width: 100%; }
.btn--primary { background: var(--uz-blue); color: #fff; box-shadow: 0 6px 18px -6px rgba(30,100,200,.6); }
.btn--primary:hover:not(:disabled) { background: var(--uz-blue-600); }
.btn--ghost { border-color: var(--border-2); background: #fff; }
.btn--ghost:hover:not(:disabled) { border-color: var(--uz-blue); color: var(--uz-blue); background: var(--uz-blue-50); }
.btn--icon { width: 44px; padding: 0; border-color: var(--border-2); background: #fff; }
.btn--icon.btn--sm { width: 36px; }
.btn--icon:hover:not(:disabled) { border-color: var(--uz-blue); color: var(--uz-blue); }
.btn--danger { background: #fff5f5; color: var(--danger); border-color: #ffc9c9; }
.btn--danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn--danger-ghost:hover:not(:disabled) { border-color: var(--danger) !important; color: var(--danger) !important; background: #fff5f5 !important; }
.badge { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--uz-blue-50); color: var(--uz-blue-600); font-size: 12px; font-weight: 800; }

/* ================= TOOLBAR / DOSE ================= */
.toolbar { display: flex; align-items: center; gap: 8px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink-2); margin-right: 4px; min-height: 44px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track { width: 38px; height: 22px; border-radius: 999px; background: var(--border-2); position: relative; transition: background var(--t) var(--ease); }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--sh-1); transition: transform var(--t) var(--ease); }
.switch input:checked + .switch__track { background: var(--uz-blue); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { outline: 3px solid rgba(30,100,200,.4); outline-offset: 2px; }

.dosebar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 10px; margin-bottom: 14px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md);
}
.dosebar__label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: 0 4px; }
.dosebar__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px 0 8px;
  border-radius: 999px; border: 1.5px solid var(--border-2); background: #fff;
  font-weight: 700; font-size: 15px; cursor: pointer;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), transform 120ms var(--ease), background var(--t) var(--ease);
}
.chip:hover { border-color: #9fb0c6; }
.chip:active { transform: scale(.96); }
.chip[aria-checked="true"] { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(6,35,46,.12); background: #fff; }
.chip__dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(15,23,42,.18); }
.chip kbd { font: 600 11px/1 var(--font); color: var(--ink-3); border: 1px solid var(--border-2); border-radius: 4px; padding: 2px 4px; }
.dosebar__other { display: none; align-items: center; gap: 6px; font-weight: 700; color: var(--ink-2); }
.dosebar__other.show { display: inline-flex; }
.dosebar__other input { width: 90px; }

/* ================= STAGE ================= */
.stage {
  position: relative;
  border-radius: var(--r-xl);
  background:
    radial-gradient(ellipse 60% 55% at 50% 42%, #ffffff 0%, rgba(255,255,255,0) 70%),
    linear-gradient(180deg, #eaf1fb 0%, #f3f6fa 60%, #e9eef5 100%);
  border: 1px solid var(--border);
  padding: 26px 16px 46px;
  overflow: hidden;
}
.stage__spot { position: absolute; left: 50%; bottom: 34px; width: 56%; height: 34px; transform: translateX(-50%); background: radial-gradient(ellipse at center, rgba(6,35,46,.28) 0%, rgba(6,35,46,0) 70%); filter: blur(6px); }
.stage__side { position: absolute; top: 18px; display: flex; flex-direction: column; align-items: center; line-height: 1; z-index: 2; }
.stage__side b { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: #fff; font-size: 16px; font-weight: 800; box-shadow: var(--sh-2); }
.stage__side small { margin-top: 5px; font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.stage__side--r { left: 18px; } .stage__side--r b { background: var(--side-r); }
.stage__side--l { right: 18px; } .stage__side--l b { background: var(--side-l); }
.stage__hint { position: absolute; left: 0; right: 0; bottom: 12px; margin: 0; text-align: center; font-size: 13px; color: var(--ink-3); font-weight: 500; }

.face {
  position: relative;
  margin: 0 auto;
  width: min(100%, calc((100dvh - 210px) * 0.7482));
  max-width: 560px;
  min-width: 260px;
  aspect-ratio: 529 / 707;
  filter: drop-shadow(0 30px 30px rgba(6,35,46,.18)) drop-shadow(0 8px 10px rgba(6,35,46,.10));
}
.face img { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
#overlay { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; cursor: crosshair; touch-action: none; }
#overlay:focus { outline: none; }
.pt:focus { outline: none; }
.pt:focus-visible circle.halo { fill: var(--uz-blue); }
.midline { stroke: rgba(255,255,255,.75); stroke-width: 1; stroke-dasharray: 3 5; opacity: 0; transition: opacity var(--t) var(--ease); }
.face:hover .midline, .face.dragging .midline { opacity: 1; }

.guide { fill: rgba(255,255,255,.25); stroke: rgba(255,255,255,.95); stroke-width: 1.4; stroke-dasharray: 2.4 2.2; pointer-events: none; }
.guides-off #gGuides { display: none; }

.pt { cursor: grab; }
.pt circle.halo { fill: #fff; opacity: .95; }
.pt circle.core { stroke: rgba(6,35,46,.45); stroke-width: .8; }
.pt circle.halo { filter: drop-shadow(0 1px 1.5px rgba(6,35,46,.45)); }
.pt text { font: 800 11px/1 var(--font); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.pt.sel circle.halo { fill: var(--navy); }
.pt:hover circle.halo { fill: var(--uz-blue); }
.pt.dragging { cursor: grabbing; }
.pt-in { animation: popin 240ms var(--ease) both; transform-box: fill-box; transform-origin: center; }
@keyframes popin { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.tip {
  position: absolute; z-index: 5; pointer-events: none;
  transform: translate(-50%, calc(-100% - 14px));
  padding: 6px 10px; border-radius: 10px;
  background: rgba(6,35,46,.92); color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap;
  box-shadow: var(--sh-2);
  opacity: 0; transition: opacity 120ms var(--ease);
}
.tip.show { opacity: 1; }
.tip .s { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; font-weight: 800; margin-right: 6px; }

/* ================= POPOVER ================= */
.pop {
  position: absolute; z-index: 20; width: 260px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  padding: 14px; display: grid; gap: 6px;
  animation: popfade 160ms var(--ease);
}
.pop[hidden] { display: none; }
@keyframes popfade { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.pop__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.pop__head strong { color: var(--navy); }
.pop label { font-size: 13px; margin-top: 4px; }
.pop__dose { display: grid; gap: 8px; }
.pop__quick { display: flex; gap: 6px; flex-wrap: wrap; }
.pop__quick button { min-width: 40px; min-height: 36px; border-radius: 999px; border: 1.5px solid var(--border-2); background: #fff; font-weight: 700; cursor: pointer; }
.pop__quick button:hover { border-color: var(--uz-blue); color: var(--uz-blue); }
.pop .btn--danger { margin-top: 10px; }
.card--face { position: relative; }

/* ================= SUMMARY ================= */
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.side { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--border); position: relative; overflow: hidden; }
.side::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.side--r { background: linear-gradient(135deg, #eef4fd, #fff); } .side--r::before { background: var(--side-r); }
.side--l { background: linear-gradient(135deg, #e8f6f3, #fff); } .side--l::before { background: var(--side-l); }
.side__label { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.side__val { font-size: 15px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.side__val b { font-size: 30px; line-height: 1.1; color: var(--navy); letter-spacing: -.02em; }
.side__meta { font-size: 13px; color: var(--ink-3); }
.balance { display: flex; height: 6px; border-radius: 999px; overflow: hidden; background: var(--border); margin: 12px 0; }
.balance span { transition: flex-grow 300ms var(--ease); flex-grow: 1; }
#balR { background: var(--side-r); } #balL { background: var(--side-l); }
.grand { display: flex; align-items: baseline; justify-content: space-between; padding: 10px 14px; border-radius: var(--r-md); background: var(--navy); color: #fff; font-weight: 600; }
.grand .muted { color: #a9bccb; font-size: 13px; margin-left: 6px; }
.grand b { font-size: 22px; font-variant-numeric: tabular-nums; }

.tablewrap { margin-top: 14px; max-height: 42dvh; overflow: auto; border: 1px solid var(--border); border-radius: var(--r-md); position: relative; }
.sumtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.sumtable th { position: sticky; top: 0; background: #f8fafc; text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding: 9px 10px; border-bottom: 1px solid var(--border); z-index: 1; }
.sumtable td { padding: 9px 10px; border-bottom: 1px solid #eef1f5; vertical-align: top; }
.sumtable tbody tr:last-child td { border-bottom: 0; }
.sumtable tbody tr { transition: background var(--t) var(--ease); }
.sumtable tbody tr:hover { background: var(--uz-blue-50); }
.sumtable .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sumtable td.num.r { color: var(--side-r); font-weight: 700; }
.sumtable td.num.l { color: var(--side-l); font-weight: 700; }
.sumtable td.num.t { font-weight: 800; }
.sumtable .zero { color: #c0c8d4; font-weight: 500 !important; }
.sumtable .rname { font-weight: 600; color: var(--ink); }
.sumtable .rsub { display: block; font-size: 12px; color: var(--ink-3); font-weight: 500; }
.empty { display: none; padding: 26px 16px; text-align: center; color: var(--ink-3); font-size: 14px; }
.empty .ico { margin: 0 auto 8px; color: #a7b4c6; }
.empty.show { display: block; }
.empty p { margin: 0; }
.actions { display: grid; gap: 8px; margin-top: 16px; }

/* ================= MODALS ================= */
.modal { border: 0; padding: 0; border-radius: var(--r-xl); box-shadow: var(--sh-3); width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); color: var(--ink); }
.modal--wide { width: min(980px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(6,35,46,.5); backdrop-filter: blur(3px); }
.modal[open] { animation: modalin 220ms var(--ease); }
@keyframes modalin { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.modal__inner { padding: 22px; display: grid; gap: 12px; }
.modal__head { display: flex; align-items: center; justify-content: space-between; }
.modal__head h2 { margin: 0; font-size: 20px; color: var(--navy); }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.modal p { margin: 0; }
.opt { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 12px; padding: 14px; border: 1.5px solid var(--border-2); border-radius: var(--r-md); cursor: pointer; transition: border-color var(--t) var(--ease), background var(--t) var(--ease); }
.opt:hover { border-color: #9fb0c6; }
.opt:has(input:checked) { border-color: var(--uz-blue); background: var(--uz-blue-50); }
.opt input { width: 20px; height: 20px; accent-color: var(--uz-blue); }
.opt b { display: block; color: var(--navy); }
.opt small { color: var(--ink-3); font-size: 13px; line-height: 1.4; display: block; }
.opt__ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: #fff; }
.opt__ico--pdf { background: #c92a2a; } .opt__ico--xls { background: #1d7a45; }
.note { display: flex; gap: 8px; font-size: 13px; color: var(--ink-3); background: var(--bg); padding: 10px 12px; border-radius: var(--r-md); }
.note .ico { width: 16px; height: 16px; margin-top: 2px; color: var(--uz-blue); }

.reg__tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.search { flex: 1 1 260px; position: relative; }
.search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.search input { padding-left: 38px; }
.reg__list { display: grid; gap: 8px; max-height: 60dvh; overflow: auto; padding: 2px; }
.reg__group { border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.reg__ghead { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; background: #f8fafc; border-bottom: 1px solid var(--border); }
.reg__ghead b { color: var(--navy); }
.reg__ghead span { font-size: 13px; color: var(--ink-3); }
.reg__row { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 12px; padding: 8px 14px; border-bottom: 1px solid #eef1f5; }
.reg__row:last-child { border-bottom: 0; }
.reg__row .d { font-weight: 700; font-variant-numeric: tabular-nums; }
.reg__row .t { font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.reg__row .t b.r { color: var(--side-r); } .reg__row .t b.l { color: var(--side-l); }
.reg__row .a { display: flex; gap: 6px; }
.reg__empty { padding: 30px; text-align: center; color: var(--ink-3); }

/* ================= REGISTER SECTION ================= */
.register { max-width: 1480px; margin: 0 auto; padding: 0 28px 28px; scroll-margin-top: 16px; }
.reg__top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.reg__top h2 { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 19px; color: var(--navy); }
.reg__top h2 .ico { color: var(--uz-blue); }
.reg__sub { margin: 4px 0 0; font-size: 14px; }
.reg__kpis { display: flex; flex-wrap: wrap; gap: 10px; }
.kpi { min-width: 120px; padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); }
.kpi span { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.kpi b { font-size: 20px; color: var(--navy); font-variant-numeric: tabular-nums; }
.reg__tools { margin-bottom: 12px; }
.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md); }
.seg__btn { min-height: 36px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; font-weight: 650; font-size: 14px; color: var(--ink-2); cursor: pointer; transition: background var(--t) var(--ease), color var(--t) var(--ease); }
.seg__btn[aria-selected="true"] { background: #fff; color: var(--navy); box-shadow: var(--sh-1); }
.daterange { display: inline-flex; align-items: center; gap: 6px; }
.daterange label { font-size: 13px; color: var(--ink-3); }
.daterange input { width: 150px; }
.reg__list { max-height: none; overflow: visible; }
.reg__table { width: 100%; border-collapse: collapse; font-size: 14px; }
.reg__table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding: 8px 12px; border-bottom: 1px solid var(--border); background: #fff; }
.reg__table td { padding: 9px 12px; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
.reg__table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.reg__table td.r { color: var(--side-r); font-weight: 700; } .reg__table td.l { color: var(--side-l); font-weight: 700; } .reg__table td.t { font-weight: 800; }
.reg__table tr.main:hover td { background: var(--uz-blue-50); }
.reg__table tr.detail td { background: #fafbfd; padding: 4px 12px 12px 44px; }
.reg__table .who b { color: var(--navy); } .reg__table .who small { display: block; color: var(--ink-3); font-size: 12px; }
.reg__table .acts { display: flex; gap: 6px; justify-content: flex-end; }
.xbtn { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border-2); background: #fff; cursor: pointer; display: inline-grid; place-items: center; transition: transform var(--t) var(--ease); }
.xbtn[aria-expanded="true"] svg { transform: rotate(90deg); }
.xbtn svg { width: 14px; height: 14px; transition: transform var(--t) var(--ease); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rchip { font-size: 12.5px; padding: 4px 9px; border-radius: 999px; background: #fff; border: 1px solid var(--border); }
.rchip b.r { color: var(--side-r); } .rchip b.l { color: var(--side-l); }
.reg__group { margin-bottom: 12px; }
.reg__ghead { gap: 16px; }
.reg__ghead .gtot { font-variant-numeric: tabular-nums; }
.reg__ghead .gtot b.r { color: var(--side-r); } .reg__ghead .gtot b.l { color: var(--side-l); }
@media (max-width: 820px) {
  .register { padding: 0 16px 24px; }
  .reg__table .hide-sm { display: none; }
  .reg__table tr.detail td { padding-left: 12px; }
}

/* ================= SYNC STATUS ================= */
.sync { display: inline-flex; align-items: center; gap: 8px; margin: 8px 0 0; padding: 4px 11px 4px 9px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid var(--border); background: var(--bg); color: var(--ink-2); }
.sync__dot { width: 8px; height: 8px; border-radius: 50%; background: #adb5bd; flex: none; }
.sync--remote { background: #ebfbee; border-color: #b2f2bb; color: #1b5e2a; } .sync--remote .sync__dot { background: var(--success); }
.sync--connecting .sync__dot { background: var(--uz-blue); animation: pulse 1.6s infinite; }
.sync--local, .sync--offline { background: #fff9db; border-color: #ffe066; color: #7a5c00; } .sync--local .sync__dot, .sync--offline .sync__dot { background: #f59f00; }
.sync--auth, .sync--error { background: #fff5f5; border-color: #ffc9c9; color: var(--danger); } .sync--auth .sync__dot, .sync--error .sync__dot { background: var(--danger); }

/* ================= AANMELDEN ================= */
body.locked { overflow: hidden; }
.auth { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px; overflow: auto; background: linear-gradient(180deg, #ffffff 0%, #eef3fb 100%); }
.auth[hidden] { display: none; }
.auth__bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.auth__card { position: relative; width: min(440px, 100%); background: #fff; border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--sh-3); padding: 28px; animation: modalin 260ms var(--ease); }
.auth__brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.auth__brand img { height: 34px; width: auto; }
.auth__brand .hero__divider { height: 30px; }
.auth__brand .hero__dept { font-size: 14px; }
.auth h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.02em; color: var(--navy); }
.auth__lead { margin: 0 0 18px; color: var(--ink-2); font-size: 15px; }
.auth__form { display: grid; gap: 14px; }
.auth__pw { position: relative; }
.auth__pw input { padding-right: 76px; }
.auth__eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 34px; padding: 0 10px; border: 0; background: transparent; color: var(--uz-blue); font-weight: 700; font-size: 14px; cursor: pointer; border-radius: 8px; }
.auth__eye:hover { background: var(--uz-blue-50); }
.auth__msg { margin: 0; font-size: 14px; font-weight: 600; color: var(--danger); }
.auth__msg:empty { display: none; }
.auth__msg.ok { color: var(--success); }
.auth__links { display: grid; gap: 4px; margin-top: 14px; justify-items: start; }
.linkbtn { min-height: 44px; padding: 0; border: 0; background: none; color: var(--uz-blue); font-weight: 650; font-size: 15px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-align: left; }
.linkbtn:hover { color: var(--uz-blue-600); }
.linkbtn[hidden] { display: none; }
.auth__icon { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 14px; border-radius: 16px; background: var(--uz-blue-50); color: var(--uz-blue); }
.auth__icon--ok { background: #ebfbee; color: var(--success); }
.auth__foot { display: flex; align-items: center; gap: 8px; justify-content: center; margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--ink-3); }
.auth__foot .ico { width: 15px; height: 15px; color: var(--success); }
.auth section[hidden] { display: none; }
.logout { margin-left: auto; padding: 8px 4px; min-height: 44px; border: 0; background: none; font: inherit; color: var(--ink-3); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.logout:hover { color: var(--uz-blue); }

/* ================= TOPBALK & GEBRUIKERSBEHEER ================= */
.topbar { background: var(--navy); color: #dbe6ee; font-size: 14px; }
.topbar__inner { max-width: 1480px; margin: 0 auto; padding: 0 28px; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.topbar__user { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }
.topbar__user .ico { width: 16px; height: 16px; opacity: .8; flex: none; }
.topbar__user #whoEmail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rolebadge { padding: 2px 9px; border-radius: 999px; background: rgba(255,255,255,.14); font-size: 12px; font-weight: 700; letter-spacing: .03em; }
.topbar__actions { display: inline-flex; gap: 4px; }
.topbtn { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 12px; border: 0; background: none; color: #dbe6ee; font: inherit; font-weight: 600; cursor: pointer; border-radius: 8px; }
.topbtn:hover { background: rgba(255,255,255,.1); color: #fff; }
.topbtn .ico { width: 16px; height: 16px; }
.topbtn[hidden], .rolebadge[hidden] { display: none; }
.topbtn:focus-visible { outline-color: #fff; }
body.locked .topbar { display: none; }

.adduser { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; margin-top: 4px; }
.adduser .field { margin: 0; }
.users__wrap { border: 1px solid var(--border); border-radius: var(--r-md); overflow: auto; max-height: 50dvh; }
.users__table { width: 100%; border-collapse: collapse; font-size: 14px; }
.users__table th { position: sticky; top: 0; z-index: 1; background: #f8fafc; text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding: 9px 12px; border-bottom: 1px solid var(--border); }
.users__table td { padding: 10px 12px; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
.users__table tr:last-child td { border-bottom: 0; }
.users__table tr.off td:first-child b { color: var(--ink-3); text-decoration: line-through; }
.users__table b { color: var(--navy); word-break: break-all; }
.users__table .acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; margin: 2px 4px 2px 0; border: 1px solid var(--border); background: var(--bg); color: var(--ink-2); }
.pill--ok { background: #ebfbee; border-color: #b2f2bb; color: #1b5e2a; }
.pill--wait { background: #fff9db; border-color: #ffe066; color: #7a5c00; }
.pill--off { background: #fff5f5; border-color: #ffc9c9; color: var(--danger); }
.pill--admin { background: var(--uz-blue-50); border-color: var(--uz-blue-100); color: var(--uz-blue-600); }
@media (max-width: 820px) {
  .topbar__inner { padding: 0 16px; }
  .adduser { grid-template-columns: 1fr; }
  .users__table .hide-sm { display: none; }
}

.savestate { margin: -2px 0 2px; min-height: 20px; text-align: center; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.savestate.ok { color: var(--success); }
.savestate.dirty { color: #a16207; }
.savestate:empty { display: none; }

/* ================= PATIËNTENLIJST & DOSSIER ================= */
.plink { padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; text-align: left; display: block; border-radius: 6px; }
.plink b { color: var(--navy); }
.plink:hover b, .plink:focus-visible b { color: var(--uz-blue); text-decoration: underline; text-underline-offset: 3px; }
.ptable tr.prow { cursor: pointer; }
.ptable tr.prow:hover td { background: var(--uz-blue-50); }
.plink-go { display: inline-flex; align-items: center; gap: 2px; color: var(--uz-blue); font-weight: 700; font-size: 13px; white-space: nowrap; }
.plink-go .ico { width: 15px; height: 15px; }
.reg--dossier .seg, .reg--dossier .search, .reg--dossier .daterange { display: none; }
.dossier__top { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-bottom: 16px; padding: 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: linear-gradient(135deg, #f4f8fe, #fff); }
.dossier__id { flex: 1 1 220px; min-width: 0; }
.dossier__id h3 { margin: 0; font-size: 22px; letter-spacing: -.02em; color: var(--navy); }
.dossier__id p { margin: 2px 0 0; font-size: 14px; }
.dossier__kpis { display: flex; flex-wrap: wrap; gap: 8px; }
.dossier__kpis .kpi { min-width: 96px; background: #fff; }
.kpi--r { border-left: 3px solid var(--side-r); } .kpi--l { border-left: 3px solid var(--side-l); }
.dossier__h { margin: 18px 0 8px; font-size: 15px; color: var(--navy); }
.dossier__h .muted { font-weight: 500; font-size: 13px; }

/* ================= EPD-CONFLICTEN ================= */
.hint { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.hint:empty { display: none; }
.hint.ok { color: var(--success); }
.hint.warn { color: #a16207; }
.reg__table .who small.warn, small.warn { display: block; color: #a16207; font-weight: 700; }
.dossier__warn { margin: 0 0 6px; padding: 12px 14px; border-radius: var(--r-md); background: #fff5f5; border: 1px solid #ffc9c9; color: #7d1a1a; font-size: 14px; }
.dossier__warn p { margin: 0 0 8px; }
.dossier__warn p:last-child { margin: 8px 0 0; font-size: 13px; }
.fixnames { display: flex; flex-wrap: wrap; gap: 8px; }
small.err-flag, .reg__table .who small.err-flag { display: block; color: var(--danger); font-weight: 700; }
.linkbtn--sm { min-height: 0; font-size: inherit; display: inline; vertical-align: baseline; }

/* ================= TOAST / FOOTER ================= */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px);
  background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--sh-3);
  font-weight: 600; font-size: 15px; opacity: 0; pointer-events: none; z-index: 100;
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
  display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--danger); }
.foot { max-width: 1480px; margin: 0 auto; padding: 8px 28px 32px; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 13px; color: var(--ink-2); }
.foot img { height: 22px; width: auto; opacity: .85; }

/* ================= RESPONSIVE ================= */
@media (max-width: 1200px) {
  .app { grid-template-columns: minmax(280px, 340px) 1fr; }
  .card--sum { grid-column: 1 / -1; position: static; }
  .card--sum .tablewrap { max-height: none; }
}
@media (max-width: 1024px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__copy { justify-self: start; }
}
@media (max-width: 820px) {
  .hero__inner, .app, .foot { padding-left: 16px; padding-right: 16px; }
  .app { grid-template-columns: 1fr; }
  .card--patient { position: static; }
  .face { width: 100%; }
  .chip kbd { display: none; }
  .hero__logo { height: 36px; }
  .reg__row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
