/* WPX commerciële context — Pegamento-huisstijl (Comfortaa / Open Sans, teal). No external resources. */

@font-face { font-family: "Comfortaa"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/comfortaa-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Comfortaa"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/comfortaa-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/open-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/open-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/open-sans-latin-700-normal.woff2") format("woff2"); }

/* --- tokens: light (default) ------------------------------------------------------------------- */
:root {
  color-scheme: light;
  --font-head: "Comfortaa", "Open Sans", system-ui, sans-serif;
  --font-body: "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --bg: #f3f7f7;
  --surface: #ffffff;
  --surface-2: #eef4f4;
  --text: #17282b;
  --muted: #4b5f63;
  --border: #cbd8da;
  --accent: #00747a;        /* Pegamento teal; white text on it: 5.6:1 */
  --accent-strong: #005a5f;
  --on-accent: #ffffff;
  --link: #00656a;
  --focus: #00747a;
  --topbar: #00474b;
  --on-topbar: #ffffff;

  --fit: #1f7a45;      --fit-bg: #e2f3e8;      --fit-ink: #13522d;
  --deels: #c27a00;    --deels-bg: #fdf0d9;    --deels-ink: #6d4100;
  --gat: #c0392b;      --gat-bg: #fbe4e1;      --gat-ink: #8a2116;
  --onbekend: #7c8c90; --onbekend-bg: #e9eef0; --onbekend-ink: #374649;
  --nvt-bg: #f1f3f4;   --nvt-ink: #4b5759;
  --empty: #dde6e7;
  --warn-ink: #8a2116;
  --ok-bg: #e2f3e8; --ok-ink: #13522d; --err-bg: #fbe4e1; --err-ink: #8a2116;
  --shadow: 0 1px 2px rgb(0 40 45 / 8%), 0 2px 8px rgb(0 40 45 / 6%);
  --radius: 12px;
}

/* --- tokens: dark ------------------------------------------------------------------------------ */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d1719; --surface: #142226; --surface-2: #1a2b30; --text: #e4eef0; --muted: #a6babe;
    --border: #2d4247; --accent: #4cc5bd; --accent-strong: #7fdad3; --on-accent: #062a2c; --link: #7fdad3;
    --focus: #7fdad3; --topbar: #0a2427; --on-topbar: #e4eef0;
    --fit: #4fbf7b; --fit-bg: #143a25; --fit-ink: #a6eac0;
    --deels: #e8a33a; --deels-bg: #3f2c0b; --deels-ink: #ffd590;
    --gat: #f0705f; --gat-bg: #4a1a14; --gat-ink: #ffb7ad;
    --onbekend: #8fa1a5; --onbekend-bg: #26363a; --onbekend-ink: #cfdcdf;
    --nvt-bg: #1f2c2f; --nvt-ink: #b9c7ca; --empty: #26363a; --warn-ink: #ffb7ad;
    --ok-bg: #143a25; --ok-ink: #a6eac0; --err-bg: #4a1a14; --err-ink: #ffb7ad;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1719; --surface: #142226; --surface-2: #1a2b30; --text: #e4eef0; --muted: #a6babe;
  --border: #2d4247; --accent: #4cc5bd; --accent-strong: #7fdad3; --on-accent: #062a2c; --link: #7fdad3;
  --focus: #7fdad3; --topbar: #0a2427; --on-topbar: #e4eef0;
  --fit: #4fbf7b; --fit-bg: #143a25; --fit-ink: #a6eac0;
  --deels: #e8a33a; --deels-bg: #3f2c0b; --deels-ink: #ffd590;
  --gat: #f0705f; --gat-bg: #4a1a14; --gat-ink: #ffb7ad;
  --onbekend: #8fa1a5; --onbekend-bg: #26363a; --onbekend-ink: #cfdcdf;
  --nvt-bg: #1f2c2f; --nvt-ink: #b9c7ca; --empty: #26363a; --warn-ink: #ffb7ad;
  --ok-bg: #143a25; --ok-ink: #a6eac0; --err-bg: #4a1a14; --err-ink: #ffb7ad;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%);
}

