/* ===========================================================================
   TRADE HISTORY
   =========================================================================== */

/* ── Filter bar ─────────────────────────────────────────────────────────── */
.hist-filters {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 0 16px;
}

.hist-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.hist-chip {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-md);
    background: var(--elevated);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s ease;
}
.hist-chip:hover  { border-color: var(--accent); color: var(--accent-text); }
.hist-chip.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent-text);
    font-weight: 600;
}

/* ── Custom date row ────────────────────────────────────────────────────── */
.hist-custom {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 14px;
    background: var(--elevated);
    border: 1px solid var(--border-md);
    border-radius: var(--r-md);
}
.hist-custom label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-2);
}
.date-inp {
    padding: 6px 10px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border-md);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
}
.date-inp:focus { outline: none; border-color: var(--accent); }

/* ── Summary stats bar ──────────────────────────────────────────────────── */
.hist-summary {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 16px;
    padding: 14px 16px;
    background: var(--elevated);
    border: 1px solid var(--border-md);
    border-radius: var(--r-md);
}
.hsum-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.hsum-lbl {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}
.hsum-val {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

/* ── History table row colors ───────────────────────────────────────────── */
#hist_table tbody tr.hist-win  { background: rgba(16, 217, 138, 0.045); }
#hist_table tbody tr.hist-loss { background: rgba(241, 79, 79, 0.045);  }
#hist_table tbody tr.hist-win:hover  { background: rgba(16, 217, 138, 0.09); }
#hist_table tbody tr.hist-loss:hover { background: rgba(241, 79, 79, 0.09);  }

/* ── Ticket label ───────────────────────────────────────────────────────── */
.ticket-lbl {
    font-size: 12px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

/* ── Timestamp cells ────────────────────────────────────────────────────── */
.ts-cell {
    font-size: 12px;
    color: var(--text-2);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .hist-summary { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
    .hist-summary { grid-template-columns: repeat(2, 1fr); }
    .hist-chip    { font-size: 12px; padding: 5px 11px; }
}

/* ===========================================================================
   BIAS PANEL (Two-Pane Layout)
   =========================================================================== */

/* ===========================================================================
   BIAS LAYOUT - two-pane
   =========================================================================== */
.bias-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    height: 600px;
}

/* ── Bias Table Wrapper: horizontal scroll container ─────────────────────── */
.bias-tbl-wrap {
    flex: 1;
    overflow-x: auto;               /* ← horizontal scroll lives HERE        */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    position: relative;
}

/* ── Bias Table itself ───────────────────────────────────────────────────── */
#bias_table {
    width: 100%;
    border-collapse: separate;      /* required for sticky + borders          */
    border-spacing: 0;
    font-size: 12.5px;
    min-width: 640px;               /* force scroll on narrow screens         */
}

#bias_table th {
    background: var(--elevated);
    padding: 10px 14px;
    text-align: center;
    font-size: 9.5px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.9px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 5;
}

#bias_table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    text-align: center;
}

#bias_table tbody tr:last-child td { border-bottom: none; }

#bias_table tbody tr:hover td { background: rgba(124,110,248,0.04); }

/* ── Sticky ASSET column (first col) ────────────────────────────────────── */
#bias_table th:first-child,
#bias_table td:first-child {
    position: sticky;
    left: 0;
    z-index: 6;
    background: var(--surface);
    text-align: left;
    min-width: 100px;
    border-right: 1px solid var(--border);
}

#bias_table th:first-child {
    z-index: 7;
    background: var(--elevated);
}

/* Frosted shadow on the right edge of the sticky column */
#bias_table th:first-child::after,
#bias_table td:first-child::after {
    content: "";
    position: absolute;
    top: 0; bottom: 0;
    right: -12px; width: 12px;
    background: linear-gradient(to right, rgba(0,0,0,0.18) 0%, transparent 100%);
    pointer-events: none;
}

/* ── Mobile responsive ──────────────────────────────────────────────────── */


/* ── Left Sidebar (Watchlists) ────────────────────────────────────────────── */
/* ─── NEON FLOW DARK GLASS PANELS ─────────────────────────────────────────── */

.bias-glass-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background: var(--bg);
}

/* ===========================================================================
   FLOATING MINIMALIST LAYOUT
   =========================================================================== */

/* Command Center Dashboard */
.cmd-dashboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 24px 20px 10px;
}
.cmd-top-row {
    display: flex;
    gap: 12px;
    align-items: center;
    width: 100%;
    max-width: 600px;
}
.wl-dropdown-wrap {
    flex: 1;
    position: relative;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    height: 48px;
    display: flex;
    align-items: center;
}
.wl-dropdown-wrap:hover { background: rgba(255, 255, 255, 0.08); }
.wl-select {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    color: var(--text);
    padding: 0 40px 0 16px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    line-height: normal;
}
.wl-select option { background: #121216; color: var(--text); }
.wl-chevron {
    position: absolute;
    right: 14px;
    pointer-events: none;
    color: var(--text-2);
    width: 18px;
    height: 18px;
}

.cmd-search-wrap {
    position: relative;
    width: 100%;
    max-width: 600px;
}
.cmd-search-icon {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    width: 24px; height: 24px;
}
.cmd-search-input {
    width: 100%;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--border-md);
    border-radius: 40px;
    padding: 0 60px;
    height: 64px;
    font-size: 18px;
    color: var(--text);
    outline: none;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}
