/* Layout: laptop-eerst app met vaste navigatiekolom in schoolblauw; inhoud op rustige vlakken.
   Boeken krijgen een omslag in genrekleur met een etiket (boekcode), zoals op de rug in de echte kast. */
:root {
  --bg: #0a1430;
  --surface: #101c3d;
  --surface-2: #16244c;
  --surface-3: #1d2e5c;
  --line: #24356a;
  --line-strong: #34498a;
  --fg: #eef1fa;
  --fg-2: #c7cfe6;
  --muted: #8e9bc0;
  --accent: #f59a2c;
  --accent-hover: #ffad4a;
  --accent-ink: #1d1103;
  --accent-text: #ffb25a;
  --accent-soft: rgba(245, 154, 44, 0.14);
  --blue: #7d9dff;
  --blue-soft: rgba(125, 157, 255, 0.14);
  --ok: #45c58c;
  --ok-soft: rgba(69, 197, 140, 0.14);
  --warn: #f1c453;
  --warn-soft: rgba(241, 196, 83, 0.15);
  --bad: #f4706a;
  --bad-soft: rgba(244, 112, 106, 0.15);
  --side-bg: #0c1838;
  --side-fg: #e9edfa;
  --side-muted: #8f9cc4;
  --side-active: rgba(245, 154, 44, 0.16);
  --label-bg: #f7f2e6;
  --label-ink: #1b2350;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --scrim: rgba(3, 8, 22, 0.62);

  --font-display: 'Literata', Georgia, 'Times New Roman', serif;
  --font-ui: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-md: 0.9375rem;
  --fs-lg: 1.0625rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.75rem;
  --fs-3xl: 2.25rem;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f2f4f9;
    --surface: #ffffff;
    --surface-2: #eef1f8;
    --surface-3: #e3e8f4;
    --line: #d9dfec;
    --line-strong: #bcc5dc;
    --fg: #121d45;
    --fg-2: #2f3a63;
    --muted: #5b6689;
    --accent: #f08a1c;
    --accent-hover: #f79a35;
    --accent-ink: #1d1103;
    --accent-text: #b05a00;
    --accent-soft: rgba(240, 138, 28, 0.13);
    --blue: #2c4fc4;
    --blue-soft: rgba(44, 79, 196, 0.1);
    --ok: #147a52;
    --ok-soft: rgba(20, 122, 82, 0.11);
    --warn: #8f5b00;
    --warn-soft: rgba(214, 150, 20, 0.16);
    --bad: #bf3730;
    --bad-soft: rgba(191, 55, 48, 0.1);
    --side-bg: #13215a;
    --side-fg: #eef1fb;
    --side-muted: #a8b3d8;
    --side-active: rgba(245, 154, 44, 0.2);
    --label-bg: #fbf7ec;
    --label-ink: #1b2350;
    --shadow: 0 10px 30px rgba(18, 29, 69, 0.14);
    --scrim: rgba(12, 20, 48, 0.45);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f2f4f9;
  --surface: #ffffff;
  --surface-2: #eef1f8;
  --surface-3: #e3e8f4;
  --line: #d9dfec;
  --line-strong: #bcc5dc;
  --fg: #121d45;
  --fg-2: #2f3a63;
  --muted: #5b6689;
  --accent: #f08a1c;
  --accent-hover: #f79a35;
  --accent-ink: #1d1103;
  --accent-text: #b05a00;
  --accent-soft: rgba(240, 138, 28, 0.13);
  --blue: #2c4fc4;
  --blue-soft: rgba(44, 79, 196, 0.1);
  --ok: #147a52;
  --ok-soft: rgba(20, 122, 82, 0.11);
  --warn: #8f5b00;
  --warn-soft: rgba(214, 150, 20, 0.16);
  --bad: #bf3730;
  --bad-soft: rgba(191, 55, 48, 0.1);
  --side-bg: #13215a;
  --side-fg: #eef1fb;
  --side-muted: #a8b3d8;
  --side-active: rgba(245, 154, 44, 0.2);
  --label-bg: #fbf7ec;
  --label-ink: #1b2350;
  --shadow: 0 10px 30px rgba(18, 29, 69, 0.14);
  --scrim: rgba(12, 20, 48, 0.45);
  color-scheme: light;
}