/* --- base -------------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 1rem/1.55 var(--font-body);
  min-height: 100vh; display: flex; flex-direction: column;
}
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; line-height: 1.25; margin: 0 0 .6rem; letter-spacing: -.005em; }
h1 { font-size: clamp(1.4rem, 1.1rem + 1.4vw, 1.9rem); }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .6rem; }
a { color: var(--link); text-underline-offset: .15em; }
a:hover { color: var(--accent-strong); }
code, .code { font-family: var(--font-mono); font-size: .88em; }
.code { color: var(--muted); white-space: nowrap; }
a.code { color: var(--link); font-weight: 600; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; 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: .5rem; top: -3rem; background: var(--surface); color: var(--link); padding: .5rem .8rem; border-radius: 6px; z-index: 10; }
.skip-link:focus { top: .5rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.warn { color: var(--warn-ink); font-weight: 600; }
.plain { list-style: none; margin: 0; padding: 0; }
.inline { display: inline; }

/* --- layout ------------------------------------------------------------------------------------ */
.topbar { background: var(--topbar); color: var(--on-topbar); }
.topbar__inner { max-width: 1280px; margin: 0 auto; padding: .7rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.brand { color: var(--on-topbar); text-decoration: none; display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.brand:hover { color: var(--on-topbar); }
.brand__name { font-family: var(--font-head); font-weight: 700; font-size: 1.3rem; letter-spacing: .01em; }
.brand__sub { font-size: .875rem; opacity: .9; }
.topbar__nav { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.topbar .btn--ghost { color: var(--on-topbar); border-color: rgb(255 255 255 / 45%); }
.topbar .btn--ghost:hover { background: rgb(255 255 255 / 12%); color: var(--on-topbar); }
.who { font-size: .875rem; }
.mainnav { display: flex; gap: .25rem; flex-wrap: wrap; margin-right: auto; }
.mainnav a { color: var(--on-topbar); text-decoration: none; font-weight: 600; font-size: .925rem; padding: .3rem .6rem; border-radius: 6px; }
.mainnav a:hover { color: var(--on-topbar); background: rgb(255 255 255 / 12%); }
.mainnav a[aria-current="page"] { text-decoration: underline; text-underline-offset: .3em; text-decoration-thickness: 2px; }
.page { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 1.25rem; }
.page:focus { outline: none; }
.footer { color: var(--muted); font-size: .8rem; text-align: center; padding: 1rem; }
.footer p { margin: 0; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.card--narrow { max-width: 34rem; margin: 2rem auto; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: 1rem; align-items: start; }
.grid__side { position: sticky; top: 1rem; }

.crumbs ol { list-style: none; padding: 0; margin: 0 0 .8rem; display: flex; flex-wrap: wrap; gap: .3rem; font-size: .875rem; }
.crumbs li + li::before { content: "›"; margin-right: .3rem; color: var(--muted); }
.crumbs [aria-current] { color: var(--muted); }

/* --- components -------------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .3rem; min-height: 2.5rem;
  padding: .4rem 1rem; border-radius: 999px; border: 1px solid var(--accent); background: var(--surface);
  color: var(--link); font: 600 .95rem/1.2 var(--font-body); cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--surface-2); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-strong); color: var(--on-accent); }
.btn--ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn--small { min-height: 2rem; padding: .2rem .8rem; font-size: .875rem; }

.chip { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.chip--fit { background: var(--fit-bg); color: var(--fit-ink); border-color: var(--fit); }
.chip--deels { background: var(--deels-bg); color: var(--deels-ink); border-color: var(--deels); }
.chip--gat { background: var(--gat-bg); color: var(--gat-ink); border-color: var(--gat); }
.chip--onbekend { background: var(--onbekend-bg); color: var(--onbekend-ink); border-color: var(--onbekend); }
.chip--nvt { background: var(--nvt-bg); color: var(--nvt-ink); border-color: var(--border); }
.chip--pl-actief { background: var(--fit-bg); color: var(--fit-ink); border-color: var(--fit); }
.chip--pl-concept { background: var(--onbekend-bg); color: var(--onbekend-ink); border-color: var(--onbekend); }
.chip--pl-vervallen { background: var(--nvt-bg); color: var(--nvt-ink); border-color: var(--border); }
tr[aria-current="true"] { background: var(--surface-2); }
.chip--feature { background: var(--surface-2); color: var(--text); border-color: var(--border); font-weight: 600; }
.tag { display: inline-block; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 0 .4rem; margin: 0 .25rem .2rem 0; font-size: .8rem; }
.note { display: block; color: var(--muted); font-size: .85rem; }

.notice { padding: .7rem 1rem; border-radius: 8px; margin: 0 0 1rem; font-weight: 600; }
.notice--ok { background: var(--ok-bg); color: var(--ok-ink); }
.notice--error { background: var(--err-bg); color: var(--err-ink); }

.meta { display: flex; flex-wrap: wrap; gap: .5rem 2rem; margin: 0 0 1rem; }
.meta dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.meta dd { margin: 0; }

/* coverage bar */
.coverage { margin: .25rem 0 .5rem; }
.coverage__bar { display: block; width: 100%; height: 1rem; border-radius: 999px; overflow: hidden; }
.coverage--compact .coverage__bar { height: .7rem; }
.seg--empty { fill: var(--empty); }
.seg--fit { fill: var(--fit); }
.seg--deels { fill: var(--deels); }
.seg--gat { fill: var(--gat); }
.seg--onbekend { fill: var(--onbekend); }
.coverage__legend { list-style: none; padding: 0; margin: .45rem 0 0; display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .875rem; }
.coverage__legend li { display: inline-flex; align-items: center; gap: .35rem; }
.swatch { width: .8rem; height: .8rem; border-radius: 3px; display: inline-block; }
.swatch--fit { background: var(--fit); }
.swatch--deels { background: var(--deels); }
.swatch--gat { background: var(--gat); }
.swatch--onbekend { background: var(--onbekend); }
/* template page: theme colours are SVG rects with a fill attribute (no inline styles under the CSP) */
h4 { font-family: var(--font-head); font-size: .95rem; margin: .8rem 0 .4rem; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .3rem .8rem; }
.swatches li { display: flex; align-items: center; gap: .4rem; }
.swatch-lg { width: 1.4rem; height: 1.4rem; flex: none; }
.swatch-lg rect, .swatch-sm rect { stroke: var(--border); stroke-width: .6; }
.swatch-sm { width: .9rem; height: .9rem; vertical-align: -2px; }

/* tender list */
.tender-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr)); gap: 1rem; }
.tender-card { margin: 0; }
.tender-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; }
.tender-card__title { font-size: 1.15rem; }
.tender-card__title a { text-decoration: none; }
.tender-card__title a:hover { text-decoration: underline; }
.details summary { cursor: pointer; color: var(--link); font-weight: 600; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: flex-end; margin-bottom: .75rem; }
.field { display: flex; flex-direction: column; gap: .25rem; min-width: 9rem; }
.field--grow { flex: 1 1 14rem; }
.field--checks { flex-direction: row; flex-wrap: wrap; gap: .25rem .75rem; border: 0; padding: 0; margin: 0; align-items: center; }
.field--checks legend { font-size: .875rem; font-weight: 600; padding: 0; margin-bottom: .25rem; width: 100%; }
.field--inline { align-self: center; }
.field label, .field > legend { font-size: .875rem; font-weight: 600; }
.check { display: inline-flex; align-items: center; gap: .35rem; font-size: .925rem; min-height: 2rem; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
input[type="search"], input[type="text"], input[type="password"], input:not([type]), select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--muted); border-radius: 8px;
  padding: .45rem .65rem; min-height: 2.5rem; width: 100%;
}
textarea { resize: vertical; }
.filters__actions { display: flex; gap: .5rem; }
.hint { font-size: .8rem; color: var(--muted); margin: .15rem 0 0; }
.form { display: flex; flex-direction: column; gap: .8rem; }
.form--compact { gap: .6rem; padding-top: .75rem; border-top: 1px solid var(--border); margin-top: 1rem; }
.subforms { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 0 1.5rem; }

.toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; margin-bottom: .5rem; }
.toolbar p { margin: 0; }
.toolbar__export { display: flex; align-items: center; gap: .4rem; font-size: .875rem; }
.empty { padding: 1rem; text-align: center; color: var(--muted); }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .925rem; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom-width: 2px; }
td.num, th.num { text-align: right; }
.group-row th { background: var(--surface-2); font-family: var(--font-head); font-size: .95rem; padding-top: .7rem; }
tbody tr[data-id]:hover { background: var(--surface-2); }

/* detail */
.req-head { margin-bottom: 1rem; }
.req-head .code { margin: 0 0 .2rem; }
.quote { margin: 0 0 .6rem; padding: .7rem 1rem; border-left: 4px solid var(--accent); background: var(--surface-2); border-radius: 0 8px 8px 0; font-size: 1.02rem; }
.list-cards > li { padding: .6rem 0; border-bottom: 1px solid var(--border); }
.list-cards > li:last-child { border-bottom: 0; }
.list-cards p { margin: 0 0 .2rem; }
.history { list-style: none; margin: 0; padding: 0; }
.history > li { padding: .55rem 0 .55rem .8rem; border-left: 2px solid var(--border); position: relative; }
.history > li::before { content: ""; position: absolute; left: -6px; top: .85rem; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.history p { margin: 0 0 .25rem; font-size: .9rem; }
.changes { margin: 0; padding-left: 1rem; font-size: .85rem; }
.changes__field { font-weight: 600; }
del { color: var(--muted); }
ins { text-decoration: none; font-weight: 600; }

/* --- responsive -------------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .grid { grid-template-columns: 1fr; }
  .grid__side { position: static; order: -1; }
}
@media (max-width: 700px) {
  .page { padding: .75rem; }
  .card { padding: .9rem; }
  .topbar__inner { padding: .6rem .75rem; }
  .brand__sub { display: none; }
  .field { min-width: 0; flex: 1 1 100%; }
  .filters__actions { width: 100%; }
  .filters__actions .btn { flex: 1; }
  /* tables become stacked cards */
  table.reqs thead, table.evidence thead, table.prices thead, table.versions thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.reqs, table.reqs tbody, table.reqs tr, table.reqs td,
  table.prices, table.prices tbody, table.prices tr, table.prices td,
  table.versions, table.versions tbody, table.versions tr, table.versions td,
  table.evidence, table.evidence tbody, table.evidence tr, table.evidence td { display: block; width: 100%; }
  table.reqs tr[data-id], table.evidence tr, table.prices tr[data-id], table.versions tr { border: 1px solid var(--border); border-radius: 10px; margin: 0 0 .6rem; padding: .35rem .6rem; }
  table.reqs td, table.evidence td, table.prices td, table.versions td { border: 0; padding: .2rem 0 .2rem 7rem; position: relative; text-align: left; min-height: 1.8rem; overflow-wrap: anywhere; }
  table.reqs td::before, table.evidence td::before, table.prices td::before, table.versions td::before { content: attr(data-label); position: absolute; left: 0; top: .3rem; width: 6.5rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
  table.reqs .group-row, table.reqs .group-row th, table.prices .group-row, table.prices .group-row th { display: block; border: 0; border-radius: 8px; margin: .5rem 0; }
}

/* --- huisstijl ------------------------------------------------------------------------------------ */
.hs-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: .9rem 1.2rem; }
.hs-colors li { display: flex; gap: .6rem; align-items: flex-start; }
.hs-colors .swatch-lg { width: 2.6rem; height: 2.6rem; }
.hs-tints { display: flex; gap: 2px; margin: .25rem 0; }
.hs-pair { width: 4rem; height: 1.5rem; display: block; }
.hs-type__row { margin-bottom: .8rem; }
.hs-type__sample { width: 100%; max-width: 34rem; height: auto; display: block; border: 1px solid var(--border); border-radius: 4px; }
.hs-flow-wrap { overflow-x: auto; margin-bottom: .8rem; }
.hs-flow-wrap svg { width: 100%; min-width: 40rem; height: auto; display: block; border: 1px solid var(--border); border-radius: 4px; }
.hs-nodes li { display: flex; gap: .4rem; align-items: center; }
.code-block { white-space: pre-wrap; word-break: break-all; font-size: .78rem; border: 1px solid var(--border); border-radius: 4px; padding: .6rem; overflow-x: auto; }
.src { font-style: italic; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
@media print { .topbar, .filters, .subforms, #bewerken, .footer, .toolbar__export { display: none !important; } .card { box-shadow: none; } }
