/* =============================================================================
   LIGHT THEME - AI Stock Guru
   Modern Neumorphic Light Mode Design
   ============================================================================= */

/* =============================================================================
   CSS VARIABLES FOR LIGHT MODE
   ============================================================================= */
html.light-theme,
body.light-theme {
    /* Background Colors - Neumorphic soft gray */
    --bg-primary: #e8eef5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e8eef5;
    --bg-card: #ffffff;
    --bg-dark: #e8eef5;
    --panel-dark: #ffffff;
    
    /* Text Colors */
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    
    /* Border Colors */
    --border-color: #d1d9e6;
    --border-light: #e8eef5;
    
    /* Accent Colors */
    --accent-blue: #3182ce;
    --accent-green: #38a169;
    --accent-red: #e53e3e;
    --accent-purple: #805ad5;
}

/* =============================================================================
   GLOBAL STYLES - Neumorphic Background
   ============================================================================= */
html.light-theme,
body.light-theme {
    background: #e8eef5 !important;
    color: #1a202c !important;
}

/* Remove dark gradient overlay */
html.light-theme::before,
body.light-theme::before {
    background: none !important;
    opacity: 0 !important;
}

/* =============================================================================
   FORCE ALL WHITE TEXT TO DARK - CRITICAL FIX
   ============================================================================= */
body.light-theme span[style*="color: #ffffff"],
body.light-theme span[style*="color:#ffffff"],
body.light-theme span[style*="color: \"#ffffff"],
body.light-theme span[style*="color:\"#ffffff"],
body.light-theme div[style*="color: #ffffff"],
body.light-theme div[style*="color:#ffffff"],
body.light-theme div[style*="color: \"#ffffff"],
body.light-theme div[style*="color:\"#ffffff"],
body.light-theme p[style*="color: #ffffff"],
body.light-theme p[style*="color:#ffffff"],
body.light-theme h1[style*="color: #ffffff"],
body.light-theme h2[style*="color: #ffffff"],
body.light-theme h3[style*="color: #ffffff"],
body.light-theme h4[style*="color: #ffffff"],
body.light-theme h5[style*="color: #ffffff"],
body.light-theme h6[style*="color: #ffffff"],
body.light-theme label[style*="color: #ffffff"] {
    color: #0f172a !important;
}

/* EXCEPTION: Keep white text on gradient headers (card headers with colored backgrounds) */
body.light-theme .card-header[style*="linear-gradient"] span[style*="color: white"],
body.light-theme .card-header[style*="linear-gradient"] span[style*="color:white"],
body.light-theme .card-header[style*="linear-gradient"] [style*="color: white"],
body.light-theme [style*="background: linear-gradient(135deg, #10b981"] span,
body.light-theme [style*="background: linear-gradient(135deg, #ef4444"] span,
body.light-theme [style*="background: linear-gradient(135deg, #667eea"] span {
    color: white !important;
}

body.light-theme span[style*="color: #f8fafc"],
body.light-theme span[style*="color:#f8fafc"],
body.light-theme div[style*="color: #f8fafc"],
body.light-theme div[style*="color:#f8fafc"],
body.light-theme h1[style*="color: #f8fafc"],
body.light-theme h2[style*="color: #f8fafc"],
body.light-theme h3[style*="color: #f8fafc"],
body.light-theme h4[style*="color: #f8fafc"],
body.light-theme h5[style*="color: #f8fafc"],
body.light-theme h6[style*="color: #f8fafc"] {
    color: #0f172a !important;
}

/* Font weight elements - usually important values */
body.light-theme span[style*="fontWeight: \"700"],
body.light-theme span[style*="fontWeight:\"700"],
body.light-theme span[style*="fontWeight: 700"],
body.light-theme span[style*="font-weight: 700"],
body.light-theme div[style*="fontWeight: \"700"],
body.light-theme div[style*="fontWeight:\"700"] {
    color: #0f172a !important;
}

/* Card values - the big numbers */
body.light-theme .card span[style*="fontWeight"],
body.light-theme .card div[style*="fontWeight"],
body.light-theme .card h1, body.light-theme .card h2, 
body.light-theme .card h3, body.light-theme .card h4,
body.light-theme .card h5, body.light-theme .card h6 {
    color: #0f172a !important;
}

/* BUT preserve green/red profit/loss colors in cards - these override the above */
body.light-theme .card span[style*="#10b981"],
body.light-theme .card span[style*="rgb(16, 185, 129)"],
body.light-theme .card div[style*="#10b981"],
body.light-theme .card [style*="color: #10b981"],
body.light-theme .card [style*="color:#10b981"] {
    color: #059669 !important; /* Darker green for profit - better contrast on light */
}

body.light-theme .card span[style*="#ef4444"],
body.light-theme .card span[style*="rgb(239, 68, 68)"],
body.light-theme .card div[style*="#ef4444"],
body.light-theme .card [style*="color: #ef4444"],
body.light-theme .card [style*="color:#ef4444"] {
    color: #dc2626 !important; /* Darker red for loss - better contrast on light */
}

body.light-theme .card span[style*="#22d3ee"],
body.light-theme .card span[style*="rgb(34, 211, 238)"],
body.light-theme .card [style*="color: #22d3ee"],
body.light-theme .card [style*="color:#22d3ee"] {
    color: #0891b2 !important; /* Darker cyan - better contrast on light */
}

/* Muted/secondary text */
body.light-theme span[style*="color: #6b7280"],
body.light-theme span[style*="color:#6b7280"],
body.light-theme span[style*="color: #9ca3af"],
body.light-theme span[style*="color:#9ca3af"],
body.light-theme div[style*="color: #6b7280"],
body.light-theme div[style*="color: #9ca3af"] {
    color: #64748b !important;
}

/* =============================================================================
   NAVBAR - Professional Light Header
   ============================================================================= */
body.light-theme .navbar,
body.light-theme .app-navbar,
body.light-theme nav.navbar,
html.light-theme .navbar {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06) !important;
}

body.light-theme .navbar h4,
body.light-theme .navbar .navbar-title,
body.light-theme .navbar .text-white {
    color: #1a202c !important;
}

body.light-theme .navbar i,
body.light-theme .navbar .navbar-icon {
    color: #4a5568 !important;
}

/* Mobile menu hamburger icon - keep same color as dark theme for visibility */
body.light-theme .navbar-menu-btn,
body.light-theme .navbar-menu-btn i,
body.light-theme #open-offcanvas,
body.light-theme #open-offcanvas i {
    color: #1e293b !important;
}

body.light-theme .navbar button:hover i,
body.light-theme .navbar .navbar-icon-btn:hover i {
    color: #3182ce !important;
}

/* Theme toggle icon */
body.light-theme #theme-toggle-btn i {
    color: #f6ad55 !important;
}

/* =============================================================================
   SIDEBAR - Clean White Sidebar
   ============================================================================= */
body.light-theme #desktop-sidebar,
body.light-theme .desktop-sidebar-col,
html.light-theme #desktop-sidebar {
    background: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
}

body.light-theme #mobile-offcanvas,
html.light-theme #mobile-offcanvas {
    background: #ffffff !important;
}

/* Menu Items */
body.light-theme .list-group-item {
    background: transparent !important;
    color: #4a5568 !important;
    border: none !important;
}

body.light-theme .list-group-item:hover {
    background: #edf2f7 !important;
    color: #3182ce !important;
}

body.light-theme .list-group-item.active {
    background: #ebf8ff !important;
    color: #3182ce !important;
    border-left: 3px solid #3182ce !important;
    font-weight: 600 !important;
}

/* =============================================================================
   MENU ICON COLORS - Same vibrant colors as dark theme
   Using Bootstrap utility classes (text-primary, text-warning, etc.)
   ============================================================================= */
/* Primary (Blue) - Home, Add Stock, Plus icons */
body.light-theme .list-group-item i.text-primary,
body.light-theme #mobile-offcanvas .list-group-item i.text-primary,
body.light-theme #desktop-sidebar .list-group-item i.text-primary {
    color: #3b82f6 !important; /* Blue-500 */
}

/* Warning (Yellow/Amber) - Lightbulb, Bolt, Performance icons */
body.light-theme .list-group-item i.text-warning,
body.light-theme #mobile-offcanvas .list-group-item i.text-warning,
body.light-theme #desktop-sidebar .list-group-item i.text-warning {
    color: #f59e0b !important; /* Amber-500 */
}

/* Info (Cyan) - Search, Stock Trend, Token Usage icons */
body.light-theme .list-group-item i.text-info,
body.light-theme #mobile-offcanvas .list-group-item i.text-info,
body.light-theme #desktop-sidebar .list-group-item i.text-info {
    color: #06b6d4 !important; /* Cyan-500 */
}

/* Success (Green) - Stock P&L icon */
body.light-theme .list-group-item i.text-success,
body.light-theme #mobile-offcanvas .list-group-item i.text-success,
body.light-theme #desktop-sidebar .list-group-item i.text-success {
    color: #10b981 !important; /* Emerald-500 */
}

/* Danger (Red) - Sector Research, Trend icons */
body.light-theme .list-group-item i.text-danger,
body.light-theme #mobile-offcanvas .list-group-item i.text-danger,
body.light-theme #desktop-sidebar .list-group-item i.text-danger {
    color: #ef4444 !important; /* Red-500 */
}

/* Secondary (Gray) - Settings, Help icons */
body.light-theme .list-group-item i.text-secondary,
body.light-theme #mobile-offcanvas .list-group-item i.text-secondary,
body.light-theme #desktop-sidebar .list-group-item i.text-secondary {
    color: #64748b !important; /* Slate-500 */
}

/* Fallback: Specific icon colors by FontAwesome class */
body.light-theme .list-group-item i.fa-home,
body.light-theme .list-group-item i.fa-house {
    color: #3b82f6 !important; /* Blue */
}

body.light-theme .list-group-item i.fa-lightbulb {
    color: #f59e0b !important; /* Amber/Yellow */
}

body.light-theme .list-group-item i.fa-search,
body.light-theme .list-group-item i.fa-magnifying-glass {
    color: #06b6d4 !important; /* Cyan */
}

body.light-theme .list-group-item i.fa-bolt {
    color: #f59e0b !important; /* Yellow */
}

body.light-theme .list-group-item i.fa-chart-bar {
    color: #ef4444 !important; /* Red for Sector Research */
}

body.light-theme .list-group-item i.fa-chart-line {
    color: #10b981 !important; /* Green */
}

body.light-theme .list-group-item i.fa-chart-area {
    color: #06b6d4 !important; /* Cyan */
}

body.light-theme .list-group-item i.fa-clipboard-list {
    color: #f97316 !important; /* Orange */
}

body.light-theme .list-group-item i.fa-chart-pie,
body.light-theme .list-group-item i.fa-pie-chart {
    color: #ef4444 !important; /* Red */
}

body.light-theme .list-group-item i.fa-plus-circle,
body.light-theme .list-group-item i.fa-circle-plus {
    color: #3b82f6 !important; /* Blue */
}

body.light-theme .list-group-item i.fa-clock,
body.light-theme .list-group-item i.fa-history {
    color: #06b6d4 !important; /* Cyan */
}

body.light-theme .list-group-item i.fa-cog,
body.light-theme .list-group-item i.fa-gear {
    color: #64748b !important; /* Gray */
}

body.light-theme .list-group-item i.fa-question-circle,
body.light-theme .list-group-item i.fa-circle-question {
    color: #64748b !important; /* Gray */
}

/* ── Per-icon vibrant colors (light theme sidebar) ── */
body.light-theme .sidebar-nav-item i.fa-th-large,
body.light-theme #mobile-offcanvas .sidebar-nav-item i.fa-th-large       { color: #3b82f6 !important; }
body.light-theme .sidebar-nav-item i.fa-search,
body.light-theme #mobile-offcanvas .sidebar-nav-item i.fa-search          { color: #0ea5e9 !important; }
body.light-theme .sidebar-nav-item i.fa-bolt,
body.light-theme #mobile-offcanvas .sidebar-nav-item i.fa-bolt            { color: #f59e0b !important; }
body.light-theme .sidebar-nav-item i.fa-industry,
body.light-theme #mobile-offcanvas .sidebar-nav-item i.fa-industry        { color: #8b5cf6 !important; }
body.light-theme .sidebar-nav-item i.fa-chart-line,
body.light-theme #mobile-offcanvas .sidebar-nav-item i.fa-chart-line      { color: #10b981 !important; }
body.light-theme .sidebar-nav-item i.fa-chart-area,
body.light-theme #mobile-offcanvas .sidebar-nav-item i.fa-chart-area      { color: #06b6d4 !important; }
body.light-theme .sidebar-nav-item i.fa-tachometer-alt,
body.light-theme #mobile-offcanvas .sidebar-nav-item i.fa-tachometer-alt  { color: #ea580c !important; }
body.light-theme .sidebar-nav-item i.fa-chart-pie,
body.light-theme #mobile-offcanvas .sidebar-nav-item i.fa-chart-pie       { color: #e11d48 !important; }
body.light-theme .sidebar-nav-item i.fa-shield-alt,
body.light-theme #mobile-offcanvas .sidebar-nav-item i.fa-shield-alt      { color: #8b5cf6 !important; }
body.light-theme .sidebar-nav-item i.fa-plus-circle,
body.light-theme #mobile-offcanvas .sidebar-nav-item i.fa-plus-circle     { color: #14b8a6 !important; }
body.light-theme .sidebar-nav-item i.fa-exchange-alt,
body.light-theme #mobile-offcanvas .sidebar-nav-item i.fa-exchange-alt    { color: #64748b !important; }
body.light-theme .sidebar-nav-item i.fa-coins,
body.light-theme #mobile-offcanvas .sidebar-nav-item i.fa-coins           { color: #ec4899 !important; }
body.light-theme .sidebar-nav-item i.fa-book-open,
body.light-theme #mobile-offcanvas .sidebar-nav-item i.fa-book-open       { color: #6366f1 !important; }
body.light-theme .sidebar-nav-item i.fa-user-shield,
body.light-theme #mobile-offcanvas .sidebar-nav-item i.fa-user-shield     { color: #64748b !important; }

body.light-theme .sidebar-nav-item:hover i,
body.light-theme .sidebar-nav-item.active i,
body.light-theme #mobile-offcanvas .sidebar-nav-item:hover i,
body.light-theme #mobile-offcanvas .sidebar-nav-item.active i {
    filter: brightness(1.1) saturate(1.2);
}

/* Section labels (DISCOVER, MY PORTFOLIO, BROKER, SYSTEM) */
body.light-theme .sidebar-section-label {
    color: #94a3b8 !important;
    font-weight: 700 !important;
}

/* Mobile offcanvas header */
body.light-theme #mobile-offcanvas .offcanvas-header {
    color: #1e293b !important;
}
body.light-theme #mobile-offcanvas .offcanvas-title,
body.light-theme #mobile-offcanvas .offcanvas-header * {
    color: #1e293b !important;
}

/* Section Labels */
body.light-theme .text-muted,
body.light-theme small.text-muted {
    color: #a0aec0 !important;
}

/* =============================================================================
   CARDS - Elevated White Cards
   ============================================================================= */
body.light-theme .card,
html.light-theme .card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06) !important;
    border-radius: 8px !important;
}

body.light-theme .card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

body.light-theme .card-header {
    background: #f7fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
    color: #1a202c !important;
}

body.light-theme .card-body {
    background: #ffffff !important;
    color: #4a5568 !important;
}

body.light-theme .card-footer {
    background: #f7fafc !important;
    border-top: 1px solid #e2e8f0 !important;
}

/* =============================================================================
   SUMMARY CARDS - Portfolio Overview
   ============================================================================= */
/* Override all gradient backgrounds on cards (exclude report KPI icons) */
body.light-theme .card[style*="linear-gradient"],
body.light-theme div[style*="linear-gradient"]:not(.btn):not(button):not(.rpt-icon) {
    background: #ffffff !important;
}

body.light-theme .card small,
body.light-theme .card .small {
    color: #718096 !important;
}

/* =============================================================================
   FORMS & INPUTS
   ============================================================================= */
