/* ===========================================================================
   EXECUTION + POSITIONS — Combined Panel Layout
   =========================================================================== */
.exec-positions-layout {
    display: grid;
    grid-template-columns: 390px 1fr;
    gap: 22px;
    align-items: start;
}

/* Left column: order form */
.order-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: sticky;
    top: 0;
}

/* Right column: positions/orders tables */
.positions-column {
    display: flex;
    flex-direction: column;
    gap: 22px;
    min-width: 0;
}

/* Account Balance Display */
.acct-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
    background: linear-gradient(135deg, var(--elevated) 0%, rgba(124,110,248,0.05) 100%);
    border: 1px solid var(--border-md);
    border-radius: var(--r-md);
    padding: 11px 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.acct-row-label {
    font-size: 10px;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.acct-balance-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--accent-dim);
    border: 1px solid rgba(124,110,248,0.25);
    border-radius: var(--r-sm);
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 800;
    color: var(--accent-text);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    font-family: 'JetBrains Mono', monospace;
    text-shadow: 0 0 14px rgba(124,110,248,0.4);
    margin-left: auto;
}


/* ===========================================================================
   FORM CARDS
   =========================================================================== */
.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: visible;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.25s ease;
    position: relative;
}
/* Gradient top-edge line */
.form-card::before {
    content: '';
    position: absolute;
    top: 0; left: 5%; right: 5%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(124,110,248,0.6), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.form-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--r-lg);
    background: radial-gradient(ellipse at 50% 0%, rgba(124,110,248,0.04) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.form-card:hover {
    border-color: rgba(124,110,248,0.25);
    box-shadow: 0 6px 32px rgba(0,0,0,0.38), 0 0 0 1px rgba(124,110,248,0.08);
    transform: translateY(-1px);
}
.form-card:hover::before { opacity: 1; }
.form-card:hover::after  { opacity: 1; }
.form-card:focus-within {
    border-color: rgba(124,110,248,0.4);
    box-shadow: 0 6px 36px rgba(0,0,0,0.38), 0 0 22px rgba(124,110,248,0.1), 0 0 0 1px rgba(124,110,248,0.18);
}
.form-card:focus-within::before { opacity: 1; }


.form-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    font-size: 10px;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1.1px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, var(--elevated) 0%, rgba(124,110,248,0.04) 100%);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.form-card-head i {
    width: 13px; height: 13px; flex-shrink: 0;
    color: var(--accent);
    filter: drop-shadow(0 0 4px rgba(124,110,248,0.55));
}

.form-grid {
    display: grid;
    gap: 14px;
    padding: 16px;
}
.col2 { grid-template-columns: 1fr 1fr; }
.col3 { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }


/* ─── Fields & Inputs ──────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; }

.field-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.field-row .field { flex: 1; min-width: 100px; }

label {
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
    display: block;
}

.field-note {
    font-size: 9.5px;
    font-weight: 400;
    color: var(--dim);
    text-transform: none;
    letter-spacing: 0;
    margin-left: 4px;
}

.field-err {
    font-size: 9.5px;
    font-weight: 500;
    color: var(--loss);
    float: right;
    text-transform: none;
    letter-spacing: 0;
}

input, select {
    width: 100%;
    height: 40px;
    padding: 0 13px;
    background: var(--elevated);
    border: 1px solid var(--border-md);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    outline: none;
    transition: border-color var(--t), box-shadow var(--t), background var(--t);
    appearance: none;
    -webkit-appearance: none;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%236b6890' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    padding-right: 30px;
    cursor: pointer;
}

select option { background: var(--surface); }

input:focus, select:focus {
    border-color: rgba(124,110,248,0.65);
    box-shadow: 0 0 0 3px var(--accent-dim), 0 0 22px rgba(124,110,248,0.1);
    background: var(--elevated-2);
}

input:disabled { opacity: 0.32; cursor: not-allowed; }

/* BE Row */
.be-row {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px;
    flex-wrap: wrap;
}

.toggle-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.toggle-lbl {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    margin: 0;
    user-select: none;
}

.be-field { flex: 1; min-width: 160px; }

/* Toggle switch */
.sw { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; }
.sw input { opacity: 0; width: 0; height: 0; position: absolute; }

