/* ── FinAI TRADING - Premium Commodity Priceboard (Bảng Giá MXV) ── */

#priceboard-tab {
    display: none;
    width: 100%;
}

#priceboard-tab.active {
    display: block !important;
    width: 100%;
    min-height: 80vh;
}

.priceboard-container {
    padding: 20px;
    background: var(--bg-primary, #0b0e14);
    backdrop-filter: blur(16px);
    border-radius: 16px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    box-shadow: var(--shadow-md, 0 20px 50px rgba(0, 0, 0, 0.4));
    color: var(--text-primary, #f8fafc);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ── 1. Top Index Summary Grid ── */
.pb-index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.pb-index-card {
    background: var(--bg-secondary, #121722);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 12px;
    padding: 16px;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.pb-index-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    border-color: rgba(59, 130, 246, 0.4);
}

.pb-index-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pb-live-badge {
    font-size: 10px;
    font-weight: 700;
    color: #10b981;
    background: rgba(16, 185, 129, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.pb-index-price {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary, #f8fafc);
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.pb-index-change {
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
}

.pb-sparkline-box {
    margin-top: 10px;
    width: 100%;
    height: 42px;
    background: transparent;
    border: none;
    padding: 0;
}

.pb-index-sparkline {
    width: 100%;
    height: 100%;
    display: block;
}

.pb-index-change.up {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.pb-index-change.down {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* ── 2. Toolbar & Category Filters ── */
.pb-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: var(--bg-secondary, rgba(30, 41, 59, 0.5));
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.05));
}

.pb-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pb-cat-btn {
    background: var(--bg-primary, rgba(51, 65, 85, 0.6));
    color: var(--text-secondary, #cbd5e1);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pb-cat-btn:hover {
    background: rgba(59, 130, 246, 0.25);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.4);
}

.pb-cat-btn.active {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #ffffff;
    border-color: #60a5fa;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.pb-search-box {
    position: relative;
    min-width: 260px;
}

.pb-search-input {
    width: 100%;
    background: var(--bg-primary, rgba(15, 23, 42, 0.9));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    border-radius: 8px;
    padding: 8px 14px 8px 36px;
    color: var(--text-primary, #f8fafc);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pb-search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.pb-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary, #64748b);
    font-size: 14px;
    pointer-events: none;
}

/* ── 3. Main Priceboard Table (chuẩn SPS360 đầy đủ thông số) ── */
.pb-table-wrapper {
    overflow-x: hidden;
    width: 100%;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: var(--bg-primary, #0b0e14);
}

.pb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
    text-align: right;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.22);
    font-variant-numeric: tabular-nums;
}

.pb-table th {
    background: var(--bg-secondary, #121722);
    color: var(--text-secondary, #94a3b8);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    padding: 6px 4px;
    border-right: 1px solid rgba(255, 255, 255, 0.22);
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
    position: sticky;
    top: 0;
    z-index: 10;
}

.pb-table th:last-child,
.pb-table td:last-child {
    border-right: none;
}

.pb-table th.th-left {
    text-align: left;
}

.pb-table th.th-center {
    text-align: center;
}

.pb-table th.grp-bid {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
    text-align: center;
}

.pb-table th.grp-match {
    background: rgba(59, 130, 246, 0.18);
    color: #60a5fa;
    text-align: center;
}

.pb-table th.grp-ask {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
    text-align: center;
}

/* Header nhóm (colspan) căn giữa đúng giữa cụm cột */
.pb-table thead tr:first-child th.grp-bid,
.pb-table thead tr:first-child th.grp-match,
.pb-table thead tr:first-child th.grp-ask {
    text-align: center !important;
}

.pb-table td {
    padding: 6px 4px;
    border-right: 1px solid rgba(255, 255, 255, 0.18);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    color: var(--text-primary, #ffffff);
    transition: background 0.2s ease;
    font-variant-numeric: tabular-nums;
}

.pb-table tbody tr {
    cursor: pointer;
    transition: background 0.2s ease;
}

.pb-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

/* Row zebra styling */
.pb-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

/* Columns specific formatting */
.pb-table th.th-code,
.pb-table td.td-code {
    width: 75px !important;
    min-width: 75px;
    max-width: 85px !important;
    text-align: left !important;
    font-weight: 800;
    color: #38bdf8;
    font-family: monospace;
    font-size: 11.5px;
    padding-left: 8px !important;
    padding-right: 4px;
    white-space: nowrap !important;
    cursor: pointer;
    transition: color 0.15s ease, text-shadow 0.15s ease;
}

.pb-table td.td-code:hover {
    color: #60a5fa !important;
    text-decoration: underline;
    text-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

.pb-table th.th-name,
.pb-table td.td-name {
    width: 165px !important;
    min-width: 160px;
    max-width: 180px !important;
    text-align: left !important;
    font-weight: 600;
    color: var(--text-primary, #e2e8f0);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap !important;
    padding-left: 6px;
    padding-right: 4px;
    cursor: pointer;
    transition: color 0.15s ease;
}

.pb-table td.td-name:hover {
    color: #38bdf8 !important;
}

.td-bid-price,
.td-bid-vol,
.td-ask-price,
.td-ask-vol,
.td-last-price,
.td-match-vol {
    padding: 6px 6px !important;
    cursor: pointer;
    transition: background 0.15s ease, filter 0.15s ease;
}

.td-bid-price:hover,
.td-bid-vol:hover {
    background: rgba(16, 185, 129, 0.2) !important;
}

.td-ask-price:hover,
.td-ask-vol:hover {
    background: rgba(239, 68, 68, 0.2) !important;
}

.td-last-price:hover,
.td-match-vol:hover {
    background: rgba(59, 130, 246, 0.2) !important;
}

.td-bid-price,
.td-ask-price,
.td-last-price {
    font-size: 13px !important;
    font-weight: 800 !important;
}

.td-bid-price {
    color: #10b981 !important;
    background: rgba(16, 185, 129, 0.05);
}

.td-bid-vol {
    color: #10b981 !important;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.05);
}

.td-ask-price {
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.05);
}

.td-ask-vol {
    color: #ef4444 !important;
    font-weight: 600;
    background: rgba(239, 68, 68, 0.05);
}

.td-last-price {
    background: rgba(59, 130, 246, 0.06);
}

.td-match-vol {
    font-weight: 600;
    background: rgba(59, 130, 246, 0.06);
}

.td-change {
    background: rgba(59, 130, 246, 0.06);
    font-weight: 700;
    font-size: 12px !important;
}

.td-exchange {
    text-align: center;
    font-weight: 700;
    color: #38bdf8;
}

.td-first-notice {
    text-align: center;
    color: var(--text-primary, #f8fafc);
    font-weight: 600;
    font-size: 11.5px;
}

.color-up {
    color: #34d399 !important;
}

.color-down {
    color: #f87171 !important;
}

.color-neutral {
    color: #f59e0b !important;
}

.color-ceiling {
    color: #c084fc !important;
}

.color-floor {
    color: #38bdf8 !important;
}

/* Price Flash Animations */
@keyframes flashGreen {
    0%   { background-color: rgba(16, 185, 129, 0.75); box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.9); }
    50%  { background-color: rgba(16, 185, 129, 0.4); box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.5); }
    100% { background-color: transparent; box-shadow: none; }
}

@keyframes flashRed {
    0%   { background-color: rgba(239, 68, 68, 0.75); box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.9); }
    50%  { background-color: rgba(239, 68, 68, 0.4); box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.5); }
    100% { background-color: transparent; box-shadow: none; }
}

.flash-up {
    animation: flashGreen 0.85s ease-out;
}

.flash-down {
    animation: flashRed 0.85s ease-out;
}

/* Actions Column */
.td-actions {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3px;
    padding: 4px 3px;
    white-space: nowrap;
}

.pb-btn-action {
    background: rgba(51, 65, 85, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.2;
}

.pb-btn-action.btn-analyze:hover {
    background: #3b82f6;
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.4);
}

.pb-btn-action.btn-chart:hover {
    background: #8b5cf6;
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.4);
}

.pb-btn-action.btn-order:hover {
    background: #10b981;
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
}

/* Responsive Table Adjustments */
@media (max-width: 900px) {
    .pb-index-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .pb-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .pb-search-box {
        min-width: 100%;
    }
}

/* ─────────────────────────────────────────────────────────────────
   SPS Order Drawer Panel Styles (Đặt lệnh SPS 360)
   ───────────────────────────────────────────────────────────────── */
.sps-order-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    display: none;
}

.sps-order-drawer.active {
    display: flex;
    justify-content: flex-end;
}

.sps-drawer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
}

.sps-drawer-content {
    position: relative;
    width: 380px;
    height: 100%;
    background: #0b0e14;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    padding: 20px;
    color: #f8fafc;
    overflow-y: auto;
    z-index: 2;
    animation: slideInRight 0.25s ease-out forwards;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.sps-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.sps-drawer-tabs {
    display: flex;
    gap: 12px;
}

.sps-tab-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
}

.sps-tab-btn.active {
    color: #ffffff;
    border-bottom-color: #10b981;
}

.sps-drawer-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
}

.sps-drawer-close:hover {
    color: #ffffff;
}

.sps-account-badge {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 16px;
}

.sps-account-badge .acc-id {
    color: #38bdf8;
    font-weight: 700;
}

.sps-account-card {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #111827;
    border: 1px solid #1f2937;
}

.sps-account-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.sps-account-name {
    font-size: 13px;
    font-weight: 700;
    color: #e2e8f0;
    line-height: 1.3;
}

.sps-account-ids {
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    font-size: 11px;
    color: #94a3b8;
}

.sps-account-ids .acc-id {
    color: #4ade80;
    font-weight: 700;
}

.sps-live-badge {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #052e16;
    background: #4ade80;
    border-radius: 999px;
    padding: 2px 7px;
}

.sps-account-card .sps-sync-btn {
    width: 100%;
}

.sps-account-actions {
    display: none !important;
}

.sps-logout-btn {
    width: 100%;
    border: none;
    border-radius: 8px;
    padding: 8px 0;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    color: #fecaca;
    background: #3f1d1d;
}

.sps-logout-btn:hover {
    background: #7f1d1d;
    color: #fff;
}

.sps-mode-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin: 0 0 8px;
}

.sps-mode-btn {
    border: none;
    border-radius: 8px;
    padding: 7px 0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    cursor: pointer;
    color: #94a3b8;
    background: #0b1220;
}

.sps-mode-btn.active {
    color: #052e16;
    background: #4ade80;
}

.sps-mode-btn.demo.active {
    color: #422006;
    background: #fbbf24;
}

.sps-live-badge.is-demo {
    background: #fbbf24;
    color: #422006;
}

.sps-acct-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    margin: 0 0 8px;
}

.sps-acct-btn {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 6px 0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.03em;
    cursor: pointer;
    color: #94a3b8;
    background: #0b1220;
    transition: all 0.15s ease;
    text-align: center;
}

.sps-acct-btn:hover {
    color: #f8fafc;
    border-color: rgba(255, 255, 255, 0.25);
}

.sps-acct-btn.active {
    color: #0f172a;
    background: #38bdf8;
    border-color: #38bdf8;
}

.sps-account-summary-grid {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 0 0 10px;
    padding: 8px 10px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    box-sizing: border-box;
}

.sps-summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    line-height: 1.4;
}