body.light-theme input,
body.light-theme .form-control,
body.light-theme select,
body.light-theme textarea,
body.light-theme .input-group-text {
    background: #ffffff !important;
    color: #1a202c !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme input:focus,
body.light-theme .form-control:focus,
body.light-theme select:focus,
body.light-theme textarea:focus {
    border-color: #3182ce !important;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15) !important;
    outline: none !important;
}

body.light-theme input::placeholder,
body.light-theme .form-control::placeholder {
    color: #a0aec0 !important;
}

/* Override dark-styled inputs */
body.light-theme input[style*="background"],
body.light-theme .form-control[style*="background"] {
    background: #ffffff !important;
    color: #1a202c !important;
    border: 1px solid #e2e8f0 !important;
}

/* =============================================================================
   BUTTONS
   ============================================================================= */
body.light-theme .btn-primary {
    background: #3182ce !important;
    border-color: #3182ce !important;
    color: #ffffff !important;
}

body.light-theme .btn-primary:hover {
    background: #2c5282 !important;
    border-color: #2c5282 !important;
}

body.light-theme .btn-success {
    background: #38a169 !important;
    border-color: #38a169 !important;
    color: #ffffff !important;
}

body.light-theme .btn-danger {
    background: #e53e3e !important;
    border-color: #e53e3e !important;
    color: #ffffff !important;
}

body.light-theme .btn-outline-secondary {
    color: #4a5568 !important;
    border-color: #e2e8f0 !important;
    background: transparent !important;
}

body.light-theme .btn-outline-secondary:hover {
    background: #edf2f7 !important;
    color: #1a202c !important;
}

body.light-theme .btn-outline-info {
    color: #3182ce !important;
    border-color: #3182ce !important;
}

body.light-theme .btn-outline-info:hover {
    background: #3182ce !important;
    color: #ffffff !important;
}

body.light-theme .btn-light {
    background: #edf2f7 !important;
    border-color: #e2e8f0 !important;
    color: #4a5568 !important;
}

/* Button Groups - Risk Toggle */
body.light-theme .btn-group .btn {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    color: #4a5568 !important;
}

body.light-theme .btn-group .btn[style*="background: #667eea"],
body.light-theme .btn-group .btn.active {
    background: #3182ce !important;
    border-color: #3182ce !important;
    color: #ffffff !important;
}

/* =============================================================================
   TABS
   ============================================================================= */
body.light-theme .nav-tabs {
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .nav-tabs .nav-link {
    color: #475569 !important;
    border: none !important;
    background: transparent !important;
    font-weight: 500 !important;
}

body.light-theme .nav-tabs .nav-link:hover {
    color: #1e40af !important;
    border-bottom: 2px solid #2563eb !important;
}

body.light-theme .nav-tabs .nav-link.active {
    color: #1e40af !important;
    background: transparent !important;
    border-bottom: 2px solid #2563eb !important;
    font-weight: 700 !important;
}

body.light-theme .tab-content {
    background: transparent !important;
}

/* Button-style tabs (Investment/Portfolio) - Light Theme */
body.light-theme .nav-pills-custom {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme .nav-pills-custom .nav-link {
    color: #334155 !important;
    background: transparent !important;
    font-weight: 600 !important;
}

body.light-theme .nav-pills-custom .nav-link:hover {
    background: rgba(37, 99, 235, 0.1) !important;
    color: #1e40af !important;
}

body.light-theme .nav-pills-custom .nav-link.active {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15) !important;
}

/* Home portfolio tabs - light theme specific */
body.light-theme #home-portfolio-tabs .nav-link {
    color: #1e293b !important;
    font-weight: 600 !important;
}

body.light-theme #home-portfolio-tabs .nav-link.active {
    color: #ffffff !important;
    font-weight: 700 !important;
}

/* =============================================================================
   MODALS - Clean Popups
   ============================================================================= */
body.light-theme .modal-content {
    background: #ffffff !important;
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

body.light-theme .modal-header {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    color: #1a202c !important;
    border-radius: 12px 12px 0 0 !important;
}

body.light-theme .modal-header h4,
body.light-theme .modal-header h5 {
    color: #1a202c !important;
}

body.light-theme .modal-body {
    background: #ffffff !important;
    color: #4a5568 !important;
}

body.light-theme .modal-footer {
    background: #f7fafc !important;
    border-top: 1px solid #e2e8f0 !important;
    border-radius: 0 0 12px 12px !important;
}

body.light-theme .modal-backdrop {
    background: rgba(0, 0, 0, 0.4) !important;
}

/* Login Modal */
body.light-theme #login-modal .modal-content {
    background: #ffffff !important;
}

body.light-theme #login-modal .modal-header i {
    color: #3182ce !important;
}

/* =============================================================================
   OFFCANVAS - Side Panels
   ============================================================================= */
body.light-theme .offcanvas {
    background: #ffffff !important;
    border-left: 1px solid #e2e8f0 !important;
}

body.light-theme .offcanvas-header {
    background: #f7fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .offcanvas h4,
body.light-theme .offcanvas h5 {
    color: #1a202c !important;
}

/* Notifications Offcanvas */
body.light-theme #notifications-offcanvas {
    background: #ffffff !important;
}

body.light-theme #notifications-offcanvas [style*="background: linear-gradient"] {
    background: #f7fafc !important;
}

body.light-theme #notifications-offcanvas-content {
    background: #ffffff !important;
}

/* Activity Log / Notifications - Force dark text for readability */
body.light-theme #notifications-offcanvas h4,
body.light-theme #notifications-offcanvas .mb-0 {
    color: #1a202c !important;
}

body.light-theme #notifications-offcanvas-content p,
body.light-theme #notifications-offcanvas-content p[style*="color"],
body.light-theme #notifications-offcanvas-content div p {
    color: #1e293b !important;
}

body.light-theme #notifications-offcanvas-content small,
body.light-theme #notifications-offcanvas-content small[style*="color"] {
    color: #64748b !important;
}

/* Notification item backgrounds for light theme */
body.light-theme #notifications-offcanvas-content > div > div[style*="rgba(40, 167, 69"] {
    background: #dcfce7 !important;
    border-bottom: 1px solid #bbf7d0 !important;
}

body.light-theme #notifications-offcanvas-content > div > div[style*="rgba(220, 53, 69"] {
    background: #fee2e2 !important;
    border-bottom: 1px solid #fecaca !important;
}

body.light-theme #notifications-offcanvas-content > div > div[style*="rgba(255, 193, 7"] {
    background: #fef3c7 !important;
    border-bottom: 1px solid #fde68a !important;
}

body.light-theme #notifications-offcanvas-content > div > div[style*="rgba(23, 162, 184"] {
    background: #dbeafe !important;
    border-bottom: 1px solid #bfdbfe !important;
}

/* Sell Signals Offcanvas */
body.light-theme #sell-signals-offcanvas {
    background: #ffffff !important;
}

/* Basket Offcanvas */
body.light-theme #basket-offcanvas {
    background: #ffffff !important;
}


body.light-theme .basket-item {
    background: #f7fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
}

body.light-theme .basket-item:hover {
    background: #edf2f7 !important;
}

/* =============================================================================
   TABLES
   ============================================================================= */
body.light-theme table:not(.CalendarMonth_table) {
    background: #ffffff !important;
}

body.light-theme th:not(.CalendarMonth_table th) {
    background: #f7fafc !important;
    color: #1a202c !important;
    border-color: #e2e8f0 !important;
    font-weight: 600 !important;
}

body.light-theme td:not(.CalendarDay):not(.CalendarDay__default) {
    background: #ffffff !important;
    color: #4a5568 !important;
    border-color: #edf2f7 !important;
}

body.light-theme tr:hover td:not(.CalendarDay):not(.CalendarDay__default) {
    background: #f7fafc !important;
}

/* =============================================================================
   DROPDOWNS
   ============================================================================= */
body.light-theme .dropdown-menu {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
    border-radius: 8px !important;
}

body.light-theme .dropdown-item {
    color: #4a5568 !important;
}

body.light-theme .dropdown-item:hover {
    background: #edf2f7 !important;
    color: #1a202c !important;
}

/* Select Components */
body.light-theme .Select-control,
body.light-theme .Select-menu-outer {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

body.light-theme .Select-value-label {
    color: #1a202c !important;
}

body.light-theme .VirtualizedSelectOption {
    background: #ffffff !important;
    color: #1a202c !important;
}

body.light-theme .VirtualizedSelectFocusedOption {
    background: #edf2f7 !important;
}

/* =============================================================================
   ALERTS & TOASTS
   ============================================================================= */
body.light-theme .alert {
    border-radius: 8px !important;
}

body.light-theme .alert-info {
    background: #ebf8ff !important;
    border: 1px solid #90cdf4 !important;
    color: #2c5282 !important;
}

body.light-theme .alert-success {
    background: #f0fff4 !important;
    border: 1px solid #9ae6b4 !important;
    color: #276749 !important;
}

body.light-theme .alert-warning {
    background: #fffaf0 !important;
    border: 1px solid #fbd38d !important;
    color: #c05621 !important;
}

body.light-theme .alert-danger {
    background: #fff5f5 !important;
    border: 1px solid #feb2b2 !important;
    color: #c53030 !important;
}

body.light-theme .toast {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
}

/* =============================================================================
   SCROLLBARS
   ============================================================================= */
body.light-theme ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

body.light-theme ::-webkit-scrollbar-track {
    background: #edf2f7;
    border-radius: 4px;
}

body.light-theme ::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

body.light-theme ::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* =============================================================================
   SPINNER / LOADING
   ============================================================================= */
body.light-theme #spinner-overlay {
    background: rgba(255, 255, 255, 0.85) !important;
}

body.light-theme #pinned-spinner,
body.light-theme #add-stock-pinned-spinner {
    background: #ffffff !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

body.light-theme #pinned-spinner .text-white,
body.light-theme #add-stock-pinned-spinner .text-white {
    color: #4a5568 !important;
}

/* =============================================================================
   TEXT COLOR OVERRIDES
   ============================================================================= */
/* Force white text to dark */
body.light-theme [style*="color: #ffffff"],
body.light-theme [style*="color: #fff"],
body.light-theme [style*="color: white"],
body.light-theme [style*="color:#ffffff"],
body.light-theme [style*="color:#fff"] {
    color: #1a202c !important;
}

/* Force light gray text to medium */
body.light-theme [style*="color: #e0e0e0"],
body.light-theme [style*="color: #f8fafc"],
body.light-theme [style*="color: #e2e8f0"] {
    color: #4a5568 !important;
}

/* Force muted colors */
body.light-theme [style*="color: #9ca3af"],
body.light-theme [style*="color: #6b7280"] {
    color: #718096 !important;
}

/* Text utility classes */
body.light-theme .text-white {
    color: #1a202c !important;
}

body.light-theme .text-light {
    color: #4a5568 !important;
}

/* =============================================================================
   BACKGROUND COLOR OVERRIDES
   ============================================================================= */
/* Override all dark backgrounds */
body.light-theme [style*="background: #0"],
body.light-theme [style*="background: #1"],
body.light-theme [style*="background:#0"],
body.light-theme [style*="background:#1"],
body.light-theme [style*="backgroundColor: #0"],
body.light-theme [style*="backgroundColor: #1"],
body.light-theme [style*="background-color: #0"],
body.light-theme [style*="background-color: #1"] {
    background: #ffffff !important;
}

/* Override gradient backgrounds */
body.light-theme [style*="linear-gradient"][style*="#071418"],
body.light-theme [style*="linear-gradient"][style*="#0d2026"],
body.light-theme [style*="linear-gradient"][style*="#151f2b"],
body.light-theme [style*="linear-gradient"][style*="#0e1a21"],
body.light-theme [style*="linear-gradient"][style*="#1e293b"],
body.light-theme [style*="linear-gradient"][style*="#0f172a"] {
    background: #ffffff !important;
}

/* Main page content */
body.light-theme #page-content,
body.light-theme .main-content-wrapper,
body.light-theme #main-content-column {
    background: transparent !important;
}

body.light-theme .container-fluid {
    background: transparent !important;
}

/* =============================================================================
   PAGE WRAPPER BACKGROUNDS (min-height: 100vh)
   ============================================================================= */
body.light-theme .p-4[style*="minHeight"],
body.light-theme .p-4[style*="min-height"],
body.light-theme div[style*="minHeight: 100vh"],
body.light-theme div[style*="min-height: 100vh"] {
    background: #f5f7fa !important;
}

/* =============================================================================
   FOOTER
   ============================================================================= */
body.light-theme footer {
    background: transparent !important;
}

body.light-theme footer hr {
    border-color: #e2e8f0 !important;
}

body.light-theme footer .text-muted {
    color: #a0aec0 !important;
}

/* =============================================================================
   SPECIFIC COMPONENT FIXES
   ============================================================================= */

/* Headers */
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: #1a202c !important;
}

/* Headers with inline styles */
body.light-theme h2[style*="color"],
body.light-theme h4[style*="color"] {
    color: #1a202c !important;
}

/* Labels */
body.light-theme label,
body.light-theme .form-label {
    color: #4a5568 !important;
}

body.light-theme label[style*="color"] {
    color: #4a5568 !important;
}

/* Checkboxes */
body.light-theme .form-check-input {
    background: #ffffff !important;
    border: 2px solid #cbd5e0 !important;
}

body.light-theme .form-check-input:checked {
    background: #3182ce !important;
    border-color: #3182ce !important;
}

body.light-theme .form-check-label {
    color: #4a5568 !important;
}

/* HR elements */
body.light-theme hr,
body.light-theme hr[style*="borderColor"] {
    border-color: #e2e8f0 !important;
    opacity: 1 !important;
}

/* Links */
body.light-theme a:not(.btn):not(.nav-link):not(.list-group-item) {
    color: #3182ce !important;
}

body.light-theme a:not(.btn):not(.nav-link):not(.list-group-item):hover {
    color: #2c5282 !important;
}

/* =============================================================================
   PROFIT/LOSS COLORS - Same vibrant colors as dark theme
   ============================================================================= */
/* Green colors for profit - keep vibrant */
body.light-theme [style*="color: #10b981"],
body.light-theme [style*="color:#10b981"],
body.light-theme [style*="color: rgb(16, 185, 129)"],
body.light-theme .text-success,
body.light-theme .profit,
body.light-theme [class*="profit"] {
    color: #10b981 !important; /* Same green as dark theme */
}

/* Red colors for loss - keep vibrant */
body.light-theme [style*="color: #ef4444"],
body.light-theme [style*="color:#ef4444"],
body.light-theme [style*="color: rgb(239, 68, 68)"],
body.light-theme .text-danger,
body.light-theme .loss,
body.light-theme [class*="loss"] {
    color: #ef4444 !important; /* Same red as dark theme */
}

body.light-theme [style*="color: #3b82f6"],
body.light-theme [style*="color: rgb(59, 130, 246)"],
body.light-theme .text-primary {
    color: #3182ce !important;
}

body.light-theme [style*="color: #8b5cf6"],
body.light-theme .text-purple {
    color: #805ad5 !important;
}

/* =============================================================================
   INVESTMENT PAGE SPECIFIC
   ============================================================================= */
body.light-theme .input-group-text[style*="backgroundColor"] {
    background: #edf2f7 !important;
    border-color: #e2e8f0 !important;
    color: #3182ce !important;
}

body.light-theme [style*="backgroundColor: rgba(245, 158, 11"] {
    background: #fffaf0 !important;
    border: 1px solid #fbd38d !important;
}

/* =============================================================================
   ACCORDION
   ============================================================================= */
