@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* =============================================================================
   BBot Institutional Trading Terminal - Global Theme System (Light & Dark)
   High-Contrast WCAG AAA-Compliant Institutional Design (Linear/TradingView Grade)
   Font Family: Inter (Fallback: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif)
   Developed by Algoh.in
   ============================================================================= */

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

/* -----------------------------------------------------------------------------
   1. CSS VARIABLES & DESIGN TOKENS
   ----------------------------------------------------------------------------- */
:root {
    --bg-page: #080c14;
    --bg-surface: #101726;
    --bg-surface-subtle: #0b0f19;
    --bg-surface-muted: #1e293b;
    --border-subtle: #1e293b;
    --border-medium: #334155;
    --border-strong: #475569;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --hover-bg: #334155;
    --hover-bg-subtle: #1e293b;
    --hover-text: #ffffff;
    color-scheme: dark;
}

html.theme-light {
    --bg-page: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-subtle: #f8fafc;
    --bg-surface-muted: #f1f5f9;
    --border-subtle: #e2e8f0;
    --border-medium: #cbd5e1;
    --border-strong: #94a3b8;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #475569;
    --text-dim: #64748b;
    --hover-bg: #e2e8f0;
    --hover-bg-subtle: #f1f5f9;
    --hover-text: #0f172a;
    color-scheme: light;
}

/* Base Body Transition & Colors */
html, body {
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

html.theme-light body {
    background-color: var(--bg-page) !important;
    color: var(--text-primary) !important;
}

/* -----------------------------------------------------------------------------
   2. CRITICAL: PURE WHITE TEXT & ICONS ON COLORED ACTION BUTTONS & ACTIVE PILLS
   Preserved in BOTH Light & Dark Modes (Never force dark text on colored buttons!)
   ----------------------------------------------------------------------------- */
#killSwitchBtn,
#killSwitchBtn *,
#saveTokenBtn,
#saveTokenBtn *,
#confirmKillBtn,
#confirmKillBtn *,
#btnTestTgAll,
#btnTestTgAll *,
#copyLogsBtn,
#copyLogsBtn *,
#btnSync,
#btnSync *,
#btnScan,
#btnScan *,
button.bg-purple-600,
button.bg-purple-600 *,
.stock-pill.bg-emerald-600,
.stock-pill.bg-emerald-600 *,
.stock-pill.bg-blue-600,
.stock-pill.bg-blue-600 *,
[id*="Modal"] button[type="submit"],
[id*="Modal"] button[type="submit"] *,
[id*="Modal"] button.bg-blue-600,
[id*="Modal"] button.bg-blue-600 *,
[id*="Modal"] button.bg-sky-600,
[id*="Modal"] button.bg-sky-600 *,
[id*="Modal"] button.bg-emerald-600,
[id*="Modal"] button.bg-emerald-600 *,
[id*="Modal"] button.bg-red-600,
[id*="Modal"] button.bg-red-600 *,
button.bg-red-600,
button.bg-red-600 *,
button.bg-blue-600,
button.bg-blue-600 *,
button.bg-sky-600,
button.bg-sky-600 *,
button.bg-emerald-600,
button.bg-emerald-600 *,
button.btn-colored,
button.btn-colored * {
    color: #ffffff !important;
}

/* Specific icon color safety */
#killSwitchBtn i,
#saveTokenBtn i,
#saveTokenBtn svg,
#confirmKillBtn i,
#btnTestTgAll i,
#copyLogsBtn i,
[id*="Modal"] button[type="submit"] i {
    color: #ffffff !important;
}

/* Active Stock Pill explicit vibrant green & white text */
.stock-pill.bg-emerald-600 {
    background-color: #10b981 !important;
    border-color: #059669 !important;
    color: #ffffff !important;
}

/* -----------------------------------------------------------------------------
   3. HAMBURGER BUTTON COMPONENT (.hamburger-btn)
   Crisp light slate with dark icon in light mode, smooth hover
   ----------------------------------------------------------------------------- */
.hamburger-btn {
    user-select: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Dark Theme Default */
html:not(.theme-light) .hamburger-btn {
    background-color: #1e293b;
    border: 1px solid #334155;
    color: #e2e8f0;
}
html:not(.theme-light) .hamburger-btn:hover {
    background-color: #334155;
    color: #ffffff;
    border-color: #475569;
}

/* Light Theme - Clean light surface before hover, smooth darker hover */
html.theme-light .hamburger-btn {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #1e293b !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}
html.theme-light .hamburger-btn:hover {
    background-color: #e2e8f0 !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.08) !important;
}

/* -----------------------------------------------------------------------------
   4. THEME TOGGLE BUTTON COMPONENT (.theme-toggle-btn)
   ----------------------------------------------------------------------------- */
.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    user-select: none;
}

/* Top Bar / Floating Theme Toggle in Dark Theme */
html:not(.theme-light) .theme-toggle-btn:not(.sidebar-theme-item) {
    background-color: #1e293b;
    color: #e2e8f0;
    border: 1px solid #334155;
}
html:not(.theme-light) .theme-toggle-btn:not(.sidebar-theme-item):hover {
    background-color: #334155;
    color: #ffffff;
    border-color: #475569;
}

/* Top Bar / Floating Theme Toggle in Light Theme */
html.theme-light .theme-toggle-btn:not(.sidebar-theme-item) {
    background-color: #ffffff !important;
    color: #1e293b !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}
html.theme-light .theme-toggle-btn:not(.sidebar-theme-item):hover {
    background-color: #e2e8f0 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.08) !important;
}

/* Theme Toggle inside Collapsible Sidebar Rail */
#collapsibleSidebar .theme-toggle-btn {
    display: flex !important;
    justify-content: flex-start !important;
    width: 100% !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* -----------------------------------------------------------------------------
   5. TOP NAVBAR & ACTION PILL BUTTONS (Charts, Trades, Dashboard, Audit, Calibration)
   ----------------------------------------------------------------------------- */
html.theme-light header {
    background-color: rgba(255, 255, 255, 0.98) !important;
    border-bottom: 1px solid var(--border-subtle) !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04) !important;
}

/* Charts Pill */
html.theme-light .header-nav-charts,
html.theme-light header a.bg-emerald-950\/50,
html.theme-light header a.bg-emerald-950\/60,
html.theme-light header a.bg-emerald-950\/70 {
    background-color: #ecfdf5 !important;
    border: 1px solid #a7f3d0 !important;
    color: #065f46 !important;
    font-weight: 700 !important;
}
html.theme-light .header-nav-charts:hover,
html.theme-light header a.bg-emerald-950\/50:hover,
html.theme-light header a.bg-emerald-950\/60:hover,
html.theme-light header a.bg-emerald-950\/70:hover {
    background-color: #d1fae5 !important;
    border-color: #6ee7b7 !important;
    color: #064e3b !important;
}

/* Audit Logs Pill */
html.theme-light .header-nav-audit,
html.theme-light header a.bg-indigo-950\/50,
html.theme-light header a.bg-indigo-950\/60 {
    background-color: #eef2ff !important;
    border: 1px solid #c7d2fe !important;
    color: #4338ca !important;
    font-weight: 700 !important;
}
html.theme-light .header-nav-audit:hover,
html.theme-light header a.bg-indigo-950\/50:hover,
html.theme-light header a.bg-indigo-950\/60:hover {
    background-color: #e0e7ff !important;
    border-color: #a5b4fc !important;
    color: #3730a3 !important;
}

/* Dashboard Pill */
html.theme-light .header-nav-dashboard,
html.theme-light header a.bg-blue-950\/70,
html.theme-light header a.bg-blue-950\/60 {
    background-color: #eff6ff !important;
    border: 1px solid #bfdbfe !important;
    color: #1d4ed8 !important;
    font-weight: 700 !important;
}
html.theme-light .header-nav-dashboard:hover,
html.theme-light header a.bg-blue-950\/70:hover,
html.theme-light header a.bg-blue-950\/60:hover {
    background-color: #dbeafe !important;
    border-color: #93c5fd !important;
    color: #1e40af !important;
}

/* Trades Pill */
html.theme-light .header-nav-trades {
    background-color: #ecfdf5 !important;
    border: 1px solid #a7f3d0 !important;
    color: #065f46 !important;
    font-weight: 700 !important;
}
html.theme-light .header-nav-trades:hover {
    background-color: #d1fae5 !important;
    border-color: #6ee7b7 !important;
    color: #064e3b !important;
}

/* Calibration Pill */
html.theme-light .header-nav-calibration {
    background-color: #fffbeb !important;
    border: 1px solid #fde68a !important;
    color: #92400e !important;
    font-weight: 700 !important;
}
html.theme-light .header-nav-calibration:hover {
    background-color: #fef3c7 !important;
    border-color: #fcd34d !important;
    color: #78350f !important;
}

/* Strategies Hub Pill */
html.theme-light .header-nav-strategies {
    background-color: #eef2ff !important;
    border: 1px solid #c7d2fe !important;
    color: #3730a3 !important;
    font-weight: 700 !important;
}
html.theme-light .header-nav-strategies:hover {
    background-color: #e0e7ff !important;
    border-color: #a5b4fc !important;
    color: #312e81 !important;
}

/* Market Status Badge in Header */
html.theme-light #headerMarketStatusBadge {
    background-color: #fef3c7 !important;
    border: 1px solid #fde68a !important;
    color: #92400e !important;
}
html.theme-light #headerMarketStatusBadge .text-amber-400 {
    color: #92400e !important;
}