.sw-track {
    position: absolute; inset: 0;
    background: var(--elevated-2);
    border: 1px solid var(--border-md);
    border-radius: 22px;
    cursor: pointer;
    transition: background var(--t), border-color var(--t), box-shadow var(--t);
}
.sw-track::before {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    left: 2px; top: 50%;
    transform: translateY(-50%);
    background: var(--muted);
    border-radius: 50%;
    transition: transform var(--t), background var(--t), box-shadow var(--t);
}

.sw input:checked + .sw-track {
    background: var(--accent-dim);
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(124,110,248,0.22);
}
.sw input:checked + .sw-track::before {
    transform: translate(16px, -50%);
    background: var(--accent);
    box-shadow: 0 0 8px rgba(124,110,248,0.6);
}

.toggle-row { display: flex; gap: 20px; flex-wrap: wrap; }


/* ─── Execute Button ──────────────────────────────────────────────────────── */
.exec-btn {
    width: 100%;
    height: 52px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    color: #fff;
    border: none;
    border-radius: var(--r-md);
    font-size: 13px;
    font-weight: 800;
    font-family: inherit;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: box-shadow var(--t), transform 0.18s ease;
    box-shadow: 0 6px 28px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.18);
    position: relative;
    overflow: hidden;
}
/* Shine sweep */
.exec-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -80%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
    transform: skewX(-20deg);
    animation: btn-shine 3.8s ease-in-out infinite;
}
@keyframes btn-shine {
    0%   { left: -80%; }
    38%  { left: 130%; }
    100% { left: 130%; }
}
/* Idle pulse ring */
.exec-btn::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: calc(var(--r-md) + 3px);
    border: 1.5px solid rgba(124,110,248,0.35);
    animation: exec-ring 3s ease-in-out infinite;
    pointer-events: none;
}
@keyframes exec-ring {
    0%, 100% { opacity: 0; transform: scale(1); }
    50%       { opacity: 1; transform: scale(1.015); }
}
.exec-btn i { width: 17px; height: 17px; position: relative; z-index: 1; }
.exec-btn:hover {
    box-shadow: 0 10px 40px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.2);
    transform: translateY(-2px);
}
.exec-btn:active { transform: translateY(0); box-shadow: 0 3px 14px var(--accent-glow); }


/* ===========================================================================
   SECTION HEADERS
   =========================================================================== */
.sec-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.sec-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sec-title h2 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.2px;
}

.sec-sub {
    font-size: 11.5px;
    color: var(--muted);
    display: block;
    margin-top: 2px;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 7px;
    background: var(--accent-dim);
    color: var(--accent-text);
    font-size: 11px;
    font-weight: 800;
    border-radius: 20px;
    border: 1px solid rgba(124,110,248,0.28);
    box-shadow: 0 0 10px rgba(124,110,248,0.18);
    transition: box-shadow var(--t), transform var(--t);
}
.badge:not(:empty) { animation: badge-pop 0.38s var(--t-spring) both; }
@keyframes badge-pop {
    from { transform: scale(0.5); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.ghost-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    background: var(--elevated);
    color: var(--muted);
    border: 1px solid var(--border-md);
    border-radius: var(--r-sm);
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: color var(--t), border-color var(--t), background var(--t), box-shadow var(--t), transform 0.15s ease;
    white-space: nowrap;
    flex-shrink: 0;
}
.ghost-btn i { width: 12px; height: 12px; }
.ghost-btn:hover {
    color: var(--accent-text);
    border-color: rgba(124,110,248,0.4);
    background: var(--accent-dim);
    box-shadow: 0 0 14px rgba(124,110,248,0.18);
    transform: translateY(-1px);
}
.ghost-btn:active { transform: translateY(0); }
.ghost-btn.spinning i { animation: spin 0.6s linear infinite; }

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


/* ===========================================================================
   TABLES
   =========================================================================== */
.tbl-wrap {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    transition: box-shadow var(--t), border-color var(--t);
}
.tbl-wrap:hover {
    box-shadow: 0 6px 32px rgba(0,0,0,0.4);
    border-color: var(--border-md);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

th {
    background: linear-gradient(180deg, var(--elevated) 0%, rgba(10,10,20,0.9) 100%);
    padding: 10px 14px;
    text-align: left;
    font-size: 9.5px;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-md);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}

td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text);
}

tr:last-child td { border-bottom: none; }

/* Zebra striping */
tbody tr:nth-child(even) td { background: rgba(255,255,255,0.012); }

tbody tr {
    transition: background 0.18s ease;
    position: relative;
}
tbody tr:hover td {
    background: rgba(124, 110, 248, 0.06) !important;
}
tbody tr:hover td:first-child {
    box-shadow: inset 3px 0 0 var(--accent);
}