body.light-theme .accordion-item {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme .accordion-button {
    background: #f7fafc !important;
    color: #1a202c !important;
}

body.light-theme .accordion-button:not(.collapsed) {
    background: #ebf8ff !important;
    color: #3182ce !important;
}

body.light-theme .accordion-body {
    background: #ffffff !important;
    color: #4a5568 !important;
}

/* =============================================================================
   CHARTS - Plotly (Keep dark background for charts in light mode)
   ============================================================================= */
/* Charts keep their dark theme - no overrides needed */
/* The chart container gets a subtle border for better visual separation */
body.light-theme .dash-graph {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

/* =============================================================================
   PROGRESS BAR
   ============================================================================= */
body.light-theme .progress {
    background: #edf2f7 !important;
    border-radius: 9999px !important;
}

/* =============================================================================
   BADGES
   ============================================================================= */
body.light-theme .badge {
    font-weight: 500 !important;
}

/* =============================================================================
   RESPONSIVE - Mobile
   ============================================================================= */
@media (max-width: 767.98px) {
    body.light-theme .navbar {
        background: #ffffff !important;
    }
    
    body.light-theme #mobile-offcanvas {
        background: #ffffff !important;
    }
}

/* =============================================================================
   SMOOTH THEME TRANSITION (Scoped to light theme only)
   ============================================================================= */
html.light-theme, body.light-theme {
    transition: background-color 0.2s ease-in-out;
}

body.light-theme .card, 
body.light-theme .modal-content, 
body.light-theme .offcanvas, 
body.light-theme .navbar, 
body.light-theme input, 
body.light-theme .btn, 
body.light-theme .list-group-item {
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

/* =============================================================================
   PRINT STYLES
   ============================================================================= */
@media print {
    body.light-theme {
        background: #ffffff !important;
        color: #000000 !important;
    }
}

/* =============================================================================
   INVESTMENT STOCK ROWS - QTY AND PRICE CELLS (CRITICAL FIX)
   ============================================================================= */

/* Stock row container */
body.light-theme #start-invest-stocks-list > div,
body.light-theme .d-flex.align-items-center.mb-2 {
    background: transparent !important;
}

/* Qty and Price cells - ALL divs with dark backgrounds and centered text */
body.light-theme div[style*="textAlign: \"center\""][style*="backgroundColor"],
body.light-theme div[style*="text-align: center"][style*="background"],
body.light-theme div[style*="textAlign"][style*="padding"][style*="border"] {
    background-color: #f1f5f9 !important;
    background: #f1f5f9 !important;
    color: #1a202c !important;
    border: 1px solid #e2e8f0 !important;
}

/* Qty and Price cells - the dark background boxes */
body.light-theme div[style*="backgroundColor: #1e2a3a"],
body.light-theme div[style*="background-color: #1e2a3a"],
body.light-theme div[style*="backgroundColor:#1e2a3a"],
body.light-theme div[style*="background: #1e2a3a"],
body.light-theme [style*="#1e2a3a"] {
    background-color: #f1f5f9 !important;
    background: #f1f5f9 !important;
    color: #1a202c !important;
    border: 1px solid #e2e8f0 !important;
}

/* Target by width - Qty boxes are usually 80px */
body.light-theme div[style*="width: \"80px\""],
body.light-theme div[style*="width:\"80px\""],
body.light-theme div[style*="width: 80px"] {
    background: #f1f5f9 !important;
    color: #1a202c !important;
    border: 1px solid #e2e8f0 !important;
}

/* Target by width - Price boxes are usually 120px */
body.light-theme div[style*="width: \"120px\""][style*="textAlign"],
body.light-theme div[style*="width:\"120px\""][style*="textAlign"] {
    background: #f1f5f9 !important;
    color: #1a202c !important;
    border: 1px solid #e2e8f0 !important;
}

/* Also target by border color selector */
body.light-theme div[style*="border: 1px solid #374151"],
body.light-theme [style*="border: 1px solid #374151"],
body.light-theme div[style*="border: \"1px solid #374151\""],
body.light-theme div[style*="borderRadius"][style*="backgroundColor: \"#1e2a3a\""] {
    background: #f1f5f9 !important;
    color: #1a202c !important;
    border: 1px solid #e2e8f0 !important;
}

/* Stock symbol names in investment list */
body.light-theme .d-flex.align-items-center .fw-bold[style*="color: \"#ffffff\""],
body.light-theme .d-flex.align-items-center .fw-bold[style*="color:#ffffff"],
body.light-theme .d-flex.align-items-center div.fw-bold {
    color: #1a202c !important;
}

/* =============================================================================
   TOTAL INVEST INPUT FIELD - CRITICAL FIX
   ============================================================================= */

body.light-theme input[style*="backgroundColor: \"#1e293b\""],
body.light-theme input[style*="background-color: #1e293b"],
body.light-theme input[style*="backgroundColor:#1e293b"],
body.light-theme input[type="number"][style*="background"] {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #1a202c !important;
    border: 1px solid #e2e8f0 !important;
}

/* Input group addon (₹ symbol box) */
body.light-theme .input-group-text[style*="backgroundColor"],
body.light-theme .input-group-text[style*="background"] {
    background: #f1f5f9 !important;
    color: #3182ce !important;
    border: 1px solid #e2e8f0 !important;
}

/* =============================================================================
   SELECT DROPDOWNS WITH DARK BACKGROUNDS
   ============================================================================= */

body.light-theme select[style*="backgroundColor: #1e293b"],
body.light-theme select[style*="background-color: #1e293b"],
body.light-theme .pnl-year-select,
body.light-theme .trend-period-select {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #1a202c !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme select option {
    background: #ffffff !important;
    color: #1a202c !important;
}

/* =============================================================================
   INVESTMENT PAGE INPUT FIELDS
   ============================================================================= */

body.light-theme #investment-amount,
body.light-theme #start-invest-amount {
    background: #ffffff !important;
    color: #1a202c !important;
    border: 1px solid #e2e8f0 !important;
}

/* Input Group Text (₹ symbol) */
body.light-theme .input-group-text[style*="#0f172a"],
body.light-theme .input-group-text[style*="rgb(15"] {
    background: #edf2f7 !important;
    color: #3182ce !important;
    border: 1px solid #e2e8f0 !important;
}

/* =============================================================================
   H4 SECTION HEADERS WITH DARK COLORS
   ============================================================================= */

body.light-theme h4[style*="color: #f8fafc"],
body.light-theme h4[style*="color:#f8fafc"],
body.light-theme h4[style*="color: rgb(248"] {
    color: #1a202c !important;
}

body.light-theme label[style*="color: #f8fafc"],
body.light-theme label[style*="color:#f8fafc"] {
    color: #4a5568 !important;
}

/* =============================================================================
   COMPREHENSIVE INPUT OVERRIDE - ALL DARK INPUTS
   ============================================================================= */

body.light-theme input[style*="color: #ffffff"],
body.light-theme input[style*="color:#ffffff"],
body.light-theme input[style*="color: #f8fafc"],
body.light-theme input[style*="color:#f8fafc"] {
    color: #1a202c !important;
}

body.light-theme input[style*="backgroundColor"],
body.light-theme input[style*="background-color"],
body.light-theme input[style*="background:"] {
    background: #ffffff !important;
    color: #1a202c !important;
}

/* =============================================================================
   ENSURE ALL TEXT IS READABLE IN CARDS
   ============================================================================= */

body.light-theme .card div[style*="color: #ffffff"],
body.light-theme .card span[style*="color: #ffffff"],
body.light-theme .card p[style*="color: #ffffff"] {
    color: #1a202c !important;
}

body.light-theme .card div[style*="color: #9ca3af"],
body.light-theme .card span[style*="color: #9ca3af"],
body.light-theme .card p[style*="color: #9ca3af"] {
    color: #718096 !important;
}

/* =============================================================================
   FORCE LIGHT THEME ON ALL DARK RGB BACKGROUNDS
   ============================================================================= */

body.light-theme *[style*="rgb(30, 42, 58)"],
body.light-theme *[style*="rgb(15, 23, 42)"],
body.light-theme *[style*="rgb(21, 31, 43)"],
body.light-theme *[style*="rgb(14, 26, 33)"],
body.light-theme *[style*="rgb(7, 20, 24)"],
body.light-theme *[style*="rgb(13, 32, 38)"] {
    background: #f7fafc !important;
    background-color: #f7fafc !important;
}

/* =============================================================================
   BASKET OFFCANVAS - PROFESSIONAL LIGHT STYLING
   ============================================================================= */

body.light-theme .offcanvas,
body.light-theme .offcanvas-end {
    background: #f7fafc !important;
    border-left: 1px solid #e2e8f0 !important;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1) !important;
}

body.light-theme .offcanvas-header {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 1rem 1.25rem !important;
}

body.light-theme .offcanvas-title,
body.light-theme .offcanvas-header h5 {
    color: #1a202c !important;
    font-weight: 600 !important;
    font-size: 1.1rem !important;
}

body.light-theme .offcanvas-body {
    background: #f7fafc !important;
    padding: 1rem !important;
}

/* Empty basket state */
body.light-theme .offcanvas-body .text-center .text-muted {
    color: #a0aec0 !important;
}

body.light-theme .offcanvas-body .text-center i {
    color: #cbd5e0 !important;
}

/* =============================================================================
   MOBILE MENU OFFCANVAS - PROFESSIONAL LIGHT STYLING  
   ============================================================================= */

body.light-theme #mobile-offcanvas {
    background: #f7fafc !important;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.1) !important;
}

body.light-theme #mobile-offcanvas .offcanvas-header {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme #mobile-offcanvas .offcanvas-body {
    background: #f7fafc !important;
    padding: 0.75rem !important;
}

body.light-theme #mobile-offcanvas .list-group-item {
    background: #ffffff !important;
    margin: 2px 0 !important;
    border-radius: 8px !important;
    border: 1px solid #edf2f7 !important;
    color: #4a5568 !important;
    font-weight: 500 !important;
    transition: all 0.15s ease !important;
}

body.light-theme #mobile-offcanvas .list-group-item:hover {
    background: #ebf8ff !important;
    border-color: #bee3f8 !important;
    color: #3182ce !important;
    transform: translateX(2px) !important;
}

body.light-theme #mobile-offcanvas .list-group-item.active {
    background: #ebf8ff !important;
    border-color: #3182ce !important;
    border-left: 3px solid #3182ce !important;
    color: #3182ce !important;
    font-weight: 600 !important;
}

body.light-theme #mobile-offcanvas .list-group-item i {
    color: inherit !important;
    opacity: 0.8 !important;
}

body.light-theme #mobile-offcanvas small.text-muted {
    color: #a0aec0 !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}

/* =============================================================================
   FINAL CLEANUP - ENSURE NO DARK BACKGROUNDS REMAIN
   ============================================================================= */

/* Any remaining elements with dark hex backgrounds */
body.light-theme *[style*="#071418"],
body.light-theme *[style*="#0d2026"],
body.light-theme *[style*="#0a1a1f"],
body.light-theme *[style*="#0e1a21"],
body.light-theme *[style*="#151f2b"],
body.light-theme *[style*="#1e293b"],
body.light-theme *[style*="#0f172a"],
body.light-theme *[style*="#1e2a3a"],
body.light-theme *[style*="#0a1628"],
body.light-theme *[style*="#374151"] {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
}

/* Fix any white text on now-light backgrounds */
body.light-theme *[style*="#071418"] *,
body.light-theme *[style*="#0d2026"] *,
body.light-theme *[style*="#0a1a1f"] *,
body.light-theme *[style*="#0e1a21"] *,
body.light-theme *[style*="#151f2b"] *,
body.light-theme *[style*="#1e293b"] *,
body.light-theme *[style*="#0f172a"] *,
body.light-theme *[style*="#1e2a3a"] * {
    color: #1a202c;
}

/* =============================================================================
   SUMMARY CARDS WITH GRADIENT BACKGROUNDS
   ============================================================================= */

body.light-theme [style*="linear-gradient(135deg, #1e293b"] {
    background: linear-gradient(135deg, #f7fafc 0%, #e2e8f0 100%) !important;
}

body.light-theme [style*="linear-gradient(135deg, #0f172a"] {
    background: linear-gradient(135deg, #ffffff 0%, #f7fafc 100%) !important;
}

/* Current Value card */
body.light-theme #current-value-card,
body.light-theme [class*="current-value"] {
    background: linear-gradient(135deg, #f7fafc 0%, #e2e8f0 100%) !important;
    border: 1px solid #e2e8f0 !important;
}

/* Investment card */
body.light-theme #investment-card,
body.light-theme [class*="investment-card"] {
    background: linear-gradient(135deg, #f7fafc 0%, #e2e8f0 100%) !important;
    border: 1px solid #e2e8f0 !important;
}

/* Returns card */
body.light-theme #returns-card,
body.light-theme [class*="returns-card"] {
    background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%) !important;
    border: 1px solid #9ae6b4 !important;
}

/* =============================================================================
   PROFESSIONAL FONT ENHANCEMENTS
   ============================================================================= */

body.light-theme {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

body.light-theme h1, 
body.light-theme h2, 
body.light-theme h3, 
body.light-theme h4, 
body.light-theme h5, 
body.light-theme h6 {
    font-weight: 600 !important;
    letter-spacing: -0.02em !important;
    color: #1a202c !important;
}

body.light-theme p,
body.light-theme span,
body.light-theme div {
    color: inherit;
}

body.light-theme .fw-bold {
    font-weight: 600 !important;
    color: #1a202c !important;
}

body.light-theme .text-secondary {
    color: #718096 !important;
}

/* =============================================================================
   STOCK TABLE ROWS
   ============================================================================= */

body.light-theme tr[style*="background"],
body.light-theme tr[style*="backgroundColor"] {
    background: #ffffff !important;
}

body.light-theme tr:hover {
    background: #f7fafc !important;
}

body.light-theme td,
body.light-theme th {
    border-color: #e2e8f0 !important;
    color: #4a5568 !important;
}

body.light-theme th {
    background: #f7fafc !important;
    color: #1a202c !important;
    font-weight: 600 !important;
}

/* =============================================================================
   STOCK PERFORMANCE CARDS - COMPREHENSIVE FIX
   ============================================================================= */

/* Main stock card wrapper */
body.light-theme .card.border-0.h-100[style*="linear-gradient"],
body.light-theme .card.border-0[style*="borderRadius"],
body.light-theme .card[style*="#1e293b"],
body.light-theme .card[style*="#1e2a3a"],
body.light-theme .card[style*="#151f2b"],
body.light-theme .card[style*="#0e1a21"] {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

/* Stock card body */
body.light-theme .card-body[style*="padding"] {
    background: transparent !important;
}

/* Stock symbol name */
body.light-theme .card h5[style*="fontWeight"],
body.light-theme .card h5[style*="color: #ffffff"],
body.light-theme h5[style*="#ffffff"] {
    color: #1a202c !important;
    font-weight: 700 !important;
}

/* Stock details text (Qty, Avg, Invested) */
body.light-theme .card span[style*="color: #94a3b8"],
body.light-theme .card span[style*="color: #9ca3af"],
body.light-theme span[style*="#94a3b8"],
body.light-theme span[style*="#9ca3af"] {
    color: #64748b !important;
}

/* View Chart button */
body.light-theme .btn[style*="background: transparent"],
body.light-theme button[style*="background: transparent"] {
    color: #3182ce !important;
}

body.light-theme .btn[style*="background: transparent"]:hover {
    background: #ebf8ff !important;
}

/* =============================================================================
   SUMMARY CARDS AT TOP - CURRENT VALUE, INVESTMENT, ETC
   ============================================================================= */

/* Target cards by their parent row structure */
body.light-theme .row > .col > .card,
body.light-theme .row > div[class*="col"] > .card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

/* Card text elements */
body.light-theme .card span[style*="fontSize: \"0.75rem\""],
body.light-theme .card span[style*="fontSize:\"0.75rem\""],
body.light-theme .card span[style*="fontWeight: \"600\""] {
    color: #64748b !important;
}

body.light-theme .card span[style*="fontWeight: \"700\""],
body.light-theme .card span[style*="fontWeight:\"700\""] {
    color: #1a202c !important;
}

/* =============================================================================
   MAIN PAGE CONTAINER BACKGROUND
   ============================================================================= */

body.light-theme .p-4[style*="minHeight"],
body.light-theme div[style*="minHeight: \"100vh\""],
body.light-theme div[style*="minHeight:\"100vh\""] {
    background: #f0f4f8 !important;
}

/* Header blocks */
body.light-theme .d-flex.justify-content-between[style*="linear-gradient"],
body.light-theme div[style*="background: \"linear-gradient"] {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

/* Overview title */
body.light-theme h2[style*="fontWeight"][style*="color: #ffffff"],
body.light-theme h2[style*="#ffffff"] {
    color: #1a202c !important;
}

/* =============================================================================
   STOCK PERFORMANCE SECTION
   ============================================================================= */

body.light-theme h3[style*="fontWeight"][style*="#ffffff"],
body.light-theme h4[style*="fontWeight"][style*="#ffffff"],
body.light-theme h3[style*="color: #ffffff"],
body.light-theme h4[style*="color: #ffffff"] {
    color: #1a202c !important;
}

/* Section headers */
body.light-theme .d-flex.align-items-center h3,
body.light-theme .d-flex.align-items-center h4 {
    color: #1a202c !important;
}

/* =============================================================================
   GREEN/RED PROFIT COLORS - KEEP THEM VISIBLE
   ============================================================================= */

body.light-theme span[style*="color: #10b981"],
body.light-theme span[style*="color:#10b981"],
body.light-theme div[style*="color: #10b981"] {
    color: #059669 !important;
    font-weight: 600 !important;
}

body.light-theme span[style*="color: #ef4444"],
body.light-theme span[style*="color:#ef4444"],
body.light-theme div[style*="color: #ef4444"] {
    color: #dc2626 !important;
    font-weight: 600 !important;
}

/* =============================================================================
   MARKET INDICES SECTION
   ============================================================================= */

body.light-theme #market-indices-card,
body.light-theme [id*="market-index"] {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

/* =============================================================================
   ALL WHITE TEXT ON DARK BACKGROUNDS
   ============================================================================= */

body.light-theme [style*="color: \"#ffffff\""],
body.light-theme [style*="color:\"#ffffff\""],
body.light-theme [style*="color: #ffffff"],
body.light-theme [style*="color:#ffffff"] {
    color: #1a202c !important;
}

body.light-theme [style*="color: \"#f8fafc\""],
body.light-theme [style*="color:\"#f8fafc\""],
body.light-theme [style*="color: #f8fafc"],
body.light-theme [style*="color:#f8fafc"] {
    color: #1a202c !important;
}

body.light-theme [style*="color: \"#e5e7eb\""],
body.light-theme [style*="color: #e5e7eb"] {
    color: #4a5568 !important;
}

/* =============================================================================
   MOBILE RESPONSIVE ENHANCEMENTS
   ============================================================================= */

@media (max-width: 768px) {
    body.light-theme .offcanvas {
        background: #f8fafc !important;
        box-shadow: 2px 0 16px rgba(0, 0, 0, 0.1) !important;
    }
    
    body.light-theme .offcanvas .list-group-item {
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        color: #4a5568 !important;
        margin-bottom: 4px !important;
        border-radius: 8px !important;
    }
    
    body.light-theme .offcanvas .list-group-item:hover,
    body.light-theme .offcanvas .list-group-item.active {
        background: #ebf8ff !important;
        color: #3182ce !important;
        border-color: #bee3f8 !important;
    }
    
    body.light-theme .card {
        margin-bottom: 0.75rem !important;
    }
}

/* =============================================================================
   ENSURE ALL CARDS HAVE LIGHT BACKGROUND
   ============================================================================= */

body.light-theme .card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme .card-header {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
    color: #1a202c !important;
}

body.light-theme .card-footer {
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
}

/* =============================================================================
   OVERRIDE ANY INLINE DARK COLORS VIA ATTRIBUTE SELECTORS
   ============================================================================= */

body.light-theme [style*="background: \"linear-gradient(135deg, #1e293b"],
body.light-theme [style*="background:\"linear-gradient(135deg, #1e293b"],
body.light-theme [style*="background: \"linear-gradient(135deg, #151f2b"],
body.light-theme [style*="background:\"linear-gradient(135deg, #151f2b"],
body.light-theme [style*="background: \"linear-gradient(135deg, #1e2a3a"],
body.light-theme [style*="background:\"linear-gradient(135deg, #1e2a3a"],
body.light-theme [style*="background: \"linear-gradient(135deg, #0e1a21"],
body.light-theme [style*="background:\"linear-gradient(135deg, #0e1a21"] {
    background: linear-gradient(135deg, #ffffff 0%, #f7fafc 100%) !important;
    border: 1px solid #e2e8f0 !important;
}

/* =============================================================================
   BASKET/OFFCANVAS CLOSE BUTTON - CRITICAL FIX
   ============================================================================= */

body.light-theme .btn-close {
    filter: none !important;
    opacity: 0.7 !important;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat !important;
}

body.light-theme .btn-close:hover {
    opacity: 1 !important;
}

body.light-theme .offcanvas .btn-close,
body.light-theme .modal .btn-close {
    filter: none !important;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%231a202c'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat !important;
}

/* =============================================================================
   MODERATE/HIGH RISK BUTTONS - INVESTMENT TAB
   Fixed styling for light theme with clear visual feedback
   ============================================================================= */

/* Toggle group container */
body.light-theme .risk-toggle-group {
    background: #f1f5f9 !important;
    border-radius: 24px !important;
    padding: 3px !important;
    border: 1px solid #e2e8f0 !important;
}

/* Selected state - using class selector */
body.light-theme #risk-btn-moderate.risk-btn-selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4) !important;
}

body.light-theme #risk-btn-high.risk-btn-selected {
    background: #ef4444 !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4) !important;
}

/* Unselected state - using class selector */
body.light-theme #risk-btn-moderate.risk-btn-unselected,
body.light-theme #risk-btn-high.risk-btn-unselected {
    background: #e2e8f0 !important;
    color: #64748b !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
}

/* Hover effects for unselected */
body.light-theme #risk-btn-moderate.risk-btn-unselected:hover,
body.light-theme #risk-btn-high.risk-btn-unselected:hover {
    background: #cbd5e1 !important;
    color: #475569 !important;
}

/* =============================================================================
   CHARTS - Plotly (Keep dark theme for charts in light mode)

body.light-theme .js-plotly-plot .legend text,
body.light-theme .js-plotly-plot .plotly .legend text {
    fill: #1e293b !important;
}

body.light-theme .js-plotly-plot text,
body.light-theme .js-plotly-plot .plotly text {
    fill: #334155 !important; /* Default dark text */
}

/* Keep annotation text (like chart center labels) dark */
body.light-theme .js-plotly-plot .annotation text {
    fill: #0f172a !important;
}

/* =============================================================================
   CHART HOVER TOOLTIPS - Light Background for Readability
   ============================================================================= */
/* Hover tooltip background - light with shadow */
body.light-theme .js-plotly-plot .hoverlayer .hovertext rect,
body.light-theme .js-plotly-plot .hoverlayer rect,
body.light-theme .js-plotly-plot .plotly .hoverlayer .hovertext rect,
html.light-theme .js-plotly-plot .hoverlayer .hovertext rect {
    fill: #ffffff !important;
    stroke: #e2e8f0 !important;
    stroke-width: 1px !important;
}

/* Hover tooltip text - dark for readability */
body.light-theme .js-plotly-plot .hoverlayer text,
body.light-theme .js-plotly-plot .hoverlayer .hovertext text,
body.light-theme .js-plotly-plot .hoverlayer tspan,
body.light-theme .js-plotly-plot .plotly .hoverlayer text,
html.light-theme .js-plotly-plot .hoverlayer text {
    fill: #1a202c !important;
}

/* Hover line */
body.light-theme .js-plotly-plot .hoverlayer .spikeline,
body.light-theme .js-plotly-plot .hoverlayer line {
    stroke: #94a3b8 !important;
}

/* Unified hover box (x unified mode) */
body.light-theme .js-plotly-plot .hoverlayer .legend rect,
body.light-theme .js-plotly-plot .hovertext path {
    fill: #ffffff !important;
    stroke: #e2e8f0 !important;
}

/* Tooltip arrow/pointer */
body.light-theme .js-plotly-plot .hoverlayer path {
    fill: #ffffff !important;
    stroke: #e2e8f0 !important;
}

/* =============================================================================
   MODAL/POPUP LIGHT THEME
   ============================================================================= */

body.light-theme .modal-content {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
}

body.light-theme .modal-header {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
    color: #1a202c !important;
}

body.light-theme .modal-title {
    color: #1a202c !important;
}

body.light-theme .modal-body {
    background: #ffffff !important;
    color: #4a5568 !important;
}

body.light-theme .modal-footer {
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
}

/* Modal backdrop */
body.light-theme .modal-backdrop {
    background: rgba(0, 0, 0, 0.3) !important;
}

/* =============================================================================
   PAGE CONTENT AREAS - ALL DARK BACKGROUNDS
   ============================================================================= */

body.light-theme [style*="minHeight: \"100vh\""],
body.light-theme [style*="min-height: 100vh"],
body.light-theme .p-4[style*="background"] {
    background: #f0f4f8 !important;
}

/* Main content wrapper */
body.light-theme #page-content,
body.light-theme .page-content,
body.light-theme #content-area {
    background: #f0f4f8 !important;
}

/* =============================================================================
   STOCK ANALYSIS POPUP/PAGE
   ============================================================================= */

body.light-theme #stock-analysis-modal .modal-content,
body.light-theme #stock-analysis-content {
    background: #ffffff !important;
}

body.light-theme #stock-analysis-content .card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

/* =============================================================================
   TREND ANALYSIS / P&L PAGES
   ============================================================================= */

body.light-theme #trend-content,
body.light-theme #pnl-content,
body.light-theme #performance-content {
    background: #f0f4f8 !important;
}