.cmd-search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 8px 30px var(--accent-glow);
    background: rgba(0,0,0,0.6);
}
.cmd-search-clear {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    background: none; border: none; color: var(--muted);
    cursor: pointer;
}
.cmd-search-clear i { width: 20px; height: 20px; }

/* Bias Dropdown (Search results) */
.bias-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border-hi);
    border-radius: var(--r-md);
    box-shadow: 0 16px 40px rgba(0,0,0,0.6);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
}
.bias-dd-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}
.bias-dd-item:last-child { border-bottom: none; }
.bias-dd-item:hover { background: var(--elevated-2); }
.bias-dd-sym {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
}
.bias-dd-hint {
    font-size: 12px;
    color: var(--accent);
    opacity: 0.8;
}
.bias-dd-empty {
    justify-content: center;
    color: var(--muted);
    font-style: italic;
}

/* Bias Chips (Active search mode symbols) */
.bias-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 24px;
    padding: 0 20px;
}
.bias-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(124, 110, 248, 0.1);
    border: 1px solid var(--accent);
    border-radius: 20px;
    color: var(--accent-text);
    font-size: 14px;
    font-weight: 600;
}
.bias-chip-x {
    background: none;
    border: none;
    color: inherit;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
    padding: 0;
}
.bias-chip-x:hover { opacity: 1; }

.cmd-wl-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    width: 100%;
    max-width: 800px;
}
.cmd-wl-list {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.cmd-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--elevated);
    border: 1px solid var(--border);
    border-radius: 30px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}
.cmd-pill:hover {
    color: var(--text);
    background: var(--elevated-2);
}
.cmd-pill.active {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.cmd-manage-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: 1px dashed var(--border-hi);
    border-radius: 30px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.cmd-manage-btn:hover {
    color: var(--text);
    border-color: var(--text);
    border-style: solid;
    background: rgba(255,255,255,0.05);
}
.cmd-manage-btn i { width: 16px; height: 16px; }

/* Manage Modal overrides */
.manage-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    max-height: 400px;
    overflow-y: auto;
}
.manage-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
}
.manage-item-name { font-weight: 700; font-size: 15px; }
.manage-item-actions { display: flex; gap: 8px; }
.manage-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--r-sm);
    transition: background 0.2s;
}
.manage-btn:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.manage-btn.danger:hover { color: var(--danger); }
.manage-btn i { width: 18px; height: 18px; }


/* The Container */
.glass-container {
    flex: 1;
    overflow: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.glass-empty {
    text-align: center;
    padding: 40px;
    color: var(--muted);
    font-size: 14px;
    background: var(--surface);
    border-radius: var(--r-md);
    border: 1px dashed var(--border-md);
}

/* ===========================================================================
   PREMIUM GLASS CARD LAYOUT (MARKET BIAS)
   =========================================================================== */
.bias-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    width: 100%;
}

.bias-card {
    position: relative;
    background: linear-gradient(145deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--r-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.4s ease;
    animation: fadeSlideUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
    cursor: grab;
}

.bias-card:active {
    cursor: grabbing;
}

.bias-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255,255,255,0.15);
    z-index: 10;
}

.bias-card.bull-glow:hover { box-shadow: 0 16px 40px rgba(16, 217, 138, 0.15); border-color: rgba(16, 217, 138, 0.3); }
.bias-card.bear-glow:hover { box-shadow: 0 16px 40px rgba(241, 79, 79, 0.15); border-color: rgba(241, 79, 79, 0.3); }
.bias-card.neut-glow:hover { box-shadow: 0 16px 40px rgba(243, 171, 38, 0.15); border-color: rgba(243, 171, 38, 0.3); }

.bias-card.dragging {
    opacity: 0.4;
    transform: scale(0.95);
}
.bias-card.drag-over {
    border: 2px dashed var(--accent);
}

.bias-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bc-sym-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bc-drag {
    color: var(--muted);
    width: 20px;
    height: 20px;
    opacity: 0.5;
    transition: opacity 0.2s;
}
.bias-card:hover .bc-drag { opacity: 1; }

.bc-sym {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--text);
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.bc-conf {
    display: flex;
    gap: 4px;
}
.bc-conf .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border-hi);
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}
.bc-conf.STRONG .dot { background: var(--profit); box-shadow: 0 0 8px var(--profit); }
.bc-conf.CAUTION .d1, .bc-conf.CAUTION .d2 { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.bc-conf.AVOID .d1 { background: var(--loss); box-shadow: 0 0 8px var(--loss); }

/* Current Session - Hero of the card */
.bc-curr-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(0,0,0,0.2);
    padding: 16px;
    border-radius: var(--r-md);
    border: 1px solid rgba(255,255,255,0.03);
}