/* -----------------------------------------------------------------------------
   6. ALL SECONDARY / UTILITY BUTTONS (bg-gray-800, bg-gray-700)
   Crisp light slate before hover, high contrast hover
   ----------------------------------------------------------------------------- */
html.theme-light .bg-gray-800:not(.badge-exclude):not(button.bg-red-600):not(button.bg-blue-600),
html.theme-light .bg-gray-700:not(.badge-exclude):not(button.bg-red-600):not(button.bg-blue-600) {
    background-color: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #334155 !important;
}

html.theme-light .bg-gray-800:hover:not(.badge-exclude):not(button.bg-red-600):not(button.bg-blue-600),
html.theme-light .bg-gray-700:hover:not(.badge-exclude):not(button.bg-red-600):not(button.bg-blue-600),
html.theme-light .hover\:bg-gray-700:hover:not(button.bg-red-600),
html.theme-light .hover\:bg-gray-800:hover:not(button.bg-red-600),
html.theme-light .hover\:bg-gray-800\/20:hover,
html.theme-light .hover\:bg-gray-800\/40:hover,
html.theme-light .hover\:bg-gray-800\/50:hover,
html.theme-light .hover\:bg-gray-800\/80:hover {
    background-color: #e2e8f0 !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
}

/* -----------------------------------------------------------------------------
   7. MAIN CARDS, PANELS & CONTAINERS (Light Surface in Light Mode)
   ----------------------------------------------------------------------------- */
