/* ─────────────────────────────────────────────────────────────
   Fongué Performance — Dashboard
   Brand: Orbitron (headings) + Inter (body)
         #9cec13 neon-lime accent · #ffbf00 gold · #141414 dark
───────────────────────────────────────────────────────────── */

/* ── Variables ─────────────────────────────────────────────── */
:root {
    /* brand */
    --lime:           #9cec13;
    --lime-dim:       rgba(156,236,19,.12);
    --lime-glow:      0 0 16px rgba(156,236,19,.35);
    --gold:           #ffbf00;
    --gold-dim:       rgba(255,191,0,.12);

    /* dark palette */
    --bg:             #0d0d0d;
    --bg-card:        #191919;
    --bg-card-hover:  #1f1f1f;
    --bg-input:       #1d1d1d;
    --sidebar-bg:     #111111;
    --border:         #2e2e2e;
    --border-strong:  #3d3d3d;

    /* text */
    --text-primary:   #f2f2f2;
    --text-secondary: #9e9e9e;
    --text-muted:     #686868;

    /* status */
    --success:        #22c55e;
    --success-bg:     rgba(34,197,94,.12);
    --warning:        #f59e0b;
    --warning-bg:     rgba(245,158,11,.12);
    --danger:         #ef4444;
    --danger-bg:      rgba(239,68,68,.12);
    --info:           #38bdf8;
    --info-bg:        rgba(56,189,248,.12);

    /* layout */
    --sidebar-width:  252px;
    --header-h:       58px;
    --bot-nav-h:      0px;  /* set to calc(60px + env(safe-area-inset-bottom)) in staff layout */
    --radius:         10px;
    --radius-sm:      6px;
    --shadow:         0 1px 4px rgba(0,0,0,.5);
    --shadow-md:      0 8px 24px rgba(0,0,0,.6);
    --transition:     .15s ease;

    /* Keyboard-aware bottom safe area.
       env(safe-area-inset-bottom) reserves space for the home indicator. When
       the on-screen keyboard is up, the keyboard already covers that area, so
       the extra padding becomes a visible gap below sticky inputs. Subtracting
       env(keyboard-inset-height) collapses --sab to 0 while the keyboard is
       up and falls back to the home-indicator inset when it's down. Use this
       instead of env(safe-area-inset-bottom) for any sticky composer/footer
       inside a popup that follows the keyboard. */
    --sab: max(0px, env(safe-area-inset-bottom) - env(keyboard-inset-height, 0px));
}

/* Belt + suspenders: not every browser reports env(keyboard-inset-height)
   (Safari only honors it inside a position:fixed element whose bottom is
   anchored to the layout viewport, and some Android Chrome versions return
   0 always). body.kb-open is set by main.js from visualViewport, so this
   override catches the cases the env() formula misses. */
body.kb-open { --sab: 0px; }

/* ── Stale-cache indicator (Phase 5) ───────────────────────────
   Lime stripe sweeping across the very top while a background revalidation
   is in flight. main.js's cachedFetch flips body[data-stale] when serving
   stale and clears it once the fresh fetch resolves. */
body[data-stale="1"]::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--lime), transparent);
    background-size: 200% 100%;
    animation: fp-stale-pulse 1.4s linear infinite;
    z-index: 9999;
    pointer-events: none;
}
@keyframes fp-stale-pulse {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}

/* ── SPA navigation placeholder skeleton (Phase 5) ─────────────
   Rendered inside the .page-content placeholder during the shell fetch.
   Reuses .skel shimmer; matches the typical card-grid shape so the user
   sees a content silhouette the instant they tap a nav tab. */
.page-content-skeleton {
    padding: 22px 22px 32px;
}
.page-skel-title {
    height: 1.6rem;
    width: 220px;
    margin-bottom: 10px;
    border-radius: 6px;
}
.page-skel-sub {
    height: .8rem;
    width: 340px;
    max-width: 70%;
    margin-bottom: 26px;
    border-radius: 4px;
}
.page-skel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.page-skel-card {
    height: 132px;
    border-radius: var(--radius);
}
@media (max-width: 768px) {
    .page-content-skeleton { padding: 18px 14px 28px; }
    .page-skel-grid { grid-template-columns: 1fr; gap: 10px; }
    .page-skel-card { height: 96px; }
}

/* ── Pull-to-refresh indicator (Phase 5) ───────────────────────
   Positioned at top of viewport. main.js drives `top` via touch drag.
   .ptr-icon spins via CSS while the refresh promise is pending. */
.ptr-indicator {
    position: fixed;
    top: -40px;
    left: 50%;
    margin-left: -20px;
    width: 40px;
    height: 40px;
    z-index: 250;
    pointer-events: none;
    transition: top .22s cubic-bezier(.4,0,.2,1);
    display: flex;
    align-items: center;
    justify-content: center;
}
.ptr-icon {
    width: 28px;
    height: 28px;
    border: 2.5px solid var(--border);
    border-top-color: var(--lime);
    border-radius: 50%;
    background: var(--bg-card);
    box-shadow: 0 4px 12px rgba(0,0,0,.4);
}
.ptr-indicator.ptr-ready .ptr-icon {
    border-color: var(--lime);
    box-shadow: 0 4px 14px rgba(156,236,19,.35);
}
.ptr-indicator.ptr-spinning .ptr-icon {
    animation: fp-ptr-spin .8s linear infinite;
}
@keyframes fp-ptr-spin {
    to { transform: rotate(360deg); }
}

/* ── Global progress bar (JS-injected, auto-shows on fetch) ─── */
.fp-progress {
    position: fixed;
    top: 0; left: 0;
    height: 2px;
    width: 0%;
    background: var(--lime);
    z-index: 99998;
    pointer-events: none;
    opacity: 0;
}
.fp-progress.active { opacity: 1; transition: width .4s ease; }

/* ── Reset ──────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
/* The viewport scroller is <html> in standards mode. Putting
   `overscroll-behavior: none` here kills the iOS rubber-band on the whole
   page. NOTE: this MUST NOT live on <body> — when body has explicit overflow
   (which it does, via overflow-x: hidden auto-deriving overflow-y: auto) and
   body's content matches its height, body has no internal overflow to scroll
   AND `overscroll-behavior: none` on body blocks wheel chaining to html.
   Result: document becomes unscrollable on desktop. */
html {
    font-size: 16px;
    overflow-x: hidden;
    overscroll-behavior: none;
    touch-action: manipulation;
}
body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    overscroll-behavior-x: none;
}

/* Touch tap feedback. Only on touch devices (hover:none) so desktop hover
   states don't fight with the press animation. Press-in feel for buttons,
   nav items, list rows. */
@media (hover: none) {
    .btn:active, .btn-sm:active, .btn-primary:active, .btn-ghost:active,
    .nav-item:active, .bn-item:active, .ms-item:active,
    .chip:active, .pill:active, .pipeline-pill:active,
    .card-tappable:active, .chat-conv-item:active,
    .athlete-card:active, .opp-card:active,
    .task-row:active {
        transform: scale(.97);
        transition: transform .08s ease-out;
    }
}
a { color: var(--lime); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; touch-action: manipulation; }
input, select, textarea { font-family: inherit; font-size: inherit; }
/* Prevent iOS from zooming into inputs with small font sizes */
@supports (-webkit-touch-callout: none) {
    input, select, textarea { font-size: max(16px, 1em) !important; }
}

/* Orbitron helper */
.font-orbitron { font-family: 'Orbitron', sans-serif; }

/* ─────────────────────────────────────────────────────────────
   LOGIN PAGE
───────────────────────────────────────────────────────────── */
.login-body { background: #0a0a0a; }

.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
}

.login-brand {
    width: 44%;
    background: #0a0a0a;
    border-right: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    position: relative;
    overflow: hidden;
}
/* neon glow backdrop */
.login-brand::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(156,236,19,.08) 0%, transparent 70%);
    pointer-events: none;
}
.login-brand-inner {
    max-width: 360px;
    position: relative;
    z-index: 1;
}
.login-logo {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    object-fit: cover;
    margin-bottom: 28px;
}
.login-brand h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    letter-spacing: .5px;
    margin-bottom: 12px;
    line-height: 1.3;
}
.login-brand p {
    color: var(--text-secondary);
    font-size: .88rem;
    line-height: 1.7;
    margin-bottom: 36px;
}
.login-features { display: flex; flex-direction: column; gap: 12px; }
.login-feature {
    display: flex; align-items: center; gap: 10px;
    color: var(--text-secondary); font-size: .85rem;
}
.feat-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--lime); flex-shrink: 0;
    box-shadow: 0 0 6px var(--lime);
}

/* Form panel */
.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background: var(--bg-card);
}
.login-form-inner { width: 100%; max-width: 380px; }
.login-form-inner h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: .3px;
    margin-bottom: 6px;
}
.login-sub { color: var(--text-secondary); margin-bottom: 32px; font-size: .88rem; }

.demo-hint {
    margin-top: 24px;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .8rem;
    color: var(--text-secondary);
}
.demo-hint code {
    background: var(--border);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: .78rem;
    color: var(--lime);
}

/* ── Social login buttons ──────────────────────────────────── */
.login-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 24px 0 20px; color: var(--text-muted); font-size: .8rem;
}
.login-divider::before, .login-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}
.social-login-buttons { display: flex; flex-direction: column; gap: 10px; }
.social-login-buttons .g_id_signin { width: 100%; }
.social-login-buttons .g_id_signin iframe { width: 100% !important; }
.btn-social {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 10px 16px;
    border-radius: var(--radius-sm); border: 1px solid var(--border);
    font-size: .88rem; font-weight: 500; cursor: pointer;
    transition: background .15s, border-color .15s;
}
.btn-apple {
    background: #fff; color: #000; border-color: #fff;
}
.btn-apple:hover { background: #e8e8e8; }

/* ── Customer portal ──────────────────────────────────────── */
.portal-shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }

/* Impersonation bar */
.portal-impersonation-bar {
    background: #7c3aed; color: #fff; font-size: .82rem;
    padding: calc(6px + env(safe-area-inset-top)) 20px 6px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
}
.portal-impersonation-bar .btn { color: #fff; border-color: rgba(255,255,255,.4); }

.portal-topbar {
    background: var(--sidebar-bg); border-bottom: 1px solid var(--border);
    padding: env(safe-area-inset-top) 16px 0; height: calc(56px + env(safe-area-inset-top)); flex-shrink: 0;
}
/* When impersonation bar is above topbar it absorbs the safe-area — topbar must not add its own */
.portal-impersonation-bar ~ .portal-topbar {
    padding-top: 0;
    height: 56px;
}
.portal-topbar-inner {
    max-width: 960px; margin: 0 auto; height: 100%;
    display: flex; align-items: center; justify-content: space-between;
}
.portal-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.portal-logo {
    font-family: 'Orbitron', sans-serif; font-weight: 800; font-size: 1rem;
    color: var(--lime); background: var(--lime-dim); padding: 4px 9px;
    border-radius: var(--radius-sm); flex-shrink: 0;
}
.portal-brand-text { display: flex; flex-direction: column; }
.portal-brand-name {
    font-family: 'Orbitron', sans-serif; font-weight: 800; font-size: .72rem;
    color: #fff; line-height: 1.15; letter-spacing: .08em; text-transform: uppercase;
}
.portal-brand-sub {
    font-family: 'Orbitron', sans-serif; font-weight: 800; font-size: .72rem;
    color: var(--lime); letter-spacing: .08em; text-transform: uppercase; line-height: 1.15;
}
.portal-user { display: flex; align-items: center; gap: 10px; }
.portal-user-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--lime-dim); border: 1px solid var(--lime);
    color: var(--lime); display: flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 700; flex-shrink: 0;
}
.portal-logout-btn {
    color: var(--text-muted); display: flex; align-items: center; padding: 6px;
    border-radius: var(--radius-sm); text-decoration: none;
    transition: color var(--transition), background var(--transition);
}
.portal-logout-btn:hover { color: var(--lime); background: var(--lime-dim); text-decoration: none; }
.portal-main { flex: 1; padding: 24px 20px 80px; min-height: 0; } /* 80px bottom padding for nav */
/* Chat tab needs portal-main to be a flex column so portal-chat-wrap can fill the viewport. */
.portal-main--chat,
.portal-main:has(> .portal-chat-wrap) {
    display: flex;
    flex-direction: column;
    padding: 0 0 calc(58px + env(safe-area-inset-bottom));
}
.portal-content { max-width: 720px; margin: 0 auto; }

/* Bottom nav */
.portal-bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    background: var(--sidebar-bg); border-top: 1px solid var(--border);
    display: flex; justify-content: space-around; align-items: stretch;
    height: calc(58px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
}
.pbn-item {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 3px; text-decoration: none;
    color: var(--text-muted); font-size: .6rem; font-weight: 600;
    padding: 6px 4px; transition: color .15s; letter-spacing: .05em; text-transform: uppercase;
}
.pbn-item:hover { color: var(--text-secondary); background: rgba(156,236,19,.04); text-decoration: none; }
.pbn-item.pbn-active { color: var(--lime); }
.pbn-item.pbn-active .pbn-icon svg { stroke: var(--lime); }
.pbn-icon { display: flex; align-items: center; justify-content: center; line-height: 1; }
.pbn-icon svg { transition: stroke .15s; }

/* Sections */
.portal-section { margin-bottom: 24px; }
.portal-section-title {
    font-size: .8rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; color: var(--text-muted); margin-bottom: 12px;
}
.portal-card { padding: 20px; }
.portal-card-title {
    font-size: .82rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .6px; color: var(--text-muted); margin-bottom: 16px;
}
.portal-card-sub { font-size: .84rem; color: var(--text-secondary); margin-bottom: 16px; }
.portal-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.portal-field-wide { grid-column: 1 / -1; }
.portal-field-label { font-size: .75rem; color: var(--text-muted); margin-bottom: 4px; }
.portal-field-value { font-size: .88rem; color: var(--text); font-weight: 500; }
.portal-field-note { font-size: .75rem; color: var(--text-muted); margin-top: 14px; }
.portal-empty { font-size: .88rem; color: var(--text-muted); padding: 24px 0; text-align: center; }
.portal-table-card { padding: 0; }
.portal-table-card .table-wrap { border-radius: var(--radius); }