.bc-curr-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bc-curr-lbl {
    font-size: 11px;
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.bc-curr-val-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bc-curr-arrow {
    width: 8px; height: 8px; border-radius: 50%;
}
.bc-curr-arrow.bull { background: var(--profit); box-shadow: 0 0 10px var(--profit); }
.bc-curr-arrow.bear { background: var(--loss); box-shadow: 0 0 10px var(--loss); }
.bc-curr-arrow.neut { background: var(--warn); box-shadow: 0 0 10px var(--warn); }

.bc-curr-text {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.bc-curr-text.bull { color: var(--profit); text-shadow: 0 0 8px rgba(16,217,138,0.3); }
.bc-curr-text.bear { color: var(--loss); text-shadow: 0 0 8px rgba(241,79,79,0.3); }
.bc-curr-text.neut { color: var(--warn); text-shadow: 0 0 8px rgba(243,171,38,0.3); }

.bc-curr-pct {
    font-family: "JetBrains Mono", monospace;
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
}

/* Progress bar */
.bc-bar-bg {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}
.bc-bar-fill {
    height: 100%;
    border-radius: 4px;
    width: 0%; /* Animates to target */
    transition: width 1s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
}
.bc-bar-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite linear;
}
.bc-bar-fill.bull { background: linear-gradient(90deg, #0ba066, var(--profit)); box-shadow: 0 0 10px var(--profit); }
.bc-bar-fill.bear { background: linear-gradient(90deg, #c03232, var(--loss)); box-shadow: 0 0 10px var(--loss); }
.bc-bar-fill.neut { background: linear-gradient(90deg, #c58416, var(--warn)); box-shadow: 0 0 10px var(--warn); }

/* Prev & Next Sessions */
.bc-mini-sessions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.bc-mini {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bc-mini-lbl {
    font-size: 10px;
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.bc-mini-val {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
}

.bc-mini-val.bull { color: var(--profit); }
.bc-mini-val.bear { color: var(--loss); }
.bc-mini-val.neut { color: var(--warn); }

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 200%; }
}

@keyframes pfill-shimmer {
    0%   { transform: translateX(-100%); opacity: 0; }
    20%  { opacity: 1; }
    80%  { opacity: 1; }
    100% { transform: translateX(300%); opacity: 0; }
}

@media (max-width: 900px) {
    .cmd-dashboard { padding: 8px 12px; gap: 12px; }
    .cmd-top-row { max-width: 100%; }
    
    .cmd-search-input { height: 44px; font-size: 14px; padding: 0 40px; border-radius: 22px; }
    .cmd-search-icon { left: 14px; width: 18px; height: 18px; }
    .cmd-search-clear { right: 14px; }
    .cmd-search-clear i { width: 16px; height: 16px; }
    
    .glass-container { padding: 10px; }
    
    .bias-card-grid { grid-template-columns: 1fr; gap: 12px; }
    
    .bias-card { padding: 16px; gap: 14px; border-radius: var(--r-md); }
    .bc-sym { font-size: 16px; }
    .bc-curr-section { padding: 12px; gap: 10px; }
    .bc-curr-text { font-size: 12px; }
    .bc-curr-pct { font-size: 14px; }
    .bc-mini-lbl { font-size: 9px; }
    .bc-mini-val { font-size: 11px; }

    .bias-dropdown { top: calc(100% + 4px); }
    .bias-dd-item { padding: 12px 16px; }
    .bias-dd-sym { font-size: 13px; }
    
    .bias-chip { font-size: 12px; padding: 6px 12px; }
    
    .cmd-pill { padding: 8px 14px; font-size: 12px; gap: 6px; }
    .cmd-manage-btn { padding: 8px 14px; font-size: 12px; gap: 6px; }
    
    .wl-modal-split {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 450px;
        gap: 16px;
    }
    .wl-pane { min-height: 200px; }
}
/* Custom Account Dropdown */
.account-selector-wrap {
    position: relative;
    z-index: 50;
}
.custom-account-dropdown {
    position: relative;
    width: 100%;
    user-select: none;
}
.account-selected {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.account-selected:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}
.custom-account-dropdown.open .account-selected {
    background: rgba(0, 200, 255, 0.08);
    border-color: var(--accent);
}
.account-selected-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.account-icon {
    width: 20px;
    height: 20px;
    color: var(--accent);
}
.acc-sel-text {
    display: flex;
    flex-direction: column;
}
.acc-sel-name {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
}
.acc-sel-id {
    font-size: 11px;
    color: var(--muted);
    font-family: monospace;
}
.account-chevron {
    width: 16px;
    height: 16px;
    color: var(--muted);
    transition: transform 0.2s ease;
}
.custom-account-dropdown.open .account-chevron {
    transform: rotate(180deg);
}
.account-options-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 250px;
    overflow-y: auto;
}
.custom-account-dropdown.open .account-options-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.account-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.account-option:hover {
    background: rgba(255,255,255,0.04);
}
.account-option.active {
    background: rgba(0, 200, 255, 0.08);
}
.account-option.active .acc-opt-name {
    color: var(--accent);
}
.account-option.active .acc-opt-icon {
    color: var(--accent);
}
.acc-opt-icon {
    width: 16px;
    height: 16px;
    color: var(--muted);
}
.acc-opt-details {
    display: flex;
    flex-direction: column;
}
.acc-opt-name {
    font-size: 12px;
    font-weight: 600;
    color: #e0e0e0;
}
.acc-opt-id {
    font-size: 11px;
    color: var(--muted);
    font-family: monospace;
}

/* Market Status Light */
.market-status-light {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-left: 15px;
    box-shadow: 0 0 8px currentColor;
}
.market-open {
    background-color: var(--profit);
    color: var(--profit);
    animation: breathe-open 2s infinite ease-in-out;
}
.market-closed {
    background-color: var(--loss);
    color: var(--loss);
    animation: breathe-closed 2s infinite ease-in-out;
}

@keyframes breathe-open {
    0% { opacity: 0.5; box-shadow: 0 0 4px var(--profit); }
    50% { opacity: 1; box-shadow: 0 0 12px var(--profit); }
    100% { opacity: 0.5; box-shadow: 0 0 4px var(--profit); }
}
@keyframes breathe-closed {
    0% { opacity: 0.5; box-shadow: 0 0 4px var(--loss); }
    50% { opacity: 1; box-shadow: 0 0 12px var(--loss); }
    100% { opacity: 0.5; box-shadow: 0 0 4px var(--loss); }
}

/* Market Closed Text */
.market-closed-text {
    font-size: 20px;
    font-weight: 800;
    color: var(--loss);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: block;
    text-align: center;
    animation: pulse-closed-text 1.5s infinite;
    padding: 15px 0;
}
@keyframes pulse-closed-text {
    0% { opacity: 0.6; }
    50% { opacity: 1; text-shadow: 0 0 8px rgba(241, 79, 79, 0.4); }
    100% { opacity: 0.6; }
}

/* --- Radar Pulse Micro-Animation --- */
.pulse-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--profit);
    border-radius: 50%;
    position: relative;
}
.pulse-dot::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: var(--profit);
    border-radius: 50%;
    z-index: -1;
    animation: radarPulse 1.5s ease-out infinite;
}
@keyframes radarPulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}


/* --- Disable Android Tap Highlight --- */
* {
    -webkit-tap-highlight-color: transparent !important;
}


/* --- Fix Cursor Bug --- */
* {
    caret-color: transparent !important;
}

input, textarea, [contenteditable="true"] {
    caret-color: auto !important;
}

/* ===========================================================================
   NEWS CALENDAR STYLES
   =========================================================================== */
.news-filters-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    background: rgba(0,0,0,0.2);
    padding: 16px 20px;
    border-radius: var(--r-md);
    border: 1px solid rgba(255,255,255,0.05);
}

.news-mobile-actions {
    display: none;
    gap: 10px;
    margin-bottom: 15px;
    width: 100%;
}
.mobile-filter-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    padding: 12px 8px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-2);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.mobile-filter-btn i {
    width: 20px;
    height: 20px;
    color: var(--accent);
    margin-bottom: 2px;
}

