/* ============================================================
   BDSTally PWA — app.css
   Mobile-first dark theme matching Figma design
   ============================================================ */

/* ── Design tokens ─────────────────────────────────────────── */
:root {
    --bg:           #0a0e1a;
    --bg-card:      #141b2d;
    --bg-card-2:    #1a2235;
    --bg-input:     #1e2a3d;
    --accent:       #00c8ff;
    --accent-dim:   rgba(0, 200, 255, 0.15);
    --accent-glow:  rgba(0, 200, 255, 0.30);
    --text:         #ffffff;
    --text-2:       #94a3b8;
    --text-3:       #64748b;
    --border:       rgba(255, 255, 255, 0.07);
    --danger:       #ef4444;
    --success:      #22c55e;
    --warning:      #f97316;
    --nav-h:        65px;
    /* iOS safe-area-inset-bottom (home-indicator clearance). Provided here
       so every var(--safe-bottom) reference resolves — without this declaration
       the whole calc(...) expression that uses it becomes invalid and the
       property silently falls back to its initial value. 0px default for
       devices/browsers that don't expose env(safe-area-inset-bottom). */
    --safe-bottom:  env(safe-area-inset-bottom, 0px);
    --radius:       12px;
    --radius-sm:    8px;
    --radius-pill:  999px;
    --transition:   0.18s ease;
}

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

html {
    height: 100%;
    -webkit-text-size-adjust: 100%;
    touch-action: manipulation;
}

body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
                 Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }

img { display: block; max-width: 100%; }

/* ── Splash screen ──────────────────────────────────────────── */
#bds-splash {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    z-index: 9999;
    gap: 16px;
    transition: opacity 0.4s ease;
}
#bds-splash.hidden {
    opacity: 0;
    pointer-events: none;
}
.bds-splash__logo svg {
    filter: drop-shadow(0 0 16px var(--accent-glow));
}
.bds-splash__name {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text);
}
.bds-splash__spinner {
    width: 28px;
    height: 28px;
    border: 2.5px solid var(--bg-card-2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ── App shell ──────────────────────────────────────────────── */
#bds-pwa-app {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Screens container ──────────────────────────────────────── */
#bds-screens {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.bds-screen {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(var(--nav-h) + 16px);
    display: none;
}
.bds-screen.active { display: block; }

/* ── Login screen ───────────────────────────────────────────── */
#screen-login {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 32px 24px;
}
.bds-login__logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}
.bds-login__logo-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-dim);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bds-login__logo-icon svg { filter: drop-shadow(0 0 8px var(--accent-glow)); }
.bds-login__logo-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}
.bds-login__form {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.bds-login__title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
}
.bds-login__subtitle {
    font-size: 14px;
    color: var(--text-2);
    text-align: center;
    margin-bottom: 8px;
}
.bds-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.bds-form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.bds-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 16px;
    outline: none;
    transition: border-color var(--transition);
}
.bds-input:focus { border-color: var(--accent); }
.bds-input::placeholder { color: var(--text-3); opacity: 1; }
.bds-input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 100px var(--bg-input) inset;
    -webkit-text-fill-color: var(--text);
}

.bds-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px 20px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    transition: opacity var(--transition), transform var(--transition);
    -webkit-tap-highlight-color: transparent;
}
.bds-btn:active { transform: scale(0.98); opacity: 0.85; }
.bds-btn--primary {
    background: var(--accent);
    color: #000;
}
.bds-btn--primary:disabled { opacity: 0.5; pointer-events: none; }
.bds-btn--ghost {
    background: var(--bg-card);
    color: var(--text);
    border: 1.5px solid var(--border);
}
.bds-btn--danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1.5px solid rgba(239, 68, 68, 0.25);
}

.bds-login__error {
    font-size: 14px;
    color: var(--danger);
    text-align: center;
    min-height: 20px;
}

/* ── Bottom navigation ──────────────────────────────────────── */
/* Bar sits flush against the bottom edge of the screen (no gap for page
   content to peek through), but the icons live in the TOP --nav-h of the
   bar via padding-bottom — so the leftmost/rightmost icons still clear
   the iPhone screen's rounded corners. iOS auto-insets the viewport (we
   don't use viewport-fit=cover) so the home indicator is handled. */
#bds-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--nav-h) + 5px);
    padding-bottom: 5px;
    z-index: 100;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    display: none;
    align-items: center;
}
#bds-nav.visible { display: flex; }

.bds-nav__item {
    flex: 1;
    height: var(--nav-h);   /* 49px icon+label tap zone */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-3);
    font-size: 10px;
    font-weight: 500;
    padding: 0 4px;
    -webkit-tap-highlight-color: transparent;
    transition: color var(--transition);
    cursor: pointer;
    border: none;
    background: none;
}
.bds-nav__item.active { color: var(--accent); }
.bds-nav__item svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bds-nav__item.active svg { stroke-width: 2.2; }

/* ── Page header ────────────────────────────────────────────── */
.bds-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 8px;
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 10;
    border-bottom: 1px solid transparent;
}
.bds-page-header--border { border-bottom-color: var(--border); }
.bds-page-header__left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.bds-page-header__logo-icon {
    width: 30px;
    height: 30px;
    background: var(--accent-dim);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bds-page-header__logo-icon svg { width: 18px; height: 18px; fill: var(--accent); }
.bds-page-header__title {
    font-size: 18px;
    font-weight: 700;
}
.bds-page-header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.bds-icon-btn {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    -webkit-tap-highlight-color: transparent;
    transition: background var(--transition);
}
.bds-icon-btn:active { background: var(--bg-card-2); }
.bds-icon-btn svg { width: 18px; height: 18px; stroke: var(--text-2); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bds-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: var(--warning);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    border-radius: 50%;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 2px solid var(--bg);
}
.bds-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--warning);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
}

/* ── Dashboard screen ───────────────────────────────────────── */
.bds-dash-greeting {
    padding: 12px 20px 16px;
}
.bds-dash-greeting__name {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}
.bds-dash-greeting__sub {
    font-size: 13px;
    color: var(--text-2);
    margin-top: 3px;
}

/* KPI cards */
.bds-kpi-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 20px 20px;
}
.bds-kpi-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 18px 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.bds-kpi-card__value {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}
.bds-kpi-card__value--white { color: var(--text); }
.bds-kpi-card__label {
    font-size: 12px;
    color: var(--text-2);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}
.bds-kpi-card__label svg { width: 12px; height: 12px; stroke: var(--success); fill: none; }

