/* Scouting Lambertus Reuver — huisstijl afgeleid van het logo:
   bosgroen, zand en oranje. */
:root {
  --green-950: #142A1E;
  --green-900: #1C3828;
  --green-800: #244A34;
  --green-700: #2F5D41;
  --green-600: #3A6B4C;
  --green-100: #E3EDE5;
  --green-50:  #F1F6F2;
  --sand-400:  #EEC48A;
  --sand-200:  #F6E2C4;
  --sand-50:   #FBF6EC;
  --orange-600:#C9581F;
  --orange-100:#FBE6DA;

  --bg: #F6F2E9;
  --surface: #FFFFFF;
  --surface-2: #FBF8F2;
  --ink: #1B2420;
  --ink-2: #4E5A53;
  --muted: #7A857E;
  --line: #E6E0D3;
  --focus: #C9581F;
  --danger: #B3261E;
  --danger-bg: #FCE8E6;
  --ok: #2F7A45;
  --ok-bg: #E2F2E6;
  --warn: #9A6200;
  --warn-bg: #FDF0D5;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgb(20 42 30 / .06), 0 4px 14px rgb(20 42 30 / .06);
  --shadow-lg: 0 10px 40px rgb(20 42 30 / .18);
  --font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --sidebar: 252px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101814;
    --surface: #17221C;
    --surface-2: #1C2A22;
    --ink: #E9EFEA;
    --ink-2: #B9C6BD;
    --muted: #8B998F;
    --line: #2A3A31;
    --green-100: #21382B;
    --green-50: #1A2B21;
    --sand-50: #1E241F;
    --orange-100: #3A2418;
    --danger-bg: #3B1C1A;
    --ok-bg: #1C3324;
    --warn-bg: #3A2C12;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 4px 14px rgb(0 0 0 / .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101814; --surface: #17221C; --surface-2: #1C2A22; --ink: #E9EFEA; --ink-2: #B9C6BD;
  --muted: #8B998F; --line: #2A3A31; --green-100: #21382B; --green-50: #1A2B21; --sand-50: #1E241F;
  --orange-100: #3A2418; --danger-bg: #3B1C1A; --ok-bg: #1C3324; --warn-bg: #3A2C12;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 4px 14px rgb(0 0 0 / .25);
  color-scheme: dark;
}

