/* Bulls & Bears - UI Enhancement Design System v2.0 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Dark Mode (Default) */
  --bg-base: #060d1b;
  --bg-surface: #0d1f35;
  --bg-card: #0f2540;
  --bg-elevated: #162d47;
  --border: #1a3a5c;
  --border-bright: #1e4a72;
  --text-primary: #e8f0fe;
  --text-secondary: #7a9bbf;
  --text-muted: #4a6a8a;
  --accent-green: #00c896;
  --accent-red: #ff4466;
  --accent-blue: #3b82f6;
  --accent-gold: #f5a623;
  --accent-purple: #8b5cf6;
  --buy-bg: rgba(0,200,150,0.1);
  --sell-bg: rgba(255,68,102,0.1);
  --glass-bg: rgba(13,31,53,0.8);
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --radius: 12px;
  --radius-sm: 8px;
}

body.light-mode {
  --bg-base: #f0f2f5;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-elevated: #f8f9fa;
  --border: #e1e4e8;
  --border-bright: #d1d5da;
  --text-primary: #1f2328;
  --text-secondary: #57606a;
  --text-muted: #6e7781;
  --buy-bg: rgba(0,200,150,0.1);
  --sell-bg: rgba(255,68,102,0.1);
  --glass-bg: rgba(255,255,255,0.8);
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body.ui-v2 {
  font-family: 'Inter', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
}

/* ── Sidebar Layout ── */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 64px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: width 0.2s ease;
}
.sidebar:hover { width: 220px; }
.sidebar:hover .nav-label { opacity: 1; width: auto; }

.sidebar-logo {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px;
  flex-shrink: 0;
}

.nav-item {
  width: 100%;
  display: flex; align-items: center;
  gap: 12px;
  padding: 12px 12px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 0;
  transition: all 0.15s ease;
  white-space: nowrap;
  position: relative;
}
.nav-item:hover { color: var(--text-primary); background: var(--bg-elevated); }
.nav-item.active { color: var(--accent-blue); background: rgba(59,130,246,0.1); border-right: 2px solid var(--accent-blue); }
.nav-item svg { flex-shrink: 0; width: 20px; height: 20px; }
.nav-label { opacity: 0; width: 0; overflow: hidden; font-size: 13px; font-weight: 500; transition: all 0.2s ease; }

.main-content { margin-left: 64px; flex: 1; display: flex; flex-direction: column; }

/* ── Top Bar ── */
.topbar {
  height: 56px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.market-status {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
}
.market-status.open { background: rgba(0,200,150,0.1); color: var(--accent-green); border: 1px solid rgba(0,200,150,0.3); }
.market-status.closed { background: rgba(255,68,102,0.1); color: var(--accent-red); border: 1px solid rgba(255,68,102,0.3); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: var(--border-bright); }
.card.clickable { cursor: pointer; }
.card.clickable:hover { transform: translateY(-1px); border-color: var(--accent-blue); }

/* ── Index Cards ── */
.index-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex; justify-content: space-between; align-items: center;
}
.index-card:hover { border-color: var(--accent-blue); transform: translateY(-1px); box-shadow: var(--shadow); }
.index-name { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-secondary); }
.index-price { font-size: 22px; font-weight: 700; color: var(--text-primary); margin-top: 4px; font-variant-numeric: tabular-nums; }
.index-change.up { color: var(--accent-green); }
.index-change.down { color: var(--accent-red); }
.badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.badge.buy { background: var(--buy-bg); color: var(--accent-green); border: 1px solid rgba(0,200,150,0.3); }
.badge.sell { background: var(--sell-bg); color: var(--accent-red); border: 1px solid rgba(255,68,102,0.3); }
.badge.hold { background: rgba(245,166,35,0.1); color: var(--accent-gold); border: 1px solid rgba(245,166,35,0.3); }

/* ── AI Score Gauge ── */
.ai-score-ring { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.ai-score-ring svg { transform: rotate(-90deg); }
.ai-score-center { position: absolute; text-align: center; }
.ai-score-number { font-size: 28px; font-weight: 800; }
.ai-score-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-secondary); }

/* ── Tables ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { padding: 10px 14px; text-align: left; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); border-bottom: 1px solid var(--border); background: var(--bg-surface); }
.data-table td { padding: 12px 14px; border-bottom: 1px solid rgba(26,58,92,0.5); }
.data-table tr:hover td { background: var(--bg-elevated); }
.data-table tr { cursor: pointer; transition: background 0.1s; }

/* ── Tabs ── */
.tab-nav { display: flex; gap: 2px; background: var(--bg-surface); border-radius: var(--radius-sm); padding: 4px; border: 1px solid var(--border); }
.tab-btn { padding: 7px 14px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--text-muted); background: none; border: none; cursor: pointer; transition: all 0.15s; white-space: nowrap; }
.tab-btn.active { background: var(--bg-elevated); color: var(--text-primary); }
.tab-btn:hover:not(.active) { color: var(--text-primary); }

