/* BetCoach unified dashboard shell */


/*
 * Canonical design tokens for the premium redesign (Phase 1: live dashboard + home).
 *
 * One token set instead of the six that had accumulated (theme.css, this file's own
 * --bc-dash-*, and page-local blocks in home.html, pressure-graphs-live.html, dcs.css,
 * live-odds-history.css) with overlapping but inconsistent values for the same colors.
 * --bc-dash-* above is kept and aliased to these so nothing outside this phase's scope
 * breaks; new work should read the tokens below directly.
 */
:root {
    /* Background steps - never pure black, each step is a deliberate elevation */

    /* Text */

    /* Separator - hairlines only, never a full border box */

    /* Blue for interaction and home pressure; pink for away; green for live states. */

    /* Match-importance tiers reuse the semantic tokens above rather than adding new hex
       values - fewer distinct colors reads calmer. NORMAL has no color: absence of a
       badge is the normal signal. */

    /* Spacing - 4/8/12/16/20/24/32/40/48, no ad hoc values */

    /* Radius - restrained scale; full pills (999px) are a distinct treatment, not part
       of this scale */

    /* Shadow - subtle, 3 levels. Prefer surface-color steps + separator hairlines over
       shadow at rest; shadow is the tie-breaker for raised/overlay elements only. */

    /* Motion - for new micro-interactions this redesign introduces (tier badges, filter
       states, panel expand/collapse). Does not touch the already-tuned chart/flash/
       morphdom timings from the prior interaction pass. */
}

/*
 * One typeface for the whole workspace, defined once.
 *
 * Every page that uses the dashboard shell gets this file - the shell injects the link
 * itself - so this is the only place the workspace font needs to exist. Eleven of the
 * fifteen dashboard pages already declared nothing and inherited it; the outliers each
 * carried their own stack, and one of them named fonts the application does not ship.
 *
 * NO webfonts named here on purpose. /odds-history asked for "Inter", "Manrope" without
 * an @font-face or a Google Fonts link anywhere in the application, which means the page
 * rendered Inter for anyone who happened to have it installed locally and something else
 * for everyone who did not - verified in production, where document.fonts reported Inter
 * available but not loaded. A font stack that depends on the visitor's installed fonts is
 * not a design decision, it is an inconsistency with a name. If Inter is wanted, it has
 * to be self-hosted with @font-face; until then the platform UI font is the one thing
 * every visitor is guaranteed to render identically.
 *
 * The emoji families are last and deliberate: labels across the product use emoji, and
 * without them Windows and Linux fall back to a monochrome glyph mid-sentence.
 */

html {
    background: var(--bc-color-canvas-deep);
}

body.bc-dashboard {
    margin: 0;
    min-height: 100vh;
    font-family: var(--bc-type-family);
    background: var(--bc-color-canvas-deep);
    color: var(--bc-color-text);
}

.bc-dash-layout {
    display: flex;
    min-height: 100vh;
}

.bc-dash-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--bc-layout-sidebar);
    background: linear-gradient(180deg, rgba(8, 16, 30, 0.98), rgba(5, 11, 20, 0.98));
    border-right: 1px solid var(--bc-color-line);
    display: flex;
    flex-direction: column;
    z-index: 1200;
    padding: 16px 10px;
    box-sizing: border-box;
    transition: width 0.2s ease;
    overflow: hidden;
}

.bc-dash-sidebar.collapsed {
    width: var(--bc-layout-sidebar-collapsed);
    overflow: hidden;
}

.bc-dash-sidebar.collapsed:not(:hover):not(.pinned) .bc-dash-brand-text,
.bc-dash-sidebar.collapsed:not(:hover):not(.pinned) .bc-dash-nav a span,
.bc-dash-sidebar.collapsed:not(:hover):not(.pinned) .bc-dash-footer a span,
.bc-dash-sidebar.collapsed:not(:hover):not(.pinned) .bc-dash-nav-group-label {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
}