/* ---------- Basis ---------- */
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-ui);
  font-size: var(--fs-md);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
#root { min-height: 100%; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; color: var(--fg); }
h1 { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }
h2 { font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 600; line-height: 1.2; }
h3 { font-size: var(--fs-lg); font-weight: 700; line-height: 1.3; }
p { margin: 0; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.mono { font-family: var(--font-mono); font-size: 0.92em; letter-spacing: 0.01em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.eyebrow { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 0.75rem; }
.stack-lg { display: flex; flex-direction: column; gap: 1.5rem; }
.grow { flex: 1 1 auto; min-width: 0; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hide-sm { }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- App-indeling ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--side-bg);
  color: var(--side-fg);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 0.25rem;
  padding: 1.1rem 0.85rem 1rem;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.brand { display: flex; align-items: center; gap: 0.7rem; padding: 0.15rem 0.4rem 1rem; }
.brand img { width: 44px; height: 44px; border-radius: 50%; box-shadow: 0 0 0 2px var(--accent), 0 0 0 4px rgba(255,255,255,0.08); flex: none; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; line-height: 1.1; color: var(--side-fg); }
.brand-sub { font-size: var(--fs-xs); color: var(--side-muted); letter-spacing: 0.04em; }
.nav-group { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--side-muted); padding: 0.9rem 0.6rem 0.3rem; font-weight: 700; }
.nav-item {
  display: flex; align-items: center; gap: 0.65rem; width: 100%;
  padding: 0.55rem 0.6rem; border-radius: var(--r-sm); border: 0; background: none;
  color: var(--side-fg); text-align: left; cursor: pointer; font-size: var(--fs-md);
}
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: 0.85; }
.nav-item:hover { background: rgba(255, 255, 255, 0.06); }
.nav-item[aria-current="page"] { background: var(--side-active); color: #fff; font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); }
.nav-count { margin-left: auto; min-width: 1.4rem; padding: 0 0.4rem; border-radius: 999px; font-size: var(--fs-xs); font-weight: 700; text-align: center; background: rgba(255,255,255,0.12); color: var(--side-fg); }
.nav-count.hot { background: var(--accent); color: var(--accent-ink); }
.side-foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid rgba(255, 255, 255, 0.08); display: flex; flex-direction: column; gap: 0.5rem; }
.me-card { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem; }
.me-card .avatar { background: rgba(255,255,255,0.1); }
.me-name { font-weight: 700; font-size: var(--fs-md); line-height: 1.2; color: var(--side-fg); }
.me-role { font-size: var(--fs-xs); color: var(--side-muted); }
.side .btn-ghost { color: var(--side-fg); }
.side .btn-ghost:hover { background: rgba(255,255,255,0.07); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem clamp(1rem, 3vw, 2rem);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 600; }
.topbar .menu-btn { display: none; }
.page { padding: 1.5rem clamp(1rem, 3vw, 2rem) 3rem; max-width: 1240px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 1.5rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 0.3rem; max-width: 62ch; }

.banner-ro { background: var(--warn-soft); color: var(--fg); border-bottom: 1px solid var(--line); padding: 0.55rem clamp(1rem, 3vw, 2rem); font-size: var(--fs-sm); display: flex; gap: 0.5rem; align-items: center; }

@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: min(290px, 86vw); z-index: 60; transform: translateX(-102%); transition: transform 0.2s ease; padding-top: calc(1.1rem + env(safe-area-inset-top, 0px)); }
  .side.open { transform: none; box-shadow: var(--shadow); }
  .side-scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 55; }
  .topbar .menu-btn { display: inline-flex; }
}