/* ── Watchlist ── */
.watchlist-row {
  display: flex; align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(26,58,92,0.4);
  cursor: pointer; transition: background 0.1s;
}
.watchlist-row:hover { background: var(--bg-elevated); }
.watchlist-row.active { background: rgba(59,130,246,0.08); border-left: 2px solid var(--accent-blue); }
.wl-symbol { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.wl-name { font-size: 11px; color: var(--text-muted); }
.wl-price { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; margin-left: auto; }
.wl-change { font-size: 11px; font-weight: 600; text-align: right; }
.wl-change.up { color: var(--accent-green); }
.wl-change.down { color: var(--accent-red); }

/* ── Pricing Cards ── */
.pricing-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 32px; transition: all 0.2s; }
.pricing-card.featured { border-color: var(--accent-blue); background: linear-gradient(135deg, rgba(59,130,246,0.08), var(--bg-card)); position: relative; }
.pricing-card.featured::before { content: 'MOST POPULAR'; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--accent-blue); color: white; font-size: 10px; font-weight: 800; letter-spacing: 0.1em; padding: 4px 14px; border-radius: 20px; }
.price-amount { font-size: 40px; font-weight: 800; color: var(--text-primary); }
.price-period { font-size: 14px; color: var(--text-muted); }
.feature-list { list-style: none; margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.feature-list li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-secondary); }
.feature-list li.yes { color: var(--text-primary); }
.feature-check { width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 10px; }
.feature-check.yes { background: rgba(0,200,150,0.15); color: var(--accent-green); }
.feature-check.no { background: rgba(255,68,102,0.1); color: var(--accent-red); }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 18px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; border: none; cursor: pointer; transition: all 0.15s; }
.btn-primary { background: var(--accent-blue); color: white; }
.btn-primary:hover { background: #2563eb; transform: translateY(-1px); }
.btn-success { background: var(--accent-green); color: #060d1b; }
.btn-success:hover { background: #00b085; }
.btn-danger { background: var(--accent-red); color: white; }
.btn-danger:hover { background: #e0304f; }
.btn-outline { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--accent-blue); color: var(--text-primary); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 13px 28px; font-size: 15px; }

/* ── Inputs ── */
.input {
  width: 100%; background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 13px; color: var(--text-primary);
  font-size: 13px; font-family: inherit; outline: none; transition: border-color 0.15s;
}
.input:focus { border-color: var(--accent-blue); }
.input::placeholder { color: var(--text-muted); }

/* ── Sparkline Container ── */
.sparkline { width: 80px; height: 32px; }

/* ── Section Headers ── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title { font-size: 14px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.section-icon { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; }

/* ── Scrollbars ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 2px; }

/* ── Responsive ── */
.page-grid { display: grid; gap: 16px; padding: 20px; }
.grid-2 { grid-template-columns: repeat(2,1fr); }
.grid-3 { grid-template-columns: repeat(3,1fr); }
.grid-4 { grid-template-columns: repeat(4,1fr); }
.grid-5 { grid-template-columns: repeat(5,1fr); }
@media(max-width:1200px){ .grid-5{grid-template-columns:repeat(3,1fr)} .grid-4{grid-template-columns:repeat(2,1fr)} }
@media(max-width:768px){ 
  .grid-3,.grid-4,.grid-5{grid-template-columns:1fr} 
  .grid-2{grid-template-columns:1fr} 
  .sidebar{display:none; position: fixed !important; top: 0; left: 0; bottom: 0; z-index: 9999 !important;} 
  .sidebar.mobile-open { display: flex !important; width: 220px !important; box-shadow: 0 0 50px rgba(0,0,0,0.8); animation: slideInLeft 0.2s ease-out; }
  .sidebar.mobile-open .nav-label { opacity: 1; width: auto; }
  .main-content{margin-left:0} 
}
@keyframes slideInLeft {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ── Subscription badge ── */
.plan-badge { padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.plan-badge.free { background: rgba(122,155,191,0.15); color: var(--text-secondary); }
.plan-badge.pro { background: rgba(59,130,246,0.15); color: var(--accent-blue); }
.plan-badge.elite { background: rgba(245,166,35,0.15); color: var(--accent-gold); }

/* ── Financials table (Screener-style) ── */
.financials-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.financials-table th { padding: 8px 12px; font-weight: 600; font-size: 11px; color: var(--text-muted); text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--bg-surface); }
.financials-table th:first-child { text-align: left; }
.financials-table td { padding: 8px 12px; border-bottom: 1px solid rgba(26,58,92,0.4); text-align: right; color: var(--text-secondary); }
.financials-table td:first-child { text-align: left; color: var(--text-primary); font-weight: 500; }
.financials-table tr:hover td { background: var(--bg-elevated); }

/* ── Ticker animation ── */
@keyframes flash-green { 0%{background:rgba(0,200,150,0.3)} 100%{background:transparent} }
@keyframes flash-red { 0%{background:rgba(255,68,102,0.3)} 100%{background:transparent} }
.tick-up { animation: flash-green 0.6s ease; }
.tick-down { animation: flash-red 0.6s ease; }

/* ── Tailwind Compatibility ── */
.bg-dark-card { background: var(--bg-card) !important; }
.bg-dark-bg { background: var(--bg-surface) !important; }
.border-dark-border { border-color: var(--border) !important; }
.text-dark-muted { color: var(--text-muted) !important; }
.bg-brand-blue { background: var(--accent-blue) !important; }
.text-brand-blue { color: var(--accent-blue) !important; }

/* ── Global Layout Fixes ── */
.bg-elevated { background-color: var(--bg-elevated) !important; }
.main-content {
    min-height: 100vh;
    width: calc(100% - 64px);
    transition: width 0.2s ease;
}
.sidebar:hover + .main-content {
    width: calc(100% - 220px);
    margin-left: 220px;
}

.card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.data-table {
    border-radius: var(--radius-sm);
    overflow: hidden;
}

/* ── Typography fixes ── */
h1, h2, h3, h4 { color: var(--text-primary); }

/* ── Flex gap polyfill ── */
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }

/* ── Tooltip ── */
.tooltip-wrap { position: relative; }
.tooltip-wrap:hover .tooltip-box { opacity: 1; pointer-events: auto; }
.tooltip-box { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; font-size: 11px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.15s; z-index: 200; }

/* ═══════════════════════════════════════════════════════════════════════════
   COMPREHENSIVE LIGHT MODE OVERRIDES
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Sidebar Light ── */
body.light-mode .sidebar {
  background: #ffffff;
  border-right-color: #e1e4e8;
}
body.light-mode .nav-item { color: #57606a; }
body.light-mode .nav-item:hover { color: #1f2328; background: #f6f8fa; }
body.light-mode .nav-item.active { color: var(--accent-blue); background: rgba(59,130,246,0.08); border-right-color: var(--accent-blue); }

/* ── Topbar Light ── */
body.light-mode .topbar {
  background: #ffffff;
  border-bottom-color: #e1e4e8;
}
body.light-mode .topbar h1 { color: #1f2328; }

/* ── Profile Dropdown Light ── */
body.light-mode .topbar-right > div > div[class*="bg-"] {
  background: #f0f4f9 !important;
  border-color: #d1d5da !important;
}
body.light-mode .topbar-right .profile-name { color: #1f2328 !important; }
body.light-mode #profile-dropdown {
  background: #ffffff !important;
  border-color: #d1d5da !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
body.light-mode #profile-dropdown p { color: #57606a; }
body.light-mode #profile-dropdown .font-bold,
body.light-mode #profile-dropdown .profile-email { color: #1f2328 !important; }
body.light-mode #profile-dropdown a {
  color: #57606a !important;
}
body.light-mode #profile-dropdown a:hover {
  background: #f6f8fa !important;
  color: #1f2328 !important;
}
body.light-mode #profile-dropdown div[class*="bg-"] {
  background: #e1e4e8 !important;
}

/* ── Body Background ── */
body.light-mode.ui-v2 {
  background: #f0f2f5;
}

/* ── Cards Light ── */
body.light-mode .card,
body.light-mode [class*="bg-dark-sidebar"],
body.light-mode [class*="bg-dark-card"],
body.light-mode .bg-dark-card,
body.light-mode .bg-dark-bg {
  background: #ffffff !important;
  border-color: #e1e4e8 !important;
}

/* ── Text Overrides ── */
body.light-mode h1, body.light-mode h2, body.light-mode h3, body.light-mode h4 {
  color: #1f2328 !important;
}
body.light-mode .text-white,
body.light-mode [class*="text-gray-200"],
body.light-mode [class*="text-gray-100"],
body.light-mode [class*="text-gray-900"],
body.light-mode [class*="dark:text-white"] {
  color: #1f2328 !important;
}
body.light-mode [class*="text-gray-400"],
body.light-mode [class*="text-gray-500"],
body.light-mode [class*="text-dark-muted"] {
  color: #57606a !important;
}

/* ── Settings Tabs ── */
body.light-mode .tab-btn {
  color: #57606a;
}
body.light-mode .tab-btn.active,
body.light-mode .tab-btn[class*="text-brand-blue"] {
  color: var(--accent-blue) !important;
}

/* ── Settings Panels & Form Inputs ── */
body.light-mode [class*="bg-gray-50"],
body.light-mode [class*="dark:bg-dark-bg"] {
  background: #f6f8fa !important;
}
body.light-mode input[type="text"],
body.light-mode input[type="number"],
body.light-mode input[type="password"],
body.light-mode input[type="email"],
body.light-mode select,
body.light-mode textarea {
  background: #ffffff !important;
  border-color: #d1d5da !important;
  color: #1f2328 !important;
}
body.light-mode input::placeholder { color: #8b949e !important; }
body.light-mode label { color: #57606a !important; }
body.light-mode .text-sm.font-medium { color: #57606a !important; }

/* ── Broker Panels ── */
body.light-mode .broker-panel {
  color: #1f2328;
}
body.light-mode .broker-tab-btn {
  color: #57606a !important;
}
body.light-mode .broker-tab-btn[class*="text-brand-blue"] {
  color: var(--accent-blue) !important;
  background: #ffffff !important;
}

/* ── Borders ── */
body.light-mode [class*="border-gray-200"],
body.light-mode [class*="border-gray-100"],
body.light-mode [class*="dark:border-dark-border"],
body.light-mode [class*="border-dark-border"] {
  border-color: #e1e4e8 !important;
}

/* ── Stock Detail Page ── */
body.light-mode .stock-header-strip {
  border-bottom-color: #e1e4e8;
}
body.light-mode .stock-header-strip .stock-price { color: #1f2328; }
body.light-mode .stock-meta { color: #57606a; }
body.light-mode .detail-tabs { border-bottom-color: #e1e4e8; }
body.light-mode .detail-tab { color: #57606a; }
body.light-mode .detail-tab.active { color: var(--accent-blue); border-bottom-color: var(--accent-blue); }
body.light-mode .detail-tab:hover { color: #1f2328; }
body.light-mode .key-metric-card,
body.light-mode .tech-level-item {
  background: #f6f8fa !important;
  border-color: #e1e4e8 !important;
}
body.light-mode .key-metric-card .metric-value,
body.light-mode .tech-level-item .level-value { color: #1f2328 !important; }
body.light-mode .key-metric-card .metric-label,
body.light-mode .tech-level-item .level-label { color: #57606a !important; }
body.light-mode .swot-card li { color: #1f2328; }
body.light-mode .peer-table td { color: #1f2328; }
body.light-mode .peer-table thead th { color: #57606a; }

/* ── SWOT Cards Light ── */
body.light-mode .swot-card {
  border-color: rgba(0,0,0,0.08) !important;
}
body.light-mode .swot-card.strengths  { background: linear-gradient(135deg, rgba(35,134,54,0.08), rgba(35,134,54,0.02)); }
body.light-mode .swot-card.weaknesses { background: linear-gradient(135deg, rgba(218,54,51,0.08), rgba(218,54,51,0.02)); }
body.light-mode .swot-card.opportunities { background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(59,130,246,0.02)); }
body.light-mode .swot-card.threats { background: linear-gradient(135deg, rgba(245,158,11,0.08), rgba(245,158,11,0.02)); }

/* ── DVM Gauges Light ── */
body.light-mode .dvm-gauge .gauge-bg { stroke: rgba(0,0,0,0.06); }
body.light-mode .dvm-gauge .gauge-label { color: #57606a; }
body.light-mode .dvm-overall { background: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.06); }
body.light-mode .dvm-overall .overall-label { color: #57606a; }

/* ── Recommendation Badge Light ── */
body.light-mode .reco-reasoning { color: #57606a; }

/* ── Financials Table Light ── */
body.light-mode .fin-table-enhanced thead th {
  background: #f6f8fa;
  color: #57606a;
  border-bottom-color: #e1e4e8;
}
body.light-mode .fin-table-enhanced td {
  color: #1f2328;
  border-bottom-color: #e1e4e8;
}
body.light-mode .fin-table-enhanced td:first-child { color: #1f2328; }
body.light-mode .fin-table-enhanced tbody tr:hover { background: #f0f4f9; }

/* ── Tables Generic Light ── */
body.light-mode .data-table th {
  background: #f6f8fa;
  color: #57606a;
  border-bottom-color: #e1e4e8;
}
body.light-mode .data-table td {
  border-bottom-color: #e1e4e8;
  color: #1f2328;
}
body.light-mode .data-table tr:hover td { background: #f6f8fa; }

/* ── Scrollbar Light ── */
body.light-mode ::-webkit-scrollbar-thumb { background: #c9d1d9; }

/* ── Pricing Cards Light ── */
body.light-mode .pricing-card {
  background: #ffffff;
  border-color: #e1e4e8;
}
body.light-mode .price-amount { color: #1f2328; }

/* ── Info Banners Light ── */
body.light-mode [class*="bg-blue-50"],
body.light-mode [class*="dark:bg-blue-900"] {
  background: #eff6ff !important;
}
body.light-mode [class*="text-blue-700"],
body.light-mode [class*="dark:text-blue-300"] {
  color: #1e40af !important;
}

/* ── Chart container still dark for readability ── */
body.light-mode #tv-chart,
body.light-mode #tv-chart-hud,
body.light-mode #macd-info-badge,
body.light-mode #rsi-info-badge {
  /* Keep chart dark even in light mode for trader ergonomics */
}

/* ── Skeleton Loader Light ── */
body.light-mode .skeleton-line {
  background: linear-gradient(90deg, #e1e4e8 25%, #f0f2f5 50%, #e1e4e8 75%);
  background-size: 200% 100%;
}

/* ── Version Badge Light ── */
body.light-mode div[class*="fixed bottom-1"] { color: #8b949e !important; }

/* ── Light Mode Chart Controls Override ── */
body.light-mode .chart-controls-wrapper,
body.light-mode #tv-chart-hud {
  background: rgba(255, 255, 255, 0.95) !important;
  border-color: #d0d7de !important;
  color: #24292f !important;
}
body.light-mode #tv-chart-hud span { color: #24292f !important; }
body.light-mode .drawing-toolbar {
  background: #f6f8fa;
  border-color: #d0d7de;
}
body.light-mode .drawing-toolbar .draw-btn { color: #57606a; }
body.light-mode .drawing-toolbar .draw-btn:hover { background: rgba(9, 105, 218, 0.1); color: #0969da; }
body.light-mode .drawing-toolbar .draw-btn.active { background: rgba(9, 105, 218, 0.15); color: #0969da; }

/* ── Settings Tooltip Fix ── */
.tooltip-wrap { position: relative; display: inline-block; }
.tooltip-wrap .tooltip-box {
  display: none; position: absolute; z-index: 9999 !important; 
  background-color: #0d1f35 !important; color: #e6edf3 !important; border: 1px solid #1a3a5c !important;
  padding: 10px 14px; border-radius: 6px; width: max-content; max-width: 280px;
  top: 100%; margin-top: 5px; box-shadow: 0 8px 24px rgba(0,0,0,0.8) !important;
  left: 50%; transform: translateX(-50%);
  opacity: 1 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  font-size: 11px !important;
  line-height: 1.5 !important;
  pointer-events: auto;
}
.tooltip-wrap .tooltip-box * {
  opacity: 1 !important;
  color: #e6edf3 !important;
  background: transparent !important;
}
.tooltip-wrap .tooltip-box .font-bold,
.tooltip-wrap .tooltip-box p.font-bold {
  color: #ffffff !important;
  font-size: 12px !important;
}
.tooltip-wrap:hover .tooltip-box { display: block; }
body.light-mode .tooltip-wrap .tooltip-box {
  background-color: #ffffff !important; color: #24292f !important; border-color: #d0d7de !important; box-shadow: 0 8px 24px rgba(0,0,0,0.15) !important;
}
body.light-mode .tooltip-wrap .tooltip-box * {
  color: #24292f !important;
}

/* ── Light Mode Indicator Tabs & Chart Container Override ── */
body.light-mode .indicator-toggles,
body.light-mode .elite-indicators {
  background: #f6f8fa !important;
  border-color: #d0d7de !important;
}
body.light-mode .chart-wrapper-container {
  background: #ffffff !important;
  border: 1px solid #d0d7de !important;
}
/* ── Chart Drawing Toolbar ── */
.drawing-toolbar {
  display: flex;
  gap: 2px;
  background: #0b1726;
  border: 1px solid #1a3a5c;
  border-radius: 4px;
  padding: 2px;
}
.drawing-toolbar .draw-btn {
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #8b949e;
  cursor: pointer;
  border: none;
  background: none;
  border-radius: 3px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.drawing-toolbar .draw-btn:hover { color: #e6edf3; background: rgba(88,166,255,0.1); }
.drawing-toolbar .draw-btn.active { color: #58a6ff; background: rgba(88,166,255,0.15); }