html.theme-light .bg-\[\#080c14\],
html.theme-light .bg-\[\#090d16\],
html.theme-light .bg-\[\#090D16\],
html.theme-light .bg-\[\#0e1626\],
html.theme-light .bg-\[\#101726\],
html.theme-light .bg-\[\#111927\],
html.theme-light .bg-\[\#0a0f1d\],
html.theme-light .bg-gray-950,
html.theme-light .bg-gray-900,
html.theme-light .bg-slate-950,
html.theme-light .bg-slate-900 {
    background-color: var(--bg-surface) !important;
    border-color: var(--border-subtle) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05) !important;
}

/* Inner Sub-Cards, Stripes and Sections */
html.theme-light .bg-\[\#080d17\],
html.theme-light .bg-\[\#090e1a\],
html.theme-light .bg-\[\#0b0709\],
html.theme-light .bg-\[\#0b0f19\],
html.theme-light .bg-\[\#0b101d\],
html.theme-light .bg-\[\#0d131f\],
html.theme-light .bg-\[\#0d1424\],
html.theme-light .bg-\[\#111827\],
html.theme-light .bg-\[\#181119\],
html.theme-light .bg-gray-900\/60,
html.theme-light .bg-gray-900\/80,
html.theme-light .bg-gray-900\/90,
html.theme-light .bg-gray-800\/80,
html.theme-light .bg-gray-800\/60,
html.theme-light .bg-gray-800\/50,
html.theme-light .bg-gray-800\/40,
html.theme-light .bg-gray-800\/20,
html.theme-light .bg-\[\#0e1626\]\/50 {
    background-color: var(--bg-surface-subtle) !important;
    border-color: var(--border-subtle) !important;
    color: var(--text-secondary) !important;
}

/* -----------------------------------------------------------------------------
   8. TYPOGRAPHY & HIGH CONTRAST (Never allow white/dim text on light surfaces)
   Excludes colored action buttons and active stock pills
   ----------------------------------------------------------------------------- */
html.theme-light h1,
html.theme-light h2,
html.theme-light h3 {
    color: var(--text-primary) !important;
}

html.theme-light .text-white:not(button):not(button *):not(.stock-pill):not([id*="Btn"]):not([id*="Btn"] *),
html.theme-light .text-gray-100:not(button):not(button *):not(.stock-pill),
html.theme-light .text-gray-200:not(button):not(button *):not(.stock-pill),
html.theme-light .text-slate-100:not(button):not(button *):not(.stock-pill),
html.theme-light .text-slate-200:not(button):not(button *):not(.stock-pill),
html.theme-light .font-extrabold:not(button):not(button *):not(.stock-pill),
html.theme-light .font-black:not(button):not(button *):not(.stock-pill) {
    color: var(--text-primary) !important;
}

html.theme-light .text-gray-300:not(button.bg-red-600):not(button.bg-blue-600),
html.theme-light .text-slate-300 {
    color: var(--text-secondary) !important;
}

html.theme-light .text-gray-400,
html.theme-light .text-slate-400 {
    color: var(--text-muted) !important;
}

html.theme-light .text-gray-500,
html.theme-light .text-slate-500 {
    color: var(--text-dim) !important;
}

/* Vivid Accents with WCAG AAA Contrast (Deep Accessible Shades in Light Mode) */
html.theme-light .text-blue-400,
html.theme-light .text-blue-300,
html.theme-light .text-blue-200 {
    color: #1d4ed8 !important; /* Blue-700 */
}
html.theme-light .text-emerald-400,
html.theme-light .text-emerald-300,
html.theme-light .text-emerald-200,
html.theme-light .text-green-400,
html.theme-light .text-green-300 {
    color: #047857 !important; /* Emerald-700 */
}
html.theme-light .text-cyan-400,
html.theme-light .text-cyan-300,
html.theme-light .text-cyan-200 {
    color: #0e7490 !important; /* Cyan-700 */
}
html.theme-light .text-teal-400,
html.theme-light .text-teal-300,
html.theme-light .text-teal-200 {
    color: #0f766e !important; /* Teal-700 */
}
html.theme-light .text-amber-400,
html.theme-light .text-amber-300,
html.theme-light .text-amber-200,
html.theme-light .text-yellow-400,
html.theme-light .text-yellow-300 {
    color: #b45309 !important; /* Amber-700 */
}
html.theme-light .text-purple-400,
html.theme-light .text-purple-300 {
    color: #6d28d9 !important; /* Purple-700 */
}
html.theme-light .text-indigo-400,
html.theme-light .text-indigo-300 {
    color: #4338ca !important; /* Indigo-700 */
}
html.theme-light .text-rose-400,
html.theme-light .text-rose-300,
html.theme-light .text-rose-200,
html.theme-light .text-red-400,
html.theme-light .text-red-300,
html.theme-light .text-red-200 {
    color: #b91c1c !important; /* Red-700 */
}
html.theme-light .text-sky-400,
html.theme-light .text-sky-300 {
    color: #0369a1 !important; /* Sky-700 */
}

/* -----------------------------------------------------------------------------
   9. HOVER & GROUP-HOVER GUARDS (Strict Zero Collision Rule)
   ----------------------------------------------------------------------------- */
/* Prevent text from becoming white or washed out on hover in Light Mode */
html.theme-light .hover\:text-white:hover:not(button.bg-red-600):not(button.bg-blue-600):not(button.bg-sky-600):not(button.bg-emerald-600),
html.theme-light .hover\:text-gray-100:hover,
html.theme-light .hover\:text-gray-200:hover,
html.theme-light .hover\:text-gray-300:hover {
    color: var(--text-primary) !important;
}

html.theme-light .group:hover .group-hover\:text-white:not(button *),
html.theme-light .group\/item:hover .group-hover\/item\:text-white:not(button *),
html.theme-light .group\/sidebar:hover .group-hover\/sidebar\:text-white:not(button *) {
    color: var(--text-primary) !important;
}

/* Map light pastel hover text in dark mode to deep readable colors in light mode */
html.theme-light .group:hover .group-hover\:text-blue-300,
html.theme-light .group\/item:hover .group-hover\/item\:text-blue-300 {
    color: #1d4ed8 !important;
}
html.theme-light .group:hover .group-hover\:text-cyan-300,
html.theme-light .group\/item:hover .group-hover\/item\:text-cyan-300 {
    color: #0e7490 !important;
}
html.theme-light .group:hover .group-hover\:text-emerald-300,
html.theme-light .group\/item:hover .group-hover\/item\:text-emerald-300 {
    color: #047857 !important;
}
html.theme-light .group:hover .group-hover\:text-amber-300,
html.theme-light .group\/item:hover .group-hover\/item\:text-amber-300 {
    color: #b45309 !important;
}
html.theme-light .group:hover .group-hover\:text-purple-300,
html.theme-light .group\/item:hover .group-hover\/item\:text-purple-300 {
    color: #6d28d9 !important;
}
html.theme-light .group:hover .group-hover\:text-indigo-300,
html.theme-light .group\/item:hover .group-hover\/item\:text-indigo-300 {
    color: #4338ca !important;
}

/* Prevent dark hover backgrounds in Light Mode */
html.theme-light .hover\:bg-emerald-900:hover,
html.theme-light .hover\:bg-emerald-900\/60:hover {
    background-color: #d1fae5 !important;
    border-color: #6ee7b7 !important;
    color: #064e3b !important;
}

html.theme-light .hover\:bg-blue-900:hover,
html.theme-light .hover\:bg-blue-800:hover,
html.theme-light .hover\:bg-blue-600\/30:hover,
html.theme-light .hover\:bg-blue-600\/50:hover {
    background-color: #dbeafe !important;
    border-color: #93c5fd !important;
    color: #1e40af !important;
}

html.theme-light .hover\:bg-cyan-900:hover,
html.theme-light .hover\:bg-cyan-900\/50:hover {
    background-color: #cffafe !important;
    border-color: #67e8f9 !important;
    color: #155e75 !important;
}

html.theme-light .hover\:bg-amber-900:hover {
    background-color: #fef3c7 !important;
    border-color: #fcd34d !important;
    color: #92400e !important;
}

html.theme-light .hover\:bg-red-900\/50:hover {
    background-color: #fee2e2 !important;
    border-color: #fca5a5 !important;
    color: #991b1b !important;
}

/* -----------------------------------------------------------------------------
   10. BORDERS & DIVIDERS
   ----------------------------------------------------------------------------- */
html.theme-light .border-gray-800,
html.theme-light .border-gray-700,
html.theme-light .border-gray-900,
html.theme-light .border-gray-800\/80,
html.theme-light .border-gray-800\/60,
html.theme-light .border-gray-800\/40,
html.theme-light .border-gray-700\/80,
html.theme-light .border-gray-700\/60,
html.theme-light .border-slate-800,
html.theme-light .border-slate-700 {
    border-color: var(--border-subtle) !important;
}

html.theme-light .divide-gray-800,
html.theme-light .divide-gray-800\/60 {
    border-color: var(--border-subtle) !important;
}

/* -----------------------------------------------------------------------------
   11. PERSISTENT COLLAPSIBLE SIDEBAR RAIL (#collapsibleSidebar)
   ----------------------------------------------------------------------------- */
html.theme-light #collapsibleSidebar {
    background-color: #ffffff !important;
    border-right: 1px solid var(--border-subtle) !important;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.04) !important;
}

html.theme-light #collapsibleSidebar .bg-\[\#0a0f1d\] {
    background-color: #f8fafc !important;
    border-color: var(--border-subtle) !important;
}

html.theme-light #collapsibleSidebar a,
html.theme-light #collapsibleSidebar button {
    color: var(--text-secondary) !important;
}

html.theme-light #collapsibleSidebar a:hover,
html.theme-light #collapsibleSidebar button:hover {
    background-color: var(--hover-bg-subtle) !important;
    color: var(--hover-text) !important;
}

/* Sidebar Kill Switch & Sign Out */
html.theme-light #collapsibleSidebar .bg-red-950\/30 {
    background-color: #fef2f2 !important;
    border-color: #fecaca !important;
    color: #b91c1c !important;
}
html.theme-light #collapsibleSidebar .bg-red-950\/30:hover {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
}

/* -----------------------------------------------------------------------------
   12. SLIDE-OVER DRAWER PANEL (#drawerPanel)
   ----------------------------------------------------------------------------- */
html.theme-light #drawerPanel {
    background-color: #ffffff !important;
    border-left: 1px solid var(--border-subtle) !important;
    box-shadow: -8px 0 25px rgba(0, 0, 0, 0.08) !important;
}

html.theme-light #drawerPanel .bg-\[\#0e1626\] {
    background-color: #f8fafc !important;
    border-bottom: 1px solid var(--border-subtle) !important;
}

html.theme-light #drawerPanel a,
html.theme-light #drawerPanel button:not(.btn-colored),
html.theme-light #drawerPanel .drawer-nav-item {
    background-color: #f8fafc !important;
    border: 1px solid var(--border-subtle) !important;
    color: var(--text-primary) !important;
}

html.theme-light #drawerPanel a:hover,
html.theme-light #drawerPanel button:not(.btn-colored):hover,
html.theme-light #drawerPanel .drawer-nav-item:hover {
    background-color: var(--hover-bg) !important;
    color: #0f172a !important;
    border-color: var(--border-medium) !important;
}

html.theme-light #drawerPanel .drawer-section-title {
    color: #64748b !important;
}

html.theme-light #drawerPanel .drawer-nav-text {
    color: #0f172a !important;
}

html.theme-light #drawerPanel .bg-\[\#0e1626\],
html.theme-light #drawerPanel .bg-\[\#090e1a\] {
    background-color: #f8fafc !important;
    border-color: var(--border-subtle) !important;
    color: var(--text-primary) !important;
}

/* Explicit high-contrast buttons for Calibration */
#btnSync,
#btnSync * {
    color: #ffffff !important;
}
#btnSync {
    background-color: #7c3aed !important;
    border: 1px solid #6d28d9 !important;
}
#btnSync:hover {
    background-color: #6d28d9 !important;
}
#btnScan,
#btnScan * {
    color: #ffffff !important;
}
#btnScan {
    background-color: #2563eb !important;
    border: 1px solid #1d4ed8 !important;
}
#btnScan:hover {
    background-color: #1d4ed8 !important;
}