/* Section headers */
.bds-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 20px 10px;
}
.bds-section-header__title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.bds-section-header__link {
    font-size: 13px;
    color: var(--accent);
    font-weight: 500;
}

/* Card lists */
.bds-card-list {
    padding: 0 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Message cards */
/* Messages Unread/All segmented filter (bell deep-links to Unread). */
.bds-msg-filter {
    display: flex;
    gap: 8px;
    padding: 12px 20px 4px;
}
.bds-msg-filter__btn {
    flex: 1;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-2);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.bds-msg-filter__btn.is-active {
    background: rgba(0, 200, 255, .14);
    color: #00C8FF;
    border-color: rgba(0, 200, 255, .4);
}
.bds-msg-filter__count { font-weight: 700; }

.bds-msg-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 14px 14px 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background var(--transition);
}
.bds-msg-card:active { background: var(--bg-card-2); }
.bds-msg-card--unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
}
.bds-msg-card__avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: var(--bg-card-2);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
}
.bds-msg-card__body { flex: 1; min-width: 0; }
.bds-msg-card__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 3px;
}
.bds-msg-card__name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bds-msg-card__time {
    font-size: 11px;
    color: var(--text-3);
    flex-shrink: 0;
}
.bds-msg-card__preview {
    font-size: 13px;
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Lesson cards */
.bds-lesson-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 14px 14px 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background var(--transition);
}
.bds-lesson-card:active { background: var(--bg-card-2); }
.bds-lesson-card__left { flex: 1; min-width: 0; }
.bds-lesson-card__name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bds-lesson-card__time {
    font-size: 13px;
    color: var(--text-2);
}
.bds-lesson-card__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
}
.bds-lesson-card__right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.bds-lesson-card__chevron svg {
    width: 16px; height: 16px;
    stroke: var(--text-3);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Pill badges */
.bds-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.bds-pill--default { background: var(--bg-card-2); color: var(--text-2); }
.bds-pill--today   { background: var(--accent); color: #000; }
.bds-pill--success { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.bds-pill--warning { background: rgba(249, 115, 22, 0.15); color: var(--warning); }
.bds-pill--danger  { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

/* ── Sticky header wrapper (header + search bar grouped) ────── */
/* Wrapping both in one sticky element avoids needing to know the
   header's height (which varies with safe-area-inset-top) */
.bds-sticky-top {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg);
}
.bds-sticky-top .bds-page-header {
    position: static; /* parent handles sticky */
}

/* ── Students screen ────────────────────────────────────────── */
.bds-search-bar {
    padding: 12px 20px;
    background: var(--bg);
}
.bds-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 0 14px;
    border: 1.5px solid var(--border);
    transition: border-color var(--transition);
}
.bds-search-wrap:focus-within { border-color: var(--accent); }
.bds-search-wrap svg { width: 16px; height: 16px; stroke: var(--text-3); fill: none; stroke-width: 2; flex-shrink: 0; }
.bds-search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 15px;
    padding: 13px 0;
}
.bds-search-input::placeholder { color: var(--text-3); }

/* Filter row (Training Type / License / Sort) — sits under the search input
   on the Students screen. Native selects keep the iOS picker UX consistent. */
.bds-filter-row {
    display: flex;
    gap: 8px;
    padding: 0 20px 10px;
    background: var(--bg);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.bds-filter-row::-webkit-scrollbar { display: none; }
.bds-filter-sel {
    flex: 1 1 0;
    min-width: 0;
    background: var(--bg-input);
    color: var(--text);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    padding: 8px 26px 8px 10px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='none' stroke='%2394a3b8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
}
.bds-filter-sel:focus { outline: none; border-color: var(--accent); }

/* Small inline badges shown next to a student name (Guaranteed / Licensed). */
.bds-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    vertical-align: 2px;
    line-height: 1.4;
}
.bds-badge--g   { color: #f59e0b; background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.3); }
.bds-badge--lic { color: #16a34a; background: rgba(22,163,74,.14);  border: 1px solid rgba(22,163,74,.35); }

.bds-student-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background var(--transition);
}
.bds-student-card:active { background: var(--bg-card-2); }
.bds-student-card__avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--accent-dim);
    color: var(--accent);
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
}
.bds-student-card__body { flex: 1; min-width: 0; }
.bds-student-card__name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 3px;
}
.bds-student-card__meta {
    font-size: 12px;
    color: var(--text-2);
}
.bds-student-card__right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}
.bds-student-card__hours {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
}
.bds-student-card__hours-label {
    font-size: 11px;
    color: var(--text-3);
}

/* ── Messages screen ────────────────────────────────────────── */
/* (uses .bds-msg-card already defined above) */
.bds-thread-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding-bottom: 0;
}
.bds-thread-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.bds-bubble {
    max-width: 78%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
}
.bds-bubble--in {
    align-self: flex-start;
    background: var(--bg-card);
    color: var(--text);
    border-bottom-left-radius: 4px;
}
.bds-bubble--out {
    align-self: flex-end;
    background: var(--accent);
    color: #000;
    border-bottom-right-radius: 4px;
}
.bds-bubble__time {
    font-size: 10px;
    margin-top: 4px;
    opacity: 0.6;
}
.bds-reply-bar {
    padding: 12px 16px;
    /* Lifts the textarea / send button well clear of the iPhone's rounded
       screen corners AND any phone-case bezel. align-items:flex-end means
       the controls stay anchored to the bottom of the content area, which
       is now ~40px higher than the bar's bottom edge. The padding region is
       bg-card so no page content peeks through. */
    padding-bottom: calc(40px + var(--safe-bottom));
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    align-items: flex-end;
}
.bds-reply-input {
    flex: 1;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 15px;
    padding: 10px 14px;
    outline: none;
    resize: none;
    max-height: 120px;
    min-height: 44px;
    transition: border-color var(--transition);
}
.bds-reply-input:focus { border-color: var(--accent); }
.bds-reply-input::placeholder { color: var(--text-3); }
.bds-reply-send {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    border: none;
    transition: opacity var(--transition);
}
.bds-reply-send:active { opacity: 0.75; }
.bds-reply-send svg { width: 18px; height: 18px; stroke: #000; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
/* In-flight + cooldown state — visible confirmation that the tap landed
   (was missing entirely). Pairs with the JS guard that bails re-taps. */
.bds-reply-send.is-sending,
.bds-reply-send:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    animation: bds-reply-pulse 1s ease-in-out infinite;
}
.bds-reply-send.is-sending:active { opacity: 0.55; } /* override the :active flicker */
@keyframes bds-reply-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(0.92); }
}