.mobile-filter-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.mobile-filter-btn:active {
    transform: scale(0.94);
    background: rgba(124, 110, 248, 0.1);
    border-color: rgba(124, 110, 248, 0.3);
    color: #fff;
}

@media (max-width: 768px) {
    .news-filters-wrapper {
        display: none !important;
    }
    .news-mobile-actions {
        display: flex;
    }
}

.news-filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.news-filter-lbl {
    font-size: 11px;
    font-weight: 700;
    color: var(--dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}
.chip-btn:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text);
}
.chip-btn.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent-text);
    box-shadow: 0 0 12px var(--accent-glow2);
}

/* Impact Chips */
.impact-chip .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    transition: all 0.2s;
    box-shadow: 0 0 4px currentColor;
}
.impact-chip.high.active { background: var(--loss-dim); border-color: var(--loss); color: var(--loss); box-shadow: 0 0 12px rgba(241,79,79,0.15); }
.impact-chip.med.active { background: var(--warn-dim); border-color: var(--warn); color: var(--warn); box-shadow: 0 0 12px rgba(245,158,11,0.15); }
.impact-chip.low.active { background: rgba(250, 204, 21, 0.1); border-color: #facc15; color: #facc15; box-shadow: 0 0 12px rgba(250,204,21,0.15); }
.impact-chip.none.active { background: rgba(255,255,255,0.1); border-color: var(--text); color: var(--text); }


/* Impact Colors */
.impact-high { color: var(--loss); }
.impact-med { color: var(--warn); }
.impact-low { color: #facc15; } /* Yellow */
.impact-none { color: var(--muted); }

.news-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.news-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.news-table th {
    background: rgba(255,255,255,0.02);
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border);
}

.news-table td {
    padding: 14px 16px;
    font-size: 13px;
    color: var(--text);
    border-bottom: 1px solid rgba(255,255,255,0.03);
    vertical-align: middle;
}

.news-table tr:hover td {
    background: rgba(255,255,255,0.02);
}

.news-time {
    font-weight: 600;
    color: var(--text-2);
}

.news-date {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 2px;
}

.news-currency {
    display: inline-block;
    padding: 4px 8px;
    background: rgba(255,255,255,0.05);
    border-radius: var(--r-sm);
    font-weight: 700;
    font-size: 11px;
}

.news-impact-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
}
.news-impact-badge.high { background: var(--loss-dim); border: 1px solid var(--loss); box-shadow: 0 0 10px rgba(241,79,79,0.2); }
.news-impact-badge.medium { background: var(--warn-dim); border: 1px solid var(--warn); box-shadow: 0 0 10px rgba(245,158,11,0.2); }
.news-impact-badge.low { background: rgba(250, 204, 21, 0.1); border: 1px solid #facc15; }
.news-impact-badge.none { background: rgba(255,255,255,0.05); border: 1px solid var(--border-md); }

.news-event {
    font-weight: 600;
    color: var(--text);
}

.news-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
}
.news-val.better { color: var(--profit); text-shadow: 0 0 8px rgba(16,217,138,0.3); }
.news-val.worse { color: var(--loss); text-shadow: 0 0 8px rgba(241,79,79,0.3); }