/* Leesbare groene tekst in donkere modus */
:root { --green-text: var(--green-600); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --green-text: #8CC8A0; } }
:root[data-theme="dark"] { --green-text: #8CC8A0; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 1.65rem; font-weight: 700; }
h2 { font-size: 1.15rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0; }
a { color: var(--green-text); }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.svg-i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Shell ---------- */
.shell { min-height: 100dvh; display: grid; grid-template-columns: var(--sidebar) 1fr; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 4px;
  background: linear-gradient(180deg, var(--green-800), var(--green-950));
  color: #E6EFE8; padding: 20px 14px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 20px; color: inherit; text-decoration: none; }
.brand img { width: 44px; height: auto; filter: drop-shadow(0 2px 6px rgb(0 0 0 / .3)); }
.brand b { display: block; font-size: 1.02rem; letter-spacing: .01em; white-space: nowrap; }
.brand span { display: block; font-size: .78rem; color: var(--sand-400); letter-spacing: .08em; text-transform: uppercase; }
.nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: rgb(230 239 232 / .5); padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: rgb(230 239 232 / .85); text-decoration: none; font-weight: 500;
}
.nav a:hover { background: rgb(255 255 255 / .07); color: #fff; }
.nav a.active { background: rgb(238 196 138 / .16); color: var(--sand-400); }
.nav a .count { margin-left: auto; background: var(--orange-600); color: #fff; font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.nav .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; margin: 0 5px; }
.sidebar-foot { margin-top: auto; border-top: 1px solid rgb(255 255 255 / .1); padding: 14px 8px 0; display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--sand-400); color: var(--green-900); display: grid; place-items: center; font-weight: 700; flex: none; font-size: .85rem; }
.sidebar-foot .who { min-width: 0; flex: 1; }
.sidebar-foot .who b { display: block; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot .who span { display: block; font-size: .75rem; color: rgb(230 239 232 / .6); }
.icon-btn { background: transparent; border: 0; color: inherit; padding: 8px; border-radius: 9px; cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn:hover { background: rgb(127 127 127 / .14); }

.main { min-width: 0; padding: 28px clamp(16px, 3vw, 40px) 60px; max-width: 1280px; width: 100%; }
.topbar, .bottomnav { display: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .sub { color: var(--ink-2); margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-size: .85rem; margin-bottom: 6px; }
.crumb:hover { color: var(--green-text); }

/* ---------- Componenten ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px;
  padding: 8px 16px; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  font: inherit; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn .svg-i { width: 18px; height: 18px; }
.btn-primary { background: var(--green-700); color: #fff; }
.btn-primary:hover { background: var(--green-800); }
.btn-accent { background: var(--orange-600); color: #fff; }
.btn-accent:hover { background: #B04B18; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--green-600); color: var(--green-700); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-sm { min-height: 32px; padding: 4px 11px; font-size: .85rem; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head a { font-size: .85rem; font-weight: 600; text-decoration: none; }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.stack { display: grid; gap: 16px; }

.stat { padding: 18px 20px; display: flex; gap: 14px; align-items: center; }
.stat .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--green-100); color: var(--green-700); flex: none; }
.stat .ic.orange { background: var(--orange-100); color: var(--orange-600); }
.stat .ic.sand { background: var(--sand-200); color: #8A5A12; }
.stat b { font-size: 1.6rem; line-height: 1.1; display: block; font-variant-numeric: tabular-nums; }
.stat span { color: var(--ink-2); font-size: .85rem; }

.hero {
  position: relative; overflow: hidden; border-radius: 18px; padding: 26px 28px; margin-bottom: 20px;
  background: radial-gradient(120% 140% at 100% 0%, var(--green-600) 0%, var(--green-800) 55%, var(--green-950) 100%);
  color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.hero h1 { color: #fff; }
.hero p { color: rgb(255 255 255 / .8); margin-top: 6px; max-width: 52ch; }
.hero .hero-logo { width: 110px; opacity: .95; filter: drop-shadow(0 6px 18px rgb(0 0 0 / .35)); }
.hero .actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.hero .btn-ghost { background: rgb(255 255 255 / .12); border-color: rgb(255 255 255 / .25); color: #fff; }
.hero .btn-ghost:hover { background: rgb(255 255 255 / .2); }
.hero::after { content: ""; position: absolute; right: -60px; bottom: -80px; width: 260px; height: 260px; border-radius: 50%; border: 36px solid rgb(238 196 138 / .08); }

.speltak-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.speltak-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px; text-decoration: none; color: inherit;
  overflow: hidden; transition: transform .15s, box-shadow .15s;
}
.speltak-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--c); }
.speltak-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.speltak-card .badge-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--c); font-size: .95rem; letter-spacing: .02em; }
.speltak-card .meta { color: var(--ink-2); font-size: .85rem; }
.speltak-card .num { margin-top: auto; display: flex; align-items: baseline; gap: 6px; }
.speltak-card .num b { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.speltak-card .num span { color: var(--muted); font-size: .85rem; }
.speltak-card.locked { opacity: .55; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 14px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .date-chip, .next-opkomst .date-chip { width: 48px; flex: none; text-align: center; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); padding: 4px 0; }
.list .date-chip b, .next-opkomst .date-chip b { display: block; font-size: 1.1rem; line-height: 1.1; }
.list .date-chip span, .next-opkomst .date-chip span { display: block; font-size: .68rem; text-transform: uppercase; color: var(--muted); letter-spacing: .06em; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; }
.list .sub { color: var(--ink-2); font-size: .85rem; }
.empty { padding: 28px 20px; text-align: center; color: var(--muted); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: .75rem; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.chip .d { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--muted)); }
.chip.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.chip.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.chip.danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.chip.new { background: var(--orange-100); color: var(--orange-600); border-color: transparent; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.search { position: relative; flex: 1; min-width: 200px; }
.search .svg-i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.search input { padding-left: 38px; }

/* Tabellen */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: var(--green-50); }
.person { display: flex; align-items: center; gap: 10px; }
.person .avatar { width: 32px; height: 32px; font-size: .78rem; background: var(--green-100); color: var(--green-700); }
.person b { display: block; font-weight: 600; }
.person span { font-size: .8rem; color: var(--muted); }
.hide-sm { }

/* Formulieren */
label.field { display: grid; gap: 5px; font-size: .85rem; font-weight: 600; color: var(--ink-2); }
label.field small { font-weight: 400; color: var(--muted); }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 12px; min-height: 40px;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green-600); box-shadow: 0 0 0 3px rgb(58 107 76 / .18); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section { grid-column: 1 / -1; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--green-text); font-weight: 700; margin-top: 8px; padding-top: 12px; border-top: 1px dashed var(--line); }
.form-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--ink); font-weight: 400; cursor: pointer; }
.check input { width: 18px; height: 18px; min-height: 0; margin-top: 2px; accent-color: var(--green-600); flex: none; }
.hint { font-size: .82rem; color: var(--ink-2); background: var(--sand-50); border: 1px solid var(--sand-200); padding: 10px 12px; border-radius: 10px; }
.hint.warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); }