/* Staggered row entry animation */
@keyframes row-in {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}
tbody tr { animation: row-in 0.3s var(--ease-out-expo) both; }
tbody tr:nth-child(1)  { animation-delay: 0.02s; }
tbody tr:nth-child(2)  { animation-delay: 0.05s; }
tbody tr:nth-child(3)  { animation-delay: 0.08s; }
tbody tr:nth-child(4)  { animation-delay: 0.11s; }
tbody tr:nth-child(5)  { animation-delay: 0.14s; }
tbody tr:nth-child(6)  { animation-delay: 0.17s; }
tbody tr:nth-child(7)  { animation-delay: 0.20s; }
tbody tr:nth-child(8)  { animation-delay: 0.23s; }
tbody tr:nth-child(9)  { animation-delay: 0.26s; }
tbody tr:nth-child(10) { animation-delay: 0.29s; }
tbody tr:nth-child(11) { animation-delay: 0.32s; }
tbody tr:nth-child(12) { animation-delay: 0.35s; }

.empty-cell {
    text-align: center;
    padding: 50px 20px !important;
    color: var(--muted);
    font-size: 13px;
}

/* Type badges */
.buy-badge, .sell-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.4px;
}
.buy-badge  {
    background: var(--profit-dim);
    color: var(--profit);
    box-shadow: 0 0 8px var(--profit-glow);
    border: 1px solid rgba(15,218,140,0.2);
}
.sell-badge {
    background: var(--loss-dim);
    color: var(--loss);
    box-shadow: 0 0 8px var(--loss-glow);
    border: 1px solid rgba(240,80,78,0.2);
}

.profit { color: var(--profit); }
.loss   { color: var(--loss); }