/* ── Impact badge as pill with label ──────────────────────────────────── */
.news-impact-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px 3px 6px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    width: auto;
    height: auto;
}
.news-impact-badge::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.news-impact-badge.high   { background: var(--loss-dim); border: 1px solid var(--loss); color: var(--loss); box-shadow: 0 0 10px rgba(241,79,79,0.2); }
.news-impact-badge.high::before { background: var(--loss); box-shadow: 0 0 6px var(--loss); }
.news-impact-badge.medium { background: var(--warn-dim); border: 1px solid var(--warn); color: var(--warn); box-shadow: 0 0 10px rgba(245,158,11,0.2); }
.news-impact-badge.medium::before { background: var(--warn); box-shadow: 0 0 6px var(--warn); }
.news-impact-badge.low    { background: rgba(250,204,21,0.1); border: 1px solid #facc15; color: #facc15; }
.news-impact-badge.low::before { background: #facc15; }
.news-impact-badge.none   { background: rgba(255,255,255,0.04); border: 1px solid var(--border-md); color: var(--muted); }
.news-impact-badge.none::before { background: var(--muted); }

/* ── News table row folder/info button ─────────────────────────────────── */
.news-info-btn {
    background: rgba(124, 110, 248, 0.08);
    border: 1px solid rgba(124, 110, 248, 0.25);
    border-radius: var(--r-sm);
    color: var(--accent-text);
    cursor: pointer;
    width: 32px; height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}
.news-info-btn:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 14px var(--accent-glow);
    transform: scale(1.12);
}
.news-info-btn svg { width: 15px; height: 15px; }

/* ── News table row animation ──────────────────────────────────────────── */
.news-table tbody tr {
    transition: background 0.2s;
}
.news-table tbody tr:hover td {
    background: rgba(124,110,248,0.04);
}
.news-table tr.day-header-row td {
    background: transparent !important;
    cursor: default !important;
}

/* ===========================================================================
   NEWS DETAIL MODAL / BOTTOM SHEET
   =========================================================================== */
.news-detail-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.news-detail-backdrop.open {
    opacity: 1;
    pointer-events: all;
}

.news-detail-panel {
    width: 420px;
    max-width: 100%;
    height: 100dvh;
    background: var(--surface);
    border-left: 1px solid var(--border-md);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -20px 0 60px rgba(0,0,0,0.5);
}
.news-detail-backdrop.open .news-detail-panel {
    transform: translateX(0);
}

.news-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 20px 16px;
    background: var(--elevated);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 5;
}
.news-detail-header-left {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.news-detail-impact-pill {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    flex-shrink: 0;
    margin-top: 3px;
}
.news-detail-impact-pill.high   { background: var(--loss-dim); border: 1px solid var(--loss); color: var(--loss); }
.news-detail-impact-pill.medium { background: var(--warn-dim); border: 1px solid var(--warn); color: var(--warn); }
.news-detail-impact-pill.low    { background: rgba(250,204,21,0.1); border: 1px solid #facc15; color: #facc15; }
.news-detail-impact-pill.none   { background: rgba(255,255,255,0.05); border: 1px solid var(--border-md); color: var(--muted); }

.news-detail-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}
.news-detail-subtitle {
    font-size: 12px;
    color: var(--muted);
    margin-top: 3px;
}

/* Stats Row */
.nd-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    margin: 0;
    border-bottom: 1px solid var(--border);
}
.nd-stat {
    background: var(--elevated);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.nd-stat-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--muted);
}
.nd-stat-val {
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.nd-stat-val.muted { color: var(--text-2); }
.nd-stat-val.profit { color: var(--profit); text-shadow: 0 0 10px rgba(16,217,138,0.3); }
.nd-stat-val.loss   { color: var(--loss); text-shadow: 0 0 10px rgba(241,79,79,0.3); }

/* Sections */
.nd-section {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.nd-section-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--muted);
    margin-bottom: 12px;
}

/* Effect grid */
.nd-effect-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.nd-effect-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--r-md);
    border: 1px solid;
}
.nd-effect-card.bullish {
    background: var(--profit-dim);
    border-color: rgba(16,217,138,0.3);
}
.nd-effect-card.bearish {
    background: var(--loss-dim);
    border-color: rgba(241,79,79,0.3);
}
.nd-effect-icon {
    font-size: 20px;
    flex-shrink: 0;
    line-height: 1;
}
.nd-effect-text strong {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 2px;
}
.nd-effect-card.bullish .nd-effect-text strong { color: var(--profit); }
.nd-effect-card.bearish .nd-effect-text strong { color: var(--loss); }
.nd-effect-text span {
    font-size: 12px;
    color: var(--text-2);
}

.nd-description {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.7;
}

.nd-footer {
    padding: 16px 20px;
    margin-top: auto;
    border-top: 1px solid var(--border);
}
.nd-ff-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--accent-dim);
    border: 1px solid var(--accent);
    border-radius: var(--r-md);
    color: var(--accent-text);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    width: 100%;
    justify-content: center;
}
.nd-ff-btn:hover {
    background: rgba(124,110,248,0.2);
    box-shadow: 0 0 20px var(--accent-glow);
}

