/* =========================================================
   Hoofd-hals oncologie · UZ Gent
   Tokens, basis, app-schil, aanmelden en gedeelde onderdelen.
   Kalender: calendar.css · Casussen en mondschema: cases.css
   ========================================================= */
:root {
  --uz-blue: #1e64c8;
  --uz-blue-600: #1853a8;
  --uz-blue-100: #dbe8fb;
  --uz-blue-50: #eef4fd;
  --navy: #06232e;
  --ink: #0f172a;
  --ink-2: #334155;
  --ink-3: #5b6778;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --border: #e3e8ef;
  --border-2: #d4dbe5;

  /* status: altijd samen met tekst of icoon, nooit enkel kleur */
  --go: #2b8a3e;
  --go-ink: #1d6b2d;
  --go-bg: #e8f5ec;
  --stop: #c92a2a;
  --stop-ink: #a32020;
  --stop-bg: #fdecec;
  --off-bg: #eef1f5;
  --off-ink: #6b7686;

  /* disciplines */
  --d-mka: #0b6fb8;
  --d-plast: #8a4fbf;
  --d-hh: #b85c00;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --sh-1: 0 1px 2px rgba(15, 23, 42, .06);
  --sh-2: 0 8px 28px -10px rgba(15, 23, 42, .22);
  --sh-3: 0 24px 64px -16px rgba(6, 35, 46, .30);
  --ease: cubic-bezier(.22, .8, .26, 1);
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --appbar-h: 64px;
  --tabbar-h: 64px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
body.locked { overflow: hidden; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.muted { color: var(--ink-3); font-weight: 500; }
:focus-visible { outline: 3px solid var(--uz-blue); outline-offset: 2px; border-radius: 4px; }
.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; }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico--lg { width: 30px; height: 30px; stroke-width: 1.6; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- knoppen en velden ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: 10px; background: #fff; font-weight: 650; text-decoration: none; transition: background .15s, border-color .15s, transform .1s; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .45; 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; }
.btn--primary:hover:not(:disabled) { background: var(--uz-blue-600); }
.btn--ghost { border-color: var(--border-2); }
.btn--ghost:hover:not(:disabled) { border-color: var(--uz-blue); color: var(--uz-blue); background: var(--uz-blue-50); }
.btn--danger { background: #fff5f5; color: var(--stop-ink); border-color: #f3c2c2; }
.btn--danger:hover:not(:disabled) { background: var(--stop); color: #fff; border-color: var(--stop); }
.iconbtn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); }
.iconbtn:hover { background: var(--uz-blue-50); color: var(--uz-blue); }
.linkbtn { min-height: 44px; padding: 0; border: 0; background: none; color: var(--uz-blue); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; text-align: left; }
.linkbtn:hover { color: var(--uz-blue-600); }

.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 650; color: var(--ink-2); }
.field input, .field select, .field textarea { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--border-2); border-radius: 10px; background: #fff; }
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--uz-blue); box-shadow: 0 0 0 4px rgba(30, 100, 200, .15); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }

.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 1px solid var(--border-2); border-radius: 999px; background: #fff; font-size: 14px; font-weight: 550; }
.chip:hover { border-color: var(--uz-blue); }
.chip[aria-pressed="true"] { background: var(--uz-blue); border-color: var(--uz-blue); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.seg { display: inline-flex; border: 1px solid var(--border-2); border-radius: 10px; overflow: hidden; background: #fff; }
.seg button { min-height: 40px; padding: 0 14px; border: 0; border-right: 1px solid var(--border-2); background: transparent; font-weight: 600; font-size: 14px; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--uz-blue); color: #fff; }
.seg button:hover:not([aria-pressed="true"]) { background: var(--uz-blue-50); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--uz-blue-50); color: var(--uz-blue-600); }
.badge--go { background: var(--go-bg); color: var(--go-ink); }
.badge--stop { background: var(--stop-bg); color: var(--stop-ink); }
.badge--off { background: var(--off-bg); color: var(--off-ink); }

/* ---------- aanmelden ---------- */
.auth { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px; overflow: auto; background: linear-gradient(180deg, #fff 0%, #e9f0fb 100%); }
.auth__card { width: min(440px, 100%); background: #fff; border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--sh-3); padding: 28px; }
.auth__brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.auth__brand img { height: 34px; width: auto; }
.auth h1 { font-size: 26px; letter-spacing: -.02em; color: var(--navy); margin-bottom: 6px; }
.auth__lead { color: var(--ink-2); margin-bottom: 18px; }
.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; border-radius: 8px; }
.auth__eye:hover { background: var(--uz-blue-50); }
.auth__msg { font-size: 14px; font-weight: 600; color: var(--stop-ink); }
.auth__msg:empty { display: none; }
.auth__msg.ok { color: var(--go-ink); }
.auth__links { display: grid; gap: 2px; margin-top: 14px; justify-items: start; }
.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: var(--go-bg); color: var(--go); }
.auth__foot { display: flex; align-items: center; gap: 8px; justify-content: center; margin-top: 22px; 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(--go); }
.auth section[hidden] { display: none; }

/* ---------- app-schil ---------- */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.appbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 20px; min-height: var(--appbar-h); padding: 0 24px; background: #fff; border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; min-width: 0; }
.brand img { height: 30px; width: auto; }
.brand__divider { width: 1px; height: 28px; background: var(--border-2); flex: none; }
.brand__dept { display: grid; line-height: 1.2; font-weight: 700; color: var(--navy); font-size: 15px; }
.brand__dept .muted { font-size: 12px; font-weight: 500; }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 600; }
.nav a:hover { background: var(--bg); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--uz-blue-50); color: var(--uz-blue-600); }
.appbar__right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.sync { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-3); }
.sync__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--go); }
.sync.is-off { color: var(--stop-ink); font-weight: 650; }
.sync.is-off .sync__dot { background: var(--stop); }
.who { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 14px; }
.who__avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .02em; }

.main { flex: 1; width: 100%; max-width: 1560px; margin: 0 auto; padding: 22px 24px 48px; outline: 0; }
.page-title { font-size: 24px; letter-spacing: -.02em; color: var(--navy); }
.page-lead { color: var(--ink-3); margin-top: 2px; }
.empty { display: grid; justify-items: center; gap: 10px; padding: 48px 16px; text-align: center; color: var(--ink-3); border: 1px dashed var(--border-2); border-radius: var(--r-md); background: #fff; }
.empty b { color: var(--ink); font-size: 16px; }

.tabbar { display: none; }

/* ---------- meldingen en dialoog ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 400; display: grid; gap: 8px; width: min(440px, calc(100vw - 24px)); pointer-events: none; }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--navy); color: #fff; font-weight: 600; box-shadow: var(--sh-2); animation: toastin .22s var(--ease); pointer-events: auto; }
.toast--err { background: var(--stop-ink); }
.toast--warn { background: #8a5a00; }
.toast--ok { background: var(--go-ink); }
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } }

.dlg { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 20px; box-shadow: var(--sh-3); overflow: hidden; }
.dlg::backdrop { background: rgba(6, 35, 46, .45); }
.dlg[open] { display: flex; flex-direction: column; animation: dlgin .22s var(--ease); }
@keyframes dlgin { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.dlg__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.dlg__head h2 { font-size: 18px; color: var(--navy); }
.dlg__body { padding: 18px 20px; overflow: auto; display: grid; gap: 14px; outline: 0; }
.dlg__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: #fafbfd; }

/* ---------- GSM ---------- */
@media (max-width: 899px) {
  .brand__dept .muted, .who__name, .sync__text { display: none; }
  .nav { display: none; }
}
@media (max-width: 767px) {
  .appbar { padding: 0 12px; gap: 8px; }
  .brand__dept { font-size: 14px; }
  .brand__divider { display: none; }
  .brand img { display: none; }
  .main { padding: 14px 12px calc(var(--tabbar-h) + 28px); }
  .tabbar { position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--border); }
  .tabbar a { display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 48px; color: var(--ink-3); text-decoration: none; font-size: 11.5px; font-weight: 650; }
  .tabbar a[aria-current="page"] { color: var(--uz-blue); }
  .tabbar a[aria-current="page"] .ico { stroke-width: 2.4; }
  .toasts { bottom: calc(var(--tabbar-h) + 16px); }
  .dlg { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
