/* =============================================================================================
   DE SCHIL: zijbalk, tabbalk onderin, paneel "Meer", statusregel
   =============================================================================================
   Hoort bij libs/schil.php (de HTML) en libs/schil.js (open/dicht op de telefoon). De kleuren
   en maten komen uit de tokens bovenin modern.css.

   Twee standen, met de grens op 900px (dezelfde als resv):
     - vanaf 900px: vaste zijbalk links op de grijze achtergrond, de pagina zelf als wit vel
       ernaast met ronde hoeken;
     - daaronder: de pagina over de volle breedte, een tabbalk onderin met vier vaste knoppen en
       "Meer". "Meer" schuift de zijbalk als paneel van onderen in beeld -- hetzelfde element,
       dus wat erin staat kan nooit verschillen van de computer.
   900 en niet 768 (de grens van Bootstrap): tussen 768 en 900 blijft er naast een zijbalk van
   250px te weinig over voor een rooster of een brede tabel.
   ============================================================================================= */

:root {
  --m8ZijBreedte: 252px;
  --m8TabHoogte: 62px;
}

/* ---- toegankelijkheid: overslaan naar de inhoud ------------------------------------------ */
.m8Overslaan {
  position: absolute; left: 12px; top: -60px; z-index: 2000;
  padding: 10px 14px; border-radius: 10px;
  background: var(--m8AccentVlak); color: #fff; font-weight: 700;
}
.m8Overslaan:focus { top: 12px; color: #fff; text-decoration: none; }

/* ---- pictogrammen in de schil ----------------------------------------------------------- */
.m8Ico {
  width: 20px; height: 20px; flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* ---- zijbalk ------------------------------------------------------------------------------ */
.m8Zijbalk {
  display: flex; flex-direction: column;
  font-size: 14.5px; line-height: 1.3;
  color: var(--m8Tekst);
}
.m8ZijKop { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 8px 16px; }
.m8Merk { display: inline-flex; align-items: center; min-height: 34px; }
.m8Merk img { display: block; height: 30px; width: auto; max-width: 170px; }
.m8Nav { display: flex; flex-direction: column; gap: 2px; }
/* Het vak dat meerolt (menu, schakelaars, weergave). Op een breed scherm telt het niet mee:
   display:contents laat zijn kinderen gewoon kinderen van de zijbalk zijn, zodat .m8Ik zijn
   margin-top:auto houdt en de zijbalk als geheel rolt, net als eerst. */
.m8ZijRol { display: contents; }

/* Een regel in het menu: een losse link, de kop van een groep, een schakelaar, de eigen naam. */
.m8NavItem,
.m8NavGroep > summary,
.m8Schakel,
.m8Ik > summary {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  min-height: 40px; padding: 0 10px;
  border-radius: 10px;
  color: var(--m8Tekst);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.m8NavItem .m8Ico,
.m8NavGroep > summary .m8Ico,
.m8Schakel .m8Ico { color: var(--m8Grijs); }
.m8NavItem:hover, .m8NavItem:focus,
.m8NavGroep > summary:hover,
.m8Schakel:hover, .m8Schakel:focus,
.m8Ik > summary:hover { background: var(--m8Zweef); color: var(--m8Tekst); text-decoration: none; }
.m8NavTekst { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Actief: wit vlakje met een streep in de eigen kleur van wie er is ingelogd. */
.m8NavItem.is-actief {
  background: var(--m8Vlak);
  box-shadow: var(--m8Schaduw);
}
.m8NavItem.is-actief .m8Ico { color: var(--m8EigenAccent); }
.m8NavItem.is-actief::before,
.m8NavSub.is-actief::before {
  content: ''; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 3px;
  background: var(--m8EigenAccent);
}

/* Groep (Rooster, Gebruikers, Instellingen...): een <details>, dus open en dicht zonder script. */
.m8NavGroep > summary { list-style: none; }
.m8NavGroep > summary::-webkit-details-marker { display: none; }
.m8NavGroep > summary > .m8Ico:last-child { width: 16px; height: 16px; margin-left: auto; transition: transform .15s ease; }
.m8NavGroep[open] > summary > .m8Ico:last-child { transform: rotate(90deg); }
.m8NavGroep.is-actief > summary .m8Ico:first-child { color: var(--m8EigenAccent); }

.m8NavSubs { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px 19px; padding-left: 10px; border-left: 1px solid var(--m8Lijn); }
.m8NavSub {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  min-height: 34px; padding: 0 10px;
  border-radius: 8px;
  color: var(--m8Grijs); font-weight: 550; font-size: 14px;
  text-decoration: none;
}
.m8NavSub .m8Ico { display: none; }
.m8NavSub:hover, .m8NavSub:focus { background: var(--m8Zweef); color: var(--m8Tekst); text-decoration: none; }
.m8NavSub.is-actief { color: var(--m8Tekst); background: var(--m8Vlak); box-shadow: var(--m8Schaduw); }
.m8NavSub.is-actief::before { left: -11px; top: 8px; bottom: 8px; }

/* Bolletjes: een getal (vakantieverzoeken), een uitroepteken (er moet iets gebeuren), een stip
   (in deze dichte groep staat iets open). */
.m8Aantal, .m8Let {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px;
  background: var(--m8RoodVlak); color: #fff;
  font-size: 11.5px; font-weight: 800; line-height: 1;
}
.m8Let { background: var(--m8OranjeVlak); }
.m8Stip { width: 8px; height: 8px; border-radius: 50%; background: var(--m8Oranje); flex: 0 0 auto; }

/* ---- schakelaars ------------------------------------------------------------------------- */
.m8Schakelaars { margin-top: 18px; display: flex; flex-direction: column; gap: 2px; }
.m8ZijKopje { padding: 0 10px 6px; font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--m8Grijs); }
.m8Schakel small { display: block; font-size: 11.5px; font-weight: 600; color: var(--m8Rood); }
.m8Schakel.is-aan small { color: var(--m8Groen); }
.m8Schakel .m8NavTekst { line-height: 1.2; padding: 4px 0; }
/* Wie hem het laatst omzette, naast "aan"/"uit". Grijs en met een punt ertussen, zodat de stand
   zelf (rood of groen) de blikvanger blijft. De naam is een voornaam uit de sessie, dus kort --
   maar hij wordt afgekapt in plaats van de kolom op te rekken. */
.m8SchakelDoor { font-style: normal; color: var(--m8Grijs); font-weight: 600; }
.m8SchakelDoor::before { content: ' \00B7 '; }
.m8Schakel small { display: flex; gap: 0; align-items: baseline; min-width: 0; }
.m8Schakel small .m8SchakelDoor { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Het uitroepteken bij een schakelaar die uit staat: zelfde bolletje als in het menu, maar het
   mag de schuifknop ernaast niet wegduwen. */
.m8Schakel .m8Let { flex: 0 0 auto; margin-left: auto; margin-right: 8px; }
.m8Knop {
  position: relative; flex: 0 0 auto;
  width: 36px; height: 22px; border-radius: 999px;
  background: var(--m8LijnSterk);
  transition: background .15s ease;
}
.m8Knop::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25);
  transition: transform .15s ease;
}
.m8Schakel.is-aan .m8Knop { background: var(--m8Groen); }
.m8Schakel.is-aan .m8Knop::after { transform: translateX(14px); }

/* ---- weergave (auto / licht / donker) ---------------------------------------------------- */
.m8Weergave { margin-top: 18px; }
.m8ThemaKeuze { display: flex; width: 100%; }
.m8ThemaKeuze > button { flex: 1 1 0; gap: 5px; padding: 0 6px; font-size: 13px; }
.m8ThemaKeuze .m8Ico { width: 16px; height: 16px; }

/* ---- eigen naam onderin ------------------------------------------------------------------ */
.m8Ik { margin-top: auto; padding-top: 14px; }
.m8Ik > summary { list-style: none; min-height: 52px; gap: 10px; border-top: 1px solid var(--m8Lijn); border-radius: 0 0 10px 10px; padding-top: 8px; padding-bottom: 8px; }
.m8Ik > summary::-webkit-details-marker { display: none; }
.m8Ik > summary > .m8Ico:last-child { width: 16px; height: 16px; margin-left: auto; color: var(--m8Grijs); transform: rotate(-90deg); transition: transform .15s ease; }
.m8Ik[open] > summary > .m8Ico:last-child { transform: rotate(90deg); }
.m8Ik .m8Avatar { box-shadow: 0 0 0 2px var(--m8Eigen, var(--m8Lijn)); border-color: var(--m8Vlak); }
.m8IkNaam { display: flex; flex-direction: column; min-width: 0; }
.m8IkNaam b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m8IkNaam small { font-size: 12px; color: var(--m8Grijs); font-weight: 500; }
.m8Uitlog { color: var(--m8Rood); }

/* ---- statusregel (Butlaroo uit, meldingenmail uit) -------------------------------------- */
.m8StatusRij { display: flex; flex-direction: column; gap: 8px; margin: 0 0 10px; }
.m8Status {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--m8Lijn); border-radius: 12px;
  background: var(--m8Vlak);
  font-size: 13.5px; line-height: 1.45; color: var(--m8Tekst);
}
.m8Status .m8Ico { margin-top: 1px; color: var(--m8Grijs); }
.m8StatusLet { background: var(--m8OranjeZacht); border-color: transparent; }
.m8StatusLet .m8Ico { color: var(--m8Oranje); }
.m8Status a { font-weight: 700; white-space: nowrap; }

/* ---- de pagina zelf ----------------------------------------------------------------------- */
.m8Inhoud { display: block; position: relative; }
/* Bootstrap-rijen (.row) hebben -15px marge en rekenen op 15px van hun ouder. */
.m8Inhoud::after { content: ''; display: table; clear: both; }

.m8footer {
  padding: 18px 0 6px; margin: 0;
  text-align: center; font-size: 11px; letter-spacing: .1em; color: var(--m8Grijs); opacity: .7;
}
.m8footer a.kassatellenlink, .m8footer a.kassatellenlink:hover { color: inherit; text-decoration: none; cursor: text; }

/* Zonder menu (inlogpagina, kassatelaccount): alleen het logo boven de inhoud. */
.m8Kaal { display: flex; justify-content: center; padding: 28px 16px 8px; }
.m8KaalLogo img { height: 40px; width: auto; }

/* ---- vanaf 900px: zijbalk en wit vel ----------------------------------------------------- */
@media (min-width: 900px) {
  .m8Zijbalk {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
    width: var(--m8ZijBreedte);
    padding: 16px 12px 12px;
    overflow-y: auto; overscroll-behavior: contain;
    scrollbar-width: thin;
  }
  .m8Hoofd { margin-left: var(--m8ZijBreedte); padding: 10px 10px 4px 0; min-height: 100vh; }
  .m8Inhoud {
    min-height: calc(100vh - 20px - 40px);
    padding: 28px 32px 36px;
    border: 1px solid var(--m8Lijn); border-radius: 18px;
    background: var(--m8Vlak);
    box-shadow: var(--m8Schaduw);
  }
  /* Het eigen menu onderaan klapt OMHOOG open.
     .m8Ik staat met margin-top:auto tegen de onderkant van de zijbalk geplakt. Naar beneden
     openklappen zette de hele lijst daardoor onder de rand van het scherm -- gemeten op een
     venster van 1280x760 met een gevulde zijbalk: 284px eronder. Je kon er alleen bij door de
     zijbalk te scrollen, en daar keek niemand.
     column-reverse zet de lijst boven de naam. De naam blijft staan waar hij stond en de links
     groeien omhoog, het beeld in. De hoogtegrens is er voor het geval de lijst langer is dan de
     ruimte erboven; dan rolt hij binnen zichzelf. */
  .m8Ik { display: flex; flex-direction: column-reverse; }
  .m8Ik > .m8NavSubs { max-height: 60vh; overflow-y: auto; overscroll-behavior: contain; }
  .m8Tabbalk, .m8Scherm, .m8AlleenSmal { display: none !important; }
  /* Kale variant (inloggen, kassatelling): geen zijbalk, en het vel is de achtergrond zelf. */
  .m8InhoudKaal { min-height: 0; max-width: 1180px; margin: 0 auto 10px; border: 0; background: transparent; box-shadow: none; }
}
@media (min-width: 1500px) {
  .m8Inhoud { padding-left: 44px; padding-right: 44px; }
}

/* ---- onder 900px: tabbalk en paneel ------------------------------------------------------- */
@media (max-width: 899px) {
  body { background: var(--m8Vlak); }
  .m8AlleenBreed { display: none !important; }
  /* De inhoud moet onder de tabbalk EN onder de statusbalken door kunnen. Die laatste hoogte
     hangt af van de lengte van de Butlaroo-melding, dus die wordt in schil.js gemeten en als
     --m8StatusHoogte doorgegeven; staat er geen balk, dan is hij 0. */
  .m8Hoofd { padding-bottom: calc(var(--m8TabHoogte) + var(--m8StatusHoogte, 0px) + 6px); }
  .m8Inhoud { padding: 16px 14px 20px; }
  /* Op de telefoon staan de statusbalken vast boven de tabbalk in plaats van bovenaan de
     pagina: daar scrollen ze weg, en juist "Butlaroo staat uit" wil je blijven zien zolang dat
     zo is -- met de melding erbij en de link om hem aan te passen. Vóór de verbouwing stonden
     ze daar ook (.butlaroo_div_top hing met top:-14px boven de vaste onderbalk).
     z-index onder de tabbalk (900) en ruim onder het schuifpaneel (1001), zodat die er
     overheen komen in plaats van andersom. */
  .m8StatusRij {
    position: fixed; left: 0; right: 0; bottom: var(--m8TabHoogte); z-index: 899;
    margin: 0; padding: 8px 12px;
    background: var(--m8Glas);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid var(--m8Lijn);
  }

  /* z-index boven het paneel (1001) en het waas (1000): de tabbalk blijft zichtbaar en
     aantikbaar als het menu openstaat, want diezelfde knop sluit het weer. */
  .m8Tabbalk {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1002;
    display: flex; align-items: stretch;
    /* De randlijn hoort BINNEN --m8TabHoogte te vallen: de inhoudsmarge, de statusregel en de
       onderkant van het paneel rekenen allemaal met die maat. Zonder deze regel was de balk
       63px en stond het paneel 1px achter zijn randlijn -- onzichtbaar, maar wel verkeerd.
       (Op de site zet Bootstrap box-sizing voor alles; hier staat het er los bij, zodat de
       maat ook klopt in een proefopstelling zonder Bootstrap.) */
    box-sizing: border-box;
    height: var(--m8TabHoogte);
    padding: 0 4px;
    border-top: 1px solid var(--m8Lijn);
    background: var(--m8Glas);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
  }
  .m8Tab {
    position: relative; flex: 1 1 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    padding: 0; border: 0; background: none;
    color: var(--m8Grijs);
    font-size: 11px; font-weight: 700; line-height: 1;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  .m8Tab:hover, .m8Tab:focus { color: var(--m8Tekst); text-decoration: none; }
  .m8Tab .m8Ico { width: 22px; height: 22px; padding: 4px 16px; box-sizing: content-box; border-radius: 999px; transition: background .15s ease; }
  .m8Tab.is-actief { color: var(--m8Tekst); }
  .m8Tab.is-actief .m8Ico { background: var(--m8EigenZacht); color: var(--m8EigenAccent); }
  .m8Tab:active .m8Ico { transform: scale(.92); }
  .m8Tab .m8Aantal, .m8Tab .m8Let { position: absolute; top: 5px; left: calc(50% + 8px); height: 18px; min-width: 18px; font-size: 10.5px; padding: 0 5px; }
  .m8Tab .m8Stip { position: absolute; top: 7px; left: calc(50% + 12px); }
  /* "Meer" en "Sluiten" zijn dezelfde knop; alleen de stand van het menu bepaalt wat je ziet. */
  body:not(.m8MenuOpen) .m8AlsOpen { display: none; }
  body.m8MenuOpen .m8AlsDicht { display: none; }
  body.m8MenuOpen .m8TabMeer { color: var(--m8Tekst); }
  body.m8MenuOpen .m8TabMeer .m8Ico { background: var(--m8EigenZacht); color: var(--m8EigenAccent); }

  /* Het paneel: dezelfde zijbalk, nu van onderen -- en tot AAN de tabbalk, niet eroverheen.
     Het rolt niet meer als geheel: .m8ZijRol rolt, zodat de eigen naam onderaan blijft staan. */
  .m8Zijbalk {
    position: fixed; left: 0; right: 0; bottom: var(--m8TabHoogte); z-index: 1001;
    max-height: calc(100vh - var(--m8TabHoogte) - 12px);
    max-height: calc(100dvh - var(--m8TabHoogte) - 12px);
    padding: 10px 12px 12px;
    overflow: hidden;
    border-radius: 22px 22px 0 0;
    background: var(--m8Vlak);
    box-shadow: 0 -10px 40px rgba(15,23,42,.18);
    /* Helemaal van het scherm af: zijn eigen hoogte plus de tabbalk waar hij op staat. */
    transform: translateY(calc(100% + var(--m8TabHoogte)));
    visibility: hidden;
    transition: transform .26s cubic-bezier(.2,.8,.2,1), visibility 0s linear .26s;
  }
  .m8ZijRol { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  /* greepje bovenaan, zodat het herkenbaar een paneel is */
  .m8Zijbalk::before { content: ''; display: block; width: 40px; height: 5px; margin: 0 auto 10px; border-radius: 3px; background: var(--m8LijnSterk); }
  body.m8MenuOpen { overflow: hidden; }
  body.m8MenuOpen .m8Zijbalk { transform: none; visibility: visible; transition: transform .26s cubic-bezier(.2,.8,.2,1); }
  .m8Scherm { position: fixed; inset: 0; z-index: 1000; background: rgba(15,23,42,.42); }
  .m8ZijKop { padding-bottom: 10px; }
  .m8Merk img { height: 26px; }
  /* In het paneel is er ruimte genoeg: groepen hoeven niet dicht, en vingers willen grotere regels. */
  .m8NavItem, .m8NavGroep > summary, .m8Schakel { min-height: 46px; }
  .m8NavSub { min-height: 42px; font-size: 15px; }
  .m8NavItem.is-actief, .m8NavSub.is-actief { background: var(--m8EigenZacht); box-shadow: none; }
  /* De eigen naam staat vast onderaan het paneel, vlak boven de knop waarmee je het sluit.
     Hij krimpt niet mee (flex:0 0 auto), dus openklappen gaat ten koste van het rolvak erboven
     en blijft dus IN beeld -- het ging eerst onder de onderrand door, zodat je moest scrollen
     en dacht dat er niets gebeurde. Is de lijst zelf te lang, dan rolt die lijst. */
  .m8Ik { margin-top: 10px; flex: 0 0 auto; }
  .m8Ik .m8NavSubs { max-height: 42vh; max-height: 42dvh; overflow-y: auto; overscroll-behavior: contain; }
}

@media (prefers-reduced-motion: reduce) {
  .m8Zijbalk, .m8Knop, .m8Knop::after, .m8NavGroep > summary > .m8Ico:last-child { transition: none !important; }
}

@media print {
  .m8Zijbalk, .m8Tabbalk, .m8Scherm, .m8StatusRij, .m8footer, .m8Toasts, .m8Overslaan { display: none !important; }
  .m8Hoofd { margin: 0 !important; padding: 0 !important; }
  .m8Inhoud { border: 0 !important; box-shadow: none !important; padding: 0 !important; }
}