/* ── Calendar tab — sub-tabs (Day / Availability) ────────────── */
.bds-tab-row {
    display: flex;
    gap: 6px;
    padding: 8px 20px 12px;
    background: var(--bg);
}
.bds-tab-btn {
    flex: 1;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    color: var(--text-2);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    padding: 9px 12px;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.bds-tab-btn:active { transform: scale(.98); }
.bds-tab-btn--active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Calendar tab — Day view timeline ────────────────────────── */
.bds-day-scroll {
    /* Vertical scroll container; height fills the viewport minus the sticky
       header above. Body has overflow:hidden so this is the scroller.
       overflow-x:hidden keeps the slide-out page from bleeding into adjacent
       screens during a swipe. */
    height: calc(100vh - 240px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 8px 0 64px;
}
.bds-day-page {
    /* The swipeable inner card. JS sets transform during a drag; CSS handles
       the enter animation after a successful commit. */
    will-change: transform;
}
@keyframes bdsDayEnterR { from { transform: translateX(100vw); } to { transform: translateX(0); } }
@keyframes bdsDayEnterL { from { transform: translateX(-100vw); } to { transform: translateX(0); } }
.bds-day-page--enter-r { animation: bdsDayEnterR .2s ease-out; }
.bds-day-page--enter-l { animation: bdsDayEnterL .2s ease-out; }
.bds-day-grid {
    position: relative;
    margin: 0 16px 0 56px; /* leave room for hour labels on the left */
}
.bds-day-hr {
    position: absolute;
    left: 0; right: 0;
    height: 1px;
    background: var(--border);
}
.bds-day-hr-label {
    position: absolute;
    left: -56px;
    width: 50px;
    font-size: 11px;
    color: var(--text-3);
    text-align: right;
    line-height: 14px;
}
.bds-day-block {
    position: absolute;
    left: 4px;
    right: 4px;
    border-radius: 8px;
    padding: 6px 10px;
    overflow: hidden;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: transform .1s;
}
.bds-day-block:active { transform: scale(.99); }
.bds-day-block--open {
    background: rgba(34,197,94,.10);
    border-color: rgba(34,197,94,.35);
    color: #4ade80;
}
.bds-day-block--booked {
    background: rgba(0,200,255,.12);
    border-color: rgba(0,200,255,.45);
    color: var(--text);
}
.bds-day-block__time {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: .04em;
    line-height: 1;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bds-day-block__primary {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bds-day-block__secondary,
.bds-day-block__sub {
    font-size: 11px;
    color: var(--text-2);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Tertiary detail lines (pickup / phone) — slightly smaller and dimmer.
   Truncates with ellipsis on long pickup addresses so the block never
   spills its bounds. Short blocks (1hr = 64px) may clip the lower lines;
   that's intentional — admin can tap the block for the full panel. */
.bds-day-block__detail {
    font-size: 10.5px;
    color: var(--text-2);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: .85;
}
.bds-day-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
    font-size: 13px;
    pointer-events: none;
}

/* ── Sales screen ───────────────────────────────────────────── */
.bds-month-picker {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    gap: 12px;
}
.bds-month-picker__btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition);
}
.bds-month-picker__btn:active { background: var(--bg-card-2); }
.bds-month-picker__btn svg { width: 16px; height: 16px; stroke: var(--text-2); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bds-month-picker__label {
    font-size: 16px;
    font-weight: 600;
}
/* ── Sales/Payroll segmented toggle (lives at top of the $ tab) ──────────── */
.bds-sp-toggle {
    display: flex;
    gap: 8px;
    padding: 12px 20px 8px;
}
.bds-sp-toggle__btn {
    flex: 1;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-2);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.bds-sp-toggle__btn.is-active {
    background: rgba(0, 200, 255, .14);
    color: #00C8FF;
    border-color: rgba(0, 200, 255, .4);
}

/* ── Payroll mode ────────────────────────────────────────────────────────── */
.bds-payroll-total-card {
    margin: 0 20px 12px;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.bds-payroll-total-card .bds-sales-total-card__amount { color: #22C55E; }
.bds-payroll-owner-strip {
    margin: 0 20px 16px;
    padding: 10px 14px;
    background: rgba(245, 158, 11, .08);
    border: 1px solid rgba(245, 158, 11, .25);
    border-radius: 10px;
    font-size: 12px;
    color: var(--text-2);
}
.bds-payroll-owner-strip strong { color: var(--text-1); font-weight: 700; }

.bds-payroll-row {
    margin: 0 20px 10px;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.bds-payroll-row--owner {
    background: rgba(245, 158, 11, .05);
    border-color: rgba(245, 158, 11, .25);
}
.bds-payroll-row__head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.bds-payroll-row__dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.bds-payroll-row__name { font-size: 15px; font-weight: 700; color: var(--text-1); }
.bds-payroll-row__badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 7px;
    border-radius: 99px;
    border: 1px solid;
}
.bds-payroll-row__badge--owner {
    color: #F59E0B;
    background: rgba(245, 158, 11, .14);
    border-color: rgba(245, 158, 11, .35);
}
.bds-payroll-row__badge--warn {
    color: #F87171;
    background: rgba(239, 68, 68, .12);
    border-color: rgba(239, 68, 68, .35);
}
.bds-payroll-row__stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}
.bds-payroll-row__stats > div { display: flex; flex-direction: column; gap: 2px; align-items: center; }
.bds-payroll-row__stat-label {
    font-size: 10px;
    color: var(--text-3, var(--text-2));
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.bds-payroll-row__stat-val {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-1);
    font-variant-numeric: tabular-nums;
}
.bds-payroll-row__stat-val--total { color: #22C55E; }
.bds-payroll-row__footer { display: flex; justify-content: flex-end; }
.bds-payroll-row__action {
    background: #00C8FF;
    color: #0A1628;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.bds-payroll-row__action:active:not(:disabled) { transform: scale(.97); }
.bds-payroll-row__action:disabled { opacity: .55; cursor: not-allowed; }
.bds-payroll-row__action--paid {
    background: rgba(34, 197, 94, .14);
    color: #22C55E;
    border: 1px solid rgba(34, 197, 94, .35);
}

.bds-sales-total-card {
    margin: 0 20px 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.bds-sales-total-card__label {
    font-size: 13px;
    color: var(--text-2);
    margin-bottom: 4px;
}
.bds-sales-total-card__amount {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
}
.bds-sales-total-card__meta {
    color: var(--text-3);
    font-size: 12px;
    text-align: right;
    line-height: 1.5;
}

/* ── Sales date-range presets + custom range row ─────────────────────────── */
.bds-sales-presets {
    display: flex;
    gap: 6px;
    padding: 8px 20px 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.bds-sales-presets::-webkit-scrollbar { display: none; }
.bds-sales-preset {
    flex-shrink: 0;
    background: var(--bg-card);
    border: 1.5px solid var(--border-1);
    color: var(--text-2);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background .12s, color .12s, border-color .12s;
}
.bds-sales-preset:active { transform: scale(.97); }
.bds-sales-preset--active {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}
.bds-sales-custom {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px 12px;
    flex-wrap: wrap;
}
.bds-sales-custom__sep {
    color: var(--text-3);
    font-size: 12px;
}
.bds-sales-date {
    flex: 1;
    min-width: 120px;
    background: var(--bg-input);
    color: var(--text);
    border: 1.5px solid var(--border-1);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
}
.bds-sales-date:focus { outline: none; border-color: var(--accent); }
.bds-sales-apply {
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* ── Sales bar graph (SVG + HTML axis labels) ────────────────────────────── */
.bds-sales-graph { margin: 0 20px 18px; }
.bds-sales-graph__wrap {
    background: var(--bg-card);
    border-radius: var(--radius);
    /* Top/bottom padding is generous enough to accommodate the top and
       bottom Y labels, which are vertically centered on their grid lines
       and so extend ~5px beyond the chart edges at font-size 10px. */
    padding: 14px 14px 10px;
}
/* Chart row: Y label column on the left, SVG bar area on the right.
   Position-relative so the Y labels can absolute-position themselves to
   exact tick percentages, guaranteeing alignment with the SVG grid lines
   regardless of how the SVG height scales. */
.bds-sales-graph__chart {
    position: relative;
    height: 160px;
    padding-left: 46px; /* reserve space for the Y label column */
}
.bds-sales-graph__ylabels {
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 100%;
    color: var(--text-3);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    pointer-events: none;
}
/* Each label is absolutely positioned at the y-percentage that
   corresponds to its tick value (set inline by the JS), then nudged
   vertically so its text center sits ON the grid line. Right-aligned
   inside the 40px column so the numbers butt up against the chart
   area without floating in space. */
.bds-sales-graph__ylabels span {
    position: absolute;
    right: 0;
    transform: translateY(-50%);
    white-space: nowrap;
}
.bds-sales-graph__svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}
/* Horizontal grid lines drawn behind the bars. preserveAspectRatio="none"
   on the SVG stretches stroke widths weirdly when the chart resizes, so
   vector-effect:non-scaling-stroke keeps the lines hairline-thin
   regardless of viewport. */
.bds-sales-graph__grid {
    stroke: var(--border-1, rgba(255,255,255,.07));
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}
/* The $0 baseline gets a slightly brighter stroke so it's identifiable
   even when the chart has negative bars below it. */
.bds-sales-graph__grid--zero {
    stroke: var(--text-3, rgba(255,255,255,.25));
    stroke-width: 1.2;
    vector-effect: non-scaling-stroke;
}
.bds-sales-graph__bar { transition: opacity .12s; }
.bds-sales-graph__bar:hover { opacity: .75; }
/* Green for positive (sales). Red for negative (refunds — visual
   framework, no data sources produce negatives today). */
.bds-sales-graph__bar--pos { fill: rgb(34,197,94); }
.bds-sales-graph__bar--neg { fill: rgb(239,68,68); }
.bds-sales-graph__xticks {
    display: flex;
    justify-content: space-between;
    color: var(--text-3);
    font-size: 10px;
    /* line up with the chart's bar area, which starts after the 46px
       Y-label column reserved by .bds-sales-graph__chart padding-left */
    margin: 6px 0 0 46px;
    font-variant-numeric: tabular-nums;
}
.bds-sales-graph__empty {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    color: var(--text-3);
    text-align: center;
    font-size: 13px;
}
.bds-sale-row {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.bds-sale-row__body { flex: 1; min-width: 0; }
.bds-sale-row__name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 3px;
}
.bds-sale-row__pkg {
    font-size: 12px;
    color: var(--text-2);
}
.bds-sale-row__right { text-align: right; flex-shrink: 0; }
.bds-sale-row__amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}
.bds-sale-row__date {
    font-size: 11px;
    color: var(--text-3);
    margin-top: 2px;
}

/* ── Availability screen ────────────────────────────────────── */
.bds-avail-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px 12px;
    gap: 12px;
}
.bds-avail-toolbar select {
    flex: 1;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    padding: 10px 12px;
    outline: none;
    -webkit-appearance: none;
}
.bds-slot-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.bds-slot-card--booked { border-left: 3px solid var(--accent); }
.bds-slot-card--open   { border-left: 3px solid var(--success); }
.bds-slot-card__body { flex: 1; min-width: 0; }
.bds-slot-card__time {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 3px;
}
.bds-slot-card__meta {
    font-size: 12px;
    color: var(--text-2);
}
.bds-slot-card__actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.bds-slot-card__del {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition);
}
.bds-slot-card__del:active { background: rgba(239, 68, 68, 0.25); }
.bds-slot-card__del svg { width: 15px; height: 15px; stroke: var(--danger); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── FAB (Add Slot) ─────────────────────────────────────────── */
.bds-fab {
    position: fixed;
    bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
    right: 20px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent);
    color: #000;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px var(--accent-glow);
    cursor: pointer;
    border: none;
    z-index: 100;
    transition: transform var(--transition);
}
.bds-fab.visible { display: flex; }
.bds-fab:active { transform: scale(0.93); }
.bds-fab svg { width: 24px; height: 24px; stroke: #000; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* ── Modal / Sheet ──────────────────────────────────────────── */
.bds-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 200;
    display: flex;
    align-items: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.bds-overlay.open { opacity: 1; pointer-events: auto; }
.bds-sheet {
    width: 100%;
    background: var(--bg-card);
    border-radius: 20px 20px 0 0;
    padding: 24px 20px;
    padding-bottom: calc(24px + var(--safe-bottom));
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    max-height: 90vh;
    overflow-y: auto;
}
.bds-overlay.open .bds-sheet { transform: translateY(0); }
.bds-sheet__handle {
    width: 36px;
    height: 4px;
    background: var(--bg-card-2);
    border-radius: 2px;
    margin: -12px auto 20px;
}
.bds-sheet__title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
}
.bds-sheet-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.bds-sheet-form .bds-btn { margin-top: 8px; }

/* ── Book Student bottom-sheet (Calendar Day view → open slot tap) ──────── */
.bds-book-sheet {
    /* Cap the sheet so the search results scroll inside it instead of
       pushing the action buttons off-screen on small phones. */
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}
/* Title row — "Book a Student" on the left, "Delete Slot" pinned right. */
.bds-book-titlerow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.bds-book-titlerow .bds-sheet__title { margin: 0; }
/* Destructive secondary action — soft red treatment so it reads as a
   real action (not just decoration) without competing with the primary
   Book / Add-block flow below. Same color tokens as the Sales graph
   --neg bars and the Reschedule-dialog Cancel Lesson button. */
.bds-book-delete-slot-btn {
    flex-shrink: 0;
    background: rgba(239, 68, 68, .10);
    color: rgb(248, 113, 113);
    border: 1px solid rgba(239, 68, 68, .35);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background .12s;
    font-family: inherit;
}
.bds-book-delete-slot-btn:hover:not(:disabled) { background: rgba(239, 68, 68, .18); }
.bds-book-delete-slot-btn:active:not(:disabled) { transform: scale(.97); }
.bds-book-delete-slot-btn:disabled { opacity: .6; cursor: not-allowed; }
.bds-book-context {
    font-size: 13px;
    color: var(--text-2);
    /* Was -4px top to tighten the gap below a plain text title. Now
       that the title row contains a real Delete Slot button (taller
       than text), the negative pull made the button's bottom edge
       touch the context line. Switched to a small positive margin
       so they're visually distinct. */
    margin: 6px 0 12px;
}
.bds-book-search { margin-bottom: 10px; }
.bds-book-results {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -4px 8px; /* slight negative to widen tap targets */
}
.bds-book-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-1);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 6px;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.bds-book-row:active { transform: scale(.99); }
.bds-book-row__name { font-size: 14px; font-weight: 600; }
.bds-book-row__sub  { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.bds-book-empty {
    padding: 20px 8px;
    text-align: center;
    color: var(--text-3);
    font-size: 13px;
}

/* Detail panel (after a student is picked). */
.bds-book-detail {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 0;
}
.bds-book-detail__head {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}
.bds-book-detail__sub {
    color: var(--text-3);
    font-weight: 400;
    font-size: 12px;
    margin-left: 4px;
}
.bds-book-detail__ok {
    background: rgba(34,197,94,.10);
    border: 1px solid rgba(34,197,94,.35);
    border-radius: 8px;
    padding: 10px 12px;
    color: rgb(74,222,128);
    font-size: 13px;
}
.bds-book-detail__warn {
    background: rgba(245,158,11,.10);
    border: 1px solid rgba(245,158,11,.35);
    border-radius: 8px;
    padding: 10px 12px;
    color: rgb(251,191,36);
    font-size: 13px;
}
.bds-book-detail__error {
    background: rgba(239,68,68,.10);
    border: 1px solid rgba(239,68,68,.35);
    border-radius: 8px;
    padding: 10px 12px;
    color: rgb(248,113,113);
    font-size: 13px;
}

/* Pickup-address section (Tallahassee-biased Places autocomplete). */
.bds-book-pickup-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin: 4px 0 4px;
}
.bds-book-savewrap {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-2);
    cursor: pointer;
    margin-top: -2px;
    padding: 2px 0;
}
.bds-book-savewrap input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Package picker rows (no-credit branch). */
.bds-book-pkg-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 240px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.bds-book-pkg-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-1);
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.bds-book-pkg-row input[type="radio"] {
    flex-shrink: 0;
    accent-color: var(--accent);
    width: 18px;
    height: 18px;
}
.bds-book-pkg-row__name {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.bds-book-pkg-row__meta {
    font-size: 11px;
    color: var(--text-3);
    white-space: nowrap;
}

/* ── Toast ──────────────────────────────────────────────────── */
#bds-toast-container {
    position: fixed;
    top: calc(20px + var(--safe-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 9000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    width: min(92vw, 380px);
}
.bds-toast {
    background: var(--bg-card-2);
    color: var(--text);
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    animation: toast-in 0.25s ease;
    border-left: 3px solid var(--accent);
    width: 100%;
}
.bds-toast--success { border-left-color: var(--success); }
.bds-toast--error   { border-left-color: var(--danger); }

/* ── Back button ────────────────────────────────────────────── */
.bds-back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.bds-back-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Loading / empty states ─────────────────────────────────── */
.bds-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
}
.bds-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--bg-card-2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.bds-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-3);
    font-size: 14px;
}
.bds-empty svg {
    width: 48px;
    height: 48px;
    stroke: var(--text-3);
    fill: none;
    margin: 0 auto 12px;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes toast-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Pull-to-refresh indicator ──────────────────────────────── */
.bds-ptr {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 0;
    overflow: hidden;
    transition: height 0.2s ease;
}
.bds-ptr.active { height: 48px; }
.bds-ptr .bds-spinner { width: 24px; height: 24px; }

/* ── Student detail ─────────────────────────────────────────── */
.bds-detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 20px 16px;
}
.bds-detail-header__avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-dim);
    color: var(--accent);
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    flex-shrink: 0;
}
.bds-detail-header__name {
    font-size: 20px;
    font-weight: 700;
}
.bds-detail-header__email {
    font-size: 13px;
    color: var(--text-2);
    margin-top: 2px;
}
.bds-detail-header__phone {
    font-size: 13px;
    color: var(--text-2);
}

