/*
 * Prindustry huisstijl voor de dashboards (brandbook v1.0, september 2026).
 *
 * Eén bestand voor de tokens, de lettertypen en de schil van de app (bovenbalk, rail, paneel, tabs, inlogpagina).
 * Zowel de oude SSR-pagina's (src/views/layouts/MainLayout.tsx) als de frontend (web/) laden dit bestand, zodat je
 * tijdens de migratie niet ziet in welk deel je zit. Tailwind in web/ leest de tokens hieronder via @theme inline.
 *
 * Opbouw in lagen, zoals in Prindustry 3.0:
 *   laag 0  donkerblauwe schil: bovenbalk en rail (de secties)
 *   laag 1  het lichte paneel dat daarop ligt: kop met paginatitel en tabs, daaronder de inhoud
 *   laag 2  witte kaarten in het paneel
 *
 * Kleurverhouding 60-30-10: wit/rust, blauw, oranje. Oranje alleen als accent (CTA, tellers, het hartje), nooit als vlak.
 * Lettertypen: Orkney Bold voor titels (nooit in kapitalen), Mulish voor lopende tekst in #242424.
 *
 * Licht en donker: elk token dat verschilt heeft light-dark(licht, donker). Welke van de twee geldt, bepaalt color-scheme
 * op <html>: standaard het systeem, met data-theme="light" of "dark" (assets/thema.js) een eigen keuze. De schil is
 * in beide standen donkerblauw; in de donkere stand worden paneel en kaarten donker en de tekst licht.
 */

