/* PT Studio: eigen stylesheet, geen externe lettertypen of CDN. */

:root {
    --bg: #f5f5f1;
    --surface: #ffffff;
    --surface-2: #fafaf7;
    --surface-3: #efefea;
    --border: #e6e5de;
    --border-strong: #d2d0c6;
    --text: #181816;
    --text-2: #3d3c37;
    --muted: #6f6d64;
    --accent: #c8f53c;
    --accent-strong: #a6d61a;
    --accent-ink: #141a00;
    --ink: #151513;
    --ink-2: #2c2c26;
    --orange: #ef6c1a;
    --orange-soft: #fff0e5;
    --red: #e5484d;
    --red-soft: #fdecec;
    --blue: #2f6ff0;
    --blue-soft: #eaf1ff;
    --green: #23885a;
    --green-soft: #e3f5ec;
    --violet: #6d4cf5;
    --violet-soft: #f0ecff;
    --side-bg: #ffffff;
    --side-border: #e6e5de;
    --side-text: #4a4943;
    --side-strong: #181816;
    --side-muted: #9a988e;
    --side-hover: #f3f3ee;
    --side-active: #eef6d4;
    --side-accent: #4d6b00;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(20, 20, 15, .04), 0 4px 16px rgba(20, 20, 15, .05);
    --shadow-lg: 0 10px 40px rgba(20, 20, 15, .16);
    --font: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
    color-scheme: light;
}

/* Donker: gekozen via de schakelaar, of automatisch als het apparaat donker staat en er niets gekozen is. */
:root[data-theme="dark"] {
    --bg: #0e0e0d;
    --surface: #171715;
    --surface-2: #1c1c1a;
    --surface-3: #242421;
    --border: #2b2b27;
    --border-strong: #3a3a35;
    --text: #f3f2ec;
    --text-2: #d6d4cb;
    --muted: #9b998f;
    --ink: #c8f53c;
    --ink-2: #b5e22d;
    --orange-soft: #33210f;
    --red-soft: #351616;
    --blue-soft: #14213d;
    --green-soft: #10291c;
    --violet-soft: #221a40;
    --side-bg: #121211;
    --side-border: #262624;
    --side-text: #bdbcb3;
    --side-strong: #ffffff;
    --side-muted: #77766d;
    --side-hover: #1f1f1d;
    --side-active: #262623;
    --side-accent: #c8f53c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0e0e0d;
        --surface: #171715;
        --surface-2: #1c1c1a;
        --surface-3: #242421;
        --border: #2b2b27;
        --border-strong: #3a3a35;
        --text: #f3f2ec;
        --text-2: #d6d4cb;
        --muted: #9b998f;
        --ink: #c8f53c;
        --ink-2: #b5e22d;
        --orange-soft: #33210f;
        --red-soft: #351616;
        --blue-soft: #14213d;
        --green-soft: #10291c;
        --violet-soft: #221a40;
        --side-bg: #121211;
        --side-border: #262624;
        --side-text: #bdbcb3;
        --side-strong: #ffffff;
        --side-muted: #77766d;
        --side-hover: #1f1f1d;
        --side-active: #262623;
        --side-accent: #c8f53c;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
        color-scheme: dark;
}
}

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

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: 1.9rem; font-weight: 750; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0; }
a { color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.tiny { font-size: .75rem; }
.strong { font-weight: 650; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1; }
.hidden { display: none !important; }

/* ---- Shell ---------------------------------------------------------------------------------------------------- */

.app-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; min-height: 100dvh; }

.sidebar {
    background: var(--side-bg);
    color: var(--side-text);
    border-right: 1px solid var(--side-border);
    display: flex;
    flex-direction: column;
    padding: 22px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    z-index: 20;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 24px; text-decoration: none; color: var(--side-strong); }
