/* De web-versie (lite.html): geen bureaublad maar een startscherm met tegels, en elke app schermvullend. Werkt ook op
   een telefoon. Bovenop style.css: de apps zelf houden hun opmaak, hier staat alleen wat anders moet. */

html.lite, html.lite body { height: auto; min-height: 100%; overflow: auto; }
/* De gloed van het bureaublad blijft staan bij scrollen, in plaats van zich te herhalen */
html.lite body { min-height: 100dvh; background-attachment: fixed; }

/* Op slot tot iemand inlogt (zie style.css voor het inlogscherm zelf) */
html[data-vergrendeld] #lite-kop, html[data-vergrendeld] #lite-home, html[data-vergrendeld] #lite-apps { display: none; }
.lite-login-logo { height: 34px; margin-bottom: 18px; }
@media (max-width: 600px) {
  #login-scherm { justify-content: flex-start; gap: 28px; padding: 6vh 12px 24px; min-height: 100dvh; position: absolute; }
  .login-tijd { font-size: 48px; }
  .login-namen { padding: 8px; gap: 2px; border-radius: 18px; }
  .login-tegel { width: 86px; padding: 12px 4px; }
  .login-avatar { width: 48px; height: 48px; font-size: 17px; }
  .login-ww-kaart { width: min(340px, 100%); }
}

/* ---------- Kop ---------- */

#lite-kop {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 8px;
  min-height: 56px;
  padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  color: #fff;
  /* Als de menubalk van de helpdesk-pc */
  background: rgba(29, 29, 27, .86);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
#lite-kop h1 { margin: 0; overflow: hidden; font-size: 17px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.lite-kop-logo { height: 22px; }
body.in-app .lite-kop-logo { display: none; }
.lite-kop-knop {
  display: flex; align-items: center; gap: 8px;
  min-width: 40px; height: 40px; padding: 0 8px;
  color: #fff; background: none; border: 0; border-radius: 10px;
}
.lite-kop-knop:hover { background: rgba(255, 255, 255, .12); }
.lite-kop-knop[hidden] { display: none; }
.lite-kop-knop .ico { width: 20px; height: 20px; }
#lite-sessie .ico { opacity: .6; width: 18px; height: 18px; }
#lite-sessie .badge { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; padding: 2px 10px; font-size: 13px; }
.lite-pill { display: flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; font-size: 12px; font-weight: 800; color: var(--zwart); background: var(--geel); border: 0; border-radius: 99px; }
.lite-pill[hidden] { display: none; }

/* ---------- Startscherm ---------- */

#lite-home {
  display: flex; flex-direction: column; gap: 14px;
  max-width: 980px; margin: 0 auto;
  padding: 22px max(16px, env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
body.in-app #lite-home { display: none; }
.lite-nu h2 { margin: 0; font-size: 24px; }
.lite-nu .hint { margin: 4px 0 0; font-size: 14px; }
.lite-kopje { margin: 10px 0 0; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--tekst2); }
.lite-kopje small { margin-left: 6px; font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; }

.lite-tegels { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
@media (max-width: 420px) { .lite-tegels { grid-template-columns: 1fr 1fr; gap: 10px; } }
/* Tegels en de inklok-kaart liggen op het bureaublad zoals de widget op de helpdesk-pc */
.lite-tegel {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 18px;
  min-height: 116px; padding: 16px;
  font: inherit; text-align: left; text-decoration: none; color: var(--tekst);
  background: var(--menu-bg);
  border: 0; border-radius: 18px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .08), 0 0 0 1px rgba(255, 255, 255, .3) inset;
  transition: transform .08s, box-shadow .15s;
}
:root[data-theme="dark"] .lite-tegel { box-shadow: 0 6px 18px rgba(0, 0, 0, .3), 0 0 0 1px rgba(255, 255, 255, .06) inset; }
.lite-tegel:hover { box-shadow: 0 12px 30px rgba(0, 0, 0, .14), 0 0 0 1px rgba(255, 255, 255, .3) inset; }
:root[data-theme="dark"] .lite-tegel:hover { box-shadow: 0 12px 30px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .1) inset; }
.lite-tegel:active { transform: scale(.97); }
.lite-tegel b { font-size: 15px; line-height: 1.25; }
.lite-tegel small { margin-top: -14px; font-size: 12px; color: var(--tekst2); }
.lite-tegel.uit { opacity: .55; box-shadow: 0 0 0 1px var(--lijn); }

/* Websites: een duidelijk label "Extern" en het adres, zodat je weet dat je de helpdesk verlaat */
.lite-domein { overflow: hidden; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; }
.lite-extern {
  position: absolute; top: 12px; right: 12px;
  display: flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px;
  font-size: 11px; font-weight: 800; letter-spacing: .02em; color: var(--tekst);
  background: var(--zacht-bg); border-radius: 99px;
}
.lite-extern .ico { width: 13px; height: 13px; }
.lite-tegel-extern:hover .lite-extern { color: var(--zwart); background: var(--geel); }
.lite-tegel-ico {
  display: grid; place-items: center;
  width: 46px; height: 46px;
  color: #fff; border-radius: 13px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .14);
}
.lite-tegel-ico .ico { width: 24px; height: 24px; }
.lite-beheer[hidden] { display: none; }
.lite-beheer { display: flex; flex-direction: column; gap: 14px; }