/* ── Mobile: Bottom Sheet ────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .news-detail-backdrop {
        align-items: flex-end;
        justify-content: center;
    }
    .news-detail-panel {
        width: 100%;
        height: 88dvh;
        border-left: none;
        border-top: 1px solid var(--border-md);
        border-radius: var(--r-xl) var(--r-xl) 0 0;
        transform: translateY(100%);
        box-shadow: 0 -20px 60px rgba(0,0,0,0.5);
    }
    .news-detail-backdrop.open .news-detail-panel {
        transform: translateY(0);
    }
    /* Handle bar for mobile sheet */
    .news-detail-panel::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: var(--border-hi);
        border-radius: 4px;
        margin: 10px auto 0;
        flex-shrink: 0;
    }
    .nd-stats-row { grid-template-columns: repeat(2, 1fr); }
}

/* ===============================================================
   GLOBAL UI POLISH & PREMIUM ANIMATIONS
   =============================================================== */

/* ── Chip btn: spring on click ──────────────────────────────────── */
.chip-btn:active {
    transform: scale(0.92);
    transition-duration: 0.06s;
}

/* ── Ghost btn spring ───────────────────────────────────────────── */
.ghost-btn:active {
    transform: translateY(0) scale(0.96);
    transition-duration: 0.06s;
}

/* ── Icon btn pulse ─────────────────────────────────────────────── */
.icon-btn:active {
    transform: scale(0.9);
    transition-duration: 0.06s;
}

/* ── Status pill: subtle breathing for ACTIVE status ────────────── */
.s-pill.active {
    animation: statusBreathe 3s ease-in-out infinite;
}
@keyframes statusBreathe {
    0%, 100% { box-shadow: 0 0 0 0 transparent; }
    50%      { box-shadow: 0 0 8px rgba(16, 217, 138, 0.2); }
}

/* ── History chip: spring toggle ────────────────────────────────── */
.hist-chip {
    transition: all 0.2s var(--ease-out-back);
}
.hist-chip:active {
    transform: scale(0.92);
}
.hist-chip.active {
    box-shadow: 0 0 14px rgba(124,110,248,0.15);
}

/* ── Summary stats: counter reveal ──────────────────────────────── */
.hist-summary {
    animation: summaryReveal 0.5s var(--ease-out-expo) both;
}
@keyframes summaryReveal {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.hsum-card {
    animation: hcardPop 0.4s var(--ease-out-back) both;
}
.hsum-card:nth-child(1) { animation-delay: 0.05s; }
.hsum-card:nth-child(2) { animation-delay: 0.1s; }
.hsum-card:nth-child(3) { animation-delay: 0.15s; }
.hsum-card:nth-child(4) { animation-delay: 0.2s; }
.hsum-card:nth-child(5) { animation-delay: 0.25s; }
.hsum-card:nth-child(6) { animation-delay: 0.3s; }
@keyframes hcardPop {
    from { opacity: 0; transform: translateY(8px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Impact badges: pulse for HIGH ──────────────────────────────── */
.news-impact-badge.high {
    animation: impactPulse 2.5s ease-in-out infinite;
}
@keyframes impactPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(241,79,79,0.15); }
    50%      { box-shadow: 0 0 18px rgba(241,79,79,0.35); }
}

/* ── News detail panel: smoother spring slide ───────────────────── */
.news-detail-panel {
    transition: transform 0.4s var(--ease-out-expo);
}

/* ── Empty state: floating animation ────────────────────────────── */
.empty-cell {
    animation: emptyFloat 3s ease-in-out infinite;
}
@keyframes emptyFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-4px); }
}

/* ── DD Section: entrance animation ─────────────────────────────── */
.dd-section {
    animation: ddSectionIn 0.4s var(--ease-out-expo) both;
}
.dd-section:nth-child(1) { animation-delay: 0.08s; }
.dd-section:nth-child(2) { animation-delay: 0.16s; }
.dd-section:nth-child(3) { animation-delay: 0.24s; }
@keyframes ddSectionIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Account card accent bar: gradient animation ────────────────── */
.acc-card-bar {
    position: relative;
    overflow: hidden;
}
.acc-card-bar::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    animation: barShimmer 3s ease-in-out infinite;
}
@keyframes barShimmer {
    0%   { left: -100%; }
    50%  { left: 200%; }
    100% { left: 200%; }
}

/* ── Floating ambient particles (CSS only) ──────────────────────── */
.app-shell::before,
.app-shell::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    animation: ambientFloat 20s ease-in-out infinite;
}
.app-shell::before {
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(124,110,248,0.06) 0%, transparent 70%);
    top: 20%; left: 5%;
    animation-delay: 0s;
}
.app-shell::after {
    width: 250px; height: 250px;
    background: radial-gradient(circle, rgba(34,211,238,0.04) 0%, transparent 70%);
    bottom: 15%; right: 8%;
    animation-delay: -10s;
}
@keyframes ambientFloat {
    0%, 100% { opacity: 0.4; transform: translate(0, 0) scale(1); }
    25%      { opacity: 0.7; transform: translate(30px, -20px) scale(1.1); }
    50%      { opacity: 0.5; transform: translate(-15px, 15px) scale(0.95); }
    75%      { opacity: 0.8; transform: translate(20px, 10px) scale(1.05); }
}

/* ── Focus-visible: keyboard accessibility ──────────────────────── */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--accent-dim);
}
input:focus-visible,
select:focus-visible {
    outline: none;
}

