/* ================================================================
   FANDO — Dark-Theme Dashboard Styles
   ================================================================ */

:root {
    /* Palette */
    --bg-primary:     #0a0e17;
    --bg-secondary:   #111827;
    --bg-card:        rgba(17, 24, 39, 0.65);
    --bg-card-hover:  rgba(30, 41, 59, 0.8);
    --border:         rgba(99, 102, 241, 0.15);
    --border-glow:    rgba(99, 102, 241, 0.35);

    --text-primary:   #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted:     #64748b;

    --accent:         #818cf8;
    --accent-bright:  #a5b4fc;
    --green:          #34d399;
    --green-dim:      rgba(52, 211, 153, 0.15);
    --red:            #f87171;
    --red-dim:        rgba(248, 113, 113, 0.15);
    --orange:         #fb923c;
    --orange-dim:     rgba(251, 146, 60, 0.15);
    --yellow:         #fbbf24;

    /* Spacing */
    --gap:  1rem;
    --radius: 14px;
    --radius-sm: 8px;
}

body.light-theme {
    --bg-primary:     #f8fafc;
    --bg-secondary:   #ffffff;
    --bg-card:        rgba(255, 255, 255, 0.88);
    --bg-card-hover:  #f1f5f9;
    --border:         rgba(99, 102, 241, 0.25);
    --border-glow:    rgba(99, 102, 241, 0.45);

    --text-primary:   #0f172a;
    --text-secondary: #334155;
    --text-muted:     #64748b;

    --accent:         #4f46e5;
    --accent-bright:  #4338ca;
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99,102,241,0.08), transparent);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;

    /* Subtle animated gradient behind everything */
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99,102,241,0.12), transparent),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(52,211,153,0.08), transparent);
}

/* ── Row 1: Top Market Ticker Strip ──────────────────── */
.top-ticker-strip {
    background: #060911;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.35rem 1.5rem;
    font-size: 0.72rem;
    font-weight: 600;
    overflow-x: auto;
    white-space: nowrap;
}

body.light-theme .top-ticker-strip {
    background: #f1f5f9;
    border-bottom: 1px solid #cbd5e1;
    color: #0f172a;
}

.ticker-container {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.ticker-item {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    padding: 2px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.ticker-item.ticker-clickable {
    cursor: pointer;
    user-select: none;
}

.ticker-item.ticker-clickable:hover {
    background: rgba(56, 189, 248, 0.14);
    border-color: rgba(56, 189, 248, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.ticker-item.ticker-clicked {
    transform: scale(0.95) !important;
}

.ticker-item.active-ticker {
    background: rgba(14, 165, 233, 0.25);
    border-color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.45);
}

.ticker-item.active-ticker .ticker-label {
    color: #38bdf8;
    font-weight: 700;
}

.ticker-item.active-ticker .ticker-price {
    color: #ffffff;
    font-weight: 800;
}

body.light-theme .ticker-item {
    background: #ffffff;
    border: 1px solid #cbd5e1;
}

body.light-theme .ticker-item.ticker-clickable:hover {
    background: #f0f9ff;
    border-color: #0284c7;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(2, 132, 199, 0.15);
}

body.light-theme .ticker-item.active-ticker {
    background: #e0f2fe;
    border-color: #0284c7;
    box-shadow: 0 0 10px rgba(2, 132, 199, 0.3);
}

body.light-theme .ticker-item.active-ticker .ticker-label {
    color: #0284c7;
    font-weight: 700;
}

body.light-theme .ticker-item.active-ticker .ticker-price {
    color: #0f172a;
    font-weight: 800;
}

.ticker-dot {
    font-size: 0.65rem;
}

.ticker-label {
    color: var(--text-muted);
}

.ticker-price {
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 4px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

@keyframes tickerFlashGreen {
    0% { background: rgba(34, 197, 94, 0.4); color: #16a34a !important; }
    100% { background: transparent; }
}

@keyframes tickerFlashRed {
    0% { background: rgba(239, 68, 68, 0.4); color: #dc2626 !important; }
    100% { background: transparent; }
}

.ticker-price.flash-green {
    animation: tickerFlashGreen 0.7s ease-out;
}

.ticker-price.flash-red {
    animation: tickerFlashRed 0.7s ease-out;
}

/* ── Row 2: Unified Header ────────────────────────────── */
header.global-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1.5rem;
    background: rgba(10, 14, 23, 0.95);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

body.light-theme header.global-header {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.brand-group {
    display: flex;
    flex-direction: column;
}

.brand-group h1 {
    font-size: 1.25rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent-bright), var(--green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
    line-height: 1;
}

.brand-group .sub-logo {
    font-size: 0.62rem;
    color: var(--text-muted);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    font-weight: 700;
    margin-top: 2px;
}

.btn-theme-toggle {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-glow);
    font-size: 0.75rem;
    padding: 4px 12px;
    cursor: pointer;
    border-radius: 20px;
    font-weight: 700;
    transition: all 0.2s ease;
}

.btn-theme-toggle:hover {
    background: var(--accent);
    color: #ffffff;
}

/* ── Navigation Links ────────────────────────────────── */
.app-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: rgba(99, 102, 241, 0.12);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent-bright);
    border: 1px solid rgba(99, 102, 241, 0.4);
}

/* ── Light Theme Variables ────────────────────────────── */
body.light-theme {
    --bg-primary:     #f8fafc;
    --bg-secondary:   #ffffff;
    --bg-card:        #ffffff;
    --bg-card-hover:  #f1f5f9;
    --border:         #e2e8f0;
    --border-glow:    #cbd5e1;

    --text-primary:   #0f172a;
    --text-secondary: #334155;
    --text-muted:     #64748b;

    --accent:         #4f46e5;
    --accent-bright:  #4338ca;
}

.sub-controls-left, .sub-controls-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-left h1 {
    font-size: 1.35rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-bright), var(--green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.header-left .subtitle {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-top: -2px;
}

.header-center {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.asset-control-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(17, 24, 39, 0.8);
    padding: 0.35rem 0.6rem;
    border-radius: 12px;
    border: 1px solid var(--border-glow);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.category-tabs {
    display: flex;
    gap: 3px;
    background: rgba(10, 14, 23, 0.6);
    padding: 2px;
    border-radius: 8px;
}

.cat-tab {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.cat-tab:hover {
    color: var(--accent-bright);
}

.cat-tab.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 8px rgba(129, 140, 248, 0.4);
}

.select-wrapper {
    position: relative;
}

.asset-dropdown {
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 800;
    color: #fff;
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid var(--accent);
    padding: 0.35rem 1rem 0.35rem 0.6rem;
    border-radius: 8px;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
}

.asset-dropdown:hover, .asset-dropdown:focus {
    border-color: var(--green);
    box-shadow: 0 0 14px rgba(52, 211, 153, 0.35);
}

.asset-dropdown optgroup {
    background: #0f172a;
    color: var(--accent-bright);
    font-weight: 700;
}

.asset-dropdown option {
    background: #0f172a;
    color: #f1f5f9;
    font-weight: 600;
    padding: 6px;
}

.market-status-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(17, 24, 39, 0.7);
    padding: 0.3rem 0.6rem;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.status-badge {
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent-bright);
    letter-spacing: 0.5px;
}

.operating-hours {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    color: var(--text-muted);
}

.spot-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(17, 24, 39, 0.8);
    padding: 0.3rem 0.7rem;
    border-radius: 10px;
    border: 1px solid var(--border-glow);
}

.spot-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.spot-top .label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.spot-top .price {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
}

.spot-ohlc {
    display: flex;
    gap: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-top: 1px;
}

.spot-ohlc b {
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.date-clock-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.current-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--accent-bright);
    letter-spacing: 1px;
}

.clock {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.status-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    transition: background 0.3s;
}
.status-dot.connected    { background: var(--green); box-shadow: 0 0 8px var(--green); }
.status-dot.disconnected { background: var(--red);   box-shadow: 0 0 8px var(--red);   }

.clock {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ── Main Grid ───────────────────────────────────────── */
#main-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 340px;
    grid-template-rows: 1fr auto;
    gap: var(--gap);
    padding: var(--gap);
}

#chain-section  { grid-column: 1; grid-row: 1 / 3; }
#signals-section { grid-column: 2; grid-row: 1; }
#heatmap-section { grid-column: 2; grid-row: 2; }

/* ── Glass Cards ─────────────────────────────────────── */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.3s;
}
.glass-card:hover {
    border-color: var(--border-glow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--accent);
    color: #fff;
}

/* ── Search Strike Input & Header Controls ── */
.chain-header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-left: auto;
}

.chain-search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.chain-search-icon {
    position: absolute;
    left: 12px;
    font-size: 0.85rem;
    pointer-events: none;
    opacity: 0.75;
}

.chain-search-input {
    background: rgba(15, 23, 42, 0.85);
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    padding: 6px 30px 6px 34px;
    font-size: 0.82rem;
    color: #f8fafc;
    outline: none;
    width: 220px;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.chain-search-input::placeholder {
    color: #94a3b8;
    font-weight: 500;
}

.chain-search-input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.chain-search-clear-btn {
    position: absolute;
    right: 10px;
    background: #cbd5e1;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    color: #334155;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.15s ease;
}

.chain-search-clear-btn:hover {
    background: #ef4444;
    color: #ffffff;
}

/* Light Theme: Highly visible search strike box */
body.light-theme .chain-search-input {
    background: #ffffff !important;
    border: 1.5px solid #94a3b8 !important;
    color: #0f172a !important;
    font-weight: 600 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05) !important;
}

body.light-theme .chain-search-input::placeholder {
    color: #64748b !important;
    font-weight: 500 !important;
}

body.light-theme .chain-search-input:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18), 0 2px 6px rgba(0, 0, 0, 0.06) !important;
    background: #ffffff !important;
}

/* ── Premium High-Contrast Option Chain Filter Pills (All | CE | PE) ── */
.chain-filter-pillbox {
    display: inline-flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.85);
    padding: 4px;
    border-radius: 24px;
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.25);
    gap: 4px;
}

body.light-theme .chain-filter-pillbox {
    background: #e2e8f0 !important;
    border: 1.5px solid #cbd5e1 !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06) !important;
    padding: 4px !important;
}

.chain-filter-btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.80rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid transparent;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.2px;
}

body.light-theme .chain-filter-btn {
    color: #64748b !important;
    font-weight: 600 !important;
    background: transparent !important;
    border-color: transparent !important;
}

.chain-filter-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

body.light-theme .chain-filter-btn:hover {
    color: #0f172a !important;
    background: rgba(255, 255, 255, 0.7) !important;
}

/* ── SELECTED / ACTIVE BUTTON (PROPER CLEAN WHITE IN LIGHT THEME) ── */
.chain-filter-btn.active {
    color: #ffffff;
    background: #1e293b;
    border: 1.5px solid #38bdf8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    font-weight: 800;
}

body.light-theme .chain-filter-btn.active {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1.5px solid #94a3b8 !important;
    font-weight: 800 !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

/* Count Badge styling */
.count-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    display: inline-block;
    line-height: 1.2;
}

body.light-theme .count-badge {
    background: #cbd5e1;
    color: #334155;
}

body.light-theme .chain-filter-btn.active .count-badge {
    background: #0f172a !important;
    color: #ffffff !important;
}

body.light-theme .chain-filter-btn.btn-ce.active .count-badge {
    background: #16a34a !important;
    color: #ffffff !important;
}

body.light-theme .chain-filter-btn.btn-pe.active .count-badge {
    background: #dc2626 !important;
    color: #ffffff !important;
}

body.light-theme .chain-filter-btn.btn-ce.active {
    background: #ffffff !important;
    color: #16a34a !important;
    border: 1.5px solid #86efac !important;
    box-shadow: 0 3px 10px rgba(22, 163, 74, 0.15), 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

body.light-theme .chain-filter-btn.btn-pe.active {
    background: #ffffff !important;
    color: #dc2626 !important;
    border: 1.5px solid #fca5a5 !important;
    box-shadow: 0 3px 10px rgba(220, 38, 38, 0.15), 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

/* ── Timeframe & Chart Toolbar Buttons ────────────────── */
.tf-buttons {
    display: flex;
    gap: 3px;
    align-items: center;
    background: rgba(15, 23, 42, 0.7);
    padding: 3px 6px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.tf-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}
.tf-label.scalp-label { color: #94a3b8; margin-right: 2px; }
.tf-label.swing-label { color: #a78bfa; margin-left: 6px; margin-right: 2px; }

.tf-btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.tf-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.tf-btn.active {
    background: #3b82f6;
    color: #ffffff;
    font-weight: 700;
    border-color: #60a5fa;
    box-shadow: 0 1px 4px rgba(59, 130, 246, 0.4);
}

/* S/R Toggle Button */
.btn-sr-toggle {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(100, 116, 139, 0.15);
    border: 1px solid rgba(100, 116, 139, 0.35);
    color: #94a3b8;
}

.btn-sr-toggle:hover {
    background: rgba(100, 116, 139, 0.25);
    color: #f1f5f9;
}

.btn-sr-toggle.active {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.6);
    color: #60a5fa;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.25);
}

/* FX Indicators Button */
.btn-fx-indicators {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.5);
    color: #d8b4fe;
}

.btn-fx-indicators:hover {
    background: #a855f7;
    border-color: #a855f7;
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(168, 85, 247, 0.4);
}

/* Toggle Chart Button */
.btn-toggle-chart {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.btn-toggle-chart:hover {
    background: rgba(51, 65, 85, 0.9);
    color: #fff;
}

/* ── Table ────────────────────────────────────────────── */
.table-wrap {
    flex: 1;
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
}

thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 0.6rem 0.75rem;
    text-align: right;
    font-weight: 700;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}
thead th:first-child { text-align: left; }
thead th:nth-child(2) { text-align: center; }

tbody tr {
    transition: background 0.15s;
}
tbody tr:hover {
    background: var(--bg-card-hover);
}

tbody td {
    padding: 0.55rem 0.75rem;
    text-align: right;
    border-bottom: 1px solid rgba(99,102,241,0.06);
    white-space: nowrap;
}
tbody td:first-child { text-align: left; font-weight: 600; }
tbody td:nth-child(2) { text-align: center; }

.empty-state {
    text-align: center !important;
    color: var(--text-muted);
    padding: 3rem !important;
    font-family: 'Inter', sans-serif;
    font-style: italic;
}

/* Cell colors */
.cell-green { color: var(--green); }
.cell-red   { color: var(--red); }
.cell-orange { color: var(--orange); }

/* Type badges */
.type-ce {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.7rem;
    background: var(--green-dim);
    color: var(--green);
}
.type-pe {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.7rem;
    background: var(--red-dim);
    color: var(--red);
}

/* Score pill */
.score-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.75rem;
}
.score-hot    { background: rgba(248,113,113,0.2); color: var(--red); }
.score-warm   { background: var(--orange-dim); color: var(--orange); }
.score-cool   { background: rgba(99,102,241,0.15); color: var(--accent); }
.score-cold   { color: var(--text-muted); }

/* Row flash animation */
@keyframes row-flash {
    0%   { background: rgba(99,102,241,0.2); }
    100% { background: transparent; }
}
.row-updated {
    animation: row-flash 0.6s ease-out;
}

/* ── Signals List ────────────────────────────────────── */
.signals-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ── Live Signal Cards & Badges (Default Dark Theme) ── */
.signal-card {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 8px 10px;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 5px;
    box-sizing: border-box;
    overflow: hidden;
    width: 100%;
}
.signal-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

/* 1. Header: Direction, Strategy, Chart */
.sig-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    width: 100%;
}
.sig-header-tags {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    min-width: 0;
}