.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented button { border: 0; background: transparent; font: inherit; font-weight: 600; font-size: .85rem; color: var(--ink-2); padding: 6px 14px; border-radius: 8px; cursor: pointer; }
.segmented button.on { background: var(--surface); color: var(--green-text); box-shadow: var(--shadow); }

/* Dialog */
dialog#modal {
  border: 0; padding: 0; border-radius: 18px; width: min(680px, calc(100vw - 24px)); max-height: calc(100dvh - 32px);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg);
}
dialog#modal::backdrop { background: rgb(14 28 20 / .5); backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--surface); flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--green-900); color: #fff; padding: 10px 18px; border-radius: 12px; box-shadow: var(--shadow-lg);
  transition: opacity .2s, transform .2s; z-index: 100; font-weight: 500; max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Kalender ---------- */
.cal-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cal-head h2 { min-width: 170px; text-transform: capitalize; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px; border-top: 1px solid var(--line); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 10px; font-weight: 600; border-bottom: 1px solid var(--line); }
.cal-day {
  min-height: 112px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; cursor: pointer;
  display: flex; flex-direction: column; gap: 3px; min-width: 0; background: var(--surface);
}
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day:hover { background: var(--green-50); }
.cal-day.other { background: var(--surface-2); color: var(--muted); }
.cal-day.weekend { background: color-mix(in srgb, var(--sand-50) 70%, var(--surface)); }
.cal-day.blocked { background-image: repeating-linear-gradient(135deg, rgb(201 88 31 / .09) 0 6px, transparent 6px 12px); }
.cal-day .n { font-size: .82rem; font-weight: 600; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .n { background: var(--orange-600); color: #fff; }
.ev {
  font-size: .74rem; font-weight: 600; padding: 2px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: color-mix(in srgb, var(--c) 16%, var(--surface)); color: color-mix(in srgb, var(--c) 75%, var(--ink)); border-left: 3px solid var(--c);
}
.ev-more { font-size: .72rem; color: var(--muted); padding-left: 4px; }
.lock-tag { font-size: .66rem; font-weight: 700; color: var(--orange-600); text-transform: uppercase; letter-spacing: .05em; }

.year-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; padding: 16px; }
.mini { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--surface); cursor: pointer; }
.mini:hover { border-color: var(--green-600); }
.mini h3 { font-size: .9rem; text-transform: capitalize; margin-bottom: 6px; }
.mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.mini-grid span { font-size: .68rem; text-align: center; aspect-ratio: 1; display: grid; place-items: center; border-radius: 5px; color: var(--ink-2); position: relative; }
.mini-grid span.dow { color: var(--muted); font-weight: 600; aspect-ratio: auto; }
.mini-grid span.has { background: color-mix(in srgb, var(--c) 22%, var(--surface)); color: var(--ink); font-weight: 700; }
.mini-grid span.blocked { background-image: repeating-linear-gradient(135deg, rgb(201 88 31 / .35) 0 3px, transparent 3px 6px); color: var(--ink); font-weight: 700; }
.mini-grid span.today { outline: 2px solid var(--orange-600); }