/* -----------------------------------------------------------------------------
   13. ALL CONTROL MODALS & DIALOGS ([id*="Modal"])
   ----------------------------------------------------------------------------- */
html.theme-light [id*="Modal"] > div {
    background-color: #ffffff !important;
    border: 1px solid var(--border-medium) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
}

html.theme-light [id*="Modal"] .bg-\[\#0e1626\],
html.theme-light [id*="Modal"] .bg-\[\#0b0f19\],
html.theme-light [id*="Modal"] .bg-\[\#080d17\],
html.theme-light [id*="Modal"] .bg-gray-900 {
    background-color: #f8fafc !important;
    border-color: var(--border-subtle) !important;
}

/* Kill Switch Modal Specifics in Light Mode */
html.theme-light #killSwitchModal > div {
    background-color: #ffffff !important;
    border: 2px solid #ef4444 !important;
    box-shadow: 0 25px 50px -12px rgba(239, 68, 68, 0.25) !important;
}
html.theme-light #killSwitchModal ul.bg-\[\#0b0709\] {
    background-color: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    color: #7f1d1d !important;
}

/* Square Off Modal Specifics in Light Mode */
html.theme-light #squareOffModal > div {
    background-color: #ffffff !important;
    border: 2px solid #ef4444 !important;
}