/* ── Contact actions row (Text / Call / Navigate / Edit) ──────────────── */
/* Sits below the avatar+name header on the student-detail screen. The
   primary Text button gets its own row at full width; Call + Navigate
   share a second row. "Missing" variant (red-outlined) is used when the
   underlying phone or address isn't on file — tapping it opens the Edit
   Profile sheet so the instructor can immediately add what's missing. */
.bds-contact-actions {
    padding: 0 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.bds-contact-actions__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.bds-contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background .12s ease, transform .08s ease, border-color .12s ease;
    -webkit-tap-highlight-color: transparent;
}
.bds-contact-btn:active { transform: scale(.97); }
.bds-contact-btn:hover  { text-decoration: none; }
.bds-contact-btn__icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}
.bds-contact-btn__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Primary = the Text button (used most often per Brian). Cyan-tinted
   filled chip so it stands out from the smaller Call / Navigate row. */
.bds-contact-btn--primary {
    background: rgba(0, 200, 255, .14);
    color: #00C8FF;
    border-color: rgba(0, 200, 255, .35);
}
.bds-contact-btn--primary:hover { background: rgba(0, 200, 255, .22); }

/* Secondary = Call + Navigate. Quieter neutral-glass treatment so the
   primary button reads as the default action. */
.bds-contact-btn--secondary {
    background: var(--bg-card);
    color: var(--text-1);
    border-color: var(--border);
}
.bds-contact-btn--secondary:hover { background: var(--bg-card-hi, rgba(255,255,255,.05)); }