/* Year/period selectors */
body.light-theme select.form-select,
body.light-theme .form-select {
    background: #ffffff !important;
    color: #1a202c !important;
    border: 1px solid #e2e8f0 !important;
}

/* =============================================================================
   AI CHAT POPUP/SIDEBAR
   ============================================================================= */

body.light-theme #chat-offcanvas,
body.light-theme .chat-container {
    background: #f8fafc !important;
}

body.light-theme .chat-message {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #4a5568 !important;
}

body.light-theme .chat-input {
    background: #ffffff !important;
    color: #1a202c !important;
    border: 1px solid #e2e8f0 !important;
}

/* =============================================================================
   SECTOR RESEARCH PAGE
   ============================================================================= */

body.light-theme #sector-research-content {
    background: #f0f4f8 !important;
}

body.light-theme .sector-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

/* =============================================================================
   TOKEN USAGE PAGE
   ============================================================================= */

body.light-theme #token-usage-content {
    background: #f0f4f8 !important;
}

/* =============================================================================
   ADD STOCK PAGE
   ============================================================================= */

body.light-theme #add-stock-content {
    background: #f0f4f8 !important;
}

/* =============================================================================
   PREFERENCES PAGE
   ============================================================================= */

body.light-theme #preferences-content {
    background: #f0f4f8 !important;
}

/* =============================================================================
   LOADING SPINNERS
   ============================================================================= */

body.light-theme .loading-spinner,
body.light-theme .spinner-border {
    color: #3182ce !important;
}

/* =============================================================================
   TOOLTIPS
   ============================================================================= */

body.light-theme .tooltip-inner {
    background: #1a202c !important;
    color: #ffffff !important;
}

body.light-theme .tooltip .arrow::before {
    border-top-color: #1a202c !important;
}

/* =============================================================================
   ALERT BOXES
   ============================================================================= */

body.light-theme .alert {
    border: 1px solid !important;
}

body.light-theme .alert-info {
    background: #ebf8ff !important;
    border-color: #bee3f8 !important;
    color: #2b6cb0 !important;
}

body.light-theme .alert-warning {
    background: #fffaf0 !important;
    border-color: #fbd38d !important;
    color: #c05621 !important;
}

body.light-theme .alert-danger {
    background: #fff5f5 !important;
    border-color: #feb2b2 !important;
    color: #c53030 !important;
}

body.light-theme .alert-success {
    background: #f0fff4 !important;
    border-color: #9ae6b4 !important;
    color: #276749 !important;
}

/* =============================================================================
   VIEW CHART BUTTON AND LINKS
   ============================================================================= */

body.light-theme .btn-link,
body.light-theme a.btn[style*="transparent"] {
    color: #3182ce !important;
}

body.light-theme .btn-link:hover {
    color: #2c5282 !important;
}

/* =============================================================================
   STOCK TREND PAGE - CHARTS AND ACCORDIONS
   ============================================================================= */

body.light-theme .accordion {
    background: transparent !important;
}

body.light-theme .accordion-item {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    margin-bottom: 0.5rem !important;
}

body.light-theme .accordion-header {
    background: #ffffff !important;
}

body.light-theme .accordion-button {
    background: #ffffff !important;
    color: #0f172a !important;
    border: none !important;
    box-shadow: none !important;
}

body.light-theme .accordion-button:not(.collapsed) {
    background: #f8fafc !important;
    color: #0f172a !important;
    box-shadow: none !important;
}

body.light-theme .accordion-button::after {
    filter: invert(0) !important;
}

/* =============================================================================
   STOCK P&L ACCORDION - COMPREHENSIVE LIGHT THEME FIX
   ============================================================================= */

/* Accordion item title - stock name, price, P&L */
body.light-theme .accordion-button .font-weight-bold,
body.light-theme .accordion-button span[style*="fontSize: 1rem"],
body.light-theme .accordion-button span[style*='fontSize: "1rem"'] {
    color: #0f172a !important;
}

body.light-theme .accordion-button span[style*="fontWeight: 600"],
body.light-theme .accordion-button span[style*="fontWeight: 700"],
body.light-theme .accordion-button span[style*='fontWeight: "600"'],
body.light-theme .accordion-button span[style*='fontWeight: "700"'] {
    color: #1e293b !important;
}

/* Price display in accordion header */
body.light-theme .accordion-button span[style*="opacity: 0.8"],
body.light-theme .accordion-button span[style*='opacity: "0.8"'] {
    color: #475569 !important;
    opacity: 1 !important;
}

/* P&L amount with green/red color - keep these colors */
body.light-theme .accordion-button span[style*="color: #28a745"],
body.light-theme .accordion-button span[style*="color:#28a745"],
body.light-theme .accordion-button span[style*='color: "#28a745"'] {
    color: #16a34a !important;
}

body.light-theme .accordion-button span[style*="color: #dc3545"],
body.light-theme .accordion-button span[style*="color:#dc3545"],
body.light-theme .accordion-button span[style*='color: "#dc3545"'] {
    color: #dc2626 !important;
}

/* Accordion card body - P&L expanded content */
body.light-theme .accordion-body .card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

/* Card header with gradient (green/red P&L header) - keep gradient but ensure white text */
body.light-theme .accordion-body .card-header[style*="linear-gradient"] {
    /* Keep the gradient background */
}

body.light-theme .accordion-body .card-header[style*="linear-gradient"] span,
body.light-theme .accordion-body .card-header[style*="linear-gradient"] i {
    color: white !important;
}

/* Card body content */
body.light-theme .accordion-body .card-body {
    background: #ffffff !important;
}

/* P&L section box */
body.light-theme .accordion-body [style*="background: #f0fdf4"],
body.light-theme .accordion-body [style*="background:#f0fdf4"],
body.light-theme .accordion-body [style*='background: "#f0fdf4"'] {
    background: #dcfce7 !important;
    border: 1px solid #bbf7d0 !important;
}

body.light-theme .accordion-body [style*="background: #fef2f2"],
body.light-theme .accordion-body [style*="background:#fef2f2"],
body.light-theme .accordion-body [style*='background: "#fef2f2"'] {
    background: #fee2e2 !important;
    border: 1px solid #fecaca !important;
}

/* Current/Invested section boxes */
body.light-theme .accordion-body [style*="background: #f8fafc"],
body.light-theme .accordion-body [style*="background:#f8fafc"],
body.light-theme .accordion-body [style*='background: "#f8fafc"'] {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
}

/* Text inside these boxes */
body.light-theme .accordion-body [style*="background: #f8fafc"] span[style*="fontWeight"],
body.light-theme .accordion-body [style*='background: "#f8fafc"'] span[style*="fontWeight"] {
    color: #0f172a !important;
}

/* Labels like "P&L", "Current", "Invested" */
body.light-theme .accordion-body span[style*="textTransform: uppercase"],
body.light-theme .accordion-body span[style*='textTransform: "uppercase"'] {
    color: #475569 !important;
}

/* AI Buy/Sell boxes */
body.light-theme .accordion-body [style*="background: #f0fdf4"] span[style*="color: #10b981"],
body.light-theme .accordion-body [style*='background: "#f0fdf4"'] span[style*='color: "#10b981"'] {
    color: #059669 !important;
}

body.light-theme .accordion-body [style*="background: #fef2f2"] span[style*="color: #ef4444"],
body.light-theme .accordion-body [style*='background: "#fef2f2"'] span[style*='color: "#ef4444"'] {
    color: #dc2626 !important;
}

/* AI Insight banner - keep yellow but ensure readable text */
body.light-theme .accordion-body [style*="background: linear-gradient(135deg, #fef3c7"],
body.light-theme .accordion-body [style*='background: "linear-gradient(135deg, #fef3c7'] {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
}

body.light-theme .accordion-body [style*="background: linear-gradient(135deg, #fef3c7"] span,
body.light-theme .accordion-body [style*='background: "linear-gradient(135deg, #fef3c7'] span {
    color: #451a03 !important;
}

/* Secondary info row - date, alerts, etc */
body.light-theme .accordion-body .text-muted {
    color: #64748b !important;
}

body.light-theme .accordion-body span[style*="color: #94a3b8"],
body.light-theme .accordion-body span[style*="color:#94a3b8"],
body.light-theme .accordion-body span[style*='color: "#94a3b8"'] {
    color: #64748b !important;
}

body.light-theme .accordion-body span[style*="color: #64748b"],
body.light-theme .accordion-body span[style*="color:#64748b"],
body.light-theme .accordion-body span[style*='color: "#64748b"'] {
    color: #475569 !important;
}

/* Alert badges (10AM, 2PM, Live) */
body.light-theme .accordion-body span[style*="background: #10b981"],
body.light-theme .accordion-body span[style*='background: "#10b981"'] {
    background: #10b981 !important;
    color: white !important;
}

body.light-theme .accordion-body span[style*="background: #e2e8f0"],
body.light-theme .accordion-body span[style*='background: "#e2e8f0"'] {
    background: #cbd5e1 !important;
    color: #475569 !important;
}

/* Performance rating text */
body.light-theme .accordion-body span[style*="Excellent"],
body.light-theme .accordion-body span[style*="Strong"],
body.light-theme .accordion-body span[style*="Good"] {
    /* Keep green colors */
}

body.light-theme .accordion-body span[style*="Weak"],
body.light-theme .accordion-body span[style*="Poor"] {
    /* Keep red colors */
}