/* 2. Full-Width Symbol & Live PnL Row */
.sig-symbol-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: 1px;
}
.sig-sym {
    color: #f8fafc;
    font-size: 0.76rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0;
    min-width: 0;
}
.sig-pnl-wrap {
    flex-shrink: 0;
}
.sig-pnl-pill {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.67rem;
    font-weight: 800;
    padding: 1.5px 6px;
    border-radius: 4px;
    white-space: nowrap;
    letter-spacing: -0.2px;
}

/* 3. Unified Metrics Bar: Status, Surety, Score & Time */
.sig-metrics-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    width: 100%;
}
.sig-metric-chips {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.sig-chip {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.63rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 4px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.sig-chip.chip-surety {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.35);
}
.sig-chip.chip-score.score-hot {
    background: rgba(245, 158, 11, 0.18);
    color: #fde68a;
    border: 1px solid rgba(245, 158, 11, 0.45);
}
.sig-chip.chip-score.score-warm {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.sig-timing-chip {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.04);
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.sig-badge {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 4px;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.sig-type.buy {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    font-weight: 800;
}

.sig-type.sell {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    font-weight: 800;
}

/* ── Strategy Badge Styles (Signal Card) ── */
.sig-strat-badge {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    white-space: nowrap;
}

.strat-stockowl {
    background: rgba(168, 85, 247, 0.22);
    color: #e9d5ff;
    border: 1px solid rgba(168, 85, 247, 0.7);
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.35);
}

.strat-hero-zero {
    background: rgba(236, 72, 153, 0.2);
    color: #fbcfe8;
    border: 1px solid rgba(236, 72, 153, 0.7);
    box-shadow: 0 0 10px rgba(236, 72, 153, 0.3);
}

.strat-momentum {
    background: rgba(245, 158, 11, 0.2);
    color: #fde68a;
    border: 1px solid rgba(245, 158, 11, 0.6);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.25);
}

.strat-reversal {
    background: rgba(6, 182, 212, 0.18);
    color: #a5f3fc;
    border: 1px solid rgba(6, 182, 212, 0.6);
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.25);
}

.strat-breakout {
    background: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.6);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.25);
}

.strat-scalp {
    background: rgba(16, 185, 129, 0.18);
    color: #a7f3d0;
    border: 1px solid rgba(16, 185, 129, 0.6);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.25);
}

.strat-vwap {
    background: rgba(59, 130, 246, 0.18);
    color: #bfdbfe;
    border: 1px solid rgba(59, 130, 246, 0.6);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.25);
}

.strat-orb {
    background: rgba(251, 191, 36, 0.18);
    color: #fef3c7;
    border: 1px solid rgba(251, 191, 36, 0.6);
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.25);
}

.strat-default {
    background: rgba(99, 102, 241, 0.15);
    color: #c7d2fe;
    border: 1px solid rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 6px rgba(99, 102, 241, 0.2);
}

.sig-sym {
    color: #f8fafc;
    font-size: 0.84rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
    display: inline-block;
    letter-spacing: 0.2px;
}

.sig-surety-badge {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.max-profit-badge {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.22), rgba(16, 185, 129, 0.25));
    color: #ffe600;
    border: 1px solid rgba(255, 215, 0, 0.55);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.25);
    font-weight: 800;
    letter-spacing: 0.4px;
    animation: maxProfitPulse 2.5s infinite ease-in-out;
}

@keyframes maxProfitPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(255, 215, 0, 0.25); border-color: rgba(255, 215, 0, 0.45); }
    50% { box-shadow: 0 0 16px rgba(255, 215, 0, 0.6); border-color: rgba(255, 215, 0, 0.85); }
}

.sig-chart-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.sig-chart-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
}