/* Missing variant — red outline + red text, used in place of the real
   action button when the underlying data isn't on file. Always renders
   on a transparent background so it reads as an "alert" rather than a
   primary CTA, but tapping is still inviting (it opens Edit Profile). */
.bds-contact-btn--missing {
    background: rgba(239, 68, 68, .08);
    color: #F87171;
    border-color: rgba(239, 68, 68, .55);
}
.bds-contact-btn--missing:hover { background: rgba(239, 68, 68, .14); }

/* ── Detail-footer Edit Profile + Road Test ────────────────────────────── */
.bds-detail-footer {
    padding: 8px 20px 32px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
}
.bds-detail-footer .bds-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Passed Road Test pass-button (pre-pass state) — celebratory primary.
   Solid brand cyan with deep-navy text reads as "this is the moment". */
.bds-roadtest__pass-btn {
    width: 100%;
    padding: 14px 16px;
    border-radius: 10px;
    background: #00C8FF;
    color: #0A1628;
    border: 1px solid #00C8FF;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    line-height: 1.2;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background .12s ease, transform .08s ease;
}
.bds-roadtest__pass-btn:hover:not(:disabled) { background: #00A3D0; border-color: #00A3D0; }
.bds-roadtest__pass-btn:active:not(:disabled) { transform: scale(.98); }
.bds-roadtest__pass-btn:disabled { opacity: .65; cursor: default; }

/* Passed state — soft green confirmation card with Undo link. */
.bds-roadtest--passed {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(34, 197, 94, .10);
    border: 1px solid rgba(34, 197, 94, .35);
    border-radius: 10px;
}
.bds-roadtest__status { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.bds-roadtest__icon  { font-size: 22px; line-height: 1; flex-shrink: 0; }
.bds-roadtest__text  { min-width: 0; }
.bds-roadtest__title { font-size: 14px; font-weight: 700; color: #22C55E; line-height: 1.2; }
.bds-roadtest__date  { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.bds-roadtest__undo {
    background: transparent;
    border: none;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 8px;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    text-decoration: underline;
}
.bds-roadtest__undo:hover:not(:disabled) { color: var(--text-1); }
.bds-roadtest__undo:disabled { opacity: .65; cursor: default; }

/* ── Edit Sessions sheet ────────────────────────────────────────────────── */
.bds-sheet__hint {
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-2);
    margin: 0 0 14px;
}
.bds-es-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}
.bds-es-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.bds-es-row__info { flex: 1; min-width: 0; }
.bds-es-row__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-1);
    line-height: 1.25;
}
.bds-es-row__meta {
    font-size: 12px;
    color: var(--text-2);
    margin-top: 2px;
}
.bds-es-stepper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.bds-es-stepper__btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card-2, rgba(255,255,255,.06));
    color: #00C8FF;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bds-es-stepper__btn:active { transform: scale(.94); }