/* Summary card at top of P&L page */
body.light-theme .card[style*="background: linear-gradient(135deg, #f6f9fc"] {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme .card[style*='background: "linear-gradient(135deg, #f6f9fc'] {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

/* Summary card values */
body.light-theme .card [style*="color: #2d3748"],
body.light-theme .card [style*='color: "#2d3748"'] {
    color: #0f172a !important;
}

body.light-theme .card [style*="color: #4a5568"],
body.light-theme .card [style*='color: "#4a5568"'] {
    color: #334155 !important;
}

body.light-theme .card [style*="color: #667eea"],
body.light-theme .card [style*='color: "#667eea"'] {
    color: #4f46e5 !important;
}

body.light-theme .accordion-body {
    background: #ffffff !important;
    color: #374151 !important;
}

body.light-theme .accordion-collapse {
    background: #ffffff !important;
}

/* Stock Trend chart containers - keep dark background */

/* =============================================================================
   STOCK ANALYSIS PAGE - SEARCH RESULTS CARDS
   ============================================================================= */

body.light-theme .stock-card,
body.light-theme .analysis-card,
body.light-theme .result-card,
body.light-theme [id*="search-result"],
body.light-theme [id*="stock-result"] {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #1a202c !important;
}

body.light-theme .stock-card h4,
body.light-theme .stock-card h5,
body.light-theme .stock-card h6,
body.light-theme .analysis-card h4,
body.light-theme .analysis-card h5 {
    color: #1a202c !important;
}

body.light-theme .stock-card p,
body.light-theme .stock-card span,
body.light-theme .analysis-card p,
body.light-theme .analysis-card span {
    color: #4a5568 !important;
}

/* Price colors should remain intact */
body.light-theme .stock-card .text-success,
body.light-theme .analysis-card .text-success {
    color: #10b981 !important;
}

body.light-theme .stock-card .text-danger,
body.light-theme .analysis-card .text-danger {
    color: #ef4444 !important;
}

/* =============================================================================
   STOCK WORKFLOW PAGE
   ============================================================================= */

body.light-theme #workflow-content {
    background: #f0f4f8 !important;
}

body.light-theme .workflow-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

/* =============================================================================
   COMPREHENSIVE TEXT COLOR FIXES
   ============================================================================= */

/* Fix all white text with inline styles */
body.light-theme [style*="color: #ffffff"],
body.light-theme [style*="color: #fff"],
body.light-theme [style*="color:#ffffff"],
body.light-theme [style*="color:#fff"],
body.light-theme [style*="color: rgb(255, 255, 255)"],
body.light-theme [style*="color: white"] {
    color: #1a202c !important;
}

/* Fix light gray text */
body.light-theme [style*="color: #f8fafc"],
body.light-theme [style*="color: #e2e8f0"],
body.light-theme [style*="color: #f1f5f9"],
body.light-theme [style*="color:#f8fafc"],
body.light-theme [style*="color:#e2e8f0"] {
    color: #374151 !important;
}

/* Fix muted text colors */
body.light-theme [style*="color: #9ca3af"],
body.light-theme [style*="color: #94a3b8"],
body.light-theme [style*="color:#9ca3af"],
body.light-theme [style*="color:#94a3b8"] {
    color: #6b7280 !important;
}

/* Preserve colored text */
body.light-theme .text-primary { color: #3b82f6 !important; }
body.light-theme .text-success { color: #10b981 !important; }
body.light-theme .text-danger { color: #ef4444 !important; }
body.light-theme .text-warning { color: #f59e0b !important; }
body.light-theme .text-info { color: #06b6d4 !important; }

/* =============================================================================
   PLOTLY CHARTS - Charts keep dark background in light mode
   ============================================================================= */
/* No overrides - charts retain their dark theme styling */

/* =============================================================================
   AI TOP PICKS PAGE
   ============================================================================= */ */

body.light-theme #top-picks-content {
    background: #f0f4f8 !important;
}

/* =============================================================================
   HELP PAGE
   ============================================================================= */

body.light-theme #help-content {
    background: #f0f4f8 !important;
}

/* =============================================================================
   KITE API PAGE
   ============================================================================= */

body.light-theme #kite-api-content {
    background: #f0f4f8 !important;
}

/* =============================================================================
   SCHEDULE PAGE
   ============================================================================= */

body.light-theme #schedule-content {
    background: #f0f4f8 !important;
}

/* =============================================================================
   ADDITIONAL CARD TEXT FIXES
   ============================================================================= */

body.light-theme .card [style*="fontWeight"],
body.light-theme .card [style*="font-weight"] {
    color: #1a202c !important;
}

body.light-theme .card .h4,
body.light-theme .card .h5,
body.light-theme .card .h6 {
    color: #1a202c !important;
}

/* Price and value displays */
body.light-theme [style*="fontSize: \"1.3rem\""],
body.light-theme [style*="fontSize: \"1.4rem\""],
body.light-theme [style*="fontSize: \"1.5rem\""] {
    color: #1a202c !important;
}

/* Small labels */
body.light-theme .card small,
body.light-theme .card .small {
    color: #6b7280 !important;
}

/* =============================================================================
   DOUGHNUT/PIE CHARTS - Charts keep dark background
   ============================================================================= */
/* No overrides - charts retain their dark theme styling */

/* =============================================================================
   STOCK TILES (PORTFOLIO VIEW)
   ============================================================================= */

body.light-theme .stock-tile,
body.light-theme [class*="portfolio-stock"] {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #1a202c !important;
}

body.light-theme .stock-tile h5,
body.light-theme .stock-tile h6,
body.light-theme .stock-tile .stock-name {
    color: #1a202c !important;
}

body.light-theme .stock-tile span,
body.light-theme .stock-tile p {
    color: #4a5568 !important;}

/* =============================================================================
   STOCK SEARCH & ANALYSIS CARDS (Mobile & Desktop)
   ============================================================================= */

body.light-theme .stock-tile-card,
body.light-theme .stock-tile-card .card {
    background: #ffffff !important;
    color: #1a202c !important;
}

body.light-theme .stock-tile-card .card-header {
    background: #f8fafc !important;
    color: #1a202c !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .stock-tile-card .card-body {
    background: #ffffff !important;
    color: #374151 !important;
}

body.light-theme .stock-tile-card .card-footer {
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
}

body.light-theme .stock-tile-card h4,
body.light-theme .stock-tile-card h5,
body.light-theme .stock-tile-card h6 {
    color: #1a202c !important;
}

body.light-theme .stock-tile-card .text-muted {
    color: #6b7280 !important;
}

body.light-theme .stock-tile-card span {
    color: #374151 !important;
}

/* Metric rows in stock cards */
body.light-theme .stock-tile-card [class*="fa-"],
body.light-theme .stock-tile-card i.fas,
body.light-theme .stock-tile-card i.fab,
body.light-theme .stock-tile-card i.far {
    color: #6b7280 !important;
}

/* Keep colored icons */
body.light-theme .stock-tile-card i.text-info { color: #06b6d4 !important; }
body.light-theme .stock-tile-card i.text-primary { color: #3b82f6 !important; }
body.light-theme .stock-tile-card i.text-success { color: #10b981 !important; }
body.light-theme .stock-tile-card i.text-danger { color: #ef4444 !important; }
body.light-theme .stock-tile-card i.text-warning { color: #f59e0b !important; }

/* Tab component in stock cards */
body.light-theme .stock-tile-card .nav-tabs {
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .stock-tile-card .nav-link {
    color: #64748b !important;
    background: transparent !important;
}

body.light-theme .stock-tile-card .nav-link.active {
    color: #3b82f6 !important;
    background: #ffffff !important;
    border-color: #e2e8f0 #e2e8f0 #ffffff !important;
}

body.light-theme .stock-tile-card .tab-content {
    background: #ffffff !important;
}

/* Details/Summary elements */
body.light-theme .stock-tile-card details {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 4px !important;
    padding: 0.5rem !important;
}

body.light-theme .stock-tile-card summary {
    color: #374151 !important;
    cursor: pointer !important;
}

/* Progress bars in stock cards */
body.light-theme .stock-tile-card .progress {
    background: #e2e8f0 !important;
}

/* =============================================================================
   SEARCH PAGE INPUT
   ============================================================================= */

body.light-theme #search-input,
body.light-theme [id*="search"] input,
body.light-theme input[type="search"],
body.light-theme .search-input {
    background: #ffffff !important;
    color: #1a202c !important;
    border: 1px solid #d1d5db !important;
}

body.light-theme #search-input::placeholder {
    color: #9ca3af !important;
}

/* =============================================================================
   STOCK TREND PAGE SPECIFIC
   ============================================================================= */

body.light-theme #stock-trend-container,
body.light-theme [id*="stock-trend"],
body.light-theme [id*="filtered-trend-content"] {
    background: #f0f4f8 !important;
}

/* Stock trend page header */
body.light-theme [id*="stock-trend"] h4,
body.light-theme [id*="filtered-trend-content"] h4 {
    color: #1a202c !important;
}

body.light-theme [id*="stock-trend"] label,
body.light-theme .trend-period-select {
    color: #374151 !important;
    background: #ffffff !important;
    border-color: #d1d5db !important;
}

/* Stock trend items/rows */
body.light-theme .stock-trend-item,
body.light-theme [class*="trend-item"] {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #1a202c !important;
}

/* Info cards on Stock Trend page */
body.light-theme .info-card,
body.light-theme [class*="info-card"] {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #374151 !important;
}

body.light-theme .info-card h6,
body.light-theme .info-card .card-title {
    color: #1a202c !important;
}

/* =============================================================================
   COLLAPSIBLE STOCK CHARTS (Stock Trend Page)
   ============================================================================= */

body.light-theme [id*="filtered-trend-content"] .card,
body.light-theme [id*="stock-trend"] .card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme [id*="filtered-trend-content"] .card-header,
body.light-theme [id*="stock-trend"] .card-header {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
    color: #1a202c !important;
}

body.light-theme [id*="filtered-trend-content"] .card-body,
body.light-theme [id*="stock-trend"] .card-body {
    background: #ffffff !important;
    color: #374151 !important;
}

/* Chart statistics cards */
body.light-theme [id*="filtered-trend-content"] [style*="border: 1px solid"],
body.light-theme [id*="stock-trend"] [style*="border: 1px solid"] {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

body.light-theme [id*="filtered-trend-content"] [style*="fontWeight"],
body.light-theme [id*="stock-trend"] [style*="fontWeight"] {
    color: #1a202c !important;
}

/* Collapse headers/buttons */
body.light-theme [id*="filtered-trend-content"] .collapse-header,
body.light-theme [id*="filtered-trend-content"] [data-bs-toggle="collapse"],
body.light-theme [id*="stock-trend"] .collapse-header,
body.light-theme [id*="stock-trend"] [data-bs-toggle="collapse"] {
    background: #ffffff !important;
    color: #1a202c !important;
}

body.light-theme [id*="filtered-trend-content"] .collapse-header:hover,
body.light-theme [id*="stock-trend"] [data-bs-toggle="collapse"]:hover {
    background: #f1f5f9 !important;
}

/* =============================================================================
   TECHNICAL ANALYSIS CRITERIA - Light Theme Styling
   ============================================================================= */

/* Criteria container */
body.light-theme .criteria-container {
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

/* Force all text in criteria container to dark for light theme */
body.light-theme .criteria-container *,
body.light-theme .criteria-container span,
body.light-theme .criteria-container li,
body.light-theme .criteria-container ul li,
body.light-theme .criteria-container ul li span,
body.light-theme .criteria-list li,
body.light-theme .criteria-list li span,
body.light-theme .criteria-item,
body.light-theme .criteria-item span {
    color: #374151 !important;
}

/* Criteria title */
body.light-theme .criteria-title {
    color: #1a202c !important;
}

/* Criteria subtitle */
body.light-theme .criteria-subtitle {
    color: #6b7280 !important;
}

/* Criteria group headers - blue accent for light theme */
body.light-theme .criteria-group-header,
body.light-theme .criteria-container .criteria-group-header,
body.light-theme .criteria-container h6 {
    color: #2563eb !important;
    border-bottom-color: #e2e8f0 !important;
}

/* Criteria items and text */
body.light-theme .criteria-item {
    color: #374151 !important;
}

body.light-theme .criteria-text {
    color: #374151 !important;
}

/* Criteria icons - brighter colors for light theme */
body.light-theme .criteria-icon.text-success,
body.light-theme .criteria-container .text-success {
    color: #16a34a !important;
}

body.light-theme .criteria-icon.text-danger,
body.light-theme .criteria-container .text-danger {
    color: #dc2626 !important;
}

/* Accordion styling for light theme */
body.light-theme .criteria-accordion .accordion-item {
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
}

body.light-theme .criteria-accordion .accordion-button {
    background-color: #f8fafc !important;
    color: #1a202c !important;
}

body.light-theme .criteria-accordion .accordion-button:not(.collapsed) {
    background-color: #eff6ff !important;
    color: #1e40af !important;
}

body.light-theme .criteria-accordion .accordion-button::after {
    filter: none !important;
}

body.light-theme .criteria-accordion .accordion-body {
    background-color: #ffffff !important;
}

/* Override any inline styles */
body.light-theme .criteria-container,
body.light-theme [style*="backgroundColor: rgba(15, 23, 42"] {
    background-color: #ffffff !important;
}

body.light-theme h6[style*="color: #fbbf24"],
body.light-theme .criteria-group-header[style*="color: #fbbf24"] {
    color: #2563eb !important;
}

body.light-theme span[style*="color: #e2e8f0"],
body.light-theme li[style*="color: #e2e8f0"] {
    color: #374151 !important;
}

body.light-theme strong[style*="color: #f1f5f9"] {
    color: #1a202c !important;
}

body.light-theme small[style*="color: #94a3b8"] {
    color: #6b7280 !important;
}

/* Signal badge area background */
body.light-theme div[style*="background: rgba(255,255,255,0.05)"] {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

/* =============================================================================
   STOCK P&L CARDS - COMPREHENSIVE LIGHT THEME FIX
   Ensures all text is readable on light backgrounds
   ============================================================================= */

/* P&L Card text colors - ensure dark text on light backgrounds */
body.light-theme [style*="color: #1e293b"],
body.light-theme [style*="color:#1e293b"],
body.light-theme span[style*="color: #1e293b"],
body.light-theme div[style*="color: #1e293b"] {
    color: #0f172a !important;
}

body.light-theme [style*="color: #475569"],
body.light-theme [style*="color:#475569"],
body.light-theme span[style*="color: #475569"],
body.light-theme div[style*="color: #475569"] {
    color: #334155 !important;
}

/* Current/Invested section headers */
body.light-theme [style*="color: #64748b"],
body.light-theme [style*="color:#64748b"],
body.light-theme span[style*="color: #64748b"] {
    color: #475569 !important;
}

/* AI Buy/Sell section text */
body.light-theme [style*="background: #f0fdf4"] span,
body.light-theme [style*="background: #fef2f2"] span,
body.light-theme [style*="background:#f0fdf4"] span,
body.light-theme [style*="background:#fef2f2"] span {
    color: inherit !important;
}

/* Price progress section */
body.light-theme [style*="background: #f8fafc"] span[style*="fontWeight"],
body.light-theme [style*="background:#f8fafc"] span[style*="fontWeight"],
body.light-theme div[style*="background: #f8fafc"] span {
    color: #1e293b !important;
}

/* Preserve green/red profit colors on these cards */
body.light-theme [style*="background: #f0fdf4"] [style*="color: #10b981"],
body.light-theme [style*="background: #fef2f2"] [style*="color: #ef4444"],
body.light-theme div[style*="background: #f0fdf4"] span[style*="color: #10b981"],
body.light-theme div[style*="background: #fef2f2"] span[style*="color: #ef4444"] {
    color: inherit !important;
}

/* Card header with white text on gradient background - keep white */
body.light-theme .card-header[style*="linear-gradient"] span[style*="color: white"],
body.light-theme .card-header[style*="linear-gradient"] [style*="color: white"],
body.light-theme [style*="background: linear-gradient(135deg"] [style*="color: white"] {
    color: white !important;
}

/* Stock symbol in portfolio tile */
body.light-theme span[style*="color: #ffffff"][style*="fontWeight: 700"],
body.light-theme span[style*="color:#ffffff"][style*="fontWeight:700"],
body.light-theme span[style*='color: "#ffffff"'][style*='fontWeight: "700"'] {
    color: #0f172a !important;
}

/* P&L amount text - keep green/red colors */
body.light-theme span[style*="fontSize: 1.4rem"][style*="fontWeight: 700"],
body.light-theme span[style*="fontSize: \"1.4rem\""][style*="fontWeight: \"700\""] {
    /* Inherit the green/red color */
}

/* Current value and Invested value text */
body.light-theme span[style*="fontSize: 1.3rem"][style*="fontWeight: 700"],
body.light-theme span[style*="fontSize: \"1.3rem\""][style*="fontWeight: \"700\""] {
    color: #0f172a !important;
}

/* Qty, Avg, Buy price text in card header - keep white on gradient */
body.light-theme .card-header[style*="linear-gradient"] span,
body.light-theme .card-header[style*="background: linear-gradient"] span {
    color: white !important;
}

/* Portfolio home page stock tiles */
body.light-theme [style*="background: linear-gradient(135deg, #151f2b"] {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme [style*="background: linear-gradient(135deg, #0e1a21"] {
    background: #f8fafc !important;
}

/* Stock name in portfolio */
body.light-theme span[style*='fontSize: "1.1rem"'][style*='fontWeight: "700"'][style*='color: "#ffffff"'] {
    color: #0f172a !important;
}

/* Gray text labels */
body.light-theme span[style*="color: #9ca3af"],
body.light-theme span[style*="color:#9ca3af"],
body.light-theme [style*='color: "#9ca3af"'] {
    color: #64748b !important;
}

/* LTP and other secondary values */
body.light-theme [style*="fontSize: 0.8rem"][style*="color: #9ca3af"],
body.light-theme span[style*='fontSize: "0.8rem"'][style*='color: "#9ca3af"'] {
    color: #64748b !important;
}

/* Alert badges - visible text on light backgrounds */
body.light-theme .badge[style*="background: #10b981"],
body.light-theme .badge[style*="background: #ef4444"] {
    color: white !important;
}

/* P&L Page Summary Cards */
body.light-theme [style*="background: linear-gradient(135deg, #1e293b 0%, #1e3a5f 100%)"],
body.light-theme [style*="background: linear-gradient(135deg, #1e293b 0%, #2d1b4e 100%)"] {
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%) !important;
    border: 1px solid #cbd5e1 !important;
}

body.light-theme [style*="background: linear-gradient(135deg, #1e293b 0%, #1e293b 100%)"] {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

/* Summary card values */
body.light-theme .card[style*="linear-gradient"] span[style*="fontWeight: 700"],
body.light-theme .card[style*="linear-gradient"] div[style*="fontWeight: 700"] {
    color: #0f172a !important;
}

/* Market index cards in light mode */
body.light-theme #market-indices-card,
body.light-theme [id="market-indices-card"] {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme #market-indices-card span[style*="fontWeight: 700"],
body.light-theme #market-indices-card [style*="fontWeight: \"700\""] {
    color: #0f172a !important;
}

body.light-theme #market-indices-card span[style*="color: #1f2937"],
body.light-theme #market-indices-card [style*='color: "#1f2937"'] {
    color: #0f172a !important;
}

body.light-theme #market-indices-card span[style*="color: #374151"],
body.light-theme #market-indices-card [style*='color: "#374151"'] {
    color: #334155 !important;
}

/* NIFTY and SENSEX values */
body.light-theme #nifty-value,
body.light-theme #sensex-value {
    color: #0f172a !important;
}

/* Stock P&L expanded card content */
body.light-theme .card .p-2[style*="background: #f8fafc"] {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
}

/* AI Insight banner in light mode - already light, just enhance */
body.light-theme [style*="background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%)"] {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
}

/* Investment tab in light mode */
body.light-theme #start-invest-amount,
body.light-theme input[id="start-invest-amount"] {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
}

/* Stock list headers */
body.light-theme span[style*='color: "#6b7280"'][style*='fontSize: "0.75rem"'] {
    color: #475569 !important;
}

/* Profit/Loss percentage colors - ensure visibility */
body.light-theme span[style*="color: #10b981"][style*="fontWeight"],
body.light-theme [style*="color: #10b981"][style*="fontWeight"] {
    color: #059669 !important;
}

body.light-theme span[style*="color: #ef4444"][style*="fontWeight"],
body.light-theme [style*="color: #ef4444"][style*="fontWeight"] {
    color: #dc2626 !important;
}
/* =============================================================================
   BADGE FIXES - ENSURE HIGH CONTRAST IN LIGHT MODE
   ============================================================================= */

/* Success badges (green) - ensure white text on green background */
body.light-theme .badge.bg-success,
body.light-theme .badge[class*="badge-success"],
body.light-theme span.badge[class*="success"] {
    background-color: #059669 !important;
    color: #ffffff !important;
}

/* Danger badges (red) - ensure white text on red background */
body.light-theme .badge.bg-danger,
body.light-theme .badge[class*="badge-danger"],
body.light-theme span.badge[class*="danger"] {
    background-color: #dc2626 !important;
    color: #ffffff !important;
}

/* Warning badges - ensure white text */
body.light-theme .badge.bg-warning,
body.light-theme .badge[class*="badge-warning"],
body.light-theme span.badge[class*="warning"] {
    background-color: #d97706 !important;
    color: #ffffff !important;
}

/* Light badges in accordion headers - need better contrast */
body.light-theme .accordion-item .badge.bg-light,
body.light-theme .accordion-header .badge.bg-light,
body.light-theme .accordion-button .badge.bg-light {
    background-color: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
}

/* Primary percentage badge (P&L percentage in summary card) */
body.light-theme .card [style*="background: #0f172a"] .badge,
body.light-theme [style*="background: #0f172a"] {
    background: #0f172a !important;
    color: #ffffff !important;
}

/* Fix inline P&L percentage badges in accordion titles */
body.light-theme .accordion-button .badge {
    font-weight: 600 !important;
    color: #ffffff !important;
}

/* Force white text on ALL colored badges - CRITICAL */
body.light-theme .badge.bg-success,
body.light-theme .badge.bg-danger,
body.light-theme .badge.bg-warning,
body.light-theme .badge.bg-primary,
body.light-theme .badge.bg-info,
body.light-theme .badge.text-white,
body.light-theme span.badge.bg-success,
body.light-theme span.badge.bg-danger {
    color: #ffffff !important;
}

/* Also handle badges with text-bg-* classes (Bootstrap 5.3+) */
body.light-theme .badge.text-bg-success,
body.light-theme .badge.text-bg-danger,
body.light-theme .badge.text-bg-warning {
    color: #ffffff !important;
}

/* Stock accordion - header and item styling */
body.light-theme .stock-accordion .accordion-item {
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme .stock-accordion .accordion-header {
    background-color: #f8fafc !important;
}

body.light-theme .stock-accordion .accordion-button {
    background-color: #f8fafc !important;
    color: #1e293b !important;
}

body.light-theme .stock-accordion .accordion-button:not(.collapsed) {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}

/* Profit/Loss tab styling */
body.light-theme .nav-tabs .nav-link[style*="color: #28a745"],
body.light-theme .nav-tabs .nav-link[style*="color: #dc3545"] {
    font-weight: 700 !important;
}

/* Summary card total P&L percentage badge */
body.light-theme .card-body [style*="fontSize: \"1.5rem\""][style*="background: #0f172a"],
body.light-theme span[style*="background: #0f172a"] {
    background: #1e40af !important;
    color: #ffffff !important;
}

/* =============================================================================
   PORTFOLIO STOCK TILES - LIGHT THEME FIX
   ============================================================================= */

/* Portfolio stock cards - fix dark gradient backgrounds */
body.light-theme .card [style*="linear-gradient(135deg, #1a1a2e"],
body.light-theme .card [style*="linear-gradient(135deg, #16213e"],
body.light-theme .card div[style*="background: linear-gradient(135deg, #1a1a2e"] {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    border: 1px solid #e2e8f0 !important;
}

/* Fix white text in portfolio cards for light theme */
body.light-theme .card [style*="linear-gradient"] span[style*="color: #ffffff"],
body.light-theme .card [style*="linear-gradient"] span[style*='color: "#ffffff"'] {
    color: #1e293b !important;
}

/* Fix muted gray text in portfolio cards */
body.light-theme .card [style*="linear-gradient"] span[style*="color: #9ca3af"],
body.light-theme .card [style*="linear-gradient"] span[style*="color: #6b7280"] {
    color: #64748b !important;
}

/* Keep profit/loss colors visible */
body.light-theme .card [style*="linear-gradient"] span[style*="color: #10b981"] {
    color: #059669 !important;
}

body.light-theme .card [style*="linear-gradient"] span[style*="color: #ef4444"] {
    color: #dc2626 !important;
}

/* BUY/SELL buttons - ensure proper contrast */
body.light-theme .btn-success,
body.light-theme .btn.btn-success,
body.light-theme button[class*="btn-success"] {
    background-color: #059669 !important;
    border-color: #059669 !important;
    color: #ffffff !important;
}

body.light-theme .btn-danger,
body.light-theme .btn.btn-danger,
body.light-theme button[class*="btn-danger"] {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
}

/* Outlined buttons in light mode */
body.light-theme .btn-outline-success {
    color: #059669 !important;
    border-color: #059669 !important;
}

body.light-theme .btn-outline-danger {
    color: #dc2626 !important;
    border-color: #dc2626 !important;
}

body.light-theme .btn-outline-info {
    color: #0284c7 !important;
    border-color: #0284c7 !important;
}

/* HOLD button styling in light mode */
body.light-theme .btn-secondary[disabled],
body.light-theme .btn.btn-secondary:disabled {
    background-color: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: #94a3b8 !important;
}

/* Percentage text next to BUY/SELL buttons */
body.light-theme span[style*="color: #10b981"][style*="marginLeft"] {
    color: #059669 !important;
    font-weight: 600 !important;
}

body.light-theme span[style*="color: #ef4444"][style*="marginLeft"] {
    color: #dc2626 !important;
    font-weight: 600 !important;
}

/* =============================================================================
   BUY/SELL BUTTON TEXT & ICON CONSISTENCY - LIGHT THEME
   ============================================================================= */

/* Ensure button text and icon have same styling */
body.light-theme .btn-success,
body.light-theme .btn-danger {
    color: #ffffff !important;
    font-weight: 600 !important;
}

body.light-theme .btn-success span,
body.light-theme .btn-success i,
body.light-theme .btn-danger span,
body.light-theme .btn-danger i {
    color: #ffffff !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
}

/* Font Awesome icons in buttons */
body.light-theme .btn-success .fas,
body.light-theme .btn-success .fa,
body.light-theme .btn-danger .fas,
body.light-theme .btn-danger .fa {
    color: #ffffff !important;
    font-size: 0.75rem !important;
}

/* Calendar CSS moved to z-calendar.css */

/* =============================================================================
   DASHBOARD SUMMARY TILES - LIGHT THEME PROFESSIONAL STYLING
   Override dark gradient backgrounds with subtle light elevated cards
   ============================================================================= */

/* All cards with dark gradient backgrounds - Modern Neumorphic Clean Design */
body.light-theme .card[style*="linear-gradient(135deg, #1e293b"],
body.light-theme .card[style*="linear-gradient(135deg, #0f172a"],
body.light-theme .card[style*="linear-gradient(135deg, #1e3a5f"],
body.light-theme .card[style*="linear-gradient(135deg, #2d1b4e"],
body.light-theme .card[style*="background: linear-gradient"],
body.light-theme div[style*="linear-gradient(135deg, #1e293b"],
body.light-theme div[style*="linear-gradient(135deg, #0f172a"] {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04) !important;
    border-radius: 12px !important;
}

/* Current Value Card - Clean white neumorphic */
body.light-theme .card[style*="#1e3a5f"],
body.light-theme .card[style*="1e3a5f"] {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04) !important;
    border-radius: 12px !important;
}

/* Investment Card - Clean white neumorphic */
body.light-theme .card[style*="#2d1b4e"],
body.light-theme .card[style*="2d1b4e"] {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04) !important;
    border-radius: 12px !important;
}

/* Profit/Returns Cards - Clean with subtle green tint at bottom */
body.light-theme .card[style*="#10b981"],
body.light-theme .card[style*="10b981"] {
    background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 60%, #dcfce7 100%) !important;
    border: 1px solid #bbf7d0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(16, 185, 129, 0.08) !important;
    border-radius: 12px !important;
}

/* Loss Cards - Clean white neumorphic */
body.light-theme .card[style*="#ef4444"],
body.light-theme .card[style*="ef4444"] {
    background: #ffffff !important;
    border: 1px solid #fecaca !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(239, 68, 68, 0.06) !important;
    border-radius: 12px !important;
}

/* SENSEX/NIFTY Index Cards - Clean white neumorphic */
body.light-theme .card[style*="linear-gradient(135deg, #1e293b 0%, #0f172a"] {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04) !important;
    border-radius: 12px !important;
}

/* =============================================================================
   ICON BADGES - Circular colored backgrounds like in image
   ============================================================================= */

/* Icon containers in cards - make them circular with colored backgrounds */
body.light-theme .card-body i[class*="fa-wallet"],
body.light-theme .card-body i[class*="fa-piggy-bank"],
body.light-theme .card-body i[class*="fa-chart-line"],
body.light-theme .card-body i[class*="fa-trophy"],
body.light-theme .card-body i[class*="fa-fire"],
body.light-theme .card-body i[class*="fa-coins"] {
    padding: 8px;
    border-radius: 50%;
    font-size: 0.9rem !important;
}

/* Blue icon badge */
body.light-theme .card-body i[style*="color: #3b82f6"],
body.light-theme .card-body i[style*="#3b82f6"] {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #3b82f6 !important;
}

/* Purple icon badge */
body.light-theme .card-body i[style*="color: #8b5cf6"],
body.light-theme .card-body i[style*="#8b5cf6"] {
    background: rgba(139, 92, 246, 0.15) !important;
    color: #8b5cf6 !important;
}

/* Green icon badge */
body.light-theme .card-body i[style*="color: #10b981"],
body.light-theme .card-body i[style*="#10b981"],
body.light-theme .card-body i[style*="color: #22c55e"],
body.light-theme .card-body i[style*="#22c55e"] {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #10b981 !important;
}

/* Red/Orange icon badge */
body.light-theme .card-body i[style*="color: #ef4444"],
body.light-theme .card-body i[style*="#ef4444"],
body.light-theme .card-body i[style*="color: #f97316"],
body.light-theme .card-body i[style*="#f97316"] {
    background: rgba(249, 115, 22, 0.15) !important;
    color: #f97316 !important;
}

/* Fix text colors inside light theme tiles */
body.light-theme .card[style*="linear-gradient"] .card-body span[style*="color: #6b7280"],
body.light-theme .card[style*="linear-gradient"] .card-body span[style*="#6b7280"] {
    color: #64748b !important;
}

body.light-theme .card[style*="linear-gradient"] .card-body div[style*="color: #ffffff"],
body.light-theme .card[style*="linear-gradient"] .card-body div[style*="#ffffff"],
body.light-theme .card[style*="linear-gradient"] .card-body span[style*="color: #ffffff"],
body.light-theme .card[style*="linear-gradient"] .card-body span[style*="#ffffff"] {
    color: #1e293b !important;
}

/* Fix card body value text - make it dark */
body.light-theme .card[style*="linear-gradient"] .card-body div[style*="fontWeight: 700"],
body.light-theme .card[style*="linear-gradient"] .card-body div[style*="fontWeight:700"],
body.light-theme .card[style*="linear-gradient"] .card-body div[style*="font-weight: 700"] {
    color: #1e293b !important;
}

/* Preserve colored values (blue, purple, green, red) */
body.light-theme .card[style*="linear-gradient"] div[style*="color: #3b82f6"],
body.light-theme .card[style*="linear-gradient"] div[style*="#3b82f6"] {
    color: #2563eb !important;
}

body.light-theme .card[style*="linear-gradient"] div[style*="color: #8b5cf6"],
body.light-theme .card[style*="linear-gradient"] div[style*="#8b5cf6"] {
    color: #7c3aed !important;
}

body.light-theme .card[style*="linear-gradient"] div[style*="color: #10b981"],
body.light-theme .card[style*="linear-gradient"] div[style*="#10b981"] {
    color: #059669 !important;
}

body.light-theme .card[style*="linear-gradient"] div[style*="color: #ef4444"],
body.light-theme .card[style*="linear-gradient"] div[style*="#ef4444"] {
    color: #dc2626 !important;
}

/* Dashboard tile hover effect - subtle lift */
body.light-theme .card[style*="linear-gradient"]:hover {
    transform: translateY(-2px) !important;
    box-shadow: 
        10px 10px 20px rgba(174, 174, 192, 0.5),
        -10px -10px 20px rgba(255, 255, 255, 0.9) !important;
    transition: all 0.25s ease-out !important;
}

/* Smooth transition for all tiles */
body.light-theme .card[style*="linear-gradient"] {
    transition: all 0.25s ease-out !important;
}

/* =============================================================================
   METRIC CARDS & PORTFOLIO TILES - CLEAN NEUMORPHIC DESIGN
   ============================================================================= */

body.light-theme .metric-card,
body.light-theme .dashboard-tile,
body.light-theme .portfolio-metric-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04) !important;
    border-radius: 12px !important;
    transition: all 0.25s ease-out !important;
}

body.light-theme .metric-card:hover,
body.light-theme .dashboard-tile:hover,
body.light-theme .portfolio-metric-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.06) !important;
}

body.light-theme .metric-card h5,
body.light-theme .dashboard-tile h5 {
    color: #1e293b !important;
}

body.light-theme .metric-card small,
body.light-theme .dashboard-tile small {
    color: #64748b !important;
}

/* =============================================================================
   GENERAL CARD - CLEAN LIGHT THEME DESIGN
   ============================================================================= */

body.light-theme .card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06),
                0 4px 12px rgba(0, 0, 0, 0.04) !important;
    border-radius: 12px !important;
    transition: box-shadow 0.2s ease, transform 0.2s ease !important;
}