/* ---------- Knoppen ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  min-height: 38px; padding: 0.45rem 0.95rem; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--fg);
  font-weight: 700; font-size: var(--fs-md); cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.05s ease;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); }
.btn-ok { background: transparent; border-color: var(--ok); color: var(--ok); }
.btn-ok:hover { background: var(--ok-soft); }
.btn-sm { min-height: 32px; padding: 0.3rem 0.65rem; font-size: var(--fs-sm); }
.btn-lg { min-height: 46px; padding: 0.6rem 1.3rem; font-size: var(--fs-lg); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }
.icon-btn { min-height: 38px; min-width: 38px; padding: 0.4rem; position: relative; }
.dot { position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 0.6875rem; font-weight: 700; line-height: 17px; text-align: center; }

/* ---------- Chips / status ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.12rem 0.55rem; border-radius: 999px;
  font-size: var(--fs-xs); font-weight: 700; line-height: 1.5; white-space: nowrap;
  background: var(--surface-3); color: var(--fg-2); border: 1px solid transparent;
}
.chip svg { width: 13px; height: 13px; }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-bad { background: var(--bad-soft); color: var(--bad); }
.chip-info { background: var(--blue-soft); color: var(--blue); }
.chip-accent { background: var(--accent-soft); color: var(--accent-text); }
.chip-outline { background: transparent; border-color: var(--line-strong); color: var(--fg-2); }
.filter-chips { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.fchip { border: 1px solid var(--line-strong); background: transparent; color: var(--fg-2); border-radius: 999px; padding: 0.3rem 0.8rem; font-size: var(--fs-sm); font-weight: 700; cursor: pointer; }
.fchip:hover { background: var(--surface-2); }
.fchip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* ---------- Vlakken ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.1rem 1.2rem; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.85rem; flex-wrap: wrap; }
.panel-head h2, .panel-head h3 { display: flex; align-items: center; gap: 0.5rem; }
.panel-flush { padding: 0; overflow: hidden; }
.panel-flush > .panel-head { padding: 1rem 1.2rem 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 1080px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.85rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 0.85rem 1rem; display: flex; flex-direction: column; gap: 0.15rem; text-align: left; min-width: 0; }
button.stat { cursor: pointer; font: inherit; color: inherit; }
button.stat:hover { border-color: var(--line-strong); background: var(--surface-2); }
.stat-label { font-size: var(--fs-sm); color: var(--muted); display: flex; align-items: center; gap: 0.4rem; }
.stat-value { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: var(--fs-xs); color: var(--muted); }
.stat.tone-bad { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.stat.tone-bad .stat-value { color: var(--bad); }
.stat.tone-warn .stat-value { color: var(--warn); }
.stat.tone-accent .stat-value { color: var(--accent-text); }

/* ---------- Formulieren ---------- */
.field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.field > label, .label { font-size: var(--fs-sm); font-weight: 700; color: var(--fg-2); }
.hint { font-size: var(--fs-xs); color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 40px; padding: 0.5rem 0.7rem; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg); font-size: var(--fs-md);
}
.textarea { min-height: 90px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input-code { font-family: var(--font-mono); font-size: 1.15rem; letter-spacing: 0.12em; text-transform: uppercase; }
.search { position: relative; min-width: 0; }
.search svg { position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.search .input { padding-left: 2.2rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem 1rem; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.check { display: inline-flex; align-items: center; gap: 0.45rem; font-size: var(--fs-md); cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.toolbar { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.toolbar .search { flex: 1 1 260px; }
.toolbar .select { width: auto; min-width: 150px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab { border: 0; background: none; padding: 0.6rem 0.85rem; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 0.4rem; align-items: center; font-size: var(--fs-md); }
.tab:hover { color: var(--fg); }
.tab[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }
.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 0.45rem 0.9rem; border-radius: 7px; font-weight: 700; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 0.4rem; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgba(0,0,0,0.18); }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); }
table.table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.table th { text-align: left; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 700; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); }
.table td { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tr.clickable { cursor: pointer; }
.table .t-right { text-align: right; }
.cell-title { font-weight: 700; }
.cell-sub { font-size: var(--fs-sm); color: var(--muted); }

/* ---------- Lijstregels ---------- */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 0.85rem; padding: 0.75rem 0; border-bottom: 1px solid var(--line); min-width: 0; }
.li:last-child { border-bottom: 0; }
.li-main { flex: 1 1 0%; min-width: 0; }
.li-title { font-weight: 700; line-height: 1.3; }
.li-sub { font-size: var(--fs-sm); color: var(--muted); }
.li-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .li { flex-wrap: wrap; } .li-actions { width: 100%; justify-content: flex-start; } }

/* ---------- Avatar ---------- */
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface-3); font-size: 1.15rem; flex: none; line-height: 1; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.7rem; }