.bds-es-stepper__val {
    min-width: 22px;
    text-align: center;
    font-size: 17px;
    font-weight: 700;
    color: var(--text-1);
}

/* ── My Pay screen (Phase 1d) ────────────────────────────────────────────── */
.bds-mypay-card {
    margin: 0 20px 12px;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.bds-mypay-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-2);
    margin-bottom: 10px;
}
.bds-mypay-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.bds-mypay-stats > div { display: flex; flex-direction: column; gap: 4px; }
.bds-mypay-stats__label { font-size: 11px; color: var(--text-3, var(--text-2)); text-transform: uppercase; letter-spacing: 0.04em; }
.bds-mypay-stats__val { font-size: 16px; font-weight: 700; color: var(--text-1); font-variant-numeric: tabular-nums; }
.bds-mypay-stats__val--money { color: #22C55E; }

.bds-mypay-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 8px;
}
.bds-mypay-item__main { flex: 1; min-width: 0; }
.bds-mypay-item__kind { font-size: 13px; font-weight: 700; color: var(--text-1); }
.bds-mypay-item__desc { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.bds-mypay-item__amount { font-size: 14px; font-weight: 700; color: #22C55E; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.bds-mypay-item__del {
    background: transparent;
    border: none;
    color: var(--text-3, var(--text-2));
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: background .12s;
}
.bds-mypay-item__del:hover { background: rgba(239,68,68,.18); color: #F87171; }

.bds-mypay-empty {
    padding: 14px;
    text-align: center;
    color: var(--text-3, var(--text-2));
    font-size: 13px;
    font-style: italic;
}
.bds-mypay-add-btn {
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    background: rgba(0,200,255,.10);
    color: #00C8FF;
    border: 1px dashed rgba(0,200,255,.4);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.bds-mypay-add-btn:disabled { opacity: .5; cursor: not-allowed; }

.bds-mypay-grand {
    margin: 0 20px 12px;
    padding: 16px;
    background: rgba(34, 197, 94, .08);
    border: 1px solid rgba(34, 197, 94, .35);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.bds-mypay-grand__label { font-size: 13px; font-weight: 700; color: var(--text-1); text-transform: uppercase; letter-spacing: .04em; }
.bds-mypay-grand__amount { font-size: 24px; font-weight: 800; color: #22C55E; font-variant-numeric: tabular-nums; }

.bds-mypay-submit {
    width: calc(100% - 40px);
    margin: 0 20px 12px;
}

.bds-mypay-status {
    margin: 0 20px 12px;
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
}
.bds-mypay-status--paid    { background: rgba(34, 197, 94, .12);    color: #22C55E; border: 1px solid rgba(34, 197, 94, .35); }
.bds-mypay-status--pending { background: rgba(245, 158, 11, .12);  color: #F59E0B; border: 1px solid rgba(245, 158, 11, .35); }

.bds-mypay-recent__row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,.03);
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 13px;
}
.bds-mypay-recent__period { flex: 1; color: var(--text-2); }
.bds-mypay-recent__amount { color: var(--text-1); font-weight: 700; font-variant-numeric: tabular-nums; }
.bds-mypay-recent__badge { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 99px; }
.bds-mypay-recent__badge--paid     { background: rgba(34, 197, 94, .14); color: #22C55E; }
.bds-mypay-recent__badge--pending  { background: rgba(245, 158, 11, .14); color: #F59E0B; }
.bds-mypay-recent__badge--rejected { background: rgba(239, 68, 68, .14); color: #F87171; }

/* ── Dashboard "More" tools list ────────────────────────────────────────── */
.bds-tools-list {
    padding: 0 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.bds-tool-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-1);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background var(--transition);
}
.bds-tool-row:active { background: var(--bg-card-2, rgba(255,255,255,.06)); }
.bds-tool-row__icon  { font-size: 20px; flex-shrink: 0; }
.bds-tool-row__label { flex: 1; text-align: left; }
.bds-tool-row__chev  { color: var(--text-2); display: inline-flex; }

/* ── Coupons screen ─────────────────────────────────────────────────────── */
.bds-coupon-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 14px 14px 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background var(--transition);
}
.bds-coupon-card:active { background: var(--bg-card-2, rgba(255,255,255,.06)); }
.bds-coupon-card__main { flex: 1; min-width: 0; }
.bds-coupon-card__code {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--text-1);
}
.bds-coupon-card__meta { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.bds-coupon-card__desc { font-size: 12px; color: var(--text-3, var(--text-2)); margin-top: 2px; font-style: italic; }
.bds-coupon-card__badge {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    color: #22C55E;
    background: rgba(34,197,94,.14);
    border: 1px solid rgba(34,197,94,.3);
    border-radius: 99px;
    padding: 2px 9px;
}
.bds-coupon-card__badge--off {
    color: #94A3B8;
    background: rgba(148,163,184,.12);
    border-color: rgba(148,163,184,.3);
}
.bds-coupon-card__chev { color: var(--text-2); display: inline-flex; flex-shrink: 0; }

/* ── Shared sheet form helpers (coupon editor) ──────────────────────────── */
.bds-form-row { display: flex; gap: 10px; }
.bds-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-1);
    padding: 6px 0;
    cursor: pointer;
}
.bds-toggle-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.bds-coupon-pkgs {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--bg-card);
}
.bds-coupon-pkg {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-1);
    cursor: pointer;
}
.bds-coupon-pkg input { width: 17px; height: 17px; accent-color: var(--accent); flex-shrink: 0; }
.bds-btn--danger-soft {
    background: rgba(239, 68, 68, .10);
    color: #F87171;
    border: 1px solid rgba(239, 68, 68, .35);
}
.bds-btn--danger-soft:active { background: rgba(239, 68, 68, .18); }

.bds-credits-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 0 20px 20px;
}
.bds-credit-stat {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 14px 12px;
    text-align: center;
}
.bds-credit-stat__val {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
}
.bds-credit-stat__label {
    font-size: 11px;
    color: var(--text-3);
    margin-top: 2px;
}

/* ── Student detail — Training Sessions grid ──────────────────── */
.bds-block-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 4px 16px 16px;
}
.bds-block-grid__empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 24px 12px;
    color: var(--text-3);
    font-size: 13px;
}
.bds-tblock {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 130px;
}
.bds-tblock__pkg {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}
.bds-tblock__sub {
    font-size: 11px;
    color: var(--text-2);
}
.bds-tblock__avail-status {
    margin-top: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--accent);
}
.bds-tblock__when {
    margin-top: 4px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    background: var(--bg-input);
}
.bds-tblock__when-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 2px;
}
.bds-tblock__when-date { font-size: 12px; font-weight: 600; color: var(--text); }
.bds-tblock__when-time { font-size: 11px; color: var(--text-2); }
.bds-tblock__when-instr { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.bds-tblock__actions {
    margin-top: auto;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.bds-tblock__btn {
    flex: 1;
    min-width: 0;
    border-radius: 7px;
    border: none;
    padding: 7px 8px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.bds-tblock__btn--book {
    background: var(--accent);
    color: #070F1C;
}
.bds-tblock__btn--reschedule {
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
}
.bds-tblock__btn--cancel {
    background: rgba(220,38,38,.12);
    color: #f87171;
    border: 1px solid rgba(220,38,38,.35);
}
.bds-tblock__btn:active { transform: scale(.97); }

/* Available block — cyan tint to read as "ready to book" */
.bds-tblock--available {
    border-color: rgba(0,200,255,.35);
    background: rgba(0,200,255,.06);
}
/* Booked block — neutral, but the "Scheduled" inner card is the visual anchor */
.bds-tblock--booked {
    border-color: var(--accent);
}
/* Completed — dimmer, purple cast (matches the desktop convention) */
.bds-tblock--completed {
    border-color: rgba(99,102,241,.35);
    opacity: .85;
}
.bds-tblock--completed .bds-tblock__pkg { color: #a5b4fc; }

/* ── Student detail — Training Notes ──────────────────────────── */
.bds-notes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 16px 16px;
}
.bds-note {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
}
.bds-note__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 12px;
}
.bds-note__date  { font-weight: 700; color: var(--text); }
.bds-note__instr { color: var(--text-2); }
.bds-note__body {
    font-size: 13px;
    color: var(--text);
    line-height: 1.5;
    white-space: pre-wrap;
}
.bds-note__skills {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.bds-skill-chip {
    font-size: 10px;
    font-weight: 600;
    color: #fbbf24;
    background: rgba(245,158,11,.12);
    border: 1px solid rgba(245,158,11,.35);
    border-radius: 5px;
    padding: 2px 7px;
}

/* Note action buttons (Edit / Delete) — sit at the bottom of each note card. */
.bds-note__actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}
.bds-note__action {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.bds-note__action:active:not(:disabled) { transform: scale(.97); }
.bds-note__action:disabled { opacity: .6; cursor: not-allowed; }
.bds-note__action--danger {
    color: #F87171;
    border-color: rgba(239, 68, 68, .35);
}
.bds-note__action--danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, .12);
    color: #F87171;
}

/* Add Note sheet — skills checklist */
.bds-note-skills {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--bg-card);
    max-height: 260px;
    overflow-y: auto;
}
.bds-note-skill {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.bds-note-skill__row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-1);
}
.bds-note-skill__row input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    flex-shrink: 0;
}
.bds-note-skill__label { color: var(--text-1); }
.bds-note-skill-more {
    flex-shrink: 0;
    padding: 5px 8px;
    font-size: 12px;
    font-family: inherit;
    background: var(--bg);
    color: var(--text-1);
    border: 1px solid var(--border);
    border-radius: 6px;
}

