/* ============================================
   TRADEBUDDY NEW UI COMPONENTS
   Loaded only when TB_NEW_UI_ENABLED=1
   ============================================ */

/* ---- Compact Stat Cards (Dashboard) ---- */
.compact-stat-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--tb-bg-card);
    border: 1px solid var(--tb-border);
    border-radius: 12px;
    transition: all 0.2s ease;
    height: 100%;
}

.compact-stat-card:hover {
    border-color: var(--tb-primary);
    box-shadow: var(--tb-shadow-sm);
}

.compact-stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.compact-stat-icon.bg-primary-alpha {
    background: var(--tb-primary-alpha);
    color: var(--tb-primary);
}

.compact-stat-icon.bg-success-alpha {
    background: var(--tb-success-alpha);
    color: var(--tb-success);
}

.compact-stat-icon.bg-info-alpha {
    background: var(--tb-info-alpha);
    color: var(--tb-info);
}

.compact-stat-icon.bg-warning-alpha {
    background: var(--tb-warning-alpha);
    color: var(--tb-warning);
}

.compact-stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--tb-text-muted) !important;
    margin-bottom: 2px;
}

.compact-stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--tb-text-primary) !important;
    line-height: 1.2;
}

.compact-stat-sub {
    font-size: 0.85rem;
    color: var(--tb-text-muted) !important;
    margin-top: 1px;
}

/* ---- Market Pulse Sidebar ---- */
.market-pulse-card {
    background: var(--tb-bg-card);
    border: 1px solid var(--tb-border);
    border-radius: 12px;
    padding: 1rem;
}

.pulse-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--tb-border-alpha);
}

.pulse-item:last-child {
    border-bottom: none;
}

.pulse-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--tb-text-muted) !important;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.pulse-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--tb-text-primary) !important;
}

.pulse-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--tb-text-primary) !important;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ---- Onboarding Card ---- */
.onboarding-card {
    background: var(--tb-bg-card);
    border: 1px solid var(--tb-primary-alpha);
    border-left: 4px solid var(--tb-primary);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.onboarding-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--tb-text-primary) !important;
    margin-bottom: 0.25rem;
}

.onboarding-subtitle {
    font-size: 0.85rem;
    color: var(--tb-text-muted) !important;
    margin-bottom: 1rem;
}

.onboarding-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: background 0.2s;
}

.onboarding-step:hover {
    background: var(--tb-primary-alpha);
}

.onboarding-step:last-child {
    margin-bottom: 0;
}

.onboarding-step-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.onboarding-step-icon.done {
    background: var(--tb-success-alpha);
    color: var(--tb-success);
}

.onboarding-step-icon.pending {
    background: var(--tb-border);
    color: var(--tb-text-muted);
}

.onboarding-step-text {
    flex: 1;
}

.onboarding-step-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--tb-text-primary) !important;
}

.onboarding-step-desc {
    font-size: 0.85rem;
    color: var(--tb-text-muted) !important;
}

.onboarding-step-action {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--tb-accent) !important;
    text-decoration: none;
    white-space: nowrap;
}

.onboarding-step-action:hover {
    color: var(--tb-accent-light) !important;
}

.onboarding-step-badge {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--tb-success-alpha);
    color: var(--tb-success) !important;
}

/* ---- Theme Toggle Button ---- */
#themeToggleBtn {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

#themeToggleBtn:hover {
    background: rgba(255, 255, 255, 0.15);
}

#themeToggleBtn i {
    font-size: 1.1rem;
}

/* ---- Help Menu Dropdown ---- */
#helpMenuBtn {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

#helpMenuBtn:hover {
    background: rgba(255, 255, 255, 0.15);
}

#helpMenuBtn i {
    font-size: 1.1rem;
}

/* ---- Unified Nav Enhancements ---- */
.nav-dropdown-menu {
    max-height: 75vh;
    overflow-y: auto;
}

