/* nuchtr v2, shell.css (M2). De schil uit 3.1 tot 3.9: zwevende zijbalk, paginakop, periodestrook,
   bannerlaag, onderbalk, Nieuw- en Meer-blad, admin "Bekijk als". Klassen onder .s-*. */

html.is-locked, html.is-locked body { overflow: hidden; }
body { overflow-x: hidden; }

/* ---------- Raamwerk ---------- */
.s-app { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: calc(var(--sidebar-w) + 12px) minmax(0, 1fr); }
.s-app[data-mode="auth"], .s-app[data-mode="boot"] { display: block; }
.s-app[data-mode="auth"] .s-side-slot, .s-app[data-mode="auth"] .s-head, .s-app[data-mode="auth"] .s-head__row2,
.s-app[data-mode="auth"] .s-period, .s-app[data-mode="auth"] .s-banner, .s-app[data-mode="auth"] .s-bnav,
.s-app[data-mode="boot"] .s-side-slot, .s-app[data-mode="boot"] .s-head, .s-app[data-mode="boot"] .s-head__row2, .s-app[data-mode="boot"] .s-bnav { display: none !important; }
.s-app[data-mode="auth"] .s-main { max-width: none; padding: 0; }
.s-page { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.s-head, .s-head__row2, .s-period, .s-banner, .s-main { width: 100%; max-width: var(--page-max); margin-left: auto; margin-right: auto; padding-left: var(--page-pad); padding-right: var(--page-pad); }
.s-main { flex: 1 0 auto; padding-bottom: 48px; outline: none; }
.s-main:focus { outline: none; }

/* ---------- Zijbalk (3.1) ---------- */
.s-side-slot { position: sticky; top: 0; height: 100vh; height: 100dvh; z-index: var(--z-sidebar); }
.s-side {
  position: absolute; top: 16px; bottom: 16px; left: 12px; width: var(--sidebar-w);
  display: flex; flex-direction: column; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-side);
  box-shadow: var(--shadow-panel); overflow: hidden; transition: width 240ms var(--ease-out);
}
.s-side:hover, .s-side:has(:focus-visible), .s-app.is-side-open .s-side { width: var(--sidebar-w-open); transition-duration: 300ms; }
.s-side__marker { position: absolute; left: 0; top: 0; width: 2px; height: 18px; border-radius: 0 2px 2px 0; background: var(--ink); opacity: 0; transition: transform 240ms var(--ease), opacity 150ms; z-index: 2; pointer-events: none; }
.s-side__brand { display: flex; align-items: center; gap: 14px; padding: 26px 0 26px 28px; color: var(--ink); flex: 0 0 auto; white-space: nowrap; }
.s-side__logo { width: 30px; height: 30px; flex: 0 0 auto; color: var(--ink); }
.s-side__wordmark { height: 19px; width: auto; display: block; color: var(--ink); }
.s-side__word { font-size: 15px; font-weight: 600; letter-spacing: .04em; }
.s-side__items { display: flex; flex-direction: column; gap: 4px; padding: 0 12px; flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
.s-side__items::-webkit-scrollbar { display: none; }
.s-side__item {
  position: relative; display: flex; align-items: center; gap: 14px; flex: 0 0 auto; width: 100%; height: 40px; padding: 0 0 0 18px;
  border-radius: 10px; color: var(--ink-3); font-size: 14px; font-weight: 500; white-space: nowrap; text-align: left;
  transition: background-color 200ms var(--ease), color 200ms, transform 200ms var(--ease);
}
.s-side__ic { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex: 0 0 auto; }
.s-side__label, .s-side__word { opacity: 0; transition: opacity 120ms var(--ease); }
.s-side:hover .s-side__label, .s-side:hover .s-side__word, .s-side:has(:focus-visible) .s-side__label, .s-side:has(:focus-visible) .s-side__word,
.s-app.is-side-open .s-side__label, .s-app.is-side-open .s-side__word { opacity: 1; transition: opacity 200ms var(--ease) 60ms; }
@media (hover: hover) { .s-side__item:hover { background: var(--panel-2); color: var(--ink-2); transform: scale(1.03); } }
.s-side__item.is-active { background: var(--panel-3); color: var(--ink); }
.s-side__item:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.s-side__plus { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); }
.s-side__plus .ic { width: 14px; height: 14px; stroke-width: 2.25; }
.s-side__item--new { color: var(--ink); }
.s-side__badge { position: absolute; top: -7px; right: -12px; min-width: 16px; height: 14px; padding: 0 4px; border-radius: 999px; background: var(--panel-3); color: var(--ink-2); border: 1px solid var(--bg-2); font-size: 9px; font-weight: 700; line-height: 12px; text-align: center; letter-spacing: 0; }
.s-side__dot { position: absolute; top: -2px; right: -3px; width: 8px; height: 8px; border-radius: 999px; background: var(--ink-4); border: 1.5px solid var(--bg-2); }
.s-side__dot[data-kind="ok"] { background: var(--pos); }
.s-side__dot[data-kind="live"] { background: var(--live); animation: dot-pulse 1.2s ease-in-out infinite; }
.s-side__dot[data-kind="err"] { background: var(--neg); }
.s-side__ring { position: absolute; inset: -5px; pointer-events: none; }
.s-side__ring svg { width: 30px; height: 30px; display: block; }
.s-side__ring path { fill: none; stroke: var(--panel-3); stroke-width: 1.5; stroke-linecap: round; }
.s-side__ring path.is-on { stroke: var(--live); }
.s-side__foot { display: flex; flex-direction: column; gap: 4px; padding: 4px 12px 12px; flex: 0 0 auto; }
.s-side__sep { height: 1px; background: var(--line); margin: 4px 6px 8px; }
.s-side__avatar { width: 28px; height: 28px; font-size: 12px; }
.s-side__who { overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }

/* ---------- Paginakop (3.1) ---------- */
.s-head { padding-top: 24px; padding-bottom: 16px; }
.s-head__bar { display: flex; align-items: center; gap: 16px; min-height: 56px; }
.s-head__logo { display: none; color: var(--ink); flex: 0 0 auto; }
.s-head__logo svg { width: 26px; height: 26px; }
.s-head__back { margin-left: -8px; flex: 0 0 auto; }
.s-head__titles { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.s-head__title { font-size: var(--t-h1); font-weight: 600; letter-spacing: var(--t-h1-ls, -.02em); line-height: 1.2; color: var(--ink); text-wrap: balance; }
.s-head__title .serif { font-family: var(--font-serif); font-style: normal; font-weight: 400; font-size: 1.12em; letter-spacing: -.01em; }
.s-head__sub { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; font-size: 12px; color: var(--ink-2); min-height: 24px; }
.s-head__sub .dvj-session { margin-left: -6px; }
.s-head__sep { display: inline-block; width: 14px; }
.s-head__sub2 { color: var(--ink-3); }
.s-head__actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.s-head__actions > [hidden] { display: none !important; }
.s-head__extra:empty { display: none; }
.s-head__primary:empty { display: none; }
.s-head__primary .dvj-btn { height: 36px; }
.s-head__eye, .s-head__cam { color: var(--ink-2); }
.s-switch { max-width: 280px; }
.s-switch .dvj-firm { width: 20px; height: 20px; border-radius: 999px; }
.s-switch .dvj-firm[hidden] { display: none; }
.s-head__row2 { display: none; }
.s-head__unitm { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); font-size: 15px; font-weight: 600; color: var(--ink); }
.s-head__unitm[hidden] { display: none; }

/* ---------- Periodestrook en banner ---------- */
.s-period { margin-bottom: var(--gap-section); }
.s-period[hidden], .s-banner[hidden] { display: none; }
.s-banner { margin-bottom: var(--gap-section); }
.s-banner .dvj-banner { box-shadow: var(--shadow-panel); }

/* ---------- Admin "Bekijk als" (3.9) ---------- */
.s-adminline { position: fixed; top: 0; left: 0; right: 0; height: 2px; background: var(--live); z-index: var(--z-admin); }
.s-adminchip { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: var(--z-admin); display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 4px 0 12px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); font-size: 12px; color: var(--ink); white-space: nowrap; }
.s-adminline[hidden], .s-adminchip[hidden] { display: none; }
.s-adminchip__stop { height: 22px; padding: 0 10px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 12px; }