/* ── Slot picker overlay ──────────────────────────────────────── */
.bds-overlay--picker { align-items: stretch; justify-content: center; }
.bds-picker {
    background: var(--bg);
    border-radius: 14px 14px 0 0;
    width: 100%;
    max-width: 540px;
    margin: auto auto 0;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    transform: translateY(100%);
    transition: transform .22s ease-out;
}
.bds-overlay--picker.open .bds-picker { transform: translateY(0); }
.bds-picker__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px 10px;
    border-bottom: 1px solid var(--border);
}
.bds-picker__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}
.bds-picker__close {
    background: none;
    border: none;
    color: var(--text-2);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}
/* Cancel Lesson row — only rendered in reschedule mode (existingBookingId).
   Sits between the picker header and the month/day toolbar. Styled as a
   muted destructive secondary action so it's discoverable but visually
   subordinate to the primary Reschedule flow below. */
.bds-picker__cancel-row {
    padding: 8px 16px 0;
}
.bds-picker__cancel-btn {
    display: block;
    width: 100%;
    background: rgba(239, 68, 68, .08);
    color: rgb(248, 113, 113);
    border: 1px solid rgba(239, 68, 68, .35);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background .12s;
}
.bds-picker__cancel-btn:hover:not(:disabled) { background: rgba(239, 68, 68, .14); }
.bds-picker__cancel-btn:active:not(:disabled) { transform: scale(.99); }
.bds-picker__cancel-btn:disabled { opacity: .6; cursor: not-allowed; }
.bds-picker__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.bds-picker__toolbar select {
    flex: 1;
    min-width: 0;
    background: var(--bg-input);
    color: var(--text);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    padding: 6px 8px;
    -webkit-appearance: none;
    appearance: none;
}
.bds-picker__body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 12px 16px 24px;
}
.bds-picker__page {
    display: flex;
    flex-direction: column;
    gap: 8px;
    will-change: transform;
}
.bds-picker__empty {
    padding: 24px 8px;
    text-align: center;
}
.bds-picker-slot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: rgba(34,197,94,.10);
    border: 1.5px solid rgba(34,197,94,.40);
    color: var(--text);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.bds-picker-slot:active { transform: scale(.98); }