/* Promo is a multi-line card — opacity/max-width leaves wrapping text in the 64px rail. */
.bc-dash-sidebar.collapsed:not(:hover):not(.pinned) .bc-premium-note {
    display: none;
}

.bc-dash-sidebar.collapsed:hover,
.bc-dash-sidebar.pinned {
    width: var(--bc-layout-sidebar);
}

.bc-dash-sidebar.collapsed:hover .bc-dash-brand-text,
.bc-dash-sidebar.collapsed:hover .bc-dash-nav a span,
.bc-dash-sidebar.collapsed:hover .bc-dash-footer a span,
.bc-dash-sidebar.pinned .bc-dash-brand-text,
.bc-dash-sidebar.pinned .bc-dash-nav a span,
.bc-dash-sidebar.pinned .bc-dash-footer a span {
    opacity: 1;
    max-width: 180px;
}

.bc-dash-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 18px;
    border-bottom: 1px solid var(--bc-color-line);
    margin-bottom: 12px;
    text-decoration: none;
    color: var(--bc-color-text);
    min-height: 40px;
}

.bc-dash-brand img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    flex-shrink: 0;
}

.bc-dash-brand-text {
    min-width: 0;
    transition: opacity 0.15s ease, max-width 0.2s ease;
}

.bc-dash-brand strong {
    display: block;
    font-size: 15px;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.bc-dash-brand span {
    display: block;
    font-size: 11px;
    color: var(--bc-color-text-tertiary);
    font-weight: 500;
    white-space: nowrap;
}

.bc-dash-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.bc-dash-nav-group-label {
    margin: 10px 12px 2px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bc-color-text-tertiary);
    opacity: 0.85;
    white-space: nowrap;
}

/* Strategies grouped navigation */
.bc-dash-strategies-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 4px 0 6px;
    border-radius: 12px;
    border: 1px solid transparent;
    transition: border-color 0.15s, background 0.15s;
}

.bc-dash-strategies-nav.is-open,
.bc-dash-strategies-nav:has(.bc-dash-strategies-toggle:hover) {
    border-color: var(--bc-color-line);
    background: rgba(255, 255, 255, 0.02);
}

.bc-dash-strategies-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--bc-color-text-tertiary);
    cursor: pointer;
    text-align: left;
    font: inherit;
    transition: background 0.15s, color 0.15s;
}

.bc-dash-strategies-toggle:hover,
.bc-dash-strategies-nav.is-open .bc-dash-strategies-toggle {
    color: var(--bc-color-text);
}

.bc-dash-strategies-toggle > i:first-child {
    width: 18px;
    text-align: center;
    font-size: 14px;
    flex-shrink: 0;
}

.bc-dash-strategies-toggle-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.bc-dash-strategies-toggle-text strong {
    font-size: 14px;
    font-weight: 650;
    line-height: 1.2;
}

.bc-dash-strategies-toggle-text small {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--bc-color-text-tertiary);
    opacity: 0.9;
}

.bc-dash-strategies-chevron {
    font-size: 11px;
    opacity: 0.7;
    transition: transform 0.18s ease;
}

.bc-dash-strategies-nav.is-open .bc-dash-strategies-chevron {
    transform: rotate(180deg);
}

.bc-dash-strategies-panel {
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 2px 8px 10px;
}

.bc-dash-strategies-nav.is-open .bc-dash-strategies-panel {
    display: flex;
}

.bc-dash-strategies-section {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bc-dash-strategies-section-label {
    padding: 6px 8px 2px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--bc-color-text-tertiary);
    opacity: 0.85;
}

.bc-dash-strategies-panel a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px 8px 12px;
    border-radius: 8px;
    color: var(--bc-color-text-tertiary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
}

.bc-dash-strategies-panel a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--bc-color-text);
}

