/* Parkhotel OS — gedeeld designsysteem (Apple-designtaal).
   Tokens 1-op-1 overgenomen uit creator-pipeline en ota-dashboard. Light-only, geen dark mode.
   Modulespecifieke opmaak staat in public/modules/<naam>.css — niet hier. */
:root {
  --tint: #C89B4F; --tint-deep: #A87F3B; --tint-soft: rgba(200,155,79,.13);
  --green: #357358; --green-soft: rgba(53,115,88,.12);
  --red: #D0342C; --red-soft: rgba(208,52,44,.1);
  --orange: #C77B22; --orange-soft: rgba(199,123,34,.12);
  --ink: #1D1D1F; --ink-2: #6E6E73; --ink-3: #AEAEB2;
  --canvas: #F5F5F7; --surface: #FFFFFF; --well: rgba(0,0,0,.035);
  --line: rgba(0,0,0,.08); --line-soft: rgba(0,0,0,.05);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
  --shadow-md: 0 2px 6px rgba(0,0,0,.06), 0 10px 28px rgba(0,0,0,.09);
  --shadow-lg: 0 8px 20px rgba(0,0,0,.1), 0 28px 70px rgba(0,0,0,.18);
  --ease: cubic-bezier(.32,.72,0,1);
  --r-card: 14px; --r-input: 10px;
  --topbar-h: 54px; --zijbalk-b: 216px;

  /* aliassen: deze namen worden inline vanuit de JS gebruikt, niet hernoemen */
  --inkt: var(--ink); --grijs: var(--ink-2); --lijn: var(--line);
  --rood: var(--red); --oranje: var(--orange); --groen: var(--green);
  --parkhotel: var(--tint-deep); --asteria: #B05B3E;
}

/* De OTA-module zet data-merk op de body; het accent wisselt mee met het hotel. */
body[data-merk="asteria"] {
  --tint: #C76E4E; --tint-deep: #A0512F; --tint-soft: rgba(199,110,78,.13);
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -.022em; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--tint-soft); }
.hidden { display: none !important; }

/* ---------- formulieren ---------- */
/* Checkboxes en radios blijven buiten schot: die worden door de modules zelf
   vormgegeven (.schuif in ota, .switch in creators). */
input:not([type=checkbox]):not([type=radio]), select, textarea {
  font-family: inherit; font-size: 14px; color: var(--ink);
  padding: 9px 12px; width: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-input);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
  appearance: none; -webkit-appearance: none;
}
select {
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%236E6E73' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  padding-right: 32px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--tint); box-shadow: 0 0 0 3.5px var(--tint-soft);
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }
textarea { resize: vertical; line-height: 1.45; }
label {
  display: block; font-size: 12px; font-weight: 600; color: var(--ink-2);
  margin: 14px 0 5px; letter-spacing: -.01em;
}

/* ---------- topbar ---------- */
header.top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  padding: 0 22px; height: var(--topbar-h);
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
}
header.top .brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
header.top .brand img { height: 17px; filter: invert(1) opacity(.88); display: block; flex: none; }
header.top .brand #module-titel {
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  border-left: 1px solid var(--line); padding-left: 12px; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
header.top .rechts { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* iOS-segmented control voor de tabs binnen een module */
.seg { display: flex; background: rgba(0,0,0,.055); border-radius: 9px; padding: 2px; flex: none; }
.seg:empty { display: none; }
.seg button {
  border: none; background: transparent; color: var(--ink);
  font-size: 13px; font-weight: 500; padding: 5px 16px; border-radius: 7px; white-space: nowrap;
  transition: background .18s var(--ease), box-shadow .18s var(--ease), color .18s var(--ease);
}
.seg button:hover { background: rgba(0,0,0,.04); }
.seg button.active { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; }

#menu-knop { display: none; }

/* ---------- knoppen ---------- */
.ic { flex: none; }
.badge .ic, .datum-knop .ic { vertical-align: -2px; }

.knop {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
  background: rgba(0,0,0,.06); color: var(--ink); border: none; text-decoration: none;
  font-size: 13px; font-weight: 600; letter-spacing: -.01em;
  padding: 8px 18px; border-radius: 980px;
  transition: transform .15s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease);
}
.knop:hover { background: rgba(0,0,0,.1); }
.knop:active { transform: scale(.97); }
.knop.primair { background: var(--tint); color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.knop.primair:hover { background: var(--tint-deep); }
.knop.klein { padding: 6px 14px; font-size: 12px; }
.knop.gevaar { background: none; color: var(--red); box-shadow: none; }
.knop.gevaar:hover { background: var(--red-soft); }
.knop.tekst { background: none; color: var(--ink-2); font-weight: 500; padding: 6px 8px; }
.knop.tekst:hover { background: none; color: var(--ink); }
.knop.breed { width: 100%; }

.icoon-knop {
  border: none; background: none; cursor: pointer; font-size: 12px; line-height: 1;
  width: 26px; height: 26px; padding: 0; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-2); border-radius: 50%;
  transition: transform .15s var(--ease), background .15s var(--ease), color .15s var(--ease);
}
.icoon-knop:hover { background: rgba(0,0,0,.06); color: var(--ink); }
.icoon-knop:active { transform: scale(.9); }
.icoon-knop.gevaar:hover { background: var(--red-soft); color: var(--red); }

/* ---------- shell: zijbalk + paneel ---------- */
.os-indeling { display: flex; align-items: flex-start; position: relative; }
/* De zijbalk is sticky en dus schermhoog; deze lijn loopt wel door tot onderaan de pagina. */
.os-indeling::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: var(--zijbalk-b);
  width: 1px; background: var(--line-soft); pointer-events: none;
}