.sps-summary-label {
    color: #94a3b8;
    font-weight: 600;
    white-space: nowrap;
}

.sps-summary-val {
    color: #f1f5f9;
    font-weight: 700;
    text-align: right;
    font-family: monospace, system-ui, -apple-system;
    letter-spacing: -0.2px;
}

.sps-summary-val.color-up {
    color: #34d399 !important;
}

.sps-summary-val.color-down {
    color: #f87171 !important;
}

/* Light mode overrides for account picker & summary */
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-acct-btn {
    background: #f1f5f9;
    color: #475569;
    border-color: #cbd5e1;
}

body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-acct-btn.active {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-account-summary-grid {
    background: #f8fafc;
    border-color: #e2e8f0;
}

body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-summary-label {
    color: #64748b;
}

body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-summary-val {
    color: #0f172a;
}

body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-summary-val.color-up {
    color: #059669 !important;
}

body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-summary-val.color-down {
    color: #dc2626 !important;
}

.sps-asset-rows,
.sps-asset-section {
    margin-bottom: 8px;
    padding: 0;
    border-radius: 6px;
    background: #0b1220;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.sps-asset-h {
    font-size: 12px;
    font-weight: 700;
    color: #cbd5e1;
    margin: 0;
    padding: 7px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#sps-panel-assets {
    font-size: 12px;
    line-height: 1.3;
}

#sps-panel-assets .banner-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 0;
    font-size: 12px;
    color: #94a3b8;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#sps-panel-assets .banner-row:last-child {
    border-bottom: none;
}

#sps-panel-assets .banner-row span,
#sps-panel-assets .banner-row b {
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
}

#sps-panel-assets .banner-row span {
    flex: 1 1 auto;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

#sps-panel-assets .banner-row b {
    flex: 0 0 42%;
    color: #e2e8f0;
    font-weight: 600;
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.sps-asset-rows .banner-row,
.sps-green-banner .banner-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 0;
    font-size: 12px;
    color: #94a3b8;
}

.sps-asset-rows .banner-row b,
.sps-green-banner .banner-row b {
    color: #e2e8f0;
    font-weight: 700;
    text-align: right;
}

.sps-side-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: #161b26;
    padding: 4px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.sps-side-btn {
    padding: 10px 0;
    border-radius: 6px;
    border: none;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    color: #94a3b8;
    background: transparent;
    transition: all 0.2s ease;
}

.sps-side-btn.buy.active {
    background: #10b981;
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
}

.sps-side-btn.sell.active {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4);
}

.sps-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.sps-form-group label {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 600;
}

.sps-input-wrap input {
    width: 100%;
    background: #161b26;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 10px 12px;
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
}

.sps-quote-strip {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 10px;
    border-radius: 4px;
    margin-top: 4px;
    color: #cbd5e1;
}

.sps-quote-strip b.up { color: #34d399; }
.sps-quote-strip b.down { color: #f87171; }

.sps-type-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.sps-type-btn {
    background: #161b26;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    padding: 8px 0;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.sps-type-btn.active {
    background: #10b981;
    color: #ffffff;
    border-color: #10b981;
}

.sps-num-input {
    display: flex;
    align-items: center;
    background: #161b26;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

.sps-num-input button {
    width: 42px;
    height: 40px;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
}

.sps-num-input button:hover {
    background: rgba(255, 255, 255, 0.08);
}

.sps-num-input input {
    flex: 1;
    background: none;
    border: none;
    text-align: center;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
}

.sps-num-input.sps-input-invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.5) !important;
}

.sps-prompt.error {
    color: #f87171 !important;
    font-weight: 700 !important;
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
}

.sps-radio-group {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #cbd5e1;
}

.sps-form-group.sps-validity-row,
.sps-validity-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 28px !important;
    margin: 8px 0 12px !important;
    padding: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.sps-validity-item,
.sps-validity-row .sps-radio-group {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 6px !important;
    cursor: pointer !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #cbd5e1 !important;
    user-select: none !important;
    margin: 0 !important;
}

.sps-validity-item input[type="radio"],
.sps-validity-row input[type="radio"] {
    cursor: pointer !important;
    margin: 0 !important;
    width: 15px !important;
    height: 15px !important;
    accent-color: #38bdf8 !important;
}

#sps-order-confirm {
    z-index: 20050;
    background: rgba(2, 6, 23, 0.45);
    backdrop-filter: none;
}

.sps-confirm-card {
    width: min(440px, calc(100vw - 24px));
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 12px;
    padding: 18px 18px 16px;
    color: #f8fafc;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
    position: relative;
    z-index: 1;
}

.sps-confirm-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.sps-confirm-head h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.sps-confirm-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid #334155;
    font-size: 13px;
    color: #cbd5e1;
}

.sps-confirm-row b {
    color: #ffffff;
    font-weight: 600;
    text-align: right;
}