.bc-dash-strategies-panel a.active {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.16), rgba(14, 165, 233, 0.12));
    color: var(--bc-color-text);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.bc-dash-strategies-panel a i {
    width: 16px;
    text-align: center;
    font-size: 12px;
    opacity: 0.9;
}

.bc-dash-strategies-fallback {
    display: none;
}

.bc-dash-sidebar.collapsed:not(:hover):not(.pinned) .bc-dash-strategies-nav {
    border: 0;
    background: transparent;
    margin: 0;
}

.bc-dash-sidebar.collapsed:not(:hover):not(.pinned) .bc-dash-strategies-toggle,
.bc-dash-sidebar.collapsed:not(:hover):not(.pinned) .bc-dash-strategies-panel {
    display: none !important;
}

.bc-dash-sidebar.collapsed:not(:hover):not(.pinned) .bc-dash-strategies-fallback {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--bc-color-text-tertiary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.bc-dash-sidebar.collapsed:not(:hover):not(.pinned) .bc-dash-strategies-fallback:hover,
.bc-dash-sidebar.collapsed:not(:hover):not(.pinned) .bc-dash-strategies-fallback.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--bc-color-text);
}

.bc-dash-sidebar.collapsed:not(:hover):not(.pinned) .bc-dash-strategies-fallback i {
    width: 18px;
    text-align: center;
}

.bc-dash-sidebar.collapsed:not(:hover):not(.pinned) .bc-dash-strategies-fallback span {
    display: none;
}

.bc-dash-sidebar.collapsed:hover .bc-dash-strategies-fallback,
.bc-dash-sidebar.pinned .bc-dash-strategies-fallback {
    display: none;
}

.bc-dash-sidebar.collapsed:hover .bc-dash-strategies-toggle,
.bc-dash-sidebar.pinned .bc-dash-strategies-toggle {
    display: flex;
}

.bc-dash-strategy-shortcuts {
    display: none;
}

.bc-dash-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--bc-color-text-tertiary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.bc-dash-nav a span {
    transition: opacity 0.15s ease, max-width 0.2s ease;
}

.bc-dash-nav a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--bc-color-text);
}

.bc-dash-nav a.active {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(14, 165, 233, 0.14));
    color: var(--bc-color-text);
    border: 1px solid rgba(34, 197, 94, 0.22);
}

.bc-dash-nav a i {
    width: 18px;
    text-align: center;
    font-size: 14px;
    flex-shrink: 0;
}

.bc-dash-footer {
    padding-top: 12px;
    border-top: 1px solid var(--bc-color-line);
    margin-top: 8px;
}

.bc-dash-footer a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--bc-color-text-tertiary);
    text-decoration: none;
    white-space: nowrap;
}

.bc-dash-footer a i {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.bc-dash-footer a span {
    transition: opacity 0.15s ease, max-width 0.2s ease;
}

.bc-premium-note {
    padding: 16px;
    background: var(--bc-color-surface-panel);
    border: 1px solid var(--bc-color-line);
    border-radius: 12px;
    margin-bottom: 16px;
}

.bc-premium-note > i {
    display: block;
    color: var(--bc-color-orange);
    margin-bottom: 12px;
    font-size: 20px;
}

.bc-premium-note strong {
    display: block;
    font-size: 13px;
}

.bc-premium-note p {
    color: var(--bc-color-text-secondary);
    font-size: 12px;
    margin: 8px 0 16px;
}

.bc-dash-footer .bc-premium-note a {
    display: flex;
    justify-content: space-between;
    color: #111820;
    background: var(--bc-color-accent);
    border-radius: 8px;
    padding: 8px;
    font-weight: 600;
    white-space: nowrap;
}

.bc-dash-pin {
    position: absolute;
    right: 8px;
    bottom: 56px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--bc-color-line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--bc-color-text-tertiary);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 11px;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.bc-dash-pin:hover,
.bc-dash-pin.active {
    color: var(--bc-color-accent);
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.12);
}