.brand-mark {
    width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0;
    background: var(--accent); color: var(--accent-ink);
    display: grid; place-items: center; font-weight: 800; font-size: 15px; letter-spacing: -0.04em;
}
.brand-name { font-weight: 750; font-size: 1.05rem; letter-spacing: -0.02em; }
.brand-name span { color: var(--side-accent); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--side-muted); padding: 16px 12px 6px; }
.nav a {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 12px; border-radius: 10px;
    color: var(--side-text); text-decoration: none; font-weight: 540; font-size: .95rem;
    transition: background .15s, color .15s;
}
.nav a:hover { background: var(--side-hover); color: var(--side-strong); }
.nav a.active { background: var(--side-active); color: var(--side-strong); font-weight: 620; }
.nav a.active svg { color: var(--side-accent); }

.sidebar-footer { margin-top: auto; border-top: 1px solid var(--side-border); padding-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.sidebar-footer .me { display: flex; align-items: center; gap: 10px; }
.sidebar-footer .who { flex: 1; min-width: 0; }
.sidebar-footer .who strong { display: block; color: var(--side-strong); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer .who a { font-size: .75rem; color: var(--side-muted); text-decoration: none; }
.sidebar-footer .who a:hover { color: var(--side-strong); }
.sidebar-footer form { margin: 0; }
.icon-button { background: none; border: 0; color: var(--side-muted); padding: 8px; border-radius: 9px; cursor: pointer; display: grid; place-items: center; }
.icon-button:hover { background: var(--side-hover); color: var(--side-strong); }

.theme-toggle { display: flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--side-hover); }
.theme-toggle button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: transparent; color: var(--side-muted); padding: 6px 8px; border-radius: 8px; cursor: pointer; font: inherit; font-size: .78rem; font-weight: 600; }
.theme-toggle button.active { background: var(--side-bg); color: var(--side-strong); box-shadow: var(--shadow); }

.mobile-top { display: none; }