/* Activity list in sidebar */
.activity-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    font-size: 0.85rem;
    color: var(--tb-text-secondary) !important;
    border-bottom: 1px solid var(--tb-border-alpha);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.activity-dot.buy { background: var(--tb-success); }
.activity-dot.sell { background: var(--tb-danger); }
.activity-dot.info { background: var(--tb-info); }

/* ============================================
   NEW UI: NAV RESTYLING (Mockup Design)
   Overrides base.html nav styles when new-ui.css is loaded
   ============================================ */

/* Top header: remove gradient, use flat dark bg */
html[data-theme] .top-header,
.top-header {
    background: var(--tb-bg-dark) !important;
    box-shadow: none !important;
    border-bottom: 1px solid var(--tb-border);
    height: 44px;
}

/* Nav bar: cleaner, shorter, flat */
html[data-theme] .main-nav,
.main-nav {
    background: var(--tb-bg-dark) !important;
    height: 48px;
    top: 44px;
    box-shadow: none !important;
    border-bottom: 1px solid var(--tb-border);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* Nav items: mockup style — text-only with bottom-border active */
.main-nav .nav-item {
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--tb-text-secondary);
    border-radius: 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.main-nav .nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--tb-text-primary);
    box-shadow: none;
}

/* Active: bottom accent border, no filled pill */
.main-nav .nav-item.active {
    background: none !important;
    color: var(--tb-accent) !important;
    font-weight: 600 !important;
    border-bottom-color: var(--tb-accent);
    box-shadow: none !important;
}

.main-nav .nav-item.active i {
    color: var(--tb-accent) !important;
}

/* Back to home: subtle style */
.main-nav .nav-item.back-to-home {
    background: none;
    border: none;
    color: var(--tb-text-muted);
    border-bottom: 2px solid transparent;
}

.main-nav .nav-item.back-to-home:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--tb-text-primary);
    border-color: transparent;
}

/* Context switcher: subtle */
.main-nav .nav-item.nav-switcher {
    font-size: 12px !important;
    opacity: 0.6;
    border-bottom: 2px solid transparent;
}

.main-nav .nav-item.nav-switcher:hover {
    opacity: 1;
}

/* Dropdown menus: match mockup */
.nav-dropdown-menu {
    background: var(--tb-bg-card);
    border: 1px solid var(--tb-border);
    border-radius: 10px;
    padding: 6px;
    margin-top: 4px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.nav-dropdown-item {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    gap: 10px;
    color: var(--tb-text-secondary);
}

.nav-dropdown-item:hover {
    background: rgba(14, 165, 233, 0.08);
    color: var(--tb-text-primary);
}

.nav-dropdown-item:hover i {
    color: var(--tb-accent);
}

.nav-dropdown-item i {
    font-size: 15px;
    color: var(--tb-text-muted);
    width: 18px;
    text-align: center;
}

/* Dropdown divider */
.nav-dropdown-divider {
    height: 1px;
    background: var(--tb-border);
    margin: 4px 8px;
}

/* Section labels in dropdowns */
.nav-section-label {
    padding: 8px 14px 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--tb-text-muted);
    opacity: 1;
}

/* Adjust main-wrapper for shorter header */
.main-wrapper {
    margin-top: 92px !important;
    min-height: calc(100vh - 92px) !important;
}

.main-wrapper.home-context {
    margin-top: 44px !important;
    min-height: calc(100vh - 44px) !important;
}

/* Restyle the header-gradient as a clean compact page header */
.header-gradient {
    background: transparent !important;
    padding: 0 0 0.75rem 0 !important;
    margin-bottom: 1rem !important;
    border-radius: 0 !important;
    border-bottom: 1px solid var(--tb-border);
}

.header-gradient h1 {
    font-size: 1.4rem !important;
    font-weight: 600 !important;
    margin-bottom: 0 !important;
    color: var(--tb-text-primary) !important;
}

