/* ==========================================================================
   ZorgScan — clinical editorial
   Papier + petrol, hairline-rasters, serif-cijfers als instrumentaflezing.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Archivo:wght@400;500;600;700&display=swap');

:root {
  --paper: #F2EEE4;
  --surface: #FDFBF6;
  --surface-2: #F8F5ED;
  --ink: #16242B;
  --ink-soft: #4A5B61;
  --ink-faint: #8A9698;
  --petrol: #10394D;
  --petrol-hi: #1B5570;
  --coral: #C9543A;
  --sage: #4F7A6F;
  --amber: #B98029;
  --line: #DDD5C5;
  --line-strong: #C4BAA6;

  --mono: 'Archivo', ui-sans-serif, system-ui, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;

  --rail: 224px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

/* Fijne papiertextuur, geen platte vlakken */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .035;
  background-image:
    repeating-linear-gradient(0deg, #000 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, #000 0 1px, transparent 1px 3px);
}

a { color: var(--petrol); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Layout ------------------------------------------------------ */
.shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }

.rail {
  width: var(--rail);
  flex: 0 0 var(--rail);
  background: var(--petrol);
  color: #E8E2D4;
  padding: 26px 0 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.rail__mark {
  padding: 0 22px 26px;
  border-bottom: 1px solid rgba(232, 226, 212, .16);
}
.rail__mark strong {
  display: block;
  font-family: var(--serif);
  font-size: 30px;
  letter-spacing: -.01em;
  line-height: 1;
  color: #FDFBF6;
}
.rail__mark span {
  display: block;
  margin-top: 7px;
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .6;
}

.rail nav { padding: 16px 10px; flex: 1; }
.rail nav a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  color: #CFC9BA;
  font-size: 14px;
  font-weight: 500;
  border-radius: 4px;
  border-left: 2px solid transparent;
}
.rail nav a:hover { background: rgba(255, 255, 255, .07); color: #FDFBF6; text-decoration: none; }
.rail nav a.is-active {
  background: rgba(255, 255, 255, .1);
  color: #FDFBF6;
  border-left-color: var(--coral);
}
.rail nav a small {
  font-size: 11px;
  opacity: .65;
  font-variant-numeric: tabular-nums;
}

.rail__foot { padding: 14px 22px 0; border-top: 1px solid rgba(232,226,212,.16); font-size: 11.5px; opacity: .55; }
.rail__foot form { margin-top: 8px; }
.rail__foot button {
  background: none; border: 0; padding: 0;
  color: #CFC9BA; font-family: inherit; font-size: 11.5px;
  cursor: pointer; text-decoration: underline;
}

.main { flex: 1; min-width: 0; padding: 30px 34px 70px; max-width: 1500px; }

/* ---------- Kop --------------------------------------------------------- */
.pagehead {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  padding-bottom: 16px; margin-bottom: 24px;
  border-bottom: 1px solid var(--line-strong);
}
.pagehead h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 400;
  letter-spacing: -.015em;
  line-height: 1.05;
}
.pagehead .sub { margin-top: 5px; color: var(--ink-soft); font-size: 13.5px; }
.pagehead__actions { display: flex; gap: 9px; align-items: center; }

.eyebrow {
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 600;
}

/* ---------- Knoppen ----------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit; font-size: 13.5px; font-weight: 500;
  border-radius: 3px; cursor: pointer;
  transition: background .13s, border-color .13s, transform .13s;
}
.btn:hover { background: #fff; border-color: var(--ink-soft); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--petrol); border-color: var(--petrol); color: #FDFBF6; }
.btn--primary:hover { background: var(--petrol-hi); border-color: var(--petrol-hi); }
.btn--accent { background: var(--coral); border-color: var(--coral); color: #fff; }
.btn--accent:hover { background: #B4462F; border-color: #B4462F; }
.btn--sm { padding: 5px 11px; font-size: 12.5px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Kaarten / KPI ---------------------------------------------- */
.grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.grid--kpi { grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); margin-bottom: 26px; }