/* Trading Setup Modal Margin Preview Box */
html.theme-light #setupMarginPreview {
    background-color: #dbeafe !important;
    border-color: #93c5fd !important;
    color: #1d4ed8 !important;
    font-weight: 700 !important;
}
html.theme-light .border-blue-900\/50 {
    border-color: #bfdbfe !important;
}

/* -----------------------------------------------------------------------------
   14. FORM INPUTS, SELECTS & TEXTAREAS
   ----------------------------------------------------------------------------- */
html.theme-light input[type="text"],
html.theme-light input[type="password"],
html.theme-light input[type="number"],
html.theme-light select,
html.theme-light textarea {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid var(--border-medium) !important;
}

html.theme-light input[readonly] {
    background-color: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #334155 !important;
}

html.theme-light input::placeholder,
html.theme-light textarea::placeholder {
    color: #94a3b8 !important;
}

html.theme-light input:focus,
html.theme-light select:focus,
html.theme-light textarea:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
    outline: none !important;
}

/* -----------------------------------------------------------------------------
   15. TABLES & LIST HEADERS
   ----------------------------------------------------------------------------- */
html.theme-light table {
    border-color: var(--border-subtle) !important;
}

html.theme-light thead th {
    background-color: #f8fafc !important;
    color: #475569 !important;
    border-bottom: 2px solid var(--border-subtle) !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em !important;
}

html.theme-light tbody tr {
    background-color: #ffffff !important;
    color: var(--text-primary) !important;
    border-bottom: 1px solid var(--border-subtle) !important;
}

html.theme-light tbody tr:nth-child(even) {
    background-color: #fbfcfe !important;
}

html.theme-light tbody tr:hover {
    background-color: #f1f5f9 !important;
    color: #000000 !important;
}

html.theme-light tbody tr:hover td {
    color: #000000 !important;
}

/* Active Selected Row in Session Trades Matrix */
html.theme-light tr.bg-blue-950\/40 {
    background-color: #eff6ff !important;
    border-left: 4px solid #2563eb !important;
}
html.theme-light tr.bg-blue-950\/40 td {
    color: #0f172a !important;
}

/* Table Link / Action Buttons */
html.theme-light table a.bg-blue-950,
html.theme-light table a.bg-gray-800 {
    background-color: #eff6ff !important;
    border: 1px solid #bfdbfe !important;
    color: #1d4ed8 !important;
    font-weight: 700 !important;
}
html.theme-light table a.bg-blue-950:hover,
html.theme-light table a.bg-gray-800:hover {
    background-color: #dbeafe !important;
    border-color: #93c5fd !important;
    color: #1e40af !important;
}

/* -----------------------------------------------------------------------------
   16. STATUS BADGES & CHIPS (Clean Pastels with Deep Bold Typography)
   Comprehensive coverage for ALL variants in both themes
   ----------------------------------------------------------------------------- */
/* Teal Badges (e.g. TG1 HIT) */
html.theme-light [class*="bg-teal-950"],
html.theme-light [class*="bg-teal-900"],
html.theme-light .bg-teal-950 {
    background-color: #ccfbf1 !important;
    color: #0f766e !important;
    border: 1px solid #5eead4 !important;
}

/* Emerald Badges (e.g. TG2 HIT, BUY BREAKOUT, AVAILABLE) */
html.theme-light [class*="bg-emerald-950"],
html.theme-light [class*="bg-emerald-900"],
html.theme-light .bg-emerald-950 {
    background-color: #d1fae5 !important;
    color: #047857 !important;
    border: 1px solid #6ee7b7 !important;
}