/* ---------- Publiek inschrijfformulier ---------- */
.public { min-height: 100dvh; background: var(--bg); }
.public-hero {
  background: radial-gradient(120% 140% at 100% 0%, var(--green-600) 0%, var(--green-800) 55%, var(--green-950) 100%);
  color: #fff; padding: 36px 20px 90px; text-align: center;
}
.public-hero img { width: 92px; margin: 0 auto 14px; filter: drop-shadow(0 6px 18px rgb(0 0 0 / .35)); }
.public-hero h1 { color: #fff; font-size: clamp(1.5rem, 4vw, 2.1rem); }
.public-hero p { color: rgb(255 255 255 / .8); margin-top: 8px; }
.public-card { max-width: 760px; margin: -60px auto 40px; padding: 0 16px; }
.public-card .card { padding: 24px; }
.dropzone {
  border: 2px dashed var(--line); border-radius: 14px; padding: 30px 20px; text-align: center; cursor: pointer; background: var(--surface-2);
  display: grid; gap: 8px; place-items: center; color: var(--ink-2);
}
.dropzone.drag, .dropzone:hover { border-color: var(--green-600); background: var(--green-50); }
.dropzone .svg-i { width: 32px; height: 32px; color: var(--green-600); }
.thanks { text-align: center; padding: 30px 10px; display: grid; gap: 10px; place-items: center; }
.thanks .big { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; }
.thanks .big .svg-i { width: 32px; height: 32px; }

.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: radial-gradient(120% 120% at 100% 0%, var(--green-600), var(--green-950)); }
.login { width: min(440px, 100%); padding: 30px; text-align: center; }
.login img { width: 96px; margin: 0 auto 12px; }
.login .roles { display: grid; gap: 8px; margin-top: 20px; text-align: left; }
.role-btn { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; font: inherit; color: var(--ink); text-align: left; }
.role-btn:hover { border-color: var(--green-600); background: var(--green-50); }
.role-btn b { display: block; }
.role-btn span { font-size: .82rem; color: var(--muted); }