.sig-score-badge {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    font-size: 0.7rem;
    padding: 2px 6px;
}
.sig-score-badge.score-hot {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.sig-score-badge.score-warm {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.sig-pnl-pill {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 5px;
    white-space: nowrap;
    letter-spacing: -0.2px;
}
.sig-pnl-pill.pnl-green {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.sig-pnl-pill.pnl-red {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.sig-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    width: 100%;
}
.sig-meta-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    min-width: 0;
    flex: 1;
}

.sig-status-badge {
    font-size: 0.67rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    letter-spacing: 0.2px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.sig-status-badge.status-active {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.sig-status-badge.status-tp1 {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.sig-status-badge.status-tp2 {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.sig-status-badge.status-tp3 {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.sig-status-badge.status-tp4 {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.sig-status-badge.status-tp5 {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.sig-status-badge.status-t6 {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: none;
}
.sig-status-badge.status-trailed-exit {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.sig-status-badge.status-sl {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.sig-time-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.04);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}
.dot-sep {
    color: #64748b;
    font-size: 0.6rem;
}

.sig-lot-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.67rem;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.03);
    padding: 3px 7px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    box-sizing: border-box;
}
.sig-lot-strip b {
    color: #e2e8f0;
}

/* 6-Tier Target Ladder UI Hidden per user request */
.sig-ladder-container {
    display: none !important;
}

.sig-progress-box {
    margin: 2px 0;
    width: 100%;
}
.sig-progress-track {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}
.sig-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, rgba(248,180,180,0.5) 0%, rgba(191,219,254,0.5) 40%, rgba(167,243,208,0.5) 100%);
    border-radius: 3px;
    transition: width 0.4s ease;
}
.sig-progress-labels {
    display: flex;
    justify-content: space-between;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    margin-top: 3px;
}
.sig-progress-labels .prog-sl { color: #ffffff; font-weight: 700; }
.sig-progress-labels .prog-ltp { color: #ffffff; font-weight: 800; }
.sig-progress-labels .prog-t1 { color: #ffffff; font-weight: 700; }

.sig-levels {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-top: 2px;
    width: 100%;
    box-sizing: border-box;
}
.sig-levels .level {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px 2px;
    border-radius: 6px;
    text-align: center;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}
.sig-levels .level .lvl-label {
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    line-height: 1;
    margin-bottom: 2px;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    display: block;
}
.sig-levels .level .lvl-val {
    font-size: 0.74rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -0.2px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    display: block;
}

.sig-levels .level.entry {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.sig-levels .level.entry .lvl-label { color: rgba(255, 255, 255, 0.6); }
.sig-levels .level.entry .lvl-val { color: #ffffff; }

.sig-levels .level.target {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.sig-levels .level.target .lvl-label { color: rgba(255, 255, 255, 0.6); }
.sig-levels .level.target .lvl-val { color: #ffffff; }

.sig-levels .level.target.t2 {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.sig-levels .level.target.t2 .lvl-label { color: rgba(255, 255, 255, 0.6); }
.sig-levels .level.target.t2 .lvl-val { color: #ffffff; }

.sig-levels .level.sl {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.sig-levels .level.sl .lvl-label { color: rgba(255, 255, 255, 0.6); }
.sig-levels .level.sl .lvl-val { color: #ffffff; }

.sig-levels .level.level-trailed {
    background: rgba(16, 185, 129, 0.18);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.55);
}
.sig-levels .level.level-trailed .lvl-label { color: #34d399; font-weight: 800; }
.sig-levels .level.level-trailed .lvl-val { color: #a7f3d0; font-weight: 800; }

.sig-action-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    padding: 3px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    width: 100%;
    box-sizing: border-box;
    margin-top: 1px;
}
.sig-footer-status {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.68rem;
    font-family: 'JetBrains Mono', monospace;
}
.sig-lock-pill {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.5);
    color: #6ee7b7;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    display: inline-block;
}
.sig-lock-pill b {
    color: #a7f3d0;
}
.sig-milestone-pill {
    color: #cbd5e1;
    font-size: 0.68rem;
}
.sig-milestone-pill b {
    color: #f1f5f9;
}
.btn-quick-buy {
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    white-space: nowrap;
    flex-shrink: 0;
}
.btn-quick-buy.buy-action {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(5, 150, 105, 0.25));
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.55);
}
.btn-quick-buy.buy-action:hover {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.45);
    transform: translateY(-1px);
}
.btn-quick-buy.sell-action {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.16), rgba(220, 38, 38, 0.25));
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.55);
}
.btn-quick-buy.sell-action:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.45);
    transform: translateY(-1px);
}

body.light-theme .btn-quick-buy.buy-action {
    color: #047857 !important;
    background: #ecfdf5 !important;
    border: 1px solid #10b981 !important;
}
body.light-theme .btn-quick-buy.buy-action:hover {
    color: #ffffff !important;
    background: #059669 !important;
}
body.light-theme .btn-quick-buy.sell-action {
    color: #b91c1c !important;
    background: #fef2f2 !important;
    border: 1px solid #ef4444 !important;
}
body.light-theme .btn-quick-buy.sell-action:hover {
    color: #ffffff !important;
    background: #dc2626 !important;
}

.date-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.72rem;
    color: #f8fafc;
    outline: none;
}
body.light-theme .date-input {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

/* Signal entry animation */
@keyframes signal-in {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}
.signal-card {
    animation: signal-in 0.35s ease-out;
}

.sig-closed-tag {
    color: #ffffff;
    font-weight: 700;
    font-size: 0.65rem;
}
.live-sig-timer {
    color: #ffffff;
    font-weight: 700;
    font-size: 0.65rem;
}
.sig-footer-milestone {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.68rem;
}
.sig-footer-milestone b {
    color: #ffffff;
}

/* ── Heatmap ─────────────────────────────────────────── */
.heatmap-grid {
    padding: 0.75rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 0.4rem;
    overflow-y: auto;
    max-height: 280px;
}

.heatmap-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 4px;
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 600;
    transition: transform 0.15s;
    cursor: default;
}
.heatmap-cell:hover { transform: scale(1.08); }

.heatmap-cell .hm-strike { font-weight: 700; font-size: 0.7rem; }
.heatmap-cell .hm-score  { font-size: 0.72rem; margin-top: 2px; }

/* ── Footer ──────────────────────────────────────────── */
footer {
    text-align: center;
    padding: 0.6rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 900px) {
    #main-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        padding: 8px;
        gap: 8px;
    }
    #chain-section   { grid-column: 1; grid-row: 1; }
    #signals-section { grid-column: 1; grid-row: 2; }
    #heatmap-section { grid-column: 1; grid-row: 3; }
    .signal-card {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .sig-symbol-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .sig-sym {
        font-size: 0.78rem;
    }
    .sig-metrics-bar {
        gap: 4px;
    }
    .sig-levels {
        gap: 3px;
    }
    .sig-levels .level .lvl-val {
        font-size: 0.68rem;
    }
    .sig-action-footer {
        flex-wrap: wrap;
        gap: 6px;
    }
    .sig-footer-status {
        width: 100%;
    }
    .btn-quick-buy {
        width: 100%;
        text-align: center;
        padding: 6px 12px;
    }
}

/* ── Scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,0.5); }

/* ── App Multi-Page Navigation ───────────────────────── */
.app-nav {
    display: flex;
    gap: 4px;
    margin-left: 1rem;
    background: rgba(17, 24, 39, 0.7);
    padding: 3px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-item:hover {
    color: var(--accent-bright);
}

.nav-item.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 10px rgba(129, 140, 248, 0.4);
}

/* ── Multi-Page Container & Cards ────────────────────── */
.page-container {
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.page-card {
    padding: 1.25rem;
}

.page-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.journal-filters {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    background: rgba(17, 24, 39, 0.5);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.btn-primary {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: var(--accent-bright);
    box-shadow: 0 0 14px rgba(129, 140, 248, 0.5);
}

.btn-secondary {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    background: rgba(30, 41, 59, 0.9);
    color: var(--accent-bright);
    border: 1px solid var(--accent);
    padding: 0.45rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    border-color: var(--green);
    color: var(--green);
}

/* ── Stats Grid ──────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.stat-card {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    border-left: 4px solid var(--accent);
}

.stat-title {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.8rem;
    font-weight: 800;
}

.stat-sub {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.purple-text { color: var(--accent-bright); }
.cyan-text   { color: #38bdf8; }
.white-text  { color: #fff; }
.margin-top  { margin-top: 1rem; }
.ts-cell     { font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; color: var(--text-muted); }
.bold-cell   { font-weight: 700; color: #fff; }
.small-text  { font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; color: var(--text-secondary); }

/* ── Global Interactive Chart Focus Modal ──────────────── */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.modal-card {
    width: 90vw;
    max-width: 950px;
    background: rgba(17, 24, 39, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0.5rem;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #f3f4f6;
}

.modal-chart-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    padding: 7px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin: 4px 0 10px 0;
}
body.light-theme .modal-chart-legend {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}

.legend-ticker-title {
    font-weight: 800;
    color: #38bdf8;
}
body.light-theme .legend-ticker-title {
    color: #0284c7 !important;
}

.legend-values-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.legend-values-wrap span {
    color: #94a3b8;
}
body.light-theme .legend-values-wrap span {
    color: #64748b !important;
}
.legend-values-wrap b {
    color: #f1f5f9;
}
body.light-theme .legend-values-wrap b {
    color: #0f172a !important;
}
.legend-sep {
    color: rgba(255, 255, 255, 0.2);
}
body.light-theme .legend-sep {
    color: #cbd5e1 !important;
}

/* ── Modal Indicator Toggle Buttons ────────────────── */
.modal-ind-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.modal-ind-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}
.modal-ind-btn.active {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}
body.light-theme .modal-ind-btn {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #64748b !important;
}
body.light-theme .modal-ind-btn:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}
body.light-theme .modal-ind-btn.active {
    background: #0f172a !important;
    border-color: #0f172a !important;
    color: #ffffff !important;
}

.modal-levels-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

.strike-cell-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.btn-strike-chart {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #a5b4fc;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-strike-chart:hover {
    background: rgba(99, 102, 241, 0.35);
    border-color: #818cf8;
    color: #ffffff;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

/* ================================================================
   Pine Script Indicator & Strategy Overlay Engine Styles
   ================================================================ */

/* Chart Overlay Legend Tags (Top-Left floating) */
.chart-overlay-legend {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    pointer-events: auto;
}

.legend-tag {
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.68rem;
    font-family: 'JetBrains Mono', monospace;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

.legend-tag:hover {
    border-color: rgba(168, 85, 247, 0.5);
}

.legend-tag .tag-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

.legend-tag .tag-val {
    font-weight: 700;
}

.legend-tag .tag-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.72rem;
    padding: 0 2px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.legend-tag .tag-btn:hover {
    opacity: 1;
    color: #f87171;
}

/* Strategy Performance Summary Bar (Bottom floating) */
.strategy-perf-bar {
    position: absolute;
    bottom: 8px;
    left: 10px;
    right: 10px;
    z-index: 20;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 8px;
    padding: 6px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    font-family: 'Inter', sans-serif;
    color: #f8fafc;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.strat-perf-metrics {
    display: flex;
    gap: 16px;
    align-items: center;
}

.strat-metric {
    display: flex;
    gap: 5px;
    align-items: center;
}

.strat-metric .lbl {
    color: #94a3b8;
    font-size: 0.68rem;
    text-transform: uppercase;
}

.strat-metric .val {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
}

/* Indicator Manager Modal Styles (Dark Theme Default) */
.ind-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ind-modal-card {
    width: 760px;
    max-width: 94vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    background: #0f172a;
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

.ind-modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(30, 41, 59, 0.6);
}

.ind-header-icon {
    background: rgba(168, 85, 247, 0.2);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    border: 1px solid rgba(168, 85, 247, 0.4);
}

.ind-modal-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #f8fafc;
    margin: 0;
}

.ind-modal-sub {
    font-size: 0.72rem;
    color: #94a3b8;
    margin: 2px 0 0 0;
}

.modal-close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.modal-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #f87171;
}

.ind-modal-tabs {
    display: flex;
    gap: 6px;
    padding: 0.6rem 1.25rem;
    background: rgba(15, 23, 42, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ind-tab-btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ind-tab-btn:hover {
    color: #f8fafc;
    background: rgba(255,255,255,0.05);
}

.ind-tab-btn.active {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.5);
    color: #c084fc;
}

.ind-modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
    background: #0b1120;
}

.ind-tab-pane {
    display: none;
}
.ind-tab-pane.active {
    display: block;
}

.ind-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.ind-card:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(168, 85, 247, 0.4);
}

.ind-card-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ind-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.ind-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #f8fafc;
}

.ind-desc {
    font-size: 0.68rem;
    color: #94a3b8;
    margin-top: 1px;
}

.btn-ind-action, .btn-strat-action {
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 6px;
    border: 1px solid rgba(168, 85, 247, 0.4);
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-ind-action:hover, .btn-strat-action:hover {
    background: #a855f7;
    color: #ffffff;
    border-color: #a855f7;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.4);
}

.btn-ind-action.active, .btn-strat-action.active {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #f87171;
}

.btn-ind-action.active:hover, .btn-strat-action.active:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

/* Pine Script Studio Box */
.pine-studio-box {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1rem;
}

.pine-studio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.pine-studio-title {
    color: #c084fc;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.pine-studio-desc {
    color: #94a3b8;
    font-size: 0.75rem;
}

.btn-upload-pine {
    background: rgba(168, 85, 247, 0.25);
    border: 1px solid rgba(168, 85, 247, 0.6);
    color: #e9d5ff;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}
.btn-upload-pine:hover {
    background: #a855f7;
    color: #ffffff;
}

.pine-field-label {
    display: block;
    font-size: 0.72rem;
    color: #cbd5e1;
    margin-bottom: 4px;
    font-weight: 600;
}

.pine-field-hint {
    font-size: 0.68rem;
    color: #a78bfa;
    font-style: italic;
}

.pine-input {
    width: 100%;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 7px 10px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.2s;
}
.pine-input:focus {
    border-color: #a855f7;
}

.pine-editor {
    width: 100%;
    height: 130px;
    background: #060911;
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #a78bfa;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    padding: 8px;
    border-radius: 8px;
    resize: vertical;
    outline: none;
}
.pine-editor:focus {
    border-color: #a855f7;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

/* ================================================================
   MASTER LIGHT THEME OVERRIDES (Full System Polish)
   ================================================================ */
body.light-theme {
    background-color: #f8fafc !important;
    background-image: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.05), transparent) !important;
    color: #0f172a !important;
}

body.light-theme * {
    border-color: #e2e8f0;
}

/* Row 1: Ticker Strip */
body.light-theme .top-ticker-strip {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
}
body.light-theme .ticker-item {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}
body.light-theme .ticker-item.macro-item {
    background: #eff6ff !important;
    border: 1px solid #bfdbfe !important;
}
body.light-theme .ticker-label {
    color: #64748b !important;
}
body.light-theme .ticker-price {
    color: #0f172a !important;
}

/* Row 2: Global Header & App Nav */
body.light-theme header.global-header,
body.light-theme header#header {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}
body.light-theme .brand-group h1,
body.light-theme #logo {
    color: #2563eb !important;
    background: linear-gradient(135deg, #2563eb, #059669) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}
body.light-theme .sub-logo {
    color: #64748b !important;
}

body.light-theme .app-nav {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
}
body.light-theme .nav-item {
    background: transparent !important;
    color: #475569 !important;
    border: 1px solid transparent !important;
}
body.light-theme .nav-item:hover {
    background: #ffffff !important;
    color: #0f172a !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
body.light-theme .nav-item.active {
    background: #ffffff !important;
    color: #2563eb !important;
    border: 1px solid #bfdbfe !important;
    font-weight: 700 !important;
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.15) !important;
}

/* Asset Selector & Category Tabs */
body.light-theme .asset-control-box {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03) !important;
}
body.light-theme .category-tabs {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
}
body.light-theme .cat-tab {
    background: transparent !important;
    color: #64748b !important;
}
body.light-theme .cat-tab:hover {
    color: #0f172a !important;
}
body.light-theme .cat-tab.active {
    background: #2563eb !important;
    color: #ffffff !important;
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.3) !important;
}
body.light-theme input,
body.light-theme textarea,
body.light-theme select,
body.light-theme .asset-dropdown {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
}
body.light-theme select optgroup,
body.light-theme select option {
    background: #ffffff !important;
    color: #0f172a !important;
}

/* Row 3 & Sub Header Controls */
body.light-theme .sub-header-controls {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
}
body.light-theme .market-status-box,
body.light-theme .spot-box,
body.light-theme .expiry-box,
body.light-theme .date-clock-box {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02) !important;
}
body.light-theme .status-badge {
    color: #059669 !important;
}
body.light-theme .operating-hours {
    color: #64748b !important;
}
body.light-theme .spot-top .price,
body.light-theme .clock,
body.light-theme .price,
body.light-theme b,
body.light-theme .value,
body.light-theme .stat-value,
body.light-theme .white-text,
body.light-theme .bold-cell {
    color: #0f172a !important;
}
body.light-theme .current-date {
    color: #2563eb !important;
}

/* Quick Intelligence Strip Cards */
body.light-theme .quick-intel-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03) !important;
}

/* Main Grid & Cards (Milky-White Clean Design - Zero Dark/Black Fills) */
body.light-theme .glass-card,
body.light-theme .page-card,
body.light-theme .stat-card,
body.light-theme .signal-card,
body.light-theme .card-header,
body.light-theme .wallet-card,
body.light-theme .modal-card,
body.light-theme .modal-wallet-card,
body.light-theme .modal-box,
body.light-theme .panel,
body.light-theme .desk-panel {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
    color: #0f172a !important;
}
body.light-theme .wallet-title,
body.light-theme .stat-title {
    color: #64748b !important;
    font-weight: 800 !important;
}
body.light-theme .wallet-val {
    color: #0f172a !important;
}
body.light-theme .card-header h2,
body.light-theme .card-header h3,
body.light-theme .card-title {
    color: #0f172a !important;
}

/* ── Light Theme Chart Toolbar & Buttons ── */
body.light-theme .tf-buttons {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
}
body.light-theme .tf-label.scalp-label {
    color: #475569 !important;
}
body.light-theme .tf-label.swing-label {
    color: #7c3aed !important;
}
body.light-theme .tf-btn {
    color: #475569 !important;
    background: transparent !important;
    border-color: transparent !important;
}
body.light-theme .tf-btn:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}
body.light-theme .tf-btn.active {
    background: #2563eb !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border-color: #2563eb !important;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3) !important;
}

body.light-theme .btn-sr-toggle {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
}
body.light-theme .btn-sr-toggle:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}
body.light-theme .btn-sr-toggle.active {
    background: #eff6ff !important;
    border: 1px solid #3b82f6 !important;
    color: #2563eb !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15) !important;
}

body.light-theme .btn-fx-indicators {
    background: #f5f3ff !important;
    border: 1px solid #ddd6fe !important;
    color: #7c3aed !important;
}
body.light-theme .btn-fx-indicators:hover {
    background: #7c3aed !important;
    border-color: #7c3aed !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25) !important;
}

body.light-theme .btn-toggle-chart,
body.light-theme .btn-theme-toggle,
body.light-theme .btn-secondary {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}
body.light-theme .btn-toggle-chart:hover,
body.light-theme .btn-theme-toggle:hover,
body.light-theme .btn-secondary:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}

body.light-theme #chart-vwap-legend {
    color: #7c3aed !important;
}
body.light-theme #chart-wrapper {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

/* Floating Chart Tags */
body.light-theme .legend-tag {
    background: rgba(255, 255, 255, 0.96) !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}
body.light-theme .strategy-perf-bar {
    background: #ffffff !important;
    border-color: #c084fc !important;
    color: #0f172a !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
}

/* Option Chain Table */
body.light-theme .filter-btn {
    background: #f8fafc !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
}
body.light-theme .filter-btn:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}
body.light-theme .filter-btn.active {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #2563eb !important;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3) !important;
}

body.light-theme table {
    background: #ffffff !important;
    color: #0f172a !important;
}
body.light-theme thead th {
    background: #f8fafc !important;
    color: #475569 !important;
    border-bottom: 2px solid #cbd5e1 !important;
}
body.light-theme tbody td {
    background: #ffffff !important;
    border-bottom: 1px solid #f1f5f9 !important;
    color: #1e293b !important;
}
body.light-theme tbody tr:hover td {
    background: #f8fafc !important;
}
body.light-theme .btn-strike-chart {
    background: #eff6ff !important;
    border: 1px solid #bfdbfe !important;
    color: #2563eb !important;
}
body.light-theme .btn-strike-chart:hover {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #2563eb !important;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3) !important;
}

/* ── Signal Cards & Heatmap (Light Theme Overrides) ── */
body.light-theme .signal-card {
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}
body.light-theme .signal-card:hover {
    border-color: #2563eb !important;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.12) !important;
}

body.light-theme .sig-type.buy {
    background: #059669 !important;
    color: #ffffff !important;
    box-shadow: 0 1px 4px rgba(5, 150, 105, 0.3) !important;
}
body.light-theme .sig-type.sell {
    background: #dc2626 !important;
    color: #ffffff !important;
    box-shadow: 0 1px 4px rgba(220, 38, 38, 0.3) !important;
}

body.light-theme .sig-strat-badge {
    font-weight: 800 !important;
    box-shadow: none !important;
}

body.light-theme .strat-stockowl {
    background: #f3e8ff !important;
    color: #7c3aed !important;
    border: 1px solid #c4b5fd !important;
}

body.light-theme .strat-hero-zero {
    background: #fce7f3 !important;
    color: #db2777 !important;
    border: 1px solid #f9a8d4 !important;
}

body.light-theme .strat-momentum {
    background: #fef3c7 !important;
    color: #b45309 !important;
    border: 1px solid #fcd34d !important;
}

body.light-theme .strat-reversal {
    background: #ecfeff !important;
    color: #0891b2 !important;
    border: 1px solid #67e8f9 !important;
}