/* Cyan Badges & Highlights (e.g. TARGET HIT, Active Status) */
html.theme-light [class*="bg-cyan-950"],
html.theme-light [class*="bg-cyan-900"],
html.theme-light .bg-cyan-950 {
    background-color: #cffafe !important;
    color: #0e7490 !important;
    border: 1px solid #67e8f9 !important;
}

/* Blue Badges (e.g. ACTIVE, BUYING POWER, SLOTS) */
html.theme-light [class*="bg-blue-950"],
html.theme-light [class*="bg-blue-900"],
html.theme-light .bg-blue-950 {
    background-color: #dbeafe !important;
    color: #1d4ed8 !important;
    border: 1px solid #93c5fd !important;
}

/* Red / Rose Badges (e.g. SELL BREAKDOWN, REJECTED, SL HIT) */
html.theme-light [class*="bg-red-950"],
html.theme-light [class*="bg-red-900"],
html.theme-light [class*="bg-rose-950"],
html.theme-light [class*="bg-rose-900"],
html.theme-light .bg-red-950,
html.theme-light .bg-rose-950 {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
    border: 1px solid #fca5a5 !important;
}

/* Amber / Yellow Badges (e.g. PRE-SIGNAL, WARNING) */
html.theme-light [class*="bg-amber-950"],
html.theme-light [class*="bg-amber-900"],
html.theme-light [class*="bg-yellow-950"],
html.theme-light [class*="bg-yellow-900"],
html.theme-light .bg-amber-950,
html.theme-light .bg-yellow-950 {
    background-color: #fef3c7 !important;
    color: #92400e !important;
    border: 1px solid #fcd34d !important;
}

/* Purple Badges */
html.theme-light [class*="bg-purple-950"],
html.theme-light [class*="bg-purple-900"],
html.theme-light .bg-purple-950 {
    background-color: #f3e8ff !important;
    color: #6b21a8 !important;
    border: 1px solid #d8b4fe !important;
}

/* Indigo Badges */
html.theme-light [class*="bg-indigo-950"],
html.theme-light [class*="bg-indigo-900"],
html.theme-light .bg-indigo-950 {
    background-color: #e0e7ff !important;
    color: #4338ca !important;
    border: 1px solid #a5b4fc !important;
}

/* -----------------------------------------------------------------------------
   17. LIVE SIGNAL FEED CARDS (#alertsContainer & #alertsStreamContainer)
   ----------------------------------------------------------------------------- */
/* Target Hit Cards */
html.theme-light #alertsContainer .bg-cyan-950\/40,
html.theme-light #alertsStreamContainer .bg-cyan-950\/40,
html.theme-light #alertsContainer [class*="bg-cyan-950"],
html.theme-light #alertsStreamContainer [class*="bg-cyan-950"] {
    background-color: #ecfeff !important;
    border: 1.5px solid #06b6d4 !important;
    color: #0f172a !important;
}
html.theme-light #alertsContainer .bg-cyan-950\/40 .text-white,
html.theme-light #alertsStreamContainer .bg-cyan-950\/40 .text-white {
    color: #0f172a !important;
}

/* Buy Breakout Cards */
html.theme-light #alertsContainer .bg-emerald-950\/40,
html.theme-light #alertsStreamContainer .bg-emerald-950\/40 {
    background-color: #f0fdf4 !important;
    border: 1.5px solid #10b981 !important;
    color: #0f172a !important;
}
html.theme-light #alertsContainer .bg-emerald-950\/40 .text-white,
html.theme-light #alertsStreamContainer .bg-emerald-950\/40 .text-white {
    color: #0f172a !important;
}

/* Sell Breakdown Cards */
html.theme-light #alertsContainer .bg-rose-950\/40,
html.theme-light #alertsStreamContainer .bg-rose-950\/40 {
    background-color: #fff1f2 !important;
    border: 1.5px solid #f43f5e !important;
    color: #0f172a !important;
}
html.theme-light #alertsContainer .bg-rose-950\/40 .text-white,
html.theme-light #alertsStreamContainer .bg-rose-950\/40 .text-white {
    color: #0f172a !important;
}

/* Pre-Signal Cards */
html.theme-light #alertsContainer .bg-\[\#080d17\],
html.theme-light #alertsStreamContainer .bg-\[\#080d17\] {
    background-color: #fffbeb !important;
    border: 1.5px solid #f59e0b !important;
    color: #92400e !important;
}

/* Default Live Alert Stream Cards */
html.theme-light #alertsStreamContainer .bg-\[\#0b0f19\] {
    background-color: #f8fafc !important;
    border: 1px solid var(--border-subtle) !important;
    color: var(--text-primary) !important;
}
html.theme-light #alertsStreamContainer .bg-\[\#0b0f19\]:hover {
    background-color: #f1f5f9 !important;
}

/* -----------------------------------------------------------------------------
   18. TODAY'S STOCKS ACCORDION & CHIPS (#simpleStockList)
   ----------------------------------------------------------------------------- */
html.theme-light #simpleStockList a {
    background-color: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #1e293b !important;
}
html.theme-light #simpleStockList a:hover {
    background-color: #dbeafe !important;
    border-color: #93c5fd !important;
    color: #1d4ed8 !important;
}

/* -----------------------------------------------------------------------------
   19. CANDLESTICK CHARTS & CALL CARDS SPECIFICS
   ----------------------------------------------------------------------------- */
html.theme-light #chartContainerParent {
    background-color: #ffffff !important;
    border: 1px solid var(--border-subtle) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

html.theme-light #chartContainerParent .bg-\[\#0b0f19\] {
    background-color: #f8fafc !important;
    border-color: var(--border-subtle) !important;
    color: var(--text-secondary) !important;
}

