/* ============================================================
   HBC Training – Mobile-first stylesheet
   ============================================================ */

:root {
    --clr-bg:        #f4f5f7;
    --clr-surface:   #ffffff;
    --clr-border:    #e0e0e0;
    --clr-text:      #1a1a1a;
    --clr-muted:     #6b7280;

    --clr-primary:   #007760;   /* HBC groen               */
    --clr-accent:    #ff5700;   /* HBC oranje              */

    --clr-lid:       #007760;   /* groen  – bestaand lid   */
    --clr-proef0:    #3b82f6;   /* blauw  – proefles 0     */
    --clr-proef1:    #10b981;   /* groen  – proefles 1     */
    --clr-proef2:    #ff5700;   /* HBC oranje – proefles 2 */
    --clr-proef3:    #ef4444;   /* rood   – proefles 3     */
    --clr-alert:     #7f1d1d;   /* donkerrood – 4+         */
    --clr-alert-bg:  #fef2f2;

    --radius:   12px;
    --shadow:   0 2px 8px rgba(0,0,0,.08);
    --tap-min:  60px;           /* minimale taphoogte       */
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: system-ui, -apple-system, sans-serif;
    background: var(--clr-bg);
    color: var(--clr-text);
    min-height: 100dvh;
}

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
    background: #007760;
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}
.topbar h1 { font-size: 1.1rem; font-weight: 700; }
.topbar .meta { font-size: .8rem; opacity: .7; }
.topbar a { color: #fff; font-size: .85rem; opacity: .8; text-decoration: none; }

/* ── Hamburger menu ──────────────────────────────────────── */
.hamburger {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 6px;
    line-height: 1;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.hamburger-menu {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,.18);
    overflow: hidden;
    z-index: 200;
    min-width: 180px;
    transition: opacity .15s, visibility .15s;
}
.hamburger-menu.open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}
.hamburger-menu a {
    display: block;
    padding: 15px 18px;
    color: var(--clr-text);
    text-decoration: none;
    font-size: .95rem;
    border-bottom: 1px solid var(--clr-border);
}
.hamburger-menu a:last-child { border-bottom: none; }
.hamburger-menu a:active { background: var(--clr-bg); }

/* ── Container ───────────────────────────────────────────── */
.container       { max-width: 600px;  margin: 0 auto; padding: 16px; width: 100%; }
.container--wide { max-width: 1200px; margin: 0 auto; padding: 16px; width: 100%; }

/* ── Scrollbare tabellen (admin) ─────────────────────────── */
.scroll-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.scroll-table table { min-width: 480px; }

/* ── Login ───────────────────────────────────────────────── */
.login-card {
    background: var(--clr-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px 24px;
    margin-top: 40px;
    text-align: center;
}
.login-card h2 { margin-bottom: 8px; }
.login-card p  { color: var(--clr-muted); margin-bottom: 24px; font-size: .95rem; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; text-align: left; }
label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }

select, input[type="text"], input[type="password"], input[type="number"] {
    width: 100%;
    padding: 14px 12px;
    border: 2px solid var(--clr-border);
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
    appearance: none;
    transition: border-color .2s;
}
select:focus, input:focus {
    outline: none;
    border-color: #007760;
}

/* PIN input: groot en centraal */
.pin-input {
    text-align: center;
    font-size: 2rem;
    letter-spacing: .5rem;
    font-weight: 700;
}