/* ---------- Boekomslag en etiket ---------- */
.cover {
  position: relative; aspect-ratio: 2 / 3; width: 100%; max-width: 100%; border-radius: 4px 9px 9px 4px;
  background: var(--cv); color: var(--ci); overflow: hidden; display: flex; flex-direction: column;
  font-size: var(--cfs, 1rem); padding: 1.15em 0.85em 0.9em 1.3em;
  box-shadow: inset 6px 0 0 rgba(0,0,0,0.18), inset 7px 0 0 rgba(255,255,255,0.08), 0 4px 10px rgba(0,0,0,0.22);
}
.cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(120deg, rgba(255,255,255,0.13), transparent 40%, rgba(0,0,0,0.12)); pointer-events: none; }
.cover-title { font-family: var(--font-display); font-weight: 700; line-height: 1.12; overflow-wrap: break-word; hyphens: auto; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.cover-author { margin-top: auto; font-size: 0.6em; opacity: 0.85; letter-spacing: 0.04em; text-transform: uppercase; font-weight: 700; }
.cover.has-code .cover-author { margin-bottom: 1.9em; }
.cover-rule { width: 30%; height: 2px; background: currentColor; opacity: 0.5; margin: 0.6em 0; }
.cover-sm { width: 46px; flex: none; --cfs: 0.45rem; padding: 0.8em 0.55em 0.6em 1.1em; border-radius: 2px 5px 5px 2px; }
.cover-sm .cover-title { -webkit-line-clamp: 4; }
.cover-sm .cover-author, .cover-sm .cover-rule { display: none; }
.cover-md { width: 70px; flex: none; --cfs: 0.62rem; }
.cover-md .cover-author { display: none; }
.code-label {
  display: inline-flex; align-items: center; gap: 0.3rem; font-family: var(--font-mono); font-weight: 500; font-size: 0.8rem; letter-spacing: 0.08em;
  background: var(--label-bg); color: var(--label-ink); padding: 0.1rem 0.45rem; border-radius: 3px; border: 1px solid rgba(27, 35, 80, 0.18); white-space: nowrap;
}
.code-label.big { font-size: 1.05rem; padding: 0.25rem 0.6rem; }
.cover .code-label { position: absolute; bottom: 7%; right: 7%; font-size: 0.62rem; padding: 0.05rem 0.3rem; box-shadow: 0 1px 2px rgba(0,0,0,0.25); }

/* Inleverstempel */
.stamp {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; line-height: 1.15;
  border: 2px solid currentColor; border-radius: 6px; padding: 0.3rem 0.6rem; color: var(--blue); transform: rotate(-2deg); min-width: 92px;
}
.stamp b { font-size: 0.95rem; letter-spacing: 0.04em; }
.stamp small { font-size: 0.62rem; opacity: 0.85; }
.stamp.warn { color: var(--warn); }
.stamp.bad { color: var(--bad); }
.stamp.ok { color: var(--ok); }

/* ---------- Catalogus ---------- */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 1.4rem 1.1rem; }
.book-card { display: flex; flex-direction: column; gap: 0.55rem; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; color: inherit; min-width: 0; }
.book-card .cover { --cfs: 1.2rem; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.book-card:hover .cover { transform: translateY(-3px); box-shadow: inset 6px 0 0 rgba(0,0,0,0.18), 0 10px 22px rgba(0,0,0,0.3); }
.book-card-title { font-weight: 700; line-height: 1.25; font-size: var(--fs-md); }
.book-card-meta { font-size: var(--fs-sm); color: var(--muted); }
@media (max-width: 520px) { .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 0.8rem; } .book-card .cover { --cfs: 1rem; } }

