/* The three layouts: staff environment, employee portal, public pages (Huisstijl V1 §3, demo V10 layout()). Sizes of the
   sidebar, navigation and top bar: the Sherlock reference (D-720).
   Below 950 px the sidebar moves to the top; below 600 px everything is one column. */

/* The page is exactly as high as the window or its content, whichever is more: the test banner is part of that height,
   so a short page never scrolls (S25e item 4, D-298). */
body { display: flex; flex-direction: column; min-height: 100vh; }

/* Staff environment and employee portal */
.shell { display: grid; flex: 1 0 auto; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4) 14px var(--space-3); background: var(--navy); color: var(--sidebar-text); }
.sidebar .brand { padding: var(--space-1) 4px 14px; border-bottom: 1px solid var(--sidebar-line); }
.caption { display: block; margin: var(--space-2) 10px 7px; color: var(--sidebar-caption); font-size: 9px; font-weight: var(--fw-regular); letter-spacing: 1.7px; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav-disabled { position: relative; display: block; min-height: 32px; padding: 8px 10px 7px; border-radius: var(--radius-sm); color: var(--sidebar-text); font-size: 11px; font-weight: var(--fw-medium); line-height: 1.45; text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--navy-hover); color: var(--white); }
.nav a[aria-current="page"]::before { content: ""; position: absolute; top: 6px; left: 0; width: 3px; height: 20px; border-radius: 3px; background: var(--brandmark-line); }
.nav-disabled { opacity: .55; cursor: not-allowed; }
.nav-fold > summary { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; border-radius: 6px; cursor: pointer; list-style: none; }
.nav-fold > summary::-webkit-details-marker { display: none; }
.nav-fold > summary::after { content: ""; width: 7px; height: 7px; margin-right: 4px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.nav-fold[open] > summary::after { transform: rotate(45deg); }
.nav-fold > summary:hover { color: var(--white); }
.nav-fold > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sidebar-bottom { margin-top: auto; padding: var(--space-2) 4px 0; border-top: 1px solid var(--sidebar-line); color: var(--sidebar-text); font-size: 10px; line-height: 1.4; }
.workspace { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; height: var(--topbar-height); padding: 0 var(--content-pad); border-bottom: 1px solid var(--line); background: var(--white); }
.topbar-title { min-width: 0; }
.topbar-title strong { color: var(--ink); font-weight: var(--fw-semibold); }
.product-short { display: none; }
.crumb { overflow: hidden; margin-top: 2px; color: var(--text-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: var(--space-3); }
.user { display: grid; text-align: right; line-height: 1.25; }
.user strong { font-size: var(--fs-sm); }
.user span { color: var(--text-muted); font-size: 11px; }
.content { max-width: var(--content-max); margin: 0 auto; padding: 22px var(--content-pad) 32px; }
.content:focus, .public-content:focus { outline: none; }
.content > :last-child, .public-content > :last-child { margin-bottom: 0; }

/* Test environment (S22b, D-240): a banner that stays on top of every page; the staff and portal sidebar starts below it */
.testbalk { position: sticky; top: 0; z-index: 90; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 14px; min-height: var(--testbalk-hoogte); padding: 8px 20px; background: var(--amber); color: var(--white); font-size: var(--fs-base); letter-spacing: .02em; text-align: center; box-shadow: inset 0 -3px 0 var(--warn-text); }
.testbalk strong { font-weight: 800; }
.testbalk-naam { font-weight: var(--fw-semibold); }
.testomgeving .sidebar { top: var(--testbalk-hoogte); height: calc(100vh - var(--testbalk-hoogte)); }

/* Public pages */
.public-header { background: linear-gradient(115deg, var(--navy), var(--hero-from) 62%, var(--hero-to)); }
.public-header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); max-width: 820px; margin: 0 auto; padding: var(--space-4) 20px; }
.public-header .caption { margin: 0; }
.public-header .taalwissel { margin: 0 0 0 auto; }
.taalkeuze { display: grid; gap: var(--space-3); margin: var(--space-4) 0; }
.public-content { width: 100%; max-width: 820px; margin: 0 auto; padding: var(--space-6) 20px var(--space-7); }
.public-content.narrow { max-width: 560px; }

/* a 1024 px window keeps more room for the content: the sidebar's texts still fit (S60) */
@media (max-width: 1200px) {
  :root { --sidebar-width: 200px; }
}
@media (max-width: 950px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar, .testomgeving .sidebar { position: static; height: auto; gap: var(--space-2); padding: 14px 20px; }
  .sidebar .brand { padding: var(--space-1) 0; }
  .sidebar .caption, .sidebar-bottom { display: none; }
  .sidebar .nav-fold > summary.caption { display: flex; justify-content: flex-start; gap: 10px; margin: var(--space-1) 0; }
  .nav { flex-direction: row; overflow-x: auto; padding-bottom: 2px; }
  .nav a, .nav-disabled { white-space: nowrap; }
  .nav a[aria-current="page"]::before { top: auto; bottom: 0; left: 10px; width: calc(100% - 20px); height: 3px; }
  .topbar { height: auto; min-height: 62px; padding: 10px 20px; }
  .content { padding: var(--space-5) 20px var(--space-6); }
}
@media (max-width: 600px) {
  .user { display: none; }
  .product-long { display: none; }
  .product-short { display: inline; }
  .shell.portal .nav { display: grid; grid-template-columns: 1fr 1fr; overflow: visible; }
  .shell.portal .nav a { display: flex; align-items: center; justify-content: center; min-height: 40px; font-size: var(--fs-base); white-space: normal; text-align: center; }  /* a finger on a phone (QR code), not the reference's desktop size */
  .public-header .caption { display: none; }
  .public-content { padding: var(--space-4) var(--space-4) var(--space-6); }
}
@media print {
  .sidebar, .topbar, .public-header, .skip-link { display: none !important; }
  body, .shell { display: block; }
  .content { padding: 0; }
}