body.light-theme .card:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08),
                0 8px 24px rgba(0, 0, 0, 0.06) !important;
}

/* =============================================================================
   INVESTMENT PAGE TILES - CLEAN NEUMORPHIC DESIGN
   ============================================================================= */

/* Risk profile cards */
body.light-theme .card[style*="borderLeft: 3px solid"],
body.light-theme .card[style*="border-left: 3px solid"] {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04) !important;
    border-radius: 12px !important;
}

/* Investment input section */
body.light-theme div[style*="background: #1e2a3a"],
body.light-theme div[style*="background:#1e2a3a"],
body.light-theme input[style*="background: #1e2a3a"],
body.light-theme input[style*="background:#1e2a3a"] {
    background: #ffffff !important;
    color: #1e293b !important;
    border-color: #e2e8f0 !important;
}

/* =============================================================================
   PERFORMANCE SUMMARY CARDS - LIGHT THEME ENHANCED SHADING
   ============================================================================= */

body.light-theme .perf-summary-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04) !important;
    border-radius: 12px !important;
    transition: box-shadow 0.2s ease, transform 0.2s ease !important;
}

body.light-theme .perf-summary-card:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.06) !important;
}

body.light-theme .perf-summary-card.perf-highlight {
    background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 60%, #dcfce7 100%) !important;
    border: 1px solid #bbf7d0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(16, 185, 129, 0.08) !important;
    border-radius: 12px !important;
}

body.light-theme .perf-card-label {
    color: #64748b !important;
}

body.light-theme .perf-card-value {
    color: #1e293b !important;
}

/* =============================================================================
   WORKFLOW PAGE TILES - CLEAN NEUMORPHIC DESIGN
   ============================================================================= */

body.light-theme div[style*="linear-gradient(180deg, rgba(15,25,35"],
body.light-theme div[style*="linear-gradient(180deg, rgba(10,20,30"] {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04) !important;
    border-radius: 12px !important;
}