.kpi { background: var(--surface); padding: 17px 18px 15px; }
.kpi__label {
  font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 600;
}
.kpi__value {
  font-family: var(--serif); font-size: 42px; line-height: 1; margin-top: 9px;
  letter-spacing: -.02em;
}
.kpi__value.is-accent { color: var(--coral); }
.kpi__value.is-petrol { color: var(--petrol); }
.kpi__note { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  margin-bottom: 22px;
}
.panel__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.panel__head h2 {
  margin: 0; font-size: 12px; font-weight: 700;
  letter-spacing: .13em; text-transform: uppercase; color: var(--ink-soft);
}
.panel__body { padding: 18px; }
.panel__body--flush { padding: 0; }

.cols { display: grid; gap: 22px; }
@media (min-width: 1060px) {
  .cols--2 { grid-template-columns: 1.35fr 1fr; }
  .cols--sidebar { grid-template-columns: 268px 1fr; align-items: start; }
}

/* ---------- Tabel ------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  text-align: left;
  padding: 9px 14px;
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 700;
  border-bottom: 1px solid var(--line-strong);
  background: var(--surface-2);
  white-space: nowrap;
}
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #FFFEFA; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

.vac-title { font-weight: 600; font-size: 14.5px; color: var(--ink); display: block; }
.vac-title:hover { color: var(--petrol); }
.vac-meta { color: var(--ink-soft); font-size: 12.5px; margin-top: 3px; }
.vac-sub { color: var(--ink-faint); font-size: 12px; margin-top: 3px; }

/* ---------- Score-chip -------------------------------------------------- */
.score {
  display: inline-block; min-width: 34px; text-align: center;
  padding: 3px 7px; border-radius: 3px;
  font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  background: #E6E2D7; color: var(--ink-soft);
}
.score--hoog { background: var(--petrol); color: #FDFBF6; }
.score--midden { background: var(--sage); color: #FDFBF6; }
.score--laag { background: #E6E2D7; color: var(--ink-faint); }

.tag {
  display: inline-block;
  padding: 2px 7px; margin: 2px 3px 2px 0;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font-size: 11.5px; color: var(--ink-soft);
  background: var(--surface-2);
}
.tag--pos { border-color: #B9CFC5; background: #EAF3EE; color: #35604F; }
.tag--neg { border-color: #E3C0B6; background: #FBEEEA; color: #94402C; }
.tag--big { border-color: #D9C48F; background: #FAF3E2; color: #7C5A16; }

.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; }
.dot--ok { background: var(--sage); }
.dot--fout { background: var(--coral); }
.dot--leeg { background: var(--amber); }
.dot--uit { background: var(--line-strong); }

/* ---------- Balken (verdeling) ----------------------------------------- */
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar { display: grid; grid-template-columns: 152px 1fr 46px; gap: 11px; align-items: center; font-size: 13px; }
.bar__label { color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar__track { height: 9px; background: var(--surface-2); border: 1px solid var(--line); position: relative; }
.bar__fill { position: absolute; inset: 0 auto 0 0; background: var(--petrol); }
.bar__fill--split { background: var(--coral); }
.bar__num { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }

/* ---------- Sparkline --------------------------------------------------- */
.spark { width: 100%; height: 88px; display: block; }
.spark path.line { fill: none; stroke: var(--petrol); stroke-width: 1.6; }
.spark path.area { fill: rgba(16, 57, 77, .08); stroke: none; }
.spark path.line2 { fill: none; stroke: var(--coral); stroke-width: 1.4; stroke-dasharray: 3 2.5; }

/* ---------- Formulieren ------------------------------------------------- */
label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-bottom: 5px; }
input[type=text], input[type=search], input[type=password], input[type=number],
input[type=email], select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-family: inherit; font-size: 14px; color: var(--ink);
  border-radius: 3px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--petrol);
  box-shadow: 0 0 0 3px rgba(16, 57, 77, .1);
}
textarea { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; line-height: 1.55; }
.field { margin-bottom: 14px; }
.field--row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink); font-weight: 400; margin-bottom: 5px; }
.check input { width: auto; margin: 0; }
.hint { font-size: 12px; color: var(--ink-faint); margin-top: 5px; line-height: 1.5; }

.filterbar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
  padding: 15px 18px; background: var(--surface); border: 1px solid var(--line);
  margin-bottom: 20px;
}
.filterbar .field { margin: 0; }
.filterbar .field--grow { flex: 1 1 240px; }