.bds-picker-slot__time { font-weight: 700; }
.bds-picker-slot__dur  { font-size: 12px; color: var(--text-2); }

/* ── Picker month grid + confirmation panel (admin/instructor booking) ───── */
/* Mirrors the public portal's month-grid UX, ported into the PWA design
   tokens. Both grids share column geometry via box-sizing:border-box. */
.bds-pcal-dow, .bds-pcal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    width: 100%;
    box-sizing: border-box;
}
.bds-pcal-dow {
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-2);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.bds-pcal-dow > div { box-sizing: border-box; min-width: 0; padding: 4px 0; }
.bds-pcal-day {
    box-sizing: border-box;
    min-width: 0;
    aspect-ratio: 1 / 1;
    min-height: 44px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-2);
    background: transparent;
    border: 1px solid transparent;
    cursor: default;
    user-select: none;
    padding: 2px;
}
.bds-pcal-day--blank { visibility: hidden; }
.bds-pcal-day--past, .bds-pcal-day--empty { color: var(--text-3, #475569); opacity: .55; }
/* Calendar-tab context: even days with no activity are tappable so an
   admin can drill in and add a slot. The --cal modifier (set in
   renderCalMonthGrid only — not in the student-booking picker) gives
   those dim cells a cursor + active-scale, but keeps them visually
   muted so the at-a-glance "where's activity?" read still works. */
.bds-pcal-day--cal { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.bds-pcal-day--cal:active { transform: scale(.96); }

/* Historical day: nothing bookable left on this date, but a past
   booking (completed lesson) lives here for the record. Visually
   muted to distinguish from upcoming bookable days, but still
   tap-able so the admin can drill in and review what happened. */
.bds-pcal-day--historical {
    color: var(--text-3, #475569);
    background: rgba(255, 255, 255, .025);
    border: 1px solid rgba(255, 255, 255, .04);
    opacity: .65;
}
.bds-pcal-day--historical .bds-pcal-dot {
    background: var(--text-3, #64748b);
    opacity: .7;
}
.bds-pcal-day--today { outline: 1px dashed rgba(34,197,94,.5); outline-offset: -2px; }
.bds-pcal-day--open {
    color: var(--text);
    background: rgba(34,197,94,.10);
    border-color: rgba(34,197,94,.40);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.bds-pcal-day--open:active { transform: scale(.96); }
.bds-pcal-day--open .bds-pcal-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgb(34,197,94);
    margin-top: 3px;
}
.bds-pcal-hint {
    text-align: center;
    color: var(--text-2);
    font-size: 12px;
    margin-top: 12px;
}
.bds-pcal-back {
    background: none;
    border: none;
    color: var(--accent, rgb(34,197,94));
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 6px 4px 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    -webkit-tap-highlight-color: transparent;
}
.bds-pcal-back svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Confirmation panel (step 3) */
.bds-pconfirm {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.bds-pconfirm__head {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}
.bds-pconfirm__sub {
    font-size: 13px;
    color: var(--text-2);
    margin-bottom: 2px;
}
.bds-pconfirm__label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-2);
    margin: 12px 0 4px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.bds-pconfirm__input {
    width: 100%;
    box-sizing: border-box;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm, 8px);
    color: var(--text);
    font-size: 14px;
    padding: 10px 12px;
    font-family: inherit;
    resize: vertical;
}
.bds-pconfirm__input:focus {
    outline: none;
    border-color: var(--accent, rgb(34,197,94));
}
/* Single-line variant used by the pickup-address <input>. Disables the
   textarea-only resize handle (no-op on input but keeps the rule tidy). */
.bds-pconfirm__input--single { resize: none; }

/* Google Places suggestion dropdown — the picker overlay lives at z-index
   99999, and Google's .pac-container default is 1000, so the suggestions
   render BEHIND the modal without this override. */
.pac-container { z-index: 100000 !important; }
.bds-pconfirm__err {
    color: #f87171;
    font-size: 12px;
    margin-top: 4px;
}
.bds-pconfirm__check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-2);
    cursor: pointer;
}
.bds-pconfirm__check input[type="checkbox"] {
    accent-color: rgb(34,197,94);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
