/* =========================================================================
   27 Moments Portaal — app-schil bovenop het design system (ds/m27.css)
   Sidebar + topbar + content, volledig in de 27 Moments-branding:
   crème achtergrond, pill-vormen, sterk afgeronde kaarten, paars als accent.
   ========================================================================= */

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

html, body { height: 100%; }

body {
  font-family: var(--m27-font-tekst);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.55;
  color: var(--m27-tekst);
  background: var(--m27-creme);
}

h1, h2, h3 { font-family: var(--m27-font-titel); letter-spacing: var(--m27-ls-titel); font-weight: 400; }
h1 { font-size: clamp(26px, 4vw, 34px); }
h2 { font-size: 22px; }
h3 { font-size: 18px; }

a { color: var(--m27-paars); }

button { font: inherit; }

img { max-width: 100%; display: block; }

/* ------------------------------ Login --------------------------------- */
.login {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(60% 50% at 15% 10%, rgba(194, 177, 215, 0.35), transparent 70%),
    radial-gradient(50% 40% at 90% 90%, rgba(227, 234, 202, 0.5), transparent 70%),
    var(--m27-creme);
}

/* Bloem-motieven — warm merkaccent, bewust rustig gehouden. */
.login::before,
.login::after {
  content: "";
  position: absolute;
  pointer-events: none;
  background-repeat: no-repeat;
  background-size: contain;
}

.login::before {
  width: min(340px, 42vw);
  height: min(340px, 42vw);
  top: -70px;
  left: -80px;
  background-image: url("ds/bloem-lichtpaars.png");
  opacity: 0.55;
  transform: rotate(14deg);
}

.login::after {
  width: min(300px, 38vw);
  height: min(300px, 38vw);
  right: -70px;
  bottom: -60px;
  background-image: url("ds/bloem-lichtgroen.png");
  opacity: 0.8;
  transform: rotate(-9deg);
}

.login__kaart {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  background: #fff;
  border-radius: var(--m27-radius-groot);
  padding: 44px 40px;
  box-shadow: 0 24px 70px rgba(47, 33, 64, 0.14);
  text-align: center;
}