#zijbalk {
  position: sticky; top: var(--topbar-h); z-index: 30;
  width: var(--zijbalk-b); flex: none;
  height: calc(100vh - var(--topbar-h));
  padding: 16px 12px; overflow-y: auto;
}
#module-lijst { display: flex; flex-direction: column; gap: 2px; }
#module-lijst .kop {
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3);
  font-weight: 600; padding: 4px 10px 6px;
}
.mod-knop {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: none; background: none; color: var(--ink);
  font-size: 13.5px; font-weight: 500; letter-spacing: -.01em;
  padding: 8px 10px; border-radius: 10px;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.mod-knop .ic { color: var(--ink-2); transition: color .16s var(--ease); }
.mod-knop:hover { background: rgba(0,0,0,.045); }
.mod-knop.actief { background: var(--tint-soft); color: var(--tint-deep); font-weight: 600; }
.mod-knop.actief .ic { color: var(--tint-deep); }

#zijbalk-overlay { display: none; }

#paneel { flex: 1; min-width: 0; padding: 26px 22px 60px; }

/* ---------- stat-tegels (gedeeld door meerdere modules) ---------- */
.stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.stat {
  background: var(--surface); border-radius: var(--r-card); padding: 12px 18px 11px; min-width: 118px;
  box-shadow: var(--shadow-sm);
}
.stat b { font-size: 22px; font-weight: 700; letter-spacing: -.02em; display: block; line-height: 1.25; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11px; font-weight: 600; color: var(--ink-2); letter-spacing: .02em; text-transform: uppercase; }

/* ---------- dialogen ---------- */
dialog {
  border: none; border-radius: 18px; padding: 0; max-width: 440px; width: 92vw;
  box-shadow: var(--shadow-lg); color: var(--ink);
}
dialog::backdrop { background: rgba(20,20,20,.32); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
dialog form { padding: 24px 26px 22px; }
dialog h3 { margin: 0 0 6px; font-size: 18px; letter-spacing: -.02em; }
dialog textarea { min-height: 76px; }
dialog .acties { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ---------- login ---------- */
/* LET OP: #login krijgt display:flex, dus het HTML-attribuut `hidden` werkt alleen
   dankzij de regel hieronder. Niet verwijderen — anders blijft de overlay staan. */
#login {
  position: fixed; inset: 0; background: var(--canvas);
  display: flex; align-items: center; justify-content: center; z-index: 60; padding: 20px;
}
#login[hidden], #app[hidden] { display: none; }
#login form {
  background: var(--surface); border-radius: 20px; padding: 36px 34px 30px; width: 340px; max-width: 100%;
  box-shadow: var(--shadow-md); text-align: center;
  animation: rise .45s var(--ease);
}
#login .login-logo { height: 20px; filter: invert(1) opacity(.9); display: block; margin: 0 auto 14px; }
#login h2 { margin: 0 0 4px; font-size: 21px; letter-spacing: -.026em; }
#login p.sub { font-size: 13px; color: var(--ink-2); margin: 0 0 20px; }
#login input { text-align: center; font-size: 15px; padding: 11px 12px; border-radius: 12px; }
#login .fout { color: var(--red); font-size: 12px; min-height: 18px; margin: 8px 0 4px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: rgba(29,29,31,.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  color: #fff; padding: 11px 20px; font-size: 13px; font-weight: 500; border-radius: 980px;
  display: flex; gap: 14px; align-items: center; z-index: 99;
  box-shadow: var(--shadow-lg);
  animation: toastup .4s var(--ease);
}
@keyframes toastup { from { transform: translate(-50%, 16px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.toast button { background: var(--tint); border: none; color: #fff; padding: 5px 14px; font-size: 12px; font-weight: 600; border-radius: 980px; }

/* ---------- klein grut ---------- */
.leeg { color: var(--ink-2); font-size: 13px; padding: 6px 0; margin: 0; }
.mini { font-size: 12px; color: var(--ink-2); }
p.mini.strak { margin-top: 0; }
a.terug {
  color: var(--ink-2); text-decoration: none; font-size: 13px; font-weight: 500;
  display: inline-block; margin-bottom: 14px;
}
a.terug:hover { color: var(--ink); }

/* ---------- smal scherm: zijbalk wordt uitschuifpaneel ---------- */
@media (max-width: 900px) {
  /* de topbar moet op één regel passen: logo weg, tabs mogen horizontaal scrollen */
  header.top { gap: 10px; padding: 0 12px; }
  #menu-knop { display: inline-flex; }
  .os-indeling::before { display: none; }
  header.top .brand img { display: none; }
  header.top .brand #module-titel { border-left: none; padding-left: 0; }
  #tabs { min-width: 0; overflow-x: auto; scrollbar-width: none; }
  #tabs::-webkit-scrollbar { display: none; }
  #zijbalk {
    position: fixed; left: 0; top: var(--topbar-h); bottom: 0; height: auto;
    background: var(--surface); box-shadow: var(--shadow-md);
    transform: translateX(-100%); transition: transform .25s var(--ease);
  }
  #zijbalk.open { transform: none; }
  #zijbalk-overlay {
    display: block; position: fixed; inset: var(--topbar-h) 0 0; z-index: 29;
    background: rgba(20,20,20,.32); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  }
  #zijbalk-overlay[hidden] { display: none; }
  #paneel { padding: 18px 14px 48px; }
}
@media (max-width: 640px) {
  /* op telefoonbreedte zegt de zijbalk al in welke module je zit */
  header.top .brand { display: none; }
  header.top .seg button { padding: 5px 12px; }
  header.top .knop.tekst { padding: 6px 2px; }
  #zijbalk { width: min(var(--zijbalk-b), 82vw); }
}