.preview-file { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.preview-file img { max-height: 420px; margin: 0 auto; }
.preview-file iframe { width: 100%; height: 420px; border: 0; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 14px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.share-box { display: flex; gap: 8px; }
.share-box input { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .topbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--green-800); color: #fff;
  }
  .topbar img { width: 32px; }
  .topbar b { flex: 1; font-size: 1rem; }
  .main { padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }
  .bottomnav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0 0; z-index: 20;
    background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottomnav a { display: grid; justify-items: center; gap: 2px; font-size: .68rem; font-weight: 600; color: var(--muted); text-decoration: none; padding: 4px 0; position: relative; }
  .bottomnav a.active { color: var(--green-text); }
  .bottomnav a .count { position: absolute; top: 0; right: calc(50% - 20px); background: var(--orange-600); color: #fff; font-size: .62rem; padding: 0 5px; border-radius: 99px; }
  .hero { padding: 22px 20px; }
  .hero .hero-logo { display: none; }
  .hide-sm { display: none; }
  .cal-day { min-height: 64px; padding: 4px; }
  .cal-day .ev { font-size: 0; padding: 0; height: 6px; border-left: 0; background: var(--c); border-radius: 3px; }
  .cal-day .lock-tag, .ev-more { display: none; }
  .cal-dow { padding: 6px 4px; text-align: center; }
  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dd { margin-bottom: 8px; }
}
@media (max-width: 560px) {
  .grid-4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .stat { padding: 14px; flex-direction: column; align-items: flex-start; gap: 8px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  h1 { font-size: 1.4rem; }
}

/* Afdrukken: het lege inschrijfformulier netjes op papier */
@media print {
  body { background: #fff; }
  .public-hero { background: none; color: #000; padding: 0 0 10px; }
  .public-hero h1, .public-hero p { color: #000; }
  .public-card { margin: 0; max-width: none; }
  .public-card .card { box-shadow: none; border: 0; padding: 0; }
  .no-print { display: none !important; }
  input, select, textarea { border: 0; border-bottom: 1px solid #999; border-radius: 0; }
}

/* ================= Opstarten, statusbalk ================= */
.boot { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--ink-2); font-weight: 600; }
.boot img { width: 84px; animation: boot 1.4s ease-in-out infinite; }
@keyframes boot { 50% { transform: scale(.94); opacity: .7; } }
@media (prefers-reduced-motion: reduce) { .boot img { animation: none; } }
#statusbar {
  position: fixed; z-index: 90; left: 50%; top: calc(8px + env(safe-area-inset-top)); transform: translate(-50%, -150%);
  display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 24px);
  background: var(--green-900); color: #fff; padding: 8px 10px 8px 14px; border-radius: 99px; box-shadow: var(--shadow-lg);
  font-size: .85rem; font-weight: 500; transition: transform .25s;
}
#statusbar.show { transform: translate(-50%, 0); }
#statusbar .svg-i { width: 18px; height: 18px; color: var(--sand-400); }
#statusbar button { border: 0; background: var(--sand-400); color: var(--green-900); font: inherit; font-weight: 700; border-radius: 99px; padding: 4px 12px; cursor: pointer; }

/* ================= Inlogpagina ================= */
.login-links { display: grid; gap: 6px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.login-links a { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: .88rem; font-weight: 600; text-decoration: none; padding: 6px; border-radius: 8px; }
.login-links a:hover { background: var(--green-50); }
.login-links .svg-i { width: 18px; height: 18px; }

.install-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 16px; border-color: var(--sand-200); background: linear-gradient(90deg, var(--sand-50), var(--surface)); }
.install-card img { width: 44px; height: 44px; border-radius: 11px; box-shadow: var(--shadow); }
.install-card b { display: block; }
.install-card span { font-size: .85rem; color: var(--ink-2); }

/* ================= Groepspagina: tabbladen ================= */
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; text-decoration: none; color: var(--ink-2); font-weight: 600;
  border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; position: relative;
}
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--green-text); border-bottom-color: var(--orange-600); }
.tabs .svg-i { width: 18px; height: 18px; }
.tabs .count { background: var(--orange-600); color: #fff; font-size: .7rem; font-weight: 700; padding: 0 6px; border-radius: 99px; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

/* ================= Aanwezigheid ================= */
.next-opkomst { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 16px; border-left: 4px solid var(--orange-600); }
.next-opkomst .title { font-weight: 700; font-size: 1.02rem; }
.next-opkomst .sub { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.att-wrap { overflow: auto; max-height: 70vh; }
table.att { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: .88rem; }
table.att th, table.att td { padding: 4px; border-bottom: 1px solid var(--line); text-align: center; background: var(--surface); }
table.att th { text-transform: none; letter-spacing: 0; }
table.att thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); text-transform: none; letter-spacing: 0; font-size: .75rem; padding: 6px 4px; }
table.att tfoot td, table.att tfoot th { position: sticky; bottom: 0; background: var(--surface-2); font-weight: 700; color: var(--ink-2); }
table.att .att-name { position: sticky; left: 0; z-index: 1; text-align: left; padding: 6px 14px; min-width: 170px; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; color: var(--ink); font-size: .88rem; border-right: 1px solid var(--line); }
table.att thead .att-name { z-index: 3; }
table.att tbody tr { cursor: default; }
table.att tbody tr:hover th, table.att tbody tr:hover td { background: var(--green-50); }
.att-col { min-width: 46px; cursor: pointer; }
.att-col span { display: block; color: var(--muted); font-weight: 600; }
.att-col b { display: block; color: var(--ink); font-size: .8rem; }
.att-col:hover b { color: var(--green-text); text-decoration: underline; }
.att-col.is-today { box-shadow: inset 0 -3px 0 var(--orange-600); }
.att-pct { min-width: 54px; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink-2); }
.att-cell {
  width: 38px; height: 34px; border-radius: 8px; border: 1.5px dashed var(--line); background: transparent; cursor: pointer;
  font: inherit; font-weight: 800; font-size: 1rem; color: var(--ink); display: inline-grid; place-items: center; transition: transform .08s;
}
.att-cell:hover:not(:disabled) { border-color: var(--green-600); }
.att-cell:active:not(:disabled) { transform: scale(.9); }
.att-cell:disabled { cursor: default; }
.att-ok { background: #DDF1E2; border: 1.5px solid #9BD3AA; color: #1F6B36; }
.att-no { background: #FADBD8; border: 1.5px solid #EDA7A0; color: #A1251B; }
.att-af { background: #FBEBC8; border: 1.5px solid #E9C877; color: #855A00; }
.att-mini { display: inline-grid; place-items: center; width: 20px; height: 18px; border-radius: 5px; font-size: .72rem; font-weight: 800; }
:root[data-theme="dark"] .att-ok { background: #1D3B27; color: #8FD6A3; border-color: #2F6B43; }
:root[data-theme="dark"] .att-no { background: #3D1E1B; color: #F2A39B; border-color: #7A3029; }
:root[data-theme="dark"] .att-af { background: #3A2F14; color: #EBC66E; border-color: #6B5320; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .att-ok { background: #1D3B27; color: #8FD6A3; border-color: #2F6B43; }
  :root:not([data-theme="light"]) .att-no { background: #3D1E1B; color: #F2A39B; border-color: #7A3029; }
  :root:not([data-theme="light"]) .att-af { background: #3A2F14; color: #EBC66E; border-color: #6B5320; }
}

.reg-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: -6px 0 10px; flex-wrap: wrap; }
.reg-list { margin: 0 -22px; }
.reg-list li { padding: 8px 22px; }
.reg-btns { display: flex; gap: 6px; }
.reg-btns button {
  min-width: 48px; height: 44px; padding: 0 12px; border-radius: 10px; font: inherit; font-weight: 700; cursor: pointer;
}
.reg-btns button:not(.on) { background: var(--surface); border: 1.5px solid var(--line); color: var(--muted); }
.reg-btns button.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px currentColor; }
.reg-btns button:disabled { cursor: default; }

.date-picks { display: flex; flex-wrap: wrap; gap: 6px; max-height: 260px; overflow: auto; padding: 2px; }
.date-pick { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 99px; font-size: .82rem; font-weight: 600; cursor: pointer; background: var(--surface); }
.date-pick input { width: 15px; height: 15px; min-height: 0; accent-color: var(--green-600); }
.date-pick.off { background: var(--warn-bg); border-color: transparent; }
.date-pick.al { opacity: .55; cursor: default; }
.date-pick small { font-weight: 400; color: var(--ink-2); }

/* ================= Taken ================= */
.task-check { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; flex: none; color: transparent; padding: 0; }
.task-check .svg-i { width: 16px; height: 16px; stroke-width: 3; }
.task-check:hover:not(:disabled) { border-color: var(--green-600); color: var(--green-100); }
.task-check.on { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.task-check:disabled { cursor: default; }
.list .title.done { text-decoration: line-through; color: var(--muted); }
.list .sub .svg-i { width: 14px; height: 14px; vertical-align: -2px; }

/* ================= Documenten ================= */
.folder-bar { display: flex; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.folder { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font: inherit; font-size: .84rem; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.folder .svg-i { width: 16px; height: 16px; }
.folder.on { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.list li.group-head { background: var(--surface-2); font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--green-text); padding: 8px 20px; gap: 8px; }
.group-head .svg-i { width: 16px; height: 16px; }
.file-ic { width: 40px; height: 46px; border-radius: 4px 12px 4px 4px; flex: none; display: grid; place-items: end center; padding-bottom: 7px; font-size: .64rem; font-weight: 800; color: #fff; background: var(--k); letter-spacing: .02em; }
.list a.icon-btn { color: var(--ink-2); }
.list a.icon-btn:hover, .list .icon-btn:hover { color: var(--green-text); }

/* ================= Handleiding installeren ================= */
.guide-wrap { display: grid; gap: 14px; }
.guide.is-actief { border-color: var(--green-600); box-shadow: 0 0 0 3px rgb(58 107 76 / .15), var(--shadow); }
.stappen { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.stappen li { display: flex; gap: 12px; align-items: flex-start; }
.stap-n { width: 28px; height: 28px; border-radius: 50%; background: var(--green-700); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; }
.kbd { display: inline-grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); vertical-align: -7px; }
.kbd .svg-i { width: 16px; height: 16px; }
.tips { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.tips li { display: flex; gap: 12px; }
.tips li > .svg-i { color: var(--green-text); margin-top: 2px; }

@media (max-width: 860px) {
  .tabs a { padding: 10px; font-size: .9rem; }
  .next-opkomst { flex-wrap: wrap; }
  .next-opkomst .btn { width: 100%; }
  table.att .att-name { min-width: 120px; max-width: 140px; padding: 6px 8px; }
  .att-wrap { max-height: none; }
  .install-card { flex-wrap: wrap; }
}

.date-chip .svg-i { margin: 6px auto; color: var(--green-text); }

/* ================= Materiaalbeheer ================= */
.shop-periode { display: flex; align-items: center; gap: 16px; padding: 16px 20px; margin-bottom: 16px; flex-wrap: wrap; border-left: 4px solid var(--green-600); }
.sp-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--green-100); color: var(--green-700); display: grid; place-items: center; flex: none; }
.sp-velden { display: grid; grid-template-columns: repeat(2, minmax(150px, 190px)); gap: 12px; }
.sp-uitleg { flex: 1; min-width: 220px; font-size: .86rem; color: var(--ink-2); }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; padding: 16px; }
.mat-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; box-shadow: none; transition: border-color .15s, box-shadow .15s; }
.mat-card:hover { border-color: var(--green-600); box-shadow: var(--shadow); }
.mat-card.uit { opacity: .6; }
.mat-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 4px; }
.mat-ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--k) 14%, var(--surface)); color: var(--k); }
.mat-ic .svg-i { width: 24px; height: 24px; }
.mat-ic.klein { width: 34px; height: 34px; border-radius: 9px; }
.mat-ic.klein .svg-i { width: 18px; height: 18px; }
.mat-card h3 { font-size: 1rem; }
.mat-omschr { font-size: .84rem; color: var(--ink-2); min-height: 1.3em; }
.mat-meta { display: flex; flex-direction: column; gap: 2px; font-size: .78rem; color: var(--muted); }
.mat-meta span { display: inline-flex; align-items: center; gap: 5px; }
.mat-meta .svg-i { width: 14px; height: 14px; }
.mat-actie { margin-top: auto; padding-top: 8px; display: flex; justify-content: flex-end; min-height: 40px; align-items: center; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--green-600); border-radius: 10px; overflow: hidden; }
.stepper button { width: 36px; height: 34px; border: 0; background: var(--green-50); color: var(--green-text); font: inherit; font-size: 1.15rem; font-weight: 700; cursor: pointer; }
.stepper button:disabled { opacity: .35; cursor: not-allowed; }
.stepper span { min-width: 36px; text-align: center; font-weight: 700; }
.mandje-bar {
  position: sticky; bottom: 16px; z-index: 15; margin-top: 16px; display: flex; align-items: center; gap: 12px;
  background: var(--green-900); color: #fff; padding: 12px 14px 12px 18px; border-radius: 14px; box-shadow: var(--shadow-lg);
}
.mandje-bar > .svg-i { color: var(--sand-400); width: 24px; height: 24px; }
.mandje-bar b { display: block; }
.mandje-bar span { font-size: .82rem; color: rgb(255 255 255 / .75); }
.mandje-bar .btn-ghost { background: transparent; color: #fff !important; border-color: rgb(255 255 255 / .3); }
.afreken-periode { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--green-50); color: var(--ink); }
.afreken-periode .svg-i { color: var(--green-text); }
.afreken-lijst { border: 1px solid var(--line); border-radius: 12px; }
.afreken-lijst li { padding: 8px 14px; }
.best-kop { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 600; }
.alleen-mobiel { display: none; }
@media (max-width: 860px) {
  .alleen-mobiel { display: block; }
  .mandje-bar { bottom: calc(78px + env(safe-area-inset-bottom)); padding: 10px 10px 10px 14px; gap: 10px; }
  .mandje-bar > .svg-i, .mandje-bar #mb-leeg { display: none; }
  .mandje-bar b { font-size: .9rem; }
  .mandje-bar #mb-af { padding: 8px 14px; min-height: 38px; }
  .shop-periode { padding: 12px 14px; gap: 10px; }
  .sp-ic { display: none; }
  .sp-velden { grid-template-columns: 1fr 1fr; width: 100%; gap: 10px; }
  .sp-uitleg { font-size: .8rem; min-width: 0; }
  .shop-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; padding: 12px; }
}