.login__logo { width: 74px; margin: 0 auto 18px; }
.login__kaart h1 { margin-bottom: 4px; color: var(--m27-donkergroen); }
.login__kaart .sub { color: #6f6b66; font-size: 14.5px; margin-bottom: 24px; }
.login__kaart form { text-align: left; }
.login__fout { color: #a4432f; font-size: 13.5px; margin-top: 14px; }
.login__toe { background: var(--m27-lichtgroen); color: var(--m27-donkergroen); border-radius: var(--m27-radius-kaart); padding: 14px 18px; font-size: 14px; margin-top: 16px; }

/* Formulieren (DS-veldstijl aangevuld) */
.veld { margin-bottom: 16px; }
.veld label { display: block; font-size: var(--m27-fs-label); letter-spacing: var(--m27-ls-label); text-transform: uppercase; margin-bottom: 6px; color: var(--m27-paars); }
.veld input, .veld select, .veld textarea {
  width: 100%;
  font: inherit;
  font-weight: 300;
  padding: 12px 16px;
  border: 1.5px solid #dad5cd;
  border-radius: 14px;
  background: #fff;
  color: var(--m27-tekst);
}
.veld input:focus-visible, .veld select:focus-visible, .veld textarea:focus-visible,
.m27-btn:focus-visible { outline: 3px solid var(--m27-lila); outline-offset: 2px; }
.veld input, .veld select, .veld textarea { transition: border-color 0.15s ease; }
.veld input:hover, .veld select:hover, .veld textarea:hover { border-color: #c5bfb4; }
.veld .hint { font-size: 13px; color: #8a857e; margin-top: 5px; }

/* Knoppen: consistente hover/actieve staten bovenop het design system. */
.m27-btn { transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease; }
.m27-btn:hover { transform: translateY(-1px); }
.m27-btn:active { transform: translateY(0); }
.m27-btn--green:hover { background: #4d5944; }
.m27-btn--purple:hover { background: #745195; }
.m27-btn--white:hover { background: #fff; box-shadow: 0 6px 18px rgba(47, 33, 64, 0.18); }
.m27-btn--outline-purple:hover { background: rgba(131, 95, 165, 0.09); }
.m27-btn--outline-white:hover { background: rgba(251, 251, 249, 0.14); }
.m27-btn[disabled] { opacity: 0.55; cursor: default; transform: none; }

/* Tags nooit middenin afbreken ("12–18 MAANDEN VOORAF"). */
.m27-tag { white-space: nowrap; }

/* Moderne dunne scrollbars in de app-schil en lange lijsten. */
.zijbalk, .modal, .tabelhoes,
.com-gasten, .gal-kieslijst, .ws-paneel, .mb-rij {
  scrollbar-width: thin;
  scrollbar-color: rgba(131, 95, 165, 0.35) transparent;
}
.zijbalk::-webkit-scrollbar, .modal::-webkit-scrollbar, .tabelhoes::-webkit-scrollbar,
.com-gasten::-webkit-scrollbar, .gal-kieslijst::-webkit-scrollbar,
.ws-paneel::-webkit-scrollbar, .mb-rij::-webkit-scrollbar { width: 7px; height: 7px; }
.zijbalk::-webkit-scrollbar-thumb, .modal::-webkit-scrollbar-thumb, .tabelhoes::-webkit-scrollbar-thumb,
.com-gasten::-webkit-scrollbar-thumb, .gal-kieslijst::-webkit-scrollbar-thumb,
.ws-paneel::-webkit-scrollbar-thumb, .mb-rij::-webkit-scrollbar-thumb {
  background: rgba(131, 95, 165, 0.35);
  border-radius: 999px;
}
.zijbalk::-webkit-scrollbar-thumb { background: rgba(251, 251, 249, 0.28); }

/* ------------------------------ App-schil ------------------------------ */
.app { display: none; min-height: 100vh; }
.app.actief { display: block; }

/* Smalle rail die uitklapt bij hover of toetsenbordfocus (zoals de hub) */
.zijbalk {
  background: var(--m27-donkergroen);
  color: var(--m27-wit);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: fixed;
  inset: 0 auto 0 0;
  width: 84px;
  z-index: 40;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.22s ease;
  white-space: nowrap;
}

.zijbalk:hover,
.zijbalk:focus-within {
  width: 284px;
  box-shadow: 24px 0 60px rgba(47, 33, 64, 0.18);
}

.hoofd { margin-left: 84px; }

.zijbalk__merk { display: flex; align-items: center; padding: 0 2px; }

.zijbalk__badge {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: none;
  background: var(--m27-wit);
  border-radius: 16px;
}

.zijbalk__badge img { width: 36px; }

.navknop span,
.zijbalk__voet {
  opacity: 0;
  transition: opacity 0.18s ease;
}

.zijbalk:hover .navknop span,
.zijbalk:focus-within .navknop span,
.zijbalk:hover .zijbalk__voet,
.zijbalk:focus-within .zijbalk__voet,
.zijbalk.open .navknop span,
.zijbalk.open .zijbalk__voet {
  opacity: 1;
}

.zijbalk nav { display: flex; flex-direction: column; gap: 4px; }

.navknop {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  border: 0;
  background: none;
  color: rgba(251, 251, 249, 0.82);
  text-align: left;
  padding: 12px 18px;
  border-radius: var(--m27-radius-pill);
  font-size: 14.5px;
  cursor: pointer;
  text-decoration: none;
  overflow: hidden;
}

.navknop { transition: background-color 0.15s ease, color 0.15s ease; }
.navknop svg { width: 18px; height: 18px; flex: none; }
.navknop:hover { background: rgba(194, 177, 215, 0.18); color: #fff; }
.navknop.actief { background: var(--m27-paars); color: #fff; font-weight: 400; }
.navknop:focus-visible { outline: 3px solid var(--m27-lila); outline-offset: -3px; }

.zijbalk__voet { margin-top: auto; padding: 0 8px; font-size: 12.5px; color: rgba(251, 251, 249, 0.55); }
.zijbalk__voet a { color: inherit; }

/* Topbar */
.hoofd { display: flex; flex-direction: column; min-width: 0; }
.hoofd > .topbalk { z-index: 20; }

.topbalk {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(18px, 3vw, 34px);
  background: rgba(247, 246, 242, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #e6e1d8;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbalk__titel h1 { color: var(--m27-donkergroen); font-size: clamp(20px, 3vw, 26px); }
.topbalk__titel p { font-size: 13px; color: #8a857e; }

.topbalk__rechts { display: flex; align-items: center; gap: 14px; }

.aftel-pill {
  background: var(--m27-lichtgroen);
  color: var(--m27-donkergroen);
  border-radius: var(--m27-radius-pill);
  padding: 8px 18px;
  font-size: 13px;
  letter-spacing: 0.6px;
  white-space: nowrap;
}

.inhoud { padding: clamp(18px, 3vw, 34px); max-width: 1180px; width: 100%; margin: 0 auto; }

/* Zachte overgang bij het wisselen van module (niet bij herlaad binnen
   dezelfde module — app.js zet de klasse alleen bij een echte wissel). */
.inhoud--wissel { animation: inhoud-in 0.26s ease; }
@keyframes inhoud-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ------------------------------ Bouwstenen ----------------------------- */
.kaart {
  background: #fff;
  border-radius: var(--m27-radius-kaart);
  padding: var(--m27-space-m);
  box-shadow: 0 10px 34px rgba(47, 33, 64, 0.07);
  margin-bottom: 18px;
}

.kaart--groen { background: var(--m27-lichtgroen); box-shadow: none; }
.kaart--lila { background: var(--m27-lila); color: var(--m27-tekst); box-shadow: none; }
.kaart--paars { background: var(--m27-paars); color: var(--m27-wit); box-shadow: none; }
.kaart h2, .kaart h3 { color: var(--m27-donkergroen); margin-bottom: 8px; }
.kaart--paars h2, .kaart--paars h3 { color: var(--m27-wit); }
.kaart .uitleg { font-size: 14px; color: #8a857e; margin-bottom: 16px; }
.kaart--paars .uitleg { color: rgba(251, 251, 249, 0.8); }

.kaart-rooster { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

/* Tabellen */
.tabelhoes { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid #efece6; vertical-align: middle; }
thead th { font-size: 12px; letter-spacing: var(--m27-ls-label); text-transform: uppercase; color: var(--m27-paars); font-weight: 400; white-space: nowrap; }
tbody tr { transition: background-color 0.15s ease; }
tbody tr:hover td { background: rgba(247, 246, 242, 0.7); }
tbody tr:last-child td { border-bottom: 0; }

/* Lijstrijen */
.rij { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid #efece6; }
.rij:last-child { border-bottom: 0; }

/* Voortgangsbalk */
.voortgang { height: 10px; border-radius: var(--m27-radius-pill); background: #ece8e0; overflow: hidden; }
.voortgang span { display: block; height: 100%; border-radius: var(--m27-radius-pill); background: var(--m27-donkergroen); transition: width 0.4s ease; }

/* Fotorooster (galerij, moodboard) */
.fotorooster { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.fotorooster img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--m27-radius-kaart); }

/* Lege staat — met een subtiel bloem-motief als warm merkaccent. */
.leeg {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 44px 24px;
  color: #8a857e;
  font-size: 14.5px;
  background: #fff;
  border-radius: var(--m27-radius-kaart);
  border: 1.5px dashed #dad5cd;
}

.leeg::before,
.leeg::after {
  content: "";
  position: absolute;
  pointer-events: none;
  background-repeat: no-repeat;
  background-size: contain;
  z-index: 0;
}

.leeg::before {
  width: 130px;
  height: 130px;
  right: -34px;
  bottom: -38px;
  background-image: url("ds/bloem-lichtgroen.png");
  opacity: 0.75;
  transform: rotate(-10deg);
}

.leeg::after {
  width: 96px;
  height: 96px;
  left: -28px;
  top: -26px;
  background-image: url("ds/bloem-lichtpaars.png");
  opacity: 0.45;
  transform: rotate(12deg);
}

.leeg > * { position: relative; z-index: 1; }
.leeg h3 { color: var(--m27-donkergroen); }

/* ------------------------------ Overlays ------------------------------- */
.modal-achtergrond {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(47, 33, 64, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-achtergrond[hidden] { display: none; }
.modal-achtergrond { animation: modal-achtergrond-in 0.2s ease; }

.modal {
  width: min(560px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  background: #fff;
  border-radius: var(--m27-radius-kaart);
  padding: 28px;
  animation: modal-in 0.22s ease;
}

@keyframes modal-achtergrond-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(0.985); } }

.modal h2 { color: var(--m27-donkergroen); margin-bottom: 14px; }
.modal__acties { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

.toosten { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toost {
  background: var(--m27-donkergroen);
  color: var(--m27-wit);
  border-radius: var(--m27-radius-pill);
  padding: 11px 22px;
  font-size: 14px;
  box-shadow: 0 12px 30px rgba(47, 33, 64, 0.35);
  animation: toost-in 0.25s ease;
}

.toost--weg { animation: toost-uit 0.25s ease forwards; }

@keyframes toost-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes toost-uit { to { opacity: 0; transform: translateY(8px); } }

/* Vergrendeld (platform toe) */
.slot { text-align: center; padding: 60px 24px; }
.slot img { width: 120px; margin: 0 auto 20px; opacity: 0.8; }
.slot h2 { color: var(--m27-donkergroen); margin-bottom: 10px; }
.slot p { max-width: 46ch; margin: 0 auto 8px; color: #6f6b66; }
.slot .m27-btn { margin-top: 16px; }

/* Foutkaart wanneer een module niet kan renderen. */
.foutkaart { text-align: center; padding: 48px 24px; }
.foutkaart h2 { color: var(--m27-donkergroen); margin-bottom: 10px; }
.foutkaart p { max-width: 52ch; margin: 0 auto 18px; color: #6f6b66; }

/* ------------------------------ Mobiel --------------------------------- */
.menuknop { display: none; border: 0; background: none; cursor: pointer; padding: 8px; }
.menuknop svg { width: 26px; height: 26px; color: var(--m27-donkergroen); }

/* Tablet (≤ 700px valt terug op hamburger; daarboven blijft de rail staan,
   zodat het portaal op 768px als volwaardige webapp met zijbalk oogt). */
@media (max-width: 700px) {
  .hoofd { margin-left: 0; }

  .zijbalk,
  .zijbalk:hover,
  .zijbalk:focus-within {
    width: min(280px, 82vw);
    transform: translateX(-105%);
    transition: transform 0.28s ease;
    box-shadow: 0 0 60px rgba(47, 33, 64, 0.4);
  }

  .zijbalk.open { transform: none; }
  .zijbalk .navknop span, .zijbalk .zijbalk__voet { opacity: 1; }
  .menuknop { display: block; }
  .aftel-pill { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .zijbalk, .voortgang span, .toost, .m27-btn, .navknop, tbody tr,
  .modal, .modal-achtergrond, .inhoud--wissel, .toost--weg {
    transition: none;
    animation: none;
  }
}

.knop-vol { width: 100%; }
.topbalk__links { display: flex; align-items: center; gap: 10px; }