/* ── Badge pop with glow ────────────────────────────────────────── */
.badge {
    transition: box-shadow 0.3s, transform 0.2s var(--ease-out-back);
}
.badge:not(:empty) { 
    animation: badgePopGlow 0.4s var(--ease-out-back) both; 
}
@keyframes badgePopGlow {
    0%   { transform: scale(0.5); opacity: 0; box-shadow: 0 0 0 transparent; }
    60%  { transform: scale(1.15); opacity: 1; box-shadow: 0 0 12px rgba(124,110,248,0.3); }
    100% { transform: scale(1); opacity: 1; box-shadow: 0 0 8px rgba(124,110,248,0.15); }
}

/* ── Loading spinner: enhanced ──────────────────────────────────── */
.spinner {
    box-shadow: 0 0 12px rgba(124,110,248,0.2);
}

/* ── Spin animation for loading icons ───────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 0.8s linear infinite; display: inline-block; }

/* ── Close button spring ────────────────────────────────────────── */
.close-btn {
    transition: color 0.18s, background 0.18s, box-shadow 0.18s;
}
.close-btn:hover {
    color: var(--text);
    background: var(--elevated-2);
    box-shadow: 0 0 0 1px var(--border-md);
}
.close-btn:active {
    transform: scale(0.92);
    transition-duration: 0.06s;
}

/* ── Account balance badge: shimmer ─────────────────────────────── */
.acct-balance-badge {
    position: relative;
    overflow: hidden;
}
.acct-balance-badge::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(124,110,248,0.12), transparent);
    animation: balanceShimmer 4s ease-in-out infinite;
}
@keyframes balanceShimmer {
    0%   { left: -100%; }
    40%  { left: 200%; }
    100% { left: 200%; }
}