.stars { display: inline-flex; gap: 1px; color: var(--accent-text); font-size: 0.9rem; letter-spacing: 1px; }
.stars .off { color: var(--line-strong); }
.star-input { display: inline-flex; gap: 0.15rem; }
.star-input button { border: 0; background: none; font-size: 1.7rem; cursor: pointer; color: var(--line-strong); padding: 0 0.1rem; line-height: 1; }
.star-input button.on { color: var(--accent); }
.tag-pick { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag-pick button { border: 1px solid var(--line-strong); background: transparent; border-radius: 999px; padding: 0.25rem 0.7rem; cursor: pointer; font-size: var(--fs-sm); color: var(--fg-2); }
.tag-pick button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--fg); }

/* ---------- Voortgang ---------- */
.progress { height: 10px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.6s ease; }
.progress.ok > span { background: var(--ok); }
.progress.thin { height: 6px; }

/* ---------- Welkom ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 1.5rem 1.6rem; color: #f4f6fd;
  background: radial-gradient(120% 140% at 100% 0%, rgba(245,154,44,0.55) 0%, rgba(245,154,44,0) 45%), linear-gradient(135deg, #142563 0%, #0d1a45 60%, #0a1433 100%);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.25rem; align-items: center;
}
.hero h1 { color: #fff; }
.hero p { color: #cdd5ef; }
.hero .goal { min-width: min(320px, 100%); }
.hero .progress { background: rgba(255,255,255,0.14); height: 12px; }
.hero .eyebrow { color: #aab6e0; }
.hero-big { font-family: var(--font-display); font-size: var(--fs-3xl); font-weight: 600; line-height: 1; color: #fff; }
@media (max-width: 760px) { .hero { grid-template-columns: minmax(0, 1fr); } }

.alert { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.8rem 1rem; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); }
.alert svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.alert-ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.alert-ok svg { color: var(--ok); }
.alert-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.alert-warn svg { color: var(--warn); }
.alert-bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.alert-bad svg { color: var(--bad); }
.alert-info { background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 30%, transparent); }
.alert-info svg { color: var(--blue); }
.alert .grow > b { display: block; }

/* ---------- Badges ---------- */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.9rem; }
.badge-card { display: flex; gap: 0.8rem; align-items: center; padding: 0.85rem; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); min-width: 0; }
.badge-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; flex: none; background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.badge-card.locked .badge-icon { background: var(--surface-3); box-shadow: inset 0 0 0 2px var(--line-strong); filter: grayscale(1); opacity: 0.55; }
.badge-card.locked .badge-name { color: var(--fg-2); }
.badge-name { font-weight: 700; line-height: 1.2; }
.badge-row { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.badge-mini { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.35rem 0.7rem 0.35rem 0.35rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-sm); font-weight: 700; }
.badge-mini span:first-child { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); }