body.light-theme .strat-breakout {
    background: #fef2f2 !important;
    color: #dc2626 !important;
    border: 1px solid #fca5a5 !important;
}

body.light-theme .strat-scalp {
    background: #ecfdf5 !important;
    color: #059669 !important;
    border: 1px solid #6ee7b7 !important;
}

body.light-theme .strat-vwap {
    background: #eff6ff !important;
    color: #2563eb !important;
    border: 1px solid #93c5fd !important;
}

body.light-theme .strat-orb {
    background: #fffbeb !important;
    color: #d97706 !important;
    border: 1px solid #fbbf24 !important;
}

body.light-theme .strat-default {
    background: #f5f3ff !important;
    color: #6d28d9 !important;
    border: 1px solid #c4b5fd !important;
}

body.light-theme .sig-surety-badge {
    background: #ecfdf5 !important;
    color: #047857 !important;
    border: 1px solid #6ee7b7 !important;
    font-weight: 800 !important;
}

body.light-theme .sig-chart-btn {
    background: #2563eb !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35) !important;
}
body.light-theme .sig-chart-btn:hover {
    background: #1d4ed8 !important;
}

body.light-theme .sig-score-badge.score-hot {
    background: #fef2f2 !important;
    color: #991b1b !important;
    border: 1px solid #fca5a5 !important;
    font-weight: 800 !important;
}
body.light-theme .sig-score-badge.score-warm {
    background: #fffbeb !important;
    color: #92400e !important;
    border: 1px solid #fde68a !important;
    font-weight: 800 !important;
}

body.light-theme .signal-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
}
body.light-theme .sig-sym {
    color: #0f172a !important;
    font-size: 0.76rem !important;
    font-weight: 800 !important;
}
body.light-theme .sig-chip.chip-surety {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    border: 1px solid #bfdbfe !important;
}
body.light-theme .sig-chip.chip-score.score-hot {
    background: #fef3c7 !important;
    color: #b45309 !important;
    border: 1px solid #fde68a !important;
}
body.light-theme .sig-chip.chip-score.score-warm {
    background: #f8fafc !important;
    color: #475569 !important;
    border: 1px solid #e2e8f0 !important;
}
body.light-theme .sig-timing-chip {
    background: #f8fafc !important;
    color: #475569 !important;
    border: 1px solid #e2e8f0 !important;
}
body.light-theme .sig-lot-strip {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #475569 !important;
}
body.light-theme .sig-lot-strip b {
    color: #0f172a !important;
}

body.light-theme .sig-levels .level.entry {
    background: #eff6ff !important;
    border: 1.5px solid #93c5fd !important;
}
body.light-theme .sig-levels .level.entry .lvl-label {
    color: #1d4ed8 !important;
    font-weight: 800 !important;
}
body.light-theme .sig-levels .level.entry .lvl-val {
    color: #1e40af !important;
    font-weight: 800 !important;
}

body.light-theme .sig-levels .level.target {
    background: #ecfdf5 !important;
    border: 1.5px solid #6ee7b7 !important;
}
body.light-theme .sig-levels .level.target .lvl-label {
    color: #047857 !important;
    font-weight: 800 !important;
}
body.light-theme .sig-levels .level.target .lvl-val {
    color: #065f46 !important;
    font-weight: 800 !important;
}

body.light-theme .sig-levels .level.sl {
    background: #fef2f2 !important;
    border: 1.5px solid #fca5a5 !important;
}
body.light-theme .sig-levels .level.sl .lvl-label {
    color: #b91c1c !important;
    font-weight: 800 !important;
}
body.light-theme .sig-levels .level.sl .lvl-val {
    color: #991b1b !important;
    font-weight: 800 !important;
}

body.light-theme .sig-levels .level.level-trailed {
    background: #ecfdf5 !important;
    border: 1.5px solid #34d399 !important;
}
body.light-theme .sig-levels .level.level-trailed .lvl-label {
    color: #047857 !important;
    font-weight: 800 !important;
}
body.light-theme .sig-levels .level.level-trailed .lvl-val {
    color: #065f46 !important;
    font-weight: 800 !important;
}

body.light-theme .sig-action-footer {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}
body.light-theme .sig-lock-pill {
    background: #dcfce7 !important;
    border: 1px solid #4ade80 !important;
    color: #15803d !important;
}
body.light-theme .sig-lock-pill b {
    color: #166534 !important;
}
body.light-theme .sig-milestone-pill {
    color: #475569 !important;
}
body.light-theme .sig-milestone-pill b {
    color: #0f172a !important;
}

body.light-theme .sig-pnl-pill.pnl-green {
    background: #ecfdf5 !important;
    color: #047857 !important;
    border: 1px solid #a7f3d0 !important;
    font-weight: 800 !important;
}
body.light-theme .sig-pnl-pill.pnl-red {
    background: #fef2f2 !important;
    color: #b91c1c !important;
    border: 1px solid #fca5a5 !important;
    font-weight: 800 !important;
}

body.light-theme .journal-filters {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}
body.light-theme .filter-group label {
    color: #334155 !important;
    font-weight: 700 !important;
}
body.light-theme .filter-group select,
body.light-theme .filter-group .asset-dropdown {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

/* Multi-LLM AI Copilot Banner & Cards in Light Theme (Zero Dark Colors) */
body.light-theme .ai-consensus-hero {
    background: linear-gradient(135deg, #f0fdf4 0%, #eff6ff 100%) !important;
    border: 1px solid #bfdbfe !important;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.08) !important;
    color: #0f172a !important;
}
body.light-theme .hero-left h1 {
    color: #0f172a !important;
}
body.light-theme .hero-left p {
    color: #475569 !important;
}
body.light-theme .hero-confidence-box {
    background: #ffffff !important;
    border: 1px solid #bfdbfe !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}
body.light-theme .hero-confidence-box div:first-child {
    color: #64748b !important;
}
body.light-theme #ai-confidence-val {
    color: #059669 !important;
}
body.light-theme #ai-regime-val {
    color: #475569 !important;
}
body.light-theme .setup-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
    color: #0f172a !important;
}
body.light-theme .setup-card-title {
    color: #0f172a !important;
}
body.light-theme .level-box {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}
body.light-theme .level-box .label {
    color: #64748b !important;
}
body.light-theme .rationale-box {
    background: #eff6ff !important;
    border: 1px solid #bfdbfe !important;
    color: #1e3a8a !important;
}

body.light-theme .sig-status-badge.status-active {
    background: #eff6ff !important;
    color: #2563eb !important;
    border: 1px solid #bfdbfe !important;
}
body.light-theme .sig-status-badge.status-trailed-exit {
    background: #f0fdf4 !important;
    color: #15803d !important;
    border: 1px solid #86efac !important;
}
body.light-theme .sig-status-badge.status-t6 {
    background: #faf5ff !important;
    color: #9333ea !important;
    border: 1px solid #d8b4fe !important;
}
body.light-theme .sig-status-badge.status-tp5 {
    background: #ecfeff !important;
    color: #0891b2 !important;
    border: 1px solid #a5f3fc !important;
}
body.light-theme .sig-status-badge.status-tp4 {
    background: #fefce8 !important;
    color: #ca8a04 !important;
    border: 1px solid #fef08a !important;
}
body.light-theme .sig-status-badge.status-tp3 {
    background: #f0fdf4 !important;
    color: #16a34a !important;
    border: 1px solid #bbf7d0 !important;
}
body.light-theme .sig-status-badge.status-tp2 {
    background: #ecfdf5 !important;
    color: #059669 !important;
    border: 1px solid #a7f3d0 !important;
}
body.light-theme .sig-status-badge.status-tp1 {
    background: #eff6ff !important;
    color: #2563eb !important;
    border: 1px solid #bfdbfe !important;
}
body.light-theme .sig-status-badge.status-sl {
    background: #fef2f2 !important;
    color: #dc2626 !important;
    border: 1px solid #fecaca !important;
}

body.light-theme .heatmap-cell {
    border: 1px solid #e2e8f0 !important;
}

/* ── Light Theme Indicator & Strategy Modal ── */
body.light-theme .ind-modal-card,
body.light-theme .modal-card {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15) !important;
    color: #0f172a !important;
}
body.light-theme .ind-modal-header,
body.light-theme .modal-header {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}
body.light-theme .ind-modal-title,
body.light-theme .modal-header h3 {
    color: #0f172a !important;
}
body.light-theme .ind-modal-sub {
    color: #64748b !important;
}
body.light-theme .modal-close-btn {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #64748b !important;
}
body.light-theme .modal-close-btn:hover {
    background: #fef2f2 !important;
    border-color: #fca5a5 !important;
    color: #dc2626 !important;
}

body.light-theme .ind-modal-tabs {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
}
body.light-theme .ind-tab-btn {
    color: #64748b !important;
}
body.light-theme .ind-tab-btn:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}
body.light-theme .ind-tab-btn.active {
    background: #f5f3ff !important;
    border-color: #ddd6fe !important;
    color: #7c3aed !important;
}

body.light-theme .ind-modal-body {
    background: #f8fafc !important;
}
body.light-theme .ind-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02) !important;
}
body.light-theme .ind-card:hover {
    background: #f8fafc !important;
    border-color: #c084fc !important;
}
body.light-theme .ind-title {
    color: #0f172a !important;
}
body.light-theme .ind-desc {
    color: #64748b !important;
}

body.light-theme .btn-ind-action,
body.light-theme .btn-strat-action {
    background: #f5f3ff !important;
    border: 1px solid #c4b5fd !important;
    color: #7c3aed !important;
}
body.light-theme .btn-ind-action:hover,
body.light-theme .btn-strat-action:hover {
    background: #7c3aed !important;
    color: #ffffff !important;
    border-color: #7c3aed !important;
}
body.light-theme .btn-ind-action.active,
body.light-theme .btn-strat-action.active {
    background: #fef2f2 !important;
    border-color: #fca5a5 !important;
    color: #dc2626 !important;
}
body.light-theme .btn-ind-action.active:hover,
body.light-theme .btn-strat-action.active:hover {
    background: #dc2626 !important;
    color: #ffffff !important;
    border-color: #dc2626 !important;
}

body.light-theme .pine-studio-box {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}
body.light-theme .pine-studio-title {
    color: #7c3aed !important;
}
body.light-theme .btn-upload-pine {
    background: #f5f3ff !important;
    border: 1px solid #c4b5fd !important;
    color: #7c3aed !important;
}
body.light-theme .btn-upload-pine:hover {
    background: #7c3aed !important;
    color: #ffffff !important;
}
body.light-theme .pine-field-label {
    color: #334155 !important;
}
body.light-theme .pine-input {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}
body.light-theme .pine-editor {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}
/* ── Global In-House Interactive Chart Focus Modal ─────────────────────────────── */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-card {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    width: 100%;
    max-width: 860px;
    padding: 1.2rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #f8fafc;
}

.modal-levels-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.76rem;
    margin: 0.5rem 0;
}

.modal-levels-bar .level {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 700;
}
.modal-levels-bar .level.entry {
    background: rgba(59, 130, 246, 0.16);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.35);
}
.modal-levels-bar .level.target {
    background: rgba(16, 185, 129, 0.16);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.35);
}
.modal-levels-bar .level.sl {
    background: rgba(239, 68, 68, 0.16);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.35);
}
.modal-levels-bar .level.vwap {
    background: rgba(167, 139, 250, 0.16);
    color: #c4b5fd;
    border: 1px solid rgba(167, 139, 250, 0.35);
}

body.light-theme .modal-backdrop {
    background: rgba(15, 23, 42, 0.45);
}
body.light-theme .modal-card {
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15) !important;
}
body.light-theme .modal-header h3 {
    color: #0f172a !important;
}
body.light-theme .modal-levels-bar {
    background: #f8fafc !important;
    border: 1.5px solid #e2e8f0 !important;
}
body.light-theme .modal-levels-bar .level.entry {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    border: 1.5px solid #93c5fd !important;
}
body.light-theme .modal-levels-bar .level.target {
    background: #ecfdf5 !important;
    color: #047857 !important;
    border: 1.5px solid #6ee7b7 !important;
}
body.light-theme .modal-levels-bar .level.sl {
    background: #fef2f2 !important;
    color: #b91c1c !important;
    border: 1.5px solid #fca5a5 !important;
}
body.light-theme .modal-levels-bar .level.vwap {
    background: #f5f3ff !important;
    color: #6d28d9 !important;
    border: 1.5px solid #ddd6fe !important;
}
.modal-tf-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.6rem 0 0.5rem 0;
}

.modal-tf-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

.modal-tf-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #94a3b8;
    padding: 4px 14px;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.modal-tf-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #f8fafc;
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.modal-tf-btn.active {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    color: #ffffff !important;
    border-color: #60a5fa !important;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.4);
    font-weight: 800;
}

body.light-theme .modal-tf-btn {
    background: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    color: #475569;
}

body.light-theme .modal-tf-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #94a3b8;
}

body.light-theme .modal-tf-btn.active {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    color: #ffffff !important;
    border-color: #1d4ed8 !important;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
    font-weight: 800;
}

body.light-theme .modal-tf-hint {
    color: #64748b !important;
}

body.light-theme #modal-lightweight-chart {
    background: #ffffff !important;
}

/* ── Dedicated RSI 1-100 Axis Scale Column ── */
.modal-rsi-scale {
    position: absolute;
    right: 0;
    bottom: 26px;
    height: 72px;
    width: 62px;
    z-index: 10;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #0f172a !important;
    border-left: 1px solid rgba(255, 255, 255, 0.15) !important;
    padding: 2px 4px 2px 6px;
    box-sizing: border-box;
    font-family: 'JetBrains Mono', monospace;
    user-select: none;
    box-shadow: -2px 0 6px rgba(0, 0, 0, 0.08);
}

body.light-theme .modal-rsi-scale {
    background: #ffffff !important;
    border-left: 1px solid #cbd5e1 !important;
    box-shadow: -2px 0 6px rgba(0, 0, 0, 0.04);
}

