:root {
  --kleur-primair: #1a3a5c;
  --kleur-accent: #2e7bbf;
  --kleur-achtergrond: #f4f7fb;
  --kleur-wit: #ffffff;
  --kleur-tekst: #1e2d3d;
  --kleur-grijs-licht: #e8eef5;
  --kleur-grijs: #8a9bae;
  --kleur-succes: #2e7d52;
  --kleur-rand: #c8d8e8;
  --radius: 6px;
  --schaduw: 0 2px 8px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--kleur-achtergrond);
  color: var(--kleur-tekst);
  font-size: 15px;
  line-height: 1.6;
}

/* Nav */
nav {
  background: var(--kleur-primair);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
nav .logo {
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  padding: 1rem 1.5rem 1rem 0;
  border-right: 1px solid rgba(255,255,255,0.15);
  margin-right: 0.5rem;
  white-space: nowrap;
}
nav a {
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  padding: 1rem 0.85rem;
  font-size: 0.9rem;
  display: inline-block;
  transition: color 0.15s, background 0.15s;
  border-bottom: 3px solid transparent;
}
nav a:hover, nav a.actief {
  color: #fff;
  border-bottom-color: #5db8f0;
  background: rgba(255,255,255,0.06);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--kleur-primair) 0%, #2a5a8e 100%);
  color: #fff;
  padding: 3rem 2rem 2.5rem;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  box-shadow: var(--schaduw);
}
.hero h1 { font-size: 2rem; font-weight: 700; margin-bottom: 0.5rem; }
.hero p { color: rgba(255,255,255,0.82); font-size: 1.05rem; max-width: 680px; }
.hero .meta {
  margin-top: 1.2rem;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.hero .meta span { display: flex; align-items: center; gap: 0.35rem; }

/* Kaarten grid */
.kaarten-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}
.kaart {
  background: var(--kleur-wit);
  border-radius: var(--radius);
  box-shadow: var(--schaduw);
  border: 1px solid var(--kleur-rand);
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.kaart:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.kaart-hoofd {
  padding: 1.2rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border-bottom: 1px solid var(--kleur-grijs-licht);
}
.kaart-icoon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.kaart h3 { font-size: 1rem; font-weight: 600; color: var(--kleur-primair); }
.kaart-body { padding: 1rem 1.4rem; }
.kaart-body p { font-size: 0.88rem; color: var(--kleur-grijs); margin-bottom: 0.6rem; }
.kaart-tabellen {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.tag {
  background: var(--kleur-grijs-licht);
  color: var(--kleur-primair);
  font-size: 0.75rem;
  padding: 0.15rem 0.55rem;
  border-radius: 12px;
  font-family: 'Consolas', monospace;
  font-weight: 500;
}

/* Sectie pagina */
.pagina-hoofd {
  background: var(--kleur-wit);
  border-radius: var(--radius);
  box-shadow: var(--schaduw);
  border: 1px solid var(--kleur-rand);
  margin-bottom: 2rem;
  overflow: hidden;
}
.pagina-hoofd-banner {
  padding: 1.8rem 2rem;
  color: #fff;
}
.pagina-hoofd-banner h1 { font-size: 1.6rem; font-weight: 700; }
.pagina-hoofd-banner p { color: rgba(255,255,255,0.82); margin-top: 0.3rem; }
.pagina-hoofd-nav {
  padding: 0.7rem 2rem;
  background: var(--kleur-grijs-licht);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--kleur-rand);
}
.pagina-hoofd-nav a {
  color: var(--kleur-accent);
  font-size: 0.85rem;
  text-decoration: none;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  transition: background 0.1s;
}
.pagina-hoofd-nav a:hover { background: var(--kleur-rand); }

/* Tabel sectie */
.tabel-sectie {
  background: var(--kleur-wit);
  border-radius: var(--radius);
  box-shadow: var(--schaduw);
  border: 1px solid var(--kleur-rand);
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.tabel-sectie-hoofd {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--kleur-rand);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.tabel-sectie-hoofd .tabel-naam {
  font-family: 'Consolas', monospace;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--kleur-primair);
}
.tabel-sectie-hoofd .tabel-oms {
  font-size: 0.88rem;
  color: var(--kleur-grijs);
  margin-top: 0.2rem;
}
.schema-badge {
  background: var(--kleur-primair);
  color: rgba(255,255,255,0.85);
  font-size: 0.72rem;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  font-family: 'Consolas', monospace;
  flex-shrink: 0;
  margin-top: 0.2rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
thead th {
  background: var(--kleur-grijs-licht);
  color: var(--kleur-primair);
  font-weight: 600;
  padding: 0.65rem 1rem;
  text-align: left;
  border-bottom: 2px solid var(--kleur-rand);
  white-space: nowrap;
}
tbody tr:nth-child(even) { background: #fafcff; }
tbody tr:hover { background: #eef4fb; }
tbody td {
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--kleur-grijs-licht);
  vertical-align: top;
}
.col-naam {
  font-family: 'Consolas', monospace;
  color: var(--kleur-primair);
  font-weight: 500;
}
.col-type {
  font-family: 'Consolas', monospace;
  color: #5a7a9b;
  white-space: nowrap;
}
.badge-pk {
  background: #1a3a5c;
  color: #fff;
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  font-weight: 700;
}
.badge-fk {
  background: #2e7bbf;
  color: #fff;
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  font-weight: 700;
}
.badge-nn {
  background: var(--kleur-succes);
  color: #fff;
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
}
.badge-null {
  background: #eee;
  color: #888;
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
}

/* Relatie diagram */
.relatie-diagram {
  padding: 1.5rem;
  background: var(--kleur-grijs-licht);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
}
.relatie-diagram h3 { margin-bottom: 0.8rem; color: var(--kleur-primair); }
.relatie-lijn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  font-family: 'Consolas', monospace;
}
.rel-pijl { color: var(--kleur-accent); font-weight: 700; }

/* Tip box */
.tip {
  background: #e8f4fd;
  border-left: 4px solid var(--kleur-accent);
  padding: 0.9rem 1.2rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}
.tip strong { color: var(--kleur-primair); }

/* SQL voorbeeld */
.sql-voorbeeld {
  background: #1e2d3d;
  color: #e8f0f8;
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  font-family: 'Consolas', monospace;
  font-size: 0.85rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}
.sql-kw { color: #5db8f0; font-weight: 600; }
.sql-tbl { color: #7cd8a0; }
.sql-com { color: #7a9ab8; font-style: italic; }
.sql-str { color: #f0b85d; }

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--kleur-grijs);
  font-size: 0.82rem;
  border-top: 1px solid var(--kleur-rand);
  margin-top: 3rem;
}
footer a { color: var(--kleur-accent); text-decoration: none; }

/* Kleur per module */
.kleur-crs { background: linear-gradient(135deg, #1a3a5c, #2e5c8a); }
.kleur-art { background: linear-gradient(135deg, #2e6b3e, #3d8f52); }
.kleur-prijs { background: linear-gradient(135deg, #7a3c00, #b85c10); }
.kleur-vk { background: linear-gradient(135deg, #4a1a6b, #7030a0); }
.kleur-ink { background: linear-gradient(135deg, #005a5a, #008080); }
.kleur-fin { background: linear-gradient(135deg, #6b0000, #a00000); }
.kleur-mag { background: linear-gradient(135deg, #003a6b, #005aaa); }
.kleur-stam { background: linear-gradient(135deg, #3a3a00, #6b6b00); }

.icoon-crs { background: #ddeeff; }
.icoon-art { background: #ddfde8; }
.icoon-prijs { background: #fde8dd; }
.icoon-vk { background: #eeddff; }
.icoon-ink { background: #ddffff; }
.icoon-fin { background: #ffdddd; }
.icoon-mag { background: #ddeeff; }
.icoon-stam { background: #ffffdd; }

@media (max-width: 700px) {
  nav { flex-wrap: wrap; padding: 0 0.5rem; }
  nav .logo { font-size: 0.9rem; padding: 0.7rem 0.8rem 0.7rem 0; }
  nav a { padding: 0.7rem 0.5rem; font-size: 0.8rem; }
  .container { padding: 0 0.8rem; }
  .hero h1 { font-size: 1.4rem; }
  .kaarten-grid { grid-template-columns: 1fr; }
}

/* Downloadpagina (hoofd-index): accordeons en bestandslijsten in dezelfde stijl */
.cards { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 2rem; }
.card {
  background: var(--kleur-wit);
  border-radius: var(--radius);
  box-shadow: var(--schaduw);
  border: 1px solid var(--kleur-rand);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 1rem 1.4rem; border: none; background: var(--kleur-wit);
  text-align: left; cursor: pointer; user-select: none; font: inherit;
  transition: background 0.15s;
}
.card-header:hover { background: var(--kleur-achtergrond); }
.card-header h2 { font-size: 1rem; font-weight: 600; color: var(--kleur-primair); }
.chevron { font-size: 0.8rem; color: var(--kleur-grijs); transition: transform 0.2s; }
.card-header.open, .sub-header.open { border-bottom: 1px solid var(--kleur-rand); }
.card-header.open .chevron, .sub-header.open .chevron { transform: rotate(180deg); }
.card-body { display: none; padding: 0.4rem 1.4rem 1.2rem; }
.card-body.open { display: block; }
.sub { margin: 0.8rem 0; border: 1px solid var(--kleur-rand); border-radius: var(--radius); overflow: hidden; }
.sub-header {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 0.6rem 1rem; border: none; background: var(--kleur-grijs-licht);
  text-align: left; cursor: pointer; user-select: none; font: inherit;
}
.sub-header:hover { background: var(--kleur-rand); }
.sub-header h3 { font-size: 0.9rem; font-weight: 600; color: var(--kleur-accent); }
.sub-body { display: none; padding: 0.3rem 1rem 0.8rem; }
.sub-body.open { display: block; }
.section-label {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--kleur-grijs); margin: 1rem 0 0.3rem;
}
ul.files { list-style: none; }
ul.files li { display: flex; align-items: center; gap: 0.6rem; padding: 0.35rem 0; border-bottom: 1px solid var(--kleur-grijs-licht); }
ul.files li:last-child { border-bottom: none; }
ul.files a { color: var(--kleur-accent); text-decoration: none; font-size: 0.9rem; flex: 1; }
ul.files a:hover { text-decoration: underline; }
.badge {
  display: inline-block; font-size: 0.65rem; padding: 0.1rem 0.4rem; border-radius: 3px;
  font-weight: 700; text-transform: uppercase; white-space: nowrap; font-family: 'Consolas', monospace;
}
.pdf { background: #fde8e8; color: #c0392b; }
.zip { background: #fef3e2; color: #d68910; }
.msi { background: #dbeafe; color: #1d4ed8; }
.db  { background: #d1fae5; color: #065f46; }
.tar { background: #ede9fe; color: #5b21b6; }
.erc { background: #fce7f3; color: #9d174d; }
.web { background: #dff1fb; color: #1b6a9a; }
.exe { background: #e0f2fe; color: #0c4a6e; }
.mp4 { background: #fef9c3; color: #854d0e; }

/* Hoofdindex: overzicht (raster/lijst), tabbladen per onderwerp en zoeken.
   De weergave wordt gestuurd door body[data-view=home|detail|zoek] en body[data-modus=grid|lijst]. */
.weergave { display: inline-flex; margin: 0 0 1.2rem; border: 1px solid var(--kleur-rand); border-radius: var(--radius); overflow: hidden; background: var(--kleur-wit); }
.weergave button { border: none; background: transparent; padding: 0.45rem 1rem; font: inherit; font-size: 0.85rem; cursor: pointer; color: var(--kleur-primair); }
.weergave button + button { border-left: 1px solid var(--kleur-rand); }
.weergave button[aria-pressed="true"] { background: var(--kleur-primair); color: #fff; }

/* Zoekbalk */
.zoekbalk { position: relative; margin: 0 0 1.2rem; }
.zoekbalk input {
  width: 100%; padding: 0.8rem 1rem 0.8rem 2.7rem; font: inherit; color: var(--kleur-tekst);
  background: var(--kleur-wit); border: 1px solid var(--kleur-rand); border-radius: var(--radius); box-shadow: var(--schaduw);
}
.zoekbalk input:focus { outline: 2px solid var(--kleur-accent); outline-offset: 1px; }
.zoek-icoon { position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); font-size: 1rem; pointer-events: none; }

.tegels, .tabs, .resultaten, .detail-kop { display: none; }
body:not([data-view="home"]) .hero,
body:not([data-view="home"]) .weergave { display: none; }
body[data-view="zoek"] .pagina { display: none; }
body[data-view="home"][data-modus="grid"] .cards { display: none; }

/* Raster: tegels met de eerste drie regels en een optie 'meer' */
body[data-view="home"][data-modus="grid"] .tegels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.tegel {
  display: flex; flex-direction: column; background: var(--kleur-wit); border: 1px solid var(--kleur-rand);
  border-radius: var(--radius); box-shadow: var(--schaduw); padding: 1.1rem 1.3rem 1rem; transition: transform 0.15s, box-shadow 0.15s;
}
.tegel:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.12); }
.tegel h2 { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }
.tegel h2 a { color: var(--kleur-primair); text-decoration: none; }
.tegel h2 a:hover { text-decoration: underline; }
.tegel ul { list-style: none; flex: 1; }
.tegel li { display: flex; align-items: center; gap: 0.5rem; min-width: 0; padding: 0.35rem 0; border-top: 1px solid var(--kleur-grijs-licht); }
.tegel li a { color: var(--kleur-accent); text-decoration: none; font-size: 0.88rem; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tegel li a:hover { text-decoration: underline; }
.tegel li .badge { min-width: 2.4rem; text-align: center; }
.tegel li .pijl { min-width: 2.4rem; text-align: center; color: var(--kleur-grijs); }
.tegel .meer { align-self: flex-start; margin-top: 0.6rem; font-size: 0.85rem; font-weight: 600; color: var(--kleur-primair); text-decoration: none; }
.tegel .meer:hover { color: var(--kleur-accent); }

/* Tabblad per onderwerp: navigatie links, inhoud rechts */
body[data-view="detail"] .pagina { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 1.5rem; align-items: start; }
body[data-view="detail"] .tabs { display: flex; flex-direction: column; gap: 0.15rem; position: sticky; top: 4.5rem; }
.tabs a { padding: 0.45rem 0.8rem; border-left: 3px solid transparent; border-radius: var(--radius); color: var(--kleur-primair); text-decoration: none; font-size: 0.88rem; }
.tabs a:hover { background: var(--kleur-grijs-licht); }
.tabs a[aria-current="page"] { background: var(--kleur-wit); border-left-color: var(--kleur-accent); font-weight: 600; box-shadow: var(--schaduw); }
.tabs a.terug { color: var(--kleur-accent); margin-bottom: 0.4rem; }
body[data-view="detail"] .cards .card:not(.actief) { display: none; }
body[data-view="detail"] .card.actief { overflow: visible; }
body[data-view="detail"] .card.actief > .card-header { display: none; }
body[data-view="detail"] .card.actief > .detail-kop { display: block; padding: 1.5rem 2rem 0; }
.detail-kop h1 { font-size: 1.6rem; color: var(--kleur-primair); line-height: 1.25; }
body[data-view="detail"] .card.actief > .card-body { display: block; padding: 0.6rem 2rem 2rem; }
.actief .sub { margin: 1rem 0 1.4rem; scroll-margin-top: 4.5rem; }
.actief .sub.doel { outline: 2px solid var(--kleur-accent); }
.actief .sub-header { cursor: default; pointer-events: none; }
.actief .sub-header .chevron { display: none; }
.actief .sub-header.open { border-bottom: none; }
.actief .sub-body { display: block; padding: 0.6rem 1.2rem 1rem; }
.actief .sub-body::after { content: ""; display: block; clear: both; }
.actief .sub-body > p, .actief .sub-body > ul:not(.files) { max-width: 75ch; }
.actief ul.files { column-width: 22rem; column-gap: 2rem; }
.actief ul.files li { break-inside: avoid; }

/* Zoekresultaten */
body[data-view="zoek"] .resultaten { display: block; margin-bottom: 2rem; }
.resultaten .telling { font-size: 0.85rem; color: var(--kleur-grijs); margin-bottom: 0.8rem; }
.resultaten .groep { background: var(--kleur-wit); border: 1px solid var(--kleur-rand); border-radius: var(--radius); box-shadow: var(--schaduw); padding: 0.9rem 1.3rem 0.5rem; margin-bottom: 1rem; }
.resultaten .groep h2 { font-size: 1rem; margin-bottom: 0.3rem; }
.resultaten .groep h2 a { color: var(--kleur-primair); text-decoration: none; }
.resultaten .groep h2 a:hover { text-decoration: underline; }
.resultaat { display: flex; align-items: baseline; gap: 0.6rem; padding: 0.45rem 0; border-top: 1px solid var(--kleur-grijs-licht); }
.resultaat .tekst { min-width: 0; }
.resultaat a { color: var(--kleur-accent); text-decoration: none; font-size: 0.9rem; }
.resultaat a:hover { text-decoration: underline; }
.resultaat .ctx { display: block; font-size: 0.8rem; color: var(--kleur-grijs); overflow-wrap: anywhere; }
.resultaat .badge, .resultaat .pijl { min-width: 2.4rem; text-align: center; flex: none; }
.resultaat .pijl { color: var(--kleur-grijs); }
.resultaat mark, .resultaten mark { background: #fff1a8; color: inherit; border-radius: 2px; }
.resultaten .rest { font-size: 0.82rem; color: var(--kleur-grijs); padding: 0.4rem 0 0.6rem; }
.resultaten .leeg { padding: 1.2rem 0; color: var(--kleur-grijs); }

@media (max-width: 1000px) { body[data-view="home"][data-modus="grid"] .tegels { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 800px) {
  body[data-view="detail"] .pagina { grid-template-columns: minmax(0, 1fr); gap: 0.8rem; }
  body[data-view="detail"] .tabs { flex-direction: row; position: static; overflow-x: auto; padding-bottom: 0.3rem; }
  .tabs a { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; }
  .tabs a[aria-current="page"] { border-bottom-color: var(--kleur-accent); }
  body[data-view="detail"] .card.actief > .detail-kop { padding: 1.1rem 1.1rem 0; }
  body[data-view="detail"] .card.actief > .card-body { padding: 0.4rem 1.1rem 1.4rem; }
}
@media (max-width: 700px) { body[data-view="home"][data-modus="grid"] .tegels { grid-template-columns: 1fr; } }

/* Tekst in kaarten (systeemeisen, bekende problemen, nieuws, tips) */
.card-body p.tp { font-size: 0.88rem; margin: 0.3rem 0 0.6rem; }
.card-body ul.tl { font-size: 0.88rem; margin: 0.2rem 0 0.7rem 1.3rem; }
.card-body ul.tl li { margin: 0.2rem 0; }
.card-body code { font-size: 0.82rem; background: var(--kleur-grijs-licht); padding: 0.05rem 0.3rem; border-radius: 3px; overflow-wrap: anywhere; }
.cards .card { scroll-margin-top: 4.5rem; }