.chips { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  padding: 4px 11px; border: 1px solid var(--line-strong); background: var(--surface);
  border-radius: 14px; font-size: 12.5px; color: var(--ink-soft);
}
.chip.is-on { background: var(--petrol); border-color: var(--petrol); color: #FDFBF6; }
.chip:hover { text-decoration: none; border-color: var(--ink-soft); }

/* ---------- Paginering -------------------------------------------------- */
.pager { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.pager a, .pager span {
  padding: 6px 11px; border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 13px; border-radius: 3px; color: var(--ink-soft);
}
.pager .is-current { background: var(--petrol); border-color: var(--petrol); color: #FDFBF6; font-weight: 600; }

/* ---------- Login ------------------------------------------------------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1100px 520px at 12% -10%, rgba(16,57,77,.14), transparent 60%),
    radial-gradient(760px 420px at 105% 108%, rgba(201,84,58,.13), transparent 62%),
    var(--paper);
  position: relative; z-index: 1;
}
.login-card {
  width: 100%; max-width: 384px;
  background: var(--surface); border: 1px solid var(--line-strong);
  padding: 34px 30px 28px;
  box-shadow: 0 22px 48px -26px rgba(22, 36, 43, .3);
}
.login-card h1 { font-family: var(--serif); font-size: 34px; margin: 0 0 4px; font-weight: 400; }
.login-card .sub { color: var(--ink-soft); font-size: 13px; margin-bottom: 24px; }
.alert {
  padding: 10px 13px; border: 1px solid #E3C0B6; background: #FBEEEA;
  color: #8E3B27; font-size: 13.5px; margin-bottom: 16px; border-radius: 3px;
}
.alert--ok { border-color: #B9CFC5; background: #EAF3EE; color: #2F5A49; }

/* ---------- Scanbalk ---------------------------------------------------- */
.scanbar {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--coral), var(--petrol), var(--coral));
  background-size: 220% 100%;
  animation: sweep 1.5s linear infinite;
  z-index: 60; display: none;
}
.scanbar.is-on { display: block; }
@keyframes sweep { from { background-position: 0 0; } to { background-position: -220% 0; } }

.empty { padding: 46px 20px; text-align: center; color: var(--ink-faint); }
.empty strong { display: block; font-family: var(--serif); font-size: 22px; color: var(--ink-soft); margin-bottom: 6px; font-weight: 400; }

pre.json {
  background: #101E24; color: #CFE3DC; padding: 14px 16px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12.5px;
  overflow: auto; max-height: 420px; border-radius: 3px; line-height: 1.55;
}

.prose { max-width: 74ch; font-size: 14.5px; line-height: 1.68; white-space: pre-wrap; color: #263238; }

/* ---------- Mobiel ------------------------------------------------------ */
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .rail {
    width: 100%; flex: none; height: auto; position: static;
    padding: 16px 0 10px;
  }
  .rail__mark { padding: 0 18px 14px; }
  .rail__mark strong { font-size: 24px; }
  .rail nav { display: flex; overflow-x: auto; gap: 4px; padding: 12px 12px 2px; }
  .rail nav a { border-left: 0; border-bottom: 2px solid transparent; white-space: nowrap; }
  .rail nav a.is-active { border-left: 0; border-bottom-color: var(--coral); }
  .rail__foot { padding: 12px 18px 0; }
  .main { padding: 20px 16px 60px; }
  .pagehead h1 { font-size: 29px; }
  .kpi__value { font-size: 34px; }
  .bar { grid-template-columns: 112px 1fr 40px; }
  table { font-size: 13.5px; }
  .hide-sm { display: none; }
}

.app-version{margin:24px 0 14px;text-align:center;color:#7c8794;font-size:11.5px;letter-spacing:.3px}