.modal-rsi-tick {
    display: flex;
    justify-content: space-between;
    align-items: center;
    line-height: 1;
}

.modal-rsi-live-badge {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    background: #ec4899;
    color: #ffffff;
    padding: 1px 4px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px;
    font-weight: 800;
    box-shadow: 0 1px 5px rgba(236, 72, 153, 0.6);
    white-space: nowrap;
    transition: top 0.12s ease-out;
    z-index: 12;
}

/* ── Dedicated Volume Axis Scale Column ── */
.modal-vol-scale {
    position: absolute;
    right: 0;
    bottom: 98px;
    height: 52px;
    width: 62px;
    z-index: 10;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #0f172a !important;
    border-left: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1) !important;
    padding: 2px 4px 2px 6px;
    box-sizing: border-box;
    font-family: 'JetBrains Mono', monospace;
    user-select: none;
    box-shadow: -2px 0 6px rgba(0, 0, 0, 0.08);
}

body.light-theme .modal-vol-scale {
    background: #ffffff !important;
    border-left: 1px solid #cbd5e1 !important;
    border-bottom: 1px dashed #e2e8f0 !important;
    box-shadow: -2px 0 6px rgba(0, 0, 0, 0.04);
}

.modal-vol-tick {
    display: flex;
    justify-content: space-between;
    align-items: center;
    line-height: 1;
}

.modal-vol-live-badge {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    background: #10b981;
    color: #ffffff;
    padding: 1px 4px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    font-weight: 800;
    box-shadow: 0 1px 5px rgba(16, 185, 129, 0.6);
    white-space: nowrap;
    transition: top 0.12s ease-out;
    z-index: 12;
}

/* ── Connection Status Toast ─────────────────────────────── */
.conn-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    min-width: 280px;
    max-width: 420px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.45);
    animation: toastSlideUp 0.3s cubic-bezier(.22,.68,0,1.2) both;
    border: 1px solid rgba(255,255,255,0.15);
    backdrop-filter: blur(12px);
}
@media (max-width: 991px) {
    .conn-toast {
        bottom: 74px;
        right: 12px;
        left: 12px;
        max-width: none;
        min-width: 0;
    }
}
@keyframes toastSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.conn-toast-error {
    background: linear-gradient(135deg, rgba(239,68,68,0.95), rgba(185,28,28,0.95));
    color: #fff;
}
.conn-toast-warning {
    background: linear-gradient(135deg, rgba(245,158,11,0.95), rgba(180,83,9,0.95));
    color: #fff;
}
.conn-toast-success {
    background: linear-gradient(135deg, rgba(34,197,94,0.95), rgba(21,128,61,0.95));
    color: #fff;
}
.conn-toast-info {
    background: linear-gradient(135deg, rgba(99,102,241,0.95), rgba(67,56,202,0.95));
    color: #fff;
}
.conn-toast-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}
.conn-toast-body span:first-child {
    font-weight: 700;
    font-size: 0.82rem;
}
#conn-toast-detail {
    font-size: 0.7rem;
    opacity: 0.85;
    font-weight: 400;
}
.conn-toast-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.75rem;
    cursor: pointer;
    font-weight: 700;
    min-width: 26px;
    transition: background 0.2s;
}
.conn-toast-close:hover { background: rgba(255,255,255,0.35); }
#conn-toast-icon { font-size: 1.3rem; line-height: 1; }
@keyframes toastSlideDown {
    from { top: -60px; opacity: 0; }
    to   { top: 14px;  opacity: 1; }
}

/* ── Mobile Touch Bottom Navigation Bar (Screens <= 768px) ────── */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
    z-index: 99999;
    justify-content: space-around;
    align-items: center;
    padding: 0 4px;
}

body:not(.light-theme) .mobile-bottom-nav {
    background: rgba(15, 23, 42, 0.95);
    border-top: 1px solid #334155;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4);
}

.mob-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    gap: 3px;
    flex: 1;
    height: 100%;
    transition: all 0.2s ease;
}

.mob-nav-item .mob-icon {
    font-size: 1.15rem;
    line-height: 1;
}

.mob-nav-item.active,
.mob-nav-item:hover {
    color: #2563eb;
}

body:not(.light-theme) .mob-nav-item {
    color: #94a3b8;
}

body:not(.light-theme) .mob-nav-item.active {
    color: #38bdf8;
}

/* ================================================================
   Mobile-Friendly Responsive Engine (768px Tablet & 480px Mobile)
   ================================================================ */
@media (max-width: 768px) {
    /* 1. Global Bottom Navigation & Safe Padding */
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        height: 56px !important;
        background: rgba(255, 255, 255, 0.96) !important;
        -webkit-backdrop-filter: blur(16px) !important;
        backdrop-filter: blur(16px) !important;
        border-top: 1px solid #e2e8f0 !important;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08) !important;
        z-index: 99999 !important;
        justify-content: space-around !important;
        align-items: center !important;
        padding: 0 4px !important;
        padding-bottom: env(safe-area-inset-bottom, 0) !important;
    }

    body:not(.light-theme) .mobile-bottom-nav {
        background: rgba(15, 23, 42, 0.96) !important;
        border-top: 1px solid #334155 !important;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.5) !important;
    }

    .mob-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: #64748b;
        font-size: 0.62rem;
        font-weight: 700;
        font-family: 'Inter', sans-serif;
        gap: 2px;
        flex: 1;
        height: 100%;
        transition: all 0.2s ease;
    }

    .mob-nav-item .mob-icon {
        font-size: 1.05rem;
        line-height: 1;
    }

    .mob-nav-item.active,
    .mob-nav-item:hover {
        color: #2563eb;
    }

    body:not(.light-theme) .mob-nav-item {
        color: #94a3b8;
    }

    body:not(.light-theme) .mob-nav-item.active {
        color: #38bdf8;
    }

    body {
        padding-bottom: 65px !important;
    }

    .page-container {
        padding: 0.6rem 0.6rem 85px 0.6rem !important;
        gap: 0.85rem !important;
    }
    .page-card {
        padding: 0.75rem 0.6rem !important;
    }
    .page-header {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    .dashboard-grid,
    .signals-container,
    .constituents-container,
    .smart-container,
    .ai-container,
    #main-grid {
        padding-bottom: 85px !important;
    }

    /* 2. Global Header & Ticker Strip */
    .app-nav {
        display: none !important;
    }

    .top-ticker-strip {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 4px 8px !important;
    }

    .ticker-container {
        gap: 0.75rem !important;
    }

    .ticker-item {
        padding: 2px 7px !important;
        font-size: 0.68rem !important;
        flex-shrink: 0 !important;
    }

    .global-header {
        padding: 0.35rem 0.65rem !important;
        gap: 6px !important;
        flex-wrap: wrap !important;
    }

    .header-left {
        gap: 6px !important;
    }

    .brand-group h1#logo {
        font-size: 1.15rem !important;
    }

    .brand-group .sub-logo {
        font-size: 0.55rem !important;
        letter-spacing: 0.8px !important;
    }

    .header-right {
        gap: 5px !important;
        flex-wrap: wrap !important;
        justify-content: flex-end !important;
    }

    .category-tabs {
        display: none !important;
    }

    .asset-dropdown {
        font-size: 0.76rem !important;
        padding: 0.25rem 0.55rem !important;
    }

    .header-right .btn-theme-toggle {
        padding: 3px 7px !important;
        font-size: 0.68rem !important;
    }

    .date-clock-box .current-date {
        display: none !important;
    }

    .date-clock-box .clock {
        font-size: 0.8rem !important;
    }

    /* 3. Sub-Header Controls & Intel Bar (Clean & Compact) */
    .sub-header-controls {
        padding: 0.35rem 0.5rem !important;
        gap: 6px !important;
    }

    .sub-controls-left {
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 6px !important;
    }

    /* HIDE UNWANTED CLUTTER ON MOBILE */
    .operating-hours,
    #operating-hours,
    .spot-ohlc,
    #spot-ohlc-bar,
    #tv-asset-full-title {
        display: none !important;
    }

    .market-status-box {
        padding: 0.2rem 0.5rem !important;
    }

    .spot-box {
        padding: 0.2rem 0.5rem !important;
    }

    .spot-top .label {
        font-size: 0.6rem !important;
    }

    .spot-top .price {
        font-size: 0.95rem !important;
    }

    /* Swipeable Intelligence Quick Strip */
    .sub-controls-center {
        width: 100% !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        gap: 6px !important;
        padding: 2px 0 !important;
        scrollbar-width: none !important;
    }
    .sub-controls-center::-webkit-scrollbar {
        display: none !important;
    }

    .sub-controls-right {
        display: none !important;
    }

    .header-intel-btn {
        padding: 4px 8px !important;
        font-size: 0.7rem !important;
        flex-shrink: 0 !important;
        border-radius: 6px !important;
    }

    /* 4. TradingView Candlestick Chart Terminal */
    .tv-top-toolbar {
        padding: 5px 8px !important;
        gap: 5px !important;
    }

    .tv-symbol-badge {
        font-size: 0.8rem !important;
    }

    #tv-ohlc-legend {
        font-size: 0.68rem !important;
        padding: 2px 6px !important;
    }

    #tv-ohlc-legend span:not(#tv-change) {
        display: none !important;
    }

    .tv-style-tf {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        display: flex !important;
        width: 100% !important;
        gap: 3px !important;
        padding-bottom: 2px !important;
        scrollbar-width: none !important;
    }
    .tv-style-tf::-webkit-scrollbar {
        display: none !important;
    }

    .tv-style-tf .tf-btn {
        flex-shrink: 0 !important;
        padding: 2px 6px !important;
        font-size: 0.68rem !important;
    }

    #chart-section {
        margin-bottom: 0.6rem !important;
    }

    #chart-container {
        height: 310px !important;
    }

    /* 5. Option Chain Table: Hide secondary columns on mobile to keep focus on Strike, LTP, Volume, Score & Chart */
    .table-wrap {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    #chain-table th:nth-child(4), #chain-table td:nth-child(4), /* Open */
    #chain-table th:nth-child(5), #chain-table td:nth-child(5), /* High */
    #chain-table th:nth-child(6), #chain-table td:nth-child(6), /* Low */
    #chain-table th:nth-child(11), #chain-table td:nth-child(11), /* ΔOI */
    #chain-table th:nth-child(12), #chain-table td:nth-child(12), /* B/S */
    #chain-table th:nth-child(13), #chain-table td:nth-child(13)  /* Depth */
    {
        display: none !important;
    }

    .chain-header-controls {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px !important;
        width: 100% !important;
    }

    .search-strike-box {
        width: 100% !important;
    }

    .search-strike-box input {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 6. Active Trades Page (/active-trades) */
    .wallet-hud {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        margin-bottom: 0.8rem !important;
    }

    .wallet-card {
        padding: 8px 10px !important;
    }

    .wallet-title {
        font-size: 0.68rem !important;
    }

    .wallet-val {
        font-size: 1.15rem !important;
    }

    /* 7. AI Copilot Page (/ai-copilot) */
    .ai-consensus-hero {
        flex-direction: column !important;
        gap: 12px !important;
        padding: 1rem !important;
    }

    .hero-confidence-box {
        width: 100% !important;
        text-align: center !important;
    }

    .setup-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
    }

    .models-breakdown-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    /* 8. Trade Journal Page (/signals) */
    .journal-filters {
        grid-template-columns: repeat(2, 1fr) !important;
        display: grid !important;
        gap: 8px !important;
        padding: 8px 10px !important;
    }

    .journal-filters .filter-group {
        width: 100% !important;
        min-width: 0 !important;
    }

    .journal-filters .filter-group select {
        width: 100% !important;
        font-size: 0.74rem !important;
        padding: 0.3rem 0.5rem !important;
    }

    /* 9. Performance Page (/performance) */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    .stat-card {
        padding: 8px 10px !important;
    }

    .stat-title {
        font-size: 0.7rem !important;
    }

    /* 10. Smart 3Y Intraday Timing Page (/smart-page) */
    .smart-container {
        padding: 0.5rem 0.6rem 85px 0.6rem !important;
    }
    .smart-page-title {
        font-size: 1.15rem !important;
    }
    .smart-page-sub {
        font-size: 0.78rem !important;
    }
    .phase-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    .phase-card {
        padding: 10px 12px !important;
    }
    .news-table-card {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100% !important;
    }
    .matrix-grid {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* 11. Pine Script & Interactive Chart Modals */
    .modal-card {
        max-width: 96% !important;
        width: 96% !important;
        max-height: 92vh !important;
        padding: 10px !important;
        overflow-y: auto !important;
    }

    .modal-close-btn {
        min-width: 36px !important;
        min-height: 36px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 1.1rem !important;
    }

    .modal-tf-bar {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100% !important;
    }

    .modal-levels-bar {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        display: flex !important;
        gap: 6px !important;
        width: 100% !important;
    }

    .modal-levels-bar .level {
        flex-shrink: 0 !important;
    }

    #modal-lightweight-chart {
        height: 280px !important;
    }
}

@media (max-width: 480px) {
    .stats-grid,
    .wallet-hud {
        grid-template-columns: 1fr 1fr !important;
    }

    .stat-value,
    .wallet-val {
        font-size: 1.05rem !important;
    }

    .journal-filters {
        grid-template-columns: 1fr !important;
    }

    .sig-action-footer {
        flex-wrap: wrap !important;
        gap: 6px !important;
    }

    .sig-footer-status {
        width: 100% !important;
    }

    .btn-quick-buy {
        width: 100% !important;
        text-align: center !important;
        padding: 6px 12px !important;
    }
}

/* ================================================================
   Row 3: Streamlined Sub-Header Intelligence Micro-Bar (Desktop Only)
   ================================================================ */
.sub-header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 16px;
    min-height: 32px;
    gap: 12px;
    flex-wrap: nowrap;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 6px;
}

