        /* ═══════════════════════════════════════════ */
        /* CSS Variables - Light Mode (Default)       */
        /* ═══════════════════════════════════════════ */
        :root {
            --bg-page: #f0f2f5;
            --bg-card: #ffffff;
            --bg-card-hover: #f8faff;
            --bg-input: #fafafa;
            --bg-secondary: #f5f5f5;
            --text-primary: #1a1a2e;
            --text-secondary: #555;
            --text-muted: #888;
            --border: #e8e8ec;
            --border-subtle: #f0f0f5;
            --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
            --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
            --shadow-lg: 0 12px 28px rgba(0,0,0,0.1);
            --color-success: #16a34a;
            --color-danger: #dc2626;
            --color-warning: #f59e0b;
            --color-info: #38bdf8;
            --color-accent: #38bdf8;
            --color-gold: #FFB800;
        }

        /* ═══════════════════════════════════════════ */
        /* CSS Variables - Dark Mode Overrides         */
        /* ═══════════════════════════════════════════ */
        body.dark-mode {
            --bg-page: #0d0d14;
            --bg-card: #16162a;
            --bg-card-hover: #1e1e35;
            --bg-input: #1e1e30;
            --bg-secondary: #12121f;
            --text-primary: #e8e8f0;
            --text-secondary: #a0a0b0;
            --text-muted: #707080;
            --border: #2a2a3f;
            --border-subtle: #1e1e30;
            --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 12px 28px rgba(0,0,0,0.5);
            --color-success: #22c55e;
            --color-danger: #ef4444;
            --color-warning: #fbbf24;
        }

        body.dark-mode .sidebar {
            background: linear-gradient(180deg, #12121f 0%, #0a0a12 100%);
        }

        * { margin: 0; padding: 0; box-sizing: border-box; }
        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: var(--bg-page);
            color: var(--text-primary);
            transition: background-color 0.3s, color 0.3s;
        }

        /* Theme transition for key elements */
        .card, .stat-card, .header, .modal, .form-input, .form-select, td {
            transition: background-color 0.3s, color 0.3s, border-color 0.3s;
        }

        /* ═══════════════════════════════════════════ */
        /* Sidebar - Premium Dark Theme              */
        /* ═══════════════════════════════════════════ */
        .app-container { display: flex; height: 100vh; }
        .sidebar { width: 230px; background: linear-gradient(180deg, #1e1e2f 0%, #151521 100%); color: white; display: flex; flex-direction: column; box-shadow: 4px 0 24px rgba(0,0,0,0.4); z-index: 10; }
        .sidebar-header { padding: 24px 20px; border-bottom: 1px solid rgba(56, 189, 248, 0.15); }
        .logo { font-size: 22px; font-weight: 800; color: #ffffff; display: flex; align-items: center; gap: 4px; letter-spacing: -0.5px; }
        .logo-icon { font-size: 28px; filter: drop-shadow(0 2px 4px rgba(56, 189, 248, 0.4)); }
        .tagline { font-size: 10px; color: var(--color-accent); margin-top: 4px; letter-spacing: 0.8px; text-transform: uppercase; font-weight: 600; opacity: 0.8; }

        .nav-menu { flex: 1; padding: 12px 0; overflow-y: auto; }
        .nav-item {
            padding: 11px 20px; cursor: pointer; display: flex; align-items: center; gap: 12px;
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            color: rgba(255,255,255,0.55); margin: 2px 8px; position: relative; font-size: 14px;
            border-radius: 10px; border-left: 3px solid transparent;
        }
        .nav-item:hover { background: rgba(56, 189, 248, 0.08); color: rgba(255,255,255,0.9); border-left-color: rgba(56, 189, 248, 0.4); }
        .nav-item.active {
            background: linear-gradient(90deg, rgba(56, 189, 248, 0.15) 0%, rgba(56, 189, 248, 0.05) 100%);
            color: #38bdf8; font-weight: 600;
            border-left-color: #38bdf8;
            box-shadow: 0 0 20px rgba(56, 189, 248, 0.1);
        }
        .nav-item-icon { font-size: 18px; width: 22px; text-align: center; transition: transform 0.2s; }
        .nav-item:hover .nav-item-icon { transform: scale(1.15); }
        .nav-item-label { font-size: 14px; font-weight: 500; }

        .sidebar-footer { padding: 16px 12px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
        .help-button {
            width: 100%; padding: 12px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white; border: none; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 13px;
            display: flex; align-items: center; justify-content: center; gap: 8px;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 4px 16px rgba(102, 126, 234, 0.25);
        }
        .help-button:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4); }

        /* ═══════════════════════════════════════════ */
        /* Header - Clean Modern                      */
        /* ═══════════════════════════════════════════ */
        .main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--bg-page); }
        .header {
            background: var(--bg-card); padding: 16px 32px;
            box-shadow: var(--shadow-sm), var(--shadow-md);
            display: flex; justify-content: space-between; align-items: center;
            border-bottom: none;
            position: relative;
        }
        .header::after {
            content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
            background: linear-gradient(90deg, #38bdf8, #667eea, #764ba2, #f093fb);
            opacity: 0.8;
        }
        .header-title { font-size: 24px; font-weight: 700; color: var(--text-primary); }
        .header-actions { display: flex; gap: 12px; align-items: center; }

        /* ═══════════════════════════════════════════ */
        /* Status Badges                              */
        /* ═══════════════════════════════════════════ */
        .status-badge {
            padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
            display: flex; align-items: center; gap: 8px;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            border: 2px solid transparent;
            backdrop-filter: blur(4px);
        }
        .status-badge.paper { background: rgba(25, 118, 210, 0.08); color: #1976d2; border-color: rgba(25, 118, 210, 0.3); }
        .status-badge.live { background: rgba(46, 125, 50, 0.08); color: #2e7d32; border-color: rgba(46, 125, 50, 0.3); animation: livePulse 2.5s ease-in-out infinite; }
        .status-badge.connected { background: rgba(46, 125, 50, 0.08); color: #2e7d32; border-color: rgba(46, 125, 50, 0.3); }
        .status-badge.disconnected { background: rgba(198, 40, 40, 0.08); color: #c62828; border-color: rgba(198, 40, 40, 0.3); }
        .status-badge.scanning { background: rgba(245, 124, 0, 0.08); color: #f57c00; border-color: rgba(245, 124, 0, 0.3); }

        @keyframes livePulse {
            0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.2); }
            50% { opacity: 0.9; box-shadow: 0 0 0 6px rgba(46, 125, 50, 0); }
        }

        /* ═══════════════════════════════════════════ */
        /* Mode Toggle                                */
        /* ═══════════════════════════════════════════ */
        .mode-toggle-container { display: flex; align-items: center; gap: 10px; padding: 6px 14px; background: var(--bg-secondary); border-radius: 20px; }
        .mode-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
        .toggle-switch { position: relative; width: 60px; height: 28px; background: #1976d2; border-radius: 14px; cursor: pointer; transition: all 0.4s; }
        .toggle-switch.live { background: #2e7d32; }
        .toggle-slider { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; background: white; border-radius: 50%; transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); box-shadow: 0 2px 6px rgba(0,0,0,0.3); }
        .toggle-switch.live .toggle-slider { left: 33px; }

        /* ═══════════════════════════════════════════ */
        /* Buttons                                    */
        /* ═══════════════════════════════════════════ */
        .btn {
            padding: 10px 20px; border: none; border-radius: 10px; cursor: pointer;
            font-weight: 600; font-size: 14px; font-family: inherit;
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative; overflow: hidden;
        }
        .btn-primary { background: linear-gradient(135deg, #FFB800 0%, #ff9500 100%); color: #1a1a2e; box-shadow: 0 2px 8px rgba(255, 184, 0, 0.25); }
        .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255, 184, 0, 0.4); }
        .btn-primary:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(255, 184, 0, 0.3); }
        .btn-secondary { background: var(--bg-secondary); color: var(--text-secondary); border: 2px solid var(--border); }
        .btn-secondary:hover { background: var(--bg-card-hover); border-color: var(--text-muted); }
        .btn-danger { background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%); color: white; box-shadow: 0 2px 8px rgba(244, 67, 54, 0.25); }
        .btn-danger:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(244, 67, 54, 0.4); }
        .btn-danger:active { transform: translateY(0); }
        .btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
        .btn-scan { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; display: flex; align-items: center; gap: 8px; font-size: 15px; padding: 12px 24px; box-shadow: 0 4px 16px rgba(102, 126, 234, 0.25); }
        .btn-scan:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4); }

        /* ═══════════════════════════════════════════ */
        /* Content Area                               */
        /* ═══════════════════════════════════════════ */
        .content-area { flex: 1; overflow-y: auto; padding: 24px; background: var(--bg-page); scroll-behavior: smooth; }

        /* ═══════════════════════════════════════════ */
        /* Cards - Elevated with Depth                */
        /* ═══════════════════════════════════════════ */
        .card {
            background: var(--bg-card); border-radius: 14px; padding: 24px;
            box-shadow: var(--shadow-sm), var(--shadow-md);
            margin-bottom: 24px; border: 1px solid var(--border-subtle);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            animation: cardEnter 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
        }
        .card:hover { box-shadow: var(--shadow-md), var(--shadow-lg); transform: translateY(-1px); }
        .card-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; color: var(--text-primary); display: flex; align-items: center; gap: 10px; }
        .card-title-icon { font-size: 22px; }

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

        /* ═══════════════════════════════════════════ */
        /* Form Elements                              */
        /* ═══════════════════════════════════════════ */
        .form-group { margin-bottom: 20px; }
        .form-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; color: var(--text-secondary); }
        .form-input, .form-select, .form-textarea {
            width: 100%; padding: 10px 14px; border: 2px solid var(--border); border-radius: 10px;
            font-size: 14px; font-family: inherit;
            transition: border-color 0.25s, box-shadow 0.25s, background-color 0.3s, color 0.3s;
            background: var(--bg-input);
            color: var(--text-primary);
        }
        .form-input:focus, .form-select:focus, .form-textarea:focus {
            outline: none; border-color: var(--color-accent); background: var(--bg-card);
            box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.1);
        }
        .form-textarea { min-height: 100px; resize: vertical; }

        /* ═══════════════════════════════════════════ */
        /* Stats Grid                                 */
        /* ═══════════════════════════════════════════ */
        .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 24px; }
        .stat-card {
            background: var(--bg-card); border-radius: 14px; padding: 20px;
            box-shadow: var(--shadow-sm), var(--shadow-md);
            border: 1px solid var(--border-subtle);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative; overflow: hidden;
        }
        .stat-card::before {
            content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
            background: linear-gradient(90deg, #38bdf8, #667eea);
            opacity: 0; transition: opacity 0.3s;
        }
        .stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md), var(--shadow-lg); }
        .stat-card:hover::before { opacity: 1; }
        .stat-label { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
        .stat-value { font-size: 28px; font-weight: 800; color: var(--text-primary); line-height: 1; }
        .stat-value.positive { color: var(--color-success); }
        .stat-value.negative { color: var(--color-danger); }

        /* ═══════════════════════════════════════════ */
        /* Tables                                     */
        /* ═══════════════════════════════════════════ */
        table { width: 100%; border-collapse: collapse; }
        th {
            background: linear-gradient(135deg, #FFB800 0%, #ff9500 100%);
            padding: 14px 12px; text-align: left; font-weight: 700; font-size: 13px;
            color: #fff; border: none; text-transform: uppercase; letter-spacing: 0.5px;
        }
        th:first-child { border-top-left-radius: 10px; }
        th:last-child { border-top-right-radius: 10px; }
        td { padding: 12px; border-bottom: 1px solid var(--border-subtle); font-size: 14px; color: var(--text-primary); transition: all 0.2s; }
        tr { transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); }
        tr:hover { background: var(--bg-card-hover); }
        tr:last-child td { border-bottom: none; }

        .badge { padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
        .badge-success { background: rgba(22, 163, 74, 0.1); color: var(--color-success); border: 1px solid rgba(22, 163, 74, 0.2); }
        .badge-warning { background: rgba(245, 158, 11, 0.1); color: #d97706; border: 1px solid rgba(245, 158, 11, 0.2); }
        .badge-danger { background: rgba(220, 38, 38, 0.1); color: var(--color-danger); border: 1px solid rgba(220, 38, 38, 0.2); }

        /* ═══════════════════════════════════════════ */
        /* Scrollbar - Refined                        */
        /* ═══════════════════════════════════════════ */
        ::-webkit-scrollbar { width: 6px; height: 6px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 3px; }
        ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }
        .sidebar ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }
        .sidebar ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

        /* ═══════════════════════════════════════════ */
        /* Scanner Section                            */
        /* ═══════════════════════════════════════════ */
        .scanner-section { background: var(--bg-card); border: 2px solid rgba(56, 189, 248, 0.3); border-radius: 14px; padding: 24px; margin-bottom: 24px; box-shadow: 0 2px 12px rgba(56, 189, 248, 0.08); }
        .scanner-section h3 { color: var(--color-accent); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; font-size: 18px; }
        .scanner-input-group { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 16px; flex-wrap: wrap; }
        .scanner-input-group > div { flex: 1; min-width: 200px; }

        .example-prompts { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
        .example-prompt {
            padding: 8px 16px; background: rgba(56, 189, 248, 0.06); border: 2px solid rgba(56, 189, 248, 0.2);
            border-radius: 20px; cursor: pointer; font-size: 13px; color: var(--text-primary); font-weight: 600;
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .example-prompt:hover { background: linear-gradient(135deg, #38bdf8 0%, #667eea 100%); color: white; border-color: transparent; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3); }

        /* ═══════════════════════════════════════════ */
        /* Broker Cards                               */
        /* ═══════════════════════════════════════════ */
        .broker-account-card { background: var(--bg-card); border: 2px solid var(--border); border-radius: 14px; padding: 20px; margin-bottom: 16px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
        .broker-account-card:hover { border-color: var(--color-accent); box-shadow: 0 4px 20px rgba(56, 189, 248, 0.12); }
        .connection-indicator { width: 12px; height: 12px; border-radius: 50%; display: inline-block; margin-right: 8px; }
        .connection-indicator.connected { background: var(--color-success); box-shadow: 0 0 8px rgba(22, 163, 74, 0.4); }
        .connection-indicator.disconnected { background: var(--color-danger); }

        /* ═══════════════════════════════════════════ */
        /* Sliders & Checkboxes                       */
        /* ═══════════════════════════════════════════ */
        .allocation-slider { width: 100%; height: 8px; border-radius: 4px; outline: none; }
        .allocation-slider::-webkit-slider-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--color-accent); cursor: pointer; box-shadow: 0 2px 6px rgba(56, 189, 248, 0.4); }
        .allocation-display { font-size: 18px; font-weight: 700; color: var(--color-accent); }
        .checkbox-wrapper { display: flex; align-items: center; gap: 10px; padding: 12px; border: 2px solid var(--border); border-radius: 10px; margin-bottom: 10px; cursor: pointer; transition: all 0.2s; }
        .checkbox-wrapper:hover { border-color: var(--color-accent); background: rgba(56, 189, 248, 0.04); }

        /* ═══════════════════════════════════════════ */
        /* Animations                                 */
        /* ═══════════════════════════════════════════ */
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

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

        @keyframes shimmer {
            0% { background-position: -200% 0; }
            100% { background-position: 200% 0; }
        }

        @keyframes scaleIn {
            from { opacity: 0; transform: scale(0.95); }
            to { opacity: 1; transform: scale(1); }
        }

        .loading-spinner {
            border: 3px solid var(--border-subtle);
            border-top: 3px solid var(--color-accent);
            border-radius: 50%;
            width: 40px; height: 40px;
            animation: spin 0.8s linear infinite;
        }

        /* ═══════════════════════════════════════════ */
        /* Alert Box                                  */
        /* ═══════════════════════════════════════════ */
        .alert-box {
            padding: 16px 20px; border-radius: 12px; margin-bottom: 20px;
            display: flex; align-items: center; gap: 12px;
            font-size: 14px; font-weight: 600;
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
            animation: cardEnter 0.4s ease-out;
        }
        .alert-info { background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%); color: white; }
        .alert-success { background: linear-gradient(135deg, #16a34a 0%, #15803d 100%); color: white; }
        .alert-warning { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: white; }
        .alert-danger { background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%); color: white; }

        /* ═══════════════════════════════════════════ */
        /* Tooltip                                    */
        /* ═══════════════════════════════════════════ */
        .tooltip { position: relative; display: inline-block; }
        .tooltip .tooltiptext {
            visibility: hidden; width: 200px; background-color: #1a1a2e; color: #fff;
            text-align: center; border-radius: 10px; padding: 8px 12px;
            position: absolute; z-index: 1; bottom: 125%; left: 50%; margin-left: -100px;
            opacity: 0; transition: opacity 0.3s, transform 0.3s; transform: translateY(4px);
            font-size: 12px; box-shadow: var(--shadow-lg);
        }
        .tooltip:hover .tooltiptext { visibility: visible; opacity: 1; transform: translateY(0); }

        /* ═══════════════════════════════════════════ */
        /* Modal - Glass Effect                       */
        /* ═══════════════════════════════════════════ */
        .modal-overlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
            display: flex; align-items: center; justify-content: center; z-index: 2000;
            animation: fadeIn 0.2s ease-out;
        }
        .modal {
            background: var(--bg-card); border-radius: 20px; padding: 32px;
            max-width: 500px; width: 90%;
            box-shadow: 0 24px 64px rgba(0,0,0,0.2);
            animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .modal-title { font-size: 20px; font-weight: 700; margin-bottom: 16px; color: var(--text-primary); }
        .modal-content { margin-bottom: 20px; }
        .modal-actions { display: flex; gap: 12px; justify-content: flex-end; }

        /* ═══════════════════════════════════════════ */
        /* Responsive                                 */
        /* ═══════════════════════════════════════════ */
        @media (max-width: 768px) {
            .sidebar { width: 70px; }
            .nav-item-label { display: none; }
            .logo { font-size: 16px; }
            .tagline { display: none; }
            .header { padding: 12px 16px; }
            .content-area { padding: 16px; }
            .stats-grid { grid-template-columns: 1fr; }
            .nav-item { margin: 2px 4px; padding: 11px 12px; justify-content: center; }
        }

        /* ═══════════════════════════════════════════ */
        /* Wave / Glow / Blink Animations             */
        /* ═══════════════════════════════════════════ */
        @keyframes waveMove { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
        @keyframes glow { 0%, 100% { box-shadow: 0 0 5px #16a34a; } 50% { box-shadow: 0 0 20px #16a34a, 0 0 30px #16a34a; } }
        @keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
        @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.8; } }

        /* ═══════════════════════════════════════════ */
        /* Pre-Market Intelligence                    */
        /* ═══════════════════════════════════════════ */
        .market-bias-banner { padding: 24px; border-radius: 14px; text-align: center; margin-bottom: 24px; animation: cardEnter 0.5s ease-out; }
        .market-bias-banner.bullish { background: linear-gradient(135deg, #16a34a 0%, #15803d 100%); color: white; }
        .market-bias-banner.bearish { background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%); color: white; }
        .market-bias-banner.neutral { background: linear-gradient(135deg, #64748b 0%, #475569 100%); color: white; }

        .conviction-bar { height: 8px; border-radius: 4px; background: var(--border-subtle); overflow: hidden; }
        .conviction-bar-fill { height: 100%; border-radius: 4px; transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
        .conviction-bar-fill.buy { background: linear-gradient(90deg, #16a34a, #22c55e); }
        .conviction-bar-fill.sell { background: linear-gradient(90deg, #dc2626, #ef4444); }

        .signal-card { display: flex; align-items: center; padding: 12px 16px; border-radius: 10px; margin-bottom: 8px; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); }
        .signal-card:hover { transform: translateX(6px); box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
        .signal-card.buy { border-left: 4px solid #16a34a; background: rgba(22, 163, 74, 0.04); }
        .signal-card.sell { border-left: 4px solid #dc2626; background: rgba(220, 38, 38, 0.04); }

        /* ═══════════════════════════════════════════ */
        /* Risk Dashboard                             */
        /* ═══════════════════════════════════════════ */
        .circuit-breaker-card { position: relative; overflow: hidden; }
        .circuit-breaker-card.triggered { border-color: var(--color-danger); animation: pulse-border 1.5s infinite; }
        @keyframes pulse-border { 0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.3); } 50% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); } }

        .limit-progress { height: 10px; border-radius: 5px; background: var(--border-subtle); overflow: hidden; margin-top: 8px; }
        .limit-progress-fill { height: 100%; border-radius: 5px; transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s; }
        .limit-progress-fill.safe { background: linear-gradient(90deg, #16a34a, #22c55e); }
        .limit-progress-fill.warning { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
        .limit-progress-fill.danger { background: linear-gradient(90deg, #dc2626, #ef4444); }

        .donut-chart { width: 200px; height: 200px; border-radius: 50%; position: relative; margin: 0 auto; }
        .donut-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; background: var(--bg-card); border-radius: 50%; width: 120px; height: 120px; display: flex; flex-direction: column; justify-content: center; box-shadow: var(--shadow-md); }

        .pnl-bars { display: flex; align-items: flex-end; gap: 2px; height: 100px; padding: 0 4px; }
        .pnl-bar { flex: 1; min-width: 4px; border-radius: 3px 3px 0 0; transition: height 0.4s cubic-bezier(0.16, 1, 0.3, 1); cursor: pointer; }
        .pnl-bar:hover { opacity: 0.8; }
        .pnl-bar.positive { background: #16a34a; }
        .pnl-bar.negative { background: #dc2626; }

        /* ═══════════════════════════════════════════ */
        /* Active Trading                             */
        /* ═══════════════════════════════════════════ */
        .trade-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
        .side-toggle { display: flex; gap: 0; border-radius: 10px; overflow: hidden; }
        .side-btn { flex: 1; padding: 12px; border: none; font-weight: 700; font-size: 16px; cursor: pointer; transition: all 0.25s; }
        .side-btn.buy { background: rgba(22, 163, 74, 0.08); color: #16a34a; }
        .side-btn.buy.active { background: #16a34a; color: white; box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3); }
        .side-btn.sell { background: rgba(220, 38, 38, 0.08); color: #dc2626; }
        .side-btn.sell.active { background: #dc2626; color: white; box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3); }

        .position-card { background: var(--bg-card); border-radius: 12px; padding: 16px; margin-bottom: 12px; border: 1px solid var(--border-subtle); display: grid; grid-template-columns: 1fr 1fr 1fr 1fr auto; gap: 12px; align-items: center; box-shadow: var(--shadow-sm); transition: all 0.2s; }
        .position-card:hover { box-shadow: var(--shadow-md); }
        .position-pnl.positive { color: #16a34a; font-weight: 700; }
        .position-pnl.negative { color: #dc2626; font-weight: 700; }

        .squareoff-warning { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: white; padding: 16px 24px; border-radius: 12px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; animation: pulse 2s infinite; }

        .position-progress { height: 6px; border-radius: 3px; background: linear-gradient(90deg, #dc2626 0%, #dc2626 30%, #FFB800 30%, #FFB800 50%, #16a34a 50%, #16a34a 100%); position: relative; margin-top: 8px; }
        .position-marker { position: absolute; top: -4px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-primary); border: 2px solid var(--bg-card); transform: translateX(-50%); box-shadow: 0 2px 4px rgba(0,0,0,0.2); }

        /* ═══════════════════════════════════════════ */
        /* System Health                              */
        /* ═══════════════════════════════════════════ */
        .health-banner { padding: 20px; border-radius: 14px; text-align: center; margin-bottom: 24px; animation: cardEnter 0.5s ease-out; }
        .health-banner.full { background: linear-gradient(135deg, #16a34a 0%, #15803d 100%); color: white; }
        .health-banner.degraded { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: white; }
        .health-banner.minimal { background: linear-gradient(135deg, #f97316 0%, #ea580c 100%); color: white; }
        .health-banner.safe_mode { background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%); color: white; }

        .status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 8px; }
        .status-dot.up { background: var(--color-success); box-shadow: 0 0 8px rgba(22, 163, 74, 0.5); }
        .status-dot.down { background: var(--color-danger); box-shadow: 0 0 8px rgba(220, 38, 38, 0.5); }
        .status-dot.degraded { background: var(--color-warning); box-shadow: 0 0 8px rgba(245, 158, 11, 0.5); }

        .alert-row { padding: 10px 16px; border-radius: 8px; margin-bottom: 6px; font-size: 13px; transition: all 0.2s; }
        .alert-row:hover { transform: translateX(4px); }
        .alert-row.critical { background: rgba(220, 38, 38, 0.06); border-left: 4px solid #dc2626; }
        .alert-row.warning { background: rgba(245, 158, 11, 0.06); border-left: 4px solid #f59e0b; }
        .alert-row.info { background: rgba(56, 189, 248, 0.06); border-left: 4px solid #38bdf8; }

        .metric-card { text-align: center; padding: 20px; }
        .metric-value { font-size: 28px; font-weight: 800; color: var(--text-primary); }
        .metric-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }
        .metric-trend { font-size: 13px; margin-top: 4px; }
        .metric-trend.up { color: var(--color-success); }
        .metric-trend.down { color: var(--color-danger); }

        /* ═══════════════════════════════════════════ */
        /* Shared Components                          */
        /* ═══════════════════════════════════════════ */
        .tab-bar { display: flex; gap: 0; background: var(--bg-page); border-radius: 12px; padding: 4px; margin-bottom: 20px; }
        .tab-item {
            flex: 1; padding: 10px 20px; text-align: center; border-radius: 10px;
            cursor: pointer; font-weight: 600; font-size: 14px; color: var(--text-muted);
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .tab-item:hover { color: var(--text-secondary); }
        .tab-item.active { background: var(--bg-card); color: var(--text-primary); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

        .section-header { font-size: 16px; font-weight: 700; color: var(--text-primary); padding-bottom: 12px; margin-bottom: 16px; border-bottom: 2px solid var(--border-subtle); display: flex; align-items: center; gap: 8px; }

        .two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

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

        .empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
        .empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
        .empty-state-text { font-size: 16px; }

        .nav-separator { padding: 12px 20px 6px; font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: rgba(255,255,255,0.3); font-weight: 700; }

        /* ═══════════════════════════════════════════ */
        /* Dark Mode Specific Overrides               */
        /* ═══════════════════════════════════════════ */
        body.dark-mode .header { background: var(--bg-card); }
        body.dark-mode .header::after { opacity: 0.6; }
        body.dark-mode .modal-overlay { background: rgba(0,0,0,0.7); }
        body.dark-mode .status-badge.paper { background: rgba(25, 118, 210, 0.15); }
        body.dark-mode .status-badge.connected { background: rgba(22, 163, 74, 0.15); }
        body.dark-mode tr:hover { background: var(--bg-card-hover); }
        body.dark-mode .badge-success { background: rgba(34, 197, 94, 0.15); color: #22c55e; border-color: rgba(34, 197, 94, 0.3); }
        body.dark-mode .badge-warning { background: rgba(251, 191, 36, 0.15); color: #fbbf24; border-color: rgba(251, 191, 36, 0.3); }
        body.dark-mode .badge-danger { background: rgba(239, 68, 68, 0.15); color: #ef4444; border-color: rgba(239, 68, 68, 0.3); }
        body.dark-mode ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }
        body.dark-mode ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