.bc-dash-main {
    flex: 1;
    margin-left: var(--bc-layout-sidebar-collapsed);
    min-width: 0;
    min-height: 100vh;
    transition: margin-left 0.2s ease;
}

.bc-dash-sidebar:hover ~ .bc-dash-main,
.bc-dash-sidebar.pinned ~ .bc-dash-main {
    margin-left: var(--bc-layout-sidebar);
}

.bc-dash-mobile-bar {
    display: none;
}

@media (max-width: 768px) {
    html,
    body.bc-dashboard {
        overflow-x: clip;
    }

    body.bc-dashboard {
        box-sizing: border-box;
    }

    .bc-dash-sidebar,
    .bc-dash-pin {
        display: none;
    }

    .bc-dash-main {
        margin-left: 0;
        width: 100%;
        min-width: 0;
        overflow-x: clip;
        box-sizing: border-box;
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    }

    .bc-dash-mobile-bar {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1200;
        background: rgba(7, 17, 31, 0.96);
        border-top: 1px solid var(--bc-color-line);
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
        justify-content: space-around;
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
        box-sizing: border-box;
    }

    .bc-dash-mobile-bar a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 8px 2px;
        color: var(--bc-color-text-tertiary);
        text-decoration: none;
        font-size: 11px;
        font-weight: 600;
        min-width: 0;
        min-height: 44px;
    }

    .bc-dash-mobile-bar a i {
        font-size: 16px;
    }

    .bc-dash-mobile-bar a span {
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .bc-dash-mobile-bar a.active {
        color: var(--bc-color-accent);
    }

    .bc-dash-strategy-shortcuts {
        display: flex;
        align-items: center;
        gap: 0;
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        padding: 8px 10px;
        position: sticky;
        top: 0;
        z-index: 1100;
        background: rgba(7, 17, 31, 0.94);
        border-bottom: 1px solid var(--bc-color-line);
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .bc-dash-strategy-shortcuts-group {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        flex-shrink: 0;
    }

    .bc-dash-strategy-shortcuts-label {
        font-size: 11px;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--bc-color-text-tertiary);
        padding-right: 2px;
    }

    .bc-dash-strategy-shortcuts-divider {
        width: 1px;
        height: 22px;
        background: var(--bc-color-line);
        margin: 0 8px;
        flex-shrink: 0;
    }

    .bc-dash-strategy-shortcuts::-webkit-scrollbar {
        display: none;
    }

    .bc-dash-strategy-shortcuts a {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        min-height: 44px;
        padding: 10px 12px;
        border-radius: 999px;
        border: 1px solid var(--bc-color-line);
        color: var(--bc-color-text-tertiary);
        text-decoration: none;
        font-size: 11px;
        font-weight: 600;
        white-space: nowrap;
        flex-shrink: 0;
        box-sizing: border-box;
    }

    .bc-dash-strategy-shortcuts a.active {
        color: var(--bc-color-text);
        border-color: rgba(34, 197, 94, 0.35);
        background: rgba(34, 197, 94, 0.12);
    }
}


/* ==========================================================================
   Touch and accessibility layer.

   This is a dense workspace: control sizes are deliberately compact for a
   precise pointer, so the 44px minimum is applied only under a coarse
   pointer rather than inflating every control on the desktop. Hover lifts
   are neutralised where hover is not real, because on a touch screen they
   stick after the tap.
   ========================================================================== */
@media (pointer: coarse) {
    .bc-dash-strategies-toggle { min-height: 44px; }
}

@media (prefers-reduced-transparency: reduce) {
    .bc-dash-mobile-bar {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        background-color: #0b1426;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bc-dash-strategies-toggle {
        transition: none;
    }
}

@media (prefers-contrast: more) {
    .bc-dash-strategies-toggle {
        border-color: rgba(255, 255, 255, 0.46);
    }
}

a:focus-visible,
button:focus-visible,
select:focus-visible,
textarea:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid #8fd4ff;
    outline-offset: 3px;
}