body.light-theme .sub-header-controls {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.sub-controls-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.sub-controls-center {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: flex-end;
}

/* Market Status Badge Box */
.market-status-box {
    display: flex;
    align-items: center;
}
.status-badge {
    font-size: 0.72rem;
    font-weight: 700;
    color: #34d399;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 2px 8px;
    border-radius: 6px;
}
body.light-theme .status-badge {
    background: #f0fdf4 !important;
    border-color: #bbf7d0 !important;
    color: #16a34a !important;
}

/* Upper Bar Intelligence Action Micro-Pills */
.header-intel-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    white-space: nowrap;
}

.header-intel-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.btn-ai-intel:hover {
    border-color: #3b82f6;
    background: rgba(37, 99, 235, 0.18);
}

.btn-drag-intel:hover {
    border-color: #06b6d4;
    background: rgba(6, 182, 212, 0.18);
}

.btn-smart-intel:hover {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.18);
}

.intel-btn-icon {
    font-size: 0.8rem;
    line-height: 1;
}

.intel-btn-tag {
    font-size: 0.64rem;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.intel-btn-status {
    font-size: 0.72rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
}
.status-buy, .status-drag, .status-smart { color: #34d399; }

body.light-theme .header-intel-btn {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
}
body.light-theme .header-intel-btn:hover {
    background: #f1f5f9 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06) !important;
}
body.light-theme .intel-btn-tag {
    color: #64748b !important;
}
body.light-theme .status-buy, 
body.light-theme .status-drag, 
body.light-theme .status-smart { 
    color: #16a34a !important; 
}

/* ── STRICT RESPONSIVE: HIDE 2nd ROW CLUTTER ON TABLET AND MOBILE ── */
@media (max-width: 1024px) {
    .sub-header-controls,
    #sub-header-controls {
        display: none !important;
    }
}

/* ================================================================
   Smart 3-Year Timing & News Analytics (Dual Theme)
   ================================================================ */
.smart-container {
    max-width: 1440px;
    margin: 1rem auto;
    padding: 0 1rem 5rem 1rem;
}
.smart-page-intro { margin-bottom: 1.5rem; }
.smart-page-title {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 800;
    color: #f8fafc;
}
.smart-page-sub {
    margin: 0.35rem 0 0 0;
    color: #94a3b8;
    font-size: 0.95rem;
}

.section-header {
    margin: 1.8rem 0 1rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.section-header h2 {
    margin: 0;
    font-size: 1.35rem;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.section-sub {
    font-size: 0.82rem;
    color: #94a3b8;
}

.phase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.phase-card {
    background: rgba(17, 24, 39, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}
.phase-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.phase-card.green-dominant { border-top: 4px solid #10b981; }
.phase-card.red-dominant { border-top: 4px solid #ef4444; }
.phase-card.neutral-dominant { border-top: 4px solid #eab308; }

.phase-time {
    font-size: 0.82rem;
    font-weight: 700;
    color: #60a5fa;
    background: rgba(37, 99, 235, 0.15);
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-block;
}
.phase-swing {
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
}
.phase-title {
    margin: 0.6rem 0 0.2rem 0;
    font-size: 1.05rem;
    color: #f8fafc;
}
.phase-bias {
    font-size: 0.8rem;
    font-weight: 600;
}

.prob-bar-container {
    margin: 0.8rem 0;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 8px;
    height: 10px;
    overflow: hidden;
    display: flex;
}
.prob-bar-green { background: #10b981; height: 100%; }
.prob-bar-red { background: #ef4444; height: 100%; }

.rule-box {
    background: rgba(30, 41, 59, 0.6);
    border-left: 3px solid #6366f1;
    padding: 0.6rem 0.8rem;
    border-radius: 4px;
    font-size: 0.83rem;
    color: #cbd5e1;
    margin-top: 0.8rem;
    line-height: 1.4;
}

.matrix-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
    gap: 0.6rem;
    margin-bottom: 2rem;
}
.matrix-slot-card {
    background: rgba(17, 24, 39, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.75rem 0.6rem;
    text-align: center;
    font-size: 0.82rem;
}
.matrix-slot-card.green { border-color: rgba(16, 185, 129, 0.3); background: rgba(16, 185, 129, 0.1); }
.matrix-slot-card.red { border-color: rgba(239, 68, 68, 0.3); background: rgba(239, 68, 68, 0.1); }
.matrix-slot-card.neutral { border-color: rgba(234, 179, 8, 0.3); background: rgba(234, 179, 8, 0.1); }

.matrix-slot-label { font-weight: 700; color: #e2e8f0; font-size: 0.76rem; }
.matrix-slot-pct { font-size: 1.15rem; font-weight: 800; margin: 0.3rem 0; }
.matrix-slot-action { font-size: 0.7rem; color: #94a3b8; }

.news-table-card {
    background: rgba(17, 24, 39, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    overflow-x: auto;
}
.news-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.news-table th {
    background: #111827;
    color: #94a3b8;
    text-align: left;
    padding: 0.7rem 0.9rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
    font-weight: 600;
}
.news-table td {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: top;
    color: #cbd5e1;
}
.news-table tr:hover { background: rgba(30, 41, 59, 0.4); }

.news-title { color: #f8fafc; }
.news-date { font-size: 0.78rem; color: #94a3b8; }
.news-summary { font-size: 0.8rem; color: #94a3b8; margin-top: 4px; }
.news-cat-badge { background: rgba(30, 41, 59, 0.8); color: #cbd5e1; padding: 2px 6px; border-radius: 4px; font-size: 0.75rem; white-space: nowrap; }
.recovery-badge { padding: 2px 6px; border-radius: 4px; font-weight: 700; font-size: 0.75rem; white-space: nowrap; }
.recovery-badge.fast { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.recovery-badge.slow { background: rgba(234, 179, 8, 0.15); color: #fbbf24; }
.news-playbook { font-size: 0.82rem; color: #cbd5e1; background: rgba(30, 41, 59, 0.5); border-radius: 6px; padding: 6px 10px; }

/* Light Theme Smart Page */
body.light-theme .smart-page-title { color: #0f172a !important; }
body.light-theme .smart-page-sub { color: #64748b !important; }
body.light-theme .section-header h2 { color: #0f172a !important; }
body.light-theme .section-sub { color: #64748b !important; }

body.light-theme .phase-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
}
body.light-theme .phase-time {
    color: #2563eb !important;
    background: #eff6ff !important;
}
body.light-theme .phase-swing { color: #64748b !important; }
body.light-theme .phase-title { color: #0f172a !important; }
body.light-theme .prob-bar-container { background: #f1f5f9 !important; }
body.light-theme .rule-box {
    background: #f8fafc !important;
    border-left: 3px solid #64748b !important;
    color: #334155 !important;
}

body.light-theme .matrix-slot-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}
body.light-theme .matrix-slot-card.green { border-color: #86efac !important; background: #f0fdf4 !important; }
body.light-theme .matrix-slot-card.red { border-color: #fca5a5 !important; background: #fef2f2 !important; }
body.light-theme .matrix-slot-card.neutral { border-color: #fde047 !important; background: #fefce8 !important; }
body.light-theme .matrix-slot-label { color: #334155 !important; }
body.light-theme .matrix-slot-action { color: #64748b !important; }

body.light-theme .news-table-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
}
body.light-theme .news-table th {
    background: #f8fafc !important;
    color: #475569 !important;
    border-bottom: 2px solid #e2e8f0 !important;
}
body.light-theme .news-table td {
    border-bottom: 1px solid #f1f5f9 !important;
    color: #1e293b !important;
}
body.light-theme .news-table tr:hover { background: #f8fafc !important; }
body.light-theme .news-title { color: #0f172a !important; }
body.light-theme .news-date { color: #64748b !important; }
body.light-theme .news-summary { color: #334155 !important; }
body.light-theme .news-cat-badge { background: #f1f5f9 !important; color: #475569 !important; }
body.light-theme .recovery-badge.fast { background: #dcfce7 !important; color: #16a34a !important; }
body.light-theme .recovery-badge.slow { background: #fef3c7 !important; color: #92400e !important; }
body.light-theme .news-playbook { font-size: 0.82rem; color: #1e293b !important; background: #f8fafc !important; }

/* ================================================================
   Constituents & Point Drag Page (Dual Theme)
   ================================================================ */
.constituents-container {
    max-width: 1440px;
    margin: 1rem auto;
    padding: 0 1rem 5rem 1rem;
}
.header-bar-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.const-page-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: #f8fafc;
}
.const-page-sub {
    margin: 0.25rem 0 0 0;
    color: #94a3b8;
    font-size: 0.88rem;
}

.index-pill-selector {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 4px;
}
.index-pill {
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(17, 24, 39, 0.8);
    color: #cbd5e1;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.index-pill:hover, .index-pill.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.kpi-card {
    background: rgba(17, 24, 39, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.kpi-card h4 {
    margin: 0;
    font-size: 0.8rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.kpi-card .kpi-val {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0.4rem 0 0 0;
}
.kpi-sub {
    font-size: 0.78rem;
    color: #94a3b8;
    margin-top: 4px;
}
.kpi-prev-close { color: #e2e8f0; }

.split-tables {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}
@media (max-width: 900px) {
    .split-tables { grid-template-columns: 1fr; }
}

.table-card {
    background: rgba(17, 24, 39, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.table-card h3 {
    margin: 0 0 0.8rem 0;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #f8fafc;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.custom-table th {
    background: #111827;
    color: #94a3b8;
    text-align: left;
    padding: 0.6rem 0.8rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
    font-weight: 600;
}
.custom-table td {
    padding: 0.65rem 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
}
.custom-table tr:hover { background: rgba(30, 41, 59, 0.4); }

.badge-lifter {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 700;
}
.badge-dragger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 700;
}

.search-input {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(17, 24, 39, 0.8);
    color: #ffffff;
    border-radius: 8px;
    font-size: 0.9rem;
    min-width: 240px;
    outline: none;
}
.search-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.stock-name-cell { color: #94a3b8; }
.sector-badge { background: rgba(30, 41, 59, 0.8); color: #cbd5e1; padding: 2px 6px; border-radius: 4px; font-size: 0.78rem; }

/* Light Theme Constituents */
body.light-theme .const-page-title { color: #0f172a !important; }
body.light-theme .const-page-sub { color: #64748b !important; }

body.light-theme .index-pill {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
}
body.light-theme .index-pill:hover,
body.light-theme .index-pill.active {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #2563eb !important;
}

body.light-theme .kpi-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
}
body.light-theme .kpi-card h4 { color: #64748b !important; }
body.light-theme .kpi-sub { color: #94a3b8 !important; }
body.light-theme .kpi-prev-close { color: #334155 !important; }

body.light-theme .table-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
}
body.light-theme .table-card h3 { color: #0f172a !important; }

body.light-theme .custom-table th {
    background: #f8fafc !important;
    color: #475569 !important;
    border-bottom: 2px solid #e2e8f0 !important;
}
body.light-theme .custom-table td {
    border-bottom: 1px solid #f1f5f9 !important;
    color: #1e293b !important;
}
body.light-theme .custom-table tr:hover { background: #f8fafc !important; }
body.light-theme .badge-lifter { background: #dcfce7 !important; color: #16a34a !important; }
body.light-theme .badge-dragger { background: #fee2e2 !important; color: #dc2626 !important; }
body.light-theme .search-input {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}
body.light-theme .stock-name-cell { color: #475569 !important; }
body.light-theme .sector-badge { background: #f1f5f9 !important; color: #475569 !important; }

/* ================================================================
   Multi-LLM AI Copilot Page (Dual Theme)
   ================================================================ */
.ai-container {
    max-width: 1440px;
    margin: 1rem auto;
    padding: 0 1rem 5rem 1rem;
}
.ai-consensus-hero {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    border-radius: 16px;
    padding: 1.8rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}
.hero-left h1 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.hero-verdict-badge {
    background: #10b981;
    color: white;
    font-size: 1.2rem;
    font-weight: 800;
    padding: 6px 16px;
    border-radius: 30px;
    display: inline-block;
    margin-top: 0.6rem;
    letter-spacing: 0.5px;
}
.hero-confidence-box {
    text-align: right;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 1rem 1.5rem;
    border-radius: 12px;
}

.trade-setup-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}
@media (max-width: 960px) {
    .trade-setup-grid { grid-template-columns: 1fr; }
}

.setup-card {
    background: rgba(17, 24, 39, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.setup-card-title {
    margin: 0;
    font-size: 1.15rem;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.setup-levels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.75rem;
    margin: 1.2rem 0;
}
.level-box {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 0.75rem;
    text-align: center;
}
.level-box .label {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 600;
}
.level-box .val {
    font-size: 1.25rem;
    font-weight: 800;
    margin-top: 4px;
}
.text-primary-val { color: #f8fafc; }

.rationale-box {
    background: rgba(30, 41, 59, 0.6);
    border-left: 4px solid #3b82f6;
    padding: 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #cbd5e1;
}

.anomalies-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.anomalies-table th {
    background: #111827;
    color: #94a3b8;
    text-align: left;
    padding: 0.6rem 0.8rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
}
.anomalies-table td {
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
}
.anomaly-badge { background: rgba(245, 158, 11, 0.15); color: #fbbf24; padding: 2px 6px; border-radius: 4px; font-size: 0.75rem; }

.section-title {
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
    color: #f8fafc;
}

.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.model-card {
    background: rgba(17, 24, 39, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.model-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0.6rem;
    margin-bottom: 0.8rem;
}
.model-name { color: #f8fafc; font-size: 1.05rem; }
.model-specialty { font-size: 0.8rem; color: #94a3b8; margin-bottom: 0.5rem; }
.model-rationale-box {
    font-size: 0.88rem;
    color: #cbd5e1;
    line-height: 1.45;
    background: rgba(30, 41, 59, 0.6);
    padding: 0.75rem;
    border-radius: 6px;
}

/* Light Theme AI Copilot */
body.light-theme .setup-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
}
body.light-theme .setup-card-title { color: #0f172a !important; }
body.light-theme .level-box {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}
body.light-theme .level-box .label { color: #64748b !important; }
body.light-theme .text-primary-val { color: #0f172a !important; }
body.light-theme .rationale-box {
    background: #f8fafc !important;
    border-left: 4px solid #2563eb !important;
    color: #334155 !important;
}
body.light-theme .anomalies-table th {
    background: #f8fafc !important;
    color: #475569 !important;
    border-bottom: 2px solid #e2e8f0 !important;
}
body.light-theme .anomalies-table td {
    border-bottom: 1px solid #f1f5f9 !important;
    color: #1e293b !important;
}
body.light-theme .anomaly-badge { background: #fef3c7 !important; color: #b45309 !important; }
body.light-theme .section-title { color: #0f172a !important; }
body.light-theme .model-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
}
body.light-theme .model-header { border-bottom: 1px solid #f1f5f9 !important; }
body.light-theme .model-name { color: #0f172a !important; }
body.light-theme .model-specialty { color: #64748b !important; }
body.light-theme .model-rationale-box {
    color: #334155 !important;
    background: #f8fafc !important;
}

/* ── TradingView Pro Terminal & 0.25s Live Pulse ────────── */
.tradingview-terminal-card {
    background: #0e1320 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.tv-top-toolbar {
    background: rgba(13, 18, 30, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tv-style-tf button {
    padding: 3px 8px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
}

@keyframes livePulse {
    0% { transform: scale(0.9); opacity: 0.7; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.9); opacity: 0.7; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.live-blink-circle {
    animation: livePulse 1.4s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

.status-pulse-dot {
    animation: livePulse 2s infinite ease-in-out;
}

body.light-theme .tradingview-terminal-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

body.light-theme .tv-top-toolbar {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme #tv-symbol-name {
    color: #0f172a !important;
}

body.light-theme #tv-ohlc-legend {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    color: #475569 !important;
}

body.light-theme #tv-ohlc-legend strong {
    color: #0f172a !important;
}

/* ================================================================
   6-TIER TARGET EXPANSION LADDER & DYNAMIC TRAILING SL STYLES
   ================================================================ */
.sig-status-badge {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.sig-status-badge.status-active,
.sig-status-badge.status-tp1,
.sig-status-badge.status-tp2,
.sig-status-badge.status-tp3,
.sig-status-badge.status-tp4,
.sig-status-badge.status-tp5,
.sig-status-badge.status-t6,
.sig-status-badge.status-trailed-exit,
.sig-status-badge.status-sl {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow: none !important;
    animation: none !important;
}

@keyframes gold-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(245, 158, 11, 0.4); }
    50% { box-shadow: 0 0 18px rgba(245, 158, 11, 0.85); }
}

/* 6-Tier Target Ladder UI */
.sig-ladder-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    margin: 8px 0;
    padding: 6px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.sig-ladder-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 2px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    text-align: center;
    transition: all 0.25s ease;
}

.sig-ladder-step .step-tier {
    font-size: 0.65rem;
    font-weight: 800;
    color: #94a3b8;
    line-height: 1;
    margin-bottom: 2px;
}

.sig-ladder-step .step-price {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    color: #e2e8f0;
    line-height: 1.1;
}

.sig-ladder-step.hit {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.5);
}

.sig-ladder-step.hit .step-tier {
    color: #34d399;
}

.sig-ladder-step.hit .step-price {
    color: #a7f3d0;
}

.sig-ladder-step.current {
    background: rgba(59, 130, 246, 0.22);
    border-color: #3b82f6;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.45);
    animation: target-chase 1.5s infinite alternate;
}

.sig-ladder-step.current .step-tier {
    color: #93c5fd;
    font-weight: 900;
}

.sig-ladder-step.t6-hit {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(217, 119, 6, 0.35));
    border-color: #f59e0b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.sig-ladder-step.t6-hit .step-tier {
    color: #fef08a;
}

.sig-ladder-step.t6-hit .step-price {
    color: #fffbeb;
}

@keyframes target-chase {
    0% { transform: scale(1); }
    100% { transform: scale(1.04); }
}

/* Trailed SL Locked Profit Pill */
.sig-trailed-lock-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.25));
    border: 1px solid rgba(16, 185, 129, 0.45);
    color: #6ee7b7;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
}

.sig-trailed-alert {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 0.75rem;
    margin: 6px 0;
    color: #d1fae5;
}

body.light-theme .sig-ladder-container {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

body.light-theme .sig-ladder-step {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
}

body.light-theme .sig-ladder-step .step-price {
    color: #0f172a !important;
}

body.light-theme .sig-ladder-step.hit {
    background: #ecfdf5 !important;
    border-color: #6ee7b7 !important;
}

body.light-theme .sig-ladder-step.hit .step-tier {
    color: #047857 !important;
}

body.light-theme .sig-ladder-step.current {
    background: #eff6ff !important;
    border-color: #3b82f6 !important;
}

/* ══════════════════════════════════════════════════════════════
   FANDO MODERN LEFT-SIDE NAVIGATION DRAWER & SIDEBAR
/* ══════════════════════════════════════════════════════════════
   FANDO MODERN BROKER LAYOUT & DOCK SYSTEM (DHAN / KITE REF)
   ══════════════════════════════════════════════════════════════ */
:root {
    --sidebar-w: 220px;
    --sidebar-w-collapsed: 62px;
    --header-h: 52px;
}

body.sidebar-collapsed {
    --sidebar-w: var(--sidebar-w-collapsed);
}

@media (max-width: 991px) {
    :root, body.sidebar-collapsed {
        --sidebar-w: 0px;
    }
    body {
        padding-bottom: 64px !important; /* Safe area for bottom nav */
    }
}

/* Page Blocks Unified Grid Alignment — ZERO Overlaps, ZERO Gaps */
.top-ticker-strip,
header.global-header,
.sub-header-controls,
#main-grid,
.page-container {
    margin-left: var(--sidebar-w) !important;
    width: calc(100% - var(--sidebar-w)) !important;
    box-sizing: border-box !important;
    transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1), width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.fando-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: #080c15;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 1050;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

body.light-theme .fando-sidebar {
    background: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.04) !important;
}

body.sidebar-collapsed .fando-sidebar {
    width: var(--sidebar-w-collapsed);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

body.light-theme .sidebar-header {
    border-bottom: 1px solid #f1f5f9;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    overflow: hidden;
}

.sidebar-brand-title {
    font-size: 1.1rem;
    font-weight: 900;
    background: linear-gradient(135deg, #38bdf8, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

body.sidebar-collapsed .sidebar-brand-title,
body.sidebar-collapsed .sidebar-brand-badge,
body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .sidebar-profile-info {
    display: none !important;
}

body.sidebar-collapsed .sidebar-header {
    justify-content: center;
    padding: 14px 6px;
}

body.sidebar-collapsed .sidebar-brand {
    display: none;
}

.sidebar-toggle-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

body.light-theme .sidebar-toggle-btn {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}

.sidebar-toggle-btn:hover {
    color: #38bdf8;
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
}

.sidebar-nav-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 8px;
    flex: 1;
    overflow-y: auto;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 8px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.83rem;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}

body.light-theme .sidebar-item {
    color: #475569;
}

.sidebar-item:hover {
    background: rgba(56, 189, 248, 0.08);
    color: #38bdf8;
    transform: translateX(2px);
}

body.light-theme .sidebar-item:hover {
    background: rgba(2, 132, 199, 0.08);
    color: #0284c7;
}

.sidebar-item.active {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.2), rgba(16, 185, 129, 0.15));
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
    font-weight: 700;
}

body.light-theme .sidebar-item.active {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #0284c7;
}

body.sidebar-collapsed .sidebar-item {
    justify-content: center;
    padding: 10px 0;
}

.sidebar-icon {
    font-size: 1.15rem;
    width: 24px;
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-nav-group-title {
    font-size: 0.64rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 8px 10px 3px 10px;
    margin-top: 6px;
    user-select: none;
}

body.light-theme .sidebar-nav-group-title {
    color: #94a3b8;
}

body.sidebar-collapsed .sidebar-nav-group-title {
    display: none !important;
}

.sidebar-item .nav-badge {
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 9999px;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
    line-height: 1.3;
}

.sidebar-item .nav-badge.live-pulse {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.4);
    animation: livePulseGlow 2s infinite ease-in-out;
}

.sidebar-item .nav-badge.live-badge {
    background: rgba(14, 165, 233, 0.18);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.4);
}

.sidebar-item .nav-badge.win-badge {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.35);
}

.sidebar-item .nav-badge.ai-badge {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border-color: rgba(168, 85, 247, 0.35);
}

body.light-theme .sidebar-item .nav-badge {
    background: #e0f2fe;
    color: #0284c7;
    border-color: #bae6fd;
}

body.light-theme .sidebar-item .nav-badge.live-pulse {
    background: #dcfce7;
    color: #15803d;
    border-color: #bbf7d0;
}

body.light-theme .sidebar-item .nav-badge.live-badge {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #7dd3fc;
}

body.light-theme .sidebar-item .nav-badge.win-badge {
    background: #dcfce7;
    color: #16a34a;
    border-color: #86efac;
}

body.light-theme .sidebar-item .nav-badge.ai-badge {
    background: #f3e8ff;
    color: #7e22ce;
    border-color: #e9d5ff;
}

body.sidebar-collapsed .sidebar-item .nav-badge {
    display: none !important;
}

@keyframes livePulseGlow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.96); }
}

.sidebar-profile {
    padding: 10px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    background: rgba(0, 0, 0, 0.25);
    transition: background 0.2s;
    flex-shrink: 0;
}

body.light-theme .sidebar-profile {
    background: #ffffff !important;
    border-top: 1px solid #e2e8f0 !important;
}

.sidebar-profile-name {
    font-size: 0.8rem;
    font-weight: 800;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.light-theme .sidebar-profile-name {
    color: #000000 !important;
}

.sidebar-profile-role {
    font-size: 0.68rem;
    color: #00e5ff;
    font-weight: 700;
}

body.light-theme .sidebar-profile-role {
    color: #0284c7 !important;
}

body.sidebar-collapsed .sidebar-profile {
    justify-content: center;
    padding: 10px 0;
}

.sidebar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7, #10b981);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* Header Page Title & Broker Pill */
.header-page-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 6px;
}

.header-page-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: -0.2px;
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

body.light-theme .header-page-title {
    color: #0f172a;
}

.broker-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 0.72rem;
    font-weight: 800;
    color: #10b981;
    letter-spacing: 0.5px;
}

.broker-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

/* Mobile Visibility Helpers */
@media (max-width: 991px) {
    .hide-mobile {
        display: none !important;
    }
    .show-mobile {
        display: flex !important;
    }
}
@media (min-width: 992px) {
    .show-mobile {
        display: none !important;
    }
}

/* Mobile Slide-Out Drawer & Bottom Nav (Dhan / Kite App Reference) */
.mobile-bottom-nav {
    display: none;
}

@media (max-width: 991px) {
    .fando-sidebar {
        width: 270px !important;
        transform: translateX(-100%);
        z-index: 1060;
        box-shadow: none;
    }

    body.mobile-drawer-open .fando-sidebar {
        transform: translateX(0);
        box-shadow: 10px 0 40px rgba(0,0,0,0.6);
    }

    .mobile-drawer-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.65);
        backdrop-filter: blur(4px);
        z-index: 1055;
    }

    body.mobile-drawer-open .mobile-drawer-backdrop {
        display: block;
    }

    /* Mobile Bottom Navigation Bar */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: #080c15;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        z-index: 1045;
        justify-content: space-around;
        align-items: center;
        padding-bottom: env(safe-area-inset-bottom);
        box-shadow: 0 -4px 20px rgba(0,0,0,0.35);
    }

    body.light-theme .mobile-bottom-nav {
        background: #ffffff;
        border-top: 1px solid #e2e8f0;
        box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
    }

    .mob-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: #94a3b8;
        font-size: 0.68rem;
        font-weight: 700;
        gap: 3px;
        padding: 5px 8px;
        border-radius: 8px;
        transition: all 0.2s;
        flex: 1;
        text-align: center;
    }

    .mob-nav-item.active {
        color: #38bdf8;
    }

    body.light-theme .mob-nav-item.active {
        color: #0284c7;
    }

    .mob-nav-item .mob-icon {
        font-size: 1.2rem;
        line-height: 1;
    }

    /* Mobile Main Grid & Chart responsive stacking */
    #main-grid {
        grid-template-columns: 1fr !important;
        padding: 6px !important;
        gap: 10px !important;
    }

    #chain-section {
        grid-column: 1 !important;
        grid-row: auto !important;
    }

    #signals-section {
        grid-column: 1 !important;
        grid-row: auto !important;
    }

    .sub-header-controls {
        padding: 8px 10px !important;
        gap: 8px !important;
    }

    .sub-controls-center {
        display: none !important;
    }

    .sub-controls-left {
        width: 100% !important;
        justify-content: space-between !important;
    }

    /* Option Chain Responsive Touch Scrolling with Sticky Strike */
    .table-container {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }

    /* Horizontal smooth scrolling for top ticker */
    .top-ticker-strip {
        overflow-x: auto !important;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .top-ticker-strip::-webkit-scrollbar {
        display: none;
    }
}

/* ==========================================================================
   UNIVERSAL LIGHT THEME ENFORCEMENT ENGINE
   Ensures ALL cards, backgrounds, modals, toolbars, tables are milky-white (#ffffff / #f8fafc)
   and NO text is white (#ffffff / #f8fafc) on light backgrounds.
   All text/headings/labels/cells default to high-contrast dark (#0f172a / #000000 / #334155 / #475569).
   ========================================================================== */
body.light-theme {
    background-color: #f8fafc !important;
    background-image: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99,102,241,0.06), transparent) !important;
    color: #0f172a !important;
}

/* Headings */
body.light-theme h1,
body.light-theme h2,
body.light-theme h3,
body.light-theme h4,
body.light-theme h5,
body.light-theme h6 {
    color: #0f172a !important;
}

/* Sidebar navigation & bottom profile card */
body.light-theme .fando-sidebar {
    background: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.03) !important;
}

body.light-theme .sidebar-header {
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .sidebar-item {
    color: #334155 !important;
}

body.light-theme .sidebar-item .nav-text {
    color: #334155 !important;
}

body.light-theme .sidebar-item:hover {
    background: #f1f5f9 !important;
    color: #0284c7 !important;
}

body.light-theme .sidebar-item:hover .nav-text {
    color: #0284c7 !important;
}

body.light-theme .sidebar-item.active {
    background: #e0f2fe !important;
    color: #0284c7 !important;
    border-left: 3px solid #0284c7 !important;
}

body.light-theme .sidebar-item.active .nav-text {
    color: #0284c7 !important;
    font-weight: 800 !important;
}

/* Sidebar bottom profile mini-card */
body.light-theme .sidebar-profile {
    background: #ffffff !important;
    border-top: 1px solid #e2e8f0 !important;
}

body.light-theme .sidebar-profile:hover {
    background: #f8fafc !important;
}

body.light-theme .sidebar-profile-name,
body.light-theme .sidebar-profile-info div:first-child {
    color: #000000 !important;
    font-weight: 800 !important;
}

body.light-theme .sidebar-profile-role {
    color: #0284c7 !important;
    font-weight: 700 !important;
}

/* Header & Tickers */
body.light-theme .global-header {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03) !important;
}

body.light-theme .header-page-title {
    color: #0f172a !important;
}

body.light-theme .top-ticker-strip {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .ticker-item {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme .ticker-name {
    color: #475569 !important;
}

body.light-theme .ticker-val {
    color: #0f172a !important;
}

body.light-theme .date-clock-box {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    color: #334155 !important;
}

body.light-theme #clock {
    color: #0f172a !important;
}

body.light-theme #current-date {
    color: #475569 !important;
}

/* Cards, Panels, Boxes, Toolbars across ALL pages */
body.light-theme .card,
body.light-theme .panel,
body.light-theme .page-card,
body.light-theme .glass-card,
body.light-theme .card-panel,
body.light-theme .user-hero-card,
body.light-theme .stat-card,
body.light-theme .kpi-card,
body.light-theme .wallet-card,
body.light-theme .ledger-container,
body.light-theme .hud-card,
body.light-theme .chart-box,
body.light-theme .lab-toolbar,
body.light-theme .action-toolbar,
body.light-theme .table-wrap,
body.light-theme .trade-log-wrap,
body.light-theme .signal-card,
body.light-theme .modal-card,
body.light-theme .modal-box,
body.light-theme .tradingview-terminal-card {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

/* Tables across ALL pages */
body.light-theme table {
    color: #0f172a !important;
}

body.light-theme table thead th,
body.light-theme table th,
body.light-theme .um-table th,
body.light-theme .ledger-table th,
body.light-theme .data-table th,
body.light-theme .custom-table th {
    background: #f8fafc !important;
    color: #475569 !important;
    border-bottom: 1px solid #e2e8f0 !important;
    font-weight: 700 !important;
}

body.light-theme table tbody td,
body.light-theme table td,
body.light-theme .um-table td,
body.light-theme .ledger-table td,
body.light-theme .data-table td,
body.light-theme .custom-table td {
    color: #0f172a !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

body.light-theme table tr:hover,
body.light-theme .um-table tr:hover,
body.light-theme .ledger-table tr:hover,
body.light-theme .data-table tr:hover,
body.light-theme .custom-table tr:hover {
    background: #f8fafc !important;
}

/* Inputs, Selects, and Textareas across ALL pages */
body.light-theme input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]),
body.light-theme select,
body.light-theme textarea,
body.light-theme .form-input,
body.light-theme .form-select,
body.light-theme .lab-input,
body.light-theme .search-input,
body.light-theme .date-input {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
}

body.light-theme input::placeholder,
body.light-theme textarea::placeholder {
    color: #94a3b8 !important;
}

body.light-theme .search-box {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
}

/* Labels and muted text */
body.light-theme label,
body.light-theme .form-label,
body.light-theme .kpi-label,
body.light-theme .kpi-title,
body.light-theme .wallet-title,
body.light-theme .hud-title,
body.light-theme .stat-title {
    color: #475569 !important;
}

body.light-theme .kpi-sub,
body.light-theme .wallet-sub,
body.light-theme .hud-sub,
body.light-theme .stat-sub {
    color: #64748b !important;
}

/* Numeric and Key Metrics (Prevent White Fonts) */
body.light-theme .white-text,
body.light-theme .bold-cell,
body.light-theme .stat-value,
body.light-theme .kpi-value,
body.light-theme .wallet-val,
body.light-theme .hud-value,
body.light-theme .user-name,
body.light-theme .user-name-title,
body.light-theme .panel-title,
body.light-theme .modal-title,
body.light-theme .sig-sym,
body.light-theme .sig-closed-tag,
body.light-theme .live-sig-timer {
    color: #0f172a !important;
}

/* Secondary Buttons */
body.light-theme .btn-secondary,
body.light-theme .btn-table,
body.light-theme .sig-chart-btn {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}

body.light-theme .btn-secondary:hover,
body.light-theme .btn-table:hover,
body.light-theme .sig-chart-btn:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}

/* Pills & Badges */
body.light-theme .acc-pill {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}

body.light-theme .sig-type.buy,
body.light-theme .sig-type.sell,
body.light-theme .sig-surety-badge,
body.light-theme .sig-score-badge,
body.light-theme .sig-status-badge {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
}

body.light-theme .sig-lot-strip {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #475569 !important;
}

body.light-theme .sig-lot-strip b {
    color: #0f172a !important;
}

body.light-theme .sig-levels .level {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme .sig-levels .level .lvl-label {
    color: #64748b !important;
}

body.light-theme .sig-levels .level .lvl-val {
    color: #0f172a !important;
}

body.light-theme .sig-action-footer {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme .sig-footer-status {
    color: #0f172a !important;
}

body.light-theme .sig-footer-milestone {
    color: #64748b !important;
}

body.light-theme .sig-footer-milestone b {
    color: #0f172a !important;
}

/* Keep text on solid action buttons white */
body.light-theme .btn-primary,
body.light-theme .btn-submit,
body.light-theme .lab-btn-run,
body.light-theme .btn-danger,
body.light-theme .btn-success,
body.light-theme .btn-run {
    color: #ffffff !important;
}

/* ================================================================
   Competitor-Grade Options Intelligence Bar (Sensibull / Dhan Pro)
   ================================================================ */
.options-intel-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    margin-bottom: 12px;
}
body.light-theme .options-intel-bar {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
}

.intel-stat-group {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.intel-stat-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.intel-stat-label {
    font-size: 0.68rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}
body.light-theme .intel-stat-label {
    color: #64748b !important;
}

.intel-stat-val {
    font-size: 0.95rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    display: flex;
    align-items: center;
    gap: 6px;
}
body.light-theme .intel-stat-val {
    color: #0f172a !important;
}

.pcr-badge {
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 4px;
}
.badge-bullish {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-bearish {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.badge-neutral {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}
body.light-theme .badge-neutral {
    color: #475569 !important;
}

/* Fast Action Scalper Buttons (Dhan Pro / Kite Style) */
.fast-scalper-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.fast-scalp-type-group {
    display: inline-flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 6px;
    padding: 2px;
    gap: 2px;
}
body.light-theme .fast-scalp-type-group {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
}
.btn-fast-type-tab {
    background: transparent;
    border: 1px solid transparent;
    padding: 3px 9px;
    border-radius: 4px;
    font-size: 0.76rem;
    font-weight: 800;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    user-select: none;
    line-height: 1.2;
}
.btn-fast-type-tab:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.08);
}
body.light-theme .btn-fast-type-tab {
    color: #64748b !important;
}
body.light-theme .btn-fast-type-tab:hover {
    color: #0f172a !important;
    background: #e2e8f0 !important;
}
.btn-fast-type-tab.active-ce {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: #ffffff !important;
    box-shadow: 0 1px 5px rgba(16, 185, 129, 0.4);
    border-color: rgba(16, 185, 129, 0.6) !important;
}
.btn-fast-type-tab.active-pe {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: #ffffff !important;
    box-shadow: 0 1px 5px rgba(239, 68, 68, 0.4);
    border-color: rgba(239, 68, 68, 0.6) !important;
}

.btn-fast-buy-ce {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff !important;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}
.btn-fast-buy-ce:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.45);
}
.btn-fast-buy-pe {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff !important;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}
.btn-fast-buy-pe:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.45);
}
.btn-fast-exit {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.btn-fast-exit:hover {
    background: #ef4444;
    color: #ffffff !important;
}

.fast-scalp-select {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #f8fafc;
    border-radius: 5px;
    padding: 4px 8px;
    font-size: 0.78rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
}
body.light-theme .fast-scalp-select {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

.fast-scalp-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #38bdf8;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 700;
    animation: fadeInFast 0.2s ease-in-out;
}
.fast-scalp-lot-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(14, 165, 233, 0.12);
    border: 1px solid rgba(14, 165, 233, 0.35);
    color: #38bdf8;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
    user-select: none;
    transition: all 0.2s ease;
}
body.light-theme .fast-scalp-lot-badge {
    background: #f0f9ff !important;
    border-color: #bae6fd !important;
    color: #0284c7 !important;
}
.fast-scalp-margin-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(16, 185, 129, 0.18);
    border: 1px solid rgba(16, 185, 129, 0.45);
    color: #10b981;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 800;
    margin-left: 4px;
}
body.light-theme .fast-scalp-margin-tag {
    background: #ecfdf5 !important;
    border-color: #a7f3d0 !important;
    color: #059669 !important;
}
.btn-pill-clear {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-weight: 800;
    cursor: pointer;
    padding: 0 2px;
    font-size: 0.72rem;
    transition: color 0.15s;
}
.btn-pill-clear:hover {
    color: #f87171;
}

.btn-fast-buy-ce.strike-selected-active {
    box-shadow: 0 2px 14px rgba(16, 185, 129, 0.55);
}
.btn-fast-buy-pe.strike-selected-active {
    box-shadow: 0 2px 14px rgba(239, 68, 68, 0.55);
}

/* Inline Buy / Sell / Chart Buttons on Option Chain Rows */
.strike-inline-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.btn-inline-buy {
    background: rgba(16, 185, 129, 0.18);
    border: 1px solid rgba(16, 185, 129, 0.45);
    color: #34d399 !important;
    border-radius: 4px;
    font-size: 0.69rem;
    font-weight: 700;
    padding: 2px 6px;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.2;
}
.btn-inline-buy:hover {
    background: #10b981;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
}
.btn-inline-sell {
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #f87171 !important;
    border-radius: 4px;
    font-size: 0.69rem;
    font-weight: 700;
    padding: 2px 6px;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.2;
}
.btn-inline-sell:hover {
    background: #ef4444;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

.chain-row {
    cursor: pointer;
    transition: background 0.15s ease;
}
.chain-row:hover {
    background: rgba(255, 255, 255, 0.04) !important;
}
.selected-strike-row {
    background: rgba(56, 189, 248, 0.14) !important;
    outline: 1.5px solid #38bdf8 !important;
    box-shadow: inset 0 0 8px rgba(56, 189, 248, 0.25) !important;
}

@keyframes fadeInFast {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

/* Expiry Selector Dropdown & DTE Badge */
.expiry-select {
    min-width: 170px;
    max-width: 260px;
    padding: 4px 10px;
    font-size: 0.76rem;
    font-weight: 700;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(168, 85, 247, 0.35);
    color: #e9d5ff;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}
.expiry-select:hover, .expiry-select:focus {
    border-color: rgba(168, 85, 247, 0.7);
    box-shadow: 0 0 6px rgba(168, 85, 247, 0.25);
}
body.light-theme .expiry-select {
    background: #ffffff !important;
    border: 1px solid #c4b5fd !important;
    color: #6d28d9 !important;
}
body.light-theme .expiry-select:hover, body.light-theme .expiry-select:focus {
    border-color: #a78bfa !important;
}
.expiry-dte-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.4);
    color: #a78bfa;
    white-space: nowrap;
    transition: all 0.2s;
}
.expiry-dte-badge.dte-today {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #f87171;
    animation: pulse 1.5s infinite;
}
.expiry-dte-badge.dte-tomorrow {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(245, 158, 11, 0.45);
    color: #f59e0b;
}
body.light-theme .expiry-dte-badge {
    background: rgba(139, 92, 246, 0.1) !important;
    border-color: #c4b5fd !important;
    color: #7c3aed !important;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Strike Buildup Badges (Sensibull / Quantsapp style) */
.buildup-pill {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    white-space: nowrap;
    letter-spacing: 0.2px;
}
.buildup-long {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.35);
}
.buildup-short {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.35);
}
.buildup-covering {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
}
.buildup-unwinding {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

/* Greek Toggle & Sound Alert Button Styling */
.btn-greeks-toggle {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-greeks-toggle:hover,
.btn-greeks-toggle.active {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(139, 92, 246, 0.35));
    border-color: #a855f7;
    color: #c084fc;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

.btn-sound-toggle {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}
.btn-sound-toggle:hover,
.btn-sound-toggle.active {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

body.light-theme .btn-greeks-toggle {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
}
body.light-theme .btn-greeks-toggle.active {
    background: #f3e8ff;
    border-color: #a855f7;
    color: #7e22ce;
}
body.light-theme .btn-sound-toggle {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
}

.greek-col {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
}