/* ---------- Nieuw, Meer, avatar, bekijk als ---------- */
.s-newmenu { display: flex; flex-direction: column; gap: 4px; }
.s-newmenu .dvj-sheet__row { transition: background-color 120ms; }
@media (hover: hover) { .s-newmenu .dvj-sheet__row:not(.is-primary):hover { background: var(--panel-2); } }
.s-more__grid .dvj-sheet__item.is-active { background: var(--panel-3); color: var(--ink); }
.s-more__me { display: flex; align-items: center; gap: 12px; padding: 16px 4px 4px; margin-top: 12px; border-top: 1px solid var(--line); }
.s-more__who { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.s-more__who b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-more__who small { font-size: 12px; color: var(--ink-3); }
.s-more > .dvj-btn--text { margin-top: 8px; }
.s-viewas { display: flex; flex-direction: column; gap: 10px; padding: 6px; }
.s-viewas__list { max-height: 320px; overflow-y: auto; }
.s-viewas__row { height: auto; min-height: 48px; padding: 6px 8px; }
.s-viewas__txt { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.s-viewas__txt b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.s-viewas__txt small { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; }
.s-viewas__meta { font-size: 11px; color: var(--ink-3); }
.s-keys { grid-template-columns: 96px 1fr; margin-top: 4px; }
.s-keys kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; margin-right: 4px; border-radius: 6px; background: var(--panel-3); color: var(--ink); font: 600 12px/1 var(--font); }
.dvj-menu__head span { font-size: 12px; color: var(--ink-3); }

/* ---------- Onderbalk (3.2) ---------- */
.s-bnav { display: none; }

/* ---------- Stubs (schermen in aanbouw) ---------- */
.s-stub { display: flex; flex-direction: column; gap: var(--gap-section); }
.s-stub .panel { min-height: 260px; display: flex; align-items: center; justify-content: center; }
.s-stub__note { font-size: 12px; color: var(--ink-3); text-align: center; }

/* Kaarten in plaats van tabel op mobiel (terugval-tabel). */
.dvj-cards.only-mobile-flex { display: none; }

/* ---------- Tablet en mobiel (tot 1023 px): mobiele schil ---------- */
@media (max-width: 1023px) {
  .s-app { grid-template-columns: minmax(0, 1fr); }
  .s-app[data-mode="app"] { padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); }
  .s-side-slot { display: none; }
  .s-head { position: sticky; top: 0; z-index: var(--z-sticky); padding-top: env(safe-area-inset-top); padding-bottom: 0; background: rgba(10,10,10,.94); }
  .s-head__bar { gap: 10px; min-height: 56px; }
  .s-head__logo { display: inline-flex; }
  .s-app.has-back .s-head__logo { display: none; }
  .s-head__titles { gap: 1px; }
  .s-head__title { font-size: 17px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-wrap: nowrap; }
  .s-head__sub { min-height: 20px; flex-wrap: nowrap; overflow: hidden; white-space: nowrap; }
  .s-head__sub .s-head__date { overflow: hidden; text-overflow: ellipsis; }
  .s-head__sub .dvj-session { height: 20px; flex: 0 0 auto; }
  .s-head__actions { gap: 0; }
  .s-head__switch--d, .s-head__unit, .s-head__primary, .s-head__extra { display: none !important; }
  .s-head__row2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 4px; padding-bottom: 12px; }
  .s-head__row2[hidden] { display: none; }
  .s-switch { max-width: 160px; }
  .s-banner, .s-period { margin-bottom: 12px; }

  .s-bnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-sticky); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(14,14,16,.97); border-top: 1px solid var(--line); transition: transform 220ms var(--ease);
  }
  .s-app[data-mode="auth"] .s-bnav { display: none; }
  .s-app.is-bnav-hidden .s-bnav { transform: translateY(110%); }
  .s-bnav__item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 44px; font-size: 10px; font-weight: 500; color: var(--ink-3); transition: color 150ms; -webkit-tap-highlight-color: transparent; }
  .s-bnav__item .ic { width: 22px; height: 22px; }
  .s-bnav__item.is-active { color: var(--ink); }
  .s-bnav__mid { display: flex; align-items: flex-start; justify-content: center; }
  .s-bnav__new { width: 48px; height: 48px; margin-top: -4px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-fab); display: inline-flex; align-items: center; justify-content: center; transition: transform 150ms var(--ease); }
  .s-bnav__new .ic { stroke-width: 2.25; }
  .s-bnav__new:active { transform: scale(.96); }
  .s-adminchip { top: auto; bottom: calc(var(--bottomnav-h) + 12px + env(safe-area-inset-bottom)); }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .s-head__title { font-size: 20px; }
}
@media (max-width: 767px) {
  .dvj-cards.only-mobile-flex { display: flex; }
  .s-stub .panel { min-height: 220px; }
}
@media (prefers-reduced-motion: reduce) {
  .s-side, .s-side__marker, .s-side__label, .s-side__word, .s-bnav { transition: none !important; }
}
