/* Beheerplatform – opmaak overgenomen uit de praktijksoftware (repo praktijk, static/css/app.css), ingekort tot
   wat het platform gebruikt. Geen externe fonts of scripts. */
:root {
  --teal: #0b7383;
  --teal-dark: #085a67;
  --teal-brand: #34b5ca;
  --teal-soft: #e6f5f8;
  --lilac: #e09ff1;
  --lilac-dark: #8e44a8;
  --lilac-soft: #f8eefb;
  --ink: #17363b;
  --muted: #56696e;
  --bg: #f6fafb;
  --surface: #ffffff;
  --line: #d6e5e8;
  --line-strong: #b9d0d5;
  --sidebar: #10343a;
  --ok: #1d7a4c;
  --ok-soft: #e4f4ec;
  --warn: #9a5a00;
  --warn-soft: #fff3df;
  --danger: #b0261c;
  --danger-soft: #fde9e7;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 4px 16px rgba(0, 0, 0, .05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.55; }
body.public { font-size: 18px; }
body.staff { font-size: 15px; }
img { max-width: 100%; height: auto; }
a { color: var(--teal); }
a:hover { color: var(--teal-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; color: var(--ink); }
h1 { font-size: 2rem; letter-spacing: -.01em; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
small, .muted { color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
:focus-visible { outline: 3px solid var(--lilac); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Knoppen */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  padding: .7em 1.25em; border-radius: 999px; border: 2px solid var(--teal);
  background: var(--teal); color: #fff; font: inherit; font-weight: 600; text-decoration: none;
  cursor: pointer; line-height: 1.2; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; }
.btn.secondary { background: transparent; color: var(--teal); }
.btn.secondary:hover { background: var(--teal-soft); color: var(--teal-dark); }
.btn.lilac { background: var(--lilac-dark); border-color: var(--lilac-dark); }
.btn.lilac:hover { filter: brightness(.88); }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.danger.secondary { background: transparent; color: var(--danger); }
.btn.small { padding: .35em .85em; font-size: .9em; }
.btn.big { padding: .9em 1.6em; font-size: 1.1em; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; color: var(--teal); font: inherit; cursor: pointer;
  text-decoration: underline; }
.link-btn.danger { color: var(--danger); }

/* Kaarten en meldingen */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem;
  box-shadow: var(--shadow); }
.card > :last-child { margin-bottom: 0; }
.card.soft { background: var(--teal-soft); border-color: transparent; box-shadow: none; }
.card.lilac { background: var(--lilac-soft); border-color: transparent; box-shadow: none; }
.card h2, .card h3 { margin-top: 0; }
.messages { list-style: none; padding: 0; margin: 1rem 0; }
.alert { padding: .8em 1em; border-radius: var(--radius-sm); margin: 0 0 .6rem; border: 1px solid transparent; }
.alert.success { background: var(--ok-soft); border-color: #b9e0cb; color: #14532f; }
.alert.error { background: var(--danger-soft); border-color: #f2c1bb; color: #7b1912; }
.alert.warning { background: var(--warn-soft); border-color: #f4d7a6; color: #6b3f00; }
.alert.info { background: var(--teal-soft); border-color: var(--line-strong); color: var(--teal-dark); }
.badge { display: inline-block; padding: .15em .6em; border-radius: 999px; font-size: .8em; font-weight: 600;
  background: var(--teal-soft); color: var(--teal-dark); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.grey { background: #eef1f2; color: var(--muted); }
.badge.lilac { background: var(--lilac-soft); color: var(--lilac-dark); }

/* Formulieren */
form p { margin: 0 0 1rem; }
label { display: block; font-weight: 600; margin-bottom: .3em; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time],
input[type=datetime-local], input[type=tel], input[type=search], input[type=url], input:not([type]), select, textarea {
  width: 100%; padding: .6em .75em; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  font: inherit; color: var(--ink); background: #fff;
}
input:focus, select:focus, textarea:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px var(--teal-soft); }
input[type=checkbox], input[type=radio] { width: 1.15em; height: 1.15em; accent-color: var(--teal); vertical-align: middle; }
.helptext, .help { display: block; color: var(--muted); font-size: .88em; margin-top: .25em; font-weight: normal; }
.errorlist { list-style: none; margin: .3em 0 0; padding: 0; color: var(--danger); font-size: .92em; }
.errorlist.nonfield { background: var(--danger-soft); padding: .7em 1em; border-radius: var(--radius-sm); margin-bottom: 1rem; }
.field { margin-bottom: 1rem; }
.field.check label { display: flex; gap: .6em; align-items: flex-start; font-weight: normal; }
.field.check input { margin-top: .25em; }
.fields-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }
.form-actions { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin-top: 1.25rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 0 0 1.25rem; background: #fff; }
legend { font-weight: 700; padding: 0 .4em; color: var(--teal-dark); }
.code-input { font-size: 1.6em !important; letter-spacing: .3em; text-align: center; max-width: 12ch; }
.hp { position: absolute; left: -9999px; }
/* Django's standaard formulieropmaak */
form > div:not([class]) { margin-bottom: 1rem; }
form > div:not([class]) > label:has(+ input[type=checkbox]) { display: inline; margin-right: .4em; }
ul[id$="-list"], div[id^="id_"] > div { list-style: none; padding: 0; }

/* Tabellen */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: .55em .7em; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: .82em; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 700; background: var(--bg); }
tbody tr:hover { background: var(--bg); }
tr.clickable { cursor: pointer; }
td.num, th.num { text-align: right; white-space: nowrap; }
tfoot td { font-weight: 700; border-top: 2px solid var(--line-strong); }
table.plain th { background: none; text-transform: none; font-size: 1em; letter-spacing: 0; color: var(--muted); width: 35%; }
.total-row td { font-weight: 700; background: var(--teal-soft); }


.auth-box { max-width: 460px; margin: 1rem auto; }
.qr { background: #fff; padding: .75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); display: inline-block; }
.qr svg { display: block; width: 240px; height: 240px; max-width: 100%; }
.codes { font-family: ui-monospace, Consolas, monospace; font-size: 1.15em; display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem 1.5rem; padding: 1rem; background: var(--teal-soft); border-radius: var(--radius-sm); }

/* ---------- Backoffice ---------- */
.staff-layout { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--sidebar) 232px, var(--bg) 232px); }
.sidebar { background: var(--sidebar); color: rgba(255, 255, 255, .8); padding: 1rem .75rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { display: flex; align-items: center; gap: .6rem; padding: .25rem .5rem 1rem; color: #fff; text-decoration: none; font-weight: 700; }
.sidebar .brand img { width: 34px; height: 34px; background: #fff; border-radius: 8px; padding: 2px; }
.sidebar nav a { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .5em .75em; border-radius: 8px; color: rgba(255, 255, 255, .8); text-decoration: none; font-weight: 500; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar nav a.active { background: var(--teal); color: #fff; }
.sidebar .group { font-size: .72em; text-transform: uppercase; letter-spacing: .08em; color: rgba(255, 255, 255, .5); margin: 1rem .75rem .3rem; }
.sidebar .count { background: var(--lilac-dark); color: #fff; border-radius: 999px; font-size: .75em; padding: 0 .5em; }
.staff-main { min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem 1.5rem; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar form { margin: 0; }
.topbar .search input { width: 260px; padding: .45em .7em; }
.content { padding: 1.5rem; max-width: 1280px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head h1 { font-size: 1.6rem; margin: 0; }
.page-head .sub { color: var(--muted); margin-top: .2rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.stat { display: flex; flex-direction: column; gap: .2rem; }
.stat .label { color: var(--muted); font-size: .85em; font-weight: 600; }
.stat .value { font-size: 1.6rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat a { text-decoration: none; }
.meter { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; margin: .5rem 0 .3rem; }
.meter span { display: block; height: 100%; background: var(--teal-brand); }
.meter.warn span { background: #e5a23b; }
.meter.over span { background: var(--danger); }
.tabs { display: flex; gap: .25rem; border-bottom: 2px solid var(--line); margin-bottom: 1.25rem; flex-wrap: wrap; }
.tabs a { padding: .55em 1em; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tabs a.active { color: var(--teal-dark); border-bottom-color: var(--teal); }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
.filters input, .filters select { width: auto; }
.filters .field { margin: 0; }
.pill-links { display: flex; gap: .35rem; flex-wrap: wrap; }
.pill-links a { padding: .3em .8em; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: .9em; }
.pill-links a.active { background: var(--teal); border-color: var(--teal); color: #fff; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.25rem; margin: 0; }
.dl dt { color: var(--muted); font-weight: 600; }
.dl dd { margin: 0; }
/* Aandacht voor een veld met een fout of een vergeten vinkje (static/js/forms.js): twee rustige roze golfjes */
@keyframes attention-pulse {
  0%, 100% { background-color: rgba(222, 78, 115, 0); box-shadow: 0 0 0 .6rem rgba(222, 78, 115, 0); }
  40% { background-color: rgba(222, 78, 115, .14); box-shadow: 0 0 0 .6rem rgba(222, 78, 115, .14); }
}
.field.attention { border-radius: 6px; animation: attention-pulse 1.6s ease-in-out 2; }
.field.attention input[type="checkbox"] { outline: 2px solid var(--danger); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .field.attention { animation: none; background-color: rgba(222, 78, 115, .12); box-shadow: 0 0 0 .6rem rgba(222, 78, 115, .12); }
}

.menu-toggle { display: none; background: none; border: 2px solid var(--line-strong); border-radius: var(--radius-sm); padding: .4em .7em; font: inherit; font-weight: 600; color: var(--ink); }
@media (max-width: 900px) {
  .staff-layout { grid-template-columns: 1fr; background: var(--bg); }
  .sidebar { position: static; height: auto; display: none; }
  .sidebar.open { display: block; }
  .menu-toggle { display: inline-block; }
  .topbar { padding: .6rem 1rem; flex-wrap: wrap; }
  .content { padding: 1rem; }
}
@media print {
  .sidebar, .topbar, .actions, .no-print { display: none !important; }
  .staff-layout { display: block; }
  body { background: #fff; }
  .card { box-shadow: none; }
}

/* ---------- Platform ---------- */
.auth-page { padding: 2.5rem 0; }
.auth-brand { text-align: center; margin-bottom: 1rem; font-weight: 800; font-size: 1.3rem; color: var(--teal); }
.auth-brand small { display: block; font-weight: 500; font-size: .8rem; color: var(--muted); }
.dot { display: inline-block; width: .7em; height: .7em; border-radius: 50%; background: var(--line-strong); }
.dot.ok { background: var(--ok); }
.dot.warn { background: #e5a23b; }
.dot.danger { background: var(--danger); }
.log { background: var(--sidebar); color: #e6f1f3; padding: 1rem; border-radius: var(--radius-sm); overflow-x: auto;
  font-size: .85em; line-height: 1.45; white-space: pre-wrap; word-break: break-word; max-height: 70vh; overflow-y: auto; margin: 0; }
.info-list { list-style: none; padding: 0; margin: 0; }
.info-list li { padding: .45em 0; border-bottom: 1px dashed var(--line); display: flex; justify-content: space-between; gap: 1rem; }
.info-list li:last-child { border-bottom: 0; }
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.terminal { display: block; width: 100%; height: calc(100vh - 260px); min-height: 420px; border: 0; border-radius: var(--radius-sm); background: #000; }
