/* GRiDS UI: basis (reset, typografie, de schil). Componenten: onderdelen.css. Schermen: schermen.css. */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--g-font);
  font-size: var(--g-f-base);
  line-height: var(--g-regel);
  color: var(--g-tekst);
  background: var(--g-achtergrond);
  font-feature-settings: 'kern' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}
h1, h2, h3, h4, p, figure, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3, h4 { font-weight: 650; letter-spacing: -0.01em; line-height: 1.2; color: var(--g-tekst); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--g-link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
img, svg { display: block; }
code, kbd, .mono { font-family: var(--g-mono); font-size: 0.92em; }
::selection { background: var(--g-teal-zacht); color: var(--g-tekst); }
[hidden] { display: none !important; }

:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--g-focus); border-radius: var(--g-hoek-s); }

/* Rustige scrollbalken */
* { scrollbar-width: thin; scrollbar-color: var(--g-lijn-sterk) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--g-lijn-sterk); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

.verborgen-tekst {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.tab-cijfers, .getal { font-variant-numeric: tabular-nums; }
.zacht { color: var(--g-tekst-2); }
.zachter { color: var(--g-tekst-3); }
.afkap { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ---------------------------------------------------------------- de schil */

.app {
  height: 100vh;
  display: grid;
  grid-template-columns: var(--g-zijbalk-b) minmax(0, 1fr) auto;
  grid-template-rows: var(--g-bovenbalk-h) minmax(0, 1fr);
  grid-template-areas: 'zij boven leja' 'zij werk leja';
  transition: grid-template-columns var(--g-middel) var(--g-curve);
}
.app[data-zijbalk='dicht'] { grid-template-columns: var(--g-zijbalk-b-dicht) minmax(0, 1fr) auto; }

/* Zijbalk */
.zijbalk {
  grid-area: zij;
  background: var(--g-zijbalk);
  color: var(--g-zijbalk-tekst);
  display: flex; flex-direction: column;
  min-width: 0;
  border-right: 1px solid var(--g-zijbalk-rand);
  position: relative;
  z-index: 20;
}
.zijbalk__kop {
  height: var(--g-bovenbalk-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px 0 16px;
  flex: none;
}
.zijbalk__logo { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.zijbalk__logo:hover { text-decoration: none; }
.zijbalk__logo svg { flex: none; }
.zijbalk__woord { height: 18px; width: auto; }
.app[data-zijbalk='dicht'] .zijbalk__woord, .app[data-zijbalk='dicht'] .zijbalk__logo .woordmerk { display: none; }
.app[data-zijbalk='dicht'] .zijbalk__kop { justify-content: center; padding: 0; }
.zijbalk__nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 6px 10px 12px; }
.zijbalk__groep { margin-top: 14px; }
.zijbalk__groep:first-child { margin-top: 4px; }
.zijbalk__groepkop {
  font-size: var(--g-f-2xs); font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--g-zijbalk-tekst-2); padding: 6px 10px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.zijbalk__project {
  margin: 2px 0 6px; padding: 8px 10px; border-radius: var(--g-hoek);
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.06);
  color: #fff; font-weight: 600; font-size: var(--g-f-md); line-height: 1.25;
  display: flex; gap: 8px; align-items: center; min-width: 0;
}
.zijbalk__project .stip { flex: none; }
.app[data-zijbalk='dicht'] .zijbalk__groepkop,
.app[data-zijbalk='dicht'] .zijbalk__project { display: none; }
.navlink {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  height: 34px; padding: 0 10px; margin: 1px 0;
  border-radius: var(--g-hoek);
  color: var(--g-zijbalk-tekst);
  font-size: var(--g-f-md); font-weight: 500;
  white-space: nowrap; text-decoration: none;
  transition: background var(--g-snel), color var(--g-snel);
}
.navlink:hover { background: var(--g-zijbalk-zweef); color: #fff; text-decoration: none; }
.navlink[aria-current='page'] { background: var(--g-zijbalk-actief); color: #fff; font-weight: 600; }
.navlink[aria-current='page']::before {
  content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0;
  background: #E5484D;
}
.navlink .icoon { flex: none; opacity: 0.9; }
.navlink__label { overflow: hidden; text-overflow: ellipsis; }
.navlink__tel { margin-left: auto; font-size: var(--g-f-xs); color: var(--g-zijbalk-tekst-2); font-variant-numeric: tabular-nums; }
.navlink__nieuw { margin-left: auto; font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--g-zijbalk-tekst-2);
  border: 1px solid rgba(255,255,255,0.12); padding: 0 5px; border-radius: 4px; line-height: 16px; }
.app[data-zijbalk='dicht'] .navlink { justify-content: center; padding: 0; }
.app[data-zijbalk='dicht'] .navlink__label,
.app[data-zijbalk='dicht'] .navlink__tel,
.app[data-zijbalk='dicht'] .navlink__nieuw { display: none; }
.zijbalk__voet { flex: none; padding: 10px; border-top: 1px solid var(--g-zijbalk-rand); display: flex; align-items: center; gap: 6px; }
.zijbalk__voet .knop { color: var(--g-zijbalk-tekst); }
.zijbalk__voet .knop:hover { background: var(--g-zijbalk-zweef); color: #fff; }
.zijbalk__bf { font-size: var(--g-f-2xs); color: var(--g-zijbalk-tekst-2); letter-spacing: 0.02em; margin-left: auto; white-space: nowrap; }
.app[data-zijbalk='dicht'] .zijbalk__bf { display: none; }
.app[data-zijbalk='dicht'] .zijbalk__voet { justify-content: center; }

/* Bovenbalk */
.bovenbalk {
  grid-area: boven;
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px 0 16px;
  background: var(--g-vlak);
  border-bottom: 1px solid var(--g-lijn);
  min-width: 0;
  z-index: 10;
}
.kruimel { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: var(--g-f-md); }
.kruimel__stuk { color: var(--g-tekst-2); white-space: nowrap; }
.kruimel__sep { color: var(--g-lijn-sterk); }
.kruimel__huidig { color: var(--g-tekst); font-weight: 600; white-space: nowrap; }
.projectwissel {
  display: inline-flex; align-items: center; gap: 8px; max-width: 360px;
  height: 32px; padding: 0 8px 0 10px; border-radius: var(--g-hoek);
  font-weight: 600; color: var(--g-tekst);
  border: 1px solid transparent;
}
.projectwissel:hover { background: var(--g-vlak-2); border-color: var(--g-lijn); }
.projectwissel .icoon { color: var(--g-tekst-3); flex: none; }
.zoekknop {
  margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  flex: 0 1 440px; min-width: 150px; height: 34px; padding: 0 8px 0 12px;
  border-radius: var(--g-hoek);
  background: var(--g-vlak-2); border: 1px solid var(--g-lijn);
  color: var(--g-tekst-3); font-size: var(--g-f-md);
  transition: border-color var(--g-snel), background var(--g-snel);
}
.zoekknop:hover { border-color: var(--g-lijn-sterk); background: var(--g-vlak); }
.zoekknop__tekst { flex: 1; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bovenbalk__rechts { display: flex; align-items: center; gap: 6px; flex: none; }
.gebruiker {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--g-merk-zacht); color: var(--g-merk); font-weight: 700; font-size: var(--g-f-xs);
  border: 1px solid var(--g-lijn);
}
:root[data-theme='donker'] .gebruiker { color: var(--g-tekst); }
.lejaknop {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 10px;
  border-radius: 999px; font-weight: 600; font-size: var(--g-f-md);
  color: #fff; background: linear-gradient(135deg, #0c6980 0%, #0a5567 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
  transition: filter var(--g-snel);
}
.lejaknop:hover { filter: brightness(1.08); }
.lejaknop[aria-pressed='true'] { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), 0 0 0 2px var(--g-vlak), 0 0 0 4px #e0a526; }
.lejaknop .stip { background: #e0a526; }

/* Werkvlak */
.werkvlak { grid-area: werk; min-width: 0; min-height: 0; overflow: auto; position: relative; }
.werkvlak--vol { overflow: hidden; }

/* Leja-slot rechts */
.leja-slot {
  grid-area: leja;
  width: var(--g-leja-b);
  min-width: 0;
  border-left: 1px solid var(--g-lijn);
  background: var(--g-vlak);
  position: relative;
  display: flex; flex-direction: column;
  z-index: 15;
}
.leja-slot[hidden] { display: none; }
.leja-slot__greep { position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 2; }
.leja-slot__greep::after { content: ''; position: absolute; left: 3px; top: 0; bottom: 0; width: 2px; background: transparent; transition: background var(--g-snel); }
.leja-slot__greep:hover::after, .leja-slot__greep.sleept::after { background: var(--g-teal); }
.leja-slot__inhoud { flex: 1; min-height: 0; height: 100%; display: flex; flex-direction: column; overflow: hidden; }

/* Smaller dan 1280: zijbalk en Leja zweven boven het werkvlak */
@media (max-width: 1279px) {
  .app, .app[data-zijbalk='dicht'] { grid-template-columns: var(--g-zijbalk-b-dicht) minmax(0, 1fr); grid-template-areas: 'zij boven' 'zij werk'; }
  .app .zijbalk__woord, .app .zijbalk__logo .woordmerk, .app .zijbalk__groepkop, .app .zijbalk__project, .app .navlink__label,
  .app .navlink__tel, .app .navlink__nieuw, .app .zijbalk__bf { display: none; }
  .app .navlink { justify-content: center; padding: 0; }
  .app[data-zijbalk='open'] .zijbalk { position: fixed; inset: 0 auto 0 0; width: var(--g-zijbalk-b); box-shadow: var(--g-schaduw-3); }
  .app[data-zijbalk='open'] .zijbalk__woord, .app[data-zijbalk='open'] .zijbalk__logo .woordmerk, .app[data-zijbalk='open'] .zijbalk__groepkop,
  .app[data-zijbalk='open'] .zijbalk__project, .app[data-zijbalk='open'] .navlink__label,
  .app[data-zijbalk='open'] .navlink__tel { display: revert; }
  .app[data-zijbalk='open'] .navlink { justify-content: flex-start; padding: 0 10px; }
  .leja-slot { position: fixed; right: 0; top: var(--g-bovenbalk-h); bottom: 0; box-shadow: var(--g-schaduw-3); max-width: 92vw; }
  .zoekknop { width: auto; flex: 1; max-width: 340px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* Afdrukken: alleen het werkvlak, zonder schil (een scherm met een eigen printlaag, zoals Genereren, gaat voor). */
@media print {
  .zijbalk, .bovenbalk, .leja-slot, .meldingen { display: none !important; }
  .app { display: block; height: auto; }
  .werkvlak { overflow: visible !important; height: auto !important; }
}
