:root {
  --ink: #1D2A41;
  --muted: #5E5A52;
  --line: #ECE8E1;
  --line-strong: #DDD8D0;
  --soft: #F3F1EE;
  --bg: #FFFFFF;
  --accent: #0087C9;
  --accent-strong: #0072AB;
  --accent-deep: #005A88;
  --accent-soft: #DCEEF8;
  --ok: #1F7A4D;
  --danger: #B42318;
  --tile1: #24466B; --tile2: #0087C9; --tile3: #3B4A63; --tile4: #5BB4E0; --tile5: #1D2A41;
  --radius: 18px;
  --tabbar: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'DM Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-strong); }
img { display: block; }
[hidden] { display: none !important; }

.app { max-width: 640px; margin: 0 auto; min-height: 100dvh; padding-bottom: calc(var(--tabbar) + var(--safe-b) + 16px); }

/* ---------- koppen ---------- */
.top { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); padding: 16px 16px 10px; display: flex; flex-direction: column; gap: 12px; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { margin: 0; font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: -.5px; }
.brand .club { letter-spacing: 4px; }
.brand .acc { color: var(--accent); }
h1.page { margin: 0; font-family: var(--display); font-weight: 800; font-size: 28px; letter-spacing: -.5px; }
h2.section { margin: 24px 0 10px; font-family: var(--display); font-weight: 800; font-size: 20px; }
.sub { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- zoeken en chips ---------- */
.search { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 16px; border-radius: 24px; background: var(--soft); }
.search input { border: 0; background: transparent; font-size: 16px; flex: 1; outline: none; min-width: 0; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 36px; padding: 0 16px; border-radius: 18px; border: 1px solid var(--line-strong); background: #fff; font-size: 14px; font-weight: 500; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 700; }
.chip-sep { flex: none; width: 1px; margin: 6px 2px; background: var(--line-strong); }
.subchips { margin-top: -4px; }
.subchips .chip { height: 32px; padding: 0 14px; font-size: 13px; }
.subchips .chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-deep); }

/* ---------- raster ---------- */
.grid { columns: 2; column-gap: 10px; padding: 6px 12px; }
@media (min-width: 560px) { .grid { columns: 3; } }
.tile { break-inside: avoid; margin: 0 0 14px; display: block; text-decoration: none; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; width: 100%; text-align: left; }
.thumb { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--tile1); }
.thumb img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.thumb .fig { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.badge-time { position: absolute; left: 8px; bottom: 8px; padding: 3px 8px; border-radius: 10px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; font-weight: 700; }
.badge-coach { position: absolute; left: 8px; top: 8px; padding: 4px 9px; border-radius: 10px; background: var(--accent-strong); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .3px; }
.badge-saved { position: absolute; right: 8px; top: 8px; width: 30px; height: 30px; border-radius: 15px; background: #fff; display: flex; align-items: center; justify-content: center; }
.tile h3 { margin: 6px 4px 0; font-size: 14px; font-weight: 700; line-height: 1.3; }
.tile p { margin: 2px 4px 0; font-size: 12px; color: var(--muted); }

.empty { text-align: center; color: var(--muted); padding: 48px 24px; font-size: 15px; line-height: 1.5; }
.empty strong { display: block; color: var(--ink); font-size: 17px; margin-bottom: 6px; }

/* ---------- knoppen ---------- */
.btn { height: 48px; padding: 0 20px; border-radius: 24px; border: 1px solid var(--line-strong); background: #fff; font-size: 15px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; color: var(--ink); }
.btn.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; height: 54px; border-radius: 27px; font-size: 16px; }
.btn.small { height: 40px; padding: 0 14px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; border: 0; background: var(--soft); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }

/* ---------- formulieren ---------- */
.form { padding: 16px; display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; }
.field input, .field select, .field textarea { height: 48px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line-strong); background: #fff; font-size: 16px; font-weight: 400; }
.field textarea { height: auto; padding: 12px 14px; line-height: 1.4; resize: vertical; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-deep); font-size: 13px; line-height: 1.45; }
.picks { display: flex; gap: 8px; overflow-x: auto; }
.pick { width: 76px; height: 100px; flex: none; border-radius: 12px; background: var(--tile1) center/cover; position: relative; }
.pick .bar { position: absolute; left: 6px; right: 6px; bottom: 6px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.35); overflow: hidden; }
.pick .bar i { display: block; height: 100%; width: 0; background: #fff; }
.pick-add { width: 76px; height: 100px; flex: none; border-radius: 12px; border: 2px dashed #C9C4BB; background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }

/* ---------- lijsten en kaarten ---------- */
.list { padding: 8px 16px; display: flex; flex-direction: column; gap: 10px; }
.item { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: var(--radius); background: var(--soft); }
.item .mini { width: 64px; height: 84px; flex: none; border-radius: 12px; background: var(--tile1) center/cover; cursor: pointer; border: 0; }
.item .txt { flex: 1; min-width: 0; }
.item h3 { margin: 0; font-size: 15px; font-weight: 700; }
.item p { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.check { width: 44px; height: 44px; flex: none; border-radius: 22px; border: 2px solid var(--ink); background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.check[aria-pressed="true"] { background: var(--accent-strong); border-color: var(--accent-strong); }
.card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.card video { width: 100%; max-height: 60vh; border-radius: 14px; background: #000; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { padding: 3px 9px; border-radius: 10px; background: var(--soft); font-size: 12px; }
.tag.pending { background: #FFF1D6; color: #7A4B00; }
.tag.rejected { background: #FDE4E2; color: var(--danger); }
.tag.approved { background: #DDF2E6; color: var(--ok); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions .btn { flex: 1; }

.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); padding: 0 16px; overflow-x: auto; }
.tab { height: 44px; border: 0; background: none; padding: 0; font-size: 15px; font-weight: 500; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--ink); }
.count { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 10px; background: var(--accent-strong); color: #fff; font-size: 12px; text-align: center; }

/* ---------- tabbalk ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: calc(var(--tabbar) + var(--safe-b)); padding-bottom: var(--safe-b); background: rgba(255,255,255,.97); border-top: 1px solid var(--line); display: flex; justify-content: center; }
.tabbar nav { display: flex; justify-content: space-around; width: 100%; max-width: 640px; padding-top: 8px; }
.tabbar a { width: 68px; height: 52px; display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 500; position: relative; }
.tabbar a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.tabbar a .dot { position: absolute; top: -2px; right: 14px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent-strong); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }

/* ---------- kijker ---------- */
.viewer { position: fixed; inset: 0; z-index: 50; background: #0E1626; color: #fff; display: flex; align-items: center; justify-content: center; touch-action: pan-x; }
.viewer video { width: 100%; height: 100%; object-fit: contain; }
.viewer .shade { position: absolute; left: 0; right: 0; bottom: 0; height: 55%; background: linear-gradient(to top, rgba(8,14,24,.85), rgba(8,14,24,0)); pointer-events: none; }
.viewer .vtop { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: center; }
.viewer .round { width: 44px; height: 44px; border-radius: 22px; border: 0; background: rgba(0,0,0,.45); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.speed { display: flex; background: rgba(0,0,0,.45); border-radius: 22px; padding: 4px; gap: 2px; }
.speed button { height: 36px; padding: 0 14px; border-radius: 18px; border: 0; background: transparent; color: #fff; font-size: 14px; font-weight: 500; cursor: pointer; }
.speed button[aria-pressed="true"] { background: #fff; color: var(--ink); font-weight: 700; }
.viewer .side { position: absolute; right: 10px; bottom: calc(150px + var(--safe-b)); display: flex; flex-direction: column; gap: 16px; align-items: center; }
.viewer .side button { width: 56px; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: transparent; color: #fff; font-size: 12px; font-weight: 700; cursor: pointer; }
.viewer .side span.c { width: 48px; height: 48px; border-radius: 24px; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; }
.viewer .side button[aria-pressed="true"] span.c { background: var(--accent-strong); }
.viewer .info { position: absolute; left: 16px; right: 84px; bottom: calc(60px + var(--safe-b)); display: flex; flex-direction: column; gap: 8px; }
.viewer .info h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1.1; }
.viewer .info p { margin: 0; font-size: 15px; line-height: 1.45; color: #E9E5DE; }
.viewer .vtag { padding: 4px 10px; border-radius: 12px; border: 1px solid rgba(255,255,255,.5); font-size: 12px; }
.viewer .from-coach { align-self: flex-start; padding: 5px 10px; border-radius: 12px; background: var(--accent-strong); font-size: 12px; font-weight: 700; }
.viewer .progress { position: absolute; left: 16px; right: 16px; bottom: calc(28px + var(--safe-b)); height: 4px; border-radius: 2px; background: rgba(255,255,255,.3); }
.viewer .progress i { display: block; height: 100%; width: 0; border-radius: 2px; background: #fff; }
.viewer .hint { position: absolute; left: 0; right: 0; bottom: calc(6px + var(--safe-b)); text-align: center; font-size: 11px; color: #C9C4BB; margin: 0; }

/* ---------- sheet ---------- */
.sheet-bg { position: fixed; inset: 0; z-index: 60; background: rgba(8,14,24,.5); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 640px; background: #fff; color: var(--ink); border-radius: 24px 24px 0 0; padding: 20px 16px calc(20px + var(--safe-b)); display: flex; flex-direction: column; gap: 14px; max-height: 90dvh; overflow: auto; }
.sheet h2 { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 800; }

/* ---------- aanmelden ---------- */
.login { min-height: 100dvh; display: flex; flex-direction: column; max-width: 480px; margin: 0 auto; }
.mosaic { height: 44dvh; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 8px; padding: 16px; }
.mosaic div { border-radius: var(--radius); }
.mosaic .tall { grid-row: span 2; }
.login .body { flex: 1; padding: 8px 28px 32px; display: flex; flex-direction: column; gap: 14px; }
.login h1 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 40px; letter-spacing: -1px; line-height: 1; }
.login .lead { margin: 0 0 8px; font-size: 16px; line-height: 1.45; color: var(--muted); }
.sso { height: 54px; border-radius: 27px; border: 1px solid var(--line-strong); background: #fff; display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 16px; font-weight: 700; text-decoration: none; color: var(--ink); }
.small-print { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); text-align: center; }
.error { padding: 12px 14px; border-radius: 14px; background: #FDE4E2; color: var(--danger); font-size: 14px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + var(--safe-b) + 16px); transform: translateX(-50%); z-index: 70; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 14px; font-weight: 500; max-width: calc(100% - 32px); }

.member { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: var(--radius); background: var(--soft); }
.member .who { display: flex; align-items: center; gap: 10px; }
.avatar { width: 40px; height: 40px; border-radius: 20px; background: var(--accent-soft) center/cover; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--accent-deep); }
.member .who .txt { flex: 1; min-width: 0; }
.member .who h3 { margin: 0; font-size: 15px; }
.member .who p { margin: 2px 0 0; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.member .opts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.member select, .member input { height: 40px; border-radius: 12px; border: 1px solid var(--line-strong); background: #fff; padding: 0 10px; font-size: 14px; }
.member input { width: 70px; }
.unit-chip { height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--line-strong); background: #fff; font-size: 13px; cursor: pointer; }
.unit-chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-deep); font-weight: 700; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- foto in de kijker ---------- */
.zoomwrap { position: absolute; inset: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.zoomwrap .vimg { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; }
.zoomwrap.zoomed { overflow: auto; display: block; touch-action: pan-x pan-y; }
.zoomwrap.zoomed .vimg { max-width: none; max-height: none; width: 200%; cursor: zoom-out; }

/* ---------- knippen ---------- */
.trim-video { width: 100%; max-height: 42dvh; border-radius: 14px; background: #000; }
.trim-track { position: relative; height: 8px; border-radius: 4px; background: var(--soft); overflow: hidden; }
.trim-sel { position: absolute; top: 0; bottom: 0; left: 0; width: 100%; background: var(--accent-strong); }
.trim-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; }
.trim-row strong { min-width: 56px; font-variant-numeric: tabular-nums; }
.trim-row .btn.small { height: 40px; min-width: 44px; padding: 0 12px; }
.trim-row .btn.small.primary { margin-left: auto; }
.sheet input[type="range"] { width: 100%; height: 32px; accent-color: var(--accent-strong); }
.sheet > * { flex-shrink: 0; }
.field { min-width: 0; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; }

/* ---------- logo ---------- */
.login-logo img { width: 100%; max-width: 320px; height: auto; display: block; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand-mark { height: 34px; width: auto; }

/* Klaarzetten van gekozen bestanden */
.prep { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: #EAF5FB; color: var(--ink); font-size: 14px; font-weight: 700; }
.prep[hidden] { display: none; }
.prep-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.prep-bar { display: block; height: 6px; border-radius: 3px; background: rgba(0, 114, 171, .15); overflow: hidden; }
.prep-bar i { display: block; height: 100%; width: 0; background: var(--accent-strong); transition: width .3s ease; }
.spinner { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 3px solid rgba(0, 114, 171, .2); border-top-color: var(--accent-strong); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pick.loading { display: flex; align-items: center; justify-content: center; background: linear-gradient(110deg, #EEF2F5 30%, #F8FAFB 50%, #EEF2F5 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
.pick-wait { font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; padding: 4px; }
@keyframes shimmer { to { background-position: -150% 0; } }

/* Opladen-scherm */
.upl { position: fixed; inset: 0; z-index: 60; background: rgba(15, 25, 40, .55); display: flex; align-items: flex-end; justify-content: center; }
.upl-card { width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; background: #fff; border-radius: 24px 24px 0 0; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; box-sizing: border-box; }
@media (min-width: 640px) { .upl { align-items: center; } .upl-card { border-radius: 24px; } }
.upl-card h2 { margin: 0; font-family: var(--display, inherit); font-size: 22px; }
.upl-total { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.upl-total .sub { margin: 0; }
.upl-pct { font-size: 34px; line-height: 1; color: var(--accent-strong); font-variant-numeric: tabular-nums; }
.upl-bigbar { display: block; height: 10px; border-radius: 5px; background: #E7EEF3; overflow: hidden; }
.upl-bigbar i { display: block; height: 100%; width: 0; background: var(--accent-strong); transition: width .25s ease; }
.upl-note { margin: 0; font-size: 13px; }
.upl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.upl-row { display: flex; gap: 12px; align-items: center; }
.upl-thumb { width: 44px; height: 56px; flex: none; border-radius: 8px; background: var(--tile1, #DDE7EE) center/cover; }
.upl-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.upl-line { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.upl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.upl-status { flex: none; color: var(--muted); font-size: 13px; }
.upl-bar { display: block; height: 6px; border-radius: 3px; background: #E7EEF3; overflow: hidden; }
.upl-bar i { display: block; height: 100%; width: 0; background: var(--accent-strong); transition: width .25s ease; }
.upl-row.ok .upl-status { color: #1E7B4F; font-weight: 700; }
.upl-row.ok .upl-bar i { background: #2E9E66; }
.upl-row.fail .upl-status { color: #C0392B; font-weight: 700; }
.upl-row.busy .upl-status { color: var(--accent-strong); font-weight: 700; }
.upl-actions { display: flex; flex-direction: column; gap: 10px; }
.upl-actions:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .spinner, .pick.loading { animation: none; } }