/* Inactive Stock Selector Pills in Charts */
html.theme-light .stock-pill:not(.bg-emerald-600):not(.bg-blue-600) {
    background-color: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}
html.theme-light .stock-pill:hover:not(.bg-emerald-600):not(.bg-blue-600) {
    background-color: #e2e8f0 !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
}

/* Active Trading Call Highlight Card in Light Theme */
html.theme-light #activeCallCard {
    background-color: #ffffff !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
}

/* 4 Call Metrics Boxes */
html.theme-light #activeCallCard .border-teal-800\/80 {
    background-color: #f0fdfa !important;
    border-color: #99f6e4 !important;
}
html.theme-light #activeCallCard .border-teal-800\/80 .text-teal-400 {
    color: #0f766e !important;
}
html.theme-light #activeCallCard .border-teal-800\/80 #callTg1Px {
    color: #0d9488 !important;
}

html.theme-light #activeCallCard .border-emerald-800\/80 {
    background-color: #f0fdf4 !important;
    border-color: #a7f3d0 !important;
}
html.theme-light #activeCallCard .border-emerald-800\/80 .text-emerald-400 {
    color: #047857 !important;
}
html.theme-light #activeCallCard .border-emerald-800\/80 #callTg2Px {
    color: #059669 !important;
}

html.theme-light #activeCallCard .border-rose-800\/80 {
    background-color: #fff1f2 !important;
    border-color: #fecdd3 !important;
}
html.theme-light #activeCallCard .border-rose-800\/80 .text-rose-400 {
    color: #b91c1c !important;
}
html.theme-light #activeCallCard .border-rose-800\/80 #callSlPx {
    color: #dc2626 !important;
}

/* -----------------------------------------------------------------------------
   20. TELEGRAM MODAL LIVE TEST FEEDBACK (High-Contrast for Light Theme)
   ----------------------------------------------------------------------------- */
html.theme-light #tgTestStatusArea {
    background-color: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}
html.theme-light #tgTestStatusArea.status-loading {
    background-color: #f0f9ff !important;
    border-color: #38bdf8 !important;
    color: #0369a1 !important;
}
html.theme-light #tgTestStatusArea.status-success {
    background-color: #ecfdf5 !important;
    border-color: #34d399 !important;
    color: #065f46 !important;
}
html.theme-light #tgTestStatusArea.status-success .text-white {
    color: #064e3b !important;
}
html.theme-light #tgTestStatusArea.status-success .text-gray-300 {
    color: #047857 !important;
}
html.theme-light #tgTestStatusArea.status-success .bg-emerald-950\/40 {
    background-color: #d1fae5 !important;
    border-color: #a7f3d0 !important;
    color: #065f46 !important;
}
html.theme-light #tgTestStatusArea.status-error {
    background-color: #fff1f2 !important;
    border-color: #f87171 !important;
    color: #991b1b !important;
}
html.theme-light #tgTestStatusArea.status-error .text-white {
    color: #7f1d1d !important;
}
html.theme-light #tgTestStatusArea.status-error .bg-rose-950\/40 {
    background-color: #fee2e2 !important;
    border-color: #fca5a5 !important;
    color: #991b1b !important;
}

/* -----------------------------------------------------------------------------
   21. ICON BOX CONTAINERS IN SIDEBAR & DRAWER (Vivid High Contrast in Light Mode)
   ----------------------------------------------------------------------------- */
html.theme-light .bg-blue-500\/10,
html.theme-light .bg-blue-500\/20,
html.theme-light .bg-blue-600\/20 {
    background-color: #dbeafe !important;
}
html.theme-light .bg-emerald-500\/10,
html.theme-light .bg-emerald-500\/20 {
    background-color: #d1fae5 !important;
}
html.theme-light .bg-amber-500\/10,
html.theme-light .bg-amber-500\/20 {
    background-color: #fef3c7 !important;
}
html.theme-light .bg-purple-500\/10,
html.theme-light .bg-purple-500\/20 {
    background-color: #f3e8ff !important;
}
html.theme-light .bg-cyan-500\/10,
html.theme-light .bg-cyan-500\/20 {
    background-color: #cffafe !important;
}
html.theme-light .bg-indigo-500\/10,
html.theme-light .bg-indigo-500\/20 {
    background-color: #e0e7ff !important;
}
html.theme-light .bg-teal-500\/10,
html.theme-light .bg-teal-500\/20 {
    background-color: #ccfbf1 !important;
}
html.theme-light .bg-yellow-500\/10,
html.theme-light .bg-yellow-500\/20 {
    background-color: #fef3c7 !important;
}
html.theme-light .bg-sky-500\/10,
html.theme-light .bg-sky-500\/20 {
    background-color: #e0f2fe !important;
}
html.theme-light .bg-gray-500\/10,
html.theme-light .bg-gray-500\/20 {
    background-color: #f1f5f9 !important;
}

/* -----------------------------------------------------------------------------
   22. CALIBRATION HOLIDAY BANNER & GAUGE
   ----------------------------------------------------------------------------- */
html.theme-light #holidayAlertBox {
    background-color: #fffbeb !important;
    border-color: #fde68a !important;
    color: #92400e !important;
}
html.theme-light #holidayAlertBox .bg-black\/40 {
    background-color: #fef3c7 !important;
    border-color: #fde68a !important;
    color: #78350f !important;
}
html.theme-light #holidayAlertBox .text-gray-300,
html.theme-light #holidayAlertBox .text-gray-400 {
    color: #78350f !important;
}
html.theme-light .w-full.bg-gray-800 {
    background-color: #e2e8f0 !important;
}