/* Help page and Token Usage page card body dark panels */
body.light-theme .card-body div[style*="linear-gradient(180deg, rgba(15,25,35"],
body.light-theme .card-body div[style*="linear-gradient(180deg, rgba(10,20,30"],
body.light-theme .card-body [style*="background: linear-gradient(180deg, rgba(15"],
body.light-theme .card-body [style*="background: linear-gradient(180deg, rgba(10"] {
    background: linear-gradient(145deg, #ffffff 0%, #f5f7fa 40%, #e8ecf1 100%) !important;
    border: 1px solid #e2e8f0 !important;
    border-top: 1px solid #ffffff !important;
    border-left: 1px solid #ffffff !important;
    box-shadow: 
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
    border-radius: 12px !important;
}

/* Text inside card body dark panels - convert to dark text */
body.light-theme .card-body div[style*="linear-gradient"] h6[style*="color: #f8fafc"],
body.light-theme .card-body div[style*="linear-gradient"] [style*="color: #f8fafc"],
body.light-theme .card-body div[style*="linear-gradient"] [style*="color:#f8fafc"] {
    color: #1e293b !important;
}

body.light-theme .card-body div[style*="linear-gradient"] ol,
body.light-theme .card-body div[style*="linear-gradient"] ul,
body.light-theme .card-body div[style*="linear-gradient"] li,
body.light-theme .card-body div[style*="linear-gradient"] p {
    color: #475569 !important;
}

body.light-theme .card-body div[style*="linear-gradient"] .small,
body.light-theme .card-body div[style*="linear-gradient"] small,
body.light-theme .card-body div[style*="linear-gradient"] [style*="color: #e8eef3"] {
    color: #64748b !important;
}

/* =============================================================================
   GENERAL PANEL BACKGROUNDS - LIGHT THEME
   ============================================================================= */

body.light-theme [style*="backgroundColor: transparent"],
body.light-theme [style*="background-color: transparent"],
body.light-theme [style*="background: transparent"] {
    background: transparent !important;
}

/* Any remaining dark backgrounds */
body.light-theme [style*="background: rgba(15"],
body.light-theme [style*="background:rgba(15"],
body.light-theme [style*="background: rgba(10"],
body.light-theme [style*="background:rgba(10"],
body.light-theme [style*="background: rgba(12"],
body.light-theme [style*="background:rgba(12"] {
    background: #f8fafc !important;
}

/* =============================================================================
   INVESTMENT PAGE SPECIFIC - LIGHT THEME
   ============================================================================= */

/* Risk profile card backgrounds */
body.light-theme .card[style*="backgroundColor: #1e293b"],
body.light-theme .card[style*="background-color: #1e293b"],
body.light-theme div[style*="backgroundColor: #1e293b"],
body.light-theme div[style*="background-color: #1e293b"] {
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme [style*="backgroundColor: #0f172a"],
body.light-theme [style*="background-color: #0f172a"] {
    background-color: #f8fafc !important;
}

/* Tab styling for investment page */
body.light-theme .nav-tabs .nav-link[style*="backgroundColor: #0f172a"],
body.light-theme .nav-tabs .nav-item [style*="backgroundColor: #0f172a"] {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
}

body.light-theme .nav-tabs .nav-link.active[style*="backgroundColor"],
body.light-theme .nav-tabs .nav-item.active [style*="backgroundColor"] {
    background-color: #ffffff !important;
    color: #1e293b !important;
    border-bottom-color: #ffffff !important;
}

/* Characteristics list styling */
body.light-theme ul[style*="color: #94a3b8"],
body.light-theme ul[style*="color:#94a3b8"],
body.light-theme li[style*="color: #94a3b8"] {
    color: #64748b !important;
}

/* Investment card result section */
body.light-theme div[style*="backgroundColor: #1e293b"][style*="borderRadius"],
body.light-theme div[style*="background-color: #1e293b"][style*="border-radius"] {
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

/* Fix text in investment cards */
body.light-theme [style*="backgroundColor: #1e293b"] h5[style*="color: #e2e8f0"],
body.light-theme [style*="background-color: #1e293b"] h5[style*="color: #e2e8f0"],
body.light-theme [style*="backgroundColor: #0f172a"] h5,
body.light-theme [style*="background-color: #0f172a"] h5 {
    color: #1e293b !important;
}

body.light-theme [style*="backgroundColor: #1e293b"] small[style*="color: #64748b"],
body.light-theme [style*="background-color: #1e293b"] small[style*="color: #64748b"] {
    color: #64748b !important;
}

body.light-theme [style*="backgroundColor: #1e293b"] span[style*="color: #94a3b8"],
body.light-theme [style*="background-color: #1e293b"] span[style*="color: #94a3b8"] {
    color: #64748b !important;
}

/* =============================================================================
   DASH DATATABLE - PROFESSIONAL LIGHT THEME
   ============================================================================= */
body.light-theme .token-datatable-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme .token-datatable-container th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
}

body.light-theme .token-datatable-container td {
    background: transparent !important;
    color: #334155 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .token-datatable-container tr:nth-child(odd) td {
    background: rgba(102, 126, 234, 0.04) !important;
}

body.light-theme .token-datatable-container tr:hover td {
    background: rgba(102, 126, 234, 0.1) !important;
}

body.light-theme .token-datatable-container .dash-filter input,
body.light-theme .token-datatable-container input[type="text"] {
    background-color: #ffffff !important;
    color: #1a202c !important;
    border: 1px solid #d1d9e6 !important;
}

body.light-theme .token-datatable-container .dash-filter input::placeholder {
    color: #94a3b8 !important;
}

body.light-theme .token-datatable-container .dash-filter input:focus {
    border-color: #667eea !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15) !important;
}

body.light-theme .token-datatable-container td[data-dash-column="Total Tokens"] {
    color: #667eea !important;
}

body.light-theme .token-datatable-container td[data-dash-column="User"] {
    color: #64748b !important;
}

body.light-theme .token-datatable-container .previous-next-container button {
    background: rgba(102, 126, 234, 0.1) !important;
    color: #334155 !important;
    border: 1px solid #d1d9e6 !important;
}

body.light-theme .token-datatable-container .previous-next-container button:hover {
    background: rgba(102, 126, 234, 0.2) !important;
}

body.light-theme .token-datatable-container .current-page,
body.light-theme .token-datatable-container .page-number {
    color: #334155 !important;
}

/* =============================================================================
   PORTFOLIO TABS - LIGHT THEME
   ============================================================================= */
body.light-theme .portfolio-tabs .nav-tabs {
    border-bottom: 2px solid #e2e8f0;
}

body.light-theme .portfolio-tabs .nav-link {
    background: #f1f5f9 !important;
    color: #334155 !important;
    font-weight: 600 !important;
}

body.light-theme .portfolio-tabs .nav-link:hover {
    background: #e2e8f0 !important;
    color: #1e293b !important;
}

body.light-theme .portfolio-tabs .nav-link.active {
    background: #ffffff !important;
    color: #1e293b !important;
    font-weight: 700 !important;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05) !important;
}

/* Stock Accordion - Light Theme */
body.light-theme .stock-accordion .accordion-button {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    color: #1e293b !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme .stock-accordion .accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

body.light-theme .stock-accordion .accordion-button::after {
    filter: none;
}

/* =============================================================================
   PERFORMANCE ANALYTICS - LIGHT THEME
   ============================================================================= */
body.light-theme .performance-analytics-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
}

body.light-theme .btn-group .btn-secondary.btn-outline {
    color: #64748b !important;
    border-color: #d1d5db !important;
}

body.light-theme .btn-group .btn-secondary.btn-outline:hover {
    background: rgba(102, 126, 234, 0.1) !important;
    color: #1e293b !important;
}

body.light-theme .performance-stat-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
}

/* Performance filter buttons - Light Theme */
body.light-theme .performance-filter-group .btn-secondary {
    background: #f1f5f9 !important;
    border: 1px solid #d1d5db !important;
    color: #64748b !important;
}

body.light-theme .performance-filter-group .btn-secondary:hover {
    background: rgba(102, 126, 234, 0.1) !important;
    border-color: #667eea !important;
    color: #1e293b !important;
}

/* Generic DataTable light theme */
body.light-theme .dash-table-container .dash-filter input,
body.light-theme .dash-table-container input[type="text"],
body.light-theme .dash-spreadsheet-container .dash-filter input,
body.light-theme .dash-spreadsheet input.dash-filter--case-sensitive--default,
body.light-theme .dash-spreadsheet input.dash-filter--case-insensitive--default {
    background-color: #ffffff !important;
    color: #1a202c !important;
    border: 1px solid #d1d9e6 !important;
    border-radius: 4px !important;
    padding: 4px 8px !important;
}

body.light-theme .dash-table-container .dash-filter input::placeholder,
body.light-theme .dash-spreadsheet input::placeholder {
    color: #718096 !important;
    opacity: 1 !important;
}

body.light-theme .dash-table-container .dash-filter input:focus,
body.light-theme .dash-spreadsheet input:focus {
    border-color: #667eea !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2) !important;
}

/* DataTable header styling for light mode */
body.light-theme .dash-spreadsheet-container .dash-header,
body.light-theme .dash-table-container th {
    background-color: #667eea !important;
    color: white !important;
}

/* DataTable cell styling for light mode */
body.light-theme .dash-spreadsheet-container .dash-cell,
body.light-theme .dash-table-container td {
    background-color: #ffffff !important;
    color: #2d3748 !important;
    border-color: #e2e8f0 !important;
}

body.light-theme .dash-spreadsheet-container .dash-cell.row-odd,
body.light-theme .dash-table-container tr:nth-child(odd) td {
    background-color: #f7fafc !important;
}

/* DataTable hover effect */
body.light-theme .dash-spreadsheet-container .dash-cell:hover,
body.light-theme .dash-table-container td:hover {
    background-color: #edf2f7 !important;
}

/* =============================================================================
   INVESTMENT TREND CHART - Light Theme Overrides
   ============================================================================= */

body.light-theme .investment-trend-chart {
    background: transparent;
}

/* Metric cards - Light theme */
body.light-theme .investment-trend-chart .portfolio-metric-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06) !important;
    color: #1e293b !important;
}

body.light-theme .investment-trend-chart .portfolio-metric-card.metric-main {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.02)) !important;
    border: 2px solid rgba(16, 185, 129, 0.4) !important;
}

body.light-theme .investment-trend-chart .portfolio-metric-card .metric-label {
    color: #64748b !important;
}