/* ---------- Grafieken ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font-ui); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .bar { fill: var(--blue); }
.chart .bar.now { fill: var(--accent); }
.chart .bar-hit { fill: transparent; cursor: default; }
.chart .bar-hit:hover + .bar, .chart g.col:hover .bar { opacity: 0.85; }
.chart .val { fill: var(--fg); font-weight: 700; }
.chart-wrap { position: relative; }
.tip { position: absolute; pointer-events: none; background: var(--surface-3); color: var(--fg); border: 1px solid var(--line-strong); padding: 0.35rem 0.55rem; border-radius: var(--r-sm); font-size: var(--fs-xs); white-space: nowrap; box-shadow: var(--shadow); transform: translate(-50%, -110%); z-index: 5; }
.hbars { display: flex; flex-direction: column; gap: 0.55rem; }
.hbar { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) 2.5rem; gap: 0.6rem; align-items: center; font-size: var(--fs-sm); }
.hbar-track { display: block; height: 10px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; background: var(--blue); border-radius: 0 999px 999px 0; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg-2); }
.hbar-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.rank { counter-reset: r; display: flex; flex-direction: column; }
.rank-item { display: flex; align-items: center; gap: 0.7rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line); min-width: 0; }
.rank-item:last-child { border-bottom: 0; }
.rank-n { width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; font-size: var(--fs-xs); font-weight: 700; background: var(--surface-3); color: var(--fg-2); flex: none; font-variant-numeric: tabular-nums; }
.rank-item:first-child .rank-n { background: var(--accent); color: var(--accent-ink); }

/* ---------- Leeg / laden ---------- */
.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.empty svg { width: 34px; height: 34px; opacity: 0.6; }
.empty b { color: var(--fg-2); font-size: var(--fs-lg); }
.skel { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--r-sm); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Modals en lade ---------- */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 80; display: grid; place-items: center; padding: 1rem; animation: fade 0.15s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); width: min(560px, 100%); max-height: min(88vh, 900px); display: flex; flex-direction: column; animation: pop 0.16s ease; }
.modal.wide { width: min(860px, 100%); }
@keyframes pop { from { transform: translateY(8px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem 0.5rem; }
.modal-body { padding: 0.5rem 1.25rem 1rem; overflow-y: auto; display: flex; flex-direction: column; gap: 1rem; }
.modal-foot { padding: 0.85rem 1.25rem 1.1rem; display: flex; justify-content: flex-end; gap: 0.5rem; flex-wrap: wrap; border-top: 1px solid var(--line); }
.drawer-scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 70; animation: fade 0.15s ease; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--bg); border-left: 1px solid var(--line); z-index: 75; display: flex; flex-direction: column; box-shadow: var(--shadow); animation: slide 0.2s ease; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.drawer-body { overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: 1.25rem; }

.book-detail { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.book-detail .cover { --cfs: 1.05rem; }
@media (max-width: 520px) { .book-detail { grid-template-columns: 100px minmax(0, 1fr); } .book-detail .cover { --cfs: 0.75rem; } }
.meta-list { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.3rem 0.9rem; font-size: var(--fs-sm); }
.meta-list dt { color: var(--muted); }
.meta-list dd { margin: 0; font-weight: 700; }

/* ---------- Meldingen ---------- */
.pop { position: absolute; right: 0; top: calc(100% + 8px); width: min(380px, calc(100vw - 2rem)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); z-index: 40; max-height: 70vh; display: flex; flex-direction: column; }
.pop-head { display: flex; justify-content: space-between; align-items: center; padding: 0.8rem 1rem; border-bottom: 1px solid var(--line); }
.pop-body { overflow-y: auto; }
.note { display: flex; gap: 0.7rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); text-align: left; width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; color: inherit; cursor: pointer; }
.note:last-child { border-bottom: 0; }
.note:hover { background: var(--surface-2); }
.note.unread { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.note-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 0.45rem; flex: none; background: var(--line-strong); }
.note-dot.ok { background: var(--ok); } .note-dot.warn { background: var(--warn); } .note-dot.bad { background: var(--bad); } .note-dot.info { background: var(--blue); } .note-dot.accent { background: var(--accent); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); right: 1rem; left: 1rem; display: flex; flex-direction: column; align-items: flex-end; gap: 0.5rem; z-index: 100; pointer-events: none; }
.toast { pointer-events: auto; max-width: min(440px, 100%); display: flex; gap: 0.6rem; align-items: flex-start; background: var(--surface-3); color: var(--fg); border: 1px solid var(--line-strong); border-left: 4px solid var(--ok); padding: 0.7rem 0.9rem; border-radius: var(--r-md); box-shadow: var(--shadow); animation: pop 0.18s ease; font-size: var(--fs-md); }
.toast.bad { border-left-color: var(--bad); }
.toast.warn { border-left-color: var(--warn); }
.toast.info { border-left-color: var(--blue); }
.toast button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 0 0 0.3rem; }

