/* =====================================================
   CRIMSON ELITE THEME — data-style="crimson"
   ===================================================== */

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

/* ─── Crimson Dark ─── */
[data-style="crimson"] {
    --primary:        #dc2626;
    --primary-hover:  #b91c1c;
    --primary-glow:   rgba(220, 38, 38, 0.35);
    --gold:           #f59e0b;
    --gold-muted:     rgba(245, 158, 11, 0.15);
    --gold-border:    rgba(245, 158, 11, 0.4);
    --success:        #22c55e;
    --danger:         #ef4444;
    --warning:        #f59e0b;
    --info:           #60a5fa;
    --inactive:       #64748b;
    --bg-gradient:    #111118;
    --bg-secondary:   #1a1a26;
    --text-color:     #f8fafc;
    --text-muted:     #94a3b8;
    --card-bg:        #1a1a26;
    --card-hover:     #222234;
    --backdrop-blur:  none;
    --glass-border:   1px solid rgba(245, 158, 11, 0.12);
    --glass-shadow:   0 4px 24px rgba(0, 0, 0, 0.5);
    --border-color:   rgba(255, 255, 255, 0.07);
    --header-bg:      #0d0d12;
    --table-header:   rgba(0, 0, 0, 0.4);
    --input-bg:       rgba(0, 0, 0, 0.3);
    --font-display:   'DM Serif Display', serif;
    --font-body:      'Outfit', sans-serif;
}

/* ─── Crimson Light ─── */
[data-style="crimson"][data-theme="light"] {
    --bg-gradient:    #faf7f2;
    --bg-secondary:   #f3ede6;
    --text-color:     #1a0a00;
    --text-muted:     #78350f;
    --card-bg:        #ffffff;
    --card-hover:     #fffbf5;
    --glass-border:   1px solid rgba(245, 158, 11, 0.25);
    --glass-shadow:   0 4px 24px rgba(120, 53, 15, 0.1);
    --border-color:   rgba(0, 0, 0, 0.08);
    --header-bg:      #1a0a00;
    --table-header:   rgba(0, 0, 0, 0.04);
    --input-bg:       rgba(0, 0, 0, 0.04);
}

[data-style="crimson"] * { font-family: var(--font-body); }

[data-style="crimson"] body {
    background: var(--bg-gradient);
    background-attachment: unset;
}

/* ─── Header ─── */
[data-style="crimson"] .header {
    background: var(--header-bg);
    backdrop-filter: none;
    border: none;
    border-bottom: 1px solid var(--gold-border);
    border-radius: 0;
    padding: 1.2rem 2rem;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
    margin-bottom: 2rem;
    margin-left: -2rem;
    margin-right: -2rem;
    width: calc(100% + 4rem);
}
[data-style="crimson"][data-theme="light"] .header {
    box-shadow: 0 2px 12px rgba(120, 53, 15, 0.15);
}
[data-style="crimson"] .logo {
    color: var(--gold);
    font-family: var(--font-display);
    font-size: 1.6rem;
    letter-spacing: 0.5px;
    text-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}
[data-style="crimson"][data-theme="light"] .logo { text-shadow: none; }
[data-style="crimson"] .logo i { color: var(--primary); }
[data-style="crimson"] .icon-btn,
[data-style="crimson"] #modeToggleBtn { color: #f8fafc; }
[data-style="crimson"] .icon-btn:hover { background: rgba(255,255,255,0.1); }
[data-style="crimson"] #modeToggleBtn { border-color: rgba(255,255,255,0.2); }
[data-style="crimson"] #modeToggleBtn:hover { background: rgba(255,255,255,0.08); }
[data-style="crimson"] body.backtest-mode #modeToggleBtn { border-color: var(--gold); color: var(--gold); }
[data-style="crimson"] body.backtest-mode #modeToggleBtn:hover { background: rgba(245,158,11,0.1); }

/* ─── Primary Button ─── */
[data-style="crimson"] .primary-btn {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 4px 14px var(--primary-glow);
    border-radius: 6px;
    font-family: var(--font-body);
    font-weight: 600;
}
[data-style="crimson"] .primary-btn:hover {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
    box-shadow: 0 6px 20px var(--primary-glow);
}

/* ─── Section titles ─── */
[data-style="crimson"] .section-title h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    letter-spacing: 0.3px;
}
[data-style="crimson"] .subtitle { color: var(--text-muted); font-size: 0.85rem; }