.header-gradient p {
    font-size: 0.85rem !important;
    color: var(--tb-text-secondary) !important;
    margin-top: 2px !important;
    margin-bottom: 0 !important;
}

/* Hide action buttons inside header-gradient (redundant with nav) */
.header-gradient .btn-outline-light {
    display: none;
}

/* Broker selector: pill style */
.broker-selector {
    background: var(--tb-bg-card);
    border: 1px solid var(--tb-border);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 13px;
    color: var(--tb-text-secondary);
}

/* ============================================
   BOTTOM TAB BAR (Context-Aware Quick Nav)
   ============================================ */
.bottom-tab-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--tb-bg-card);
    border: 1px solid var(--tb-border);
    border-radius: 28px;
    padding: 5px;
    display: flex;
    gap: 3px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 1050;
}

.bottom-tab-bar a.bottom-tab-item {
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    background: transparent;
    color: var(--tb-text-secondary) !important;
    text-decoration: none !important;
    transition: all 0.15s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}

.bottom-tab-bar a.bottom-tab-item:hover {
    color: var(--tb-text-primary) !important;
    background: rgba(255, 255, 255, 0.06);
}

.bottom-tab-bar a.bottom-tab-item.active {
    background: var(--tb-accent);
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.bottom-tab-item i {
    font-size: 14px;
}

/* Add padding-bottom to main content so bottom bar doesn't overlap */
.main-content {
    padding-bottom: 80px !important;
}

/* ============================================
   POSITION MINI CARDS (Dashboard)
   ============================================ */
.position-mini-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
}

.position-mini-card {
    background: var(--tb-bg-dark);
    border: 1px solid var(--tb-border);
    border-radius: 10px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.15s;
}

.position-mini-card:hover {
    border-color: var(--tb-accent);
    transform: translateY(-1px);
}

.pos-symbol {
    font-size: 15px;
    font-weight: 700;
    color: var(--tb-text-primary);
    margin-bottom: 2px;
}

.pos-detail {
    font-size: 12.5px;
    color: var(--tb-text-muted);
}

.pos-pnl {
    font-size: 18px;
    font-weight: 700;
    margin-top: 8px;
}

.pos-pnl.positive { color: var(--tb-success); }
.pos-pnl.negative { color: var(--tb-danger); }

/* ============================================
   DASHBOARD STAT CARDS (Mockup Style)
   ============================================ */
.new-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.new-stat-card {
    background: var(--tb-bg-card);
    border: 1px solid var(--tb-border);
    border-radius: 10px;
    padding: 18px 20px;
}

.new-stat-label {
    font-size: 12.5px;
    color: var(--tb-text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.new-stat-value {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--tb-text-primary);
}

.new-stat-sub {
    font-size: 13px;
    color: var(--tb-text-secondary);
    margin-top: 4px;
}

.new-stat-sub.positive { color: var(--tb-success); }
.new-stat-sub.negative { color: var(--tb-danger); }

/* ============================================
   DASHBOARD 2-COLUMN LAYOUT
   ============================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.dashboard-card {
    background: var(--tb-bg-card);
    border: 1px solid var(--tb-border);
    border-radius: 10px;
    padding: 20px;
}

.dashboard-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.dashboard-card-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--tb-text-muted);
}

/* Position tabs (Stocks / Options) */
.position-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--tb-border);
    margin-bottom: 16px;
}

.position-tab {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--tb-text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.15s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

.position-tab:hover { color: var(--tb-text-secondary); }
.position-tab.active {
    color: var(--tb-accent);
    border-bottom-color: var(--tb-accent);
}

/* Market Pulse sidebar items */
.market-pulse-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--tb-border);
}

.market-pulse-item:last-child {
    border-bottom: none;
}

.market-pulse-label {
    font-size: 12.5px;
    color: var(--tb-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.market-pulse-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--tb-text-primary);
}

.market-pulse-desc {
    font-size: 12.5px;
    color: var(--tb-text-muted);
}

