/* BBJ Berg — overgenomen uit de React Native StyleSheets (styles/*.tsx). */

:root {
    --ink: #111;
    --ink-strong: #111827;
    --muted: #666;
    --muted-2: #6B7280;
    --label: #777;
    --placeholder: #9CA3AF;
    --border: #E6E6E8;
    --border-input: #E5E5E7;
    --surface: #FFFFFF;
    --surface-soft: #FAFAFB;
    --surface-gray: #F1F1F3;
    --input-auth: #F3F4F6;
    --page: #F7F7F8;
    --danger: #991B1B;
    --danger-strong: #B91C1C;
    --danger-bright: #DC2626;
    --success: #15803D;
    --warning: #92400E;
    --shadow: 0 6px 12px rgba(0, 0, 0, .06);
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    color-scheme: light;
}

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

html, body {
    margin: 0;
    padding: 0;
    background: var(--surface);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
button:disabled { opacity: .6; cursor: default; }
a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
input::placeholder { color: var(--placeholder); }

.icon { flex-shrink: 0; display: block; }

/* ---------- opstart / laden ---------- */

.boot, .center-screen {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
}

.boot-spinner, .spinner {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid #E5E7EB;
    border-top-color: var(--ink-strong);
    animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

#blazor-error-ui {
    display: none;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 1000;
    padding: 12px 16px calc(12px + var(--safe-bottom));
    background: #FEF2F2;
    color: var(--danger);
    font-weight: 600;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, .12);
}
#blazor-error-ui .reload { text-decoration: underline; margin-left: 8px; }
#blazor-error-ui .dismiss { position: absolute; right: 16px; cursor: pointer; }

/* ---------- auth / registratie ---------- */

.auth-screen {
    min-height: 100dvh;
    max-width: 480px;
    margin: 0 auto;
    padding: calc(8px + var(--safe-top)) 16px calc(24px + var(--safe-bottom));
    display: flex;
    flex-direction: column;
    background: var(--surface);
}

.auth-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px 0;
}

.back-button {
    width: 40px;
    height: 40px;
    border-radius: 20px;
    background: var(--input-auth);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
    align-self: flex-start;
}

.logo {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    background: var(--input-auth);
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
    overflow: hidden;
}
.logo img { width: 60px; height: auto; mix-blend-mode: multiply; }

.title {
    font-size: 32px;
    font-weight: 800;
    color: var(--ink-strong);
    text-align: center;
    line-height: 1.15;
}

.subtitle {
    margin-top: 10px;
    margin-bottom: 32px;
    font-size: 16px;
    color: var(--muted-2);
    text-align: center;
    line-height: 1.4;
}

.header .subtitle { margin-bottom: 20px; }