/* ─── Account Cards ─── */
[data-style="crimson"] .account-card {
    background: var(--card-bg);
    backdrop-filter: none;
    border: none;
    border-top: 3px solid var(--gold);
    border-radius: 12px;
    box-shadow: var(--glass-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
[data-style="crimson"] .account-card:hover {
    background: var(--card-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 32px rgba(0,0,0,0.45), 0 0 0 1px var(--gold-border);
}
[data-style="crimson"] .acc-name {
    color: var(--gold);
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
[data-style="crimson"] a.acc-name { color: var(--gold); text-decoration: none; }
[data-style="crimson"] a.acc-name:hover { text-decoration: underline; }
[data-style="crimson"] .acc-balance {
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--text-color);
    margin-top: 0.2rem;
    letter-spacing: -1px;
}
[data-style="crimson"] .acc-balance::after {
    content: '';
    display: block;
    height: 2px;
    width: 48px;
    background: linear-gradient(90deg, var(--gold), transparent);
    margin-top: 6px;
    margin-bottom: 4px;
    border-radius: 2px;
}
[data-style="crimson"] .stat-row { color: var(--text-muted); font-size: 0.85rem; }
[data-style="crimson"] .stat-val { color: var(--text-color); font-weight: 600; }
[data-style="crimson"] .edit-btn:hover { color: var(--gold); }

/* ─── Badges ─── */
[data-style="crimson"] .badge { border-radius: 4px; }
[data-style="crimson"] .badge.success { background: rgba(34,197,94,0.12); color:#4ade80; border:1px solid rgba(34,197,94,0.25); }
[data-style="crimson"] .badge.danger { background:rgba(239,68,68,0.12); color:#f87171; border:1px solid rgba(239,68,68,0.25); }
[data-style="crimson"] .badge.warning { background:rgba(245,158,11,0.12); color:var(--gold); border:1px solid var(--gold-border); }
[data-style="crimson"] .badge.info { background:rgba(96,165,250,0.12); color:#93c5fd; border:1px solid rgba(96,165,250,0.25); }
[data-style="crimson"] .badge.inactive { background:rgba(100,116,139,0.12); color:#94a3b8; border:1px solid rgba(100,116,139,0.2); }

/* ─── Warning/State Cards - Dark ─── */
[data-style="crimson"] .account-card.account-blown {
    background: #000 !important;
    border-top: 3px solid #dc2626 !important;
    border-left: none; border-right: none; border-bottom: none;
}
[data-style="crimson"] .account-card.account-blown .acc-name { color: var(--gold) !important; }
[data-style="crimson"] .account-card.account-blown .acc-balance,
[data-style="crimson"] .account-card.account-blown .stat-row span,
[data-style="crimson"] .account-card.account-blown .stat-val,
[data-style="crimson"] .account-card.account-blown .cr-balance,
[data-style="crimson"] .account-card.account-blown .cr-stat-val,
[data-style="crimson"] .account-card.account-blown .cr-progress-label span,
[data-style="crimson"] .account-card.account-blown .cr-pnl-row span { color: #fff !important; }
[data-style="crimson"] .account-card.account-blown .cr-stat-label,
[data-style="crimson"] .account-card.account-blown .cr-consec-row,
[data-style="crimson"] .account-card.account-blown .cr-consistency-wrap { color: rgba(255,255,255,0.7) !important; }

[data-style="crimson"] .account-card.account-danger {
    background: linear-gradient(135deg, #1a0000, #3b0000) !important;
    border-top: 3px solid #dc2626 !important;
    border-left: none; border-right: none; border-bottom: none;
    box-shadow: 0 10px 30px rgba(220,38,38,0.25);
}
[data-style="crimson"] .account-card.account-danger .acc-name { color: var(--gold) !important; }
[data-style="crimson"] .account-card.account-danger .acc-balance,
[data-style="crimson"] .account-card.account-danger .stat-row span,
[data-style="crimson"] .account-card.account-danger .stat-val,
[data-style="crimson"] .account-card.account-danger .cr-balance,
[data-style="crimson"] .account-card.account-danger .cr-stat-val,
[data-style="crimson"] .account-card.account-danger .cr-progress-label span,
[data-style="crimson"] .account-card.account-danger .cr-pnl-row span { color: #fca5a5 !important; }
[data-style="crimson"] .account-card.account-danger .cr-stat-label,
[data-style="crimson"] .account-card.account-danger .cr-consec-row,
[data-style="crimson"] .account-card.account-danger .cr-consistency-wrap { color: rgba(252,165,165,0.7) !important; }

[data-style="crimson"] .account-card.account-warning {
    background: linear-gradient(135deg, #1a1000, #3b2800) !important;
    border-top: 3px solid var(--gold) !important;
    border-left: none; border-right: none; border-bottom: none;
    box-shadow: 0 10px 30px rgba(245,158,11,0.15);
}
[data-style="crimson"] .account-card.account-warning .acc-name { color: var(--gold) !important; }
[data-style="crimson"] .account-card.account-warning .acc-balance,
[data-style="crimson"] .account-card.account-warning .stat-row span,
[data-style="crimson"] .account-card.account-warning .stat-val,
[data-style="crimson"] .account-card.account-warning .cr-balance,
[data-style="crimson"] .account-card.account-warning .cr-stat-val,
[data-style="crimson"] .account-card.account-warning .cr-progress-label span,
[data-style="crimson"] .account-card.account-warning .cr-pnl-row span { color: #fde68a !important; }
[data-style="crimson"] .account-card.account-warning .cr-stat-label,
[data-style="crimson"] .account-card.account-warning .cr-consec-row,
[data-style="crimson"] .account-card.account-warning .cr-consistency-wrap { color: rgba(253,230,138,0.7) !important; }
[data-style="crimson"] .account-card.account-warning .badge {
    background: rgba(0,0,0,0.3) !important;
    border: 1px solid rgba(245,158,11,0.3) !important;
    color: var(--gold) !important;
}

[data-style="crimson"] .account-card.target-hit {
    background: linear-gradient(135deg, #052e16, #14532d) !important;
    border-top: 3px solid #22c55e !important;
    border-left: none; border-right: none; border-bottom: none;
    box-shadow: 0 10px 30px rgba(34,197,94,0.15);
}
[data-style="crimson"] .account-card.target-hit .acc-name { color: #86efac !important; }
[data-style="crimson"] .account-card.target-hit .acc-balance,
[data-style="crimson"] .account-card.target-hit .cr-balance { color: #fff !important; }
[data-style="crimson"] .account-card.target-hit .stat-row span,
[data-style="crimson"] .account-card.target-hit .stat-val,
[data-style="crimson"] .account-card.target-hit .cr-stat-val,
[data-style="crimson"] .account-card.target-hit .cr-progress-label span,
[data-style="crimson"] .account-card.target-hit .cr-pnl-row span { color: #bbf7d0 !important; }
[data-style="crimson"] .account-card.target-hit .cr-stat-label,
[data-style="crimson"] .account-card.target-hit .cr-consec-row,
[data-style="crimson"] .account-card.target-hit .cr-consistency-wrap { color: rgba(187,247,208,0.7) !important; }

/* ─── Light State Cards ─── */
[data-style="crimson"][data-theme="light"] .account-card.account-blown { background: #1a0000 !important; }
[data-style="crimson"][data-theme="light"] .account-card.account-danger {
    background: linear-gradient(135deg, #fee2e2, #fecaca) !important;
    border-top-color: #dc2626 !important;
}
[data-style="crimson"][data-theme="light"] .account-card.account-danger .acc-name { color: #991b1b !important; }
[data-style="crimson"][data-theme="light"] .account-card.account-danger .acc-balance,
[data-style="crimson"][data-theme="light"] .account-card.account-danger .stat-row span,
[data-style="crimson"][data-theme="light"] .account-card.account-danger .stat-val,
[data-style="crimson"][data-theme="light"] .account-card.account-danger .cr-balance,
[data-style="crimson"][data-theme="light"] .account-card.account-danger .cr-stat-val,
[data-style="crimson"][data-theme="light"] .account-card.account-danger .cr-progress-label span,
[data-style="crimson"][data-theme="light"] .account-card.account-danger .cr-pnl-row span { color: #7f1d1d !important; }
[data-style="crimson"][data-theme="light"] .account-card.account-danger .cr-stat-label,
[data-style="crimson"][data-theme="light"] .account-card.account-danger .cr-consec-row,
[data-style="crimson"][data-theme="light"] .account-card.account-danger .cr-consistency-wrap { color: rgba(127,29,29,0.8) !important; }
[data-style="crimson"][data-theme="light"] .account-card.account-warning {
    background: linear-gradient(135deg, #fef3c7, #fde68a) !important;
    border-top-color: #d97706 !important;
}
[data-style="crimson"][data-theme="light"] .account-card.account-warning .acc-name { color: #92400e !important; }
[data-style="crimson"][data-theme="light"] .account-card.account-warning .acc-balance,
[data-style="crimson"][data-theme="light"] .account-card.account-warning .stat-row span,
[data-style="crimson"][data-theme="light"] .account-card.account-warning .stat-val,
[data-style="crimson"][data-theme="light"] .account-card.account-warning .cr-balance,
[data-style="crimson"][data-theme="light"] .account-card.account-warning .cr-stat-val,
[data-style="crimson"][data-theme="light"] .account-card.account-warning .cr-progress-label span,
[data-style="crimson"][data-theme="light"] .account-card.account-warning .cr-pnl-row span { color: #78350f !important; }
[data-style="crimson"][data-theme="light"] .account-card.account-warning .cr-stat-label,
[data-style="crimson"][data-theme="light"] .account-card.account-warning .cr-consec-row,
[data-style="crimson"][data-theme="light"] .account-card.account-warning .cr-consistency-wrap { color: rgba(120,53,15,0.8) !important; }
[data-style="crimson"][data-theme="light"] .account-card.target-hit {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0) !important;
    border-top-color: #16a34a !important;
}
[data-style="crimson"][data-theme="light"] .account-card.target-hit .acc-name { color: #14532d !important; }
[data-style="crimson"][data-theme="light"] .account-card.target-hit .acc-balance,
[data-style="crimson"][data-theme="light"] .account-card.target-hit .stat-row span,
[data-style="crimson"][data-theme="light"] .account-card.target-hit .stat-val,
[data-style="crimson"][data-theme="light"] .account-card.target-hit .cr-balance,
[data-style="crimson"][data-theme="light"] .account-card.target-hit .cr-stat-val,
[data-style="crimson"][data-theme="light"] .account-card.target-hit .cr-progress-label span,
[data-style="crimson"][data-theme="light"] .account-card.target-hit .cr-pnl-row span { color: #166534 !important; }
[data-style="crimson"][data-theme="light"] .account-card.target-hit .cr-stat-label,
[data-style="crimson"][data-theme="light"] .account-card.target-hit .cr-consec-row,
[data-style="crimson"][data-theme="light"] .account-card.target-hit .cr-consistency-wrap { color: rgba(22,101,52,0.8) !important; }

/* ─── Watermarks ─── */
[data-style="crimson"] .account-card.account-blown::after { color:rgba(220,38,38,0.18); border-color:rgba(220,38,38,0.18); }
[data-style="crimson"] .account-card.account-danger::after { color:rgba(220,38,38,0.12); border-color:rgba(220,38,38,0.12); }
[data-style="crimson"] .account-card.account-warning::after { color:rgba(245,158,11,0.15); border-color:rgba(245,158,11,0.15); }

/* ─── Ghost card ─── */
[data-style="crimson"] .account-card.ghost-card { border: 2px dashed var(--gold-border) !important; border-radius: 12px !important; }
[data-style="crimson"] .account-card.ghost-card:hover { border-color: var(--gold) !important; background: rgba(245,158,11,0.04) !important; }
[data-style="crimson"] .account-card.ghost-card:hover i,
[data-style="crimson"] .account-card.ghost-card:hover div { color: var(--gold) !important; }

/* ─── History card ─── */
[data-style="crimson"] .history-card {
    background: var(--card-bg);
    backdrop-filter: none;
    border: none;
    border-top: 3px solid var(--gold);
    border-radius: 12px;
    box-shadow: var(--glass-shadow);
}
[data-style="crimson"] .filters-bar { background: var(--table-header); border-bottom: 1px solid var(--border-color); }
[data-style="crimson"] .filter-input { background: var(--input-bg); border: 1px solid var(--border-color); color: var(--text-color); }
[data-style="crimson"] .filter-input:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(245,158,11,0.15); }
[data-style="crimson"] .history-table th {
    background: var(--table-header);
    color: var(--gold);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
[data-style="crimson"] .sortable-th:hover { background: rgba(245,158,11,0.08); color: var(--gold); }
[data-style="crimson"] .history-table tbody tr:hover td { background: rgba(245,158,11,0.04); }

/* ─── Modals ─── */
[data-style="crimson"] .modal-content {
    background: var(--card-bg);
    backdrop-filter: none;
    border: 1px solid var(--gold-border);
    border-top: 3px solid var(--gold);
    border-radius: 12px;
}
[data-style="crimson"] .modal-header h3 { font-family: var(--font-display); font-size: 1.3rem; }
[data-style="crimson"] .form-group input,
[data-style="crimson"] .form-group select { background: var(--input-bg); border-color: var(--border-color); color: var(--text-color); border-radius: 6px; }
[data-style="crimson"] .form-group input:focus,
[data-style="crimson"] .form-group select:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(245,158,11,0.15); }
[data-style="crimson"] .form-group label { color: var(--text-muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.4px; }
[data-style="crimson"] .close-btn:hover { color: var(--gold); }

/* ─── FAB ─── */
[data-style="crimson"] .fab-btn {
    background: linear-gradient(135deg, #dc2626, #991b1b);
    box-shadow: 0 4px 20px var(--primary-glow);
}
[data-style="crimson"] .fab-btn:hover {
    background: linear-gradient(135deg, #b91c1c, #7f1d1d);
    box-shadow: 0 8px 28px var(--primary-glow);
    transform: translateY(-5px) scale(1.05);
}

/* ─── Backtest mode ─── */
[data-style="crimson"] body.backtest-mode {
    background-image: radial-gradient(circle at top right, rgba(220,38,38,0.08), transparent 40%),
                      radial-gradient(circle at bottom left, rgba(245,158,11,0.05), transparent 40%);
}
[data-style="crimson"] body.backtest-mode .header { border-bottom: 1px solid rgba(220,38,38,0.5); }

/* ─── Tooltip ─── */
[data-style="crimson"] .glass-tooltip { background: var(--card-bg); border: 1px solid var(--gold-border); color: var(--text-color); }

/* ─── Scrollbar ─── */
[data-style="crimson"] ::-webkit-scrollbar { width: 6px; }
[data-style="crimson"] ::-webkit-scrollbar-track { background: transparent; }
[data-style="crimson"] ::-webkit-scrollbar-thumb { background: rgba(245,158,11,0.3); border-radius: 3px; }
[data-style="crimson"] ::-webkit-scrollbar-thumb:hover { background: rgba(245,158,11,0.6); }

/* ─── Theme Switcher Panel ─── */
.theme-switcher-wrapper {
    position: relative;
}

.theme-switcher-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}
.theme-switcher-btn:hover { background: rgba(0,0,0,0.05); }
[data-theme="dark"] .theme-switcher-btn:hover { background: rgba(255,255,255,0.1); }
[data-style="crimson"] .theme-switcher-btn { color: #f8fafc; }
[data-style="crimson"] .theme-switcher-btn:hover { background: rgba(255,255,255,0.1); }

.theme-picker-panel {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    background: var(--card-bg);
    border: var(--glass-border);
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
    z-index: 99999;
    gap: 8px;
    flex-direction: column;
    min-width: 210px;
    backdrop-filter: var(--backdrop-blur);
}
.theme-picker-panel.open { display: flex; }


.theme-picker-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
    padding: 0 4px;
    margin-bottom: 2px;
}
.theme-picker-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 6px;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s, background 0.2s;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    text-align: center;
}
.theme-option:hover { background: rgba(0,0,0,0.05); }
[data-theme="dark"] .theme-option:hover { background: rgba(255,255,255,0.07); }
.theme-option.active { border-color: var(--primary); color: var(--text-color); }
[data-style="crimson"] .theme-option.active { border-color: var(--gold); }

.theme-swatch {
    width: 48px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}
/* Classic Light */
.swatch-classic-light { background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%); }
/* Classic Dark */
.swatch-classic-dark { background: linear-gradient(135deg, #0f172a 0%, #1e1e24 100%); }
/* Crimson Dark */
.swatch-crimson-dark {
    background: #111118;
    border-top: 3px solid #f59e0b;
}
/* Crimson Light */
.swatch-crimson-light {
    background: #faf7f2;
    border-top: 3px solid #f59e0b;
}
[data-style="crimson"] .theme-picker-panel {
    background: var(--card-bg);
    border: 1px solid var(--gold-border);
}

/* =====================================================
   CRIMSON ELITE — Card Component Styles (.cr-*)
   ===================================================== */

/* ─── Layout overrides ─── */
[data-style="crimson"] .app-container {
    max-width: 1400px;
}

[data-style="crimson"] .accounts-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

@media (max-width: 1200px) {
    [data-style="crimson"] .accounts-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
    [data-style="crimson"] .accounts-grid { grid-template-columns: 1fr; }
}

/* ─── Card Top block ─── */
[data-style="crimson"] .cr-card-top {
    margin-bottom: 1rem;
}

/* ─── Card header row ─── */
[data-style="crimson"] .cr-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}

[data-style="crimson"] .cr-acc-label {
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gold);
}
[data-style="crimson"] .cr-acc-label a {
    color: var(--gold);
    text-decoration: none;
}
[data-style="crimson"] .cr-acc-label a:hover { text-decoration: underline; }

[data-style="crimson"] .cr-card-actions {
    display: flex;
    gap: 6px;
}

[data-style="crimson"] .cr-action-btn {
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.2);
    color: var(--gold);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
}
[data-style="crimson"] .cr-action-btn:hover {
    background: rgba(245,158,11,0.2);
    border-color: var(--gold);
}

/* ─── Balance + sparkline row ─── */
[data-style="crimson"] .cr-balance-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.5rem;
}

[data-style="crimson"] .cr-balance {
    font-family: var(--font-body);
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-color);
    letter-spacing: -1.5px;
    line-height: 1;
}

[data-style="crimson"] .cr-sparkline {
    flex-shrink: 0;
    opacity: 0.9;
}
[data-style="crimson"] .cr-sparkline svg {
    display: block;
}

/* ─── PnL summary row ─── */
[data-style="crimson"] .cr-pnl-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}
[data-style="crimson"] .cr-pnl-sep {
    color: var(--border-color);
    font-size: 1rem;
}
[data-style="crimson"] .cr-pnl-positive { color: #4ade80; }
[data-style="crimson"] .cr-pnl-negative { color: #f87171; }
[data-style="crimson"][data-theme="light"] .cr-pnl-positive { color: #16a34a; }
[data-style="crimson"][data-theme="light"] .cr-pnl-negative { color: #dc2626; }

/* ─── Progress bar ─── */
[data-style="crimson"] .cr-progress-wrap {
    margin-bottom: 1rem;
}
[data-style="crimson"] .cr-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 5px;
}
[data-style="crimson"] .cr-progress-track {
    height: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 2px;
    overflow: hidden;
}
[data-style="crimson"][data-theme="light"] .cr-progress-track {
    background: rgba(0,0,0,0.08);
}
[data-style="crimson"] .cr-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s ease;
}

/* ─── Stats 2-col grid ─── */
[data-style="crimson"] .cr-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-top: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
}
[data-style="crimson"] .cr-stat {
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border-color);
}
[data-style="crimson"] .cr-stat:nth-child(odd) {
    padding-right: 0.75rem;
    border-right: 1px solid var(--border-color);
}
[data-style="crimson"] .cr-stat:nth-child(even) {
    padding-left: 0.75rem;
}
[data-style="crimson"] .cr-stat-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 2px;
}
[data-style="crimson"] .cr-stat-val {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-color);
}
[data-style="crimson"] .cr-rem {
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--text-muted);
}

/* ─── Consecutive losses warning bar ─── */
[data-style="crimson"] .cr-consec-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #f87171;
    margin-bottom: 0.75rem;
}
[data-style="crimson"] .cr-stop-badge {
    margin-left: auto;
    background: #dc2626;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 2px 8px;
    border-radius: 4px;
}

/* ─── Consistency section (reuse existing but adapt) ─── */
[data-style="crimson"] .cr-consistency-wrap > div {
    border-top: 1px solid var(--border-color);
    font-size: 0.82rem;
}
[data-style="crimson"] .cr-consistency-wrap .stat-row {
    font-size: 0.82rem;
}

/* ─── Badges row ─── */
[data-style="crimson"] .cr-badges-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

/* ─── History Section / Table Redesign ─── */
[data-style="crimson"] .section-title h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
}

[data-style="crimson"] .history-table {
    font-size: 0.88rem;
}

[data-style="crimson"] .history-table th,
[data-style="crimson"] .history-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

[data-style="crimson"] .history-table th {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    background: var(--table-header);
    color: var(--gold);
}

[data-style="crimson"] .history-table tbody tr {
    transition: background 0.15s;
}
[data-style="crimson"] .history-table tbody tr:hover td {
    background: rgba(245,158,11,0.04);
}

[data-style="crimson"] .text-green { color: #4ade80; }
[data-style="crimson"] .text-red   { color: #f87171; }
[data-style="crimson"][data-theme="light"] .text-green { color: #16a34a; }
[data-style="crimson"][data-theme="light"] .text-red   { color: #dc2626; }

/* ─── Section title PnL pill ─── */
[data-style="crimson"] #tradeHistoryTitle span {
    font-family: var(--font-body) !important;
    border-radius: 6px !important;
}