/* -----------------------------------------------------------------------------
   23. TOAST NOTIFICATIONS (#globalSystemToast)
   ----------------------------------------------------------------------------- */
html.theme-light #globalSystemToast {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1) !important;
}
html.theme-light #globalSystemToast.bg-emerald-950\/95 {
    background-color: #ecfdf5 !important;
    border-color: #34d399 !important;
    color: #065f46 !important;
}
html.theme-light #globalSystemToast.bg-rose-950\/95 {
    background-color: #fff1f2 !important;
    border-color: #f87171 !important;
    color: #991b1b !important;
}
html.theme-light #globalSystemToast.bg-amber-950\/95 {
    background-color: #fffbeb !important;
    border-color: #fbbf24 !important;
    color: #92400e !important;
}
html.theme-light #globalSystemToast.bg-gray-900\/95 {
    background-color: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

/* -----------------------------------------------------------------------------
   24. CUSTOM SCROLLBAR (Light Mode Crisp Gray)
   ----------------------------------------------------------------------------- */
html.theme-light .custom-scroll::-webkit-scrollbar-track {
    background: #f1f5f9 !important;
}
html.theme-light .custom-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1 !important;
    border-radius: 4px;
}
html.theme-light .custom-scroll::-webkit-scrollbar-thumb:hover {
    background: #94a3b8 !important;
}

/* -----------------------------------------------------------------------------
   25. LOGIN PAGE & AUTHENTICATION CARD (.login-card)
   Institutional Light & Dark Mode styling with zero contrast collision
   ----------------------------------------------------------------------------- */
/* Dark Theme (Default) */
html:not(.theme-light) .login-card {
    background-color: #101726;
    border: 1px solid #1e293b;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    color: #f8fafc;
}
html:not(.theme-light) .login-card .login-title {
    color: #ffffff;
}
html:not(.theme-light) .login-card .login-subtitle {
    color: #94a3b8;
}
html:not(.theme-light) .login-card .login-label {
    color: #cbd5e1;
}
html:not(.theme-light) .login-card .login-input {
    background-color: #090d16;
    border: 1px solid #334155;
    color: #ffffff;
}
html:not(.theme-light) .login-card .login-input::placeholder {
    color: #64748b;
}
html:not(.theme-light) .login-card .login-input:focus {
    background-color: #0d1424;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}
html:not(.theme-light) .login-card .login-icon {
    color: #64748b;
}
html:not(.theme-light) .login-card .login-eye-btn {
    color: #64748b;
}
html:not(.theme-light) .login-card .login-eye-btn:hover {
    color: #cbd5e1;
}
html:not(.theme-light) .login-card .login-checkbox-label {
    color: #cbd5e1;
}
html:not(.theme-light) .login-card .login-footer {
    border-top-color: #1e293b;
    color: #64748b;
}
html:not(.theme-light) .login-card .login-footer-text a {
    color: #60a5fa;
}
html:not(.theme-light) .login-card .login-footer-meta {
    color: #64748b;
}
html:not(.theme-light) .login-error-box {
    background-color: rgba(69, 10, 10, 0.7);
    border: 1px solid rgba(185, 28, 28, 0.7);
    color: #fca5a5;
}

/* Light Theme */
html.theme-light .login-ambient-1 {
    opacity: 0.35;
}
html.theme-light .login-ambient-2 {
    opacity: 0.35;
}
html.theme-light .login-card,
html.theme-light .bg-\[\#101726\]\/95 {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04) !important;
}
html.theme-light .login-card .login-title {
    color: #0f172a !important;
}
html.theme-light .login-card .login-subtitle {
    color: #475569 !important;
}
html.theme-light .login-card .login-label {
    color: #334155 !important;
}
html.theme-light .login-card .login-input {
    background-color: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}
html.theme-light .login-card .login-input::placeholder {
    color: #94a3b8 !important;
}
html.theme-light .login-card .login-input:focus {
    background-color: #ffffff !important;
    border-color: #2563eb !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2) !important;
}
html.theme-light .login-card .login-icon {
    color: #64748b !important;
}
html.theme-light .login-card .login-eye-btn {
    color: #64748b !important;
}
html.theme-light .login-card .login-eye-btn:hover {
    color: #0f172a !important;
}
html.theme-light .login-card .login-checkbox-label {
    color: #334155 !important;
}
html.theme-light .login-card .login-footer {
    border-top-color: #e2e8f0 !important;
    color: #64748b !important;
}
html.theme-light .login-card .login-footer-text a {
    color: #2563eb !important;
}
html.theme-light .login-card .login-footer-meta {
    color: #64748b !important;
}
html.theme-light .login-error-box {
    background-color: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    color: #991b1b !important;
}

/* -------------------------------------------------------------
   SMOOTH PRICE TICK FLASH ANIMATION (NIFTY, BANKNIFTY & TICKERS)
   Replaces jerky odometer reels with sleek, GPU-accelerated flash
   ------------------------------------------------------------- */
@keyframes priceTickUp {
    0% {
        color: #10b981;
        text-shadow: 0 0 10px rgba(16, 185, 129, 0.7);
        transform: translateY(-1px);
    }
    100% {
        color: inherit;
        text-shadow: none;
        transform: translateY(0);
    }
}

@keyframes priceTickDown {
    0% {
        color: #f43f5e;
        text-shadow: 0 0 10px rgba(244, 63, 94, 0.7);
        transform: translateY(1px);
    }
    100% {
        color: inherit;
        text-shadow: none;
        transform: translateY(0);
    }
}

.price-tick-up {
    animation: priceTickUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.price-tick-down {
    animation: priceTickDown 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.tabular-nums {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}