/* Responsive: stack on mobile */
@media (max-width: 992px) {
    .new-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .bottom-tab-bar {
        left: 10px;
        right: 10px;
        transform: none;
        justify-content: center;
    }
    .bottom-tab-item {
        padding: 6px 10px;
        font-size: 11px;
    }
}

@media (max-width: 576px) {
    .new-stats-row {
        grid-template-columns: 1fr;
    }
    .position-mini-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   SECTION HEADERS — Bolder for visibility
   ============================================ */
.card-title,
h5.card-title,
h5.mb-0,
h5.mb-3 {
    font-weight: 700 !important;
    letter-spacing: 0.01em;
}

/* ============================================
   LIGHT MODE — Comprehensive Fixes
   (Overrides new-ui.css !important rules that
    break theme-light.css component overrides)
   ============================================ */

/* Keep top header DARK in light mode for visual anchoring */
html[data-theme="light"] .top-header,
html[data-theme="light"].top-header {
    background: linear-gradient(135deg,
        hsl(199, 89%, 26%) 0%,
        hsl(199, 89%, 34%) 100%) !important;
    border-bottom: none !important;
}

/* Header text + ticker: ensure white on dark header */
html[data-theme="light"] .top-header .app-name,
html[data-theme="light"] .top-header a,
html[data-theme="light"] .top-header span {
    color: hsla(0, 0%, 100%, 0.95) !important;
}

/* Header icon buttons: white on dark header */
html[data-theme="light"] .header-icon-btn,
html[data-theme="light"] #themeToggleBtn,
html[data-theme="light"] #helpMenuBtn {
    color: hsla(0, 0%, 100%, 0.9) !important;
}

html[data-theme="light"] .header-icon-btn:hover,
html[data-theme="light"] #themeToggleBtn:hover,
html[data-theme="light"] #helpMenuBtn:hover {
    background: hsla(0, 0%, 100%, 0.15) !important;
    color: #fff !important;
}

/* AI budget text in header */
html[data-theme="light"] .ai-budget-text,
html[data-theme="light"] .top-header .text-muted {
    color: hsla(0, 0%, 100%, 0.7) !important;
}

/* Broker selector in header: semi-transparent on dark bg */
html[data-theme="light"] .top-header .broker-selector {
    background: hsla(0, 0%, 100%, 0.12) !important;
    border-color: hsla(0, 0%, 100%, 0.2) !important;
    color: hsla(0, 0%, 100%, 0.9) !important;
}

/* User menu in header */
html[data-theme="light"] .top-header .user-menu,
html[data-theme="light"] .top-header .user-name {
    color: hsla(0, 0%, 100%, 0.95) !important;
}

/* Nav bar: crisp white with subtle shadow for separation */
html[data-theme="light"] .main-nav {
    background: hsla(0, 0%, 100%, 0.98) !important;
    border-bottom: 1px solid hsl(220, 13%, 88%) !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06) !important;
}

/* Nav items: dark text on white nav */
html[data-theme="light"] .main-nav .nav-item {
    color: hsl(215, 20%, 30%) !important;
}

html[data-theme="light"] .main-nav .nav-item:hover {
    background: hsla(199, 89%, 42%, 0.06) !important;
    color: hsl(199, 89%, 32%) !important;
}

html[data-theme="light"] .main-nav .nav-item.active {
    color: hsl(199, 89%, 32%) !important;
    border-bottom-color: hsl(199, 89%, 40%) !important;
}

html[data-theme="light"] .main-nav .nav-item i {
    color: inherit !important;
}

/* Back-to-home / context switcher: darker text */
html[data-theme="light"] .main-nav .nav-item.back-to-home {
    background: hsl(220, 14%, 96%) !important;
    color: hsl(215, 20%, 40%) !important;
    border: 1px solid hsl(220, 13%, 88%) !important;
}