/* ── Table tbl-wrap hover glow ──────────────────────────────────── */
.tbl-wrap {
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
.tbl-wrap:hover {
    box-shadow: 0 4px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(124,110,248,0.05);
}

/* ── Sidebar account dropdown: spring ───────────────────────────── */
.account-options-panel {
    transition: all 0.25s var(--ease-out-back);
}
.custom-account-dropdown.open .account-options-panel {
    animation: dropdownSpring 0.3s var(--ease-out-back);
}
@keyframes dropdownSpring {
    0%   { opacity: 0; transform: translateY(-8px) scale(0.95); }
    60%  { opacity: 1; transform: translateY(2px) scale(1.01); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Account card status-specific hover glows ───────────────────── */
.acc-card[data-status="ACTIVE"]:hover     { box-shadow: 0 20px 48px rgba(16, 217, 138, 0.12); border-color: rgba(16, 217, 138, 0.25); }
.acc-card[data-status="NEAR_LIMIT"]:hover { box-shadow: 0 20px 48px rgba(243, 171, 38, 0.12); border-color: rgba(243, 171, 38, 0.25); }
.acc-card[data-status="BREACHED"]:hover   { box-shadow: 0 20px 48px rgba(241, 79, 79, 0.12); border-color: rgba(241, 79, 79, 0.25); }

/* ── Smooth page-level transitions ──────────────────────────────── */
.main-content {
    scroll-behavior: smooth;
}

/* ── Card body inner content: stagger ───────────────────────────── */
.acc-card-body {
    animation: cardBodyIn 0.4s 0.1s var(--ease-out-expo) both;
}
@keyframes cardBodyIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* =========================================
   ALERT CARDS (Glassmorphism)
========================================= */
.alert-card {
    background: rgba(18, 18, 28, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.alert-card:hover {
    transform: translateY(-4px);
    border-color: rgba(167, 139, 250, 0.3);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(167, 139, 250, 0.1);
}

/* Subtle glow effect behind card */
.alert-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.alert-card-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alert-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alert-symbol {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-symbol i {
    color: var(--accent);
    width: 18px;
    height: 18px;
}

.alert-target {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: rgba(0,0,0,0.3);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}

.alert-message {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
    background: rgba(0,0,0,0.15);
    padding: 10px;
    border-radius: 8px;
    border-left: 2px solid var(--accent);
}

.alert-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.alert-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 0;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.alert-btn-edit {
    background: rgba(167, 139, 250, 0.1);
    color: #a78bfa;
}

.alert-btn-edit:hover {
    background: rgba(167, 139, 250, 0.2);
}

.alert-btn-delete {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.alert-btn-delete:hover {
    background: rgba(239, 68, 68, 0.2);
}

/ *   C u s t o m   D r o p d o w n s   * / 
 
 . c u s t o m - s e l e c t - w r a p p e r   {   p o s i t i o n :   r e l a t i v e ;   w i d t h :   1 0 0 % ;   u s e r - s e l e c t :   n o n e ;   f o n t - f a m i l y :   i n h e r i t ;   f o n t - s i z e :   1 4 p x ;   } 
 
 . c u s t o m - s e l e c t - t r i g g e r   {   d i s p l a y :   f l e x ;   a l i g n - i t e m s :   c e n t e r ;   j u s t i f y - c o n t e n t :   s p a c e - b e t w e e n ;   p a d d i n g :   1 2 p x   1 4 p x ;   b a c k g r o u n d :   v a r ( - - b g ) ;   b o r d e r :   1 p x   s o l i d   v a r ( - - b o r d e r ) ;   b o r d e r - r a d i u s :   v a r ( - - r - s m ) ;   c o l o r :   v a r ( - - t e x t ) ;   c u r s o r :   p o i n t e r ;   t r a n s i t i o n :   a l l   0 . 2 s   e a s e ;   } 
 
 . c u s t o m - s e l e c t - t r i g g e r : h o v e r   {   b o r d e r - c o l o r :   v a r ( - - p r i m a r y ) ;   } 
 
 . c u s t o m - s e l e c t - w r a p p e r . o p e n   . c u s t o m - s e l e c t - t r i g g e r   {   b o r d e r - c o l o r :   v a r ( - - p r i m a r y ) ;   } 
 
 . c u s t o m - s e l e c t - w r a p p e r   . c h e v r o n - i c o n   {   d i s p l a y :   f l e x ;   a l i g n - i t e m s :   c e n t e r ;   t r a n s i t i o n :   t r a n s f o r m   0 . 2 s   e a s e ;   c o l o r :   v a r ( - - t e x t - m u t e d ) ;   } 
 
 . c u s t o m - s e l e c t - w r a p p e r . o p e n   . c h e v r o n - i c o n   {   t r a n s f o r m :   r o t a t e ( 1 8 0 d e g ) ;   } 
 
 . c u s t o m - s e l e c t - l i s t   {   p o s i t i o n :   a b s o l u t e ;   t o p :   1 0 0 % ;   l e f t :   0 ;   r i g h t :   0 ;   b a c k g r o u n d :   v a r ( - - e l e v a t e d - 2 ) ;   b o r d e r :   1 p x   s o l i d   v a r ( - - b o r d e r ) ;   b o r d e r - r a d i u s :   v a r ( - - r - s m ) ;   m a r g i n - t o p :   4 p x ;   z - i n d e x :   1 0 0 ;   m a x - h e i g h t :   2 5 0 p x ;   o v e r f l o w - y :   a u t o ;   d i s p l a y :   n o n e ;   p a d d i n g :   4 p x ;   b o x - s h a d o w :   0   4 p x   1 2 p x   r g b a ( 0 , 0 , 0 , 0 . 3 ) ;   l i s t - s t y l e :   n o n e ;   } 
 
 . c u s t o m - s e l e c t - w r a p p e r . o p e n   . c u s t o m - s e l e c t - l i s t   {   d i s p l a y :   b l o c k ;   a n i m a t i o n :   s l i d e D o w n   0 . 1 5 s   e a s e - o u t ;   } 
 
 . c u s t o m - s e l e c t - o p t i o n   {   p a d d i n g :   1 0 p x   1 2 p x ;   c u r s o r :   p o i n t e r ;   b o r d e r - r a d i u s :   4 p x ;   c o l o r :   v a r ( - - t e x t - m u t e d ) ;   t r a n s i t i o n :   b a c k g r o u n d   0 . 1 s   e a s e ,   c o l o r   0 . 1 s   e a s e ;   } 
 
 . c u s t o m - s e l e c t - o p t i o n : h o v e r   {   b a c k g r o u n d :   v a r ( - - h o v e r ) ;   c o l o r :   v a r ( - - t e x t ) ;   } 
 
 . c u s t o m - s e l e c t - o p t i o n . s e l e c t e d   {   b a c k g r o u n d :   v a r ( - - p r i m a r y - l i g h t ) ;   c o l o r :   v a r ( - - p r i m a r y ) ;   f o n t - w e i g h t :   5 0 0 ;   } 
 
 
/* Fix for Alert Dropdown being covered by keyboard on Mobile */
@media (max-width: 768px) {
    #alert_symbol_dropdown.custom-dropdown-list {
        position: static !important;
        margin-top: 8px !important;
        box-shadow: none !important;
        max-height: 180px !important;
        border: 1px solid var(--border-md) !important;
    }
}

/* Custom Select Replacement UI */
.cs-wrapper { position: relative; width: 100%; font-family: inherit; }
.cs-trigger { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 38px; padding: 0 12px; background: var(--elevated); border: 1px solid var(--border-md); border-radius: var(--r-sm); color: var(--text); font-size: 13px; font-weight: 500; cursor: pointer; user-select: none; transition: all 0.2s; }
.cs-trigger:hover, .cs-wrapper.open .cs-trigger { border-color: rgba(124,110,248,0.6); background: var(--elevated-2); }
.cs-wrapper.open .cs-trigger { box-shadow: 0 0 0 3px var(--accent-dim); }
.cs-trigger svg { width: 16px; height: 16px; color: var(--text-2); transition: transform 0.2s; }
.cs-wrapper.open .cs-trigger svg { transform: rotate(180deg); }
.cs-options { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #1a1a24; border: 1px solid var(--border-md); border-radius: var(--r-sm); max-height: 220px; overflow-y: auto; z-index: 999; box-shadow: 0 8px 24px rgba(0,0,0,0.6); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: all 0.2s; }
.cs-wrapper.open .cs-options { opacity: 1; visibility: visible; transform: translateY(0); }
.cs-option { padding: 10px 12px; font-size: 13px; color: var(--text-2); cursor: pointer; transition: background 0.15s, color 0.15s; }
.cs-option:hover { background: rgba(255,255,255,0.05); color: white; }
.cs-option.selected { background: rgba(124,110,248,0.15); color: var(--accent-text); font-weight: 600; }
@media (max-width: 768px) {
    .modal .cs-options { display: none !important; position: static !important; box-shadow: none !important; margin-top: 6px; transform: none; }
    .modal .cs-wrapper.open .cs-options { display: block !important; }
}

/* Fix z-index stacking for form cards when dropdown is open */
.form-card:has(.cs-wrapper.open), .form-card:focus-within, .form-card:hover {
    z-index: 50;
}