.input {
    height: 58px;
    width: 100%;
    border-radius: 14px;
    background: var(--input-auth);
    border: 1.5px solid transparent;
    padding: 0 18px;
    font-size: 16px;
    color: var(--ink-strong);
    margin-bottom: 14px;
    outline: none;
}
.input:focus { border-color: #D1D5DB; }
.input.input-error { margin-bottom: 6px; border-color: var(--danger-bright); background: #FEF2F2; }

.field-error {
    margin: -2px 0 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--danger-bright);
}

.error-banner {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 14px;
    padding: 12px;
    border-radius: 12px;
    background: #FEF2F2;
    border: 1px solid #FCA5A5;
    color: var(--danger);
    font-size: 14px;
    font-weight: 600;
    line-height: 19px;
}

.row {
    margin: 6px 0 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.muted { font-size: 14px; color: var(--muted-2); }
.link-strong { font-size: 14px; font-weight: 700; color: var(--ink-strong); }

.primary-button {
    height: 60px;
    width: 100%;
    border-radius: 30px;
    background: #000;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bottom-row { margin-top: 32px; display: flex; justify-content: center; }
.button-stack { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }

.step-indicator { margin-bottom: 24px; }
.step-bars { display: flex; gap: 6px; }
.step-bar { flex: 1; height: 4px; border-radius: 999px; background: var(--border-input); }
.step-bar.active { background: var(--ink-strong); }
.step-text, .input-label, .section-label, .list-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--label);
    text-transform: uppercase;
    letter-spacing: .5px;
}
.step-text { margin-top: 8px; }
.section-label { margin: 8px 0; font-size: 13px; font-weight: 800; }
.section-label.small { margin: 22px 0 8px; font-size: 12px; font-weight: 700; }

.choice-list { display: flex; flex-direction: column; gap: 14px; padding-bottom: 20px; }
.choice-card {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: var(--surface);
    border-radius: 20px;
    padding: 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.choice-card.selected { border-color: var(--ink); background: #FCFCFC; }

.role-icon {
    width: 42px;
    height: 42px;
    border-radius: 21px;
    background: var(--surface-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.role-icon.selected { background: var(--ink); }
.role-name { flex: 1; font-size: 18px; font-weight: 800; color: var(--ink); }
.role-name.large { font-size: 19px; }

.round-check {
    width: 26px;
    height: 26px;
    border-radius: 13px;
    border: 1.5px solid #D0D0D4;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.round-check.selected { background: var(--ink); border-color: var(--ink); }

.loading-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 32px;
    gap: 12px;
    text-align: center;
}
.loading-text { font-size: 16px; font-weight: 700; color: var(--ink-strong); }
.loading-subtext { font-size: 14px; color: var(--muted-2); }
.retry-button {
    margin-top: 12px;
    min-height: 48px;
    padding: 0 24px;
    border-radius: 30px;
    background: #000;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
}

/* ---------- tabs ---------- */

.tabs-shell { min-height: 100dvh; background: var(--page); }

.tab-content {
    max-width: 640px;
    margin: 0 auto;
    padding-bottom: calc(72px + var(--safe-bottom));
}

.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: flex;
    justify-content: center;
    background: #fff;
    border-top: 1px solid #E5E7EB;
    padding-bottom: var(--safe-bottom);
}

.tab {
    flex: 1;
    max-width: 160px;
    height: 58px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #8E8E93;
    font-size: 11px;
    font-weight: 600;
}
.tab.active { color: #007AFF; }

.screen {
    padding: calc(20px + var(--safe-top)) 20px 20px;
    position: relative;
    min-height: calc(100dvh - 72px);
}

.list { display: flex; flex-direction: column; gap: 12px; padding-bottom: 110px; }
.admin-list { gap: 16px; padding-bottom: 32px; }
.list-section-title { margin-top: 6px; margin-bottom: -4px; font-size: 13px; font-weight: 800; letter-spacing: .6px; }

.message-card {
    padding: 18px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.message-title { font-size: 18px; font-weight: 800; }
.message-text { color: var(--muted); font-size: 15px; }
.top-gap { margin-top: 8px; }

.card {
    background: #fff;
    border-radius: 20px;
    padding: 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.badge {
    align-self: flex-start;
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--surface-gray);
    font-size: 12px;
    font-weight: 700;
    color: #444;
}
.badge.large { padding: 6px 12px; font-size: 13px; }
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; }

.round-button {
    width: 38px;
    height: 38px;
    border-radius: 19px;
    background: var(--surface-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.icon-button { display: flex; align-items: center; justify-content: center; padding: 4px; }

.dark-button {
    width: 100%;
    min-height: 48px;
    border-radius: 14px;
    background: var(--ink);
    color: #fff;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ---------- activiteiten ---------- */

.form-card {
    background: #fff;
    border-radius: 20px;
    padding: 16px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.form-header { display: flex; align-items: center; justify-content: space-between; }
.section-title { font-size: 17px; font-weight: 800; }

.field-input {
    min-height: 48px;
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--border-input);
    background: var(--surface-soft);
    padding: 0 14px;
    font-size: 15px;
    outline: none;
}
.field-input:focus { border-color: #C9C9CE; }

.picker-field {
    min-height: 58px;
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--border-input);
    background: var(--surface-soft);
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
}
.picker-stack { flex: 1; display: flex; flex-direction: column; min-width: 0; cursor: pointer; }
.picker-value { display: block; margin-top: 3px; font-size: 15px; font-weight: 700; color: var(--ink); }
.picker-value.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.input-label { display: block; }

.native-picker {
    margin-top: 3px;
    border: 0;
    background: transparent;
    padding: 0;
    font-size: 15px;
    font-weight: 700;
    min-height: 22px;
    width: 100%;
    outline: none;
}
/* Eigen icoon staat al naast het veld; het veld zelf opent de picker (showPicker). */
.native-picker::-webkit-calendar-picker-indicator { display: none; }
.native-picker { cursor: pointer; }

.activity-card {
    background: #fff;
    border-radius: 20px;
    padding: 14px;
    border: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.activity-icon {
    width: 42px;
    height: 42px;
    border-radius: 21px;
    background: var(--surface-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    flex-shrink: 0;
}
.activity-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.activity-title { font-weight: 800; }
.activity-subtitle { color: var(--muted); }
.activity-info .badge { margin-top: 6px; }
.activity-date { margin-top: 4px; font-weight: 700; }
.response-count { margin-top: 4px; font-size: 12px; color: var(--muted); }

.signup-row { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.signup-button {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--border-input);
    background: var(--surface-soft);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
}
.signup-button.signed-up { background: var(--success); border-color: var(--success); color: #fff; }
.signup-button.signoff { color: var(--danger); }
.signup-button.not-coming { background: var(--danger); border-color: var(--danger); color: #fff; }

.card-menu { position: relative; }
.menu-backdrop { position: fixed; inset: 0; z-index: 40; }
.dropdown {
    position: absolute;
    top: 44px;
    right: 0;
    width: 145px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--border);
    padding: 6px 0;
    z-index: 50;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .12);
}
.dropdown-item {
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
}
.dropdown-item:hover { background: var(--surface-soft); }
.dropdown-item.danger { color: var(--danger); }

.fab {
    position: fixed;
    right: max(24px, calc(50vw - 320px + 24px));
    bottom: calc(72px + 28px + var(--safe-bottom));
    width: 58px;
    height: 58px;
    border-radius: 29px;
    background: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(0, 0, 0, .25);
    z-index: 30;
}

/* ---------- bottom sheets ---------- */

.sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    z-index: 100;
    animation: fade .2s ease-out;
}
.sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 101;
    max-width: 640px;
    max-height: 88dvh;
    overflow-y: auto;
    margin: 0 auto;
    background: #fff;
    border-radius: 28px 28px 0 0;
    padding: 10px 20px calc(32px + var(--safe-bottom));
    animation: slide-up .25s ease-out;
}
@keyframes fade { from { opacity: 0; } }
@keyframes slide-up { from { transform: translateY(100%); } }

.sheet-handle { width: 42px; height: 5px; border-radius: 999px; background: #D1D5DB; margin: 0 auto 16px; }
.sheet-header { display: flex; align-items: center; justify-content: space-between; }
.sheet-title { font-size: 20px; font-weight: 800; }
.sheet-explanation { margin-top: 14px; color: var(--muted); line-height: 20px; }

.options { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.option {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    width: 100%;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid var(--border-input);
    background: var(--surface-soft);
    font-size: 15px;
    font-weight: 600;
}
.option.spread { justify-content: space-between; }
.option.selected { border-color: var(--ink); background: var(--surface-gray); }
.radio {
    width: 20px;
    height: 20px;
    border-radius: 10px;
    border: 2px solid var(--placeholder);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.radio.selected { border-color: var(--ink); }
.radio.selected::after { content: ""; width: 10px; height: 10px; border-radius: 5px; background: var(--ink); }

.notice {
    margin-top: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px;
    border-radius: 14px;
    background: var(--surface-soft);
    border: 1px solid var(--border-input);
    line-height: 20px;
}

.sheet-button {
    margin-top: 20px;
    width: 100%;
    min-height: 52px;
    border-radius: 16px;
    background: var(--ink);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    text-align: center;
}

.roster-list { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.roster-row { padding: 14px; border-radius: 14px; background: var(--surface-soft); border: 1px solid var(--border-input); }
.roster-name { font-size: 15px; font-weight: 800; }
.roster-meta { margin-top: 3px; color: var(--muted); }
.roster-meta.pending { color: #B45309; font-weight: 700; }

/* ---------- groepen ---------- */

.card-header { width: 100%; display: flex; align-items: center; gap: 12px; }
.role-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.role-count { margin-top: 2px; font-size: 14px; color: var(--label); }
.empty-state { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: #F8F8F9; color: var(--label); font-size: 14px; }
.users-list { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.user-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 14px;
    background: var(--surface-soft);
}
.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.avatar.lg { width: 46px; height: 46px; font-size: 15px; }
.avatar.xl { width: 84px; height: 84px; font-size: 26px; }
.avatar.xxl { width: 96px; height: 96px; font-size: 28px; }
.user-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.user-name { font-size: 16px; font-weight: 700; }
.user-email { margin-top: 2px; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }

.detail-head { margin-top: 18px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.detail-name { margin-top: 14px; font-size: 20px; font-weight: 800; }
.detail-email { margin-top: 4px; font-size: 15px; color: var(--muted); }
.detail-phone, .parent-phone { margin-top: 6px; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.parents-list { display: flex; flex-direction: column; gap: 10px; }
.parent-card { padding: 14px; border-radius: 14px; background: var(--surface-soft); border: 1px solid var(--border-input); }
.parent-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.parent-name { font-size: 15px; font-weight: 800; }

/* ---------- beheer ---------- */

.admin-card { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.admin-card.needs-role { border-color: #F59E0B; background: #FFFBEB; }
.warning-badge {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border-radius: 999px;
    background: #FEF3C7;
    color: var(--warning);
    font-size: 12px;
    font-weight: 800;
}
.pending-hint { font-size: 13px; font-weight: 600; color: var(--warning); }
.user-header { display: flex; align-items: center; gap: 12px; }
.admin-name { font-size: 17px; font-weight: 800; }

.dropdown-button {
    width: 100%;
    min-height: 58px;
    border-radius: 16px;
    background: var(--surface-soft);
    border: 1px solid var(--border-input);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.dropdown-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dropdown-panel {
    border-radius: 16px;
    background: var(--surface-soft);
    border: 1px solid var(--border-input);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.role-option {
    width: 100%;
    min-height: 46px;
    border-radius: 12px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #222;
}
.checkbox {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    border: 1.5px solid #CFCFD4;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.checkbox.active { background: var(--ink); border-color: var(--ink); }
.save-button, .delete-button {
    margin-top: 8px;
    width: 100%;
    min-height: 48px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 800;
    text-align: center;
}
.save-button { background: var(--ink); color: #fff; }
.delete-button { background: #FEF2F2; border: 1px solid #FCA5A5; color: var(--danger-strong); }

/* ---------- profiel ---------- */

img.avatar { object-fit: cover; background: var(--surface-gray); }

.avatar-wrapper { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 20px; }
.avatar-picker { position: relative; cursor: pointer; border-radius: 50%; }
.avatar-picker.busy { opacity: .6; pointer-events: none; }
.avatar-badge {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 32px;
    height: 32px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}
.avatar-actions { display: flex; gap: 16px; }
.avatar-actions button { font-size: 14px; font-weight: 700; color: var(--ink); }
.avatar-actions button.danger { color: var(--danger); }
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
.field-card { background: #fff; border-radius: 16px; padding: 14px; border: 1px solid var(--border); margin-bottom: 12px; }
.field-value { margin-top: 3px; font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.profile-card { padding: 16px; margin-bottom: 12px; box-shadow: none; }
.profile-card + .dark-button { margin-top: 8px; font-size: 15px; }

/* ---------- dialogen (Alert.alert) ---------- */

.dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, .4);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fade .15s ease-out;
}
.dialog {
    width: 100%;
    max-width: 340px;
    background: #fff;
    border-radius: 20px;
    padding: 22px 20px 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, .2);
}
.dialog-title { font-size: 18px; font-weight: 800; text-align: center; }
.dialog-message { margin-top: 8px; color: #444; text-align: center; line-height: 1.4; }
.dialog-buttons { margin-top: 20px; display: flex; gap: 8px; }
.dialog-button {
    flex: 1;
    min-height: 46px;
    border-radius: 14px;
    background: var(--ink);
    color: #fff;
    font-weight: 800;
    text-align: center;
}
.dialog-button.cancel { background: var(--surface-gray); color: var(--ink); }
.dialog-button.destructive { background: var(--danger-strong); }