/* ---------- Inloggen ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.login-brand {
  position: relative; overflow: hidden; color: #f2f4fc; padding: clamp(1.5rem, 5vw, 3.5rem);
  display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
  background: radial-gradient(90% 70% at 100% 100%, rgba(245,154,44,0.5), rgba(245,154,44,0) 60%), radial-gradient(70% 60% at 0% 0%, rgba(60,105,230,0.45), rgba(60,105,230,0) 60%), linear-gradient(160deg, #0f1f55, #0a1433 70%);
}
.login-brand h1 { color: #fff; font-size: clamp(2rem, 4.2vw, 3.1rem); line-height: 1.05; max-width: 14ch; }
.login-brand p { color: #c9d2ef; max-width: 46ch; font-size: var(--fs-lg); }
.login-brand .emblem { width: 92px; height: 92px; border-radius: 50%; box-shadow: 0 0 0 3px #f59a2c, 0 0 0 7px rgba(255,255,255,0.08); }
.spines { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.spines span { display: block; width: 26px; border-radius: 3px 3px 1px 1px; box-shadow: inset 3px 0 0 rgba(0,0,0,0.18); position: relative; }
.spines span::after { content: ''; position: absolute; left: 4px; right: 4px; bottom: 12px; height: 9px; background: #f7f2e6; border-radius: 1px; opacity: 0.9; }
.login-form { display: flex; flex-direction: column; justify-content: center; padding: clamp(1.5rem, 5vw, 3.5rem); gap: 1.5rem; background: var(--bg); }
.login-card { width: min(460px, 100%); margin: 0 auto; display: flex; flex-direction: column; gap: 1.25rem; }
.demo-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.demo-acc { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.65rem; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; color: inherit; min-width: 0; }
.demo-acc:hover { border-color: var(--accent); background: var(--surface-2); }
.demo-acc .avatar { width: 32px; height: 32px; font-size: 1rem; }
@media (max-width: 860px) { .login { grid-template-columns: minmax(0, 1fr); } .login-brand { min-height: auto; } .spines { display: none; } }
@media (max-width: 420px) { .demo-list { grid-template-columns: minmax(0, 1fr); } }

.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.center-card { width: min(520px, 100%); display: flex; flex-direction: column; gap: 1rem; text-align: left; }

/* ---------- Balie ---------- */
.desk { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .desk { grid-template-columns: minmax(0, 1fr); } }
.step { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.75rem; }
.step-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: var(--fs-sm); flex: none; }
.step-n.done { background: var(--ok); color: #fff; }
.pick-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; max-height: 290px; overflow-y: auto; }
.pick-item { display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.75rem; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); text-align: left; cursor: pointer; color: inherit; width: 100%; }
.pick-item:last-child { border-bottom: 0; }
.pick-item:hover, .pick-item:focus-visible { background: var(--surface-2); }
.receipt { border: 1px dashed var(--line-strong); border-radius: var(--r-md); padding: 0.9rem 1rem; display: flex; gap: 0.9rem; align-items: center; background: var(--surface); }
.selected-card { display: flex; gap: 0.75rem; align-items: center; padding: 0.75rem; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }

details.more > summary { cursor: pointer; color: var(--blue); font-weight: 700; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 0; width: 100%; }
kbd { font-family: var(--font-mono); font-size: 0.8em; padding: 0.05rem 0.35rem; border-radius: 4px; border: 1px solid var(--line-strong); background: var(--surface-2); }
@media (max-width: 640px) { .hide-sm { display: none !important; } }