/* Widgets (lite-rooster.js): op het bureaublad zwevend, hier gewoon kaarten onder elkaar */
.widget.lite-widget {
  position: static;
  width: auto; max-height: none;
  opacity: 1; transform: none; visibility: visible; pointer-events: auto;
}
.lite-widget .ik { gap: 12px; padding: 16px 16px 14px; }
/* Geen barcodescanner aan een browser */
.lite .ul .klok-scan { display: none !important; }

/* Rooster van vandaag: per uur de tijd en wie er zit; het uur van nu geel, wat voorbij is vaag */
.rw-kop { display: flex; align-items: center; gap: 8px; }
.rw-kop h2 { flex: 1; min-width: 0; }
.rw-kop .btn .ico { width: 14px; height: 14px; }
.rw-uren { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.rw-uur {
  display: grid; grid-template-columns: 150px 1fr auto; align-items: center; gap: 10px;
  min-height: 40px; padding: 6px 10px;
  border-radius: 10px;
}
.rw-uur.nu { background: var(--open); }
.rw-uur.voorbij { opacity: .45; }
.rw-tijd { display: flex; flex-direction: column; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--tekst2); }
.rw-tijd b { font-size: 14px; color: var(--tekst); }
.rw-nu { padding: 1px 9px; font-size: 12px; font-weight: 800; color: var(--zwart); background: var(--geel); border-radius: 99px; }
@media (max-width: 420px) { .rw-uur { grid-template-columns: 96px 1fr auto; } }

.lite-widget .hint { margin: 0; }
.rw-knoppen { display: flex; flex-wrap: wrap; gap: 8px; }

.lite-voorkeuren { margin-top: 10px; }
.lite-voorkeur-knoppen { display: flex; flex-wrap: wrap; gap: 8px; }
.lite-voorkeur-knoppen .btn[hidden] { display: none; }

/* ---------- Een app ---------- */

#lite-apps { display: none; }
body.in-app #lite-apps { display: block; }
.lite-app[hidden] { display: none; }
.lite-inhoud {
  --rand: 0px;
  max-width: 1280px; min-height: calc(100dvh - 57px - 2 * var(--rand)); margin: var(--rand) auto;
  background: var(--oppervlak);
}
/* Op een groot scherm ligt de app als een venster op het bureaublad, zoals op de helpdesk-pc */
@media (min-width: 900px) {
  .lite-inhoud {
    --rand: 16px;
    width: calc(100% - 2 * var(--rand));
    /* clip, niet hidden: dan blijft position: sticky in de apps werken */
    overflow: clip;
    border-radius: var(--radius);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .16), 0 0 0 1px var(--lijn);
  }
  :root[data-theme="dark"] .lite-inhoud { box-shadow: 0 20px 50px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .06); }
}
/* Bestanden heeft zijn eigen scrollende lijst en voorbeeld: precies zo hoog als het scherm */
.lite-app[data-app="bestanden"] .lite-inhoud { height: calc(100dvh - 57px - 2 * var(--rand)); }
.lite-app[data-app="instellingen"] .lite-inhoud, .lite-app[data-app="uren"] .lite-inhoud { background: var(--grijs); }

/* Panelen: altijd over het hele scherm, en op een telefoon van onderen */
.lite .sheet-backdrop { position: fixed; }
@media (max-width: 600px) {
  .lite .sheet-backdrop { align-items: flex-end; }
  .lite .sheet {
    width: 100%; max-height: 88dvh;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0;
  }
  #toasts { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); align-items: stretch; }
  .toast { max-width: none; }
}

/* ---------- De apps op een smal scherm ---------- */

@media (max-width: 760px) {
  .row2, .row3 { grid-template-columns: 1fr; gap: 0; }
  .qt, .ul, .rooster, .uren, .settings { padding: 16px 12px; }
  .qt-types { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .ul-kop { flex-wrap: wrap; }
  .ul-blok { grid-template-columns: 1fr auto; }
  .ul-blok .ul-namen { grid-column: 1 / -1; }
  .r-head { flex-wrap: wrap; }
  /* Het rooster is een brede tabel: zijwaarts schuiven in plaats van alles onleesbaar klein */
  .r-tabel { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .r-tabel .schedule-table { min-width: 720px; }
  .team-list li { flex-wrap: wrap; }
  .inline-form { flex-wrap: wrap; }
  .uren table { display: block; overflow-x: auto; }

  /* Bestanden: de lijst boven, het voorbeeld eronder (of de lijst alleen, tot je iets kiest) */
  .lite-app[data-app="bestanden"] .lite-inhoud { height: auto; }
  .bv { flex-direction: column; height: auto; }
  .bv-lijstkant { width: auto; border-right: 0; border-bottom: 1px solid var(--lijn); }
  .bv-lijst { max-height: 45dvh; }
  .bv-voorbeeld { min-height: 70dvh; }
  .bv-info { flex-wrap: wrap; }
  .bv-knoppen { justify-content: flex-start; margin-left: 0; }
  .bv-bewerk-rij { flex-direction: column; gap: 0; }
  .ib-vel { padding: 12px 8px 24px; }
}

/* Bestanden: alleen Instructies (geen plekken-kolom), en kiezen van een eigen bestand */
.bv-plekken[hidden] { display: none; }
.bv-toe-kies { align-self: flex-start; cursor: pointer; }
