/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --groen:    #019541;
  --groen-d:  #017a34;
  --zwart:    #111111;
  --grijs-d:  #222222;
  --grijs:    #444444;
  --grijs-l:  #888888;
  --rand:     #dddddd;
  --bg:       #f5f5f5;
  --wit:      #ffffff;
  --rood:     #d32f2f;
  --oranje:   #e65100;
  --blauw:    #1565c0;
  --paars:    #6a1b9a;
  --geel:     #f9a825;

  --status-aanwezig:       #019541;
  --status-telaat:         #e65100;
  --status-ongeoorloofd:   #d32f2f;
  --status-geoorloofd:     #1565c0;
  --status-geblesseerd:    #6a1b9a;
  --status-ziek:           #f9a825;

  --radius:   8px;
  --shadow:   0 1px 4px rgba(0,0,0,.12);
  --trans:    .15s ease;
}

html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--zwart);
  line-height: 1.5;
  min-height: 100vh;
}

/* ── Layout ───────────────────────────────────────────────────────────────── */
.topbar {
  background: var(--zwart);
  color: var(--wit);
  padding: 0 16px;
  padding-top: env(safe-area-inset-top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  height: calc(56px + env(safe-area-inset-top));
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.topbar-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-title .team-badge {
  background: var(--groen);
  color: var(--wit);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.topbar-actions { display: flex; gap: 8px; align-items: center; }
.topbar-actions a { color: var(--wit); text-decoration: none; font-size: .85rem; opacity: .8; }
.topbar-actions a:hover { opacity: 1; }

.nav {
  background: var(--zwart);
  border-top: 1px solid #333;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: #aaa;
  text-decoration: none;
  padding: 10px 14px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color var(--trans), border-color var(--trans);
}
.nav a:hover  { color: var(--wit); }
.nav a.active { color: var(--groen); border-bottom-color: var(--groen); }

.container { max-width: 680px; margin: 0 auto; padding: 16px; }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--wit);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}
.card-title {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--grijs-l);
  margin-bottom: 12px;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: filter var(--trans), opacity var(--trans);
  white-space: nowrap;
}
.btn:active { filter: brightness(.9); }
.btn-primary   { background: var(--groen); color: var(--wit); }
.btn-dark      { background: var(--zwart); color: var(--wit); }
.btn-danger    { background: var(--rood);  color: var(--wit); }
.btn-ghost     { background: transparent; color: var(--grijs); border: 1px solid var(--rand); }
.btn-sm        { padding: 6px 12px; font-size: .8rem; }
.btn-full      { width: 100%; }
.btn:disabled  { opacity: .5; cursor: not-allowed; }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--grijs);
  margin-bottom: 5px;
  letter-spacing: .02em;
}
.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--wit);
  color: var(--zwart);
  transition: border-color var(--trans), box-shadow var(--trans);
  -webkit-appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--groen);
  box-shadow: 0 0 0 3px rgba(1,149,65,.15);
}
textarea.form-control { resize: vertical; min-height: 80px; }

/* ── Status badges ────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.badge-aanwezig     { background: #e8f5e9; color: var(--status-aanwezig); }
.badge-telaat       { background: #fff3e0; color: var(--status-telaat); }
.badge-ongeoorloofd { background: #ffebee; color: var(--status-ongeoorloofd); }
.badge-geoorloofd   { background: #e3f2fd; color: var(--status-geoorloofd); }
.badge-geblesseerd  { background: #f3e5f5; color: var(--status-geblesseerd); }
.badge-ziek         { background: #fffde7; color: var(--status-ziek); }

.status-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Alerts & Flash ───────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  font-size: .9rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-success { background: #e8f5e9; color: #1b5e20; border-left: 4px solid var(--groen); }
.alert-error   { background: #ffebee; color: #7f1f1f; border-left: 4px solid var(--rood); }
.alert-warning { background: #fff8e1; color: #7f5f00; border-left: 4px solid var(--geel); }
.alert-info    { background: #e3f2fd; color: #0d3c61; border-left: 4px solid var(--blauw); }

/* ── Verjaardag banner ────────────────────────────────────────────────────── */
.birthday-banner {
  background: linear-gradient(135deg, #019541 0%, #01c857 100%);
  color: var(--wit);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(1,149,65,.3);
}
.birthday-banner .icon { font-size: 1.8rem; }
.birthday-banner strong { display: block; font-size: 1rem; }
.birthday-banner span   { font-size: .85rem; opacity: .9; }

.birthday-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rand);
  font-size: .9rem;
}
.birthday-item:last-child { border-bottom: none; }
.birthday-days {
  margin-left: auto;
  background: var(--bg);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: .75rem;
  font-weight: 700;
  color: var(--groen);
}

