        /* ═══════════════════════════════════════════════════════════
           LIGHT THEME
           ═══════════════════════════════════════════════════════════ */
        :root, [data-theme="light"] {
            /* Primary — Brand Orange */
            --orange-700: #c2410c;
            --orange-600: #ea580c;
            --orange-500: #f97316;
            --orange-400: #fb923c;
            --orange-300: #fdba74;
            --orange-100: #ffedd5;
            --orange-50: #fff7ed;
            
            /* Neutrals — Slate */
            --bg-primary: #f8fafc;
            --bg-secondary: #f1f5f9;
            --bg-card: #ffffff;
            --bg-card-hover: #f8fafc;
            
            /* Market Colors — Gains */
            --accent-green: #22c55e;
            --accent-green-dim: rgba(34, 197, 94, 0.1);
            --accent-green-bg: #dcfce7;
            --accent-green-text: #166534;
            
            /* Market Colors — Losses */
            --accent-red: #ef4444;
            --accent-red-dim: rgba(239, 68, 68, 0.1);
            --accent-red-bg: #fee2e2;
            --accent-red-text: #991b1b;
            
            /* UI Accents */
            --accent-blue: #3b82f6;
            --accent-blue-dim: rgba(59, 130, 246, 0.1);
            --accent-purple: #8b5cf6;
            --accent-purple-dim: rgba(139, 92, 246, 0.1);
            --accent-yellow: #f59e0b;
            --accent-yellow-dim: rgba(245, 158, 11, 0.1);
            --accent-orange: #ea580c;
            --accent-teal: #14b8a6;
            --accent-cyan: #06b6d4;
            --accent-pink: #ec4899;
            
            /* Typography — Slate grays */
            --text-primary: #0f172a;
            --text-secondary: #475569;
            --text-muted: #94a3b8;
            
            /* Borders & shadows */
            --border-color: #e2e8f0;
            --gradient-1: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
            --gradient-2: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
            --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
            --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
            --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
            
            /* Chart colors */
            --chart-1: #ea580c;
            --chart-2: #3b82f6;
            --chart-3: #8b5cf6;
            --chart-4: #06b6d4;
            --chart-5: #ec4899;
            --chart-6: #14b8a6;
            --chart-grid: rgba(0,0,0,0.06);
            --chart-text: #64748b;
        }

        /* ═══════════════════════════════════════════════════════════
           DARK THEME - Deep slate backgrounds for after-hours
           ═══════════════════════════════════════════════════════════ */
        [data-theme="dark"] {
            /* Primary — Brand Orange (slightly brighter for dark) */
            --orange-700: #ea580c;
            --orange-600: #f97316;
            --orange-500: #fb923c;
            --orange-400: #fdba74;
            
            /* Neutrals — Dark Slate */
            --bg-primary: #0f172a;
            --bg-secondary: #1e293b;
            --bg-card: #1e293b;
            --bg-card-hover: #334155;
            
            /* Market Colors — Gains */
            --accent-green: #22c55e;
            --accent-green-dim: rgba(34, 197, 94, 0.2);
            --accent-green-bg: rgba(34, 197, 94, 0.15);
            --accent-green-text: #86efac;
            
            /* Market Colors — Losses */
            --accent-red: #ef4444;
            --accent-red-dim: rgba(239, 68, 68, 0.2);
            --accent-red-bg: rgba(239, 68, 68, 0.15);
            --accent-red-text: #fca5a5;
            
            /* UI Accents */
            --accent-blue: #3b82f6;
            --accent-blue-dim: rgba(59, 130, 246, 0.2);
            --accent-purple: #a78bfa;
            --accent-purple-dim: rgba(167, 139, 250, 0.2);
            --accent-yellow: #fbbf24;
            --accent-yellow-dim: rgba(251, 191, 36, 0.2);
            --accent-orange: #f97316;
            --accent-teal: #2dd4bf;
            --accent-cyan: #22d3ee;
            --accent-pink: #f472b6;
            
            /* Typography — Light slate */
            --text-primary: #f8fafc;
            --text-secondary: #94a3b8;
            --text-muted: #64748b;
            
            /* Borders & shadows */
            --border-color: #334155;
            --gradient-1: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
            --gradient-2: linear-gradient(135deg, #a78bfa 0%, #3b82f6 100%);
            --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
            --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
            --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
            
            /* Chart colors */
            --chart-1: #f97316;
            --chart-2: #3b82f6;
            --chart-3: #a78bfa;
            --chart-4: #22d3ee;
            --chart-5: #f472b6;
            --chart-6: #2dd4bf;
            --chart-grid: rgba(255,255,255,0.08);
            --chart-text: #94a3b8;
        }

        * { margin: 0; padding: 0; box-sizing: border-box; }

        /* Accessibility: visually hidden but available to screen readers */
        .visually-hidden {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            background: var(--bg-primary);
            color: var(--text-primary);
            min-height: 100vh;
            line-height: 1.6;
            font-size: 15px;
            transition: background-color 0.3s ease, color 0.3s ease;
        }

        /* ═══════════════════════════════════════════════════════════
           LANDING VIEW - Two-column layout
           ═══════════════════════════════════════════════════════════ */
        #landing-view {
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            background: var(--bg-primary);
            transition: opacity 0.5s ease, transform 0.5s ease;
        }

        #landing-view.fade-out {
            opacity: 0;
            transform: translateY(-20px);
            pointer-events: none;
        }

        #landing-view.hidden {
            display: none;
        }

        /* Landing Header/Nav Bar */
        .landing-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 1rem 2rem;
            background: var(--bg-card);
            border-bottom: 1px solid var(--border-color);
            position: sticky;
            top: 0;
            z-index: 100;
        }

        .landing-header-logo {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            font-size: 1.35rem;
            font-weight: 700;
            color: var(--text-primary);
        }

        .landing-header-logo .logo-icon {
            width: 40px;
            height: 40px;
            background: var(--gradient-1);
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 1.1rem;
        }

        .landing-header-logo span {
            color: var(--orange-600);
        }

        .landing-header-actions {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .landing-header-btn {
            width: 40px;
            height: 40px;
            border-radius: 10px;
            border: 1px solid var(--border-color);
            background: var(--bg-card);
            color: var(--text-secondary);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1rem;
            transition: all 0.2s ease;
        }

        .landing-header-btn:hover {
            background: var(--bg-secondary);
            color: var(--text-primary);
            border-color: var(--orange-400);
        }

        /* Landing Main Content */
        .landing-main {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 2rem;
        }

        .landing-content {
            max-width: 1100px;
            width: 100%;
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 2rem;
            align-items: stretch;
        }

        /* Step 1: Instructions Panel */
        .landing-step-panel {
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 16px;
            padding: 2rem;
            display: flex;
            flex-direction: column;
        }

        .step-panel-header {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            margin-bottom: 1.5rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid var(--border-color);
        }

        .step-badge {
            background: var(--gradient-1);
            color: white;
            font-size: 0.7rem;
            font-weight: 700;
            padding: 0.25rem 0.6rem;
            border-radius: 6px;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .step-panel-title {
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--text-primary);
        }

        .instructions-intro {
            color: var(--text-secondary);
            font-size: 0.9rem;
            margin-bottom: 1.5rem;
        }

        .instructions-list {
            list-style: none;
            padding: 0;
            margin: 0 0 1.5rem 0;
            flex: 1;
        }

        .instructions-list li {
            display: flex;
            align-items: flex-start;
            gap: 0.75rem;
            padding: 0.75rem 0;
            border-bottom: 1px solid var(--border-color);
            font-size: 0.9rem;
            color: var(--text-primary);
        }

        .instructions-list li:last-child {
            border-bottom: none;
        }

        .instruction-number {
            width: 24px;
            height: 24px;
            min-width: 24px;
            background: var(--orange-100);
            color: var(--orange-600);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.75rem;
            font-weight: 600;
        }

        [data-theme="dark"] .instruction-number {
            background: rgba(249, 115, 22, 0.15);
            color: var(--orange-400);
        }

        .instruction-text {
            flex: 1;
        }

        .instruction-text strong {
            color: var(--text-primary);
        }

        .instruction-text .instruction-detail {
            color: var(--text-muted);
            font-size: 0.8rem;
        }

        .screenshot-guide-btn {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.75rem 1rem;
            background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            color: var(--text-secondary);
            font-size: 0.85rem;
            cursor: pointer;
            transition: all 0.2s ease;
            margin-top: auto;
        }

        .screenshot-guide-btn:hover {
            border-color: var(--orange-400);
            color: var(--orange-600);
            background: var(--orange-50);
        }

        [data-theme="dark"] .screenshot-guide-btn:hover {
            background: rgba(249, 115, 22, 0.1);
        }

        .screenshot-guide-btn i {
            font-size: 0.9rem;
        }

        /* Step 2: Upload Panel */
        .landing-upload-panel {
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 16px;
            padding: 2rem;
            display: flex;
            flex-direction: column;
        }

        .privacy-shield {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.75rem;
            padding: 0.75rem 1rem;
            background: var(--accent-green-dim);
            border: 1px solid rgba(34, 197, 94, 0.3);
            border-radius: 10px;
            margin-bottom: 1.5rem;
        }

        .privacy-shield-icon {
            width: 36px;
            height: 36px;
            background: var(--accent-green);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 1rem;
        }

        .privacy-shield-text {
            font-size: 0.85rem;
            color: var(--accent-green-text);
        }

        [data-theme="dark"] .privacy-shield-text {
            color: var(--accent-green);
        }

        .landing-upload-zone {
            background: var(--bg-secondary);
            border: 2px dashed var(--border-color);
            border-radius: 12px;
            padding: 2rem 1.5rem;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s ease;
            margin-bottom: 1.5rem;
        }

        .landing-upload-zone:hover {
            border-color: var(--orange-400);
            background: var(--orange-50);
        }

        [data-theme="dark"] .landing-upload-zone:hover {
            background: rgba(249, 115, 22, 0.08);
        }

        .landing-upload-zone.drag-over {
            border-color: var(--orange-500);
            background: var(--orange-50);
            transform: scale(1.02);
        }

        [data-theme="dark"] .landing-upload-zone.drag-over {
            background: rgba(249, 115, 22, 0.12);
        }

        .landing-upload-icon {
            width: 64px;
            height: 64px;
            margin: 0 auto 1rem;
            background: var(--gradient-1);
            border-radius: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            color: white;
            animation: float 3s ease-in-out infinite;
        }

        @keyframes float {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-6px); }
        }

        .landing-upload-title {
            font-size: 1rem;
            font-weight: 600;
            margin-bottom: 0.25rem;
            color: var(--text-primary);
        }

        .landing-upload-desc {
            color: var(--text-muted);
            font-size: 0.8rem;
            margin-bottom: 1rem;
        }

        .browse-btn {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem 1rem;
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            font-size: 0.85rem;
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .browse-btn:hover {
            border-color: var(--orange-400);
            color: var(--orange-600);
        }

        .landing-file-list {
            margin-top: 1rem;
            text-align: left;
        }

        .landing-file-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.6rem 0.75rem;
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            margin-bottom: 0.5rem;
            font-size: 0.85rem;
        }

        .landing-file-item i {
            color: var(--orange-500);
        }

        /* Features Checklist */
        .features-checklist {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.5rem 1rem;
            margin-bottom: 1rem;
        }

        .feature-check {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.8rem;
            color: var(--text-secondary);
        }

        .feature-check i {
            color: var(--accent-green);
            font-size: 0.85rem;
        }

        /* Disclaimer in Upload Panel */
        .panel-disclaimer {
            background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 0.75rem 1rem;
            margin-bottom: 1rem;
        }

        .panel-disclaimer-header {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.75rem;
            font-weight: 600;
            color: var(--accent-yellow);
            margin-bottom: 0.35rem;
        }

        .panel-disclaimer-text {
            font-size: 0.7rem;
            color: var(--text-muted);
            line-height: 1.4;
            margin-bottom: 0.5rem;
        }

        .disclaimer-checkbox {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding-top: 0.5rem;
            border-top: 1px solid var(--border-color);
        }

        .disclaimer-checkbox input[type="checkbox"] {
            width: 16px;
            height: 16px;
            accent-color: var(--orange-500);
            cursor: pointer;
        }

        .disclaimer-checkbox label {
            font-size: 0.75rem;
            color: var(--text-secondary);
            cursor: pointer;
            user-select: none;
        }

        .disclaimer-checkbox label:hover {
            color: var(--text-primary);
        }

        .landing-analyze-btn {
            width: 100%;
            padding: 0.875rem 1.5rem;
            font-size: 0.95rem;
            font-weight: 600;
            background: var(--gradient-1);
            color: white;
            border: none;
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            margin-top: auto;
        }

        .landing-analyze-btn:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(234, 88, 12, 0.3);
        }

        .landing-analyze-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        /* Landing Footer */
        .landing-footer {
            padding: 1rem 2rem;
            border-top: 1px solid var(--border-color);
            background: var(--bg-card);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 2rem;
            font-size: 0.8rem;
            color: var(--text-muted);
        }

        .landing-footer a {
            color: var(--text-secondary);
            text-decoration: none;
            transition: color 0.2s ease;
        }

        .landing-footer a:hover {
            color: var(--orange-500);
        }

        .footer-divider {
            color: var(--border-color);
        }

        /* Screenshot Modal */
        .screenshot-modal {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.7);
            z-index: 1000;
            align-items: center;
            justify-content: center;
            padding: 2rem;
        }

        .screenshot-modal.visible {
            display: flex;
        }

        .screenshot-modal-content {
            background: var(--bg-card);
            border-radius: 16px;
            max-width: 700px;
            width: 100%;
            max-height: 90vh;
            overflow-y: auto;
            padding: 2rem;
            position: relative;
        }

        .screenshot-modal-close {
            position: absolute;
            top: 1rem;
            right: 1rem;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            border: 1px solid var(--border-color);
            background: var(--bg-card);
            color: var(--text-secondary);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1rem;
            transition: all 0.2s ease;
        }

        .screenshot-modal-close:hover {
            background: var(--accent-red-dim);
            border-color: var(--accent-red);
            color: var(--accent-red);
        }

        .screenshot-modal-title {
            font-size: 1.25rem;
            font-weight: 600;
            margin-bottom: 1.5rem;
            color: var(--text-primary);
        }

        .screenshot-step {
            display: flex;
            gap: 1rem;
            padding: 1rem 0;
            border-bottom: 1px solid var(--border-color);
        }

        .screenshot-step:last-child {
            border-bottom: none;
        }

        .screenshot-step-num {
            width: 32px;
            height: 32px;
            min-width: 32px;
            background: var(--gradient-1);
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.85rem;
            font-weight: 600;
        }

        .screenshot-step-content h4 {
            font-size: 0.95rem;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 0.25rem;
        }

        .screenshot-step-content p {
            font-size: 0.85rem;
            color: var(--text-muted);
            line-height: 1.5;
        }

        .screenshot-step-content code {
            background: var(--bg-secondary);
            padding: 0.15rem 0.4rem;
            border-radius: 4px;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.8rem;
            color: var(--orange-600);
        }

        /* Mobile Responsive */
        @media (max-width: 900px) {
            .landing-content {
                grid-template-columns: 1fr;
                gap: 1.5rem;
            }

            .landing-main {
                padding: 1.5rem;
            }

            .landing-header {
                padding: 0.75rem 1rem;
            }

            .landing-header-logo {
                font-size: 1.15rem;
            }

            .landing-header-logo .logo-icon {
                width: 36px;
                height: 36px;
                font-size: 1rem;
            }

            .landing-step-panel,
            .landing-upload-panel {
                padding: 1.5rem;
            }

            .features-checklist {
                grid-template-columns: 1fr;
            }

            .landing-footer {
                flex-direction: column;
                gap: 0.5rem;
                text-align: center;
            }

            .footer-divider {
                display: none;
            }
        }

        /* ═══════════════════════════════════════════════════════════
           APP VIEW - Post-upload dashboard with sidebar
           ═══════════════════════════════════════════════════════════ */
        #app-view {
            display: none;
            opacity: 0;
            transition: opacity 0.5s ease;
        }

        #app-view.visible {
            display: block;
            min-height: 100vh;
            opacity: 1;
        }

        /* Sidebar */
        .sidebar {
            position: fixed;
            left: 0;
            top: 0;
            bottom: 0;
            width: 260px;
            background: var(--bg-card);
            border-right: 1px solid var(--border-color);
            display: flex;
            flex-direction: column;
            z-index: 100;
            transition: transform 0.3s ease;
        }

        .sidebar-header {
            padding: 1.5rem;
            border-bottom: 1px solid var(--border-color);
        }

        .sidebar-logo {
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--text-primary);
        }

        .sidebar-logo span {
            color: var(--orange-600);
        }

        .sidebar-nav {
            flex: 1;
            overflow-y: auto;
            padding: 1rem 0;
        }

        .nav-section {
            padding: 0.5rem 1rem;
            margin-bottom: 0.5rem;
        }

        .nav-section-title {
            font-size: 0.7rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--text-muted);
            padding: 0.5rem 0.75rem;
        }

        .nav-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.75rem;
            margin: 0.125rem 0;
            border-radius: 8px;
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.15s ease;
            font-size: 0.9rem;
        }

        .nav-item:hover {
            background: var(--bg-secondary);
            color: var(--text-primary);
        }

        .nav-item.active {
            background: var(--orange-100);
            color: var(--orange-700);
        }

        [data-theme="dark"] .nav-item.active {
            background: rgba(249, 115, 22, 0.15);
            color: var(--orange-400);
        }

        .nav-item i {
            width: 20px;
            text-align: center;
            font-size: 0.95rem;
        }

        .sidebar-footer {
            padding: 1rem 1.5rem;
            border-top: 1px solid var(--border-color);
        }

        .sidebar-upload-btn {
            width: 100%;
            padding: 0.75rem;
            font-size: 0.85rem;
            font-weight: 500;
            background: var(--bg-secondary);
            color: var(--text-secondary);
            border: 1px dashed var(--border-color);
            border-radius: 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            transition: all 0.2s ease;
        }

        .sidebar-upload-btn:hover {
            border-color: var(--orange-400);
            color: var(--orange-600);
            background: var(--orange-50);
        }

        [data-theme="dark"] .sidebar-upload-btn:hover {
            background: rgba(249, 115, 22, 0.1);
        }

        /* Main Content Area */
        .main-content {
            margin-left: 260px;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            background: var(--bg-primary);
        }

        /* Top Bar */
        .top-bar {
            position: sticky;
            top: 0;
            z-index: 50;
            background: var(--bg-card);
            border-bottom: 1px solid var(--border-color);
            padding: 1rem 1.5rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 1rem;
        }

        .top-bar-left {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .mobile-menu-btn {
            display: none;
            width: 40px;
            height: 40px;
            border: 1px solid var(--border-color);
            border-radius: 8px;
            background: var(--bg-card);
            color: var(--text-primary);
            cursor: pointer;
            align-items: center;
            justify-content: center;
            font-size: 1.1rem;
        }

        .breadcrumb {
            font-size: 0.9rem;
            color: var(--text-secondary);
        }

        .breadcrumb-current {
            color: var(--text-primary);
            font-weight: 500;
        }

        .top-bar-right {
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .top-bar-btn {
            width: 40px;
            height: 40px;
            border-radius: 8px;
            border: 1px solid var(--border-color);
            background: var(--bg-card);
            color: var(--text-secondary);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.95rem;
            transition: all 0.2s ease;
        }

        .top-bar-btn:hover {
            background: var(--bg-secondary);
            color: var(--text-primary);
        }

        /* Content Panels */
        .content-area {
            flex: 1;
            padding: 1.5rem;
            overflow-y: auto;
            background: var(--bg-primary);
        }

        .view-panel {
            display: none;
            animation: fadeIn 0.3s ease;
        }

        .view-panel.active {
            display: block;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* Mobile Sidebar Overlay */
        .sidebar-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 99;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .sidebar-overlay.visible {
            display: block;
            opacity: 1;
        }

        /* ═══════════════════════════════════════════════════════════
           MOBILE RESPONSIVE - Sidebar becomes drawer
           ═══════════════════════════════════════════════════════════ */
        @media (max-width: 768px) {
            #app-view.visible {
                grid-template-columns: 1fr;
            }

            .sidebar {
                transform: translateX(-100%);
            }

            .sidebar.open {
                transform: translateX(0);
            }

            .main-content {
                margin-left: 0;
            }

            .mobile-menu-btn {
                display: flex;
            }

            .top-bar {
                padding: 0.75rem 1rem;
            }

            .content-area {
                padding: 1rem;
            }
        }

        /* Legacy container for backward compatibility */
        .app-container {
            max-width: 1400px;
            margin: 0 auto;
            padding: 2rem;
        }

        /* Theme Toggle Button */
        .theme-toggle {
            position: fixed;
            top: 1.5rem;
            right: 1.5rem;
            width: 44px;
            height: 44px;
            border-radius: 12px;
            border: 1px solid var(--border-color);
            background: var(--bg-card);
            color: var(--text-primary);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.1rem;
            box-shadow: var(--shadow-md);
            transition: all 0.2s ease;
            z-index: 1000;
        }

        .theme-toggle:hover {
            transform: scale(1.05);
            box-shadow: var(--shadow-lg);
        }

        .theme-toggle .fa-sun { display: none; }
        .theme-toggle .fa-moon { display: block; }
        
        [data-theme="dark"] .theme-toggle .fa-sun { display: block; }
        [data-theme="dark"] .theme-toggle .fa-moon { display: none; }

        .keyboard-shortcuts-btn {
            position: fixed;
            top: 1.5rem;
            right: 4.5rem;
            width: 44px;
            height: 44px;
            border-radius: 12px;
            border: 1px solid var(--border-color);
            background: var(--bg-card);
            color: var(--text-secondary);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1rem;
            box-shadow: var(--shadow-md);
            transition: all 0.2s ease;
            z-index: 1000;
        }

        .keyboard-shortcuts-btn:hover {
            transform: scale(1.05);
            box-shadow: var(--shadow-lg);
            color: var(--orange-500);
        }

        /* Header */
        .header {
            text-align: center;
            margin-bottom: 2rem;
            padding-bottom: 2rem;
            border-bottom: 1px solid var(--border-color);
            position: relative;
        }

        .header::before {
            content: '';
            position: absolute;
            top: -100px;
            left: 50%;
            transform: translateX(-50%);
            width: 600px;
            height: 600px;
            background: radial-gradient(circle, rgba(234, 88, 12, 0.08) 0%, transparent 70%);
            pointer-events: none;
        }

        [data-theme="dark"] .header::before {
            background: radial-gradient(circle, rgba(249, 115, 22, 0.12) 0%, transparent 70%);
        }

        .logo {
            font-size: 32px;
            font-weight: 700;
            letter-spacing: -0.5px;
            margin-bottom: 8px;
            color: var(--text-primary);
        }

        .logo span {
            color: var(--orange-600);
        }

        .subtitle {
            color: var(--text-muted);
            font-size: 16px;
        }

        /* Upload Section */
        .upload-section {
            background: var(--bg-card);
            border: 2px dashed var(--border-color);
            border-radius: 12px;
            padding: 2rem;
            text-align: center;
            margin-bottom: 2rem;
            transition: all 0.15s ease;
        }

        .upload-section:hover {
            border-color: var(--orange-400);
        }
        
        .upload-section.drag-over {
            border-color: var(--orange-500);
            background: var(--orange-50);
        }

        [data-theme="dark"] .upload-section.drag-over {
            background: rgba(249, 115, 22, 0.1);
        }

        .upload-icon {
            width: 56px;
            height: 56px;
            margin: 0 auto 1rem;
            background: var(--orange-100);
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            color: var(--orange-600);
        }

        [data-theme="dark"] .upload-icon {
            background: rgba(249, 115, 22, 0.15);
            color: var(--orange-400);
        }

        .upload-title {
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 8px;
        }

        .upload-desc {
            color: var(--text-muted);
            margin-bottom: 1rem;
            font-size: 14px;
            max-width: 500px;
            margin-left: auto;
            margin-right: auto;
        }

        .file-input { display: none; }

        .btn {
            border: none;
            padding: 10px 20px;
            font-size: 14px;
            font-weight: 600;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.15s ease;
            font-family: inherit;
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
        }

        .btn-primary {
            background: var(--orange-600);
            color: white;
        }

        .btn-primary:hover {
            background: var(--orange-500);
        }

        .btn-secondary {
            background: transparent;
            color: var(--text-secondary);
            border: 1px solid var(--border-color);
        }

        .btn-secondary:hover:not(:disabled) {
            border-color: var(--orange-400);
            color: var(--text-primary);
        }

        .btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        /* File List */
        .file-list {
            display: flex;
            flex-wrap: wrap;
            gap: 0.75rem;
            margin-top: 1rem;
            justify-content: center;
        }

        .file-chip {
            background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 0.5rem 0.75rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.85rem;
            animation: slideIn 0.3s ease;
        }

        @keyframes slideIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .file-chip i { color: var(--accent-green); }

        .file-chip .remove-file {
            width: 18px;
            height: 18px;
            background: var(--accent-red-dim);
            border: none;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--accent-red);
            font-size: 0.7rem;
            transition: all 0.2s ease;
        }

        .file-chip .remove-file:hover {
            background: var(--accent-red);
            color: white;
        }

        /* Analyze Section */
        .analyze-section {
            text-align: center;
            margin-bottom: 2rem;
        }

        /* Loading */
        .loading {
            display: none;
            text-align: center;
            padding: 4rem;
        }

        .loading.visible { display: block; }

        .spinner {
            width: 50px;
            height: 50px;
            border: 4px solid var(--border-color);
            border-top-color: var(--accent-green);
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 auto 1rem;
        }

        @keyframes spin { to { transform: rotate(360deg); } }

        /* Dashboard */
        .dashboard {
            display: none;
        }

        .dashboard.visible {
            display: block;
            animation: fadeIn 0.5s ease;
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        /* Tabs */
        .tabs {
            display: flex;
            gap: 8px;
            margin-bottom: 24px;
            flex-wrap: wrap;
            border-bottom: 1px solid var(--border-color);
            padding-bottom: 16px;
        }

        .tab {
            background: transparent;
            border: 1px solid var(--border-color);
            color: var(--text-secondary);
            padding: 8px 16px;
            border-radius: 8px;
            cursor: pointer;
            font-family: inherit;
            font-size: 13px;
            font-weight: 500;
            transition: all 0.15s ease;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .tab:hover {
            border-color: var(--orange-400);
            color: var(--text-primary);
        }

        .tab.active {
            background: var(--orange-600);
            border-color: var(--orange-600);
            color: white;
        }

        .tab-content { display: none; }
        .tab-content.active { display: block; }

        /* Cards */
        .card {
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 20px;
            transition: box-shadow 0.15s ease;
        }

        .card:hover {
            box-shadow: 0 4px 12px rgba(0,0,0,0.08);
        }

        [data-theme="dark"] .card:hover {
            box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        }

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

        .card-title {
            font-size: 11px;
            font-weight: 600;
            letter-spacing: 1px;
            text-transform: uppercase;
            color: var(--text-muted);
        }

        .card-icon {
            width: 36px;
            height: 36px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .card-value {
            font-size: 24px;
            font-weight: 700;
            font-family: 'JetBrains Mono', monospace;
            margin-bottom: 4px;
        }

        .card-change {
            font-size: 0.85rem;
            color: var(--text-secondary);
        }

        .positive { color: var(--accent-green); }
        .negative { color: var(--accent-red); }

        /* Grid */
        .grid { display: grid; gap: 1rem; }
        .grid-2 { grid-template-columns: repeat(2, 1fr); }
        .grid-3 { grid-template-columns: repeat(3, 1fr); }
        .grid-4 { grid-template-columns: repeat(4, 1fr); }
        .grid-6 { grid-template-columns: repeat(6, 1fr); }

        @media (max-width: 1200px) {
            .grid-4 { grid-template-columns: repeat(2, 1fr); }
            .grid-6 { grid-template-columns: repeat(3, 1fr); }
        }

        @media (max-width: 768px) {
            .grid-2, .grid-3, .grid-4, .grid-6 { grid-template-columns: 1fr; }
            .app-container { padding: 1rem; }
        }

        /* Section Headers */
        .section-header {
            display: flex;
            align-items: center;
            gap: 1rem;
            margin: 2rem 0 1rem;
        }

        .section-header h2 {
            font-size: 1.25rem;
            font-weight: 700;
            white-space: nowrap;
        }

        .section-header .line {
            flex: 1;
            height: 1px;
            background: var(--border-color);
        }

        /* Profile */
        .profile-card {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .profile-avatar {
            width: 60px;
            height: 60px;
            background: var(--gradient-1);
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            font-weight: 800;
        }

        .profile-info h2 {
            font-size: 1.25rem;
            font-weight: 700;
        }

        .profile-info p {
            color: var(--text-secondary);
            font-size: 0.85rem;
        }

        .profile-badge {
            background: var(--accent-green-dim);
            color: var(--accent-green);
            padding: 0.2rem 0.6rem;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: 600;
            display: inline-block;
            margin-top: 0.25rem;
        }

        /* Tables */
        .table-container {
            overflow-x: auto;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.85rem;
        }

        th {
            text-align: left;
            padding: 0.75rem;
            background: var(--bg-secondary);
            color: var(--text-secondary);
            font-weight: 600;
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            border-bottom: 1px solid var(--border-color);
            position: sticky;
            top: 0;
            z-index: 1;
        }

        td {
            padding: 0.75rem;
            border-bottom: 1px solid var(--border-color);
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.8rem;
        }

        tr:hover td { background: rgba(0, 0, 0, 0.02); }

        .symbol-cell {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .symbol-icon {
            width: 28px;
            height: 28px;
            background: var(--accent-blue-dim);
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.6rem;
            font-weight: 700;
            color: var(--accent-blue);
            overflow: hidden;
        }

        .symbol-icon img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        /* Fee Items */
        .fee-item {
            display: flex;
            justify-content: space-between;
            padding: 0.6rem 0;
            border-bottom: 1px solid var(--border-color);
        }

        .fee-item:last-child { border-bottom: none; }
        .fee-label { color: var(--text-secondary); }
        .fee-value { font-family: 'JetBrains Mono', monospace; font-weight: 600; }

        /* Comparison */
        .comparison-row {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 1rem;
            padding: 0.75rem 0;
            border-bottom: 1px solid var(--border-color);
            font-size: 0.85rem;
        }

        .comparison-row:last-child { border-bottom: none; }
        .comparison-label { color: var(--text-secondary); }
        .comparison-value { font-family: 'JetBrains Mono', monospace; text-align: right; }

        /* Risk Meter */
        .risk-meter {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            margin-top: 1rem;
            font-size: 0.8rem;
        }

        .risk-bar {
            flex: 1;
            height: 6px;
            background: var(--bg-secondary);
            border-radius: 3px;
            overflow: hidden;
        }

        .risk-fill {
            height: 100%;
            border-radius: 3px;
            transition: width 0.5s ease;
        }

        .risk-low { background: var(--accent-green); }
        .risk-medium { background: var(--accent-yellow); }
        .risk-high { background: var(--accent-red); }

        /* Date Range Buttons */
        .date-range-btn {
            padding: 0.5rem 1rem;
            border: 1px solid var(--border-color);
            background: var(--bg-secondary);
            color: var(--text-secondary);
            border-radius: 6px;
            cursor: pointer;
            font-size: 0.8rem;
            font-family: inherit;
            transition: all 0.2s ease;
        }

        .date-range-btn:hover {
            border-color: var(--orange-500);
            color: var(--orange-500);
        }

        .date-range-btn.active {
            background: var(--orange-500);
            border-color: var(--orange-500);
            color: white;
        }

        /* Dividend Calendar */
        .dividend-calendar {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 1rem;
        }

        @media (max-width: 768px) {
            .dividend-calendar {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        .calendar-month {
            background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 1rem;
            transition: all 0.2s ease;
        }

        .calendar-month:hover {
            border-color: var(--orange-500);
            transform: translateY(-2px);
        }

        .calendar-month.has-dividend {
            border-color: var(--accent-green);
            background: linear-gradient(135deg, rgba(34, 197, 94, 0.05) 0%, transparent 100%);
        }

        .calendar-month.current-month {
            border-color: var(--orange-500);
            box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.2);
        }

        .calendar-month-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0.75rem;
            padding-bottom: 0.5rem;
            border-bottom: 1px solid var(--border-color);
        }

        .calendar-month-name {
            font-weight: 600;
            color: var(--text-primary);
            font-size: 0.9rem;
        }

        .calendar-month-year {
            font-size: 0.75rem;
            color: var(--text-secondary);
        }

        .calendar-month-amount {
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--accent-green);
            margin-bottom: 0.5rem;
        }

        .calendar-month-amount.forecast {
            color: var(--orange-500);
            opacity: 0.8;
        }

        .calendar-month-stocks {
            display: flex;
            flex-wrap: wrap;
            gap: 0.25rem;
        }

        .calendar-stock-badge {
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 4px;
            padding: 0.15rem 0.4rem;
            font-size: 0.65rem;
            font-weight: 600;
            color: var(--text-secondary);
        }

        .calendar-stock-badge.forecast {
            border-style: dashed;
            opacity: 0.7;
        }

        .confidence-badge {
            display: inline-block;
            padding: 0.2rem 0.5rem;
            border-radius: 4px;
            font-size: 0.7rem;
            font-weight: 600;
        }

        .confidence-high {
            background: rgba(34, 197, 94, 0.15);
            color: #22c55e;
        }

        .confidence-medium {
            background: rgba(245, 158, 11, 0.15);
            color: #f59e0b;
        }

        .confidence-low {
            background: rgba(239, 68, 68, 0.15);
            color: #ef4444;
        }

        /* Zakah */
        .zakah-card {
            background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
            border-color: var(--accent-yellow);
        }

        .zakah-input {
            background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 0.6rem 0.75rem;
            color: var(--text-primary);
            font-family: inherit;
            font-size: 0.85rem;
            width: 180px;
        }

        .zakah-input:focus {
            outline: none;
            border-color: var(--accent-yellow);
        }

        /* Chart Container */
        .chart-container {
            height: 280px;
            position: relative;
        }

        /* Watchlist & Alerts */
        .input-group {
            display: flex;
            gap: 0.75rem;
            margin-bottom: 1rem;
        }

        .input-group input, .input-group select {
            background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 0.6rem 0.75rem;
            color: var(--text-primary);
            font-family: inherit;
            font-size: 0.85rem;
            flex: 1;
        }

        .input-group input:focus, .input-group select:focus {
            outline: none;
            border-color: var(--accent-blue);
        }

        /* Export Button */
        .export-btn {
            background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            color: var(--text-primary);
            padding: 0.5rem 1rem;
            border-radius: 8px;
            cursor: pointer;
            font-family: inherit;
            font-size: 0.8rem;
            font-weight: 500;
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
            transition: all 0.2s ease;
        }

        .export-btn:hover {
            background: var(--bg-card-hover);
            border-color: var(--accent-green);
        }

        .export-dropdown {
            position: relative;
        }

        .export-menu {
            position: absolute;
            top: 100%;
            right: 0;
            margin-top: 0.5rem;
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
            min-width: 200px;
            z-index: 1000;
            opacity: 0;
            visibility: hidden;
            transform: translateY(-10px);
            transition: all 0.2s ease;
        }

        .export-menu.show {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        .export-menu button {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            width: 100%;
            padding: 0.75rem 1rem;
            border: none;
            background: none;
            color: var(--text-primary);
            font-family: inherit;
            font-size: 0.85rem;
            cursor: pointer;
            text-align: left;
            transition: background 0.15s ease;
        }

        .export-menu button:first-child {
            border-radius: 12px 12px 0 0;
        }

        .export-menu button:last-child {
            border-radius: 0 0 12px 12px;
        }

        .export-menu button:hover {
            background: var(--bg-secondary);
        }

        .export-menu button i {
            width: 16px;
            color: var(--orange-500);
        }

        /* Scrollbar */
        ::-webkit-scrollbar { width: 6px; height: 6px; }
        ::-webkit-scrollbar-track { background: var(--bg-secondary); }
        ::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
        ::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

        /* Summary Grid */
        .summary-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        @media (max-width: 1024px) {
            .summary-grid { grid-template-columns: repeat(2, 1fr); }
        }

        @media (max-width: 640px) {
            .summary-grid { grid-template-columns: 1fr; }
        }

        /* Progress bars for fee breakdown */
        .progress-bar-container {
            margin-bottom: 0.75rem;
        }

        .progress-bar-label {
            display: flex;
            justify-content: space-between;
            margin-bottom: 0.3rem;
            font-size: 0.8rem;
        }

        .progress-bar {
            height: 6px;
            background: var(--bg-secondary);
            border-radius: 3px;
            overflow: hidden;
        }

        .progress-bar-fill {
            height: 100%;
            border-radius: 3px;
            transition: width 0.5s ease;
        }

        /* Empty State Styling */
        .empty-state {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 2rem;
            color: var(--text-muted);
            text-align: center;
            min-height: 150px;
        }

        .empty-state i {
            font-size: 2.5rem;
            margin-bottom: 1rem;
            opacity: 0.5;
        }

        .empty-state p {
            font-size: 0.9rem;
            margin: 0;
            max-width: 250px;
        }

        .empty-state-overlay {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: var(--bg-card);
            border-radius: 8px;
            z-index: 10;
        }

        .chart-wrapper {
            position: relative;
            height: 100%;
        }

        /* Attribution Toggle */
        .attribution-toggle {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 1rem;
        }

        .attribution-toggle-btn {
            padding: 0.5rem 1rem;
            border: 1px solid var(--border-color);
            background: var(--bg-secondary);
            color: var(--text-secondary);
            border-radius: 6px;
            cursor: pointer;
            font-size: 0.8rem;
            font-family: inherit;
            font-weight: 500;
            transition: all 0.2s ease;
        }

        .attribution-toggle-btn:hover {
            border-color: var(--orange-400);
            color: var(--text-primary);
        }

        .attribution-toggle-btn.active {
            background: var(--orange-600);
            border-color: var(--orange-600);
            color: white;
        }

        /* Attribution Summary Cards */
        .attribution-summary {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        @media (max-width: 1024px) {
            .attribution-summary { grid-template-columns: repeat(2, 1fr); }
        }

        @media (max-width: 640px) {
            .attribution-summary { grid-template-columns: 1fr; }
        }

        .attribution-card {
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 1rem;
            text-align: center;
        }

        .attribution-card-label {
            font-size: 0.7rem;
            font-weight: 600;
            letter-spacing: 0.5px;
            text-transform: uppercase;
            color: var(--text-muted);
            margin-bottom: 0.5rem;
        }

        .attribution-card-value {
            font-size: 1.1rem;
            font-weight: 700;
            font-family: 'JetBrains Mono', monospace;
        }

        .attribution-card-sub {
            font-size: 0.75rem;
            color: var(--text-secondary);
            margin-top: 0.25rem;
        }

        /* Monthly Returns Heatmap */
        .returns-heatmap {
            display: flex;
            flex-direction: column;
            gap: 0.25rem;
        }

        .heatmap-row {
            display: flex;
            align-items: center;
            gap: 0.25rem;
        }

        .heatmap-year {
            width: 50px;
            font-size: 0.75rem;
            font-weight: 600;
            color: var(--text-secondary);
            text-align: right;
            padding-right: 0.5rem;
        }

        .heatmap-cell {
            flex: 1;
            min-width: 32px;
            height: 32px;
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.65rem;
            font-weight: 600;
            font-family: 'JetBrains Mono', monospace;
            transition: transform 0.15s ease;
        }

        .heatmap-cell:hover {
            transform: scale(1.1);
            z-index: 1;
        }

        .heatmap-cell.positive {
            background: var(--accent-green);
            color: white;
        }

        .heatmap-cell.negative {
            background: var(--accent-red);
            color: white;
        }

        .heatmap-cell.neutral {
            background: var(--bg-secondary);
            color: var(--text-muted);
        }

        .heatmap-cell.empty {
            background: transparent;
            border: 1px dashed var(--border-color);
        }

        .heatmap-header {
            display: flex;
            gap: 0.25rem;
            margin-bottom: 0.5rem;
            padding-left: 50px;
        }

        .heatmap-header span {
            flex: 1;
            min-width: 32px;
            text-align: center;
            font-size: 0.7rem;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
        }

        /* Diversification Tab Styles */
        .diversification-summary {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        @media (max-width: 1024px) {
            .diversification-summary { grid-template-columns: repeat(2, 1fr); }
        }

        @media (max-width: 640px) {
            .diversification-summary { grid-template-columns: 1fr; }
        }

        .diversification-card {
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 1rem;
            display: flex;
            align-items: center;
            gap: 1rem;
            transition: all 0.2s ease;
        }

        .diversification-card:hover {
            border-color: var(--orange-400);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        .diversification-card-icon {
            width: 48px;
            height: 48px;
            border-radius: 12px;
            background: linear-gradient(135deg, var(--orange-500), var(--orange-600));
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 1.2rem;
            flex-shrink: 0;
        }

        .diversification-card-content {
            flex: 1;
        }

        .diversification-card-label {
            font-size: 0.7rem;
            font-weight: 600;
            letter-spacing: 0.5px;
            text-transform: uppercase;
            color: var(--text-muted);
            margin-bottom: 0.25rem;
        }

        .diversification-card-value {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--text-primary);
            font-family: 'JetBrains Mono', monospace;
        }

        .grid-3 {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 1.5rem;
        }

        @media (max-width: 1200px) {
            .grid-3 { grid-template-columns: repeat(2, 1fr); }
        }

        @media (max-width: 768px) {
            .grid-3 { grid-template-columns: 1fr; }
        }

        /* Treemap Styles */
        .treemap-container {
            display: flex;
            flex-wrap: wrap;
            width: 100%;
            min-height: 400px;
            border-radius: 8px;
            overflow: hidden;
            background: var(--bg-secondary);
        }

        .treemap-item {
            display: flex;
            align-items: center;
            justify-content: center;
            flex-direction: column;
            padding: 0.5rem;
            color: white;
            font-weight: 600;
            text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
            cursor: pointer;
            transition: all 0.2s ease;
            overflow: hidden;
            box-sizing: border-box;
            border: 1px solid rgba(255,255,255,0.1);
        }

        .treemap-item:hover {
            filter: brightness(1.1);
            z-index: 1;
            transform: scale(1.02);
        }

        .treemap-item-symbol {
            font-size: 0.9rem;
            font-weight: 700;
        }

        .treemap-item-value {
            font-size: 0.7rem;
            opacity: 0.9;
        }

        .treemap-item-pct {
            font-size: 0.65rem;
            opacity: 0.8;
        }

        /* Sector Colors */
        .sector-technology { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
        .sector-healthcare { background: linear-gradient(135deg, #10b981, #059669); }
        .sector-financial { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
        .sector-consumer-cyclical { background: linear-gradient(135deg, #f59e0b, #d97706); }
        .sector-consumer-defensive { background: linear-gradient(135deg, #84cc16, #65a30d); }
        .sector-industrials { background: linear-gradient(135deg, #6b7280, #4b5563); }
        .sector-energy { background: linear-gradient(135deg, #ef4444, #dc2626); }
        .sector-utilities { background: linear-gradient(135deg, #06b6d4, #0891b2); }
        .sector-real-estate { background: linear-gradient(135deg, #ec4899, #db2777); }
        .sector-communication { background: linear-gradient(135deg, #f97316, #ea580c); }
        .sector-materials { background: linear-gradient(135deg, #a3a3a3, #737373); }
        .sector-other { background: linear-gradient(135deg, #64748b, #475569); }

        /* Loading spinner for diversification */
        .div-loading {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 3rem;
            color: var(--text-secondary);
        }

        .div-loading .spinner {
            width: 40px;
            height: 40px;
            border: 3px solid var(--border-color);
            border-top-color: var(--orange-500);
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-bottom: 1rem;
        }

        /* Real-time Price Refresh Styles */
        .price-refresh-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 0.75rem 1rem;
            margin-bottom: 1rem;
            flex-wrap: wrap;
            gap: 0.75rem;
        }

        .price-refresh-info {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .price-refresh-label {
            font-weight: 600;
            color: var(--text-primary);
            font-size: 0.9rem;
        }

        .price-refresh-status {
            font-size: 0.8rem;
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            gap: 0.35rem;
        }

        .price-refresh-status.live {
            color: var(--accent-green);
        }

        .price-refresh-status.live i {
            animation: pulse 2s infinite;
        }

        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }

        .price-refresh-actions {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .last-updated {
            font-size: 0.75rem;
            color: var(--text-muted);
        }

        .btn-sm {
            padding: 0.4rem 0.75rem;
            font-size: 0.8rem;
        }

        /* Price change indicators */
        .price-cell {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
        }

        .price-current {
            font-family: 'JetBrains Mono', monospace;
            font-weight: 600;
        }

        .price-statement {
            font-size: 0.7rem;
            color: var(--text-muted);
            text-decoration: line-through;
        }

        .day-change {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            font-family: 'JetBrains Mono', monospace;
        }

        .day-change-value {
            font-weight: 600;
        }

        .day-change-pct {
            font-size: 0.75rem;
        }

        /* Price update animation */
        @keyframes priceFlash {
            0% { background-color: transparent; }
            50% { background-color: rgba(234, 88, 12, 0.2); }
            100% { background-color: transparent; }
        }

        .price-updated {
            animation: priceFlash 0.5s ease;
        }

        /* Live indicator dot */
        .live-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--accent-green);
            display: inline-block;
            margin-right: 0.35rem;
            animation: pulse 2s infinite;
        }

        /* Benchmark Selector Styles */
        .benchmark-selector {
            display: flex;
            align-items: center;
            gap: 1rem;
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 0.75rem 1rem;
            margin-bottom: 1.5rem;
            flex-wrap: wrap;
        }

        .benchmark-selector-label {
            font-weight: 600;
            color: var(--text-primary);
            font-size: 0.85rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .benchmark-chips {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            flex: 1;
        }

        .benchmark-chip {
            display: flex;
            align-items: center;
            gap: 0.35rem;
            padding: 0.4rem 0.75rem;
            border: 1px solid var(--border-color);
            background: var(--bg-secondary);
            color: var(--text-secondary);
            border-radius: 20px;
            cursor: pointer;
            font-size: 0.8rem;
            font-family: inherit;
            font-weight: 500;
            transition: all 0.2s ease;
        }

        .benchmark-chip:hover {
            border-color: var(--orange-400);
            color: var(--text-primary);
        }

        .benchmark-chip.active {
            background: var(--orange-600);
            border-color: var(--orange-600);
            color: white;
        }

        .benchmark-chip.loading {
            opacity: 0.7;
            pointer-events: none;
        }

        .benchmark-chip-icon {
            font-size: 0.9rem;
        }

        /* Benchmark colors for charts */
        .benchmark-sp500 { color: #3b82f6; }
        .benchmark-nasdaq { color: #10b981; }
        .benchmark-dow { color: #f59e0b; }
        .benchmark-russell { color: #8b5cf6; }
        .benchmark-vix { color: #ef4444; }

        /* Enhanced Dividend Analytics Styles */
        .dividend-metrics-bar {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 1rem;
            margin-bottom: 1rem;
        }

        @media (max-width: 1024px) {
            .dividend-metrics-bar { grid-template-columns: repeat(2, 1fr); }
        }

        @media (max-width: 640px) {
            .dividend-metrics-bar { grid-template-columns: 1fr; }
        }

        .dividend-metric {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 1rem;
            transition: all 0.2s ease;
        }

        .dividend-metric:hover {
            border-color: var(--orange-400);
            transform: translateY(-2px);
        }

        .dividend-metric-icon {
            width: 40px;
            height: 40px;
            border-radius: 10px;
            background: linear-gradient(135deg, var(--orange-500), var(--orange-600));
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 1rem;
            flex-shrink: 0;
        }

        .dividend-metric-content {
            display: flex;
            flex-direction: column;
        }

        .dividend-metric-label {
            font-size: 0.7rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: var(--text-muted);
        }

        .dividend-metric-value {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--text-primary);
            font-family: 'JetBrains Mono', monospace;
        }

        /* Dividend Heatmap */
        .dividend-heatmap {
            display: grid;
            grid-template-columns: repeat(12, 1fr);
            gap: 4px;
            padding: 1rem;
        }

        .heatmap-cell {
            aspect-ratio: 1;
            border-radius: 6px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            font-size: 0.65rem;
            font-weight: 600;
            transition: all 0.2s ease;
            cursor: pointer;
            position: relative;
        }

        .heatmap-cell:hover {
            transform: scale(1.1);
            z-index: 1;
        }

        .heatmap-cell-month {
            font-size: 0.6rem;
            opacity: 0.8;
        }

        .heatmap-cell-value {
            font-size: 0.7rem;
            font-weight: 700;
        }

        .heatmap-level-0 { background: var(--bg-secondary); color: var(--text-muted); }
        .heatmap-level-1 { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
        .heatmap-level-2 { background: rgba(34, 197, 94, 0.4); color: #22c55e; }
        .heatmap-level-3 { background: rgba(34, 197, 94, 0.6); color: white; }
        .heatmap-level-4 { background: rgba(34, 197, 94, 0.8); color: white; }
        .heatmap-level-5 { background: #22c55e; color: white; }

        /* DRIP Calculator */
        .drip-calculator {
            padding: 0.5rem;
        }

        .drip-inputs {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        @media (max-width: 1024px) {
            .drip-inputs { grid-template-columns: repeat(2, 1fr); }
        }

        @media (max-width: 640px) {
            .drip-inputs { grid-template-columns: 1fr; }
        }

        .drip-input-group {
            display: flex;
            flex-direction: column;
            gap: 0.35rem;
            position: relative;
        }

        .drip-input-group label {
            font-size: 0.75rem;
            font-weight: 600;
            color: var(--text-secondary);
        }

        .drip-input-group input {
            padding: 0.6rem 0.75rem;
            border: 1px solid var(--border-color);
            border-radius: 8px;
            background: var(--bg-secondary);
            color: var(--text-primary);
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.9rem;
        }

        .drip-input-group input:focus {
            outline: none;
            border-color: var(--orange-500);
        }

        .drip-input-suffix {
            position: absolute;
            right: 10px;
            bottom: 10px;
            font-size: 0.75rem;
            color: var(--text-muted);
        }

        .drip-results {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 1rem;
        }

        @media (max-width: 1024px) {
            .drip-results { grid-template-columns: repeat(2, 1fr); }
        }

        .drip-result-card {
            background: var(--bg-secondary);
            border-radius: 12px;
            padding: 1rem;
            text-align: center;
            border: 1px solid var(--border-color);
        }

        .drip-result-label {
            font-size: 0.7rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: var(--text-muted);
            margin-bottom: 0.35rem;
        }

        .drip-result-value {
            font-size: 1.25rem;
            font-weight: 700;
            font-family: 'JetBrains Mono', monospace;
        }

        .drip-result-sub {
            font-size: 0.7rem;
            color: var(--text-secondary);
            margin-top: 0.25rem;
        }

        /* Portfolio Rebalancing Tool Styles */
        .rebalancing-container {
            margin-top: 1rem;
        }

        .rebalancing-mode-toggle {
            display: flex;
            align-items: center;
            gap: 1rem;
            margin-bottom: 1.5rem;
            flex-wrap: wrap;
        }

        .rebalancing-mode-btn {
            padding: 0.5rem 1rem;
            border: 2px solid var(--border-color);
            background: var(--bg-secondary);
            color: var(--text-secondary);
            border-radius: 8px;
            cursor: pointer;
            font-size: 0.85rem;
            font-weight: 600;
            transition: all 0.2s ease;
        }

        .rebalancing-mode-btn:hover {
            border-color: var(--orange-400);
            color: var(--text-primary);
        }

        .rebalancing-mode-btn.active {
            background: var(--orange-500);
            border-color: var(--orange-500);
            color: white;
        }

        .rebalancing-cash-input {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-left: auto;
        }

        .rebalancing-cash-input label {
            font-size: 0.85rem;
            color: var(--text-secondary);
            white-space: nowrap;
        }

        .rebalancing-cash-input input {
            width: 120px;
            padding: 0.5rem;
            border: 1px solid var(--border-color);
            border-radius: 6px;
            background: var(--bg-secondary);
            color: var(--text-primary);
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.85rem;
        }

        .rebalance-table {
            width: 100%;
            border-collapse: collapse;
        }

        .rebalance-table th {
            background: var(--bg-secondary);
            padding: 0.75rem;
            text-align: left;
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: var(--text-muted);
            border-bottom: 2px solid var(--border-color);
        }

        .rebalance-table td {
            padding: 0.75rem;
            border-bottom: 1px solid var(--border-color);
            font-size: 0.9rem;
        }

        .rebalance-table tbody tr:hover {
            background: var(--bg-secondary);
        }

        .rebalance-table input[type="number"] {
            width: 80px;
            padding: 0.4rem 0.5rem;
            border: 1px solid var(--border-color);
            border-radius: 6px;
            background: var(--bg-secondary);
            color: var(--text-primary);
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.85rem;
            text-align: right;
        }

        .rebalance-table input[type="number"]:focus {
            outline: none;
            border-color: var(--orange-500);
        }

        .rebalance-action {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.85rem;
            font-weight: 600;
        }

        .rebalance-action.buy {
            color: var(--green-500);
        }

        .rebalance-action.sell {
            color: var(--red-500);
        }

        .rebalance-action.hold {
            color: var(--text-muted);
        }

        .rebalance-total-row {
            background: var(--bg-secondary);
            font-weight: 600;
        }

        .rebalance-total-row td {
            border-bottom: none;
        }

        .target-warning {
            color: var(--orange-500) !important;
        }

        .rebalancing-summary {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        @media (max-width: 768px) {
            .rebalancing-summary { grid-template-columns: repeat(2, 1fr); }
            .rebalancing-mode-toggle { flex-direction: column; align-items: flex-start; }
            .rebalancing-cash-input { margin-left: 0; width: 100%; }
        }

        .rebalancing-summary-card {
            background: var(--bg-secondary);
            border-radius: 12px;
            padding: 1rem;
            text-align: center;
            border: 1px solid var(--border-color);
        }

        .rebalancing-summary-label {
            font-size: 0.7rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: var(--text-muted);
            margin-bottom: 0.35rem;
        }

        .rebalancing-summary-value {
            font-size: 1.25rem;
            font-weight: 700;
            font-family: 'JetBrains Mono', monospace;
        }

        .rebalancing-actions {
            display: flex;
            gap: 1rem;
            justify-content: flex-end;
            flex-wrap: wrap;
        }

        @media (max-width: 640px) {
            .rebalancing-actions { justify-content: center; }
            .rebalancing-actions button { flex: 1; min-width: 140px; }
        }

        /* Sortable & Filterable Tables Styles */
        .table-controls {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
            flex-wrap: wrap;
            gap: 0.75rem;
        }

        .table-filter {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .table-filter-input {
            padding: 0.5rem 0.75rem;
            padding-left: 2rem;
            border: 1px solid var(--border-color);
            border-radius: 8px;
            background: var(--bg-secondary);
            color: var(--text-primary);
            font-size: 0.85rem;
            min-width: 200px;
            transition: all 0.2s ease;
        }

        .table-filter-input:focus {
            outline: none;
            border-color: var(--orange-500);
            box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.1);
        }

        .table-filter-wrapper {
            position: relative;
        }

        .table-filter-wrapper i {
            position: absolute;
            left: 0.75rem;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-muted);
            font-size: 0.85rem;
        }

        .table-stats {
            font-size: 0.8rem;
            color: var(--text-secondary);
        }

        th.sortable {
            cursor: pointer;
            user-select: none;
            transition: background-color 0.2s ease;
            white-space: nowrap;
        }

        th.sortable:hover {
            background: var(--bg-hover);
        }

        th.sortable::after {
            content: '';
            display: inline-block;
            width: 0;
            height: 0;
            margin-left: 0.5rem;
            vertical-align: middle;
            border-left: 4px solid transparent;
            border-right: 4px solid transparent;
            border-bottom: 4px solid transparent;
            border-top: 4px solid transparent;
            opacity: 0.3;
        }

        th.sortable.sort-asc::after {
            border-bottom: 5px solid var(--orange-500);
            border-top: none;
            opacity: 1;
        }

        th.sortable.sort-desc::after {
            border-top: 5px solid var(--orange-500);
            border-bottom: none;
            opacity: 1;
        }

        th.sortable:not(.sort-asc):not(.sort-desc):hover::after {
            border-bottom: 4px solid var(--text-muted);
            opacity: 0.5;
        }

        .highlight-row {
            animation: highlightFade 1s ease-out;
        }

        @keyframes highlightFade {
            0% { background-color: rgba(234, 88, 12, 0.2); }
            100% { background-color: transparent; }
        }

        .no-results-row td {
            text-align: center;
            color: var(--text-secondary);
            padding: 2rem;
            font-style: italic;
        }

        /* Pagination Styles */
        .pagination-container {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1rem 1.5rem;
            background: var(--bg-card);
            border-top: 1px solid var(--border-color);
            flex-wrap: wrap;
            gap: 0.75rem;
        }

        .pagination-info {
            font-size: 0.85rem;
            color: var(--text-secondary);
            white-space: nowrap;
        }

        .pagination-controls {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .pagination-btn {
            padding: 0.4rem 0.75rem;
            border: 1px solid var(--border-color);
            border-radius: 6px;
            background: var(--bg-secondary);
            color: var(--text-primary);
            cursor: pointer;
            font-size: 0.8rem;
            transition: all 0.2s ease;
        }

        .pagination-btn:hover:not(:disabled) {
            background: var(--bg-hover);
            border-color: var(--orange-500);
        }

        .pagination-btn:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }

        .pagination-btn.active {
            background: var(--orange-500);
            border-color: var(--orange-500);
            color: white;
        }

        .page-size-select {
            padding: 0.4rem 0.5rem;
            border: 1px solid var(--border-color);
            border-radius: 6px;
            background: var(--bg-secondary);
            color: var(--text-primary);
            font-size: 0.8rem;
            cursor: pointer;
        }

        .page-size-select:focus {
            outline: none;
            border-color: var(--orange-500);
        }

        .pagination-pages {
            display: flex;
            gap: 0.25rem;
        }

        /* Print Styles */
        @media print {
            body {
                background: white !important;
                color: black !important;
                font-size: 12px;
            }
            
            .theme-toggle,
            .keyboard-shortcuts-btn,
            .upload-section,
            .analyze-section,
            .tabs,
            .export-dropdown,
            .price-refresh-bar,
            .rebalancing-container,
            .watchlist-section,
            .btn,
            button:not(.tab) {
                display: none !important;
            }
            
            .dashboard {
                display: block !important;
            }
            
            .tab-content {
                display: block !important;
                page-break-inside: avoid;
                margin-bottom: 2rem;
            }
            
            .card {
                background: white !important;
                border: 1px solid #ddd !important;
                box-shadow: none !important;
                break-inside: avoid;
            }
            
            .chart-container,
            canvas {
                max-height: 300px !important;
            }
            
            table {
                font-size: 10px;
            }
            
            .positive { color: #22c55e !important; }
            .negative { color: #ef4444 !important; }
            
            h2 { 
                font-size: 14px;
                color: #1e293b !important;
                border-bottom: 2px solid #ea580c;
                padding-bottom: 0.5rem;
            }
            
            @page {
                margin: 1cm;
            }
        }