html[data-theme="light"] .main-nav .nav-item.back-to-home:hover {
    background: hsl(220, 14%, 92%) !important;
    color: hsl(215, 20%, 25%) !important;
}

/* Page body: subtle cool grey for contrast against white cards */
html[data-theme="light"] .main-wrapper {
    background: hsl(220, 20%, 96%) !important;
}

/* Stat cards: white with visible border + subtle shadow */
html[data-theme="light"] .new-stat-card {
    background: #fff !important;
    border: 1px solid hsl(220, 13%, 85%) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

/* Dashboard cards: same treatment */
html[data-theme="light"] .dashboard-card {
    background: #fff !important;
    border: 1px solid hsl(220, 13%, 85%) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

/* Compact stat cards (options page) */
html[data-theme="light"] .compact-stat-card {
    background: #fff !important;
    border: 1px solid hsl(220, 13%, 85%) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

/* General .card override for content cards */
html[data-theme="light"] .card {
    background: #fff !important;
    border: 1px solid hsl(220, 13%, 85%) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

/* Market pulse sidebar cards */
html[data-theme="light"] .market-pulse-card {
    background: #fff !important;
    border: 1px solid hsl(220, 13%, 85%) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

/* Onboarding card */
html[data-theme="light"] .onboarding-card {
    background: #fff !important;
    border: 1px solid hsl(199, 89%, 80%) !important;
    border-left: 4px solid hsl(199, 89%, 42%) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

/* Dropdown menus: white with strong shadow for depth */
html[data-theme="light"] .nav-dropdown-menu {
    background: #fff !important;
    border: 1px solid hsl(220, 13%, 85%) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15) !important;
}

html[data-theme="light"] .nav-dropdown-item {
    color: hsl(215, 20%, 30%) !important;
}

html[data-theme="light"] .nav-dropdown-item:hover {
    background: hsl(199, 89%, 96%) !important;
    color: hsl(199, 89%, 30%) !important;
}

html[data-theme="light"] .nav-dropdown-item i {
    color: hsl(215, 15%, 50%) !important;
}

html[data-theme="light"] .nav-dropdown-item:hover i {
    color: hsl(199, 89%, 35%) !important;
}

html[data-theme="light"] .nav-section-label {
    color: hsl(215, 15%, 55%) !important;
}

/* Bottom tab bar: white with upward shadow */
html[data-theme="light"] .bottom-tab-bar {
    background: #fff !important;
    border: 1px solid hsl(220, 13%, 88%) !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1) !important;
}

html[data-theme="light"] .bottom-tab-bar a.bottom-tab-item {
    color: hsl(215, 15%, 50%) !important;
}

html[data-theme="light"] .bottom-tab-bar a.bottom-tab-item:hover {
    color: hsl(215, 20%, 25%) !important;
    background: hsl(220, 14%, 96%) !important;
}

html[data-theme="light"] .bottom-tab-bar a.bottom-tab-item.active {
    background: hsl(199, 89%, 42%) !important;
    color: #fff !important;
}

/* Header gradient (page title area) */
html[data-theme="light"] .header-gradient {
    border-bottom-color: hsl(220, 13%, 88%) !important;
}

html[data-theme="light"] .header-gradient h1 {
    color: hsl(222, 47%, 11%) !important;
}

html[data-theme="light"] .header-gradient p {
    color: hsl(215, 20%, 45%) !important;
}

/* User menu dropdown */
html[data-theme="light"] .user-menu-dropdown {
    background: #fff !important;
    border: 1px solid hsl(220, 13%, 85%) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15) !important;
}

/* Position mini cards */
html[data-theme="light"] .position-mini-card {
    background: hsl(220, 14%, 98%) !important;
    border: 1px solid hsl(220, 13%, 88%) !important;
}

html[data-theme="light"] .position-mini-card:hover {
    border-color: hsl(199, 89%, 45%) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

/* Theme toggle: show moon icon darker when on light mode */
html[data-theme="light"] #themeToggleBtn i {
    color: hsla(0, 0%, 100%, 0.95) !important;
}

/* Help menu button */
html[data-theme="light"] #helpMenuBtn i {
    color: hsla(0, 0%, 100%, 0.95) !important;
}

/* Bridge options template CSS variables to theme system */
/* Options templates use --text-primary, --border-color etc. (no --tb- prefix)
   which are undefined and inherit dark theme defaults. Map them for light mode. */
html[data-theme="light"] .options-dashboard,
html[data-theme="light"] .alpaca-dashboard,
html[data-theme="light"] .options-content {
    --text-primary: hsl(222, 47%, 11%);
    --text-secondary: hsl(215, 20%, 35%);
    --text-muted: hsl(215, 15%, 55%);
    --border-color: hsl(220, 13%, 85%);
    --card-bg: #fff;
    --bg-primary: hsl(220, 20%, 96%);
    --bg-secondary: hsl(220, 14%, 98%);
    --bg-tertiary: hsl(220, 14%, 93%);
    --accent-primary: hsl(199, 89%, 42%);
}

/* Options btn-outline: explicit dark text in light mode */
html[data-theme="light"] .btn-outline {
    color: hsl(215, 20%, 30%) !important;
    border-color: hsl(220, 13%, 80%) !important;
}

html[data-theme="light"] .btn-outline:hover {
    background: hsl(220, 14%, 93%) !important;
    color: hsl(199, 89%, 32%) !important;
}

/* Options page headers (Current Positions, Whale Tracking, etc.) */
html[data-theme="light"] .content-card .card-header h2,
html[data-theme="light"] .page-title {
    color: hsl(222, 47%, 11%) !important;
}

/* Options summary cards in light mode */
html[data-theme="light"] .summary-card {
    background: #fff !important;
    border-color: hsl(220, 13%, 85%) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

html[data-theme="light"] .summary-card .card-label {
    color: hsl(215, 15%, 50%) !important;
}

html[data-theme="light"] .summary-card .card-value {
    color: hsl(222, 47%, 11%) !important;
}

/* Options content cards */
html[data-theme="light"] .content-card {
    background: #fff !important;
    border-color: hsl(220, 13%, 85%) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

/* Options action cards */
html[data-theme="light"] .action-card {
    background: #fff !important;
    border-color: hsl(220, 13%, 85%) !important;
    color: hsl(222, 47%, 11%) !important;
}

html[data-theme="light"] .action-card:hover {
    border-color: hsl(199, 89%, 45%) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="light"] .action-card h3 {
    color: hsl(222, 47%, 11%) !important;
}

html[data-theme="light"] .action-card p {
    color: hsl(215, 20%, 45%) !important;
}

/* Options positions table */
html[data-theme="light"] .positions-table th {
    color: hsl(215, 15%, 50%) !important;
    border-color: hsl(220, 13%, 88%) !important;
}

html[data-theme="light"] .positions-table td {
    color: hsl(222, 47%, 11%) !important;
    border-color: hsl(220, 13%, 92%) !important;
}

/* AI budget widget in dark header */
html[data-theme="light"] .ai-budget-widget {
    color: hsla(0, 0%, 100%, 0.9) !important;
}

html[data-theme="light"] .ai-budget-widget .budget-label,
html[data-theme="light"] .ai-budget-widget .budget-value {
    color: hsla(0, 0%, 100%, 0.9) !important;
}

html[data-theme="light"] .ai-budget-widget .budget-icon {
    color: hsla(0, 0%, 100%, 0.8) !important;
}

html[data-theme="light"] .ai-budget-widget .budget-bar {
    background: hsla(0, 0%, 100%, 0.2) !important;
}

/* Notification bell */
html[data-theme="light"] .notification-bell,
html[data-theme="light"] .top-header-right .bi-bell {
    color: hsla(0, 0%, 100%, 0.9) !important;
}