/* Program header */
.portal-program-header {
    margin-bottom: 16px; padding: 14px 16px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.portal-program-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.portal-program-name { font-family: 'Orbitron', sans-serif; font-size: .95rem; font-weight: 700; color: var(--text); }
.portal-program-dates { font-size: .8rem; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.portal-date-sep { color: var(--text-muted); }

/* Banners */
.portal-banner {
    padding: 10px 16px; border-radius: var(--radius-sm); font-size: .84rem;
    margin-bottom: 12px; border-left: 3px solid transparent;
}
.portal-banner-warning { background: rgba(245,158,11,.1); border-color: #f59e0b; color: #fbbf24; }
.portal-banner-danger  { background: rgba(239,68,68,.1);  border-color: #ef4444; color: #f87171; }
.portal-banner-info    { background: rgba(59,130,246,.1); border-color: #3b82f6; color: #93c5fd; }

/* Booking task cards */
.portal-booking-cards { display: flex; flex-direction: column; gap: 10px; }
.portal-booking-card {
    display: flex; align-items: center; gap: 14px; padding: 14px 16px;
    background: var(--bg-card); border: 1px solid var(--lime); border-radius: var(--radius);
}
.portal-booking-icon { font-size: 1.4rem; flex-shrink: 0; }
.portal-booking-info { flex: 1; }
.portal-booking-title { font-size: .9rem; font-weight: 600; color: var(--text); }
.portal-booking-sub { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }

/* Milestone timeline */
.portal-timeline { display: flex; flex-direction: column; gap: 0; }
.portal-ms-item { display: flex; gap: 14px; padding: 12px 0; position: relative; }
.portal-ms-item:not(:last-child)::before {
    content: ''; position: absolute; left: 9px; top: 36px; bottom: -12px;
    width: 2px; background: var(--border);
}
.portal-ms-item.ms-done::before { background: var(--lime-dim); }
.portal-ms-item.ms-current::before { background: var(--lime); }
.portal-ms-dot {
    width: 22px; height: 22px; flex-shrink: 0; display: flex; align-items: center;
    justify-content: center; border-radius: 50%; font-size: .75rem; margin-top: 2px;
    background: var(--bg-card); border: 2px solid var(--border); color: var(--text-muted);
}
.ms-done .portal-ms-dot { background: var(--lime-dim); border-color: var(--lime); color: var(--lime); }
.ms-current .portal-ms-dot { background: var(--lime); border-color: var(--lime); color: #000; font-size: .9rem; }
.portal-ms-body { flex: 1; min-width: 0; }
.portal-ms-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.portal-ms-name { font-size: .9rem; font-weight: 600; color: var(--text); }
.ms-done .portal-ms-name { color: var(--text-muted); text-decoration: line-through; }
.portal-ms-meta { display: flex; align-items: center; gap: 10px; margin-top: 3px; flex-wrap: wrap; }
.portal-ms-date { font-size: .78rem; color: var(--text-secondary); }
.portal-ms-countdown { font-size: .75rem; color: var(--lime); }
.portal-ms-triggered { font-size: .75rem; color: var(--text-muted); }
.portal-ms-tasks { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.portal-ms-task { display: flex; align-items: flex-start; gap: 8px; font-size: .82rem; color: var(--text-secondary); }
.portal-ms-task-check { color: var(--lime); flex-shrink: 0; }
.badge-lime { background: var(--lime-dim); color: var(--lime); }

/* Invite card */
.portal-invite-card { max-width: 480px; padding: 24px; }

/* Placeholder card */
.portal-placeholder-card {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 40px 24px; text-align: center;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
}
.portal-placeholder-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: .5; }
.portal-placeholder-title { font-size: .95rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.portal-placeholder-body { font-size: .84rem; color: var(--text-muted); max-width: 340px; }

/* Training video upload */
.portal-upload-area {
    border: 2px dashed var(--border); border-radius: var(--radius);
    padding: 24px; margin-bottom: 0; transition: border-color .2s;
}
.portal-upload-area:hover { border-color: var(--lime); }
.portal-upload-btn {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    width: 100%; background: none; border: none; cursor: pointer; padding: 8px;
    color: var(--text-secondary);
}
.portal-upload-btn:hover { color: var(--text); }
.portal-upload-icon { font-size: 2rem; }
.portal-upload-btn span:not(.portal-upload-icon) { font-size: .9rem; font-weight: 500; }
.portal-upload-sub { font-size: .75rem; color: var(--text-muted); }
.portal-upload-restrictions {
    display: flex; flex-direction: column; gap: 6px;
    margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
}
.portal-restriction-row { display: flex; align-items: center; gap: 8px; }
.portal-restriction-label {
    font-size: .7rem; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .05em; width: 46px; flex-shrink: 0;
}
.portal-restriction-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.portal-tag {
    font-size: .68rem; font-weight: 600; padding: 2px 6px; border-radius: 3px;
    background: var(--hover); color: var(--text-secondary); border: 1px solid var(--border);
    letter-spacing: .03em;
}
.portal-restriction-value { font-size: .75rem; color: var(--text-secondary); }
.portal-upload-progress { margin-top: 14px; }
.portal-progress-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.portal-progress-fill { height: 100%; background: var(--lime); border-radius: 2px; transition: width .3s; }
.portal-progress-label { font-size: .78rem; color: var(--text-muted); margin-top: 6px; }

/* Media grid */
.portal-media-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px;
    margin-top: 4px;
}
.portal-media-item { display: flex; flex-direction: column; gap: 4px; }
.portal-media-video-thumb, .portal-media-img-thumb {
    position: relative; aspect-ratio: 9/16; border-radius: var(--radius-sm);
    overflow: hidden; background: var(--bg-card); border: 1px solid var(--border);
    cursor: pointer;
}
.portal-media-video-thumb video, .portal-media-img-thumb img {
    width: 100%; height: 100%; object-fit: cover;
}
.portal-media-play {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; color: rgba(255,255,255,.85); text-shadow: 0 0 10px rgba(0,0,0,.6);
    pointer-events: none;
}
.portal-media-name { font-size: .7rem; color: var(--text-muted); text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.portal-media-empty, .portal-media-loading { grid-column: 1/-1; text-align: center; padding: 32px; font-size: .88rem; color: var(--text-muted); }

/* Lightbox */
.portal-lightbox {
    position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,.88);
    display: flex; align-items: center; justify-content: center; padding: 16px;
    overflow-y: auto;
}
.portal-lightbox-inner {
    position: relative; background: var(--bg-card); border-radius: var(--radius);
    padding: 14px; width: min(92vw, 500px);
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    display: flex; flex-direction: column; transition: width .2s;
}
/* Landscape media: wider box */
.portal-lightbox-inner.lb-landscape { width: min(92vw, 860px); }
/* Portrait media: narrower box */
.portal-lightbox-inner.lb-portrait  { width: min(88vw, 400px); }
.portal-lightbox-close {
    position: absolute; top: -34px; right: 0; background: rgba(0,0,0,.4); border: none;
    color: #fff; font-size: 1.1rem; cursor: pointer; padding: 4px 10px; border-radius: 20px;
}
/* Media area */
.portal-lb-media-wrap {
    width: 100%; overflow: hidden; border-radius: 6px; background: #000;
    display: flex; align-items: center; justify-content: center;
    max-height: 62vh;
}
.portal-lb-media-wrap img {
    width: 100%; height: 100%; object-fit: contain; display: block; max-height: 62vh;
}

/* ── Custom video player ─────────────────────────────────────────── */
.fp-player { position: relative; width: 100%; background: #000; border-radius: 6px; overflow: hidden; }
.fp-player video { display: block; width: 100%; max-height: 62vh; object-fit: contain; cursor: pointer; }
/* Big play overlay */
.fp-play-overlay {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    pointer-events: none; transition: opacity .15s;
}
.fp-play-overlay-btn {
    width: 58px; height: 58px; border-radius: 50%;
    background: rgba(0,0,0,.55); border: 2px solid rgba(255,255,255,.7);
    display: flex; align-items: center; justify-content: center;
    transition: transform .15s, opacity .15s;
}
.fp-play-overlay-btn svg { width: 22px; height: 22px; fill: #fff; }
.fp-player.playing .fp-play-overlay { opacity: 0; }
.fp-player:hover.playing .fp-play-overlay { opacity: 1; }
/* Controls bar */
.fp-controls {
    position: absolute; bottom: 0; left: 0; right: 0; z-index: 2;
    background: linear-gradient(transparent, rgba(0,0,0,.75));
    padding: 24px 10px 8px; display: flex; flex-direction: column; gap: 6px;
    opacity: 0; transition: opacity .2s;
}
.fp-player:hover .fp-controls,
.fp-player.paused  .fp-controls { opacity: 1; }
/* Progress bar */
.fp-progress { position: relative; height: 4px; background: rgba(255,255,255,.25); border-radius: 2px; cursor: pointer; }
.fp-progress:hover { height: 6px; margin-top: -1px; }
.fp-progress-buffered { position: absolute; left: 0; top: 0; height: 100%; background: rgba(255,255,255,.2); border-radius: 2px; pointer-events: none; }
.fp-progress-played { position: absolute; left: 0; top: 0; height: 100%; background: var(--lime); border-radius: 2px; pointer-events: none; }
.fp-progress-thumb {
    position: absolute; top: 50%; transform: translate(-50%, -50%);
    width: 12px; height: 12px; border-radius: 50%; background: var(--lime);
    pointer-events: none; opacity: 0; transition: opacity .15s;
}
.fp-progress:hover .fp-progress-thumb { opacity: 1; }
/* Bottom row */
.fp-ctrl-row { display: flex; align-items: center; gap: 8px; }
.fp-btn {
    background: none; border: none; color: #fff; cursor: pointer; padding: 2px 4px;
    display: flex; align-items: center; justify-content: center; opacity: .85;
    transition: opacity .15s; flex-shrink: 0;
}
.fp-btn:hover { opacity: 1; }
.fp-btn svg { width: 16px; height: 16px; fill: #fff; }
.fp-time { font-size: .72rem; color: rgba(255,255,255,.8); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fp-spacer { flex: 1; }
.fp-speed {
    font-size: .72rem; color: rgba(255,255,255,.8); background: rgba(255,255,255,.12);
    border: none; border-radius: 3px; padding: 2px 5px; cursor: pointer; font-weight: 600;
}
.fp-speed:hover { background: rgba(255,255,255,.22); }

/* Media date groups */
.portal-media-group { margin-bottom: 20px; }
.portal-media-group-label { font-size: .72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.pmg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }

/* Load more */
.portal-load-more { display: block; width: 100%; margin-top: 16px; padding: 10px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-secondary); font-size: .85rem; cursor: pointer; text-align: center; }
.portal-load-more:hover { background: var(--hover); }
.portal-load-more:disabled { opacity: .5; cursor: default; }

/* Lightbox meta */
.portal-lightbox-meta { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.portal-meta-title { background: var(--bg-page, #0d0d0d); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; color: var(--text); font-size: .9rem; width: 100%; box-sizing: border-box; }
.portal-meta-desc { background: var(--bg-page, #0d0d0d); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; color: var(--text); font-size: .85rem; width: 100%; box-sizing: border-box; resize: vertical; }
.portal-meta-save { align-self: flex-end; padding: 7px 18px; border: none; border-radius: var(--radius-sm); background: var(--lime); color: #000; font-weight: 600; font-size: .85rem; cursor: pointer; }

/* Media item delete + bulk select */
.portal-media-item { position: relative; }
.portal-media-delete {
    position: absolute; top: 4px; right: 4px; z-index: 2;
    width: 26px; height: 26px; border-radius: 50%;
    background: rgba(0,0,0,.65); border: 1px solid rgba(255,255,255,.2);
    font-size: .9rem; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; opacity: 0; transition: opacity .15s;
    padding: 0;
}
.portal-media-item:hover .portal-media-delete { opacity: 1; }
.portal-media-item.select-mode .portal-media-delete { display: none; }
.portal-media-checkbox {
    position: absolute; top: 6px; left: 6px; z-index: 3;
    width: 20px; height: 20px; border-radius: 4px;
    border: 2px solid rgba(255,255,255,.6); background: rgba(0,0,0,.5);
    cursor: pointer; display: none; align-items: center; justify-content: center;
    transition: border-color .15s, background .15s;
}
.portal-media-checkbox.checked { background: var(--lime); border-color: var(--lime); }
.portal-media-checkbox.checked::after { content: '✓'; font-size: .75rem; color: #000; font-weight: 700; line-height: 1; }
.select-mode .portal-media-checkbox { display: flex; }
.select-mode .portal-media-video-thumb,
.select-mode .portal-media-img-thumb { cursor: pointer; }
.select-mode .portal-media-item.selected .portal-media-video-thumb,
.select-mode .portal-media-item.selected .portal-media-img-thumb {
    outline: 2px solid var(--lime); outline-offset: 1px;
}
/* Bulk action bar */
.portal-bulk-bar {
    position: sticky; bottom: 0; left: 0; right: 0; z-index: 100;
    background: var(--bg-card); border-top: 1px solid var(--border);
    padding: 10px 16px; display: flex; align-items: center; gap: 10px;
    flex-wrap: wrap;
}
.portal-bulk-bar-count { font-size: .85rem; color: var(--text-secondary); flex: 1; }
.portal-bulk-btn {
    padding: 7px 14px; border-radius: var(--radius-sm); font-size: .82rem; font-weight: 600;
    cursor: pointer; border: 1px solid var(--border); background: var(--bg);
    color: var(--text); transition: background .15s;
}
.portal-bulk-btn:hover { background: var(--hover); }
.portal-bulk-btn.danger { color: #f87171; border-color: #f87171; }
.portal-bulk-btn.danger:hover { background: rgba(248,113,113,.12); }
.portal-media-select-toggle {
    font-size: .78rem; color: var(--lime); background: none; border: none;
    cursor: pointer; padding: 0; font-weight: 600;
}
.portal-media-select-toggle:hover { text-decoration: underline; }

/* Lightbox trash + cancel */
.portal-lightbox-trash {
    background: none; border: 1px solid var(--border, #333); border-radius: var(--radius-sm);
    color: #f87171; cursor: pointer; padding: 5px 8px;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s, border-color .15s;
}
.portal-lightbox-trash:hover { background: rgba(248,113,113,.12); border-color: rgba(248,113,113,.4); }
.portal-lb-download {
    background: none; border: 1px solid var(--border, #333); border-radius: var(--radius-sm);
    color: var(--text-secondary, #aaa); cursor: pointer; padding: 5px 8px;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s, border-color .15s;
}
.portal-lb-download:hover { background: rgba(156,236,19,.1); color: var(--lime, #9cec13); border-color: rgba(156,236,19,.35); }
.portal-meta-cancel {
    padding: 7px 14px; border-radius: var(--radius-sm); font-size: .85rem; font-weight: 600;
    cursor: pointer; border: 1px solid var(--border); background: var(--bg); color: var(--text-secondary);
    transition: background .15s;
}
.portal-meta-cancel:hover { background: var(--hover); }
/* Confirm dialog */
.portal-confirm-overlay {
    position: fixed; inset: 0; z-index: 20000; background: rgba(0,0,0,.7);
    display: flex; align-items: center; justify-content: center;
}
.portal-confirm-box {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 24px 20px; width: min(88vw, 320px); display: flex; flex-direction: column; gap: 20px;
}
.portal-confirm-msg { font-size: .9rem; color: var(--text); margin: 0; text-align: center; }
.portal-confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* Language switcher (portal profile) */
.portal-lang-switcher { display: flex; gap: 8px; }
.portal-lang-btn {
    display: flex; align-items: center; gap: 7px;
    padding: 8px 16px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--bg);
    color: var(--text-secondary); font-size: .85rem; font-weight: 500;
    cursor: pointer; transition: border-color .15s, color .15s, background .15s;
}
.portal-lang-btn:hover { border-color: var(--lime); color: var(--text); }
.portal-lang-btn.active {
    border-color: var(--lime); background: var(--lime-dim);
    color: var(--lime); font-weight: 600;
}
.portal-lang-flag { font-size: 1.1rem; line-height: 1; }

/* Courses enrolled */
.portal-courses-enrolled { display: flex; align-items: center; gap: 14px; }
.portal-courses-icon { font-size: 1.8rem; }
.portal-courses-title { font-size: .9rem; font-weight: 600; color: var(--text); }

/* Athlete status dots in filter */
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.status-dot--active { background: #4ade80; }
.status-dot--paused { background: #fbbf24; }
.status-dot--restricted { background: #f87171; }

.portal-footer {
    text-align: center; padding: 16px; font-size: .75rem; color: var(--text-muted);
    border-top: 1px solid var(--border);
}

@media (max-width: 600px) {
    .portal-field-grid { grid-template-columns: 1fr; }
    .portal-program-header { flex-direction: column; align-items: flex-start; }
    .portal-media-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}

/* ─────────────────────────────────────────────────────────────
   APP SHELL
───────────────────────────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; min-height: 100dvh; }

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    padding-top: env(safe-area-inset-top);
    top: 0; left: 0; bottom: 0;
    z-index: 200;
    transition: transform var(--transition);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 14px;
    border-bottom: 1px solid var(--border);
}
.sidebar-logo { display: none; }
.sidebar-logo-img {
    width: 34px; height: 34px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}
.sidebar-brand { flex: 1; min-width: 0; }
.sidebar-brand-name {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: .72rem; font-weight: 800;
    color: #fff; line-height: 1.15; letter-spacing: .08em;
    text-transform: uppercase;
}
.sidebar-brand-sub {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: .72rem; font-weight: 800;
    color: var(--lime); letter-spacing: .08em;
    text-transform: uppercase; line-height: 1.15;
}
.sidebar-close {
    display: none; background: none; border: none;
    color: var(--text-muted); font-size: 18px; padding: 4px; line-height: 1;
}

/* Nav */
.sidebar-nav {
    flex: 1; padding: 10px 8px; overflow-y: auto;
}
.nav-section-label {
    font-size: .65rem; font-weight: 600;
    letter-spacing: .1em; text-transform: uppercase;
    color: var(--text-muted); padding: 8px 8px 4px;
}
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-radius: var(--radius-sm);
    color: var(--text-secondary); font-size: .86rem; font-weight: 500;
    transition: background var(--transition), color var(--transition);
    margin-bottom: 1px; text-decoration: none;
}
.nav-item:hover {
    background: rgba(156,236,19,.06);
    color: var(--lime);
    text-decoration: none;
}
.nav-item.active {
    background: var(--lime-dim);
    color: var(--lime);
    border-left: 2px solid var(--lime);
    padding-left: 8px;
}
.nav-icon { display: flex; align-items: center; flex-shrink: 0; }

/* Footer */
.sidebar-footer {
    padding: 12px 12px;
    border-top: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
}
.sidebar-user { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.sidebar-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--lime-dim); border: 1px solid var(--lime);
    color: var(--lime); display: flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 700; flex-shrink: 0;
}
.sidebar-avatar-img { object-fit: cover; }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
    display: block; font-size: .8rem; font-weight: 600; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-role { display: block; font-size: .68rem; color: var(--text-muted); }
.sidebar-logout {
    color: var(--text-muted); display: flex; align-items: center;
    padding: 6px; border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
}
.sidebar-logout:hover { color: var(--lime); background: var(--lime-dim); text-decoration: none; }

.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.7); z-index: 199;
}

/* ── Main wrapper ───────────────────────────────────────────── */
.main-wrap {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex; flex-direction: column; min-width: 0;
    overflow-x: hidden;
}

/* ── Top bar ────────────────────────────────────────────────── */
.topbar {
    height: calc(var(--header-h) + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 14px;
    padding-left: 24px; padding-right: 24px;
    position: sticky; top: 0; z-index: 100;
}
.topbar-menu-btn {
    display: none; background: none; border: none;
    color: var(--text-secondary); padding: 4px; border-radius: 6px;
}
.topbar-title { flex: 1; }
.topbar-title h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: .85rem; font-weight: 700;
    letter-spacing: .5px; color: var(--text-primary);
}
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--lime-dim); border: 1px solid var(--lime);
    color: var(--lime); display: flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 700;
}
.topbar-avatar-img { object-fit: cover; }
.portal-avatar-img { object-fit: cover; }

/* ── Page content ───────────────────────────────────────────── */
.page-content {
    flex: 1; padding: 28px 28px 56px;
    max-width: 1400px; width: 100%;
}
.page-header {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 24px; gap: 10px;
    flex-wrap: nowrap;
}
.page-header > div:first-child { min-width: 0; flex: 1; }
.page-header .page-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-heading {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem; font-weight: 800;
    letter-spacing: .5px; color: #fff;
}
.page-sub { color: var(--text-secondary); font-size: .85rem; }
.page-header-actions {
    display: flex; gap: 8px; align-items: center; flex-shrink: 0;
}
.btn-icon-only {
    padding-left: 10px; padding-right: 10px;
}
/* Actions overflow menu (mobile: collapses action buttons into ⋯ dropdown) */
.page-actions-overflow { display: none; position: relative; }
.page-actions-overflow-btn {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 50%;
    background: none; border: 1px solid var(--border); cursor: pointer;
    color: var(--text-muted); transition: all var(--transition);
    touch-action: manipulation;
}
.page-actions-overflow-btn:hover { border-color: var(--lime); color: var(--lime); }
.page-actions-menu {
    display: none; position: absolute; right: 0; top: calc(100% + 6px);
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(0,0,0,.4);
    z-index: 120; min-width: 180px; overflow: hidden;
}
.page-actions-menu.open { display: block; }
.page-actions-menu-item {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 10px 14px; background: none; border: none;
    color: var(--text-primary); font-size: .82rem; font-family: Inter, sans-serif;
    cursor: pointer; text-decoration: none; text-align: left;
    border-bottom: 1px solid rgba(255,255,255,.04);
    transition: background .1s;
}
.page-actions-menu-item:last-child { border-bottom: none; }
.page-actions-menu-item:hover { background: var(--hover); }

@media (max-width: 768px) {
    .page-header { margin-bottom: 14px; gap: 8px; }
    .page-heading { font-size: .92rem; }
    .page-sub { font-size: .74rem; }
    /* On mobile: hide inline action buttons, show overflow menu */
    .page-header-actions .btn:not(.btn-icon-only) { display: none; }
    .page-header-actions .filter-select { display: none; }
    .page-actions-overflow { display: block; }
    .page-header-actions { gap: 4px; flex-shrink: 0; }
}

/* ── Unified filter bar (below page header) ────────────────── */
.page-filter-bar {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin-bottom: 14px;
}
.page-filter-bar .filter-pills { margin: 0; }
.page-filter-bar .search-input { max-width: 220px; }
@media (max-width: 768px) {
    .page-filter-bar { gap: 6px; }
    .page-filter-bar .search-input { max-width: 100%; flex: 1; }
}

/* ─────────────────────────────────────────────────────────────
   COMPONENTS
───────────────────────────────────────────────────────────── */

/* Stats row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px; margin-bottom: 20px;
}
.stats-row-5 { grid-template-columns: repeat(5, 1fr); }
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
}
.stat-icon {
    width: 36px; height: 36px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 10px;
}
.stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem; font-weight: 700;
    letter-spacing: -.5px; line-height: 1.1;
    color: #fff;
}
.stat-label { font-size: .75rem; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
.stat-trend { font-size: .73rem; margin-top: 6px; }
.trend-up   { color: var(--lime); }
.trend-down { color: var(--danger); }
.trend-neutral { color: var(--text-muted); }

/* Card */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden; margin-bottom: 18px;
}
.card-toolbar {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.card-header-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px 10px; border-bottom: 1px solid var(--border);
}
.card-title { font-weight: 600; font-size: .9rem; color: var(--text-primary); }
.card-subtitle { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }

/* Table */
.table-wrap {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
}
.data-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.data-table th {
    text-align: left; padding: 9px 14px;
    font-size: .68rem; font-weight: 600;
    letter-spacing: .08em; text-transform: uppercase;
    color: var(--text-muted); border-bottom: 1px solid var(--border);
    white-space: nowrap; background: var(--sidebar-bg);
}
.data-table td {
    padding: 11px 14px; border-bottom: 1px solid var(--border);
    color: var(--text-primary); vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-card-hover); }

/* Search & filter */
.search-input {
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .83rem; outline: none;
    width: 210px;
    background: var(--bg-input); color: var(--text-primary);
    transition: border-color var(--transition);
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--lime); }
.filter-select {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .83rem; outline: none;
    background: var(--bg-input); color: var(--text-primary); cursor: pointer;
}

/* Avatar cell */
.avatar-cell { display: flex; align-items: center; gap: 9px; }
.mini-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--lime-dim); color: var(--lime);
    font-size: .7rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    border: 1px solid rgba(156,236,19,.2);
}

/* Row actions */
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.action-btn {
    background: none; border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 5px 7px;
    color: var(--text-muted); display: flex; align-items: center;
    transition: all var(--transition);
}
.action-btn:hover { color: var(--lime); border-color: var(--lime); background: var(--lime-dim); text-decoration: none; }
.action-btn-success:hover { color: var(--lime); border-color: var(--lime); background: var(--lime-dim); }

/* Badges */
.badge {
    display: inline-flex; align-items: center;
    padding: 2px 8px; border-radius: 20px;
    font-size: .7rem; font-weight: 600;
    letter-spacing: .03em; white-space: nowrap;
}
.badge-success  { background: var(--success-bg); color: var(--success); }
.badge-warning  { background: var(--warning-bg); color: var(--warning); }
.badge-danger   { background: var(--danger-bg);  color: var(--danger); }
.badge-info     { background: var(--info-bg);    color: var(--info); }
.badge-orange   { background: rgba(234,88,12,.12); color: #f97316; }
.badge-neutral  { background: rgba(255,255,255,.06); color: var(--text-secondary); }
.badge-lime     { background: var(--lime-dim); color: var(--lime); }

/* Alerts */
.alert {
    padding: 12px 16px; border-radius: var(--radius-sm);
    margin-bottom: 18px; font-size: .86rem; font-weight: 500;
}
.alert-danger  { background: var(--danger-bg);  color: var(--danger);  border: 1px solid rgba(239,68,68,.3); }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(34,197,94,.3); }

/* Toast notifications */
.toast-container {
    position: fixed; top: calc(16px + env(safe-area-inset-top)); right: 16px; z-index: 99999;
    display: flex; flex-direction: column; gap: 8px;
    pointer-events: none; max-width: min(400px, calc(100vw - 32px));
}
.toast {
    pointer-events: auto;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 36px 12px 14px;
    font-size: .84rem; font-weight: 500; line-height: 1.4;
    box-shadow: 0 8px 24px rgba(0,0,0,.35);
    position: relative; overflow: hidden;
    transform: translateX(120%); opacity: 0;
    transition: transform .3s cubic-bezier(.22,1,.36,1), opacity .3s ease;
    touch-action: pan-x; user-select: none;
}
.toast.toast-in   { transform: translateX(0); opacity: 1; }
.toast.toast-out  { transform: translateX(120%); opacity: 0; }
.toast-success { border-left: 3px solid var(--success); color: var(--success); }
.toast-error   { border-left: 3px solid var(--danger);  color: var(--danger); }
.toast-warning { border-left: 3px solid var(--warning); color: var(--warning); }
.toast-info    { border-left: 3px solid var(--lime);    color: var(--lime); }
.toast-dismiss {
    position: absolute; top: 6px; right: 6px;
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; font-size: 1rem; line-height: 1;
    padding: 4px; border-radius: 3px;
}
.toast-dismiss:hover { color: var(--text); background: var(--hover); }
.toast-progress {
    position: absolute; bottom: 0; left: 0; height: 2px;
    background: currentColor; opacity: .5;
    transition: none;
}
.toast-progress.running { transition: width linear; }

/* Confirm dialog */
.confirm-backdrop {
    position: fixed; inset: 0; z-index: 10001;
    background: rgba(0,0,0,.55); display: flex;
    align-items: center; justify-content: center;
    opacity: 0; transition: opacity .2s ease;
}
.confirm-backdrop.confirm-open { opacity: 1; }
.confirm-dialog {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
    max-width: 420px; width: calc(100vw - 32px);
    box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.confirm-title {
    font-weight: 600; font-size: 1rem; margin-bottom: 6px;
    color: var(--text);
}
.confirm-message {
    font-size: .85rem; color: var(--text-secondary);
    margin-bottom: 14px; line-height: 1.45;
}
.confirm-message:empty { display: none; }
.confirm-inputs { display: flex; flex-direction: column; gap: 10px; margin: 0 0 18px; }
.confirm-inputs--row { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
.confirm-input { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.confirm-inputs--row .confirm-input { flex: 1 1 0; min-width: 100px; }
.confirm-inputs--row .confirm-input--inline { flex: 0 0 auto; }
.confirm-inputs--row .confirm-input--inline .form-input { width: 110px; }
.confirm-input-label { font-size: .72rem; color: var(--text-secondary); font-weight: 500; }
.confirm-actions { display: flex; gap: 8px; justify-content: flex-end; }
.opp-lang-pick { display: flex; gap: 10px; margin-bottom: 18px; }
.opp-lang-opt { display: flex; align-items: center; gap: 7px; padding: 8px 16px; border: 1px solid var(--border); border-radius: 20px; cursor: pointer; font-size: .84rem; color: var(--text-secondary); transition: border-color .12s, color .12s; }
.opp-lang-opt:has(input:checked) { border-color: var(--lime); color: var(--lime); font-weight: 600; }
.opp-lang-opt input { accent-color: var(--lime); }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: var(--radius-sm);
    font-size: .83rem; font-weight: 600;
    border: 1px solid transparent; cursor: pointer;
    transition: all var(--transition); text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary {
    background: var(--lime); color: #0a0a0a; border-color: var(--lime);
}
.btn-primary:hover {
    background: #aaff1a; border-color: #aaff1a;
    box-shadow: var(--lime-glow); text-decoration: none; color: #0a0a0a;
}
.btn-ghost {
    background: transparent; color: var(--text-secondary);
    border-color: var(--border);
}
.btn-ghost:hover {
    background: rgba(255,255,255,.04); color: var(--text-primary);
    text-decoration: none;
}
.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 5px 11px; font-size: .78rem; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block; font-size: .8rem; font-weight: 600;
    color: var(--text-secondary); margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%; padding: 8px 12px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: .86rem; color: var(--text-primary);
    background: var(--bg-input); outline: none;
    font-family: inherit;
    transition: border-color var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--lime);
    box-shadow: 0 0 0 3px rgba(156,236,19,.1);
}
.form-group textarea { resize: vertical; }

/* Standalone drawer inputs (task form, note form) */
.form-input {
    width: 100%; padding: 8px 12px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: .86rem; color: var(--text-primary);
    background: var(--bg-input); outline: none;
    font-family: inherit;
    transition: border-color var(--transition);
    box-sizing: border-box;
}
.form-input:focus { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(156,236,19,.1); }
textarea.form-input { resize: vertical; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.form-row-between {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; font-size: .82rem;
}
.form-note { margin-top: 10px; font-size: .78rem; color: var(--text-muted); }

/* Password toggle */
.password-wrap { position: relative; }
.password-wrap input { padding-right: 40px; }
.pw-toggle {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--text-muted);
    padding: 0; display: flex; align-items: center;
}
.pw-toggle:hover { color: var(--lime); }

/* Checkbox */
.checkbox-label { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.checkbox-label input[type=checkbox] { width: auto; cursor: pointer; accent-color: var(--lime); }
.text-link {
    color: var(--lime); font-size: .82rem; cursor: pointer;
    background: none; border: none; padding: 0; font-family: inherit;
    text-decoration: none;
}
.text-link:hover { text-decoration: underline; }

/* Mono */
.mono { font-family: 'Courier New', monospace; font-size: .8rem; color: var(--lime); }

/* Utility */
.text-success { color: var(--lime) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger  { color: var(--danger) !important; }
.text-muted   { color: var(--text-muted) !important; }
.hidden       { display: none !important; }

/* ─────────────────────────────────────────────────────────────
   MODAL
───────────────────────────────────────────────────────────── */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    height: 100lvh; /* covers behind keyboard transparent areas (iOS 26 keyboard) */
    background: rgba(0,0,0,.75); z-index: 500;
    align-items: center; justify-content: center;
    padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
    /* Keyboard pushes the centered modal up so it stays visible above the keys */
    padding-bottom: calc(max(20px, env(safe-area-inset-bottom)) + env(keyboard-inset-height, 0px));
}
.modal-backdrop.open { display: flex; }
.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    width: 100%; max-width: 480px;
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 40px);
    overflow-y: auto;
    animation: slideUp .18s ease;
}
.modal-lg { max-width: 620px; }
.modal-lg .modal-body { min-height: min(50vh, 480px); }
@keyframes slideUp {
    from { transform: translateY(14px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-header h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: .88rem; font-weight: 700; letter-spacing: .3px;
}
.modal-close {
    background: none; border: none; font-size: 18px;
    color: var(--text-muted); line-height: 1; padding: 4px;
    border-radius: 4px; transition: color var(--transition);
}
.modal-close:hover { color: var(--lime); }
.modal-body { padding: 20px; }
.modal-footer {
    display: flex; justify-content: flex-end; gap: 10px;
    padding-top: 8px; border-top: 1px solid var(--border); margin-top: 8px;
}
#salesOrderModal .modal {
    display: flex; flex-direction: column; overflow: hidden;
}
#salesOrderModal .modal-body {
    overflow-y: auto; flex: 1;
}
#salesOrderModal .modal-footer {
    flex-shrink: 0; margin-top: 0; padding: 12px 20px;
}

/* ─────────────────────────────────────────────────────────────
   PIPELINE STRIP (Sales)
───────────────────────────────────────────────────────────── */
.pipeline-strip {
    display: flex; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; margin-bottom: 18px;
}
.pipeline-stage {
    flex: 1; padding: 13px 14px;
    border-right: 1px solid var(--border); text-align: center;
}
.pipeline-stage:last-child { border-right: none; }
.pipeline-stage-name {
    font-size: .65rem; color: var(--text-muted);
    font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px;
}
.pipeline-stage-count {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.15rem; font-weight: 700; color: #fff;
}
.pipeline-stage-val { font-size: .72rem; color: var(--text-muted); margin-top: 2px; }

/* ─────────────────────────────────────────────────────────────
   PROGRAMS GRID
───────────────────────────────────────────────────────────── */
.programs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px; margin-bottom: 18px;
}
.program-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex; flex-direction: column;
    transition: border-color var(--transition);
}
.program-card:hover { border-color: var(--border-strong); }
.program-card-top { padding: 18px 18px 14px; flex: 1; }
.program-card-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 10px; margin-bottom: 10px;
}
.program-name {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700; font-size: .88rem; color: #fff; letter-spacing: .2px;
}
.program-category { font-size: .72rem; color: var(--text-muted); margin-top: 3px; }
.program-desc { font-size: .82rem; color: var(--text-secondary); line-height: 1.55; }
.program-meta {
    display: flex; flex-wrap: wrap; gap: 8px 14px;
    padding: 11px 18px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.program-meta-item {
    display: flex; align-items: center; gap: 5px;
    font-size: .76rem; color: var(--text-secondary);
}
.program-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 18px;
}
.program-price { display: flex; align-items: baseline; gap: 3px; }
.price-amount {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem; font-weight: 700; color: var(--lime);
}
.price-period { font-size: .75rem; color: var(--text-muted); }

/* ─────────────────────────────────────────────────────────────
   ANALYTICS
───────────────────────────────────────────────────────────── */
.analytics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.analytics-card-wide { grid-column: 1 / -1; }
.chart-area { padding: 16px; position: relative; height: 260px; }

.integration-placeholder {
    padding: 36px 24px; text-align: center; color: var(--text-muted);
    display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.integration-placeholder p { font-size: .86rem; max-width: 280px; }
.integration-note { padding: 12px 20px 16px; font-size: .8rem; text-align: center; }

.social-metrics { padding: 4px 0; }
.social-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 11px 20px; border-bottom: 1px solid var(--border);
    font-size: .84rem;
}
.social-row:last-child { border-bottom: none; }
.social-platform { display: flex; align-items: center; gap: 9px; font-weight: 500; }
.social-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

/* ─────────────────────────────────────────────────────────────
   SETTINGS
───────────────────────────────────────────────────────────── */
.settings-layout {
    display: grid; grid-template-columns: 190px 1fr;
    gap: 22px; align-items: start;
}
.settings-nav {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 6px;
    display: flex; flex-direction: column; gap: 2px;
}
.settings-nav-item {
    background: none; border: none; text-align: left;
    padding: 9px 12px; border-radius: var(--radius-sm);
    font-size: .84rem; font-weight: 500;
    color: var(--text-secondary); cursor: pointer;
    transition: all var(--transition);
}
.settings-nav-item:hover { background: rgba(255,255,255,.04); color: var(--text-primary); }
.settings-nav-item.active { background: var(--lime-dim); color: var(--lime); font-weight: 600; }

.settings-content {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 28px;
    min-width: 0; overflow-x: auto;
}
@media (max-width: 768px) {
    .settings-content { padding: 16px; }
}
.prog-table-wrap { overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
.settings-section-header { margin-bottom: 22px; }
.settings-section-header h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: .88rem; font-weight: 700; letter-spacing: .3px;
    color: #fff; margin-bottom: 4px;
}
.settings-section-header p { font-size: .83rem; color: var(--text-secondary); }
.settings-form .btn { margin-top: 4px; }

.integration-block {
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 15px 18px; margin-bottom: 14px;
    transition: border-color var(--transition);
}
.integration-block:hover { border-color: var(--border-strong); }
.integration-block-head {
    display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
}
.integration-block-head > div:nth-child(2) { flex: 1; }
.integration-block-head strong { font-size: .88rem; display: block; color: var(--text-primary); }
.integration-block-head p { font-size: .78rem; color: var(--text-secondary); margin-top: 2px; }
.integration-logo {
    width: 34px; height: 34px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .82rem; flex-shrink: 0;
}
.integration-block .form-group { margin-bottom: 0; }

/* Bexio settings accordion */
.bexio-accordion {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.bexio-accordion + .bexio-accordion { margin-top: -1px; border-radius: 0; }
.bexio-accordion:first-of-type { border-radius: 8px 8px 0 0; }
.bexio-accordion:last-of-type  { border-radius: 0 0 8px 8px; }
.bexio-accordion:only-of-type  { border-radius: 8px; }
.bexio-accordion summary {
    display: flex; align-items: center; justify-content: space-between;
    padding: 13px 16px;
    font-size: .875rem; font-weight: 600; color: var(--text-primary);
    cursor: pointer; list-style: none; user-select: none;
    background: var(--bg-card);
    transition: background .15s;
}
.bexio-accordion summary::-webkit-details-marker { display: none; }
.bexio-accordion summary::after {
    content: '';
    display: inline-block;
    width: 7px; height: 7px;
    border-right: 1.5px solid var(--text-muted);
    border-bottom: 1.5px solid var(--text-muted);
    transform: rotate(45deg);
    transition: transform .2s;
    flex-shrink: 0;
}
.bexio-accordion[open] summary::after { transform: rotate(-135deg); }
.bexio-accordion summary:hover { background: var(--hover); }
.bexio-accordion-body {
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid var(--border);
}
.bexio-accordion-body p { margin: 0 0 .75rem; font-size: .875rem; color: var(--text-secondary); line-height: 1.6; }
.bexio-accordion-body ol { color: var(--text-secondary); font-size: .875rem; line-height: 1.8; }

/* Toggle switch */
.toggle-group { margin-bottom: 20px; }
.toggle-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-row strong { font-size: .86rem; font-weight: 600; display: block; margin-bottom: 2px; }
.toggle-row p { font-size: .78rem; color: var(--text-secondary); }
.toggle-switch { position: relative; flex-shrink: 0; cursor: pointer; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
    display: block; width: 38px; height: 20px;
    background: var(--border-strong); border-radius: 20px;
    position: relative; transition: background var(--transition);
}
.toggle-track::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 14px; height: 14px; background: #fff; border-radius: 50%;
    transition: transform var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.toggle-switch input:checked + .toggle-track { background: var(--lime); }
.toggle-switch input:checked + .toggle-track::after { transform: translateX(18px); }

.session-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; padding: 13px 0;
}
.session-row strong { font-size: .86rem; display: block; }
.session-row p { font-size: .78rem; color: var(--text-secondary); margin-top: 2px; }

.divider { border: none; border-top: 1px solid var(--border); margin: 26px 0; }

/* ─────────────────────────────────────────────────────────────
   ATHLETES / SALES shared helpers
───────────────────────────────────────────────────────────── */
.prog-pill {
    display: inline-flex; align-items: center;
    padding: 2px 8px; border-radius: 20px;
    font-size: .7rem; font-weight: 600;
    background: var(--lime-dim); color: var(--lime); white-space: nowrap;
}
.tag-chip {
    display: inline-block; padding: 1px 6px; border-radius: 10px;
    font-size: .7rem; background: rgba(255,255,255,.06);
    color: var(--text-secondary); margin: 1px;
}
.source-badge { font-size: .76rem; color: var(--text-secondary); text-transform: capitalize; }
.contact-tags { display: flex; gap: 4px; margin-top: 3px; flex-wrap: wrap; }
.hidden-col { display: none; }
.mt-8 { margin-top: 8px; }

.empty-state {
    padding: 52px 24px; text-align: center; color: var(--text-muted);
    display: flex; flex-direction: column; align-items: center; gap: 12px; font-size: .88rem;
}

/* ─────────────────────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .stats-row          { grid-template-columns: 1fr 1fr; }
    .stats-row-5        { grid-template-columns: 1fr 1fr; }
    .analytics-grid     { grid-template-columns: 1fr; }
    .analytics-card-wide { grid-column: auto; }
    .settings-layout    { grid-template-columns: 1fr; }
    .settings-nav       { flex-direction: row; overflow-x: auto; flex-wrap: nowrap; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .sidebar-close { display: block; }
    .main-wrap { margin-left: 0; }
    .topbar-menu-btn { display: none !important; } /* bottom nav replaces hamburger */
    .page-content { padding: 18px 14px calc(72px + env(safe-area-inset-bottom)); }
    /* Prevent iOS auto-zoom on input focus (requires >= 16px) */
    input[type="text"], input[type="search"], input[type="email"],
    input[type="tel"], input[type="url"], input[type="number"],
    textarea, select { font-size: 16px !important; }
    .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
    .pipeline-strip { display: grid; grid-template-columns: repeat(3,1fr); }
    .login-brand { display: none; }
    /* Drawer safe area */
    .drawer { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }

    /* ── Compact stat cards ── */
    .stats-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 14px;
    }
    /* 5-card rows: horizontal scroll strip */
    .stats-row-5 {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
        margin-bottom: 14px;
        padding-bottom: 4px; /* space for scrollbar */
        scrollbar-width: none;
    }
    .stats-row-5::-webkit-scrollbar { display: none; }
    .stats-row-5 .stat-card {
        min-width: 130px;
        flex-shrink: 0;
        scroll-snap-align: start;
    }
    /* Tighter card padding + smaller value on mobile */
    .stat-card {
        padding: 12px 14px;
    }
    .stat-value {
        font-size: 1.2rem;
    }
    .stat-icon {
        width: 28px; height: 28px;
        margin-bottom: 6px;
        border-radius: 6px;
    }
    .stat-label { font-size: .70rem; margin-top: 3px; }
    .stat-trend { font-size: .68rem; margin-top: 4px; }
}

@media (max-width: 480px) {
    .programs-grid  { grid-template-columns: 1fr; }
    /* Keep 2-col for stat cards — 1-col wastes too much vertical space */
    .stats-row { grid-template-columns: 1fr 1fr; }
    .stat-value { font-size: 1.1rem; }
}

/* ─────────────────────────────────────────────────────────────
   ATHLETE CARD GRID
───────────────────────────────────────────────────────────── */
.cards-toolbar {
    display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center;
}
.filter-pills { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.tag-pill {
    display: inline-block; padding: 2px 8px; font-size: .72rem; font-weight: 500;
    background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px;
    color: var(--text-secondary); margin-right: 4px; margin-bottom: 4px;
}

.athlete-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 24px;
    min-height: 50vh;
    align-content: start;
}
@media (min-width: 768px)  { .athlete-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .athlete-grid { grid-template-columns: repeat(3, 1fr); } }

.athlete-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex; flex-direction: column;
    cursor: pointer;
    transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.athlete-card:hover {
    border-color: rgba(156,236,19,.35);
    box-shadow: 0 4px 20px rgba(0,0,0,.35);
    transform: translateY(-1px);
}

/* Card header */
.athlete-card-header {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 14px 10px;
}
.athlete-avatar {
    width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; object-fit: cover;
}
.athlete-avatar-initials {
    background: var(--lime-dim); border: 1px solid rgba(156,236,19,.25);
    color: var(--lime); display: flex; align-items: center; justify-content: center;
    font-size: .85rem; font-weight: 700;
}
.athlete-card-identity { flex: 1; min-width: 0; }
.athlete-name {
    font-weight: 600; font-size: .88rem; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.athlete-meta-row {
    display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 3px;
}
.athlete-meta-row .badge { font-size: .65rem; padding: 1px 6px; }

/* Card body */
.athlete-card-body {
    padding: 0 14px 8px; flex: 1;
    display: flex; flex-direction: column; gap: 6px;
}
.athlete-milestone-row {
    display: flex; flex-direction: column; gap: 4px;
    padding: 8px 10px;
    background: rgba(255,255,255,.02);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.milestone-item { display: flex; align-items: baseline; gap: 6px; }
.milestone-label {
    font-size: .64rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: var(--text-muted); flex-shrink: 0; width: 32px;
}
.milestone-value { font-size: .81rem; color: var(--text-primary); flex: 1; }
.milestone-date  {
    font-size: .71rem; font-weight: 600; flex-shrink: 0;
    background: rgba(255,255,255,.06); padding: 1px 6px; border-radius: 10px;
}
.athlete-card-footer-info {
    display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center;
    padding-top: 2px;
}
.athlete-expiry { font-size: .74rem; color: var(--text-secondary); }
.athlete-billing-pill { font-size: .74rem; font-weight: 500; }

/* Card footer: quick actions */
.athlete-card-footer {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-top: 1px solid var(--border);
}
.card-action-btn {
    background: none; border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 5px 9px;
    font-size: .82rem; cursor: pointer; line-height: 1;
    color: var(--text-primary); text-decoration: none;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
}
.card-action-btn:hover {
    border-color: var(--lime); background: var(--lime-dim); text-decoration: none;
}

/* ─────────────────────────────────────────────────────────────
   SLIDE-IN DRAWER
───────────────────────────────────────────────────────────── */
.drawer-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    height: 100lvh; /* extends behind keyboard transparent areas (iOS 26 keyboard) */
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(2px);
    z-index: 399;
    transition: opacity .25s ease;
    cursor: pointer;
}
.drawer-overlay.open { display: block; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

.athlete-drawer {
    position: fixed; top: 0; right: 0;
    bottom: 0;
    bottom: env(keyboard-inset-height, 0px); /* anchored above the keyboard */
    width: min(460px, 98vw);
    padding-top: env(safe-area-inset-top);
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    z-index: 400;
    display: flex; flex-direction: column;
    transform: translateX(100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
}
.athlete-drawer.open { transform: translateX(0); box-shadow: -12px 0 40px rgba(0,0,0,.6); }

.drawer-swipe-hint { display: none; }
@media (max-width: 768px) {
    .athlete-drawer { width: 100vw; border-left: none; }
}

/* Skeleton loading lines */
.skeleton-line {
    height: 14px; border-radius: 4px; margin-bottom: 10px;
    background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-card) 50%, var(--bg-input) 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.4s ease-in-out infinite;
}
.skeleton-line:nth-child(1) { width: 80%; }
.skeleton-line:nth-child(2) { width: 60%; }
.skeleton-line:nth-child(3) { width: 70%; }
@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.drawer-header {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.drawer-athlete-id { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; }
.drawer-avatar-wrap { position: relative; flex-shrink: 0; cursor: pointer; }
.drawer-avatar-edit {
    position: absolute; bottom: -2px; right: -2px;
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--lime); color: #000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .15s;
}
.drawer-avatar-wrap:hover .drawer-avatar-edit { opacity: 1; }
.drawer-header-program {
    padding: 6px 18px; font-size: .72rem; color: var(--text-muted);
    border-bottom: 1px solid var(--border); background: rgba(255,255,255,.02);
    display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center;
    min-height: 0;
}
.drawer-header-program:empty { display: none; }
.drawer-program-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; padding: 6px 14px 6px 18px;
    border-bottom: 1px solid var(--border); background: rgba(255,255,255,.02);
    flex-wrap: wrap;
}
.drawer-header-program-text {
    font-size: .72rem; color: var(--text-muted);
    display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center;
    flex: 1; min-width: 0;
}
.drawer-header-program-text:empty::before { content: 'No active program'; opacity: .5; }
.drawer-program-actions { display: flex; gap: 4px; flex-shrink: 0; }
.dpb-btn {
    background: none; border: 1px solid var(--border); color: var(--text-secondary);
    padding: 3px 8px; border-radius: var(--radius-sm); cursor: pointer;
    font-size: .7rem; font-family: inherit; white-space: nowrap;
    transition: color .15s, border-color .15s, background .15s;
}
.dpb-btn:hover { color: var(--lime); border-color: var(--lime); }
.dpb-btn-danger:hover { color: var(--danger, #f87171); border-color: var(--danger, #f87171); background: rgba(248,113,113,.06); }
.drawer-extend-panel {
    display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
    padding: 8px 18px; border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,.015);
}
.edit-form-divider {
    height: 1px; background: var(--border);
    margin: 16px 0 14px;
}
.drawer-name {
    font-family: 'Orbitron', sans-serif;
    font-size: .9rem; font-weight: 700; color: #fff; letter-spacing: .2px;
}
.drawer-meta { font-size: .76rem; color: var(--text-secondary); margin-top: 2px; }
.drawer-header-actions { display: flex; align-items: center; gap: 2px; }
.drawer-close {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 6px; border-radius: var(--radius-sm);
    flex-shrink: 0; display: flex; align-items: center;
    transition: color var(--transition), background var(--transition);
}
.drawer-close:hover { color: var(--lime); background: var(--lime-dim); }

/* ── Action strip (WhatsApp / Book / HL / Course / More) ── */
.drawer-action-strip {
    display: flex; gap: 4px;
    padding: 6px 14px 0;
    border-bottom: 1px solid var(--border);
    overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.drawer-action-strip::-webkit-scrollbar { display: none; }
.das-btn {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 7px 10px 8px;
    background: none; border: none; border-bottom: 2px solid transparent;
    color: var(--text-secondary); font-size: .68rem; font-family: inherit;
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: color .15s, border-color .15s;
    flex-shrink: 0;
}
.das-btn:hover { color: var(--lime); text-decoration: none; }
.das-btn svg { opacity: .7; transition: opacity .15s; }
.das-btn:hover svg { opacity: 1; }
.das-btn-disabled { opacity: .3; pointer-events: none; }
.das-btn-danger { color: var(--danger, #f87171); }
.das-btn-danger:hover { color: var(--danger, #f87171); }
.das-btn-primary { color: var(--lime); border-bottom-color: var(--lime); }
.das-btn-primary svg { opacity: 1; }
.das-btn-primary:hover { color: var(--lime); }
.das-more { position: relative; }
.das-dropdown-menu {
    position: fixed; z-index: 9999;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); min-width: 220px;
    box-shadow: 0 8px 24px rgba(0,0,0,.5); overflow: hidden;
}
.da-dropdown-group-label {
    padding: 7px 12px 3px;
    font-size: .63rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; color: var(--text-muted);
}
.das-notion-link { display: block; }

/* ── Remove-from-program details/summary ──────────────────  */
.drawer-danger-details summary {
    font-size: .78rem; color: var(--danger, #f87171);
    cursor: pointer; list-style: none; padding: 6px 0;
    user-select: none;
}
.drawer-danger-details summary::-webkit-details-marker { display: none; }
.drawer-danger-details summary::before { content: '⚠ '; }
.drawer-danger-details[open] summary { opacity: .7; }

.drawer-body {
    flex: 1; overflow-y: auto; overflow-x: hidden; padding: 0;
}

/* Sections inside drawer */
.drawer-section {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}
.drawer-section-label {
    font-size: .65rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .1em; color: var(--text-muted); margin-bottom: 10px;
}

.edit-section-label {
    font-size: .65rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .1em; color: var(--text-muted);
    margin-top: 18px; margin-bottom: 8px;
    padding-bottom: 5px; border-bottom: 1px solid var(--border);
}
.edit-section-label:first-child { margin-top: 0; }

.profile-group-label {
    font-size: .65rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .1em; color: var(--text-muted); margin-bottom: 6px;
}
.profile-group { margin-bottom: 10px; }

/* 2-column action grid */
.drawer-action-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.drawer-action-btn {
    display: flex; align-items: center; gap: 7px;
    padding: 9px 11px;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); cursor: pointer;
    font-size: .82rem; color: var(--text-primary); font-family: inherit;
    text-decoration: none; transition: all var(--transition); text-align: left;
}
.drawer-action-btn:hover {
    border-color: var(--lime); background: var(--lime-dim);
    color: var(--text-primary); text-decoration: none;
}
.drawer-action-btn.drawer-action-danger:hover { border-color: var(--danger); background: var(--danger-bg); }
.drawer-action-btn.drawer-action-disabled { opacity: .4; pointer-events: none; }
.da-icon { font-size: 1rem; flex-shrink: 0; }

/* Drawer action dropdowns */
.da-dropdown { position: relative; }
.da-dropdown-toggle { width: 100%; justify-content: flex-start; }
.da-chevron { margin-left: auto; font-size: .7rem; opacity: .5; transition: transform .15s; }
.da-dropdown.open .da-chevron { transform: rotate(180deg); }
.da-dropdown-menu {
    display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,.45); overflow: hidden; margin-top: -1px;
}
.da-dropdown.open .da-dropdown-menu { display: block; }
.da-dropdown-item {
    display: block; width: 100%; padding: 9px 12px; border: none; background: none;
    color: var(--text-secondary); font-size: .8rem; text-align: left; cursor: pointer;
    transition: background .1s, color .1s; border-bottom: 1px solid var(--border);
}
.da-dropdown-item:last-child { border-bottom: none; }
.da-dropdown-item:hover { background: var(--lime-dim); color: var(--text-primary); }

/* Expiry readonly display */
.drawer-expiry-row {
    display: flex; align-items: center; gap: 10px; margin-bottom: 4px;
}
.drawer-expiry-label {
    font-size: .76rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0;
}
.drawer-expiry-readonly {
    flex: 1; padding: 6px 10px;
    background: rgba(255,255,255,.04); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text-secondary);
    font-size: .84rem; outline: none; cursor: default;
}

/* Extend panel */
.extend-date-input {
    padding: 7px 10px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--bg-input);
    color: var(--text-primary); font-size: .84rem; outline: none;
}
.extend-date-input:focus { border-color: var(--lime); }

/* Drawer tabs */
.drawer-tabs {
    display: flex; border-bottom: 1px solid var(--border);
    flex-shrink: 0; padding: 0 18px;
    position: sticky; top: 0; background: var(--bg-card); z-index: 1;
}
.tab-btn {
    flex: 1; padding: 10px 4px;
    background: none; border: none; border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-size: .82rem; font-weight: 600; color: var(--text-muted);
    cursor: pointer; transition: all var(--transition); white-space: nowrap;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--lime); border-bottom-color: var(--lime); }

.drawer-tab-panel { padding: 16px 18px; }
.drawer-empty { color: var(--text-muted); font-size: .84rem; padding: 4px 0; }

/* Profile info grid */
.drawer-profile-section { padding: 12px 18px; }
.drawer-profile-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px;
}
.profile-field {}
.profile-field-label {
    font-size: .63rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; color: var(--text-muted); margin-bottom: 1px;
}
.profile-field-value {
    font-size: .82rem; color: var(--text-primary);
}
.profile-field-value a { color: var(--lime); }

/* Guardian card */
.guardian-card {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: var(--radius-sm);
    background: var(--bg); border: 1px solid var(--border);
}
.guardian-card + .guardian-card { margin-top: 6px; }
.guardian-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255,255,255,.06);
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: .72rem; color: var(--text-muted);
    flex-shrink: 0;
}
.guardian-info { flex: 1; min-width: 0; }
.guardian-name { font-size: .82rem; font-weight: 600; color: var(--text-primary); }
.guardian-meta { font-size: .72rem; color: var(--text-secondary); }
.guardian-meta a { color: var(--lime); }
.guardian-wa {
    font-size: 1.1rem; text-decoration: none; flex-shrink: 0;
    opacity: .7; transition: opacity var(--transition);
}
.guardian-wa:hover { opacity: 1; }

/* ─────────────────────────────────────────────────────────────
   BILLING & HISTORY ROWS
───────────────────────────────────────────────────────────── */
.billing-row {
    display: grid; grid-template-columns: 1fr auto auto;
    gap: 10px; align-items: center;
    padding: 10px 0; border-bottom: 1px solid var(--border);
}
.billing-row:last-child { border-bottom: none; }

.opp-list-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; padding: 9px 6px; border-bottom: 1px solid var(--border);
    cursor: pointer; border-radius: 5px; margin: 0 -6px;
}
.opp-list-row:last-child { border-bottom: none; }
.opp-list-row:hover { background: var(--hover); }
.opp-list-status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.opp-list-main { flex: 1; min-width: 0; }
.opp-list-name { font-size: .84rem; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opp-list-stage { font-size: .73rem; margin-top: 2px; }
.opp-list-value { font-size: .82rem; color: var(--lime); font-weight: 600; white-space: nowrap; }

.history-row {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border);
}
.history-row:last-child { border-bottom: none; }

/* ─────────────────────────────────────────────────────────────
   DASHBOARD
───────────────────────────────────────────────────────────── */
.dashboard-cols { display: grid; grid-template-columns: 1fr 380px; gap: 20px; margin-top: 20px; align-items: start; }
@media (max-width: 900px) { .dashboard-cols { grid-template-columns: 1fr; } }

/* ── Calendar ─────────────────────────────────────────────── */
.calendar-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}
.calendar-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
}
.calendar-dow-row {
    display: grid; grid-template-columns: repeat(7,1fr); gap: 2px;
    border-bottom: 1px solid var(--border); padding-bottom: 6px; margin-bottom: 4px;
}
.calendar-dow-row span {
    font-size: .65rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; color: var(--text-muted); text-align: center; padding: 4px 0;
}
.calendar-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; }
.cal-day {
    min-height: 52px; padding: 5px 4px;
    border-radius: 6px; cursor: pointer;
    transition: background var(--transition);
}
.cal-day:hover  { background: rgba(255,255,255,.05); }
.cal-day.outside { opacity: .25; pointer-events: none; }
.cal-day.today  { outline: 1px solid var(--lime); outline-offset: -1px; }
.cal-day.today .cal-day-num { color: var(--lime); font-weight: 700; }
.cal-day.selected { background: var(--lime-dim); }
.cal-day-num {
    font-size: .73rem; color: var(--text-secondary);
    line-height: 1; margin-bottom: 4px;
}
.cal-dots { display: flex; flex-wrap: wrap; gap: 2px; }
.cal-dot  { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.cal-dot.task        { background: var(--lime); }
.cal-dot.expiry      { background: #f97316; }
.cal-dot.milestone   { background: #60a5fa; }
.cal-dot.appointment { background: #a78bfa; }

/* Calendar filter dropdown */
.cal-filter-wrap { position: relative; }
.cal-filter-btn  { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.cal-filter-panel {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 120;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.4);
    padding: 8px 6px; min-width: 148px;
    display: none; flex-direction: column; gap: 2px;
}
.cal-filter-wrap.open .cal-filter-panel { display: flex; }
.cal-fopt {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 8px; border-radius: 6px; cursor: pointer;
    font-size: .8rem; color: var(--text-secondary);
    user-select: none; transition: background .1s;
}
.cal-fopt:hover { background: rgba(255,255,255,.05); }
.cal-fopt input[type=checkbox] { accent-color: var(--lime); cursor: pointer; margin: 0; width: 13px; height: 13px; }
.cal-fopt-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.cal-fopt-dot.task        { background: var(--lime); }
.cal-fopt-dot.expiry      { background: #f97316; }
.cal-fopt-dot.milestone   { background: #60a5fa; }
.cal-fopt-dot.appointment { background: #a78bfa; }

/* Day detail panel */
#day-detail {
    margin-top: 16px; padding: 14px;
    background: rgba(255,255,255,.03);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.day-detail-title { font-size: .84rem; font-weight: 600; color: var(--text-primary); }
.day-event-row {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.05);
    font-size: .82rem;
}
.day-event-row:last-child { border-bottom: none; }
.day-event-row .cal-dot { margin-top: 5px; flex-shrink: 0; }

/* ── Task panel (right column) ────────────────────────────── */
.task-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    position: sticky;
    top: calc(var(--header-h) + 20px);
    max-height: calc(100vh - var(--header-h) - 40px);
    max-height: calc(100dvh - var(--header-h) - 40px);
    overflow-y: auto;
}
.task-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px; padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.task-panel-title {
    font-family: 'Orbitron', sans-serif;
    font-size: .82rem; font-weight: 700;
    letter-spacing: .05em; color: var(--text-primary);
}
.task-count-badge {
    background: var(--lime); color: #000;
    font-size: .70rem; font-weight: 700;
    padding: 1px 8px; border-radius: 20px;
}

/* Task rows */
.task-section-label {
    font-size: .65rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; color: var(--text-muted); margin: 14px 0 6px;
}
.task-section-label:first-child { margin-top: 0; }
.task-row {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.05);
}
.task-row:last-child { border-bottom: none; }
.task-row-done { opacity: .45; }
.task-row-body  { flex: 1; min-width: 0; cursor: pointer; }
.task-row-title { font-size: .84rem; font-weight: 500; color: var(--text-primary); }
.task-row-desc  { font-size: .76rem; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-row-meta  { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .73rem; color: var(--text-muted); margin-top: 3px; }
.task-row-athlete { color: var(--lime); text-decoration: none; }
.task-row-athlete:hover { text-decoration: underline; }
.task-check {
    flex-shrink: 0; width: 20px; height: 20px; margin-top: 2px;
    border: 2px solid var(--border); border-radius: 50%;
    background: none; cursor: pointer; transition: all var(--transition);
}
.task-check:hover { border-color: var(--lime); background: var(--lime-dim); }
.task-check-done { border-color: var(--success); background: var(--success); }
.task-check-done::after { content: '\2713'; display: flex; align-items: center; justify-content: center; font-size: 11px; color: #000; line-height: 1; }
.task-edit-inline {
    padding: 8px 0 8px 28px; /* indent to align with task body */
}
.task-edit-inline .form-input { font-size: .82rem; padding: 6px 8px; }
.task-complete-btn {
    flex-shrink: 0; padding: 4px 10px;
    background: none; border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-size: .76rem;
    color: var(--text-muted); cursor: pointer;
    transition: all var(--transition);
}
.task-complete-btn:hover { border-color: var(--lime); color: var(--lime); background: var(--lime-dim); }
.task-overdue-chip {
    background: rgba(239,68,68,.15); color: #fca5a5;
    padding: 1px 7px; border-radius: 10px; font-size: .68rem; white-space: nowrap;
}
.task-due-chip {
    background: rgba(255,255,255,.06); color: var(--text-secondary);
    padding: 1px 7px; border-radius: 10px; font-size: .68rem; white-space: nowrap;
}

/* ─────────────────────────────────────────────────────────────
   KANBAN BOARD (Sales)
───────────────────────────────────────────────────────────── */
.kanban-wrap   { display:flex; gap:14px; overflow-x:auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; padding-bottom:16px; align-items:flex-start; }
.kanban-col    { flex:0 0 280px; background:var(--bg-card); border:1px solid var(--border); border-radius:10px; display:flex; flex-direction:column; }
@media (min-width: 1280px) { .kanban-col { flex-basis: 320px; } }
@media (min-width: 1600px) { .kanban-col { flex-basis: 360px; } }
.kanban-col-header { padding:12px 14px 10px; border-bottom:1px solid var(--border); }
.kanban-col-title  { font-size:.78rem; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--text-secondary); }
.kanban-col-meta   { font-size:.72rem; color:var(--text-muted); margin-top:2px; }
.kanban-cards  { padding:8px; display:flex; flex-direction:column; gap:6px; min-height:80px; }
.kanban-card   { background:var(--bg); border:1px solid var(--border); border-radius:8px; padding:10px 12px; cursor:grab; transition:border-color .15s, box-shadow .15s; position:relative; }
.kanban-card:hover { border-color:var(--lime); box-shadow:0 0 0 1px var(--lime); }
.kanban-card.dragging { opacity:.4; }
.kanban-col.drag-over .kanban-cards { background:var(--lime-dim); border-radius:6px; }
.kanban-card-top  { display:flex; align-items:flex-start; gap:8px; margin-bottom:7px; }
.kanban-avatar    { width:28px; height:28px; border-radius:50%; object-fit:cover; flex-shrink:0; }
.kanban-avatar-init { background:var(--lime-dim); border:1px solid rgba(156,236,19,.2); color:var(--lime); display:flex; align-items:center; justify-content:center; font-size:.72rem; font-weight:700; }
.kanban-card-identity { flex:1; min-width:0; }
.kanban-card-name    { font-size:.82rem; font-weight:600; color:var(--text-primary); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.kanban-card-opp     { font-size:.74rem; color:var(--text-muted); margin-top:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.kanban-card-footer  { display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.kanban-val-chip     { font-size:.70rem; background:var(--lime-dim); color:var(--lime); padding:1px 7px; border-radius:10px; font-weight:600; }
.kanban-src-chip     { font-size:.70rem; color:var(--text-muted); }
.kanban-age-chip          { font-size:.68rem; color:var(--text-muted); margin-left:auto; }
.kanban-age-chip.age-warn { color:#f59e0b; }
.kanban-age-chip.age-stale{ color:#ef4444; font-weight:600; }
.kanban-appt-dot     { width:6px; height:6px; border-radius:50%; background:#60a5fa; margin-left:auto; flex-shrink:0; }
.kanban-card.updated-24h { border-left:3px solid var(--lime); }
.kanban-card.stale-7d    { border-left:3px solid #f59e0b; }
.kanban-card.stale-14d   { border-left:3px solid #ef4444; }
.kanban-card.stale-14d .kanban-card-name { color:#ef4444; }

/* ── Won / Lost history section ─────────────────────────────────────────────── */
.wl-section        { margin-top:24px; }
.wl-section-header { display:flex; align-items:center; margin-bottom:12px; }
.wl-section-title  { font-size:.78rem; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--text-secondary); }
.wl-grid           { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.wl-col            { background:var(--bg-card); border:1px solid var(--border); border-radius:10px; padding:14px; }
.wl-col-label      { font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted); margin-bottom:10px; }
.wl-group-header   { display:flex; justify-content:space-between; font-size:.74rem; font-weight:600; padding:4px 0 6px; border-bottom:1px solid var(--border); margin-bottom:6px; }
.wl-won-header     { color:var(--success, #4ade80); }
.wl-lost-header    { color:var(--danger, #f87171); }
.wl-card           { display:flex; align-items:center; gap:8px; padding:6px 4px; cursor:pointer; border-radius:6px; transition:background .12s; }
.wl-card:hover     { background:var(--bg); }
.wl-avatar         { width:24px; height:24px; border-radius:50%; object-fit:cover; flex-shrink:0; }
.wl-avatar-init    { background:var(--lime-dim); border:1px solid rgba(156,236,19,.2); color:var(--lime); display:flex; align-items:center; justify-content:center; font-size:.68rem; font-weight:700; }
.wl-card-body      { flex:1; min-width:0; }
.wl-card-name      { font-size:.80rem; font-weight:500; color:var(--text-primary); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wl-card-val       { font-size:.72rem; color:var(--lime); margin-top:1px; }
.wl-card-date      { font-size:.68rem; color:var(--text-muted); flex-shrink:0; }
.wl-empty          { font-size:.78rem; color:var(--text-muted); padding:8px 4px; }
@media (max-width:600px) { .wl-grid { grid-template-columns:1fr; } }

/* btn-danger */
.btn-danger { background:rgba(239,68,68,.15); color:#fca5a5; border:1px solid rgba(239,68,68,.3); }
.btn-danger:hover { background:rgba(239,68,68,.25); }

/* Small inline delete/danger icon button */
.icon-btn-danger { flex-shrink:0; background:none; border:none; color:var(--text-muted); cursor:pointer; font-size:.78rem; padding:3px 5px; border-radius:4px; line-height:1; opacity:.5; transition:opacity .15s, color .15s; }
.icon-btn-danger:hover { opacity:1; color:#fca5a5; }

/* Calendars reference panel */
.cal-reference {
    margin-top:14px; font-size:.80rem;
    border:1px solid var(--border); border-radius:var(--radius);
    background:var(--bg-card);
}
.cal-reference summary {
    padding:10px 14px; cursor:pointer; color:var(--text-muted);
    list-style:none; user-select:none;
}
.cal-reference summary::-webkit-details-marker { display:none; }
.cal-reference-grid { padding:8px 14px 14px; display:flex; flex-direction:column; gap:4px; }
.cal-ref-row { display:flex; align-items:center; gap:10px; padding:4px 0; border-bottom:1px solid var(--border); }
.cal-ref-row:last-child { border-bottom:none; }
.cal-ref-id   { font-family:'Courier New',monospace; font-size:.72rem; color:var(--lime); flex-shrink:0; word-break:break-all; }
.cal-ref-name { font-size:.78rem; color:var(--text-secondary); flex:1; }

/* ── Stat card delta ─────────────────────────────────────── */
.stat-delta    { font-size:.70rem; margin-top:3px; }
.stat-delta.up   { color:var(--success); }
.stat-delta.down { color:var(--danger); }

/* ── Activity pulse strip ────────────────────────────────── */
.activity-pulse { font-size:.76rem; color:var(--text-muted); padding:6px 0 12px; display:flex; gap:16px; flex-wrap:wrap; }
.activity-pulse strong { color:var(--text-secondary); }

/* ── Pipeline pills ──────────────────────────────────────── */
.pipeline-pills { display:flex; gap:6px; margin-bottom:14px; flex-wrap:wrap; }
.pipeline-pill  { padding:5px 14px; border-radius:20px; font-size:.76rem; cursor:pointer; border:1px solid var(--border); color:var(--text-muted); user-select:none; transition:background .12s, color .12s, border-color .12s; }
.pipeline-pill.active { background:var(--lime); color:#000; border-color:var(--lime); font-weight:600; }

/* ── Drawer notes ────────────────────────────────────────── */
.note-row      { padding:10px 0; border-bottom:1px solid var(--border); }
.note-row:last-child { border-bottom:none; }
.note-body     { font-size:.83rem; color:var(--text-primary); white-space:pre-wrap; }
.note-meta     { font-size:.72rem; color:var(--text-muted); margin-top:4px; }
.note-add-area { width:100%; background:var(--bg-input); border:1px solid var(--border); border-radius:var(--radius-sm); color:var(--text-primary); padding:9px 10px; font-size:.83rem; resize:vertical; }
.note-add-area:focus { border-color:var(--lime); outline:none; }
.opp-note-form { padding-top:4px; }

/* ── Note cards (new style) ──────────────────────────────── */
.note-card { display:flex; gap:10px; padding:10px 0; border-bottom:1px solid var(--border); }
.note-card:last-child { border-bottom:none; }
.note-card-avatar { flex-shrink:0; width:30px; height:30px; border-radius:50%; background:var(--lime); color:#0d0d0d; font-size:.7rem; font-weight:700; display:flex; align-items:center; justify-content:center; }
.note-card-body { flex:1; min-width:0; }
.note-card-header { display:flex; align-items:center; gap:8px; margin-bottom:4px; }
.note-card-author { font-size:.78rem; font-weight:600; color:var(--text-primary); }
.note-card-time { font-size:.72rem; color:var(--text-muted); flex:1; }
.note-delete-btn { background:none; border:none; color:var(--text-muted); cursor:pointer; font-size:.8rem; padding:2px 4px; border-radius:3px; opacity:0; transition:opacity .15s; }
.note-card:hover .note-delete-btn { opacity:1; }
.note-delete-btn:hover { color:#ef4444; background:rgba(239,68,68,.1); }
.note-card-text { font-size:.83rem; color:var(--text-primary); line-height:1.5; word-break:break-word; }

/* ── Drawer appointments ─────────────────────────────────── */
.appt-row      { display:flex; align-items:flex-start; gap:10px; padding:9px 0; border-bottom:1px solid var(--border); }
.appt-row:last-child { border-bottom:none; }
.appt-time     { font-size:.73rem; color:var(--text-muted); flex-shrink:0; width:80px; }
.appt-title    { font-size:.88rem; font-weight:500; }
.appt-cal      { font-size:.72rem; color:var(--text-muted); }
.appt-status-chip { font-size:.68rem; padding:1px 7px; border-radius:10px; display:inline-block; margin-top:3px; }
.appt-status-confirmed { background:rgba(34,197,94,.15); color:#4ade80; }
.appt-status-cancelled { background:rgba(239,68,68,.15); color:#fca5a5; }
.appt-book-btn { display:inline-flex; align-items:center; gap:6px; padding:6px 14px; background:var(--lime-dim); color:var(--lime); border:1px solid var(--lime); border-radius:var(--radius-sm); font-size:.78rem; font-weight:600; text-decoration:none; margin-top:12px; }
.appt-book-btn:hover { background:var(--lime); color:#000; text-decoration:none; }

/* Loading dots animation */
.loading-dots { color:var(--text-muted); letter-spacing:.1em; }

/* ── Sales Order Modal ───────────────────────────────────── */
.so-section        { padding:14px 0; border-bottom:1px solid var(--border); }
.so-section:last-child { border-bottom:none; }
.so-section-label  { font-size:.72rem; font-weight:600; text-transform:uppercase; letter-spacing:.06em; color:var(--text-muted); margin-bottom:8px; }
.so-row-2          { display:grid; grid-template-columns:1fr 1fr; gap:14px; }

/* Radio button pills */
.so-radio-group    { display:flex; flex-wrap:wrap; gap:6px; }
.so-radio-btn      { display:inline-flex; align-items:center; gap:6px; padding:5px 12px; border:1px solid var(--border); border-radius:20px; cursor:pointer; font-size:.80rem; color:var(--text-secondary); user-select:none; transition:border-color .12s, background .12s, color .12s; }
.so-radio-btn:hover { border-color:var(--lime); color:var(--lime); }
.so-radio-btn input[type=radio] { display:none; }
.so-radio-btn:has(input:checked) { background:var(--lime-dim,rgba(156,236,19,.12)); border-color:var(--lime); color:var(--lime); font-weight:600; }

.so-country-pill { padding:4px 10px; border:1px solid var(--border); border-radius:16px; background:transparent; color:var(--text-secondary); font-size:.75rem; font-weight:500; cursor:pointer; transition:border-color .12s, background .12s, color .12s; }
.so-country-pill:hover { border-color:var(--lime); color:var(--lime); }
@media (max-width:600px) { .so-country-pills { display:none !important; } }

/* Contact search dropdown — fixed so it escapes the modal's overflow-y:auto */
.so-search-dropdown { position:fixed; background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); z-index:600; min-height:120px; max-height:260px; overflow-y:auto; box-shadow:0 8px 32px rgba(0,0,0,.55); }
.so-search-card     { display:flex; align-items:center; gap:10px; padding:9px 12px; cursor:pointer; transition:background .1s; border-bottom:1px solid var(--border); }
.so-search-card:last-child { border-bottom:none; }
.so-search-card:hover, .so-search-card--active { background:var(--bg-input); }
.so-search-avatar   { width:32px; height:32px; border-radius:50%; background:var(--lime-dim,rgba(156,236,19,.15)); color:var(--lime); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:.85rem; flex-shrink:0; }
.so-search-name     { font-size:.83rem; font-weight:500; color:var(--text-primary); }
.so-search-info     { flex:1; min-width:0; }
.so-search-sub      { font-size:.73rem; color:var(--text-muted); margin-top:2px; }
.so-search-msg      { padding:10px 12px; font-size:.80rem; color:var(--text-muted); }

/* Locked contact card */
.so-contact-card    { display:flex; align-items:center; gap:10px; padding:10px 12px; background:var(--bg-input); border:1px solid var(--border); border-radius:var(--radius-sm); margin-bottom:4px; }
.so-contact-avatar  { width:36px; height:36px; border-radius:50%; background:var(--lime-dim,rgba(156,236,19,.15)); color:var(--lime); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:.90rem; flex-shrink:0; }
.so-contact-info    { flex:1; min-width:0; }
.so-contact-name    { font-size:.85rem; font-weight:600; color:var(--text-primary); }
.so-contact-meta    { font-size:.74rem; color:var(--text-muted); margin-top:2px; }
.so-contact-cid     { font-size:.62rem; color:var(--text-muted); margin-top:1px; font-family:monospace; opacity:.6; }
.so-contact-cid:empty { display:none; }
.so-contact-clear   { background:none; border:none; color:var(--text-muted); cursor:pointer; font-size:14px; padding:4px; flex-shrink:0; }
.so-contact-clear:hover { color:var(--danger); }

/* Breakdown table */
.so-breakdown-table { width:100%; border-collapse:collapse; font-size:.82rem; margin-top:2px; }
.so-breakdown-table th { text-align:right; padding:4px 8px; font-size:.70rem; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted); font-weight:600; border-bottom:1px solid var(--border); }
.so-breakdown-table th:first-child { text-align:left; }
.so-breakdown-table td { padding:6px 8px; text-align:right; color:var(--text-secondary); border-bottom:1px solid var(--border); }
.so-breakdown-table td:first-child { text-align:left; color:var(--text-muted); font-size:.78rem; }
.so-breakdown-table tr:last-child td { border-bottom:none; }
.so-val-hi { color:var(--lime) !important; font-weight:600; }
.so-row-label { white-space:nowrap; }

/* Bare inputs/selects inside SO sections (not wrapped in .form-group) */
#so-country,
#so-fixed-price,
#so-tax-rate,
#so-custom-nbr,
#so-custom-gross,
#so-notes {
    width:100%; padding:8px 12px;
    border:1px solid var(--border); border-radius:var(--radius-sm);
    font-size:.86rem; color:var(--text-primary);
    background:var(--bg-input); outline:none;
    font-family:inherit;
    transition:border-color var(--transition);
    margin-top:4px;
}
#so-country:focus,
#so-fixed-price:focus,
#so-tax-rate:focus,
#so-custom-nbr:focus,
#so-custom-gross:focus,
#so-notes:focus {
    border-color:var(--lime);
    box-shadow:0 0 0 3px rgba(156,236,19,.10);
}
#so-notes {
    resize:vertical;
    min-height:72px;
    line-height:1.5;
}

/* Toggles & confirm */
.so-toggle-label  { display:flex; align-items:center; gap:8px; font-size:.80rem; color:var(--text-secondary); cursor:pointer; user-select:none; }
.so-toggle-label input[type=checkbox] { accent-color:var(--lime); width:14px; height:14px; cursor:pointer; }
.so-confirm-label { display:flex; align-items:flex-start; gap:8px; font-size:.80rem; color:var(--text-secondary); cursor:pointer; line-height:1.5; }
.so-confirm-label input[type=checkbox] { accent-color:var(--lime); width:14px; height:14px; margin-top:2px; cursor:pointer; flex-shrink:0; }
.so-radio-disabled { opacity:.45; cursor:not-allowed; }
.so-radio-disabled input { cursor:not-allowed; }

/* Opportunity section */
.so-opp-loading { font-size:.78rem; color:var(--text-muted); padding:8px 0; }
.so-opp-banner { padding:10px 14px; border-radius:var(--radius-sm,6px); font-size:.82rem; line-height:1.5; margin-bottom:4px; display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.so-opp-info   { background:rgba(251,191,36,.10); border:1px solid rgba(251,191,36,.25); color:#fcd34d; }
.so-opp-ok     { background:rgba(34,197,94,.10);  border:1px solid rgba(34,197,94,.25);  color:#4ade80; }
.so-opp-warn   { background:rgba(239,68,68,.10);  border:1px solid rgba(239,68,68,.25);  color:#fca5a5; }
.so-opp-meta   { opacity:.75; font-size:.78rem; }
.so-opp-tag    { margin-left:auto; font-size:.70rem; font-weight:700; letter-spacing:.05em; text-transform:uppercase; opacity:.8; }
.so-opp-table  { width:100%; border-collapse:collapse; font-size:.78rem; margin-top:8px; }
.so-opp-table th { padding:5px 8px; text-align:left; font-size:.68rem; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted); font-weight:600; border-bottom:1px solid var(--border); }
.so-opp-table td { padding:7px 8px; border-bottom:1px solid var(--border); color:var(--text-secondary); vertical-align:middle; }
.so-opp-table tr:last-child td { border-bottom:none; }
.so-opp-del-btn { background:none; border:1px solid rgba(239,68,68,.35); color:#fca5a5; border-radius:4px; padding:2px 8px; font-size:.72rem; cursor:pointer; }
.so-opp-del-btn:hover { background:rgba(239,68,68,.15); }

/* ── Mobile First Fixes ────────────────────────────────────────────────────── */

/* C1: Input font-size ≥ 16px — prevents iOS auto-zoom on focus */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="tel"],
select,
textarea {
    font-size: 16px;
}
@media (min-width: 769px) {
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="password"],
    input[type="date"],
    input[type="tel"],
    select,
    textarea {
        font-size: 15px;
    }
}

/* C2: Touch targets ≥ 44px */
.nav-item {
    padding: 12px 12px;
    min-height: 44px;
}
.sidebar-logout {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}
@media (max-width: 768px) {
    .sidebar-close {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}
.btn {
    min-height: 44px;
    padding: 10px 16px;
}
.btn-sm {
    min-height: 38px;
}
.modal-close {
    min-width: 44px;
    min-height: 44px;
}
.pipeline-pill,
.filter-chip {
    min-height: 38px;
    padding: 8px 14px;
}
.drawer-action-btn {
    min-height: 44px;
}

/* C3: Kanban board — mobile horizontal scroll-snap */
@media (max-width: 768px) {
    .kanban-wrap {
        flex-direction: row;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
        gap: 10px;
        padding-bottom: 20px;
        padding-left: 14px;
        padding-right: 14px;
    }
    .kanban-col {
        flex: 0 0 calc(85vw);
        scroll-snap-align: start;
    }
    .kanban-card {
        padding: 12px 14px;  /* bigger tap target */
    }
    .kanban-card-name { font-size: .88rem; }
    .kanban-card-footer { gap: 8px; }
    .kanban-val-chip,
    .kanban-src-chip,
    .kanban-age-chip { font-size: .75rem; }
    .kanban-col-header { padding: 14px 14px 10px; }
    /* Scroll hint: right edge fade on kanban */
    .kanban-wrap::after {
        content: '';
        position: sticky;
        right: 0;
        top: 0;
        min-width: 28px;
        height: 100%;
        pointer-events: none;
        background: linear-gradient(to left, var(--bg-page, #0d0d0d), transparent);
        flex-shrink: 0;
    }
}

/* ─────────────────────────────────────────────────────────────
   UPCOMING CALLS PANEL
───────────────────────────────────────────────────────────── */
.upcoming-calls {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); margin-bottom: 16px; overflow: hidden;
}
.uc-hd {
    display: flex; align-items: center; gap: 8px;
    padding: 11px 16px; border-bottom: 1px solid var(--border);
}
.uc-title {
    font-size: .72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; color: var(--text-muted);
}
.uc-period { font-size: .72rem; color: var(--text-muted); margin-left: auto; }
.uc-toggle {
    background: none; border: none; color: var(--text-muted);
    font-size: .9rem; padding: 0 2px; line-height: 1;
    transition: transform var(--transition), color var(--transition);
    cursor: pointer; margin-left: 6px;
}
.uc-toggle:hover { color: var(--text-primary); }

/* Cards */
.uc-card {
    display: grid; grid-template-columns: 68px 1fr auto;
    gap: 0 16px; padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
.uc-card:last-child { border-bottom: none; }
.uc-card:hover { background: var(--bg-card-hover); }

/* Time column */
.uc-time {
    display: flex; flex-direction: column; align-items: center;
    padding-top: 2px; gap: 1px;
}
.uc-day {
    font-size: .66rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: .06em; color: var(--text-muted);
}
.uc-time--today .uc-day { color: var(--lime); }
.uc-hour {
    font-size: .92rem; font-weight: 600; color: var(--text-primary);
    line-height: 1.2;
}
.uc-date { font-size: .68rem; color: var(--text-muted); margin-top: 1px; }

/* Body */
.uc-body { min-width: 0; }
.uc-contact { display: flex; align-items: center; gap: 9px; margin-bottom: 5px; }
.uc-avatar {
    width: 27px; height: 27px; border-radius: 50%; flex-shrink: 0;
    background: var(--lime-dim); color: var(--lime);
    display: flex; align-items: center; justify-content: center;
    font-size: .72rem; font-weight: 700;
}
.uc-info { min-width: 0; }
.uc-name {
    font-size: .88rem; font-weight: 600; color: var(--text-primary);
    display: flex; align-items: center; gap: 6px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.uc-meta { font-size: .74rem; color: var(--text-muted); margin-top: 1px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uc-status-badge { font-size: .62rem !important; padding: 1px 6px !important; }

.uc-opp-row { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; flex-wrap: wrap; }
.uc-badge   { font-size: .66rem !important; padding: 1px 6px !important; }
.uc-opp-prog { font-size: .78rem; color: var(--lime); font-weight: 500; }
.uc-opp-val  { font-size: .78rem; color: var(--text-secondary); }

.uc-athlete { font-size: .76rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.uc-athlete strong { color: var(--text-secondary); font-weight: 500; }
.uc-prog-status { opacity: .8; }
.uc-mstone-sep  { color: var(--text-muted); margin: 0 2px; }
.uc-dot { color: var(--border-strong); font-size: .7rem; }

/* Actions */
.uc-actions { display: flex; flex-direction: column; gap: 4px; justify-content: center; flex-shrink: 0; }
.uc-btn { font-size: .72rem !important; padding: 4px 9px !important; min-height: 0 !important; white-space: nowrap; }

/* Skeleton */
.uc-skeleton {
    display: grid; grid-template-columns: 68px 1fr; gap: 16px;
    padding: 13px 16px; border-bottom: 1px solid var(--border); align-items: start;
}
.uc-skeleton:last-child { border-bottom: none; }

/* Details row: location + assignee */
.uc-details { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; font-size: .76rem; }
.uc-location-link { color: var(--lime); text-decoration: none; }
.uc-location-link:hover { text-decoration: underline; }
.uc-location { color: var(--text-muted); }
.uc-assignee { color: var(--text-muted); }
.uc-assignee::before { content: '👤 '; }
.uc-calendar { color: var(--text-muted); }
.uc-calendar::before { content: '📅 '; }
.uc-btn-showed { color: var(--success, #4ade80) !important; }
.uc-btn-noshow { color: var(--danger, #f87171) !important; }
.uc-btn-newopp { color: var(--lime) !important; }

/* Stage picker popover */
.uc-stage-picker { z-index:9999; background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); padding:8px; min-width:200px; max-width:260px; box-shadow:0 8px 24px rgba(0,0,0,.5); }
.uc-sp-label { font-size:.72rem; color:var(--text-muted); padding:2px 6px 8px; border-bottom:1px solid var(--border); margin-bottom:6px; }
.uc-sp-item { display:block; width:100%; text-align:left; padding:7px 10px; font-size:.82rem; color:var(--text-primary); background:none; border:none; border-radius:var(--radius-sm); cursor:pointer; transition:background var(--transition); }
.uc-sp-item:hover { background:var(--hover); }

/* Empty state */
.uc-empty { padding: 20px 16px; font-size: .83rem; color: var(--text-muted); text-align: center; }

/* ─────────────────────────────────────────────────────────────
   PROGRAMS PAGE
───────────────────────────────────────────────────────────── */
.prog-currency-label {
    font-size: .75rem; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: var(--lime);
    padding: 4px 10px; border-radius: var(--radius-sm);
    background: var(--lime-dim); display: inline-block;
    margin: 1.5rem 0 1rem;
}
.prog-currency-label:first-child { margin-top: 0; }

/* Pricing table */
.prog-table { width: 100%; border-collapse: collapse; }
.prog-table th {
    text-align: left; padding: 0 12px 10px 0;
    font-size: .72rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .06em; color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
.prog-table th:not(:first-child) { text-align: center; }
.prog-table td {
    padding: 10px 12px 10px 0;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.prog-table tr:last-child td { border-bottom: none; }
.prog-table td:first-child {
    font-size: .9rem; font-weight: 500; color: var(--text-primary);
    min-width: 150px;
}
.prog-table td:not(:first-child) { text-align: center; }
.prog-m-total { color: var(--lime); font-weight: 600; font-size: .88rem; white-space: nowrap; }
.prog-table input[type="number"] {
    width: 90px; padding: 6px 10px; text-align: center;
    background: var(--bg-input); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    transition: border-color var(--transition);
    -moz-appearance: textfield;
}
.prog-table input[type="number"]:focus {
    border-color: var(--lime);
    box-shadow: 0 0 0 3px rgba(156,236,19,.1);
    outline: none;
}
.prog-table input[type="number"]::-webkit-inner-spin-button,
.prog-table input[type="number"]::-webkit-outer-spin-button { opacity: .4; }

/* Language grid */
.prog-lang-grid {
    display: grid;
    align-items: center;
    gap: .6rem 2rem;
    margin-bottom: 1.5rem;
}
.prog-lang-header {
    font-size: .72rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .06em; color: var(--text-muted); text-align: center;
}
.prog-lang-name {
    font-size: .9rem; font-weight: 500; color: var(--text-primary);
}

/* Tax rates editor */
.prog-tax-header {
    font-size: .72rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .06em; color: var(--text-muted);
}
.prog-tax-grid {
    display: grid;
    gap: .5rem;
    align-items: center;
}
.prog-tax-row { display: contents; }
.prog-tax-row input[type="number"],
.prog-tax-row input[type="text"] {
    padding: 7px 10px;
    background: var(--bg-input); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    width: 100%;
    transition: border-color var(--transition);
}
.prog-tax-row input:focus {
    border-color: var(--lime);
    box-shadow: 0 0 0 3px rgba(156,236,19,.1);
    outline: none;
}
.prog-tax-default {
    display: flex; align-items: center; justify-content: center;
}
.prog-tax-default input[type="radio"] {
    accent-color: var(--lime); width: 16px; height: 16px; cursor: pointer;
}

/* C4: Modal — bottom sheet on mobile */
@media (max-width: 640px) {
    .modal-backdrop {
        align-items: flex-end;
    }
    .modal,
    .modal-lg {
        width: 100vw;
        max-width: 100vw;
        max-height: 90vh;
        max-height: 90dvh;
        overflow-y: auto;
        border-radius: 16px 16px 0 0;
        margin: 0;
        padding-bottom: env(safe-area-inset-bottom);
    }
    .modal-header {
        position: sticky;
        top: 0;
        z-index: 1;
        background: var(--bg-card);
    }
}

/* C5: Table responsive — horizontal scroll on mobile */
.table-wrap {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
}
@media (max-width: 768px) {
    .data-table {
        min-width: 540px;
    }
}

/* C8: Task panel — no sticky on mobile */
@media (max-width: 900px) {
    .task-panel {
        position: static;
        max-height: none;
    }
}

/* ── App Banners (push prompt, install prompt) ─────────────── */
.app-banner {
    position: fixed; left: 12px; right: 12px; z-index: 320;
    bottom: calc(72px + env(safe-area-inset-bottom));
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: 0 8px 32px rgba(0,0,0,.5);
    padding: 12px 16px; display: flex; align-items: center; gap: 10px;
    animation: bannerSlideUp .3s ease-out;
}
@keyframes bannerSlideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.app-banner-icon { font-size: 1.2rem; flex-shrink: 0; }
.app-banner-text { flex: 1; font-size: .82rem; color: var(--text-primary); line-height: 1.4; }
.app-banner-text small { display: block; font-size: .72rem; color: var(--text-muted); margin-top: 2px; }
.app-banner .btn { flex-shrink: 0; }
.app-banner-close {
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    font-size: 16px; padding: 4px; flex-shrink: 0; line-height: 1;
}
.app-banner-close:hover { color: var(--text-primary); }
@media (min-width: 769px) {
    .app-banner { left: auto; right: 24px; bottom: 24px; max-width: 400px; }
}

/* ─────────────────────────────────────────────────────────────
   BOTTOM NAV BAR (mobile)
───────────────────────────────────────────────────────────── */
.bottom-nav {
    display: flex; /* hidden on desktop via min-width query below */
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: calc(60px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    /* Glass dock: translucent + blur over page content */
    background: rgba(13, 13, 13, .72);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid rgba(255, 255, 255, .06);
    flex-direction: row;
    align-items: stretch;
    z-index: 300;
}
/* Fallback: solid background when backdrop-filter isn't supported */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .bottom-nav { background: var(--sidebar-bg); }
}
@media (min-width: 769px) {
    .bottom-nav { display: none; }
}
/* Active-tab indicator (positioned/sized by JS in main.js) */
.bn-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--lime);
    border-radius: 0 0 3px 3px;
    box-shadow: 0 0 12px rgba(156, 236, 19, .45);
    transform: translateX(0);
    transition: transform .22s cubic-bezier(.4, 0, .2, 1),
                width    .22s cubic-bezier(.4, 0, .2, 1);
    pointer-events: none;
    will-change: transform, width;
}
.bn-item {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 4px;
    font-size: .72rem; font-weight: 500; text-transform: uppercase;
    letter-spacing: .01em;
    color: var(--text-secondary);
    background: none; border: none;
    min-height: 56px;
    padding: 6px 2px;
    text-decoration: none;
    transition: color var(--transition);
    -webkit-tap-highlight-color: transparent;
    /* Allow children to use position:relative against this if needed */
    position: relative;
}
.bn-item.active { color: var(--lime); }
.bn-item:active { color: var(--lime); }
.bn-item svg { flex-shrink: 0; }
/* 4th nav item: hidden on small phones, visible on ≥390px (iPhone 12+) */
.bn-item-wide { display: none; }
@media (min-width: 390px) {
    .bn-item-wide { display: flex; }
}

/* ─────────────────────────────────────────────────────────────
   MORE SLIDE-UP SHEET
───────────────────────────────────────────────────────────── */
.more-backdrop {
    display: none;
    position: fixed; inset: 0; z-index: 400;
    background: rgba(0,0,0,.6);
}
.more-backdrop.open { display: block; }

.more-sheet {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 401;
    background: var(--bg-card);
    border-top: 1px solid var(--border-strong);
    border-radius: 16px 16px 0 0;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: transform .28s cubic-bezier(.32,.72,0,1);
}
.more-sheet.open { transform: translateY(0); }

.more-sheet-handle {
    width: 36px; height: 4px;
    background: var(--border-strong); border-radius: 2px;
    margin: 0 auto 12px;
}

.more-sheet-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.ms-item {
    display: flex; align-items: center; gap: 12px;
    padding: 18px 20px;
    color: var(--text-primary); font-size: .95rem; font-weight: 500;
    text-decoration: none;
    border-top: 1px solid var(--border);
    -webkit-tap-highlight-color: transparent;
    transition: background var(--transition);
}
.ms-item:active { background: var(--bg-card-hover); }
.ms-item--active { color: var(--lime); }
.ms-item--danger { color: var(--danger); }
.ms-item svg { flex-shrink: 0; opacity: .75; }

/* ─────────────────────────────────────────────────────────────
   ATTENTION / ACTION-REQUIRED SECTION (Dashboard)
───────────────────────────────────────────────────────────── */
.attention-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.attention-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid transparent;
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.attention-card--danger  { border-left-color: var(--danger); }
.attention-card--warning { border-left-color: var(--warning); }

.attention-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.attention-card-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
}
.attention-card--danger  .attention-card-title { color: var(--danger); }
.attention-card--warning .attention-card-title { color: var(--warning); }
.attention-card-title svg { flex-shrink: 0; opacity: .85; }

.attention-count {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.attention-card-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.attention-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: .82rem;
    min-height: 22px;
}
.attention-item-name {
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}
.attention-item-meta {
    font-size: .76rem;
    color: var(--text-muted);
    flex-shrink: 0;
    white-space: nowrap;
}
.attention-item-badge {
    font-size: .72rem;
    font-weight: 700;
    flex-shrink: 0;
    white-space: nowrap;
    padding: 1px 7px;
    border-radius: 10px;
}
.attention-item-badge--danger  { background: var(--danger-bg);  color: var(--danger); }
.attention-item-badge--warning { background: var(--warning-bg); color: var(--warning); }

.attention-more {
    font-size: .74rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.attention-card-footer-link {
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: color var(--transition);
}
.attention-card--danger  .attention-card-footer-link:hover { color: var(--danger);  text-decoration: none; }
.attention-card--warning .attention-card-footer-link:hover { color: var(--warning); text-decoration: none; }

/* ─────────────────────────────────────────────────────────────
   ATTENTION STRIP (compact, reusable)
───────────────────────────────────────────────────────────── */
.att-strip {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
}
.att-strip-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.att-strip-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 5px 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all var(--transition);
}
.att-strip-chip:hover { border-color: var(--text-muted); }
.att-strip-chip--danger  { color: var(--danger);  border-color: rgba(var(--danger-rgb, 220,53,69), .35); }
.att-strip-chip--warning { color: var(--warning); border-color: rgba(var(--warning-rgb, 255,193,7), .35); }
.att-strip-chip--active  { background: #252525; }
.att-strip-chip--danger.att-strip-chip--active  { background: var(--danger-bg); }
.att-strip-chip--warning.att-strip-chip--active { background: var(--warning-bg); }

.att-strip-chip-count {
    font-family: 'Orbitron', sans-serif;
    font-size: .82rem;
    font-weight: 700;
}
.att-strip-chip-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.att-strip-detail {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.att-strip-detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: .82rem;
    padding: 4px 2px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.att-strip-detail-row:hover { background: #1f1f1f; }

/* ─────────────────────────────────────────────────────────────
   ATHLETES — ACTION-FIRST SECTIONS
───────────────────────────────────────────────────────────── */
.ath-attention-section { margin-bottom: 16px; }
.ath-attention-section:empty { display: none; }

.ath-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.ath-section-title {
    font-size: .76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
}
.ath-section-count {
    background: var(--lime-dim);
    color: var(--lime);
    font-size: .68rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 8px;
}

/* Today's Tasks */
.ath-today-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 16px;
}

.ath-today-list { display: flex; flex-direction: column; gap: 2px; }

.ath-today-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 4px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.ath-today-item:hover { background: #1f1f1f; }

.ath-today-check {
    background: none;
    border: 2px solid var(--border);
    border-radius: 4px;
    width: 22px;
    height: 22px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    flex-shrink: 0;
    transition: border-color var(--transition), background var(--transition);
}
.ath-today-check:hover { border-color: var(--lime); background: var(--lime-dim); }

.ath-today-body { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ath-today-title { font-size: .85rem; color: var(--text-primary); }
.ath-today-meta { font-size: .76rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }

/* Upcoming Summary */
.ath-upcoming-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 20px;
}
.ath-upcoming-summary { display: flex; flex-direction: column; gap: 4px; }
.ath-upcoming-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .84rem;
    padding: 4px 0;
}
.ath-upcoming-label {
    font-weight: 500;
    color: var(--text-secondary);
}

/* Upcoming timeline */
.ath-timeline { display: flex; flex-direction: column; gap: 2px; }
.tl-day-label {
    font-size: .7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; color: var(--text-muted);
    padding: 6px 0 2px;
}
.tl-day-label:first-child { padding-top: 0; }
.tl-item {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 4px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.tl-item:hover { background: #1f1f1f; }
.tl-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.tl-dot--task  { background: var(--lime); }
.tl-dot--appt  { background: var(--info, #3b82f6); }
.tl-dot--expiry { background: var(--warning); }
.tl-time {
    font-family: 'Orbitron', sans-serif;
    font-size: .7rem; font-weight: 600;
    color: var(--lime); flex-shrink: 0; width: 38px;
}
.tl-body { flex: 1; min-width: 0; }
.tl-title { font-size: .82rem; color: var(--text-primary); }
.tl-sub { font-size: .7rem; color: var(--text-muted); margin-left: 6px; }

/* ─────────────────────────────────────────────────────────────
   SALES — ACTION-FIRST SECTIONS
───────────────────────────────────────────────────────────── */
.sales-action-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 12px;
}

.sales-call-row, .sales-stale-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 4px;
    border-radius: var(--radius-sm);
    font-size: .85rem;
}
.sales-call-row:hover, .sales-stale-row:hover { background: rgba(255,255,255,.03); }
.sales-call-time { font-weight: 600; color: var(--lime); min-width: 42px; font-size: .82rem; }
.sales-call-name { flex: 1; color: var(--text-primary); font-weight: 500; }
.sales-call-cal { font-size: .76rem; color: var(--text-muted); }

.sales-stale-name { flex: 1; color: var(--text-primary); font-weight: 500; }
.sales-stale-val { font-size: .78rem; color: var(--text-secondary); }
.sales-stale-stage { font-size: .74rem; color: var(--text-muted); }
.sales-stale-age { flex-shrink: 0; }

.sales-pipeline-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.sales-pipeline-summary {
    font-size: .78rem;
    color: var(--text-muted);
    margin-left: auto;
}

.sales-closed-summary {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 16px;
    margin-top: 12px;
}

/* ─────────────────────────────────────────────────────────────
   SKELETON SHIMMER (async loading states)
───────────────────────────────────────────────────────────── */
@keyframes skel-shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position:  600px 0; }
}
.skel {
    display: block;
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--border-strong) 50%, var(--bg-card) 75%);
    background-size: 1200px 100%;
    animation: skel-shimmer 1.4s infinite linear;
    border-radius: var(--radius-sm);
}
.skel-stat-val {
    height: 2rem;
    width: 50px;
    margin-bottom: 6px;
}
.skel-stat-lbl {
    height: .65rem;
    width: 80px;
}
.skel-row {
    height: .85rem;
    width: 100%;
    margin-bottom: 8px;
    border-radius: 4px;
}
.skel-row--short { width: 55%; }
.skel-row--med   { width: 75%; }
.skel-cell {
    height: .75rem;
    border-radius: 3px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.data-ready { animation: fadeIn .22s ease; }

/* ── Appointment booking ──────────────────────────────────── */

/* Mode tabs */
.bk-mode-tabs {
    display: flex; gap: 0; margin-bottom: 14px;
    border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden;
}
.bk-mode-tab {
    flex: 1; padding: 8px 12px; font-size: .82rem; font-weight: 500;
    background: none; border: none; color: var(--text-secondary);
    cursor: pointer; transition: all .15s; text-align: center;
}
.bk-mode-tab + .bk-mode-tab { border-left: 1px solid var(--border); }
.bk-mode-tab.active { background: var(--lime-dim); color: var(--lime); }
.bk-mode-tab:hover:not(.active) { background: var(--hover); }

/* Calendar grid */
.bk-cal-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px; padding: 0 2px;
}
.bk-cal-header span { font-size: .88rem; font-weight: 600; color: var(--text); }
.bk-cal-nav {
    background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text-secondary); width: 32px; height: 32px; font-size: 1.1rem;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.bk-cal-nav:hover { border-color: var(--lime); color: var(--lime); }

.bk-cal-grid {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
}
.bk-cal-dow {
    text-align: center; font-size: .7rem; font-weight: 600;
    color: var(--text-muted); padding: 4px 0; text-transform: uppercase;
    letter-spacing: .5px;
}
.bk-cal-cell {
    text-align: center; padding: 8px 0; font-size: .82rem;
    border-radius: var(--radius-sm); cursor: pointer; transition: all .12s;
    min-height: 36px; display: flex; align-items: center; justify-content: center;
}
.bk-cal-empty { cursor: default; }
.bk-cal-past { color: var(--text-muted); opacity: .35; cursor: not-allowed; }
.bk-cal-unavailable { color: var(--text-muted); opacity: .5; }
.bk-cal-unavailable:hover { background: var(--hover); }
.bk-cal-available {
    color: var(--lime); font-weight: 600;
    background: var(--lime-dim); border: 1px solid transparent;
}
.bk-cal-available:hover { border-color: var(--lime); }
.bk-cal-selected {
    background: var(--lime) !important; color: #000 !important;
    font-weight: 700; border-color: var(--lime) !important;
}
.bk-cal-today { box-shadow: inset 0 0 0 1px var(--border-strong); }

/* Slot chips */
.slot-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.slot-chip {
    padding: 8px 14px; font-size: .82rem; font-weight: 500;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg-input); color: var(--text-primary);
    cursor: pointer; transition: all .15s;
    min-height: 36px;
}
.slot-chip:hover { border-color: var(--lime); color: var(--lime); }
.slot-chip.selected {
    background: var(--lime-dim); border-color: var(--lime); color: var(--lime); font-weight: 600;
}

/* ── User picker (booking modal) ──────────────────────────── */
.bk-user-picker {
    display: flex; flex-direction: column; gap: 10px;
}
.bk-user-group-label {
    font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
    color: var(--text-muted); margin-bottom: 2px;
}
.bk-user-avatars {
    display: flex; flex-wrap: wrap; gap: 6px;
}
.bk-user-chip {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 6px 4px 5px; border-radius: 10px;
    border: 2px solid transparent; background: none;
    cursor: pointer; transition: all .15s ease; min-width: 56px; max-width: 72px;
}
.bk-user-chip:hover { background: var(--hover); }
.bk-user-chip.selected {
    border-color: var(--lime); background: var(--lime-dim);
}
.bk-user-chip.bk-user-override { opacity: .55; }
.bk-user-chip.bk-user-override:hover,
.bk-user-chip.bk-user-override.selected { opacity: 1; }

.bk-user-avatar {
    width: 40px; height: 40px; border-radius: 50%; overflow: hidden;
    flex-shrink: 0; position: relative;
}
.bk-user-photo {
    width: 100%; height: 100%; object-fit: cover; display: block;
    border-radius: 50%;
}
.bk-user-initials {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    background: var(--bg-input); color: var(--text-secondary); font-weight: 700;
    font-size: .82rem; border-radius: 50%;
}
.bk-user-label {
    font-size: .68rem; color: var(--text-secondary); text-align: center;
    line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 64px;
}
.bk-user-chip.selected .bk-user-label { color: var(--lime); font-weight: 600; }
.bk-user-chip.selected .bk-user-avatar {
    box-shadow: 0 0 0 2px var(--lime);
}
.bk-user-selected-name {
    font-size: .78rem; color: var(--lime); font-weight: 600;
    min-height: 18px; margin-top: 4px; margin-bottom: 4px;
}

.search-dropdown {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); max-height: 200px; overflow-y: auto;
    z-index: 10; box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.search-dropdown-item {
    padding: 10px 12px; cursor: pointer; font-size: .84rem;
    border-bottom: 1px solid var(--border);
}
.search-dropdown-item:hover { background: var(--hover); }
.search-dropdown-item:last-child { border-bottom: none; }

/* Make form-group relative for dropdown positioning */
#bk-contact-search { position: relative; }

/* ── Appointments page ───────────────────────────────────── */
.appt-day-group { margin-bottom: 20px; }
.appt-day-label {
    font-size: .78rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .5px; color: var(--text-muted); margin-bottom: 8px;
    padding-left: 2px;
}
.appt-card { padding: 14px 16px; margin-bottom: 8px; }
.appt-card-inner { display: flex; align-items: center; gap: 14px; }
.appt-time {
    font-size: .82rem; font-weight: 600; color: var(--lime);
    min-width: 100px; flex-shrink: 0;
}
.appt-details { flex: 1; min-width: 0; }
.appt-title { font-weight: 500; font-size: .88rem; }
.appt-contact { font-size: .78rem; color: var(--text-secondary); }
.appt-contact-link { color: var(--lime); text-decoration: none; }
.appt-contact-link:hover { text-decoration: underline; }
.appt-cal { font-size: .72rem; color: var(--text-muted); }
.appt-meta { flex-shrink: 0; }
.appt-actions {
    display: flex; gap: 6px; margin-top: 8px; padding-top: 8px;
    border-top: 1px solid var(--border);
}

@media (max-width: 480px) {
    .appt-card-inner { flex-wrap: wrap; }
    .appt-time { min-width: auto; }
}

/* ── Enhanced form controls ───────────────────────────────── */

/* Searchable select */
.fp-select { position: relative; }
.form-group .fp-select { width: 100%; }
.fp-select-display {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px; font-size: .86rem; font-family: inherit;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text-primary);
    cursor: pointer; text-align: left; min-width: 200px;
}
.form-group .fp-select-display { width: 100%; }
.fp-select-display:hover { border-color: var(--border-strong); }
.fp-select.open .fp-select-display { border-color: var(--lime); }
.fp-select-arrow { font-size: .7rem; color: var(--text-muted); margin-left: 8px; flex-shrink: 0; }
.fp-select-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-select-dropdown {
    position: fixed;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); z-index: 100000;
    box-shadow: 0 8px 24px rgba(0,0,0,.4); max-height: 260px; min-height: 80px;
    display: flex; flex-direction: column;
}
.fp-select-search-wrap { padding: 8px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.fp-select-search {
    width: 100%; padding: 7px 10px; font-size: .84rem;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text-primary);
    outline: none;
}
.fp-select-search:focus { border-color: var(--lime); }
.fp-select-list { overflow-y: auto; flex: 1; }
.fp-select-option {
    padding: 9px 12px; font-size: .84rem; cursor: pointer;
    color: var(--text-primary); transition: background .1s;
}
.fp-select-option:hover { background: var(--hover); }
.fp-select-option.selected { color: var(--lime); font-weight: 500; }
.fp-select-empty { padding: 12px; color: var(--text-muted); font-size: .82rem; text-align: center; }
.fp-select-group {
    padding: 8px 12px 4px; font-size: .68rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted);
    border-top: 1px solid var(--border);
}
.fp-select-group:first-child { border-top: none; }

/* Date picker */
.fp-date { position: relative; display: flex; align-items: center; }
.fp-date input[type="date"] { flex: 1; padding-right: 36px; }
.fp-date input[type="date"]::-webkit-calendar-picker-indicator { display: none; -webkit-appearance: none; }
.fp-date-icon {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    padding: 4px; border-radius: 4px;
}
.fp-date-icon:hover { color: var(--lime); }
.fp-date-popup {
    position: fixed;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); z-index: 100000;
    box-shadow: 0 8px 24px rgba(0,0,0,.4); padding: 12px;
    min-width: 280px; max-width: calc(100vw - 24px);
}
@media (max-width: 768px) {
    .fp-date-popup { position: fixed; left: 50% !important; top: auto !important; bottom: 0;
        transform: translateX(-50%); margin: 0; border-radius: var(--radius) var(--radius) 0 0;
        width: 100vw; max-width: 100vw; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
        z-index: 500;
    }
    .fp-date-popup.fp-date-above { bottom: 0; top: auto !important; }
}
.fp-date-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px; font-size: .86rem; font-weight: 600;
}
.fp-date-nav {
    background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text-secondary); width: 28px; height: 28px; font-size: 1rem;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.fp-date-nav:hover { border-color: var(--lime); color: var(--lime); }
.fp-date-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.fp-date-dow {
    text-align: center; font-size: .68rem; font-weight: 600;
    color: var(--text-muted); padding: 4px 0; text-transform: uppercase;
}
.fp-date-cell {
    text-align: center; padding: 7px 0; font-size: .82rem;
    border-radius: var(--radius-sm); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    min-height: 32px; transition: all .1s;
}
.fp-date-empty { cursor: default; }
.fp-date-disabled { color: var(--text-muted); opacity: .3; cursor: not-allowed; }
.fp-date-day:hover:not(.fp-date-disabled) { background: var(--hover); }
.fp-date-selected { background: var(--lime) !important; color: #000 !important; font-weight: 700; }
.fp-date-today { box-shadow: inset 0 0 0 1px var(--lime); }

/* Time picker */
.fp-time { position: relative; display: flex; align-items: center; }
.fp-time input[type="time"] { flex: 1; padding-right: 36px; }
.fp-time-popup {
    position: absolute; right: 0; top: 100%; margin-top: 4px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); z-index: 200;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
    width: 120px; max-height: 240px; overflow-y: auto;
}
.fp-time-option {
    padding: 8px 12px; font-size: .84rem; cursor: pointer;
    color: var(--text-primary); text-align: center; font-variant-numeric: tabular-nums;
}
.fp-time-option:hover { background: var(--hover); }
.fp-time-option.selected { color: var(--lime); font-weight: 600; }

/* ── Multi-select ────────────────────────────────────────────────────── */
.fp-multiselect { position: relative; }
.fp-multiselect-trigger {
    display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
    min-height: 38px; padding: 4px 32px 4px 10px; cursor: pointer;
    background: var(--bg-input, #1e1e2a); border: 1px solid var(--border);
    border-radius: 6px; font-size: .84rem; color: var(--text-primary);
    position: relative; user-select: none;
}
.fp-multiselect-trigger:focus { outline: none; border-color: var(--lime); }
.fp-multiselect.open .fp-multiselect-trigger { border-color: var(--lime); }
.fp-multiselect-trigger .fp-select-arrow { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.fp-multiselect-placeholder { color: var(--text-muted); }
.fp-multiselect-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 6px; border-radius: 4px;
    background: rgba(156,236,19,.12); border: 1px solid rgba(156,236,19,.3);
    color: var(--lime); font-size: .75rem; font-weight: 600; white-space: nowrap;
}
.fp-multiselect-chip-remove {
    background: none; border: none; padding: 0; cursor: pointer;
    color: var(--lime); opacity: .6; font-size: .7rem; line-height: 1;
}
.fp-multiselect-chip-remove:hover { opacity: 1; }
.fp-multiselect-dropdown {
    position: fixed; z-index: 9999;
    background: var(--bg-card, #1a1a2a); border: 1px solid var(--border);
    border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,.5);
    overflow: hidden; min-width: 180px;
}
.fp-multiselect-search-wrap { padding: 8px 8px 4px; }
.fp-multiselect-list { overflow-y: auto; max-height: 220px; padding: 4px 0; }
.fp-multiselect-option {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 12px; cursor: pointer; font-size: .84rem;
    color: var(--text-primary);
}
.fp-multiselect-option:hover { background: var(--hover); }
.fp-multiselect-option input[type="checkbox"] { accent-color: var(--lime); width: 14px; height: 14px; flex-shrink: 0; cursor: pointer; }

/* ── View Transitions (cross-document, Chrome 126+ / Safari 18.2+) ── */
@view-transition { navigation: auto; }

/* Name persistent shell elements so they animate separately from content */
.sidebar       { view-transition-name: sidebar; }
.topbar        { view-transition-name: topbar; }
.bottom-nav    { view-transition-name: bottom-nav; }
.page-content  { view-transition-name: main-content; }

/* Shell: stay put, no animation (instant swap) */
::view-transition-old(sidebar),
::view-transition-new(sidebar),
::view-transition-old(topbar),
::view-transition-new(topbar),
::view-transition-old(bottom-nav),
::view-transition-new(bottom-nav) {
    animation: none;
}

/* Keep shell above content during transition */
::view-transition-group(sidebar)    { z-index: 200; }
::view-transition-group(topbar)     { z-index: 200; }
::view-transition-group(bottom-nav) { z-index: 200; }
::view-transition-group(main-content) { z-index: 1; }

/* Main content: crossfade with subtle scale */
::view-transition-old(main-content) {
    animation: vt-content-out .15s ease-in forwards;
}
::view-transition-new(main-content) {
    animation: vt-content-in .2s ease-out;
}
@keyframes vt-content-out { to { opacity: 0; } }
@keyframes vt-content-in  { from { opacity: 0; } }

/* Root fallback (for elements not named) */
::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: .15s;
}

/* ─────────────────────────────────────────────────────────────
   MOBILE FIXES (consolidated)
───────────────────────────────────────────────────────────── */

/* Login form — reduce padding on small screens */
@media (max-width: 480px) {
    .login-form-panel { padding: 32px 20px; }
    .login-form-inner { max-width: 100%; }
}

/* Page header — allow wrapping on mobile */
@media (max-width: 768px) {
    .page-header { flex-wrap: wrap; gap: 10px; }
    .page-header-actions { flex-wrap: wrap; }
}

/* Call action buttons — meet touch target guidelines */
.uc-btn { min-height: 36px !important; padding: 6px 10px !important; }

/* Settings nav — scroll hint */
@media (max-width: 900px) {
    .settings-nav {
        -webkit-overflow-scrolling: touch;
        position: relative;
    }
    .settings-nav::after {
        content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 32px;
        background: linear-gradient(to right, transparent, var(--bg-card));
        pointer-events: none;
    }
}

/* Digest grid — stack on narrow screens */
@media (max-width: 480px) {
    .digest-stat-grid { grid-template-columns: 1fr !important; }
}

/* ── Global Search Palette ─────────────────────────────────────────── */
.topbar-search-btn {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 50%;
    background: none; border: 1px solid var(--border); cursor: pointer;
    color: var(--text-muted); transition: all var(--transition);
    position: relative; z-index: 10; touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.topbar-search-btn:hover { border-color: var(--lime); color: var(--lime); background: var(--lime-dim); }

/* ── Notification bell + drawer ───────────────────────────────────── */
.topbar-bell-btn {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 50%;
    background: none; border: 1px solid var(--border); cursor: pointer;
    color: var(--text-muted); transition: all var(--transition);
    position: relative; z-index: 10; touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.topbar-bell-btn:hover { border-color: var(--lime); color: var(--lime); background: var(--lime-dim); }
.topbar-bell-badge {
    position: absolute; top: 2px; right: 2px;
    min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 8px;
    background: var(--lime); color: #000;
    font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
    box-shadow: 0 0 0 2px var(--bg-card);
}
.portal-user .topbar-bell-btn { width: 36px; height: 36px; }
.portal-user .topbar-bell-badge { top: 0; right: 0; }

.notif-list {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column;
}
.notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background var(--transition), transform .25s ease, opacity .25s ease;
    border-left: 3px solid transparent;
    will-change: transform;
}
.notif-item:hover { background: var(--hover); }
.notif-item-unread { border-left-color: var(--lime); background: rgba(156,236,19,.04); }
.notif-item-unread .notif-item-title { font-weight: 600; color: var(--text-primary); }
.notif-item-row { display: flex; align-items: flex-start; gap: 8px; }
.notif-item-main { flex: 1; min-width: 0; }
.notif-item-title { font-size: .9rem; color: var(--text-primary); line-height: 1.3; }
.notif-item-body  { font-size: .8rem; color: var(--text-secondary); margin-top: 2px; line-height: 1.35;
                    overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notif-item-meta  { font-size: .7rem; color: var(--text-muted); margin-top: 4px; }
.notif-item-nested { padding-left: 32px; background: rgba(0,0,0,.15); }

/* Mark-as-read button — visible on hover (desktop). On touch devices users swipe instead. */
.notif-item-mark-btn {
    flex: 0 0 auto;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition), color var(--transition), border-color var(--transition), background var(--transition);
    -webkit-tap-highlight-color: transparent;
}
.notif-item:hover .notif-item-mark-btn,
.notif-item-mark-btn:focus-visible { opacity: 1; }
.notif-item-mark-btn:hover {
    color: var(--lime);
    border-color: var(--lime);
    background: var(--lime-dim);
}
/* Touch devices: button is always visible (no hover state) since swipe is the primary action,
   but keeping the button visible as a tap-friendly fallback. */
@media (hover: none) {
    .notif-item-mark-btn { opacity: 1; }
}
.notif-group-head .notif-item-title { display: flex; align-items: center; gap: 6px; }
.notif-group-count {
    display: inline-block;
    background: var(--lime-dim); color: var(--lime);
    font-size: .68rem; font-weight: 600;
    padding: 2px 8px; border-radius: 10px;
    margin-left: 4px;
}
.notif-group-children { list-style: none; margin: 0; padding: 0; }
.notif-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 48px 16px; color: var(--text-muted); gap: 12px; text-align: center;
}
.notif-empty-icon { color: var(--text-muted); opacity: .4; }
.notif-empty-text { font-size: .9rem; }

.search-palette-backdrop {
    position: fixed; inset: 0; z-index: 900;
    background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: min(20vh, 120px);
}
.search-palette {
    width: min(580px, calc(100vw - 24px));
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: 0 16px 64px rgba(0,0,0,.5);
    overflow: hidden;
}
.search-palette-header {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.search-palette-header input {
    flex: 1; background: none; border: none; outline: none;
    color: var(--text-primary); font-size: .95rem; font-family: Inter, sans-serif;
}
.search-palette-header input::placeholder { color: var(--text-muted); }
.search-palette-kbd {
    font-family: Inter, sans-serif; font-size: .68rem;
    padding: 2px 6px; border: 1px solid var(--border);
    border-radius: 4px; color: var(--text-muted); background: var(--bg-input);
    line-height: 1.4;
}
.search-palette-results {
    max-height: min(50vh, 400px); overflow-y: auto;
}
.search-palette-results:empty { display: none; }
.sp-group-label {
    font-size: .68rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .06em; color: var(--text-muted);
    padding: 10px 16px 4px;
}
.sp-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; cursor: pointer; transition: background .1s;
}
.sp-item:hover, .sp-item.sp-active { background: var(--hover); }
.sp-item-icon {
    flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .72rem; font-weight: 600;
    background: var(--lime-dim); color: var(--lime);
}
.sp-item-icon--opp { background: rgba(255,191,0,.12); color: var(--gold); }
.sp-item-icon--co  { background: rgba(56,189,248,.12); color: var(--info); }
.sp-item-photo {
    flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
    object-fit: cover;
}
.sp-item-body { flex: 1; min-width: 0; }
.sp-item-name { font-size: .84rem; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-item-sub  { font-size: .72rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-empty {
    padding: 24px 16px; text-align: center;
    color: var(--text-muted); font-size: .84rem;
}
.sp-hint {
    padding: 12px 16px; text-align: center;
    color: var(--text-muted); font-size: .78rem;
}
@media (max-width: 768px) {
    .search-palette-backdrop { padding-top: calc(var(--header-h) + env(safe-area-inset-top)); align-items: flex-start; }
    .search-palette { width: 100vw; max-height: calc(70vh - var(--header-h)); border-radius: 0 0 var(--radius) var(--radius); border: none; border-bottom: 1px solid var(--border); }
    .search-palette-kbd { display: none; }
}

/* ── Quick Actions FAB ─────────────────────────────────────────────── */
.fab {
    position: fixed; z-index: 350;
    bottom: 24px; right: 24px;
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--lime); color: #000; border: none;
    box-shadow: 0 4px 16px rgba(156,236,19,.35);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: transform .2s, box-shadow .2s;
    touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.fab:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(156,236,19,.45); }
.fab.fab-open svg { transform: rotate(45deg); transition: transform .2s; }
.fab svg { transition: transform .2s; }
@media (max-width: 768px) {
    .fab { bottom: calc(72px + env(safe-area-inset-bottom)); right: 16px; }
}

.fab-backdrop {
    position: fixed; inset: 0; z-index: 348;
    background: rgba(0,0,0,.3);
    display: none;
}
.fab-backdrop.open { display: block; }
.fab-sheet {
    position: fixed; z-index: 349;
    bottom: 84px; right: 24px;
    display: flex; flex-direction: column; gap: 6px;
    animation: fabSlideUp .2s ease;
}
@keyframes fabSlideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 768px) {
    .fab-sheet { bottom: calc(132px + env(safe-area-inset-bottom)); right: 16px; }
}
.fab-action {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; border-radius: var(--radius-sm);
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text-primary); font-size: .84rem; font-family: Inter, sans-serif;
    cursor: pointer; white-space: nowrap;
    transition: background var(--transition);
}
.fab-action:hover { background: var(--bg-card-hover); }
.fab-action svg { color: var(--lime); flex-shrink: 0; }

/* ── Milestone Editor ──────────────────────────────────────────── */
.ms-editor-list { display: flex; flex-direction: column; gap: 10px; }
.ms-card {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); overflow: hidden;
    transition: border-color .15s;
}
.ms-card:hover { border-color: var(--text-muted); }
.ms-card[draggable="true"] { cursor: grab; }
.ms-card-header {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; background: rgba(255,255,255,.02);
    border-bottom: 1px solid var(--border);
}
.ms-drag-handle { cursor: grab; color: var(--text-muted); font-size: 1rem; flex-shrink: 0; user-select: none; }
.ms-card-num { font-size: .68rem; font-weight: 700; color: var(--text-muted); flex-shrink: 0; min-width: 22px; }
.ms-name-input { flex: 1; font-weight: 600; }
.ms-card-body { padding: 12px 14px; }
.ms-card-body .form-group { margin-bottom: 10px; }
.ms-card-body .form-group:last-child { margin-bottom: 0; }
.ms-card-body label { font-size: .72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; display: block; }
.ms-rr-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.ms-rr-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px; background: var(--lime-dim); border-radius: 12px;
    font-size: .74rem; color: var(--lime);
}
.ms-rr-chip button { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: .8rem; padding: 0; line-height: 1; }
.ms-rr-chip button:hover { color: var(--danger); }

/* ── Alert Banner ──────────────────────────────────────────────────── */
.alert-banner {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    padding: 8px 14px; margin-bottom: 12px;
    background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.2);
    border-radius: var(--radius-sm); font-size: .78rem;
}
.alert-banner-seg {
    display: inline-flex; align-items: center; gap: 4px;
    cursor: pointer; padding: 2px 0; color: var(--text-secondary);
    transition: color var(--transition);
}
.alert-banner-seg:hover { color: var(--text-primary); }
.alert-banner-seg--danger { color: #fca5a5; }
.alert-banner-seg--warning { color: #fcd34d; }
.alert-banner-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.alert-banner-dot--danger  { background: var(--danger); }
.alert-banner-dot--warning { background: var(--warning); }
.alert-banner-sep { color: var(--text-muted); margin: 0 2px; }

/* ── Pill Tabs ─────────────────────────────────────────────────────── */
.pill-tabs {
    display: flex; gap: 4px; margin-bottom: 14px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; -ms-overflow-style: none;
}
.pill-tabs::-webkit-scrollbar { display: none; }
.pill-tab {
    flex-shrink: 0; padding: 7px 16px;
    border-radius: 20px; border: 1px solid var(--border);
    background: none; color: var(--text-secondary);
    font-size: .80rem; font-family: Inter, sans-serif; font-weight: 500;
    cursor: pointer; transition: all var(--transition);
    white-space: nowrap; position: relative;
}
.pill-tab:hover { border-color: var(--text-muted); color: var(--text-primary); }
.pill-tab.active {
    background: var(--lime-dim); border-color: var(--lime);
    color: var(--lime); font-weight: 600;
}
.pill-tab-badge {
    font-size: .62rem; font-weight: 700;
    background: var(--warning); color: #000;
    padding: 1px 5px; border-radius: 8px;
    margin-left: 4px; vertical-align: top;
}

/* ── Tab panels ────────────────────────────────────────────────────── */
.ath-tab-panel { min-height: 200px; }

/* ── Feed items ────────────────────────────────────────────────────── */
.feed-day-label {
    font-size: .72rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .05em; color: var(--text-muted);
    padding: 12px 0 4px; border-bottom: 1px solid rgba(255,255,255,.05);
}
.feed-day-label:first-child { padding-top: 0; }
.feed-item {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.03);
}
.feed-icon { flex-shrink: 0; font-size: .82rem; margin-top: 1px; }
.feed-body { flex: 1; min-width: 0; }
.feed-title { font-size: .82rem; color: var(--text-primary); }
.feed-sub   { font-size: .72rem; color: var(--text-muted); margin-top: 1px; }
.feed-time  { font-size: .72rem; color: var(--text-muted); flex-shrink: 0; }

/* ── Milestone groups ──────────────────────────────────────────────── */
.ms-group-label {
    font-size: .72rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .05em; padding: 14px 0 6px;
    display: flex; align-items: center; gap: 8px;
}
.ms-group-label:first-child { padding-top: 0; }
.ms-group-label--overdue { color: #fca5a5; }
.ms-group-label--soon    { color: #fcd34d; }
.ms-group-label--later   { color: var(--text-muted); }
.ms-group-count {
    font-size: .62rem; background: rgba(255,255,255,.08);
    padding: 1px 6px; border-radius: 8px;
}
.ms-row {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.04);
    cursor: pointer; transition: background .1s;
}
.ms-row:hover { background: var(--hover); margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: var(--radius-sm); }
.ms-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .68rem; font-weight: 600;
    background: var(--lime-dim); color: var(--lime); flex-shrink: 0;
}
.ms-info { flex: 1; min-width: 0; }
.ms-name { font-size: .82rem; font-weight: 500; color: var(--text-primary); }
.ms-detail { font-size: .72rem; color: var(--text-muted); margin-top: 1px; }
.ms-date { font-size: .72rem; flex-shrink: 0; white-space: nowrap; }

/* ── Athletes layout (main + sidebar) ──────────────────────────────── */
.ath-layout { display: flex; gap: 20px; }
.ath-main { flex: 1; min-width: 0; }
.ath-sidebar-feed { display: none; }
@media (min-width: 1024px) {
    .ath-sidebar-feed {
        display: block; position: sticky; top: 80px; align-self: flex-start;
        width: 300px; flex-shrink: 0;
        background: var(--bg-card); border: 1px solid var(--border);
        border-radius: var(--radius); padding: 16px;
        max-height: calc(100vh - 100px);
        max-height: calc(100dvh - 100px);
        overflow-y: auto;
    }
}

/* ── Filter toggle button + panel ──────────────────────────────────── */
.filter-toggle-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 20px;
    border: 1px solid var(--border); background: none;
    color: var(--text-secondary); font-size: .80rem;
    font-family: Inter, sans-serif; cursor: pointer;
    transition: all var(--transition); white-space: nowrap; position: relative;
}
.filter-toggle-btn:hover { border-color: var(--text-muted); color: var(--text-primary); }
.filter-toggle-btn--active { border-color: var(--lime); color: var(--lime); background: var(--lime-dim); }
.filter-badge {
    font-size: .6rem; font-weight: 700; min-width: 16px; height: 16px;
    border-radius: 8px; background: var(--lime); color: #000;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 4px; margin-left: 2px;
}
.filter-panel {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 14px 16px;
    margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start;
}
.filter-panel-section { display: flex; flex-direction: column; gap: 6px; }
.filter-panel-label { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.filter-panel-actions { margin-left: auto; display: flex; align-items: flex-end; }
.filter-panel .filter-pills { gap: 4px; }
.filter-panel .filter-select { font-size: .82rem; }
@media (max-width: 768px) {
    .filter-panel { flex-direction: column; gap: 12px; }
    .filter-panel-actions { margin-left: 0; }
    .filter-panel .filter-pills { overflow-x: auto; flex-wrap: nowrap; }
}

/* ── Chat panel (global slide-in overlay) ──────────────────────── */
.chat-panel-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    height: 100lvh; /* extends behind keyboard transparent areas (iOS 26 keyboard) */
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(2px);
    z-index: 409;
    cursor: pointer;
    animation: fadeIn .2s ease;
}
.chat-panel-overlay.open { display: block; }

.chat-panel {
    position: fixed;
    top: 0; right: 0;
    /* Anchor between top and the keyboard top (or screen bottom when closed).
       env(keyboard-inset-height) is Safari 17.6+ / Chrome 117+. Older browsers
       fall back to bottom: 0, which lands at the keyboard top when combined
       with the viewport meta's `interactive-widget=resizes-content`. */
    bottom: 0;
    bottom: env(keyboard-inset-height, 0px);
    width: min(960px, 100vw);
    z-index: 410;
    background: var(--bg-card); /* matches sidebar header */
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
    padding-top: env(safe-area-inset-top);
}
.chat-panel.open {
    transform: translateX(0);
    box-shadow: -12px 0 40px rgba(0,0,0,.6);
}
@media (max-width: 768px) {
    .chat-panel { width: 100vw; border-left: none; }
}

/* Chat bubble FAB badge (absolutely positioned on FAB button) */
.fab-chat { position: fixed; }
.chat-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--danger);
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 5px;
    min-width: 16px;
    line-height: 1.4;
    pointer-events: none;
}

/* Search palette quick actions */
.sp-quick-actions {
    border-bottom: 1px solid var(--border);
    padding: 6px 4px;
}
.sp-section-label {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 4px 12px 6px;
}
.sp-qa-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: .875rem;
    font-family: inherit;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
}
.sp-qa-item:hover { background: var(--hover); }
.sp-qa-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--lime);
    flex-shrink: 0;
}

/* ── Milestone Editor ──────────────────────────────────────────── */

/* Page-level: strip padding/max-width when milestones pane is open */
body.ms-page-active .page-content { max-width: none; padding: 0; }
body.ms-page-active .page-header  { display: none; }

/* Analysis page: hide FAB only (bottom nav stays for navigation) */
body[data-page="analysis"] .fab,
body[data-page="analysis"] .fab-backdrop,
body[data-page="analysis"] .fab-sheet,
body[data-page="analysis"] .fab-chat {
    display: none !important;
}

/* Analysis page: fill edge-to-edge, no page padding */
body[data-page="analysis"] .page-content {
    max-width: none;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
body[data-page="analysis"] .main-wrap {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 60px - env(safe-area-inset-bottom));
    overflow: hidden;
}
@media (min-width: 769px) {
    body[data-page="analysis"] .main-wrap { height: 100dvh; }
}
/* Hide chrome when analysis is in fullscreen */
body.fp-analysis-fullscreen .topbar,
body.fp-analysis-fullscreen .bottom-nav,
body.fp-analysis-fullscreen .sidebar {
    display: none !important;
}

/* Outer pane: full width, column layout */
.ms-pane-full { display: flex; flex-direction: column; width: 100%; }

/* ── Sticky toolbar ── */
.ms-toolbar {
    position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top));
    z-index: 50;
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 10px 5vw;
    background: var(--sidebar-bg); border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.ms-toolbar-left  { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.ms-toolbar-center { display: flex; align-items: center; gap: 8px; }
.ms-toolbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; }

.ms-back-btn { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 600; color: var(--text-muted); background: none; border: none; cursor: pointer; padding: 0; letter-spacing: .01em; white-space: nowrap; flex-shrink: 0; }
.ms-back-btn:hover { color: var(--lime); }
.ms-toolbar-select { font-size: .82rem; padding: 5px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--input-bg, rgba(255,255,255,.06)); color: var(--text); max-width: 200px; }
.ms-toolbar-dur { display: flex; align-items: center; gap: 5px; }
.ms-toolbar-input { width: 52px; font-size: .82rem; padding: 5px 8px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--input-bg, rgba(255,255,255,.06)); color: var(--text); text-align: center; }
.ms-toolbar-label { font-size: .75rem; color: var(--text-muted); white-space: nowrap; }
.ms-toolbar-icon-btn { display: inline-flex; align-items: center; gap: 5px; background: none; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 5px 10px; color: var(--text-muted); cursor: pointer; font-size: .78rem; position: relative; }
.ms-toolbar-icon-btn:hover { color: var(--text); border-color: var(--lime); }
.ms-toolbar-badge { background: var(--lime); color: #000; font-size: .6rem; font-weight: 700; border-radius: 10px; padding: 1px 5px; line-height: 1.4; }

/* ── Viz canvas ── */
.ms-viz-canvas { padding: 0 5vw 60px; }

/* ── Edit popup ── */
.ms-edit-popup {
    position: fixed; z-index: 400;
    width: 480px; max-width: calc(100vw - 24px);
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 14px; box-shadow: 0 16px 48px rgba(0,0,0,.5);
    display: flex; flex-direction: column;
}
.ms-edit-popup--sheet {
    position: fixed !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    top: auto !important; width: 100% !important; max-width: 100% !important;
    border-radius: 18px 18px 0 0; max-height: 85vh;
}
.ms-edit-popup-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.ms-edit-popup-title { font-size: .88rem; font-weight: 700; color: var(--text); }
.ms-edit-popup-close { background: none; border: none; color: var(--text-muted); font-size: 1.3rem; cursor: pointer; padding: 0 4px; line-height: 1; }
.ms-edit-popup-close:hover { color: var(--text); }
.ms-edit-popup-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ms-popup-row { display: flex; gap: 10px; }
.ms-popup-visibility { background: var(--surface-alt, rgba(0,0,0,.025)); border: 1px solid var(--border); border-radius: 10px; padding: 2px; }
.ms-popup-footer { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; display: flex; justify-content: flex-end; }
.ms-popup-backdrop { position: fixed; inset: 0; z-index: 399; }

/* ── Excluded days popover ── */
.ms-excl-popover {
    position: fixed; z-index: 300;
    width: 300px; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.4);
    padding: 0;
}
.ms-excl-popover-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.ms-excl-popover-header strong { font-size: .85rem; }
.ms-excl-close { background: none; border: none; color: var(--text-muted); font-size: 1.2rem; cursor: pointer; line-height: 1; padding: 0 2px; }
.ms-excl-desc { font-size: .78rem; color: var(--text-muted); padding: 10px 14px 6px; line-height: 1.5; }
.ms-excl-list { padding: 0 14px; display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.ms-excluded-actions { padding: 8px 14px 14px; display: flex; gap: 8px; }

/* Internal/Visible badges */
.ms-internal-badge { font-size: .62rem; font-weight: 700; padding: 2px 7px; border-radius: 20px; white-space: nowrap; background: rgba(0,0,0,.07); color: var(--text-muted); flex-shrink: 0; }
.ms-visible-badge   { font-size: .62rem; font-weight: 700; padding: 2px 7px; border-radius: 20px; white-space: nowrap; background: color-mix(in srgb, var(--lime) 15%, transparent); color: color-mix(in srgb, var(--lime) 80%, #000); flex-shrink: 0; }

/* Action summary strip (below toolbar, above viz) */
.ms-action-summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 5vw; background: rgba(0,0,0,.15); border-bottom: 1px solid var(--border); }
.ms-action-summary-label { font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-right: 4px; }
.ms-action-pill { display: inline-flex; align-items: center; gap: 5px; font-size: .68rem; font-weight: 600; padding: 3px 9px; border-radius: 20px; }
.ms-action-pill-count { font-weight: 800; font-size: .72rem; }

/* Internal toggle */
.ms-internal-toggle-row { background: var(--surface-alt, rgba(0,0,0,.025)); border: 1px solid var(--border); border-radius: 10px; padding: 2px; }
.ms-internal-toggle { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; cursor: pointer; border-radius: 8px; transition: background .15s; }
.ms-internal-toggle:hover { background: rgba(0,0,0,.03); }
.ms-int-track { width: 40px; height: 22px; background: color-mix(in srgb, var(--lime) 20%, #d1d5db); border-radius: 11px; position: relative; flex-shrink: 0; transition: background .2s; margin-top: 1px; }
.ms-internal-toggle--on .ms-int-track { background: rgba(0,0,0,.25); }
.ms-int-thumb { width: 18px; height: 18px; background: white; border-radius: 50%; position: absolute; top: 2px; left: 2px; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.ms-internal-toggle--on .ms-int-thumb { transform: translateX(18px); }
.ms-int-labels { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.ms-int-label { font-size: .75rem; color: var(--text-muted); display: flex; align-items: center; gap: 5px; line-height: 1.4; transition: color .15s, opacity .15s; opacity: .4; }
.ms-int-label--active { color: var(--text); opacity: 1; font-weight: 500; }

.ms-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ms-when-row { display: flex; gap: 6px; align-items: center; }
.ms-offset-input { width: 64px !important; }
.ms-after-label { font-size: .75rem; color: var(--text-muted); white-space: nowrap; }
.ms-offset-hint { font-size: .72rem; color: var(--text-muted); white-space: nowrap; opacity: .7; margin-left: 2px; }
.form-label-opt { font-size: .7rem; font-weight: 400; color: var(--text-muted); }
.form-hint { font-size: .68rem; color: var(--text-muted); margin-top: 2px; }

/* Action badge */
.ms-action-badge { font-size: .68rem; font-weight: 600; padding: 2px 7px; border-radius: 20px; white-space: nowrap; background: var(--surface-alt, #f0f0f0); color: var(--text-muted); flex-shrink: 0; }
.ms-action-badge.ms-blue   { background: #dbeafe; color: #1d4ed8; }
.ms-action-badge.ms-indigo { background: #e0e7ff; color: #4338ca; }
.ms-action-badge.ms-teal   { background: #ccfbf1; color: #0f766e; }
.ms-action-badge.ms-green  { background: #dcfce7; color: #15803d; }
.ms-action-badge.ms-orange { background: #ffedd5; color: #c2410c; }
.ms-action-badge.ms-purple { background: #f3e8ff; color: #7c3aed; }
.ms-action-badge--sm { font-size: .62rem; padding: 1px 5px; }

/* Tasks */
.ms-tasks-section { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 2px; }
.ms-tasks-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: 8px; }
.ms-tasks-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.ms-task-item { background: var(--surface-alt, rgba(0,0,0,.02)); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.ms-task-header { display: flex; align-items: center; gap: 8px; }
.ms-task-audience-toggle {
    display: flex; gap: 0; border: 1px solid var(--border); border-radius: 20px;
    overflow: hidden; cursor: pointer; flex-shrink: 0; margin-left: auto;
}
.ms-aud-opt {
    padding: 2px 9px; font-size: .7rem; font-weight: 500; color: var(--text-muted);
    transition: background .12s, color .12s; user-select: none; white-space: nowrap;
}
.ms-aud-active { background: var(--lime-dim); color: var(--lime); }
.ms-task-label { font-size: .72rem; font-weight: 600; color: var(--text-muted); }
.ms-task-remove { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1rem; padding: 0; }
.ms-task-remove:hover { color: var(--danger, #e53e3e); }
.ms-assign-toggle { display: flex; gap: 12px; margin-bottom: 4px; }
.ms-assign-toggle label { font-size: .78rem; display: flex; align-items: center; gap: 4px; cursor: pointer; }
.ms-rr-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.ms-rr-chip { font-size: .75rem; background: var(--surface-alt, #f0f0f0); border: 1px solid var(--border); border-radius: 20px; padding: 2px 8px; display: flex; align-items: center; gap: 4px; }
.ms-rr-chip button { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: .85rem; padding: 0; line-height: 1; }

/* Viz panel (right col) */
.ms-right-col .ms-viz-inner { display: flex; flex-direction: column; height: 100%; }
.ms-viz-track { flex: 1; overflow-y: auto; padding: 16px 0 40px; }
.ms-viz-empty { color: var(--text-muted); font-size: .82rem; padding: 60px 28px; text-align: center; }

/* Proportional timeline */
.ms-viz-proportional { position: relative; margin: 0 28px 0 40px; }
/* Vertical spine — sits to the left of the markers */
.ms-viz-spine { position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--border); border-radius: 1px; }
/* Month gridlines */
.ms-viz-grid-line { position: absolute; left: -40px; right: 0; display: flex; align-items: center; pointer-events: none; }
.ms-viz-grid-label { font-size: .58rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); width: 36px; flex-shrink: 0; line-height: 1; white-space: nowrap; }
.ms-viz-grid-line-inner { flex: 1; height: 1px; background: var(--border); opacity: .45; }
/* Half-month faint lines */
.ms-viz-half-line { position: absolute; left: -24px; right: 0; pointer-events: none; }
.ms-viz-half-line-inner { width: 100%; height: 1px; background: var(--border); opacity: .18; }
/* Milestone markers — absolutely positioned, label to the right of spine */
.ms-viz-marker { position: absolute; left: 8px; right: 0; display: flex; align-items: center; gap: 8px; cursor: pointer; transform: translateY(-50%); padding: 3px 0; transition: opacity .15s; }
.ms-viz-marker:hover { opacity: .85; }
.ms-viz-marker--internal { opacity: .5; }
.ms-viz-marker--internal:hover { opacity: .75; }
/* Pip — small dot to the right of the spine */
.ms-viz-pip { width: 9px; height: 9px; border-radius: 50%; background: #94a3b8; flex-shrink: 0; border: 2px solid var(--surface); box-shadow: 0 0 0 1.5px #94a3b8; transition: transform .15s, box-shadow .15s; position: relative; z-index: 2; }
.ms-viz-marker:hover .ms-viz-pip { transform: scale(1.25); }
.ms-viz-marker--active .ms-viz-pip { transform: scale(1.4); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lime) 35%, transparent); }
.ms-viz-marker--internal .ms-viz-pip { background: #94a3b8 !important; box-shadow: 0 0 0 1.5px #94a3b8 !important; border-style: dashed; }
/* Pip colors by action */
.ms-viz-pip.ms-blue   { background: #3b82f6; box-shadow: 0 0 0 1.5px #3b82f6; }
.ms-viz-pip.ms-indigo { background: #6366f1; box-shadow: 0 0 0 1.5px #6366f1; }
.ms-viz-pip.ms-teal   { background: #14b8a6; box-shadow: 0 0 0 1.5px #14b8a6; }
.ms-viz-pip.ms-green  { background: #22c55e; box-shadow: 0 0 0 1.5px #22c55e; }
.ms-viz-pip.ms-orange { background: #f97316; box-shadow: 0 0 0 1.5px #f97316; }
.ms-viz-pip.ms-purple { background: #a855f7; box-shadow: 0 0 0 1.5px #a855f7; }
/* Label — beside the pip, all on one line */
.ms-viz-label { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; flex-wrap: wrap; }
.ms-viz-label-name { font-size: .78rem; font-weight: 600; color: var(--text); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-viz-simdate { font-size: .68rem; font-weight: 700; color: var(--lime); white-space: nowrap; }
.ms-viz-dot-timing { font-size: .63rem; color: var(--text-muted); white-space: nowrap; }
.ms-viz-dot-action { font-size: .63rem; color: var(--text-muted); white-space: nowrap; }
.ms-viz-dot-tasks  { font-size: .6rem; color: var(--text-muted); white-space: nowrap; }
.ms-viz-dot-internal-tag { font-size: .58rem; font-weight: 700; color: var(--text-muted); background: rgba(0,0,0,.06); border-radius: 20px; padding: 1px 5px; white-space: nowrap; }
.ms-viz-dot-visible-tag  { font-size: .58rem; font-weight: 700; color: color-mix(in srgb, var(--lime) 70%, #000); background: color-mix(in srgb, var(--lime) 15%, transparent); border-radius: 20px; padding: 1px 5px; white-space: nowrap; }

/* Simulation bar (above viz track) */
.ms-viz-sim-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-alt, rgba(0,0,0,.025)); flex-wrap: wrap; gap: 8px; }
.ms-viz-sim-bar-left { display: flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.ms-viz-sim-bar-right { display: flex; align-items: center; gap: 10px; }
.ms-sim-date-inline { font-size: .82rem !important; padding: 4px 8px !important; height: auto !important; width: auto !important; }
/* Sim toggle */
.ms-sim-toggle-wrap { display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.ms-sim-toggle-wrap input[type="checkbox"] { display: none; }
.ms-sim-toggle-track { width: 34px; height: 19px; background: var(--border); border-radius: 10px; position: relative; flex-shrink: 0; transition: background .2s; }
.ms-sim-toggle-wrap input:checked + .ms-sim-toggle-track { background: var(--lime); }
.ms-sim-toggle-thumb { width: 15px; height: 15px; background: white; border-radius: 50%; position: absolute; top: 2px; left: 2px; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.ms-sim-toggle-wrap input:checked + .ms-sim-toggle-track .ms-sim-toggle-thumb { transform: translateX(15px); }
.ms-sim-toggle-label { font-size: .72rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; }

/* Excluded Days accordion */
.ms-excluded-accordion { margin-top: 20px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.ms-excluded-toggle { width: 100%; display: flex; align-items: center; gap: 10px; padding: 13px 16px; background: var(--surface-alt, rgba(0,0,0,.025)); border: none; cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--text); text-align: left; }
.ms-excluded-toggle:hover { background: rgba(0,0,0,.04); }
.ms-excluded-toggle-icon { color: var(--text-muted); flex-shrink: 0; }
.ms-excluded-count { margin-left: auto; font-size: .72rem; font-weight: 500; color: var(--text-muted); background: rgba(0,0,0,.06); padding: 2px 8px; border-radius: 20px; }
.ms-excluded-chevron { margin-left: 8px; flex-shrink: 0; color: var(--text-muted); transition: transform .2s; }
.ms-excluded-toggle.ms-excluded-open .ms-excluded-chevron { transform: rotate(180deg); }
.ms-excluded-body { padding: 16px; background: var(--surface); }
.ms-excluded-desc { font-size: .82rem; color: var(--text-muted); margin-bottom: 14px; line-height: 1.5; }
.ms-excluded-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; max-width: 280px; }
.ms-excluded-row { display: flex; align-items: center; gap: 8px; }
.ms-excluded-input { width: 100px; font-family: monospace; font-size: .85rem; }
.ms-excluded-remove { opacity: .5; }
.ms-excluded-remove:hover { opacity: 1; }
.ms-excluded-actions { display: flex; align-items: center; gap: 10px; }

/* ── Timeline notes ── */
.ms-viz-note {
    position: absolute; left: 52%; right: 8px;
    background: color-mix(in srgb, #fefce8 85%, transparent);
    border: 1px solid #fde68a;
    border-left: 3px solid #f59e0b;
    border-radius: 6px; padding: 6px 9px;
    cursor: pointer; transition: box-shadow .15s, border-color .15s;
    font-size: .72rem; line-height: 1.45;
}
.ms-viz-note:hover { box-shadow: 0 2px 10px rgba(245,158,11,.25); border-color: #f59e0b; }
.ms-viz-note--active { box-shadow: 0 0 0 2px #f59e0b; }
.ms-note-header { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.ms-note-timing { font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #92400e; }
.ms-note-simdate { font-size: .65rem; font-weight: 700; color: var(--lime); }
.ms-note-body { color: #78350f; white-space: pre-wrap; word-break: break-word; max-height: 4.5em; overflow: hidden; text-overflow: ellipsis; }

/* Opp drawer sits below athlete drawer so "Open profile" can overlay it */
#oppDrawerOverlay { z-index: 389; }
#oppDrawer { z-index: 390; }

/* ── Drawer media tab (da-*) — used on all pages with the contact drawer ── */
.da-media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.fp-media-card { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.da-analysis-card { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border, #222); }
.da-analysis-card:last-child { border-bottom: none; }
.da-analysis-name { font-size: .8rem; color: var(--lime, #9cec13); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.da-analysis-name:hover { text-decoration: underline; }
.da-analysis-date { font-size: .7rem; color: var(--text-muted, #555); flex-shrink: 0; }

/* ── Shared media lightbox (FPMedia.openLightbox) ── */
.fp-lightbox { position: fixed; inset: 0; z-index: 9999; display: none; align-items: center; justify-content: center; }
.fp-lightbox.open { display: flex; }
.fp-lightbox-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.82); cursor: pointer; }
.fp-lightbox-box { position: relative; z-index: 1; background: #111; border: 1px solid var(--border, #222); border-radius: 12px; max-width: 90vw; max-height: 92vh; overflow: hidden; display: flex; flex-direction: column; min-width: 320px; }
.fp-lightbox-top { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border, #222); }
.fp-lightbox-title { flex: 1; font-size: .85rem; font-weight: 600; color: var(--text-primary, #fff); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-lightbox-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.fp-lightbox-close { background: none; border: none; color: var(--text-muted, #555); cursor: pointer; font-size: 1.1rem; padding: 2px 6px; }
.fp-lightbox-media { flex: 1; overflow: auto; padding: 16px; display: flex; align-items: center; justify-content: center; }
.fp-lightbox-meta { padding: 10px 14px; border-top: 1px solid var(--border, #222); display: flex; flex-wrap: wrap; gap: 6px; }

/* ── Shared media badges (FPMedia) ── */
.fp-media-badge { font-size: .6rem; font-weight: 700; padding: 2px 5px; border-radius: 4px; text-transform: uppercase; letter-spacing: .04em; }
.fp-badge-analysis { background: #1e3a5f; color: #60a5fa; }
.fp-badge-customer { background: #1a3320; color: #4ade80; }
.fp-badge-team     { background: #2d1f4e; color: #c084fc; }
.fp-badge-analyzed { background: #1c2e1c; color: var(--lime, #9cec13); }

/* Uploader-type corner dot on thumbnails */
.fp-thumb-overlay {
    position: absolute; inset: 0; pointer-events: none; z-index: 3;
}
.fp-uploader-dot {
    position: absolute; bottom: 5px; right: 5px;
    width: 10px; height: 10px; border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(0,0,0,.6);
    display: block;
}
.fp-uploader-team    { background: var(--lime, #9cec13); }
.fp-uploader-athlete { background: #a78bfa; }
.fp-uploader-analysis { background: #60a5fa; }
.fp-analyzed-tick {
    position: absolute; top: 4px; right: 4px;
    font-size: .58rem; font-weight: 700; color: var(--lime, #9cec13);
    background: rgba(0,0,0,.6); border-radius: 3px; padding: 1px 3px;
    line-height: 1;
}

/* ── Native app (FPApp WKWebView) overrides ─────────────────────────────── */

/* Suppress tap highlight flicker on all interactive elements */
.fp-native-app * { -webkit-tap-highlight-color: transparent; }

/* Inputs: prevent iOS zoom on focus (requires font-size >= 16px) */
.fp-native-app input,
.fp-native-app select,
.fp-native-app textarea { font-size: max(16px, 1em); }

/* Hide PWA reload button — native app has its own refresh */
.fp-native-app #pwa-reload-btn { display: none !important; }

/* Hide keyboard shortcut hints — Cmd+K etc. don't apply on iOS */
.fp-native-app kbd,
.fp-native-app .fp-sc-key { display: none !important; }

/* Momentum scrolling on scrollable containers */
.fp-native-app .drawer,
.fp-native-app .page-content,
.fp-native-app .kanban-col,
.fp-native-app .uc-list { -webkit-overflow-scrolling: touch; }

/* ──────────────────────────────────────────────────────────────────
   MOBILE-FIRST AUDIT — PHASE A
   Cross-cutting infra adjustments grouped here so the audit pass is
   discoverable as a unit. Each block self-scopes via a media query.
─────────────────────────────────────────────────────────────────── */

/* A.1 — Touch-target floor for icon-only chrome on coarse pointers.
   .btn / .btn-sm / .modal-close / .drawer-action-btn / .pipeline-pill /
   .filter-chip are already bumped globally (see line ~2624); the icon
   chrome below was missed. */
@media (pointer: coarse) {
    .page-actions-overflow-btn { width: 44px; height: 44px; }
    .fp-date-nav { width: 36px; height: 36px; }
    .drawer-close,
    .wb-enroll-close {
        min-width: 40px; min-height: 40px;
        display: inline-flex; align-items: center; justify-content: center;
    }
    .fp-date-cell { min-height: 38px; }
    .action-btn { padding: 8px 10px; }
}

/* A.2 — Readable-text floor for chrome on mobile.
   10–11px chips/badges/section labels are too small on retina phones. */
@media (max-width: 768px) {
    .badge,
    .icon-badge-count,
    .sidebar-user-role,
    .kanban-age-chip,
    .kanban-src-chip,
    .portal-media-name,
    .profile-field-label,
    .profile-group-label,
    .drawer-section-label,
    .edit-section-label {
        font-size: max(0.78rem, 11.5px);
    }
    .das-btn { font-size: max(0.78rem, 12px); }
    .kanban-card-opp { font-size: max(0.82rem, 12.5px); }
}

/* A.3 — Drawer tabs horizontal-scroll on narrow phones (contact drawer
   has 7 tabs; on <380px they crush). */
@media (max-width: 480px) {
    .drawer-tabs {
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap;
    }
    .drawer-tabs::-webkit-scrollbar { display: none; }
    .tab-btn { flex: 0 0 auto; padding-left: 14px; padding-right: 14px; }
}

/* A.4 — Filter pill rows horizontal-scroll on very narrow screens
   (athletes, appointments, sales) to avoid multi-line wrapping. */
@media (max-width: 480px) {
    .filter-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 2px;
    }
    .filter-pills::-webkit-scrollbar { display: none; }
    .filter-pills > * { flex-shrink: 0; }
}

/* A.5 — fp-time-popup mobile bottom-sheet, mirroring fp-date-popup.
   Time picker was the lone holdout among fp-* popups. */
@media (max-width: 768px) {
    .fp-time-popup {
        position: fixed !important;
        left: 50% !important;
        right: auto !important;
        top: auto !important;
        bottom: 0;
        margin: 0;
        transform: translateX(-50%);
        border-radius: var(--radius) var(--radius) 0 0;
        width: 100vw;
        max-width: 100vw;
        max-height: 50vh;
        padding-bottom: env(safe-area-inset-bottom);
        z-index: 500;
    }
    .fp-time-option { padding: 12px 16px; font-size: 1rem; }
}

/* A.6 — Dropdown viewport guard: keep fixed-position popovers inside
   the viewport on phones (were escaping past the right edge on 375px). */
@media (max-width: 768px) {
    .so-search-dropdown,
    .das-dropdown-menu,
    .fp-select-dropdown,
    .fp-multiselect-dropdown {
        max-width: calc(100vw - 16px);
    }
}

/* ──────────────────────────────────────────────────────────────────
   MOBILE-FIRST AUDIT — PHASE C
   Responsive table strategies. Opt-in via class — does not change
   any existing table's behavior. See plan §2 Phase C.
─────────────────────────────────────────────────────────────────── */

/* C.2 — Card-stack on phones. Add `.responsive-card` to a `.data-table`
   to make rows render as stacked cards below 768px. Each <td> must carry
   a `data-label` attribute so the column name renders as the row label.
   Cells without data-label (typically the row-actions column) render
   right-aligned and unlabeled. */
@media (max-width: 768px) {
    .data-table.responsive-card { min-width: 0; }
    .data-table.responsive-card,
    .data-table.responsive-card thead,
    .data-table.responsive-card tbody,
    .data-table.responsive-card tr,
    .data-table.responsive-card td {
        display: block;
        width: 100%;
    }
    .data-table.responsive-card thead { display: none; }
    .data-table.responsive-card tr {
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        margin-bottom: 10px;
        padding: 8px 12px;
    }
    .data-table.responsive-card tbody tr:hover { background: var(--bg-card); }
    .data-table.responsive-card td {
        padding: 8px 0;
        border-bottom: 1px solid rgba(255,255,255,.04);
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        text-align: right;
        white-space: normal;
    }
    .data-table.responsive-card tbody tr td:last-child { border-bottom: none; }
    .data-table.responsive-card td[data-label]::before {
        content: attr(data-label);
        font-size: .68rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: .06em;
        color: var(--text-muted);
        flex: 1 1 auto;
        text-align: left;
    }
    .data-table.responsive-card td:not([data-label]) {
        justify-content: flex-end;
    }
    /* colspan loaders/empty/error states span the whole card row */
    .data-table.responsive-card td[colspan] {
        display: block;
        text-align: center;
        border-bottom: none;
    }
    .data-table.responsive-card td[colspan]::before { content: none; }
}