.main { min-width: 0; padding: 32px clamp(18px, 4vw, 48px) 64px; max-width: 1400px; width: 100%; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-header .eyebrow { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.page-header .eyebrow a { text-decoration: none; }
.page-header .eyebrow a:hover { color: var(--text); }
.page-header p { color: var(--muted); margin-top: 6px; }

/* Tablet (iPad staand): smalle balk met alleen iconen. */
@media (max-width: 1100px) and (min-width: 761px) {
    .app-shell { grid-template-columns: 76px 1fr; }
    .sidebar { padding: 18px 10px; align-items: center; }
    .brand { padding: 0 0 18px; }
    .brand-name, .nav-label, .nav a span, .sidebar-footer .who, .theme-toggle span { display: none; }
    .nav { width: 100%; }
    .nav a { justify-content: center; padding: 12px; }
    .nav a svg { width: 22px; height: 22px; }
    .sidebar-footer { width: 100%; align-items: center; }
    .sidebar-footer .me { flex-direction: column; }
    .theme-toggle { flex-direction: column; }
}

/* Telefoon: balk bovenin met account, navigatie onderin zoals een iPhone-app. */
@media (max-width: 760px) {
    .app-shell { display: block; }
    .mobile-top {
        display: flex; align-items: center; gap: 10px;
        position: sticky; top: 0; z-index: 25;
        padding: calc(10px + var(--safe-top)) 14px 10px;
        background: color-mix(in srgb, var(--side-bg) 88%, transparent);
        backdrop-filter: saturate(180%) blur(14px);
        -webkit-backdrop-filter: saturate(180%) blur(14px);
        border-bottom: 1px solid var(--side-border);
    }
    .mobile-top .brand { padding: 0; flex: 1; }
    .mobile-top form { margin: 0; }
    .sidebar {
        position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto;
        flex-direction: row; padding: 6px 6px calc(6px + var(--safe-bottom));
        border-right: 0; border-top: 1px solid var(--side-border);
        background: color-mix(in srgb, var(--side-bg) 92%, transparent);
        backdrop-filter: saturate(180%) blur(14px);
        -webkit-backdrop-filter: saturate(180%) blur(14px);
    }
    .sidebar > .brand, .sidebar-footer, .nav-label { display: none; }
    .nav { flex-direction: row; width: 100%; justify-content: space-around; }
    .nav a { flex: 1; flex-direction: column; gap: 2px; padding: 6px 2px; font-size: .68rem; font-weight: 600; text-align: center; border-radius: 12px; }
    .nav a svg { width: 22px; height: 22px; }
    .nav a.active { background: transparent; }
    .main { padding: 18px 14px calc(96px + var(--safe-bottom)); }
    .page-header { margin-bottom: 18px; align-items: stretch; }
    .page-header > * { width: 100%; }
    .page-header .row { width: 100%; }
    .page-header .search, .page-header .search .input { width: 100%; min-width: 0; }
    h1 { font-size: 1.55rem; }
}

/* ---- Cards en grids ------------------------------------------------------------------------------------------- */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card-flat { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-header h2, .card-header h3 { display: flex; align-items: center; gap: 8px; }
.card-dark { background: #121211; color: #f3f2ec; border-color: #121211; }
.card-dark .muted { color: #9b998f; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-main { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-label { font-size: .8rem; color: var(--muted); font-weight: 560; display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 1.8rem; font-weight: 750; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: .9rem; font-weight: 600; color: var(--muted); margin-left: 3px; }

/* ---- Knoppen -------------------------------------------------------------------------------------------------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 1px solid transparent; border-radius: 11px;
    padding: 9px 15px; font: inherit; font-weight: 600; font-size: .92rem;
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--ink-2); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: var(--accent-strong); }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--muted); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { padding: 6px 10px; font-size: .83rem; border-radius: 9px; }
.btn-icon { padding: 7px; border-radius: 9px; background: transparent; color: var(--muted); border: 0; }
.btn-icon:hover { background: var(--surface-3); color: var(--text); }
.btn-icon.danger:hover { background: var(--red-soft); color: var(--red); }
.btn-block { width: 100%; }

/* ---- Chips en badges ------------------------------------------------------------------------------------------ */

.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 999px;
    border: 1px solid var(--border-strong); background: var(--surface);
    font: inherit; font-size: .86rem; font-weight: 560; color: var(--text-2);
    cursor: pointer; transition: all .15s; user-select: none;
}
.chip:hover { border-color: var(--muted); }
.chip.selected { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip .order { background: var(--accent); color: var(--accent-ink); border-radius: 999px; width: 18px; height: 18px; display: grid; place-items: center; font-size: .7rem; font-weight: 750; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: .75rem; font-weight: 620; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge-accent { background: var(--accent); color: var(--accent-ink); }
.badge-orange { background: var(--orange-soft); color: var(--orange); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-violet { background: var(--violet-soft); color: var(--violet); }
.badge-dark { background: var(--ink); color: var(--bg); }

/* ---- Formulieren ---------------------------------------------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: .82rem; font-weight: 620; color: var(--text-2); }
.field .hint { font-size: .78rem; color: var(--muted); }
.input, .select, .textarea, input.input, select.select {
    width: 100%; font: inherit; color: var(--text);
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    padding: 9px 12px; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent); }
.textarea { min-height: 84px; resize: vertical; }
.input-sm { padding: 6px 9px; font-size: .88rem; border-radius: 8px; }
.input-num { width: 76px; text-align: center; font-variant-numeric: tabular-nums; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.form-section { display: grid; grid-template-columns: 240px 1fr; gap: 28px; padding: 26px 0; border-bottom: 1px solid var(--border); }
.form-section:first-child { padding-top: 0; }
.form-section:last-of-type { border-bottom: 0; }
.form-section h3 { margin-bottom: 6px; }
@media (max-width: 900px) { .form-section { grid-template-columns: 1fr; gap: 14px; } }
.validation-message { color: var(--red); font-size: .8rem; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: .92rem; }
.checkbox input { width: 17px; height: 17px; accent-color: var(--ink); }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: .9rem; }
.alert svg { flex-shrink: 0; margin-top: 1px; }
.alert-info { background: var(--blue-soft); color: var(--text); }
.alert-info svg { color: var(--blue); }
.alert-warn { background: var(--orange-soft); color: var(--text); }
.alert-warn svg { color: var(--orange); }
.alert-error { background: var(--red-soft); color: var(--text); }
.alert-error svg { color: var(--red); }
.alert-success { background: var(--green-soft); color: var(--text); }
.alert-success svg { color: var(--green); }

/* ---- Tabs ----------------------------------------------------------------------------------------------------- */

.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-3); border-radius: 13px; width: fit-content; max-width: 100%; overflow-x: auto; margin-bottom: 22px; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; text-decoration: none; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tab .count { background: var(--surface-3); border-radius: 999px; padding: 0 7px; font-size: .75rem; }

.segmented { display: inline-flex; gap: 2px; background: var(--surface-3); padding: 3px; border-radius: 11px; }
.segmented button { border: 0; background: transparent; padding: 6px 11px; border-radius: 8px; font: inherit; font-size: .83rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---- Tabellen ------------------------------------------------------------------------------------------------- */

.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

/* ---- Avatars en cliëntkaarten --------------------------------------------------------------------------------- */

.avatar {
    --h: 90;
    width: 44px; height: 44px; border-radius: 14px; flex-shrink: 0;
    display: grid; place-items: center; font-weight: 750; font-size: .95rem; letter-spacing: -0.02em;
    background: linear-gradient(135deg, hsl(var(--h) 85% 72%), hsl(calc(var(--h) + 40) 80% 60%));
    color: hsl(var(--h) 60% 14%);
}
.avatar-lg { width: 64px; height: 64px; border-radius: 20px; font-size: 1.35rem; }

.client-card { display: flex; flex-direction: column; gap: 14px; text-decoration: none; transition: transform .15s, box-shadow .15s, border-color .15s; }
.client-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.client-card .head { display: flex; gap: 12px; align-items: center; }
.client-card .name { font-weight: 700; font-size: 1.02rem; }
.client-card .meta { display: flex; gap: 14px; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: 12px; }
.client-card .meta span { display: inline-flex; align-items: center; gap: 5px; }
.client-card .meta .on { color: var(--green); }

.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 38px; min-width: 260px; }

.empty { text-align: center; padding: 56px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .icon-wrap { width: 56px; height: 56px; border-radius: 18px; background: var(--surface-3); display: grid; place-items: center; color: var(--muted); margin-bottom: 6px; }
.empty p { color: var(--muted); max-width: 420px; }

/* ---- Trainingsschema ------------------------------------------------------------------------------------------ */

.session { padding: 0; overflow: hidden; }
.session-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); flex-wrap: wrap; }
.session-head .title { flex: 1; min-width: 200px; }
.session-head .title input { font: inherit; font-weight: 700; font-size: 1.05rem; border: 1px solid transparent; background: transparent; padding: 2px 6px; margin-left: -6px; border-radius: 7px; width: 100%; color: var(--text); }
.session-head .title input:hover { border-color: var(--border-strong); }
.session-head .title input:focus { outline: none; border-color: var(--text); background: var(--surface); }
.session-format { padding: 12px 20px; background: var(--violet-soft); font-size: .88rem; display: flex; gap: 10px; align-items: flex-start; }
.session-format svg { color: var(--violet); flex-shrink: 0; margin-top: 2px; }
.session-body { padding: 6px 12px 12px; }
.session-foot { display: flex; gap: 18px; padding: 12px 20px; border-top: 1px solid var(--border); font-size: .83rem; color: var(--muted); flex-wrap: wrap; }
.session-foot strong { color: var(--text-2); font-weight: 620; }

.ex-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 8px; border-radius: 12px; }
.ex-row + .ex-row { border-top: 1px dashed var(--border); }
.ex-row:hover { background: var(--surface-2); }
.ex-block { width: 30px; height: 30px; border-radius: 9px; background: var(--surface-3); display: grid; place-items: center; font-weight: 750; font-size: .78rem; color: var(--text-2); }
.ex-block.finisher { background: var(--orange-soft); color: var(--orange); }
.ex-block.wod { background: var(--violet-soft); color: var(--violet); }
.ex-name { font-weight: 640; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.ex-sub { font-size: .8rem; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.ex-dose { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.ex-dose .big { font-weight: 720; font-size: 1rem; }
.ex-dose input { width: 52px; padding: 5px 4px; text-align: center; font: inherit; font-size: .88rem; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); }
.ex-actions { display: flex; gap: 2px; opacity: .55; transition: opacity .15s; }
.ex-row:hover .ex-actions { opacity: 1; }
.ex-note { grid-column: 2 / -1; font-size: .8rem; color: var(--muted); }
.ex-note.caution { color: var(--orange); display: flex; gap: 6px; align-items: center; }
.last-weight { font-size: .78rem; background: var(--green-soft); color: var(--green); padding: 2px 8px; border-radius: 999px; font-weight: 620; }
@media (max-width: 720px) {
    .ex-row { grid-template-columns: 30px 1fr; }
    .ex-dose, .ex-actions { grid-column: 2; }
    .ex-actions { opacity: 1; }
}

.plan-list-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%; }
.plan-list-item:hover { border-color: var(--border-strong); }
.plan-list-item.selected { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }

/* ---- Modals en toasts ----------------------------------------------------------------------------------------- */

.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 10, 8, .5); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; padding: 20px; animation: fade .15s ease-out; }
.modal { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); width: min(640px, 100%); max-height: min(86vh, 900px); display: flex; flex-direction: column; animation: pop .18s ease-out; border: 1px solid var(--border); }
.modal-wide { width: min(900px, 100%); }
.modal-head { padding: 20px 22px 14px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.option-list { display: flex; flex-direction: column; gap: 6px; }
.option { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%; transition: border-color .15s, background .15s; }
.option:hover { border-color: var(--text); background: var(--surface-2); }
.option .grow { min-width: 0; }

.toast-host { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 60; }
.toast { background: #121211; color: #f3f2ec; padding: 12px 16px; border-radius: 13px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px; font-size: .9rem; animation: pop .2s ease-out; max-width: 420px; }
.toast svg { color: var(--accent); flex-shrink: 0; }

/* ---- Voeding -------------------------------------------------------------------------------------------------- */

.macro-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 720px) { .macro-grid { grid-template-columns: repeat(2, 1fr); } }
.macro { padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.macro .v { font-size: 1.4rem; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.macro .l { font-size: .78rem; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 99px; display: inline-block; }
.dot-kcal { background: var(--ink); }
.dot-p { background: var(--blue); }
.dot-c { background: var(--accent-strong); }
.dot-f { background: var(--orange); }

.bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; display: flex; }
.bar > span { display: block; height: 100%; }
.bar-p { background: var(--blue); }
.bar-c { background: var(--accent-strong); }
.bar-f { background: var(--orange); }
.bar-fill { background: var(--ink); border-radius: 99px; }

.meal { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border); align-items: start; }
.meal:last-child { border-bottom: 0; }
.meal-type { font-size: .78rem; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-top: 3px; }
.meal-title { font-weight: 680; font-size: 1rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.meal-macros { display: flex; gap: 12px; font-size: .8rem; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.meal-macros b { color: var(--text-2); font-weight: 650; }
.meal details { margin-top: 8px; font-size: .88rem; }
.meal summary { cursor: pointer; color: var(--muted); font-weight: 560; font-size: .83rem; }
.meal ul { margin: 8px 0; padding-left: 18px; }
.meal li { margin: 2px 0; }
.meal-actions { display: flex; align-items: center; gap: 4px; }
.portion { display: inline-flex; align-items: center; gap: 2px; background: var(--surface-3); border-radius: 9px; padding: 2px; }
.portion button { border: 0; background: transparent; width: 26px; height: 26px; border-radius: 7px; cursor: pointer; color: var(--text-2); font-size: 1rem; font-weight: 700; }
.portion button:hover { background: var(--surface); }
.portion span { min-width: 42px; text-align: center; font-size: .83rem; font-weight: 650; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .meal { grid-template-columns: 1fr; gap: 6px; } }

.day-tabs { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 16px; }
.day-tab { border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 8px 4px; cursor: pointer; font: inherit; color: var(--text-2); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.day-tab b { font-size: .85rem; }
.day-tab span { font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.day-tab.active { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.day-tab.active span { color: color-mix(in srgb, var(--bg) 70%, transparent); }

.shop-group { break-inside: avoid; margin-bottom: 18px; }
.shop-group h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 6px; }
.shop-item { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--border); cursor: pointer; font-size: .92rem; }
.shop-item input { width: 17px; height: 17px; accent-color: var(--ink); }
.shop-item .amt { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.shop-item.done .name { text-decoration: line-through; color: var(--muted); }
.shop-columns { columns: 2 260px; column-gap: 32px; }

/* ---- Grafiek -------------------------------------------------------------------------------------------------- */

.chart { width: 100%; height: auto; display: block; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 10px; font-family: var(--font); }
.chart .line { fill: none; stroke: var(--ink); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: color-mix(in srgb, var(--accent) 35%, transparent); }
.chart .pt { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }

.progress-card { display: flex; flex-direction: column; gap: 10px; }
.trend-up { color: var(--green); font-weight: 650; }
.trend-down { color: var(--red); font-weight: 650; }

.set-row { display: grid; grid-template-columns: 34px 1fr 1fr 34px; gap: 8px; align-items: center; }
.set-row .n { font-size: .8rem; color: var(--muted); font-weight: 650; text-align: center; }

/* ---- Inlogpagina ---------------------------------------------------------------------------------------------- */

.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-visual { background: #121211; color: #f3f2ec; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-visual::before { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(200, 245, 60, .35), transparent 65%); right: -160px; top: -120px; }
.auth-visual::after { content: ""; position: absolute; width: 380px; height: 380px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 122, 41, .22), transparent 65%); left: -120px; bottom: -120px; }
.auth-visual > * { position: relative; z-index: 1; }
.auth-visual h1 { font-size: clamp(2rem, 3.4vw, 3rem); font-weight: 780; letter-spacing: -0.04em; max-width: 520px; }
.auth-visual h1 span { color: var(--accent); }
.auth-visual ul { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-direction: column; gap: 12px; color: #c9c8bf; }
.auth-visual li { display: flex; gap: 10px; align-items: center; }
.auth-visual li svg { color: var(--accent); }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 900px) { .auth-page { grid-template-columns: 1fr; } .auth-visual { display: none; } }

/* ---- Afdrukken ------------------------------------------------------------------------------------------------ */

.print-page { max-width: 900px; margin: 0 auto; padding: 32px 24px 60px; background: var(--surface); min-height: 100vh; }
.print-page h1 { font-size: 1.6rem; }
.print-header { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--text); padding-bottom: 14px; margin-bottom: 20px; gap: 16px; }
.print-session { break-inside: avoid; margin-bottom: 22px; }
.print-session h2 { font-size: 1.1rem; margin-bottom: 4px; }
.print-table { width: 100%; border-collapse: collapse; font-size: .88rem; margin-top: 8px; }
.print-table th, .print-table td { border-bottom: 1px solid var(--border); padding: 7px 8px; text-align: left; }
.print-table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.print-table td.log { width: 90px; border-left: 1px solid var(--border); }
.print-actions { display: flex; gap: 10px; margin-bottom: 20px; }

@media print {
    :root { color-scheme: light; --bg: #fff; --surface: #fff; --surface-2: #fff; --text: #000; --muted: #555; --border: #ccc; --ink: #000; }
    body { background: #fff; font-size: 11pt; }
    .no-print, .print-actions, .sidebar, .toast-host { display: none !important; }
    .print-page { padding: 0; max-width: none; }
    .app-shell { display: block; }
    .main { padding: 0; }
    .card { box-shadow: none; }
    a { text-decoration: none; }
}

/* ---- Aanraakschermen (iPhone, iPad) --------------------------------------------------------------------------- */

@media (pointer: coarse) {
    /* iOS zoomt in op velden kleiner dan 16px. */
    .input, .select, .textarea, input, select, textarea { font-size: 16px !important; }
    .btn { padding: 11px 16px; }
    .btn-sm { padding: 9px 12px; }
    .btn-icon { padding: 10px; }
    .chip { padding: 9px 14px; }
    .ex-actions { opacity: 1; }
    .ex-dose input { width: 58px; padding: 9px 4px; }
    .portion button { width: 36px; height: 36px; }
    .segmented button { padding: 9px 13px; }
    .tab { padding: 10px 14px; }
    .shop-item { padding: 10px 0; }
    .shop-item input, .checkbox input { width: 22px; height: 22px; }
}

@media (max-width: 760px) {
    .card { padding: 16px; border-radius: 14px; }
    .tabs { width: 100%; }
    .session-head { padding: 14px; }
    .session-body { padding: 4px 6px 10px; }
    .ex-row { grid-template-columns: 30px minmax(0, 1fr); gap: 8px 10px; padding: 12px 6px; }
    .ex-dose { grid-column: 2; flex-wrap: wrap; }
    .ex-actions { grid-column: 1 / -1; justify-content: flex-end; flex-wrap: wrap; border-top: 1px dashed var(--border); padding-top: 6px; }
    .modal-backdrop { place-items: end center; padding: 0; }
    .modal, .modal-wide { width: 100%; max-height: 92dvh; border-radius: 22px 22px 0 0; padding-bottom: var(--safe-bottom); }
    .toast-host { left: 14px; right: 14px; bottom: calc(84px + var(--safe-bottom)); }
    .toast { max-width: none; }
    .hide-sm { display: none !important; }
    .table td, .table th { padding: 10px 8px; }
    .meal { grid-template-columns: 1fr; }
    .meal-actions { justify-content: flex-end; }
    .search .input { min-width: 0; }
    .client-card .meta { flex-wrap: wrap; gap: 8px 14px; }
    .day-tab { padding: 8px 2px; }
}

/* ---- Trainingsmodus ------------------------------------------------------------------------------------------- */

.tm { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
.tm-top {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; gap: 12px;
    padding: calc(12px + var(--safe-top)) 18px 12px;
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border);
}
.tm-top .title { flex: 1; min-width: 0; }
.tm-top .title strong { display: block; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-top .title span { font-size: .8rem; color: var(--muted); }
.tm-clock { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.05rem; background: var(--surface-3); padding: 6px 12px; border-radius: 10px; }
.tm-progress { height: 4px; background: var(--surface-3); }
.tm-progress span { display: block; height: 100%; background: var(--accent-strong); transition: width .3s; }
.tm-strip { display: flex; gap: 8px; overflow-x: auto; padding: 12px 18px; scrollbar-width: none; }
.tm-strip::-webkit-scrollbar { display: none; }
.tm-chip { flex-shrink: 0; display: flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: .85rem; font-weight: 600; color: var(--text-2); cursor: pointer; max-width: 220px; }
.tm-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-chip.current { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tm-chip.done { border-color: var(--green); color: var(--green); }
.tm-chip.current.done { color: var(--bg); }
.tm-body { flex: 1; width: 100%; max-width: 860px; margin: 0 auto; padding: 6px 18px calc(150px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 16px; }
.tm-exercise h1 { font-size: clamp(1.6rem, 4.5vw, 2.2rem); }
.tm-target { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.tm-target .badge { font-size: .85rem; padding: 6px 12px; }
.tm-advice { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.tm-advice .kg { font-size: 2rem; font-weight: 780; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.tm-advice .kg small { font-size: 1rem; color: var(--muted); font-weight: 600; }
.tm-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.tm-stats div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.tm-stats b { display: block; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.tm-stats span { font-size: .75rem; color: var(--muted); }

.tm-set { display: grid; grid-template-columns: 44px minmax(0, 1.2fr) minmax(0, 1fr) 64px; gap: 10px; align-items: center; padding: 12px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); }
.tm-set.next { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.tm-set.done { background: var(--green-soft); border-color: transparent; }
.tm-set .n { font-weight: 750; font-size: 1.1rem; text-align: center; color: var(--muted); }
.tm-step { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; background: var(--surface-3); border-radius: 14px; overflow: hidden; }
.tm-step button { height: 54px; border: 0; background: transparent; font-size: 1.5rem; font-weight: 600; color: var(--text); cursor: pointer; }
.tm-step button:active { background: var(--border); }
.tm-step input { width: 100%; min-width: 0; height: 54px; border: 0; background: transparent; text-align: center; font: inherit; font-size: 1.25rem !important; font-weight: 750; color: var(--text); font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.tm-step input::-webkit-outer-spin-button, .tm-step input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tm-step .unit { font-size: .7rem; color: var(--muted); text-align: center; margin-top: -10px; padding-bottom: 6px; grid-column: 2; }
.tm-check { width: 64px; height: 64px; border-radius: 18px; border: 2px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.tm-check.on { background: var(--green); border-color: var(--green); color: #fff; }
.tm-set-labels { display: grid; grid-template-columns: 44px minmax(0, 1.2fr) minmax(0, 1fr) 64px; gap: 10px; padding: 0 12px; font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
@media (max-width: 520px) {
    .tm-set, .tm-set-labels { grid-template-columns: 30px minmax(0, 1.25fr) minmax(0, 1fr) 54px; gap: 6px; padding-left: 8px; padding-right: 8px; }
    .tm-step { grid-template-columns: 38px 1fr 38px; }
    .tm-step button { height: 50px; }
    .tm-step input { height: 50px; font-size: 1.1rem !important; }
    .tm-check { width: 54px; height: 54px; border-radius: 15px; }
    .tm-advice .kg { font-size: 1.6rem; }
}

.tm-bottom {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
    padding: 12px 18px calc(12px + var(--safe-bottom));
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid var(--border);
}
.tm-bottom-inner { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.tm-nav { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.btn-xl { padding: 17px 20px; font-size: 1.05rem; border-radius: 16px; }

.tm-rest { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-radius: 18px; background: var(--ink); color: var(--bg); }
.tm-rest.over { background: var(--accent); color: var(--accent-ink); animation: pulse 1s ease-in-out 3; }
.tm-ring { position: relative; width: 74px; height: 74px; flex-shrink: 0; }
.tm-ring svg { transform: rotate(-90deg); }
.tm-ring .track { stroke: color-mix(in srgb, currentColor 20%, transparent); }
.tm-ring .fill { stroke: var(--accent); transition: stroke-dashoffset .25s linear; }
.tm-rest.over .tm-ring .fill { stroke: var(--accent-ink); }
.tm-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.tm-rest .info { flex: 1; min-width: 0; }
.tm-rest .info strong { display: block; font-size: 1.05rem; }
.tm-rest .info span { font-size: .8rem; opacity: .75; }
.tm-rest button { border: 0; background: color-mix(in srgb, currentColor 14%, transparent); color: inherit; border-radius: 12px; padding: 12px 12px; font: inherit; font-weight: 700; cursor: pointer; min-width: 52px; }
@keyframes pulse { 50% { transform: scale(1.02); } }

.tm-start { display: flex; flex-direction: column; gap: 14px; }
.tm-start-list { display: flex; flex-direction: column; gap: 8px; }
.tm-start-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.tm-summary { text-align: center; padding: 32px 18px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.tm-summary .big { font-size: 3rem; }
.pr { background: var(--accent); color: var(--accent-ink); font-weight: 700; border-radius: 999px; padding: 2px 10px; font-size: .78rem; }

#blazor-error-ui { background: var(--red); color: #fff; bottom: 0; display: none; left: 0; padding: .7rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
#blazor-error-ui a { color: #fff; }

.components-reconnect-show, .components-reconnect-failed, .components-reconnect-rejected { }