/* ================= Materiaal: foto's en symbolen ================= */
.mat-ic.heeft-foto { padding: 0; overflow: hidden; background: var(--surface-2); }
.mat-ic.heeft-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mat-card.met-foto { padding-top: 0; overflow: hidden; }
.mat-foto { position: relative; margin: 0 -14px 8px; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.mat-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mat-foto .chip { position: absolute; top: 10px; right: 10px; box-shadow: var(--shadow); }
.mat-foto .chip:not(.ok):not(.warn):not(.danger) { background: var(--surface); }
.mat-detail-foto { width: 100%; max-height: 320px; object-fit: contain; border-radius: 12px; background: var(--surface-2); margin-bottom: 14px; }
.beeld-keuze { display: flex; gap: 16px; align-items: center; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; background: var(--surface-2); }
.beeld-voorbeeld .mat-ic { width: 96px; height: 96px; border-radius: 16px; }
.beeld-voorbeeld .mat-ic .svg-i { width: 44px; height: 44px; }
.beeld-knoppen { display: grid; gap: 6px; }
.beeld-knoppen .sub { font-size: .82rem; color: var(--ink-2); font-weight: 400; }
.icoon-keuze { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.icoon-keuze .ik { position: relative; }
.icoon-keuze .ik input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; opacity: 0; pointer-events: none; }
.icoon-keuze .ik span {
  width: 42px; height: 42px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; color: var(--ink-2); font-size: .72rem; font-weight: 700;
}
.icoon-keuze .ik span .svg-i { width: 20px; height: 20px; }
.icoon-keuze .ik:hover span { border-color: var(--green-600); }
.icoon-keuze .ik input:checked + span { border-color: var(--green-600); background: var(--green-100); color: var(--green-text); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--green-600); }
.icoon-keuze .ik input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (max-width: 560px) { .beeld-keuze { flex-direction: column; align-items: flex-start; } }