.btn {
    display: block;
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
}
.btn:active { transform: scale(.98); opacity: .9; }
.btn-primary { background: #007760; color: #fff; }
.btn-danger  { background: var(--clr-proef3); color: #fff; }
.btn-sm {
    display: inline-block;
    width: auto;
    padding: 8px 16px;
    font-size: .9rem;
}

.error-msg {
    background: #fee2e2;
    color: #b91c1c;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: .9rem;
}

/* ── Filter toggle ───────────────────────────────────────── */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.filter-bar span { font-size: .9rem; color: var(--clr-muted); }

.toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: .9rem;
}
.toggle input { width: 0; height: 0; opacity: 0; position: absolute; }
.toggle-track {
    width: 44px; height: 24px;
    background: var(--clr-border);
    border-radius: 99px;
    position: relative;
    transition: background .2s;
    flex-shrink: 0;
}
.toggle-track::after {
    content: '';
    position: absolute;
    left: 3px; top: 3px;
    width: 18px; height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: left .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle input:checked + .toggle-track { background: #007760; }
.toggle input:checked + .toggle-track::after { left: 23px; }

/* ── Ledenlijst ──────────────────────────────────────────── */
.member-list { display: flex; flex-direction: column; gap: 10px; }

.member-card {
    background: var(--clr-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: var(--tap-min);
    border-left: 5px solid transparent;
    transition: box-shadow .15s;
}
.member-card:active { box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* Alert (4+): hele kaart rood */
.member-card.alert-card {
    background: var(--clr-alert-bg);
    border-left-color: var(--clr-alert);
    animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: var(--shadow); }
    50%       { box-shadow: 0 0 0 4px rgba(239,68,68,.25); }
}

.member-card.proef3 { border-left-color: var(--clr-proef3); }
.member-card.proef2 { border-left-color: var(--clr-proef2); }
.member-card.proef1 { border-left-color: var(--clr-proef1); }
.member-card.proef0 { border-left-color: var(--clr-proef0); }
.member-card.lid    { border-left-color: var(--clr-lid); opacity: .75; }

/* Badge */
.badge {
    flex-shrink: 0;
    min-width: 52px;
    padding: 5px 8px;
    border-radius: 8px;
    font-size: .75rem;
    font-weight: 800;
    text-align: center;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.badge-lid    { background: #dcfce7; color: #15803d; }
.badge-proef0 { background: #dbeafe; color: #1e40af; }
.badge-proef1 { background: #d1fae5; color: #065f46; }
.badge-proef2 { background: #fff0e8; color: #cc4400; }
.badge-proef3 { background: #fee2e2; color: #b91c1c; }
.badge-alert  { background: var(--clr-alert); color: #fff; font-size: .8rem; }

/* Naam + subtext */
.member-info { flex: 1; min-width: 0; }
.member-name { font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.member-sub  { font-size: .8rem; color: var(--clr-muted); margin-top: 2px; }
.alert-sub   { color: var(--clr-alert); font-weight: 700; }

/* Actie knoppen rechts */
.member-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.btn-plus {
    width: 52px; height: 52px;
    border-radius: 50%;
    border: none;
    background: #007760;
    color: #fff;
    font-size: 1.7rem;
    font-weight: 300;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    align-self: center;
    flex-shrink: 0;
    transition: transform .1s, background .15s;
    line-height: 1;
}
.btn-plus:active { transform: scale(.9); }
.btn-plus.disabled { background: var(--clr-border); color: var(--clr-muted); cursor: default; }

/* Aanwezigheids-checkbox */
.check-label {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    width: 44px; height: 44px;
    cursor: pointer;
}
.check-label input { display: none; }
.check-box {
    width: 44px; height: 44px;
    border: 2px solid var(--clr-border);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    transition: background .15s, border-color .15s;
}
.check-label input:checked + .check-box {
    background: var(--clr-lid);
    border-color: var(--clr-lid);
    color: #fff;
}

/* ── Leeg scherm ─────────────────────────────────────────── */
.empty { text-align: center; padding: 40px 16px; color: var(--clr-muted); }
.empty p { font-size: 1rem; }

/* Edit knop */
.btn-edit {
    width: 34px; height: 34px;
    border-radius: 8px;
    border: 2px solid var(--clr-border);
    background: #fff;
    color: #555;
    font-size: .85rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    align-self: center;
    flex-shrink: 0;
    line-height: 1;
    transition: background .1s;
}
.btn-edit:active { background: #f3f4f6; }

/* ── Sectie header ───────────────────────────────────────── */
.section-title {
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--clr-muted);
    margin-bottom: 8px;
    margin-top: 20px;
}

/* ── Confirmation overlay ────────────────────────────────── */
.overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    display: flex; align-items: flex-end; justify-content: center;
    z-index: 200;
    opacity: 0; pointer-events: none;
    transition: opacity .2s;
}
.overlay.open { opacity: 1; pointer-events: all; }

.confirm-sheet {
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 24px 20px 36px;
    width: 100%; max-width: 600px;
    transform: translateY(100%);
    transition: transform .25s ease;
    text-align: center;
}
.overlay.open .confirm-sheet { transform: translateY(0); }

.confirm-sheet h3 { font-size: 1.2rem; margin-bottom: 6px; }
.confirm-sheet p  { color: var(--clr-muted); margin-bottom: 24px; }
.confirm-sheet .btn { margin-bottom: 10px; }
.btn-cancel { background: var(--clr-bg); color: var(--clr-text); font-weight: 600; }

/* ── Admin ───────────────────────────────────────────────── */
.admin-card {
    background: var(--clr-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}
.admin-card h3 { margin-bottom: 14px; font-size: 1rem; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--clr-border); }
th { font-weight: 700; background: var(--clr-bg); }
tr:last-child td { border-bottom: none; }

.success-msg {
    background: #dcfce7; color: #15803d;
    padding: 10px 14px; border-radius: 8px;
    margin-bottom: 16px; font-size: .9rem;
}

/* ── Toast notificatie ───────────────────────────────────── */
#toast {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    background: #007760; color: #fff;
    padding: 12px 20px; border-radius: 99px;
    font-size: .9rem; font-weight: 600;
    opacity: 0; pointer-events: none;
    transition: opacity .3s;
    white-space: nowrap;
    z-index: 300;
}
#toast.show { opacity: 1; }