.sps-confirm-row b.is-buy { color: #4ade80; }
.sps-confirm-row b.is-sell { color: #f87171; }

.sps-confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 16px;
}

.sps-confirm-back,
.sps-confirm-ok {
    border: none;
    border-radius: 8px;
    padding: 11px 0;
    font-weight: 700;
    cursor: pointer;
}

.sps-confirm-back { background: #1f2937; color: #e2e8f0; }
.sps-confirm-back:hover { background: #374151; color: #ffffff; }
.sps-confirm-ok { background: #16a34a; color: #fff; }
.sps-confirm-ok:hover { background: #15803d; }
.sps-confirm-ok.danger { background: #ef4444; color: #fff; }
.sps-confirm-ok.danger:hover { background: #dc2626; }
.sps-confirm-ok.primary { background: #3b82f6; color: #fff; }
.sps-confirm-ok.primary:hover { background: #2563eb; }

/* SPS Account Selection Modal */
.sps-account-select-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    max-height: 330px;
    overflow-y: auto;
    margin-bottom: 14px;
    padding-right: 4px;
}
.sps-account-select-list::-webkit-scrollbar {
    width: 5px;
}
.sps-account-select-list::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}
.sps-acct-group-header {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #94a3b8;
    margin: 6px 0 2px 2px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
}
.sps-acct-card-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 13px;
    background: rgba(15, 23, 42, 0.65);
    border: 1.5px solid #334155;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.18s ease-in-out;
}
.sps-acct-card-item:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: #64748b;
    transform: translateY(-1px);
}
.sps-acct-card-item.selected {
    background: rgba(30, 58, 138, 0.35);
    border-color: #3b82f6;
    box-shadow: 0 0 14px rgba(59, 130, 246, 0.3);
}
.sps-acct-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
}
.sps-acct-badge.badge-blue { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.4); }
.sps-acct-badge.badge-cyan { background: rgba(6, 182, 212, 0.2); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.4); }
.sps-acct-badge.badge-purple { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.4); }
.sps-acct-badge.badge-yellow { background: rgba(234, 179, 8, 0.2); color: #facc15; border: 1px solid rgba(234, 179, 8, 0.4); }

.sps-drawer-footer {
    margin-top: 10px;
}

.sps-submit-btn {
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    border: none;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sps-submit-btn.buy {
    background: #10b981;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.sps-submit-btn.sell {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

@keyframes spsPulseGlow {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.8); }
    50% { transform: scale(1.02); box-shadow: 0 0 0 12px rgba(59, 130, 246, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

.sps-pulse-glow {
    animation: spsPulseGlow 1.2s infinite ease-in-out !important;
}

.sps-order-msg {
    margin-top: 12px;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    white-space: normal;
    word-spacing: normal;
    line-height: 1.45;
}

.sps-order-msg.success { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid #10b981; }
.sps-order-msg.error { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid #ef4444; }
.sps-order-msg.hidden { display: none; }

/* Contract Card Box */
.sps-contract-card {
    background: #161b26;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
}

.sps-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.sps-card-symbol b {
    font-size: 15px;
    color: #ffffff;
    font-weight: 800;
}

.sps-card-exchange {
    font-size: 11px;
    color: #64748b;
    margin-left: 6px;
}

.sps-card-price-wrap {
    text-align: right;
}

.sps-card-price-wrap b {
    font-size: 15px;
    font-weight: 800;
}

.sps-card-price-wrap b.up { color: #34d399; }
.sps-card-price-wrap b.down { color: #f87171; }

.sps-card-price-wrap span {
    font-size: 11px;
    margin-left: 4px;
}

.sps-card-price-wrap span.up { color: #34d399; }
.sps-card-price-wrap span.down { color: #f87171; }

.sps-card-name {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 8px;
}

.sps-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    padding-top: 6px;
}

.sps-hl-strip {
    display: flex;
    gap: 8px;
    font-weight: 700;
}

.sps-hl-strip .c-purple { color: #c084fc; }
.sps-hl-strip .c-yellow { color: #f59e0b; }
.sps-hl-strip .c-blue { color: #38bdf8; }

.sps-max-qty {
    font-size: 11px;
    color: #94a3b8;
}

.sps-max-qty b {
    color: #ffffff;
}

/* Prompt Helper next to inputs */
.sps-input-with-prompt {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sps-input-with-prompt .sps-num-input {
    flex: 1;
}

.sps-prompt {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 600;
    min-width: 65px;
    white-space: nowrap;
}

.sps-mkt-select {
    flex: 1;
    background: #161b26;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 10px 12px;
    color: #94a3b8;
    font-weight: 700;
    text-align: center;
}

/* Dynamic Submit Button formatting */
.sps-submit-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
}

.sps-submit-btn .btn-side-text {
    font-size: 18px;
    font-weight: 900;
}

.sps-submit-btn .btn-sub-text {
    font-size: 12px;
    font-weight: 700;
    opacity: 0.95;
}

/* Tab Panel Switching */
.sps-tab-panel {
    display: flex;
    flex-direction: column;
}
.sps-tab-panel.hidden {
    display: none !important;
}

#sps-panel-book {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Green Summary Banner */
.sps-green-banner {
    background: linear-gradient(135deg, #15803d 0%, #166534 100%);
    border-radius: 6px;
    padding: 0;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    box-shadow: none;
}

.sps-green-banner .banner-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #d1fae5;
}

.sps-green-banner .banner-row b {
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
}

.sps-green-banner .banner-row b.safe {
    color: #bbf7d0;
}

#sps-panel-assets .sps-green-banner .banner-row {
    border-bottom-color: rgba(255, 255, 255, 0.14);
}

#sps-panel-assets .sps-green-banner .banner-row span {
    color: #d1fae5;
    border-right-color: rgba(255, 255, 255, 0.14);
}

#sps-panel-assets .sps-green-banner .banner-row b {
    color: #ffffff;
}

/* Filter Pills */
.sps-filter-pills {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.sps-pill {
    background: #161b26;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.sps-pill.active {
    background: #10b981;
    color: #ffffff;
    border-color: #10b981;
}

#sps-portfolio-msg {
    padding: 8px 4px 6px;
    font-size: 12px;
    font-weight: 600;
}

/* Mini Table */
.sps-mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: 4px;
}

.sps-mini-table th {
    text-align: left;
    color: #64748b;
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 11px;
}

.sps-mini-table td {
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
}

.sps-mini-table td.empty-cell {
    text-align: center;
    color: #64748b;
    padding: 30px 10px;
}

.sps-mini-table td .sps-pill {
    padding: 2px 7px;
    font-size: 11px;
    cursor: default;
    display: inline-block;
    border-radius: 4px;
    letter-spacing: 0.5px;
    box-sizing: border-box;
    max-width: 100%;
}

.sps-mini-table td .sps-pill.is-working {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.4);
}

.sps-mini-table td .sps-pill.is-filled {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.4);
}

body.light-mode .sps-mini-table td .sps-pill.is-working {
    background: #fef3c7;
    color: #b45309;
    border-color: #fde68a;
}

.sps-mini-table td .sps-pill.is-cancelled,
.sps-mini-table td .sps-pill.is-rejected {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
}

.sps-mini-table td.empty-cell {
    text-align: center !important;
    padding: 24px 10px !important;
    color: #64748b;
    font-size: 11px;
}

body.light-mode .sps-mini-table td .sps-pill.is-filled {
    background: #d1fae5;
    color: #047857;
    border-color: #a7f3d0;
}

body.light-mode .sps-mini-table td .sps-pill.is-cancelled,
body.light-mode .sps-mini-table td .sps-pill.is-rejected {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

/* Sổ lệnh Table Proportions */
#sps-panel-book .sps-mini-table,
.sps-book-table {
    table-layout: fixed;
    width: 100%;
}

#sps-panel-book .sps-mini-table th,
#sps-panel-book .sps-mini-table td,
.sps-book-table th,
.sps-book-table td {
    padding: 6px 2px !important;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
}

#sps-panel-book .sps-mini-table th:nth-child(1),
#sps-panel-book .sps-mini-table td:nth-child(1),
.sps-book-table th.ob-sym,
.sps-book-table td.ob-sym { width: 62px; text-align: left; }

#sps-panel-book .sps-mini-table th:nth-child(2),
#sps-panel-book .sps-mini-table td:nth-child(2),
.sps-book-table th.ob-side,
.sps-book-table td.ob-side { width: 38px; text-align: center; }

#sps-panel-book .sps-mini-table th:nth-child(3),
#sps-panel-book .sps-mini-table td:nth-child(3),
.sps-book-table th.ob-px,
.sps-book-table td.ob-px { width: 66px; text-align: right; font-variant-numeric: tabular-nums; }

#sps-panel-book .sps-mini-table th:nth-child(4),
#sps-panel-book .sps-mini-table td:nth-child(4),
.sps-book-table th.ob-qty,
.sps-book-table td.ob-qty { width: 32px; text-align: center; }

#sps-panel-book .sps-mini-table th:nth-child(5),
#sps-panel-book .sps-mini-table td:nth-child(5),
.sps-book-table th.ob-st,
.sps-book-table td.ob-st { width: 75px; text-align: center; padding-right: 4px !important; }

/* Book sub-tabs navigation */
.sps-book-subtabs {
    display: flex;
    gap: 2px;
    padding: 6px 6px 0;
    border-bottom: 1px solid rgba(15,23,42,.12);
    flex-shrink: 0;
}
.sps-book-subtab {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #64748b;
    font-size: 10.5px;
    font-weight: 600;
    padding: 5px 2px 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: color .15s, border-color .15s;
    text-align: center;
}
.sps-book-subtab:hover { color: #3b82f6; }
.sps-book-subtab.active {
    color: #1d4ed8;
    border-bottom-color: #3b82f6;
}

/* Sub-panel containers */
.sps-book-subpanel {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.sps-subpanel-label {
    font-size: 9.5px;
    color: #94a3b8;
    padding: 4px 6px 2px;
    letter-spacing: .3px;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* Scrollable scroll area inside each subpanel */
.sps-mini-scroll {
    overflow: auto;
    flex: 1;
    min-height: 0;
}

/* Shared mini-table defaults for new tables */
.sps-closed-table, .sps-open-table, .sps-pending-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 10px;
}
.sps-closed-table th, .sps-closed-table td,
.sps-open-table th,   .sps-open-table td,
.sps-pending-table th,.sps-pending-table td {
    padding: 5px 2px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
    text-align: right;
    border-bottom: 1px solid rgba(15,23,42,.06);
}
.sps-closed-table th, .sps-open-table th, .sps-pending-table th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    font-size: 9px;
    color: #64748b;
    border-bottom: 1px solid rgba(15,23,42,.12);
    z-index: 1;
}
body.dark-mode .sps-closed-table th,
body.dark-mode .sps-open-table th,
body.dark-mode .sps-pending-table th,
body.cosmic-mode .sps-closed-table th,
body.cosmic-mode .sps-open-table th,
body.cosmic-mode .sps-pending-table th {
    background: #0f172a;
    color: #94a3b8;
}

/* Vị thế đóng columns */
.cl-sym  { width: 62px; text-align: left !important; }
.cl-side { width: 28px; text-align: center !important; font-weight: 700; }
.cl-type { width: 38px; text-align: center !important; }
.cl-qty  { width: 24px; text-align: center !important; }
.cl-px   { width: 52px; font-variant-numeric: tabular-nums; }
.cl-time { width: 88px; text-align: center !important; font-size: 9px; }
.cl-st   { width: 44px; text-align: center !important; }

/* Vị thế mở columns */
.op-sym  { width: 54px; text-align: left !important; }
.op-side { width: 26px; text-align: center !important; font-weight: 700; }
.op-qty  { width: 20px; text-align: center !important; }
.op-avg  { width: 40px; font-variant-numeric: tabular-nums; }
.op-mark { width: 40px; font-variant-numeric: tabular-nums; }
.op-size { width: 44px; text-align: right !important; font-variant-numeric: tabular-nums; }
.op-unit { width: 34px; text-align: center !important; color: #94a3b8; }
.op-fx   { width: 44px; text-align: right !important; font-variant-numeric: tabular-nums; }
.op-dm   { width: 38px; text-align: right !important; font-variant-numeric: tabular-nums; color: #38bdf8; font-weight: 600; }
.op-pnl  { width: 44px; font-weight: 700; font-variant-numeric: tabular-nums; }
.op-tp   { width: 32px; font-variant-numeric: tabular-nums; font-size: 9px; color: #10b981; }
.op-sl   { width: 32px; font-variant-numeric: tabular-nums; font-size: 9px; color: #ef4444; }
.op-act  { width: 58px; text-align: center !important; }

/* Lệnh chờ columns */
.pd-sym    { width: 52px; text-align: left !important; }
.pd-side   { width: 26px; text-align: center !important; font-weight: 700; }
.pd-type   { width: 36px; text-align: center !important; }
.pd-qty    { width: 26px; text-align: center !important; }
.pd-px     { width: 48px; font-variant-numeric: tabular-nums; }
.pd-filled { width: 28px; text-align: center !important; }
.pd-valid  { width: 28px; text-align: center !important; font-size: 9px; }
.pd-time   { width: 76px; text-align: center !important; font-size: 9px; }
.pd-act    { width: 28px; text-align: center !important; }

/* Action buttons in book sub-tabs */
.btn-edit-pos {
    background: rgba(59,130,246,.1);
    border: 1px solid rgba(59,130,246,.3);
    color: #2563eb;
    border-radius: 4px;
    padding: 2px 4px;
    font-size: 10px;
    cursor: pointer;
    line-height: 1;
}
.btn-edit-pos:hover { background: rgba(59,130,246,.2); }
.btn-cancel-order {
    background: rgba(239,68,68,.1);
    border: 1px solid rgba(239,68,68,.3);
    color: #dc2626;
    border-radius: 4px;
    padding: 2px 5px;
    font-size: 9.5px;
    cursor: pointer;
    font-weight: 600;
}
.btn-cancel-order:hover { background: rgba(239,68,68,.2); }

/* Danh mục (Portfolio) Table Proportions */

.sps-portfolio-table {
    table-layout: fixed;
    width: 100%;
    margin-top: 6px;
    font-size: 10px;
}

.sps-portfolio-table th,
.sps-portfolio-table td {
    padding: 6px 1px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.sps-portfolio-table th {
    font-size: 10px;
    color: #64748b;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    user-select: none;
}

.sps-portfolio-table th.th-sym,
.sps-portfolio-table td.td-sym {
    width: 54px;
    max-width: 54px;
    text-align: left;
    font-weight: 700;
    font-size: 10px;
}

.sps-portfolio-table th.th-side,
.sps-portfolio-table td.td-side {
    width: 36px;
    max-width: 36px;
    text-align: center;
    font-weight: 700;
    font-size: 9.5px;
}

.sps-portfolio-table th.th-qty,
.sps-portfolio-table td.td-qty {
    width: 26px;
    max-width: 26px;
    text-align: center;
    font-size: 10px;
}

.sps-portfolio-table th.th-avg,
.sps-portfolio-table td.td-avg {
    width: 50px;
    max-width: 50px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-size: 9.5px;
    letter-spacing: -0.2px;
}

.sps-portfolio-table th.th-mark,
.sps-portfolio-table td.td-mark {
    width: 50px;
    max-width: 50px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-size: 9.5px;
    letter-spacing: -0.2px;
}

.sps-portfolio-table th.th-pnl,
.sps-portfolio-table td.td-pnl {
    width: 68px;
    max-width: 68px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 9.5px;
    letter-spacing: -0.2px;
    padding-right: 2px !important;
}

.sps-portfolio-table th.th-act,
.sps-portfolio-table td.td-act {
    width: 42px;
    max-width: 42px;
    text-align: center;
    padding: 2px 2px !important;
}

.btn-close-pos {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 3px;
    padding: 1.5px 4px;
    font-size: 9.5px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1.2;
    transition: all 0.15s ease;
    display: inline-block;
    white-space: nowrap;
    min-width: 36px;
    text-align: center;
    box-sizing: border-box;
}

.btn-close-pos:hover {
    background: #ef4444;
    color: #ffffff;
}

body.light-mode .btn-close-pos {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

body.light-mode .btn-close-pos:hover {
    background: #dc2626;
    color: #ffffff;
}

/* Accordions */
.sps-accordion {
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sps-accordion .acc-head {
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    padding: 8px 0;
    cursor: pointer;
}

.sps-accordion .acc-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 6px 0 12px 0;
}

.sps-accordion .acc-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #cbd5e1;
}

.sps-accordion .acc-row span.yellow {
    color: #f59e0b;
    font-weight: 700;
}

/* Quản Lý Lệnh - đồng bộ style với các tab khác */
.nav-manage-orders-btn {
    /* inherit .tab-btn theme */
}
.nav-manage-orders-btn:hover {
    /* inherit */
}

.pb-btn-manage-orders {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border: 1px solid #10b981;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
    white-space: nowrap;
    transition: all 0.2s ease;
    margin-left: 10px;
}

.pb-btn-manage-orders:hover {
    background: #059669;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.45);
    transform: translateY(-1px);
}

.sps-sync-btn {
    margin-left: auto;
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sps-sync-btn:hover {
    background: #10b981;
    color: #ffffff;
}

.sps-sync-btn.active-login {
    background: #10b981;
    color: #ffffff;
    border: none;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.sps-sync-btn.active-login:hover {
    background: #059669;
}

/* Modal Đăng nhập SPS Asia */
.sps-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: all 0.3s ease;
}

.sps-modal-overlay.hidden {
    display: none !important;
}

.sps-modal-card {
    background: #0b0e14;
    border: 1px solid rgba(16, 185, 129, 0.4);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    width: 90%;
    max-width: 420px;
    padding: 24px;
    color: #f8fafc;
    animation: spsModalIn 0.25s ease-out;
}

@keyframes spsModalIn {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.sps-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
}

.sps-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #10b981;
}

.sps-modal-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    transition: color 0.2s;
}

.sps-modal-close:hover {
    color: #ef4444;
}

.sps-modal-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sps-form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sps-form-field label {
    font-size: 12px;
    font-weight: 600;
    color: #cbd5e1;
}

.sps-form-field input {
    background: #181d28;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 10px 12px;
    color: #ffffff;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.sps-form-field input:focus {
    border-color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

.sps-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.sps-password-wrapper input {
    width: 100%;
    padding-right: 44px !important;
}

.sps-toggle-eye-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 6px;
    border-radius: 4px;
    z-index: 3;
    user-select: none;
    opacity: 0.9;
}

.sps-toggle-eye-btn:hover {
    transform: translateY(-50%) scale(1.12);
    opacity: 1;
}

.sps-login-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ef4444;
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 6px;
}

.sps-login-error.hidden {
    display: none !important;
}

.sps-login-submit-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
    transition: all 0.2s ease;
    margin-top: 8px;
}

.sps-login-submit-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
}

/* ===================================================
   SPS MODERN LOGIN MODAL
   =================================================== */
#sps-login-modal.sps-modal-overlay {
    background: rgba(8, 12, 22, 0.82) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    z-index: 99999 !important;
}

.sps-login-modal-card {
    background: linear-gradient(160deg, #0f172a 0%, #131d35 55%, #0b1120 100%) !important;
    border: 1px solid rgba(56, 189, 248, 0.3) !important;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.9), 0 0 40px rgba(2, 132, 199, 0.22) !important;
    border-radius: 20px !important;
    width: 92% !important;
    max-width: 440px !important;
    padding: 26px 26px 22px !important;
    color: #f8fafc !important;
    position: relative !important;
    overflow: hidden !important;
    animation: spsModalIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.sps-login-modal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0284c7 0%, #10b981 50%, #38bdf8 100%);
}

.sps-login-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sps-login-title-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sps-login-badge-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.35) 0%, rgba(16, 185, 129, 0.25) 100%);
    border: 1px solid rgba(56, 189, 248, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
}

.sps-login-title {
    font-size: 16.5px;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: -0.2px;
    line-height: 1.3;
}

.sps-login-subtitle {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 3px;
    line-height: 1.4;
}

.sps-login-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sps-login-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
    transform: scale(1.05);
}

.sps-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.sps-form-label {
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sps-modern-input {
    width: 100% !important;
    box-sizing: border-box !important;
    background: rgba(15, 23, 42, 0.75) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 10px !important;
    padding: 12px 14px !important;
    color: #f8fafc !important;
    font-size: 13.5px !important;
    outline: none !important;
    transition: all 0.2s ease !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

.sps-modern-input::placeholder {
    color: #64748b;
    font-size: 12.5px;
}

.sps-modern-input:focus {
    border-color: #38bdf8 !important;
    background: rgba(15, 23, 42, 0.95) !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25), inset 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

.sps-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.sps-password-wrapper .sps-modern-input {
    padding-right: 48px !important;
}

.sps-toggle-eye-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    user-select: none;
}

.sps-toggle-eye-btn:hover {
    color: #38bdf8;
    background: rgba(255, 255, 255, 0.08);
}

.sps-login-error-box {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    font-size: 12.5px;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
}

.sps-login-error-box.hidden {
    display: none !important;
}

.sps-login-btn-submit {
    width: 100% !important;
    padding: 13px 18px !important;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 40%, #10b981 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 14.5px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    box-shadow: 0 4px 18px rgba(2, 132, 199, 0.4) !important;
    transition: all 0.2s ease !important;
    margin-top: 6px !important;
}

.sps-login-btn-submit:hover:not(:disabled) {
    transform: translateY(-1.5px) !important;
    box-shadow: 0 6px 24px rgba(2, 132, 199, 0.55) !important;
    filter: brightness(1.08) !important;
}

.sps-login-btn-submit:active:not(:disabled) {
    transform: translateY(0) !important;
}

.sps-login-btn-submit:disabled {
    opacity: 0.65 !important;
    cursor: not-allowed !important;
    filter: grayscale(0.3) !important;
}

.sps-login-secure-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
    font-size: 11.5px;
    color: #64748b;
    text-align: center;
}

.sps-login-secure-footer .secure-icon {
    font-size: 13px;
    color: #10b981;
}

/* Banner thông báo bắt buộc liên kết Trade SPS */
.sps-link-notice-box {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.12) 0%, rgba(16, 185, 129, 0.08) 100%) !important;
    border: 1px dashed rgba(56, 189, 248, 0.35) !important;
    border-radius: 12px !important;
    padding: 12px 14px !important;
    margin-bottom: 18px !important;
}

.sps-notice-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    background: rgba(245, 158, 11, 0.15) !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
    color: #fbbf24 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
    margin-bottom: 8px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.sps-notice-text {
    font-size: 12.5px !important;
    color: #cbd5e1 !important;
    line-height: 1.45 !important;
    margin-bottom: 8px !important;
}

.sps-notice-features {
    display: flex !important;
    flex-direction: column !important;
    gap: 5px !important;
}

.sps-feature-item {
    font-size: 12px !important;
    color: #94a3b8 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.sps-feature-item span:first-child {
    font-size: 13px !important;
}

.sps-login-btn-skip {
    width: 100% !important;
    background: transparent !important;
    border: none !important;
    color: #64748b !important;
    font-size: 12.5px !important;
    padding: 10px 0 2px !important;
    cursor: pointer !important;
    text-align: center !important;
    transition: color 0.2s ease !important;
}

.sps-login-btn-skip:hover {
    color: #94a3b8 !important;
    text-decoration: underline !important;
}

/* Inline dock mode (Tong hop) - compact */
#sps-order-drawer.inline{position:relative!important;width:100%!important;max-width:100%!important;min-width:100%!important;height:100%!important;max-height:100%!important;display:block!important;z-index:1;overflow:hidden!important;box-sizing:border-box!important}
#sps-order-drawer.inline .sps-drawer-overlay,
#sps-order-drawer.inline .sps-drawer-close{display:none!important}
#sps-order-drawer.inline .sps-drawer-content{width:100%!important;max-width:100%!important;min-width:100%!important;box-sizing:border-box!important;height:100%!important;max-height:100%!important;border-left:none!important;box-shadow:none!important;animation:none!important;padding:10px 8px 12px!important;overflow-y:auto!important;overflow-x:hidden!important}
/* SPS light mode theme */
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-drawer-content{
  background:#ffffff!important;color:#0f172a!important;border-left-color:#e2e8f0!important
}
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-tab-btn{color:#64748b}
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-tab-btn.active{color:#0f172a;border-bottom-color:#10b981}
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-side-toggle{background:#f1f5f9}
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-contract-card{background:#f8fafc;border:1px solid #e2e8f0}
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-type-btn{background:#f1f5f9;border-color:#cbd5e1;color:#475569}
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-type-btn.active{background:#10b981;border-color:#10b981;color:#fff}
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-num-input{background:#f8fafc;border-color:#cbd5e1}
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-num-input.sps-input-invalid{border-color:#dc2626!important;box-shadow:0 0 0 1px rgba(220,38,38,0.4)!important}
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-num-input button,
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-num-input input{color:#0f172a}
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-radio-group,
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-validity-item,
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-form-group label,
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-account-badge,
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-prompt{color:#475569}
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-prompt.error{color:#dc2626!important;background:#fef2f2!important;border-color:#fca5a5!important}
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-drawer-header{border-bottom-color:#e2e8f0}
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-card-symbol b{color:#0f172a!important}
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-input-wrap input{
  background:#f8fafc!important;border-color:#cbd5e1!important;color:#0f172a!important
}
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-quote-strip{
  background:#f1f5f9!important;color:#475569!important
}
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-mkt-select{
  background:#f1f5f9!important;color:#0f172a!important;border:1px solid #cbd5e1!important
}
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-green-banner{
  background:#15803d!important;color:#ecfdf5!important
}
body:not(.dark-mode):not(.cosmic-mode) #sps-panel-assets .sps-asset-section,
body:not(.dark-mode):not(.cosmic-mode) #sps-panel-assets .sps-asset-rows{
  background:#fff;border-color:#e5e7eb
}
body:not(.dark-mode):not(.cosmic-mode) #sps-panel-assets .sps-asset-h{
  color:#334155;border-bottom-color:#e5e7eb
}
body:not(.dark-mode):not(.cosmic-mode) #sps-panel-assets .banner-row{
  color:#64748b;border-bottom-color:#e5e7eb
}
body:not(.dark-mode):not(.cosmic-mode) #sps-panel-assets .banner-row span{
  border-right-color:#e5e7eb
}
body:not(.dark-mode):not(.cosmic-mode) #sps-panel-assets .banner-row b{
  color:#0f172a
}
body:not(.dark-mode):not(.cosmic-mode) #sps-panel-assets .sps-green-banner .banner-row,
body:not(.dark-mode):not(.cosmic-mode) #sps-panel-assets .sps-green-banner .banner-row span{
  color:#ecfdf5;border-color:rgba(255,255,255,.18)
}
body:not(.dark-mode):not(.cosmic-mode) #sps-panel-assets .sps-green-banner .banner-row b{
  color:#fff
}
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-drawer-close{color:#64748b}
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-drawer-close:hover{color:#0f172a}
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-side-btn{color:#64748b}
/* ===== Priceboard light mode blue frames ===== */
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .priceboard-container{
  background:#eef4fb;
  border:2px solid #60a5fa;
  color:#0f172a;
  box-shadow:0 8px 24px rgba(37,99,235,.08);
}
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-index-card{
  background:#ffffff;
  border:2px solid #93c5fd;
  box-shadow:0 0 0 1px rgba(59,130,246,.08);
}
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-index-title{color:#1e40af}
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-index-price{color:#0f172a}
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-toolbar{
  background:#eff6ff;
  border:1.5px solid #93c5fd;
  border-radius:10px;
  padding:10px 12px;
}
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-cat-btn{
  background:#ffffff;
  border:1px solid #93c5fd;
  color:#1e40af;
}
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-cat-btn.active{
  background:#3b82f6;
  border-color:#2563eb;
  color:#fff;
}
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-search-input{
  background:#ffffff;
  border:1.5px solid #93c5fd;
  color:#0f172a;
}
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-table-wrapper{
  background:#ffffff;
  border:2px solid #60a5fa;
  box-shadow:0 0 0 1px rgba(59,130,246,.1);
}
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-table{
  border:1px solid #60a5fa;
  border-collapse:collapse;
}
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-table th{
  background:#eff6ff;
  color:#1e40af;
  border-right:1px solid #93c5fd;
  border-bottom:1px solid #60a5fa;
}
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-table th.grp-bid{
  background:#ecfdf5;
  color:#047857;
  border-right:1px solid #93c5fd;
}
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-table th.grp-match{
  background:#dbeafe;
  color:#1d4ed8;
  border-right:1px solid #93c5fd;
}
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-table th.grp-ask{
  background:#fef2f2;
  color:#b91c1c;
  border-right:1px solid #93c5fd;
}
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-table td{
  color:#0f172a;
  border-right:1px solid #bfdbfe;
  border-bottom:1px solid #bfdbfe;
  background:#ffffff;
}
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-table tbody tr:nth-child(even) td{
  background:#f8fbff;
}
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-table tbody tr:hover td{
  background:#dbeafe!important;
}
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-table .td-code{
  color:#0369a1;
}
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-btn-action{
  background:#eff6ff;
  border:1px solid #60a5fa;
  color:#1d4ed8;
}
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-btn-action.btn-analyze:hover{
  background:#3b82f6;color:#fff;border-color:#2563eb;
}
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-btn-action.btn-chart:hover{
  background:#8b5cf6;color:#fff;border-color:#7c3aed;
}
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-btn-action.btn-order:hover{
  background:#10b981;color:#fff;border-color:#059669;
}

/* ─────────────────────────────────────────────────────────────────
   SPS TP / SL Section Styles (Tỉ lệ chuẩn đồng bộ với Giá & Khối lượng)
   ───────────────────────────────────────────────────────────────── */
.sps-tpsl-check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #cbd5e1;
    cursor: pointer;
    user-select: none;
    margin-bottom: 2px;
}

.sps-tpsl-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
    animation: fadeInTPSL 0.2s ease;
}

@keyframes fadeInTPSL {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.sps-tpsl-row {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
}

.sps-tpsl-tag {
    width: 36px;
    height: 38px;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.2px;
    flex-shrink: 0;
    user-select: none;
}

.sps-tpsl-tag.tp {
    color: #34d399;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.sps-tpsl-tag.sl {
    color: #f87171;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Đảm bảo toàn bộ controls bên trong .sps-num-input KHÔNG BAO GIỜ bị tràn */
.sps-tpsl-row .sps-num-input {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    height: 38px !important;
    display: flex !important;
    align-items: center !important;
    background: #161b26 !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 6px !important;
    overflow: hidden !important; /* DẤU - VÀ + LUÔN NẰM TRỌN TRONG Ô */
    box-sizing: border-box !important;
}

.sps-tpsl-row .sps-num-input button {
    flex: 0 0 30px !important;
    width: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
    height: 100% !important;
    background: transparent !important;
    border: none !important;
    color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    user-select: none !important;
    transition: background 0.15s ease !important;
}

.sps-tpsl-row .sps-num-input button:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

.sps-tpsl-row .sps-num-input input {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    width: 0 !important;
    height: 100% !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    text-align: center !important;
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    padding: 0 2px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    -moz-appearance: textfield !important;
}

.sps-tpsl-row .sps-num-input input::-webkit-outer-spin-button,
.sps-tpsl-row .sps-num-input input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

/* Prompt hiển thị điều kiện >, < kèm giá hiện tại */
.sps-tpsl-row .sps-prompt {
    flex: 0 0 auto !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    min-width: 68px !important;
    padding: 4px 6px !important;
    border-radius: 4px !important;
    white-space: nowrap !important;
    text-align: center !important;
    box-sizing: border-box !important;
    letter-spacing: 0.2px !important;
    user-select: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.sps-tpsl-row .sps-prompt.tp {
    color: #34d399 !important;
    background: rgba(16, 185, 129, 0.12) !important;
    border: 1px solid rgba(16, 185, 129, 0.25) !important;
}

.sps-tpsl-row .sps-prompt.sl {
    color: #f87171 !important;
    background: rgba(239, 68, 68, 0.12) !important;
    border: 1px solid rgba(239, 68, 68, 0.25) !important;
}

/* Light mode overrides for TP / SL */
body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-tpsl-check-label,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #sps-order-drawer.inline .sps-tpsl-check-label {
    color: #334155 !important;
}

body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-tpsl-tag.tp,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #sps-order-drawer.inline .sps-tpsl-tag.tp {
    color: #059669 !important;
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}

body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-tpsl-tag.sl,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #sps-order-drawer.inline .sps-tpsl-tag.sl {
    color: #dc2626 !important;
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-tpsl-row .sps-num-input,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #sps-order-drawer.inline .sps-tpsl-row .sps-num-input {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-tpsl-row .sps-num-input button,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #sps-order-drawer.inline .sps-tpsl-row .sps-num-input button {
    color: #0f172a !important;
}

body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-tpsl-row .sps-num-input input,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #sps-order-drawer.inline .sps-tpsl-row .sps-num-input input {
    color: #0f172a !important;
}

body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-tpsl-row .sps-prompt.tp,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #sps-order-drawer.inline .sps-tpsl-row .sps-prompt.tp {
    color: #059669 !important;
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}

body:not(.dark-mode):not(.cosmic-mode) #sps-order-drawer .sps-tpsl-row .sps-prompt.sl,
body:not(.dark-mode):not(.cosmic-mode) #tonghop-tab #sps-order-drawer.inline .sps-tpsl-row .sps-prompt.sl {
    color: #dc2626 !important;
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

/* Utility: hide SPS conditional groups */
#sps-order-drawer .hidden, #sps-login-modal .hidden, #sps-tpsl-box.hidden { display: none !important; }

/* Khung chọn ngày hết hạn lệnh GTD */
.sps-gtd-date-wrap {
    margin-top: 8px;
    margin-bottom: 6px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 8px;
    padding: 7px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.sps-gtd-date-wrap label {
    font-size: 12px;
    color: #38bdf8;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 600;
    margin: 0;
}
.sps-gtd-date-wrap input[type="date"] {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 6px;
    color: #f8fafc;
    padding: 4px 8px;
    font-size: 12px;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    color-scheme: dark;
}
.sps-gtd-date-wrap input[type="date"]:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.5);
}

/* ─── MODAL RIÊNG BIỆT CHO CHỈNH SỬA TP/SL VỊ THẾ ─────────────────── */
.sps-tpsl-modal-card {
    width: min(480px, calc(100vw - 28px));
    background: #0d121d;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    padding: 20px 22px;
    color: #f8fafc;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 1px rgba(255, 255, 255, 0.2);
    position: relative;
    animation: spsModalIn 0.22s ease-out;
}

.sps-tpsl-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sps-tpsl-modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sps-tpsl-icon {
    font-size: 18px;
}

.sps-tpsl-modal-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #f1f5f9;
    letter-spacing: -0.2px;
}

/* Thống kê vị thế */
.sps-tpsl-summary-card {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
}

.sps-tpsl-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px 14px;
}

.sps-tpsl-summary-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sps-tpsl-lbl {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sps-tpsl-val {
    font-size: 13px;
    color: #ffffff;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.sps-tpsl-val.sym {
    color: #38bdf8;
}

.sps-tpsl-val.text-buy {
    color: #10b981;
}

.sps-tpsl-val.text-sell {
    color: #ef4444;
}

/* Form Body */
.sps-tpsl-form-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sps-tpsl-block {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 8px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.sps-tpsl-block.tp-block {
    border-left: 3px solid #10b981;
}

.sps-tpsl-block.sl-block {
    border-left: 3px solid #ef4444;
}

.sps-tpsl-block-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.sps-tpsl-tag-title {
    display: flex;
    align-items: center;
    gap: 7px;
}

.sps-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 3px;
    line-height: 1;
}

.sps-badge.tp-badge {
    background: #10b981;
    color: #022c22;
}

.sps-badge.sl-badge {
    background: #ef4444;
    color: #ffffff;
}

.sps-tpsl-tag-title label {
    font-size: 12px;
    font-weight: 600;
    color: #e2e8f0;
    cursor: pointer;
}

.sps-tpsl-hint {
    font-size: 11px;
    color: #94a3b8;
    font-style: italic;
}

.sps-tpsl-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sps-tpsl-step {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #f8fafc;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
    user-select: none;
}

.sps-tpsl-step:hover {
    background: #334155;
    border-color: #64748b;
}

.sps-tpsl-step:active {
    transform: scale(0.95);
}

.sps-tpsl-field {
    flex: 1;
    height: 38px;
    background: #050811;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sps-tpsl-field.tp-field:focus {
    border-color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

.sps-tpsl-field.sl-field:focus {
    border-color: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

.sps-tpsl-field.tp-field {
    color: #34d399;
}

.sps-tpsl-field.sl-field {
    color: #f87171;
}

.sps-tpsl-calc {
    margin-top: 6px;
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.4;
}

.sps-tpsl-alert {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    color: #fca5a5;
    animation: spsFadeIn 0.2s ease;
}

.sps-tpsl-alert.hidden {
    display: none !important;
}

/* Actions Footer */
.sps-tpsl-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sps-tpsl-btn {
    padding: 9px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
}

.sps-tpsl-btn.del {
    margin-right: auto;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #f87171;
}

.sps-tpsl-btn.del:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: #ef4444;
}

.sps-tpsl-btn.cancel {
    background: #1e293b;
    color: #cbd5e1;
    border: 1px solid #334155;
}

.sps-tpsl-btn.cancel:hover {
    background: #334155;
    color: #ffffff;
}

.sps-tpsl-btn.save {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.sps-tpsl-btn.save:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.45);
}

/* ==========================================================================
   STR DYNAMIC THEME SYSTEM — MỤC 2: BẢNG GIÁ (#priceboard-tab)
   Đồng bộ 100% theo Theme Picker:
   1. Chế độ Nền: Đen (dark) / Vũ trụ nhiều màu (cosmic) / Trắng (light)
   2. Ngũ hành & Màu nhấn: Kim, Mộc, Thủy, Hỏa, Thổ & Custom Hex
   3. Viền khung: Themed borders phong thủy
   ========================================================================== */

/* 2.1 Khung tổng thể của tab */
#priceboard-tab {
    color: var(--str-text-main, #ffffff);
    background: transparent;
}

/* 2.2 Container Bảng Giá */
#priceboard-tab .priceboard-container {
    background: var(--str-bg-card, #101010) !important;
    border: 1px solid var(--str-border-subtle, rgba(255, 255, 255, 0.1)) !important;
    color: var(--str-text-main, #ffffff) !important;
    border-radius: 16px !important;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
}

/* Viền khung phong thủy khi bật tùy chọn */
body.str-themed-borders #priceboard-tab .priceboard-container {
    border-color: var(--str-border-gold, rgba(56, 189, 248, 0.35)) !important;
}

/* Thích ứng 3 chế độ nền cho Priceboard Container */
body.cosmic-mode #priceboard-tab .priceboard-container {
    background: var(--str-bg-card, rgba(15, 23, 42, 0.52)) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.45) !important;
}

body.str-pure-black #priceboard-tab .priceboard-container,
body.dark-mode:not(.cosmic-mode) #priceboard-tab .priceboard-container {
    background: var(--str-bg-card, #101010) !important;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6) !important;
}

body.str-pure-white #priceboard-tab .priceboard-container,
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .priceboard-container {
    background: #ffffff !important;
    border: 1px solid var(--str-border-subtle, #e5e7eb) !important;
    color: #111827 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
}

/* 2.3 Thẻ chỉ số tổng quan trên đỉnh (.pb-index-card) */
#priceboard-tab .pb-index-card {
    background: var(--str-bg-surface, #141414) !important;
    border: 1px solid var(--str-border-subtle, rgba(255, 255, 255, 0.1)) !important;
    border-radius: 12px !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease !important;
}

body.cosmic-mode #priceboard-tab .pb-index-card {
    background: rgba(15, 23, 42, 0.6) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.str-pure-white #priceboard-tab .pb-index-card,
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-index-card {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #111827 !important;
}

#priceboard-tab .pb-index-card:hover {
    border-color: var(--str-accent, #38bdf8) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 24px var(--str-accent-soft, rgba(56, 189, 248, 0.25)) !important;
}

#priceboard-tab .pb-index-title {
    color: var(--str-text-muted, #94a3b8) !important;
}

body.str-pure-white #priceboard-tab .pb-index-title,
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-index-title {
    color: #64748b !important;
}

#priceboard-tab .pb-index-price {
    color: var(--str-text-main, #ffffff) !important;
}

body.str-pure-white #priceboard-tab .pb-index-price,
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-index-price {
    color: #0f172a !important;
}

/* 2.4 Thanh công cụ & Tabs danh mục (.pb-toolbar) */
#priceboard-tab .pb-toolbar {
    background: var(--str-bg-surface, #141414) !important;
    border: 1px solid var(--str-border-subtle, rgba(255, 255, 255, 0.1)) !important;
    border-radius: 12px !important;
}

body.cosmic-mode #priceboard-tab .pb-toolbar {
    background: rgba(11, 18, 32, 0.65) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.str-pure-white #priceboard-tab .pb-toolbar,
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-toolbar {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

/* Nút danh mục */
#priceboard-tab .pb-cat-btn {
    background: var(--str-bg-base, rgba(255, 255, 255, 0.05)) !important;
    color: var(--str-text-muted, #cbd5e1) !important;
    border: 1px solid var(--str-border-subtle, rgba(255, 255, 255, 0.1)) !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
}

body.str-pure-white #priceboard-tab .pb-cat-btn,
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-cat-btn {
    background: #ffffff !important;
    color: #475569 !important;
    border-color: #e2e8f0 !important;
}

#priceboard-tab .pb-cat-btn:hover {
    background: var(--str-accent-soft, rgba(56, 189, 248, 0.15)) !important;
    color: var(--str-accent, #38bdf8) !important;
    border-color: var(--str-accent, #38bdf8) !important;
}

#priceboard-tab .pb-cat-btn.active {
    background: linear-gradient(135deg, var(--str-accent, #0284c7), var(--str-accent-mid, #2563eb)) !important;
    color: var(--str-accent-fg, #ffffff) !important;
    border-color: var(--str-accent, #38bdf8) !important;
    box-shadow: 0 4px 14px var(--str-accent-soft, rgba(56, 189, 248, 0.35)) !important;
    font-weight: 700 !important;
}

/* Ô tìm kiếm */
#priceboard-tab .pb-search-input {
    background: var(--str-bg-surface, #141414) !important;
    color: var(--str-text-main, #ffffff) !important;
    border: 1px solid var(--str-border-subtle, rgba(255, 255, 255, 0.15)) !important;
    border-radius: 8px !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

body.cosmic-mode #priceboard-tab .pb-search-input {
    background: rgba(11, 18, 32, 0.7) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

body.str-pure-white #priceboard-tab .pb-search-input,
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-search-input {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
}

#priceboard-tab .pb-search-input:focus {
    outline: none !important;
    border-color: var(--str-accent, #38bdf8) !important;
    box-shadow: 0 0 0 3px var(--str-accent-soft, rgba(56, 189, 248, 0.25)) !important;
}

/* 2.5 Bảng giá SPS360 (.pb-table-wrapper & .pb-table) */
#priceboard-tab .pb-table-wrapper {
    background: var(--str-bg-surface, #0f141c) !important;
    border: 1px solid var(--str-border-subtle, rgba(255, 255, 255, 0.12)) !important;
    border-radius: 10px !important;
}

body.cosmic-mode #priceboard-tab .pb-table-wrapper {
    background: rgba(6, 9, 19, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body.str-pure-white #priceboard-tab .pb-table-wrapper,
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-table-wrapper {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

/* Tiêu đề cột th */
#priceboard-tab .pb-table th {
    background: var(--str-bg-surface, #141414) !important;
    color: var(--str-text-muted, #94a3b8) !important;
    border-right: 1px solid var(--str-border-subtle, rgba(255, 255, 255, 0.12)) !important;
    border-bottom: 1px solid var(--str-border-subtle, rgba(255, 255, 255, 0.15)) !important;
}

body.cosmic-mode #priceboard-tab .pb-table th {
    background: #0f172a !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body.str-pure-white #priceboard-tab .pb-table th,
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-table th {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border-right: 1px solid #e2e8f0 !important;
    border-bottom: 1px solid #cbd5e1 !important;
}

/* Cụm cột Khớp lệnh / Mua / Bán */
#priceboard-tab .pb-table th.grp-match,
#priceboard-tab .pb-table th.grp-bid,
#priceboard-tab .pb-table th.grp-ask {
    background: var(--str-accent-soft, rgba(56, 189, 248, 0.15)) !important;
    color: var(--str-accent, #38bdf8) !important;
}

/* Ô dữ liệu td */
#priceboard-tab .pb-table td {
    color: var(--str-text-main, #ffffff);
    border-right: 1px solid var(--str-border-subtle, rgba(255, 255, 255, 0.1)) !important;
    border-bottom: 1px solid var(--str-border-subtle, rgba(255, 255, 255, 0.1)) !important;
}

body.str-pure-white #priceboard-tab .pb-table td,
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-table td {
    color: #0f172a !important;
    border-right: 1px solid #f1f5f9 !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

/* Zebra striping */
#priceboard-tab .pb-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02) !important;
}

body.str-pure-white #priceboard-tab .pb-table tbody tr:nth-child(even),
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-table tbody tr:nth-child(even) {
    background: #f8fafc !important;
}

/* Hover dòng */
#priceboard-tab .pb-table tbody tr:hover {
    background: var(--str-accent-soft, rgba(56, 189, 248, 0.12)) !important;
}

/* Dòng đang được chọn active */
#priceboard-tab .pb-table tbody tr.selected {
    background: var(--str-accent-soft, rgba(56, 189, 248, 0.2)) !important;
}

/* Cột Mã Hợp Đồng */
#priceboard-tab .pb-table th.th-code,
#priceboard-tab .pb-table td.td-code {
    color: var(--str-accent, #38bdf8) !important;
    font-weight: 800 !important;
}

body.str-pure-white #priceboard-tab .pb-table th.th-code,
body.str-pure-white #priceboard-tab .pb-table td.td-code,
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-table th.th-code,
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-table td.td-code {
    color: var(--str-accent, #0284c7) !important;
}

#priceboard-tab .pb-table td.td-code:hover {
    color: var(--str-accent, #38bdf8) !important;
    filter: brightness(1.2) !important;
}

/* Cột Tên Hợp Đồng */
#priceboard-tab .pb-table td.td-name {
    color: var(--str-text-main, #e2e8f0);
}

body.str-pure-white #priceboard-tab .pb-table td.td-name,
body:not(.dark-mode):not(.cosmic-mode) #priceboard-tab .pb-table td.td-name {
    color: #1e293b !important;
}

#priceboard-tab .pb-table td.td-name:hover {
    color: var(--str-accent, #38bdf8) !important;
}

/* Nút hành động trong bảng */
#priceboard-tab .pb-btn-action.btn-analyze:hover {
    background: var(--str-accent, #38bdf8) !important;
    color: var(--str-accent-fg, #ffffff) !important;
    box-shadow: 0 2px 10px var(--str-accent-soft, rgba(56, 189, 248, 0.4)) !important;
}

/* 2.6 Drawer Đặt lệnh & Thông tin hàng hóa SPS */
.sps-order-drawer .sps-drawer-content {
    background: var(--str-bg-card, #101010) !important;
    color: var(--str-text-main, #ffffff) !important;
    border-left: 1px solid var(--str-border-gold, rgba(56, 189, 248, 0.3)) !important;
}

body.cosmic-mode .sps-order-drawer .sps-drawer-content {
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
}

body.str-pure-white .sps-order-drawer .sps-drawer-content,
body:not(.dark-mode):not(.cosmic-mode) .sps-order-drawer .sps-drawer-content {
    background: #ffffff !important;
    color: #0f172a !important;
    border-left: 1px solid #e2e8f0 !important;
}

.sps-order-drawer .sps-drawer-header {
    background: var(--str-bg-surface, #141414) !important;
    border-bottom: 1px solid var(--str-border-subtle, rgba(255, 255, 255, 0.1)) !important;
}

body.str-pure-white .sps-order-drawer .sps-drawer-header,
body:not(.dark-mode):not(.cosmic-mode) .sps-order-drawer .sps-drawer-header {
    background: #f8fafc !important;
    border-bottom-color: #e2e8f0 !important;
}

.sps-order-drawer .sps-drawer-tabs button.active {
    color: var(--str-accent, #38bdf8) !important;
    border-bottom-color: var(--str-accent, #38bdf8) !important;
}