/* E-mailinstellingen: formulier links, voorbeeld rechts */
.mail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.mail-voorbeeld { position: sticky; top: 16px; overflow: hidden; }
.mail-voorbeeld iframe { display: block; width: 100%; height: min(78vh, 820px); border: 0; background: #F6F2E9; }
.mail-grid code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-size: .85em; }
@media (max-width: 960px) { .mail-grid { grid-template-columns: minmax(0, 1fr); } .mail-voorbeeld { position: static; } }

/* Rechtenschema: rollen als kolommen, rechten als rijen */
.rechten-kaart { overflow: hidden; }
.rechten-scroll { overflow-x: auto; }
.rechten-tabel { width: 100%; border-collapse: collapse; font-size: .9rem; }
.rechten-tabel th, .rechten-tabel td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; }
.rechten-tabel .rt-recht { text-align: left; min-width: 260px; color: var(--ink); }
.rechten-tabel thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; vertical-align: bottom; min-width: 96px; }
.rechten-tabel thead th.rt-recht { z-index: 2; }
.rechten-tabel tbody td.rt-recht, .rechten-tabel thead th.rt-recht { position: sticky; left: 0; background: var(--surface); }
.rechten-tabel tr.rt-groep th { text-align: left; background: var(--surface-2); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); padding: 7px 10px; }
.rechten-tabel input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--green-600, #2F5D41); cursor: pointer; }
.rechten-tabel select { font: inherit; font-size: .8rem; padding: 4px 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.rt-rol { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; font: inherit; font-weight: 700; color: var(--green-text); cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.rt-rol svg { width: 13px; height: 13px; opacity: .6; }
.rt-rol:hover { background: var(--surface-2); }
.rt-sub { font-size: .72rem; color: var(--ink-2); font-weight: 400; }