@font-face { font-family: "Orkney"; src: url("/assets/fonts/orkney/OrkneyLight.ttf") format("truetype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Orkney"; src: url("/assets/fonts/orkney/OrkneyRegular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Orkney"; src: url("/assets/fonts/orkney/OrkneyBold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light dark;

  /* primair palet */
  --pd-hoofd: #3095b4;
  --pd-donker: light-dark(#172e4b, #e9eff6);   /* donkerblauw als tekstkleur (titels); in het donker wordt dat licht */
  --pd-oranje: #f16721;
  --pd-tekst: light-dark(#242424, #e3eaf2);

  /* de schil (bovenbalk, rail) is in beide standen donkerblauw; in het donker nog iets dieper */
  --pd-schil: #172e4b;
  --pd-schil-a: light-dark(#172e4b, #0a1322);
  --pd-schil-b: light-dark(#16304f, #0c1a2d);
  --pd-schil-c: light-dark(#145674, #0f2d3f);

  /* blauwe familie uit het social palet, voor verdieping en hover */
  --pd-blauw-2: #145674;
  --pd-blauw-3: #264164;

  /* social palet: vier families, handig als reeksen in grafieken; in het donker lichter zodat ze leesbaar blijven */
  --pd-groen: light-dark(#487259, #7cb893);
  --pd-paars: light-dark(#522279, #b48ad6);
  --pd-indigo: light-dark(#2d3b82, #93a2ea);

  /* afgeleid voor de interface */
  --pd-rust: light-dark(#f3f7f9, #111e31);     /* de 60% wit/rust: het paneel */
  --pd-vlak: light-dark(#ffffff, #192c47);     /* kaarten, velden, de actieve knop in de rail */
  --pd-tint: light-dark(#e6f2f6, #1c3b4b);     /* hoofdkleur, heel licht: actieve en geselecteerde dingen */
  --pd-lijn: light-dark(#dfe7ec, #2b3f5a);
  --pd-gedempt: light-dark(#5b6774, #9fb0c0); /* secundaire tekst, haalt 4.5:1 op rust */
  --pd-link: light-dark(#1d7896, #6cc8e3);     /* hoofdkleur iets dieper, zodat links als tekst genoeg contrast hebben */
  --pd-grijs: light-dark(#b9c5cd, #3c5068);    /* neutrale balken en schakelaars die uit staan */
  --pd-grijs-licht: light-dark(#cfd9e0, #2c4059);
  --pd-oranje-tint: light-dark(#fdebe1, #46271a);
  --pd-oranje-tekst: light-dark(#8a3409, #ffb089); /* tekst op oranje-tint */

  --pd-font-titel: "Orkney", "Mulish", system-ui, sans-serif;
  --pd-font-tekst: "Mulish", system-ui, -apple-system, "Segoe UI", sans-serif;

  --pd-radius: 14px;
  --pd-radius-groot: 24px;
  --pd-schaduw: 0 1px 2px light-dark(rgba(23, 46, 75, .05), rgba(0, 0, 0, .25)), 0 8px 24px light-dark(rgba(23, 46, 75, .07), rgba(0, 0, 0, .3));
  --pd-schaduw-hoog: 0 2px 4px light-dark(rgba(23, 46, 75, .06), rgba(0, 0, 0, .3)), 0 16px 40px light-dark(rgba(23, 46, 75, .14), rgba(0, 0, 0, .45));

  --pd-bovenbalk: 64px;
  --pd-rail: 104px;
  --pd-onderbalk: 0px;
}
/* eigen keuze gaat vóór het systeem (assets/thema.js) */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* ---- laag 0: de schil ---------------------------------------------------------------------------------------- */
body.pd-app {
  margin: 0;
  height: 100dvh;
  overflow: hidden;
  font-family: var(--pd-font-tekst);
  color: var(--pd-tekst);
  background:
    radial-gradient(1200px 700px at 100% 100%, rgba(48, 149, 180, .35), transparent 60%),
    linear-gradient(160deg, var(--pd-schil-a) 0%, var(--pd-schil-b) 50%, var(--pd-schil-c) 100%);
  background-attachment: fixed;
}

.pd-topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--pd-bovenbalk);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px 0 24px;
  color: #fff;
  z-index: 50;
}
.pd-brand { display: flex; align-items: center; gap: 14px; color: #fff; text-decoration: none; }
.pd-brand:hover { color: #fff; text-decoration: none; }
/* diapositief logo: volledig wit, uit het originele bestand */
.pd-brand img { height: 30px; width: auto; display: block; filter: brightness(0) invert(1); }
.pd-brand .pd-toolnaam {
  font-family: var(--pd-font-titel);
  font-weight: 400;
  font-style: italic;
  font-size: 15px;
  letter-spacing: .02em;
  /* basislijn gelijk aan het woordmerk in het logo: dat ligt op 23 van de 30 px,
     de tekst (Orkney hhea 888/-312 op 15px) centreert z'n basislijn op 19,3 px */
  position: relative;
  top: 3.7px;
  color: rgba(255, 255, 255, .85);
}
.pd-topbar-rechts { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.pd-topbar-rechts form { margin: 0; display: flex; }
.pd-gebruiker { display: flex; align-items: center; gap: 10px; font-size: 14px; color: rgba(255, 255, 255, .85); }
.pd-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--pd-hoofd); color: #fff;
  font-family: var(--pd-font-titel); font-weight: 700; font-size: 13px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .25);
}
.pd-icoonknop {
  width: 36px; height: 36px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: rgba(255, 255, 255, .75);
  cursor: pointer; font-size: 15px; transition: background-color .15s, color .15s;
}
.pd-icoonknop:hover, .pd-icoonknop:focus-visible { background: rgba(255, 255, 255, .1); color: #fff; outline: none; }

/* de rail: één knop per sectie (Start, elk dashboard, Tools, Toegang) met icoon en naam, in groepen met een kopje
   erboven. Compact genoeg om op een laptop zonder scrollen te passen */
.pd-rail {
  position: fixed;
  top: var(--pd-bovenbalk);
  left: 0;
  bottom: 0;
  width: var(--pd-rail);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0 16px;
  overflow-y: auto;
  /* dun maar zichtbaar: past de rail niet, dan moet je zien dat er meer onder zit */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .28) transparent;
  z-index: 40;
}
.pd-rail-item {
  position: relative;
  margin: 0 10px;
  padding: 7px 4px 6px;
  border-radius: var(--pd-radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: rgba(255, 255, 255, .72);
  text-decoration: none;
  text-align: center;
  font-family: var(--pd-font-tekst);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  transition: background-color .15s, color .15s, box-shadow .2s, transform .2s;
}
.pd-rail-item i { font-size: 16px; }
.pd-rail-item span.pd-label { max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; hyphens: auto; overflow-wrap: anywhere; }
.pd-rail-item:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.pd-rail-item:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
/* actief: een witte (in het donker: lichtere) tegel die boven de schil uitkomt */
.pd-rail-item.is-actief { background: var(--pd-vlak); color: var(--pd-donker); box-shadow: 0 8px 22px rgba(0, 0, 0, .28); }
.pd-rail-item.is-actief i { color: var(--pd-hoofd); }
/* de kopjes van de groepen: dun (Orkney Light), geen kapitalen, zodat ze terugwijken achter de knoppen */
.pd-rail-groep {
  margin: 6px 10px 0;
  padding: 7px 2px 1px;
  border-top: 1px solid rgba(255, 255, 255, .16);
  color: rgba(255, 255, 255, .7);
  font-family: var(--pd-font-titel);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: .04em;
  text-align: center;
  overflow-wrap: anywhere;
}
/* het versienummer onderaan de rail: klein en gedempt, de rail duwt hem naar beneden */
.pd-rail-versie {
  margin: auto 10px 0;
  padding-top: 10px;
  color: rgba(255, 255, 255, .5);
  font-family: var(--pd-font-tekst);
  font-size: 10px;
  font-weight: 600;
  text-align: center;
}
.pd-teller {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--pd-oranje); color: #fff;
  font-family: var(--pd-font-tekst); font-size: 11px; font-weight: 800; line-height: 1;
}
/* de teller in de hoek van de knop, naast het icoon */
.pd-rail-item .pd-teller { position: absolute; top: 4px; right: 10px; min-width: 18px; height: 18px; font-size: 10px; box-shadow: 0 0 0 2px var(--pd-schil-a); }
.pd-rail-item.is-actief .pd-teller { box-shadow: 0 0 0 2px var(--pd-vlak); }

/* lage schermen (laptop met taakbalk): de rail nog wat compacter zodat alles past */
@media (min-width: 992px) and (max-height: 760px) {
  .pd-rail { padding-top: 6px; }
  .pd-rail-item { padding: 5px 4px 4px; gap: 2px; font-size: 11px; }
  .pd-rail-item i { font-size: 15px; }
  .pd-rail-groep { margin-top: 4px; padding-top: 5px; }
}

/* ---- laag 1: het paneel ------------------------------------------------------------------------------------- */
.pd-paneel {
  position: fixed;
  top: var(--pd-bovenbalk);
  left: var(--pd-rail);
  right: 0;
  bottom: var(--pd-onderbalk);
  background: var(--pd-rust);
  border-top-left-radius: var(--pd-radius-groot);
  box-shadow: -10px 0 40px rgba(0, 0, 0, .22);
  overflow-y: auto;
  overflow-x: hidden;
  scroll-padding-top: 160px;
}
.pd-kop {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 26px 36px 0;
  background: color-mix(in srgb, var(--pd-rust) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
}
.pd-kop.zonder-tabs { padding-bottom: 6px; }
.pd-eyebrow {
  display: block;
  font-family: var(--pd-font-titel);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .08em;
  color: var(--pd-hoofd);
  margin: 0 0 4px;
}
.pd-titel {
  font-family: var(--pd-font-titel);
  font-weight: 300;
  font-size: 30px;
  line-height: 1.15;
  color: var(--pd-donker);
  margin: 0;
}
.pd-titel b, .pd-titel strong { font-weight: 700; }

.pd-tabs {
  display: flex;
  gap: 4px;
  margin: 18px -4px 0;
  border-bottom: 1px solid var(--pd-lijn);
  overflow-x: auto;
  scrollbar-width: none;
}
.pd-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 13px;
  white-space: nowrap;
  color: var(--pd-gedempt);
  font-family: var(--pd-font-tekst);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 10px 10px 0 0;
  transition: color .15s, background-color .15s;
}
.pd-tab i { font-size: 13px; opacity: .8; }
.pd-tab:hover { color: var(--pd-donker); background: rgba(48, 149, 180, .06); text-decoration: none; }
.pd-tab.is-actief { color: var(--pd-donker); font-weight: 700; }
.pd-tab.is-actief i { color: var(--pd-hoofd); opacity: 1; }
.pd-tab.is-actief::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--pd-hoofd);
}
.pd-tab .pd-teller { height: 18px; min-width: 18px; font-size: 10px; }

/* de schakelaar tussen systemen (Testen: CEC of Whitelabelshop) vóór de tabs; de tabs horen bij het gekozen systeem */
.pd-schakel {
  display: inline-flex;
  flex: none;
  align-self: center;
  gap: 2px;
  margin: 0 14px 6px 4px;
  padding: 3px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--pd-donker) 8%, transparent);
}
.pd-schakel-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 9px;
  color: var(--pd-gedempt);
  font-family: var(--pd-font-tekst);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  transition: color .15s, background-color .15s, box-shadow .15s;
}
.pd-schakel-item:hover { color: var(--pd-donker); text-decoration: none; }
.pd-schakel-item:focus-visible { outline: 2px solid var(--pd-hoofd); outline-offset: 1px; }
.pd-schakel-item.is-actief { background: var(--pd-vlak); color: var(--pd-donker); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
.pd-schakel-item .pd-teller { height: 16px; min-width: 16px; font-size: 10px; }

.pd-inhoud { padding: 28px 36px 120px; }

/* ---- laag 2: kaarten en tegels (gedeeld door SSR en frontend) ---------------------------------------------- */
.pd-kaart { background: var(--pd-vlak); border: 1px solid var(--pd-lijn); border-radius: var(--pd-radius); box-shadow: var(--pd-schaduw); }

/* slogan: altijd zonder hoofdletters, hartje in oranje */
.pd-slogan { font-family: var(--pd-font-titel); font-weight: 700; letter-spacing: .01em; }
.pd-slogan .pd-hart { color: var(--pd-oranje); }

/* ---- smalle schermen: rail wordt een balk onderin ---------------------------------------------------------- */
@media (max-width: 991.98px) {
  :root { --pd-bovenbalk: 56px; --pd-rail: 0px; --pd-onderbalk: 68px; }
  .pd-topbar { padding: 0 12px 0 16px; }
  .pd-brand img { height: 24px; }
  .pd-gebruiker .pd-naam { display: none; }
  .pd-rail {
    top: auto; right: 0; width: auto; height: var(--pd-onderbalk);
    flex-direction: row; gap: 2px; padding: 6px 8px;
    overflow-x: auto; overflow-y: hidden;
    background: var(--pd-schil-a);
  }
  .pd-rail-item { flex: 1 1 0; min-width: 64px; margin: 0; padding: 7px 4px 6px; gap: 4px; font-size: 11px; }
  .pd-rail-item i { font-size: 17px; }
  .pd-rail-item span.pd-label { -webkit-line-clamp: 1; hyphens: none; overflow-wrap: normal; text-overflow: ellipsis; white-space: nowrap; display: block; }
  .pd-rail-item .pd-teller { top: 2px; right: 10px; }
  .pd-rail-versie { display: none; }
  /* onderin geen ruimte voor kopjes: een streepje tussen de groepen, de naam blijft voor schermlezers */
  .pd-rail-groep {
    flex: 0 0 1px; align-self: stretch; margin: 8px 4px; padding: 0; border: 0;
    background: rgba(255, 255, 255, .18); color: transparent; font-size: 0; overflow: hidden;
  }
  .pd-paneel { border-radius: 20px 20px 0 0; box-shadow: none; }
  .pd-kop { padding: 18px 16px 0; }
  .pd-titel { font-size: 24px; }
  .pd-tabs { margin-top: 12px; }
  .pd-inhoud { padding: 20px 16px 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .pd-rail-item, .pd-tab, .pd-schakel-item, .pd-icoonknop { transition: none; }
}

/* ---- inlogpagina ------------------------------------------------------------------------------------------- */
body.pd-login, body.pd-login *, body.pd-login *::before, body.pd-login *::after { box-sizing: border-box; }
body.pd-login {
  margin: 0;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  font-family: var(--pd-font-tekst);
  color: var(--pd-tekst);
  background: var(--pd-vlak);
}
.pd-login-merk {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  padding: 56px 64px;
  color: #fff;
  background:
    radial-gradient(900px 600px at 110% 110%, rgba(48, 149, 180, .55), transparent 60%),
    linear-gradient(160deg, var(--pd-schil-a) 0%, var(--pd-schil-b) 45%, var(--pd-schil-c) 100%);
}
/* het beeldmerk als groot, zacht kader op de achtergrond (beeldconcept: logovorm als outline, licht geroteerd) */
.pd-login-merk::after {
  content: "";
  position: absolute;
  right: -140px;
  top: 50%;
  width: 560px;
  height: 560px;
  transform: translateY(-50%) rotate(-8deg);
  background: url("/assets/wls/favicon.png") center / contain no-repeat;
  filter: brightness(0) invert(1);
  opacity: .045;
  pointer-events: none;
}
.pd-login-merk > * { position: relative; z-index: 1; }
.pd-login-merk img { width: 210px; max-width: 70%; filter: brightness(0) invert(1); display: block; }
.pd-login-merk .pd-eyebrow { color: #9fd3e4; }
.pd-login-merk h2 {
  font-family: var(--pd-font-titel);
  font-weight: 300;
  font-size: clamp(34px, 4.2vw, 54px);
  line-height: 1.05;
  margin: 0 0 18px;
  color: #fff;
}
/* het dikgedrukte deel altijd op de tweede regel */
.pd-login-merk h2 b { display: block; font-weight: 700; }
.pd-login-merk p { max-width: 420px; font-size: 17px; line-height: 1.55; color: rgba(255, 255, 255, .78); margin: 0; }
.pd-login-merk .pd-slogan { font-size: 16px; }

.pd-login-form { display: flex; align-items: center; justify-content: center; padding: 48px 32px; background: var(--pd-rust); }
.pd-login-form > div { width: min(380px, 100%); }
.pd-login-form h1 { font-family: var(--pd-font-titel); font-weight: 700; font-size: 32px; color: var(--pd-donker); margin: 0 0 8px; }
.pd-login-form p { color: var(--pd-gedempt); margin: 0 0 28px; line-height: 1.5; }
.pd-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  padding: 14px 22px;
  border: 0; border-radius: 12px;
  background: var(--pd-oranje); color: #fff;
  font-family: var(--pd-font-tekst); font-size: 16px; font-weight: 800;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(241, 103, 33, .3);
  transition: transform .15s, box-shadow .15s, background-color .15s;
}
.pd-cta:hover { color: #fff; text-decoration: none; background: #e25a15; transform: translateY(-1px); box-shadow: 0 12px 26px rgba(241, 103, 33, .36); }
.pd-cta:focus-visible { outline: 3px solid var(--pd-donker); outline-offset: 3px; }
.pd-knop-rustig {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 12px 20px; border-radius: 12px; border: 1px solid var(--pd-lijn); background: var(--pd-vlak);
  color: var(--pd-donker); font-weight: 700; text-decoration: none;
}
.pd-knop-rustig:hover { border-color: var(--pd-hoofd); color: var(--pd-donker); text-decoration: none; }
.pd-login-fout {
  background: var(--pd-oranje-tint); color: var(--pd-oranje-tekst); border: 1px solid light-dark(#f9c7aa, #6b3a22);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 20px; font-size: 14px;
}
.pd-login-form .pd-login-voet { margin: 32px 0 0; font-size: 12px; color: var(--pd-gedempt); }

@media (max-width: 860px) {
  body.pd-login { grid-template-columns: minmax(0, 1fr); }
  .pd-login-merk { padding: 32px 24px; gap: 28px; }
  .pd-login-merk::after { width: 320px; height: 320px; right: -90px; }
  .pd-login-form { padding: 32px 16px 48px; align-items: flex-start; }
}