/* ── Lijst rijen ──────────────────────────────────────────────────────────── */
.list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rand);
  text-decoration: none;
  color: inherit;
}
.list-row:last-child { border-bottom: none; }
.list-row:hover .list-row-main { color: var(--groen); }
.list-row-main { font-weight: 600; font-size: .95rem; flex: 1; min-width: 0; }
.list-row-sub  { font-size: .78rem; color: var(--grijs-l); margin-top: 1px; }
.list-row-right { text-align: right; flex-shrink: 0; }

.sessie-type-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Presentie rij ────────────────────────────────────────────────────────── */
.presentie-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rand);
}
.presentie-row:last-child { border-bottom: none; }
.presentie-naam { flex: 1; font-weight: 600; font-size: .95rem; }
.presentie-naam small { display: block; font-weight: 400; color: var(--grijs-l); font-size: .75rem; }
.presentie-select {
  flex-shrink: 0;
  width: 170px;
  padding: 8px 10px;
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  font-size: .85rem;
  background: var(--wit);
  cursor: pointer;
}
.presentie-select:focus { outline: none; border-color: var(--groen); }

/* ── Statistieken tabel ───────────────────────────────────────────────────── */
.stats-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.stats-table th {
  text-align: left;
  padding: 8px 10px;
  background: var(--zwart);
  color: var(--wit);
  font-size: .72rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.stats-table th.sortable { cursor: pointer; user-select: none; }
.stats-table th.sortable:hover { background: var(--grijs-d); }
.stats-table td { padding: 9px 10px; border-bottom: 1px solid var(--rand); vertical-align: middle; }
.stats-table tr:last-child td { border-bottom: none; }
.stats-table tr:hover td { background: #fafafa; }
.pct-bar { height: 6px; background: var(--rand); border-radius: 3px; margin-top: 4px; min-width: 50px; }
.pct-fill { height: 100%; border-radius: 3px; background: var(--groen); }

/* ── Progress ring (dashboard) ────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-box {
  background: var(--zwart);
  color: var(--wit);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
}
.stat-box .num { font-size: 1.8rem; font-weight: 800; color: var(--groen); line-height: 1; }
.stat-box .lbl { font-size: .68rem; letter-spacing: .05em; text-transform: uppercase; opacity: .7; margin-top: 4px; }

/* ── Login pagina ─────────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--zwart);
}
.login-card {
  background: var(--wit);
  border-radius: 12px;
  padding: 28px 28px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
.login-logo {
  text-align: center;
  margin-bottom: 20px;
}

/* ── Admin panels ─────────────────────────────────────────────────────────── */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .admin-grid { grid-template-columns: 1fr; } }

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.tag-admin { background: #fff3e0; color: var(--oranje); }
.tag-coach { background: #e8f5e9; color: var(--groen); }

/* ── Activiteitstype kleur dot ────────────────────────────────────────────── */
.type-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* ── Wachtwoord formulier ─────────────────────────────────────────────────── */
.collapse-section { margin-top: 12px; }
details > summary { cursor: pointer; font-size: .85rem; color: var(--grijs-l); padding: 6px 0; }
details[open] > summary { color: var(--groen); }

/* ── Utility ──────────────────────────────────────────────────────────────── */
.text-muted  { color: var(--grijs-l); font-size: .85rem; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-green  { color: var(--groen); }
.text-red    { color: var(--rood); }
.fw-bold     { font-weight: 700; }
.mt-4        { margin-top: 4px; }
.mt-8        { margin-top: 8px; }
.mt-12       { margin-top: 12px; }
.mt-16       { margin-top: 16px; }
.mb-4        { margin-bottom: 4px; }
.mb-8        { margin-bottom: 8px; }
.mb-12       { margin-bottom: 12px; }
.mb-16       { margin-bottom: 16px; }
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.flex-1      { flex: 1; }
.divider     { border: none; border-top: 1px solid var(--rand); margin: 12px 0; }
.empty-state { text-align: center; padding: 32px 16px; color: var(--grijs-l); }
.empty-state .icon { font-size: 2.5rem; margin-bottom: 8px; }

/* ── Mobiel optimalisaties ────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .presentie-select { width: 140px; font-size: .8rem; }
  .stat-box .num { font-size: 1.4rem; }
  .admin-grid { grid-template-columns: 1fr; }
}

/* ── Sticky opslaan knop ──────────────────────────────────────────────────── */
.sticky-save {
  position: sticky;
  bottom: 0;
  background: var(--wit);
  border-top: 1px solid var(--rand);
  padding: 12px 16px;
  margin: 0 -16px -16px;
  box-shadow: 0 -2px 8px rgba(0,0,0,.08);
}