/* PnL animations */
@keyframes pg { 0%,100% { color:var(--profit); } 50% { color:#34d399; text-shadow:0 0 8px rgba(15,218,140,.5); } }
@keyframes pr { 0%,100% { color:var(--loss);   } 50% { color:#f87171; text-shadow:0 0 8px rgba(240,80,78,.5); } }
.profit-tick { animation: pg 0.8s ease-out; }
.loss-tick   { animation: pr 0.8s ease-out; }

/* Row action buttons */
.btn-edit {
    height: 27px; padding: 0 12px;
    background: var(--elevated-2);
    color: var(--text-2);
    border: 1px solid var(--border-md);
    border-radius: var(--r-sm);
    font-size: 11px; font-weight: 600;
    font-family: inherit; cursor: pointer;
    transition: color var(--t), border-color var(--t), background var(--t), transform 0.15s ease;
}
.btn-edit:hover {
    color: var(--accent-text);
    border-color: var(--accent);
    background: var(--accent-dim);
    transform: translateY(-1px);
}

/* BE one-tap button */
.btn-be {
    height: 27px; padding: 0 11px;
    background: var(--accent-dim);
    color: var(--accent-text);
    border: 1px solid rgba(124,110,248,0.28);
    border-radius: var(--r-sm);
    font-size: 11px; font-weight: 700;
    font-family: inherit; cursor: pointer;
    transition: background var(--t), border-color var(--t), transform 0.1s, box-shadow var(--t);
    white-space: nowrap;
}
.btn-be:hover {
    background: rgba(124,110,248,0.25);
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(124,110,248,0.2);
}
.btn-be:active { transform: translateY(0); }

/* × Close position button */
.btn-close-pos {
    height: 27px; width: 27px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent;
    color: var(--loss);
    border: 1px solid rgba(240,80,78,0.35);
    border-radius: var(--r-sm);
    font-size: 14px; font-weight: 700;
    font-family: inherit; cursor: pointer;
    transition: background var(--t), border-color var(--t), transform 0.15s, box-shadow var(--t);
}
.btn-close-pos:hover {
    background: var(--loss-dim);
    border-color: var(--loss);
    transform: scale(1.1);
    box-shadow: 0 0 10px var(--loss-glow);
}

/* Lot Size Preview strip */
.lot-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border-md);
    border-radius: var(--r-md);
    overflow: hidden;
    margin-top: 8px;
    animation: lotPreviewIn 0.38s var(--ease-out-expo) both;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

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

.lot-preview-item {
    background: var(--elevated);
    padding: 11px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: background 0.2s;
}
.lot-preview-item:hover { background: var(--elevated-2); }

.lot-preview-lbl {
    font-size: 9px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.9px;
}

.lot-preview-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    transition: color 0.3s, text-shadow 0.3s;
}

/* Cancel pending order button */
.btn-cancel {
    height: 27px; padding: 0 11px; margin-left: 4px;
    background: transparent; color: var(--loss);
    border: 1px solid rgba(240,80,78,0.4);
    border-radius: var(--r-sm);
    font-size: 11px; font-weight: 600;
    font-family: inherit; cursor: pointer;
    transition: background var(--t), box-shadow var(--t), transform 0.15s;
}
.btn-cancel:hover {
    background: var(--loss-dim);
    box-shadow: 0 0 10px var(--loss-glow);
    transform: translateY(-1px);
}


/* ===========================================================================
   ACCOUNTS DASHBOARD — Premium Cards
   =========================================================================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 18px;
}

.loading-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 80px 20px;
    color: var(--muted);
    font-size: 13px;
}

.spinner {
    width: 24px; height: 24px;
    border: 2px solid var(--border-md);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    box-shadow: 0 0 12px rgba(124,110,248,0.2);
}

/* Account Card */
.acc-card {
    position: relative;
    background: linear-gradient(145deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.01) 100%);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: transform 0.38s var(--ease-spring), box-shadow 0.38s ease, border-color 0.3s ease;
    animation: cardSlideUp 0.55s var(--ease-out-expo) backwards;
}
.acc-card:nth-child(1) { animation-delay: 0.05s; }
.acc-card:nth-child(2) { animation-delay: 0.12s; }
.acc-card:nth-child(3) { animation-delay: 0.19s; }
.acc-card:nth-child(4) { animation-delay: 0.26s; }
.acc-card:nth-child(5) { animation-delay: 0.33s; }
.acc-card:nth-child(6) { animation-delay: 0.40s; }

@keyframes cardSlideUp {
    from { opacity: 0; transform: translateY(28px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Card mesh overlay for depth */
.acc-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 80% -20%, rgba(124,110,248,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 120%, rgba(34,211,238,0.03) 0%, transparent 50%);
    pointer-events: none;
    transition: opacity 0.3s;
}

.acc-card:hover {
    transform: translateY(-5px) scale(1.018);
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.5);
    border-color: rgba(255,255,255,0.16);
    z-index: 10;
}
.acc-card[data-status="ACTIVE"]:hover     { box-shadow: 0 18px 44px rgba(15, 218, 140, 0.16); border-color: rgba(15, 218, 140, 0.3); }
.acc-card[data-status="NEAR_LIMIT"]:hover { box-shadow: 0 18px 44px rgba(245, 158, 11, 0.16); border-color: rgba(245, 158, 11, 0.3); }
.acc-card[data-status="BREACHED"]:hover   { box-shadow: 0 18px 44px rgba(240, 80, 78, 0.18); border-color: rgba(240, 80, 78, 0.3); }

/* Accent bar */
.acc-card-bar {
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--cyan));
    background-size: 200% 100%;
    animation: bar-flow 4s ease infinite;
}
.acc-card[data-status="NEAR_LIMIT"] .acc-card-bar {
    background: linear-gradient(90deg, var(--warn), #d97706, var(--warn));
    background-size: 200% 100%;
}
.acc-card[data-status="BREACHED"] .acc-card-bar {
    background: linear-gradient(90deg, var(--loss), #c43030, var(--loss));
    background-size: 200% 100%;
    animation: bar-flow 1.5s ease infinite;
}
@keyframes bar-flow {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.acc-card-body { padding: 18px; position: relative; z-index: 1; }

/* Card header row */
.acc-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
}

.acc-id-col {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.acc-lbl {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
    letter-spacing: -0.4px;
}

.acc-id {
    font-size: 11px;
    font-weight: 500;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.acc-terminal { font-size: 10px; color: var(--dim); }

.acc-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Status pill */
.s-pill {
    display: inline-flex; align-items: center;
    font-size: 9px; font-weight: 800; letter-spacing: 0.9px;
    text-transform: uppercase; padding: 3px 10px; border-radius: 20px;
    white-space: nowrap; border: 1px solid transparent;
}
.s-pill.active     {
    background: var(--profit-dim);
    color: var(--profit);
    border-color: rgba(15,218,140,0.25);
    box-shadow: 0 0 10px rgba(15,218,140,0.12);
}
.s-pill.near-limit {
    background: var(--warn-dim);
    color: var(--warn);
    border-color: rgba(245,158,11,0.25);
    box-shadow: 0 0 10px rgba(245,158,11,0.12);
}
.s-pill.breached   {
    background: var(--loss-dim);
    color: var(--loss);
    border-color: rgba(240,80,78,0.25);
    box-shadow: 0 0 10px rgba(240,80,78,0.15);
    animation: blink 1.8s ease-in-out infinite;
}

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

/* Icon button */
.icon-btn {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    background: var(--elevated-2);
    border: 1px solid var(--border-md);
    border-radius: var(--r-sm);
    color: var(--muted); cursor: pointer;
    transition: color var(--t), border-color var(--t), background var(--t), transform 0.15s var(--ease-out-back);
    flex-shrink: 0;
}
.icon-btn i { width: 13px; height: 13px; }
.icon-btn:hover {
    color: var(--accent-text);
    border-color: var(--accent);
    background: var(--accent-dim);
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(124,110,248,0.18);
}

/* Metrics grid — 2×2 */
.acc-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}

.metric {
    background: var(--elevated);
    border: 1px solid var(--border);
    padding: 11px 13px;
    border-radius: var(--r-md);
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: border-color var(--t), box-shadow var(--t), transform 0.2s;
}
.metric:hover {
    border-color: var(--border-md);
    box-shadow: 0 4px 14px rgba(0,0,0,0.3);
    transform: translateY(-1px);
}

.m-label {
    font-size: 9px; font-weight: 700;
    color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px;
}

.m-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px; font-weight: 700;
    color: var(--text); font-variant-numeric: tabular-nums;
    transition: color 0.3s, text-shadow 0.3s;
    line-height: 1.2;
}
.m-value.hi   { color: var(--accent-text); text-shadow: 0 0 14px rgba(124,110,248,0.25); }
.m-value.hi-g { color: var(--profit); text-shadow: 0 0 14px rgba(15,218,140,0.25); }
.m-value.dim  { color: var(--muted); font-weight: 600; font-size: 13px; }

/* DD sections */
.dd-sections {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dd-section {
    background: var(--elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 11px 13px;
    transition: border-color var(--t);
}
.dd-section:hover { border-color: var(--border-md); }

.dd-row {
    display: flex; align-items: flex-start;
    justify-content: space-between; gap: 8px; margin-bottom: 9px;
}

.dd-info { flex: 1; min-width: 0; }

.dd-label {
    font-size: 12px; font-weight: 600;
    color: var(--text-2); display: block;
}

.dd-sub {
    font-size: 10px; color: var(--muted);
    font-variant-numeric: tabular-nums; margin-top: 3px; display: block;
}

.dd-pct {
    font-size: 14px; font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap; padding-top: 1px;
}

.dd-disabled {
    font-size: 11px; color: var(--dim);
    font-style: italic;
}

/* Progress bar */
.pbar {
    height: 7px;
    background: var(--elevated-2);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
}

.pfill {
    height: 100%; border-radius: 4px;
    background: linear-gradient(90deg, var(--accent-2), var(--accent), var(--accent-3));
    background-size: 200% 100%;
    min-width: 4px;
    transition: width 1.1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 0 10px rgba(124,110,248,0.35);
    animation: bar-flow 3s ease infinite;
}
.pfill::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; bottom: 0;
    width: 60%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: pfill-shimmer 2.5s ease-in-out infinite;
}
@keyframes pfill-shimmer {
    0%   { left: -100%; }
    100% { left: 200%; }
}
.pfill.warn { background: linear-gradient(90deg, #d97706, var(--warn), #fbbf24); box-shadow: 0 0 10px var(--warn-glow); }
.pfill.red  { background: linear-gradient(90deg, #c43030, var(--loss), #f87171); box-shadow: 0 0 10px var(--loss-glow); }


/* ===========================================================================
   MARKET BIAS TABLE
   =========================================================================== */
.bias-badge {
    display: inline-flex; align-items: center;
    font-size: 11px; font-weight: 800;
    padding: 3px 11px; border-radius: 20px;
    white-space: nowrap; letter-spacing: 0.3px;
    border: 1px solid transparent;
}
.bias-bullish {
    background: var(--profit-dim); color: var(--profit);
    border-color: rgba(15,218,140,0.25);
    box-shadow: 0 0 8px rgba(15,218,140,0.15);
}
.bias-bearish {
    background: var(--loss-dim);   color: var(--loss);
    border-color: rgba(240,80,78,0.25);
    box-shadow: 0 0 8px rgba(240,80,78,0.15);
}
.bias-choppy  {
    background: var(--warn-dim);   color: var(--warn);
    border-color: rgba(245,158,11,0.25);
}
.bias-unknown { background: var(--elevated);   color: var(--muted); }

.fc-item { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 5px; min-width: 120px; }
.fc-item:last-child { margin-bottom: 0; }

.fc-pct {
    font-size: 11px; font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    min-width: 30px; text-align: right;
}

.mini-bar { flex: 1; height: 3px; background: var(--elevated-2); border-radius: 2px; overflow: hidden; }
.mini-fill { height: 100%; border-radius: 2px; background: var(--accent); transition: width 0.5s ease; }
.mini-fill.warn { background: var(--warn); }
.mini-fill.red  { background: var(--loss); }

.sess-label {
    display: block;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--dim);
    margin-bottom: 4px;
}

.bias-conf {
    display: inline-block;
    margin-left: 5px;
    font-size: 9.5px;
    font-weight: 600;
    opacity: 0.75;
    letter-spacing: 0;
}

/* Confidence Signal Bars */
@keyframes glow-flash {
    0% { opacity: 1; }
    100% { opacity: 0; }
}
@keyframes profit-text-flash {
    0%   { text-shadow: 0 0 14px rgba(15, 218, 140, 1); }
    100% { text-shadow: none; }
}
@keyframes loss-text-flash {
    0%   { text-shadow: 0 0 14px rgba(240, 80, 78, 1); }
    100% { text-shadow: none; }
}

.td-pnl {
    position: relative;
    z-index: 1;
}
.td-pnl::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0;
}
.td-pnl.profit::before {
    background: radial-gradient(circle at center, rgba(15, 218, 140, 0.35) 0%, transparent 60%);
}
.td-pnl.loss::before {
    background: radial-gradient(circle at center, rgba(240, 80, 78, 0.35) 0%, transparent 60%);
}

.conf-signal {
    display: inline-flex;
}
.conf-signal.conf-yellow .sig-label { color: var(--warn); }

.conf-signal.conf-green .b1,
.conf-signal.conf-green .b2,
.conf-signal.conf-green .b3 {
    background: var(--profit);
    box-shadow: 0 0 6px rgba(15, 218, 140, 0.5);
}
.conf-signal.conf-green .b3 {
    animation: sig-pulse 2s ease-in-out infinite;
}
.conf-signal.conf-green .sig-label { color: var(--profit); }

@keyframes sig-pulse {
    0%, 100% { box-shadow: 0 0 4px rgba(15, 218, 140, 0.5); }
    50%       { box-shadow: 0 0 12px rgba(15, 218, 140, 0.9); }
}

.next-sess-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.dir-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 9px 2px 7px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
    border: 1px solid transparent;
    white-space: nowrap;
}
.dir-bull {
    background: rgba(15, 218, 140, 0.11);
    color: var(--profit);
    border-color: rgba(15, 218, 140, 0.25);
}
.dir-bear {
    background: rgba(240, 80, 78, 0.11);
    color: var(--loss);
    border-color: rgba(240, 80, 78, 0.25);
}
.dir-neutral {
    background: rgba(245, 158, 11, 0.11);
    color: var(--warn);
    border-color: rgba(245, 158, 11, 0.25);
}

/* Live PnL cell tick flash */
@keyframes profit-flash {
    0%   {
        background: rgba(15, 218, 140, 0.16);
        box-shadow: inset 0 0 14px rgba(15, 218, 140, 0.45), 0 0 14px rgba(15, 218, 140, 0.22);
        text-shadow: 0 0 10px rgba(15, 218, 140, 0.8);
    }
    100% {
        background: transparent;
        box-shadow: none;
        text-shadow: none;
    }
}
@keyframes loss-flash {
    0%   {
        background: rgba(240, 80, 78, 0.16);
        box-shadow: inset 0 0 14px rgba(240, 80, 78, 0.45), 0 0 14px rgba(240, 80, 78, 0.22);
        text-shadow: 0 0 10px rgba(240, 80, 78, 0.8);
    }
    100% {
        background: transparent;
        box-shadow: none;
        text-shadow: none;
    }
}
.profit-tick { animation: profit-flash 0.85s cubic-bezier(0.22, 1, 0.36, 1); }
.loss-tick   { animation: loss-flash 0.85s cubic-bezier(0.22, 1, 0.36, 1); }