/* Chart container - Light theme */
body.light-theme .investment-trend-chart .investment-chart-container {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

/* Period tabs container - Light theme */
body.light-theme .investment-trend-chart .period-tabs-container {
    background: rgba(99, 102, 241, 0.05) !important;
    border: 1px solid #e2e8f0 !important;
}

/* Title and labels - Light theme */
body.light-theme .investment-trend-chart h4 {
    color: #1e293b !important;
}

/* Plotly chart elements - Light theme */
body.light-theme .investment-trend-chart .xtick text,
body.light-theme .investment-trend-chart .ytick text {
    fill: #64748b !important;
}

body.light-theme .investment-trend-chart .legendtext {
    fill: #64748b !important;
}

/* Grid lines - Light theme */
body.light-theme .investment-trend-chart .gridlayer line {
    stroke: rgba(148, 163, 184, 0.2) !important;
}

/* Axis lines - Light theme */
body.light-theme .investment-trend-chart .xlines line,
body.light-theme .investment-trend-chart .ylines line {
    stroke: rgba(148, 163, 184, 0.3) !important;
}

/* Range slider - Light theme */
body.light-theme .investment-trend-chart .rangeslider-bg {
    fill: #f1f5f9 !important;
}

body.light-theme .investment-trend-chart .rangeslider-mask-min,
body.light-theme .investment-trend-chart .rangeslider-mask-max {
    fill: rgba(241, 245, 249, 0.85) !important;
}

body.light-theme .investment-trend-chart .rangeslider-slidebox {
    fill: rgba(99, 102, 241, 0.15) !important;
    stroke: #6366f1 !important;
}

body.light-theme .investment-trend-chart .rangeslider-grabarea {
    fill: rgba(99, 102, 241, 0.2) !important;
}

/* Period tabs - Light theme */
body.light-theme .investment-trend-chart .period-tab {
    color: #64748b !important;
}

body.light-theme .investment-trend-chart .period-tab:hover {
    background: rgba(99, 102, 241, 0.1) !important;
    color: #1e293b !important;
}

body.light-theme .investment-trend-chart .period-tab.active {
    background: #6366f1 !important;
    color: #ffffff !important;
}

/* =============================================================================
   RISK MANAGEMENT DASHBOARD - Light Theme
   ============================================================================= */

body.light-theme .risk-management-dashboard {
    color: #1e293b;
}

body.light-theme .risk-metric-card {
    background: linear-gradient(145deg, #ffffff, #e8eef5) !important;
    border: 1px solid #d1d9e6 !important;
    box-shadow: 8px 8px 16px #c8ced4, -8px -8px 16px #ffffff;
}

body.light-theme .risk-metric-card:hover {
    box-shadow: 4px 4px 10px #c8ced4, -4px -4px 10px #ffffff;
}

body.light-theme .risk-metric-card > div:first-child {
    color: #64748b !important;
}

body.light-theme .risk-metric-card > div:nth-child(2) {
    color: #1e293b !important;
}

body.light-theme .risk-chart-card {
    background: linear-gradient(145deg, #ffffff, #e8eef5) !important;
    border: 1px solid #d1d9e6 !important;
    box-shadow: 8px 8px 16px #c8ced4, -8px -8px 16px #ffffff;
}

body.light-theme .risk-chart-card > div > div > span {
    color: #1e293b !important;
}

body.light-theme .risk-chart-card > div > small,
body.light-theme .risk-chart-card small {
    color: #64748b !important;
}

body.light-theme .risk-chart-select {
    background-color: #e8eef5 !important;
    color: #1e293b !important;
    border: 1px solid #d1d9e6 !important;
    box-shadow: inset 2px 2px 4px #c8ced4, inset -2px -2px 4px #ffffff;
}

body.light-theme .risk-chart-select:focus {
    border-color: #3182ce !important;
    box-shadow: inset 2px 2px 4px #c8ced4, inset -2px -2px 4px #ffffff, 0 0 0 2px rgba(49, 130, 206, 0.2) !important;
}

body.light-theme .risk-chart-select option {
    background-color: #f8f9fc !important;
    color: #1e293b !important;
}

/* Risk chart area backgrounds - Light theme */
body.light-theme .risk-chart-card .js-plotly-plot .plotly .main-svg {
    background: transparent !important;
}

body.light-theme .risk-chart-card .js-plotly-plot .plotly .bg {
    fill: transparent !important;
}

/* Axis labels - Light theme */
body.light-theme .risk-chart-card .xtick text,
body.light-theme .risk-chart-card .ytick text,
body.light-theme .risk-chart-card .g-xtitle text,
body.light-theme .risk-chart-card .g-ytitle text {
    fill: #64748b !important;
}

/* Grid lines - Light theme */
body.light-theme .risk-chart-card .xgrid,
body.light-theme .risk-chart-card .ygrid {
    stroke: rgba(148, 163, 184, 0.2) !important;
}

/* Dashboard header - Light theme */
body.light-theme .risk-management-dashboard h4 {
    color: #1e293b !important;
}

body.light-theme .risk-management-dashboard > div:first-child > p {
    color: #64748b !important;
}

/* Keep profit/loss colors visible in light theme */
body.light-theme .risk-metric-card span[style*="color: #10b981"],
body.light-theme .risk-metric-card span[style*="color:#10b981"] {
    color: #059669 !important;
}

body.light-theme .risk-metric-card span[style*="color: #ef4444"],
body.light-theme .risk-metric-card span[style*="color:#ef4444"] {
    color: #dc2626 !important;
}

/* =============================================================================
   EQUITY CURVE CHART - Light Theme
   ============================================================================= */

body.light-theme .equity-curve-section {
    background: linear-gradient(145deg, #ffffff, #f1f5f9) !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 8px 8px 16px #d1d9e6, -8px -8px 16px #ffffff;
}

body.light-theme .equity-curve-title {
    color: #1e293b !important;
}

body.light-theme .equity-curve-subtitle {
    color: #64748b !important;
}

/* Equity curve chart axis text - Light theme */
body.light-theme .equity-curve-container .xtick text,
body.light-theme .equity-curve-container .ytick text {
    fill: #64748b !important;
}

/* Equity curve chart grid lines - Light theme */
body.light-theme .equity-curve-container .xgrid,
body.light-theme .equity-curve-container .ygrid {
    stroke: rgba(148, 163, 184, 0.2) !important;
}

/* Equity curve range slider - Light theme */
body.light-theme .equity-curve-container .rangeslider-bg {
    fill: #f1f5f9 !important;
}

body.light-theme .equity-curve-container .rangeslider-mask-min,
body.light-theme .equity-curve-container .rangeslider-mask-max {
    fill: rgba(241, 245, 249, 0.85) !important;
}

body.light-theme .equity-curve-container .rangeslider-slidebox {
    fill: rgba(99, 102, 241, 0.15) !important;
    stroke: #6366f1 !important;
}

body.light-theme .equity-curve-container .rangeslider-grabarea {
    fill: rgba(99, 102, 241, 0.2) !important;
}

/* Period tabs - Light theme */
body.light-theme .equity-curve-container .period-tab {
    color: #64748b !important;
}

body.light-theme .equity-curve-container .period-tab:hover {
    background: rgba(99, 102, 241, 0.1) !important;
    color: #1e293b !important;
}

body.light-theme .equity-curve-container .period-tab.active {
    background: #6366f1 !important;
    color: #ffffff !important;
}

/* =============================================================================
   STOCK TREND SECTION - Light Theme
   ============================================================================= */

body.light-theme .stock-trend-section {
    background: linear-gradient(145deg, #ffffff, #f1f5f9) !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 8px 8px 16px #d1d9e6, -8px -8px 16px #ffffff;
}

body.light-theme .stock-trend-title {
    color: #1e293b !important;
}

body.light-theme .stock-trend-subtitle {
    color: #64748b !important;
}

body.light-theme .stock-trend-accordion-item {
    background: linear-gradient(145deg, #ffffff, #f8fafc) !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 4px 4px 8px #d1d9e6, -4px -4px 8px #ffffff;
}

body.light-theme .stock-trend-accordion-item .accordion-button {
    background: transparent !important;
    color: #1e293b !important;
}

body.light-theme .stock-trend-accordion-item .accordion-button:not(.collapsed) {
    background: rgba(59, 130, 246, 0.08) !important;
}

body.light-theme .stock-trend-accordion-item .accordion-button::after {
    filter: none;
}

body.light-theme .stock-trend-symbol {
    color: #1e293b !important;
}

body.light-theme .stock-trend-price {
    color: #1e293b !important;
}

body.light-theme .stock-trend-metric-value {
    color: #1e293b !important;
}

body.light-theme .stock-trend-chart-wrapper {
    background: rgba(241, 245, 249, 0.5);
}

/* Stock Trend chart axis text - Light theme */
body.light-theme .stock-trend-chart-container .xtick text,
body.light-theme .stock-trend-chart-container .ytick text {
    fill: #64748b !important;
}

/* Stock Trend chart grid lines - Light theme */
body.light-theme .stock-trend-chart-container .xgrid,
body.light-theme .stock-trend-chart-container .ygrid {
    stroke: rgba(148, 163, 184, 0.2) !important;
}

/* Stock Trend range slider - Light theme */
body.light-theme .stock-trend-chart-container .rangeslider-bg {
    fill: #f1f5f9 !important;
}

body.light-theme .stock-trend-chart-container .rangeslider-mask-min,
body.light-theme .stock-trend-chart-container .rangeslider-mask-max {
    fill: rgba(241, 245, 249, 0.85) !important;
}

body.light-theme .stock-trend-chart-container .rangeslider-slidebox {
    fill: rgba(59, 130, 246, 0.15) !important;
    stroke: rgba(59, 130, 246, 0.4) !important;
}

body.light-theme .stock-trend-chart-container .rangeslider-grabarea {
    fill: rgba(59, 130, 246, 0.2) !important;
}

/* =============================================================================
   STOCK ANALYSIS DASHBOARD - Light Theme
   ============================================================================= */

body.light-theme .stock-analysis-summary-card {
    background: linear-gradient(145deg, #ffffff, #f1f5f9) !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

body.light-theme .stock-analysis-summary-item {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
}

body.light-theme .stock-analysis-summary-icon {
    background: rgba(99, 102, 241, 0.12) !important;
    color: #6366f1 !important;
}

body.light-theme .stock-analysis-summary-label {
    color: #64748b !important;
}

body.light-theme .stock-analysis-summary-value {
    color: #1e293b !important;
}

body.light-theme .stock-analysis-tabs {
    border-bottom: 1px solid #e2e8f0;
}

body.light-theme .stock-analysis-tabs .nav-link {
    color: #64748b !important;
}

body.light-theme .stock-analysis-tabs .nav-link.active {
    color: #1e293b !important;
}

body.light-theme .stock-analysis-accordion-item {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

body.light-theme .stock-analysis-accordion-item .accordion-button {
    color: #1e293b !important;
}

body.light-theme .stock-analysis-accordion-item .accordion-button:not(.collapsed) {
    background: rgba(99, 102, 241, 0.05) !important;
}

body.light-theme .stock-analysis-accordion-item .accordion-button::after {
    filter: none;
}

body.light-theme .stock-analysis-symbol {
    color: #1e293b;
}

body.light-theme .stock-analysis-header-price {
    color: #64748b;
}

body.light-theme .stock-analysis-label {
    color: #64748b !important;
}

body.light-theme .stock-analysis-metric-card {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
}

body.light-theme .stock-analysis-current {
    color: #2563eb !important;
}

body.light-theme .stock-analysis-invested {
    color: #7c3aed !important;
}

body.light-theme .stock-analysis-info-item {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
}

body.light-theme .stock-analysis-small-value {
    color: #1e293b !important;
}

body.light-theme .stock-analysis-progress-pct {
    color: #64748b;
}

body.light-theme .stock-analysis-progress-bar {
    background: #e2e8f0 !important;
}

body.light-theme .stock-analysis-ai-buy-card {
    background: rgba(16, 185, 129, 0.1) !important;
    border: 1px solid rgba(16, 185, 129, 0.2) !important;
}

body.light-theme .stock-analysis-ai-sell-card {
    background: rgba(239, 68, 68, 0.08) !important;
    border: 1px solid rgba(239, 68, 68, 0.15) !important;
}

body.light-theme .stock-analysis-ai-buy {
    color: #059669 !important;
}

body.light-theme .stock-analysis-ai-sell {
    color: #dc2626 !important;
}

body.light-theme .stock-analysis-insight-card {
    background: rgba(139, 92, 246, 0.06) !important;
    border: 1px solid rgba(139, 92, 246, 0.15) !important;
}

body.light-theme .stock-analysis-insight-text {
    color: #6d28d9 !important;
}

body.light-theme .stock-analysis-footer {
    border-top-color: #e2e8f0 !important;
}

body.light-theme .stock-analysis-meta-item {
    color: #64748b;
}

/* P&L card in light theme */
body.light-theme .stock-analysis-pnl-card {
    border-radius: 10px !important;
}

body.light-theme .stock-analysis-pnl-value {
    font-weight: 700 !important;
}

/* Stock P&L heading and FY label */
body.light-theme [style*="color: #f8fafc"] {
    color: #1e293b !important;
}

/* FY Dropdown - override dark inline styles */
body.light-theme .pnl-year-select,
body.light-theme #pnl-year-filter {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    border: 1px solid #d1d5db !important;
}

body.light-theme .pnl-year-select option,
body.light-theme #pnl-year-filter option {
    background: #ffffff !important;
    color: #1e293b !important;
}

body.light-theme .stock-analysis-alert {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

/* =============================================================================
   ANALYSIS DETAILS MODAL (Light Theme Override)
   ============================================================================= */

body.light-theme #analysis-details-modal .modal-content {
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme .analysis-details-header {
    background: linear-gradient(90deg, #f1f5f9, #e2e8f0) !important;
    border-bottom: 2px solid #7c3aed !important;
}

body.light-theme .analysis-details-title {
    color: #1e293b !important;
}

body.light-theme .analysis-details-body {
    background: #f8fafc !important;
    color: #1e293b !important;
}

body.light-theme .analysis-details-footer {
    background: #f1f5f9 !important;
    border-top: 1px solid #e2e8f0 !important;
}

body.light-theme .analysis-details-footer .btn-secondary {
    border-color: #cbd5e1 !important;
    color: #334155 !important;
}

body.light-theme .analysis-details-no-data {
    color: #334155 !important;
}

body.light-theme .analysis-details-muted {
    color: #64748b !important;
}

body.light-theme .analysis-card-blue {
    background-color: #ffffff !important;
    border: 1px solid #bfdbfe !important;
}

body.light-theme .analysis-card-header-blue {
    background: #eff6ff !important;
    border-bottom: 2px solid #3b82f6 !important;
}

body.light-theme .analysis-card-header-blue span {
    color: #1e293b !important;
}

body.light-theme .analysis-card-purple {
    background-color: #ffffff !important;
    border: 1px solid #ddd6fe !important;
}

body.light-theme .analysis-card-header-purple {
    background: #f5f3ff !important;
    border-bottom: 2px solid #7c3aed !important;
}

body.light-theme .analysis-card-header-purple span {
    color: #1e293b !important;
}

body.light-theme .analysis-card-amber {
    background-color: #ffffff !important;
    border: 1px solid #fde68a !important;
}

body.light-theme .analysis-card-header-amber {
    background: #fffbeb !important;
    border-bottom: 2px solid #f59e0b !important;
}

body.light-theme .analysis-card-header-amber span {
    color: #1e293b !important;
}

body.light-theme .analysis-details-pre {
    color: #1e293b !important;
}

/* =============================================================================
   PORTFOLIO HOME PAGE — Light Theme Override
   ============================================================================= */

/* Page Container */
body.light-theme .portfolio-page-container {
    background: #f0f4f8 !important;
}

/* Summary Cards */
body.light-theme .summary-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

body.light-theme .summary-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
}

body.light-theme .summary-card-label {
    color: #64748b !important;
}

body.light-theme .summary-card-value {
    color: #1e293b !important;
}

/* Stock Tile Cards */
body.light-theme .stock-tile-card {
    border: 1px solid #e2e8f0 !important;
}

body.light-theme .stock-tile-inner {
    background: #ffffff !important;
}

body.light-theme .stock-tile-meta {
    color: #64748b !important;
}

body.light-theme .stock-tile-meta-sep {
    color: #94a3b8 !important;
}

body.light-theme .stock-tile-symbol {
    color: #1e293b !important;
}

body.light-theme .stock-tile-label-green {
    color: #059669 !important;
}

/* Market Indices Combined Card */
body.light-theme .market-idx-card {
    background: #ffffff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme .market-idx-label {
    color: #64748b !important;
}

body.light-theme .market-idx-value {
    color: #1e293b !important;
}

body.light-theme .market-idx-open {
    color: #94a3b8 !important;
}

body.light-theme .market-idx-divider {
    border-right-color: #e2e8f0 !important;
}

/* Tabs in light theme */
body.light-theme .nav-pills-custom .nav-link {
    color: #64748b !important;
}

body.light-theme .nav-pills-custom .nav-link.active {
    color: #3b82f6 !important;
    background-color: rgba(59, 130, 246, 0.08) !important;
}

/* Investment tab inputs */
body.light-theme #start-invest-amount {
    background: #ffffff !important;
    color: #1e293b !important;
    border: 1px solid #d1d5db !important;
}

/* Empty portfolio message */
body.light-theme .portfolio-page-container .text-center p {
    color: #64748b !important;
}

/* Market indices card in portfolio */
body.light-theme #market-indices-card .card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme #market-indices-card .card span {
    color: #1e293b !important;
}

body.light-theme #market-indices-card #nifty-value,
body.light-theme #market-indices-card #sensex-value {
    color: #1e293b !important;
}

/* Trading signal banner */
body.light-theme .stock-tile-inner > div:last-child[style*="fbbf24"] {
    background-color: rgba(251, 191, 36, 0.15) !important;
}

/* HOLD button in light theme */
body.light-theme .stock-tile-inner .btn-secondary[disabled] {
    background-color: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
}

/* Risk toggle buttons */
body.light-theme .risk-toggle-group .btn-secondary {
    border-color: #d1d5db !important;
}

/* ==========================================================================
   INVESTMENT PAGE — Light Theme Overrides
   ========================================================================== */

/* Input section */
body.light-theme .invest-input-section {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Labels */
body.light-theme .invest-label {
    color: #1e293b;
}

/* Amount input */
body.light-theme .invest-input-prefix {
    background: #f8fafc;
    border-color: #d1d5db;
    color: #0891b2;
}
body.light-theme .invest-amount-input,
body.light-theme .invest-amount-input.form-control {
    background: #ffffff !important;
    border-color: #d1d5db !important;
    color: #1e293b !important;
}
body.light-theme .invest-amount-input:focus {
    border-color: #0891b2 !important;
    box-shadow: 0 0 0 2px rgba(8, 145, 178, 0.15) !important;
}

/* Quick amount buttons */
body.light-theme .invest-quick-btn {
    border-color: #d1d5db;
    color: #64748b;
}
body.light-theme .invest-quick-btn:hover {
    background: rgba(8, 145, 178, 0.08);
    border-color: #0891b2;
    color: #0891b2;
}

/* Strategy display bar */
body.light-theme .invest-strategy-display {
    color: #475569;
    background: #f8fafc;
    border-color: #e2e8f0;
}

/* Sector filter section */
body.light-theme .invest-sector-section {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Sector checklist pills */
body.light-theme .invest-sector-checklist .form-check-label {
    background: rgba(8, 145, 178, 0.05);
    border-color: #d1d5db;
    color: #64748b;
}
body.light-theme .invest-sector-checklist .form-check-input:checked + .form-check-label {
    background: rgba(8, 145, 178, 0.12);
    border-color: #0891b2;
    color: #0891b2;
}
body.light-theme .invest-sector-checklist .form-check-label:hover {
    background: rgba(8, 145, 178, 0.1);
    border-color: #0891b2;
}

/* Link buttons */
body.light-theme .invest-link-btn {
    color: #0891b2 !important;
}
body.light-theme .invest-link-btn-muted {
    color: #94a3b8 !important;
}

/* Icons */
body.light-theme .invest-accent-icon {
    color: #0891b2;
}

/* Text utilities */
body.light-theme .invest-heading {
    color: #1e293b;
}
body.light-theme .invest-subtext {
    color: #64748b;
}
body.light-theme .invest-muted-text {
    color: #94a3b8;
}
body.light-theme .invest-divider {
    border-color: #e2e8f0;
}

/* Tabs */
body.light-theme .invest-tabs {
    border-bottom-color: #e2e8f0;
}
body.light-theme .invest-tabs .nav-link {
    color: #64748b;
}
body.light-theme .invest-tabs .nav-link:hover {
    color: #1e293b;
    border-bottom-color: #cbd5e1;
}
body.light-theme .invest-tabs .nav-link.active {
    color: #0891b2 !important;
    border-bottom-color: #0891b2 !important;
}

/* Summary card */
body.light-theme .invest-summary-card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Metric card */
body.light-theme .invest-metric-card {
    background: #f8fafc;
}

/* Stock tile card */
body.light-theme .invest-stock-tile {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
body.light-theme .invest-stock-tile:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Chart wrapper */
body.light-theme .invest-chart-wrapper {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

/* Analysis modal */
body.light-theme .invest-analysis-modal .modal-content {
    background: #ffffff;
    border-color: #e2e8f0;
}
body.light-theme .invest-modal-header {
    background: #ffffff;
    border-bottom-color: #e2e8f0;
    color: #1e293b;
}
body.light-theme .invest-modal-body {
    background: #ffffff;
    color: #1e293b;
}
body.light-theme .invest-modal-footer {
    background: #f8fafc;
    border-top-color: #e2e8f0;
}

/* ==========================================================================
   SEARCH PAGE — Light Theme Overrides
   ========================================================================== */

body.light-theme .search-card {
    background: #ffffff;
    border-color: #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

body.light-theme .search-stock-input {
    background-color: #f8fafc !important;
    border-color: #d1d5db !important;
    color: #1e293b !important;
}
body.light-theme .search-stock-input::placeholder {
    color: #94a3b8 !important;
}
body.light-theme .search-stock-input:focus {
    border-color: #0891b2 !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 2px rgba(8, 145, 178, 0.12) !important;
}

/* ==========================================================================
   CHART MODAL — Light Theme Overrides
   ========================================================================== */

body.light-theme .chart-modal .modal-content {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.1);
}

/* Header */
body.light-theme .chart-modal-header {
    background: #ffffff;
    border-bottom-color: #e2e8f0;
}
body.light-theme .chart-modal-icon {
    color: #0891b2;
}
body.light-theme .chart-modal-title {
    color: #0f172a;
}
body.light-theme .chart-modal-header .btn-close {
    filter: none;
}

/* Body */
body.light-theme .chart-modal-body {
    background: #ffffff;
    color: #1e293b;
}

/* Footer */
body.light-theme .chart-modal-footer {
    background: #f8fafc;
    border-top-color: #e2e8f0;
}
body.light-theme .chart-modal-close-btn {
    border-color: #cbd5e1;
    color: #475569;
    background: #f1f5f9;
}
body.light-theme .chart-modal-close-btn:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    color: #0f172a;
}

/* Price info header */
body.light-theme .chart-info-header {
    background: #f8fafc;
    border-color: #e2e8f0;
}
body.light-theme .chart-info-price {
    color: #0f172a;
}
body.light-theme .chart-info-label {
    color: #64748b;
}
body.light-theme .chart-info-value {
    color: #1e293b;
}

/* Chart tabs */
body.light-theme .chart-tabs {
    border-bottom-color: #e2e8f0;
}
body.light-theme .chart-tabs .nav-link {
    color: #94a3b8;
}
body.light-theme .chart-tabs .nav-link:hover {
    color: #334155;
    border-bottom-color: #cbd5e1;
}
body.light-theme .chart-tabs .nav-link.active {
    color: #0891b2 !important;
    border-bottom-color: #0891b2 !important;
}

/* Chart graph wrapper */
body.light-theme .chart-graph-wrapper {
    background: #ffffff;
}

/* Signal bar */
body.light-theme .chart-signal-bar {
    background: #f8fafc;
    border-color: #e2e8f0;
}

/* Criteria */
body.light-theme .chart-criteria-group-title {
    color: #334155;
    border-bottom-color: #e2e8f0;
}
body.light-theme .chart-criteria-accordion .accordion-item {
    background: #ffffff;
    border-color: #e2e8f0;
}
body.light-theme .chart-criteria-accordion .accordion-button {
    background: #f8fafc;
    color: #1e293b;
}
body.light-theme .chart-criteria-accordion .accordion-button:not(.collapsed) {
    background: #f1f5f9;
    color: #0891b2;
}
body.light-theme .chart-criteria-accordion .accordion-body {
    background: #ffffff;
    color: #475569;
}

/* ==========================================================================
   MARKET FLAG SELECTOR — Light Theme Overrides
   ========================================================================== */

body.light-theme .market-flag-dropdown {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 12px 32px rgba(0,0,0,0.1);
}

body.light-theme .market-flag-option {
    color: #334155;
}
body.light-theme .market-flag-option:hover {
    background: rgba(0,0,0,0.04);
}
body.light-theme .market-flag-option.market-flag-active {
    background: rgba(8,145,178,0.08);
}

body.light-theme .market-flag-check {
    color: #0891b2;
}
body.light-theme .market-flag-img {
    border-color: rgba(0,0,0,0.15);
}
body.light-theme .market-flag-img-dd {
    border-color: rgba(0,0,0,0.12);
}