/* ==========================================================================
   STR HOME — MXV MARGIN TABLE & INTERACTIVE PNL CALCULATOR
   Hỗ trợ Dark Mode, Pure White, Cosmic & Hệ thống Ngũ hành Theme STR
   ========================================================================== */

/* 1. SECTION WRAPPER */
.mxv-margin-section,
.mxv-calc-section {
    width: 100%;
    margin-bottom: 60px;
    box-sizing: border-box;
}

/* 2. OFFICIAL MXV NOTICE CARD */
.mxv-official-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: var(--str-bg-card, #101010);
    border: 1px solid var(--fs-accent-border, rgba(255, 255, 255, 0.12));
    border-left: 4px solid var(--fs-accent, #d4af37);
    border-radius: var(--str-radius-card, 12px);
    padding: 16px 22px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    flex-wrap: wrap;
}

.mxv-notice-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 280px;
}

.mxv-badge-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--str-accent-soft, rgba(212, 175, 55, 0.15));
    color: var(--fs-accent, #d4af37);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mxv-notice-content h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--fs-accent, #d4af37);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.mxv-notice-content p {
    margin: 0;
    font-size: 13px;
    color: var(--str-text-main, #ffffff);
    opacity: 0.9;
    line-height: 1.5;
}

.mxv-fx-pill-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.mxv-fx-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--str-accent-soft, rgba(212, 175, 55, 0.1));
    border: 1px solid var(--str-border-subtle, rgba(255, 255, 255, 0.12));
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--str-text-main, #ffffff);
    white-space: nowrap;
}

.mxv-fx-pill span {
    color: var(--fs-accent, #d4af37);
    font-weight: 700;
}

/* 3. TOOLBAR (TABS + FILTER + SEARCH) */
.mxv-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.mxv-cat-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}
.mxv-cat-tabs::-webkit-scrollbar { display: none; }

.mxv-cat-btn {
    background: var(--str-bg-surface, #141414);
    border: 1px solid var(--fs-accent-border, rgba(255, 255, 255, 0.12));
    color: var(--str-text-muted, #c9d1d9);
    padding: 8px 18px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.mxv-cat-btn:hover {
    border-color: var(--fs-accent, #d4af37);
    color: var(--str-text-main, #ffffff);
    background: var(--str-accent-soft, rgba(212, 175, 55, 0.12));
}

.mxv-cat-btn.active {
    background: var(--fs-accent, #d4af37);
    color: var(--str-accent-fg, #0b0f17) !important;
    border-color: var(--fs-accent, #d4af37);
    font-weight: 700;
    box-shadow: 0 2px 10px var(--str-accent-soft, rgba(212, 175, 55, 0.3));
}

.mxv-search-box {
    position: relative;
    min-width: 260px;
    flex: 0 1 340px;
}

.mxv-search-box input {
    width: 100%;
    background: var(--str-bg-surface, #141414);
    border: 1px solid var(--fs-accent-border, rgba(255, 255, 255, 0.15));
    border-radius: 22px;
    padding: 9px 38px 9px 16px;
    font-size: 13px;
    color: var(--str-text-main, #ffffff);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.mxv-search-box input:focus {
    border-color: var(--fs-accent, #d4af37);
    box-shadow: 0 0 10px var(--str-accent-soft, rgba(212, 175, 55, 0.25));
}

.mxv-search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--str-text-muted, #8b949e);
    pointer-events: none;
}

/* 4. MARGIN TABLE */
.mxv-table-wrap {
    background: var(--str-bg-card, #101010);
    border: 1px solid var(--fs-accent-border, rgba(255, 255, 255, 0.12));
    border-radius: var(--str-radius-card, 14px);
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    margin-bottom: 20px;
    overflow-x: auto;
}

.mxv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
    white-space: nowrap;
}

.mxv-table th {
    background: var(--str-bg-surface, rgba(0, 0, 0, 0.35));
    color: var(--fs-accent, #d4af37);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11.5px;
    letter-spacing: 0.05em;
    padding: 14px 16px;
    border-bottom: 1px solid var(--fs-accent-border, rgba(212, 175, 55, 0.3));
}

.mxv-table td {
    padding: 13px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--str-text-main, #ffffff);
    vertical-align: middle;
}

.mxv-table tbody tr {
    transition: background 0.15s ease;
}

.mxv-table tbody tr:hover {
    background: var(--str-accent-soft, rgba(212, 175, 55, 0.08));
}

.mxv-sym-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    color: var(--fs-accent, #d4af37);
    font-family: monospace;
    font-size: 13px;
}

.mxv-exchange-tag {
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--str-text-muted, #94a3b8);
    font-family: sans-serif;
}

.mxv-type-tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}
.mxv-type-standard { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.mxv-type-mini { background: rgba(52, 211, 153, 0.15); color: #34d399; }
.mxv-type-micro { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.mxv-type-nano { background: rgba(192, 132, 252, 0.15); color: #c084fc; }

.mxv-vnd-highlight {
    font-weight: 700;
    color: var(--fs-accent, #d4af37);
    font-size: 13.5px;
}

.mxv-btn-calc {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--str-accent-soft, rgba(212, 175, 55, 0.15));
    border: 1px solid var(--fs-accent, #d4af37);
    color: var(--fs-accent, #d4af37);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mxv-btn-calc:hover {
    background: var(--fs-accent, #d4af37);
    color: #0b0f17;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--str-accent-soft, rgba(212, 175, 55, 0.3));
}

/* 5. EXPIRY MONTH CODES ACCORDION / BAR */
.mxv-months-bar {
    background: var(--str-bg-card, #101010);
    border: 1px solid var(--fs-accent-border, rgba(255, 255, 255, 0.1));
    border-radius: var(--str-radius-card, 12px);
    padding: 14px 20px;
    margin-bottom: 40px;
}

.mxv-months-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--fs-accent, #d4af37);
    text-transform: uppercase;
}

.mxv-months-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
}

.mxv-month-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 6px 8px;
    text-align: center;
    font-size: 12px;
}

.mxv-month-code {
    font-weight: 800;
    color: var(--fs-accent, #d4af37);
    margin-right: 4px;
    font-family: monospace;
}

.mxv-month-val {
    color: var(--str-text-muted, #94a3b8);
}

/* ==========================================================================
   6. CALCULATOR SECTION (INTERACTIVE PNL & RISK SIMULATOR)
   ========================================================================== */
.mxv-calc-container {
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    gap: 28px;
    align-items: stretch;
}

.mxv-calc-card {
    background: var(--str-bg-card, #101010);
    border: 1px solid var(--fs-accent-border, rgba(212, 175, 55, 0.35));
    border-radius: var(--str-radius-card, 16px);
    padding: 26px 28px;
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.mxv-calc-header-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--str-border-subtle, rgba(255, 255, 255, 0.1));
}

.mxv-calc-header-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--str-text-main, #ffffff);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.mxv-calc-header-title svg {
    color: var(--fs-accent, #d4af37);
}

.mxv-calc-meta-pill {
    font-size: 11.5px;
    font-weight: 700;
    background: var(--str-accent-soft, rgba(212, 175, 55, 0.15));
    color: var(--fs-accent, #d4af37);
    padding: 4px 10px;
    border-radius: 14px;
}

/* INPUT CONTROLS */
.mxv-form-group {
    margin-bottom: 18px;
}

.mxv-form-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--str-text-muted, #cbd5e1);
    margin-bottom: 8px;
}

.mxv-label-sub {
    font-size: 11.5px;
    color: var(--str-text-dim, #94a3b8);
    font-weight: 400;
}

.mxv-select,
.mxv-input {
    width: 100%;
    background: var(--str-bg-surface, rgba(0, 0, 0, 0.35));
    border: 1px solid var(--fs-accent-border, rgba(255, 255, 255, 0.15));
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13.5px;
    color: var(--str-text-main, #ffffff);
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.mxv-select:focus,
.mxv-input:focus {
    border-color: var(--fs-accent, #d4af37);
    box-shadow: 0 0 8px var(--str-accent-soft, rgba(212, 175, 55, 0.25));
}

.mxv-select option {
    background: var(--str-bg-surface, #141414);
    color: #ffffff;
}

/* POSITION TOGGLE (MUA / BÁN) */
.mxv-position-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.mxv-pos-btn {
    border: 1px solid var(--fs-accent-border, rgba(255, 255, 255, 0.15));
    background: var(--str-bg-surface, rgba(0, 0, 0, 0.3));
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 700;
    color: var(--str-text-muted, #94a3b8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.mxv-pos-btn.active-buy {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    color: #34d399;
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.3);
}

.mxv-pos-btn.active-sell {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #f87171;
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.3);
}

/* LOT CONTROL */
.mxv-lot-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mxv-lot-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--str-text-main, #ffffff);
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mxv-lot-btn:hover {
    background: var(--str-accent-soft, rgba(212, 175, 55, 0.2));
    border-color: var(--fs-accent, #d4af37);
    color: var(--fs-accent, #d4af37);
}

.mxv-lot-quick {
    display: flex;
    gap: 6px;
}

.mxv-quick-cap.active-cap {
    background: var(--fs-accent, #d4af37) !important;
    color: #0b0f17 !important;
    border-color: var(--fs-accent, #d4af37) !important;
    font-weight: 700;
}

/* SLIDER CONTROLLER */
.mxv-slider-box {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 14px 16px;
    margin-top: 6px;
}

.mxv-slider-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 12.5px;
}

.mxv-slider-delta {
    font-weight: 700;
    font-family: monospace;
    font-size: 13.5px;
    padding: 2px 8px;
    border-radius: 6px;
}

.mxv-delta-up { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.mxv-delta-down { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.mxv-delta-zero { background: rgba(255, 255, 255, 0.08); color: var(--str-text-muted, #94a3b8); }

.mxv-range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.mxv-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--fs-accent, #d4af37);
    cursor: pointer;
    box-shadow: 0 0 10px var(--str-accent-soft, rgba(212, 175, 55, 0.5));
    border: 2px solid #ffffff;
    transition: transform 0.1s ease;
}

.mxv-range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.mxv-slider-scale {
    display: flex;
    justify-content: space-between;
    font-size: 10.5px;
    color: var(--str-text-dim, #64748b);
    margin-top: 6px;
    font-weight: 600;
}

/* FEE BOX (+ PHÍ) */
.mxv-fee-box {
    background: var(--str-accent-soft, rgba(212, 175, 55, 0.06));
    border: 1px dashed var(--fs-accent-border, rgba(212, 175, 55, 0.35));
    border-radius: 8px;
    padding: 12px 14px;
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mxv-fee-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mxv-fee-label strong {
    font-size: 12.5px;
    color: var(--fs-accent, #d4af37);
    display: flex;
    align-items: center;
    gap: 6px;
}

.mxv-fee-label span {
    font-size: 11.5px;
    color: var(--str-text-muted, #94a3b8);
}

.mxv-fee-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mxv-fee-input {
    width: 130px;
    background: var(--str-bg-surface, rgba(0, 0, 0, 0.4));
    border: 1px solid var(--fs-accent-border, rgba(255, 255, 255, 0.2));
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--str-text-main, #ffffff);
    text-align: right;
    outline: none;
}

/* RESULTS DASHBOARD */
.mxv-results-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
}

.mxv-net-pnl-banner {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.04) 0%, rgba(0, 0, 0, 0.4) 100%);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 22px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.mxv-net-pnl-banner.profit {
    border-color: #10b981;
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.12) 0%, rgba(6, 78, 59, 0.25) 100%);
    box-shadow: 0 0 24px rgba(16, 185, 129, 0.25);
}

.mxv-net-pnl-banner.loss {
    border-color: #ef4444;
    background: linear-gradient(145deg, rgba(239, 68, 68, 0.12) 0%, rgba(127, 29, 29, 0.25) 100%);
    box-shadow: 0 0 24px rgba(239, 68, 68, 0.25);
}

.mxv-pnl-subtitle {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--str-text-muted, #94a3b8);
    margin-bottom: 6px;
}

.mxv-pnl-main-value {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--str-text-main, #ffffff);
}

.mxv-net-pnl-banner.profit .mxv-pnl-main-value { color: #34d399; }
.mxv-net-pnl-banner.loss .mxv-pnl-main-value { color: #f87171; }

.mxv-pnl-usd-value {
    font-size: 14.5px;
    font-weight: 600;
    opacity: 0.85;
    color: var(--str-text-muted, #cbd5e1);
}

.mxv-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.mxv-metric-item {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mxv-metric-title {
    font-size: 11.5px;
    color: var(--str-text-dim, #94a3b8);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.mxv-metric-val {
    font-size: 15px;
    font-weight: 700;
    color: var(--str-text-main, #ffffff);
}

.mxv-metric-sub {
    font-size: 11px;
    color: var(--str-text-dim, #64748b);
}

/* RISK CALLOUT / TIP */
.mxv-risk-note {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 12px;
    color: var(--str-text-muted, #94a3b8);
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.mxv-risk-note svg {
    color: var(--fs-accent, #d4af37);
    flex-shrink: 0;
    margin-top: 2px;
}

/* ==========================================================================
   7. ENERGY GROUP EMPTY STATE NOTICE PANE (Full-width & Perfectly Centered)
   ========================================================================== */
.mxv-energy-notice-pane {
    width: 100%;
    min-height: 280px;
    padding: 56px 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 14px;
    white-space: normal;
}

.mxv-energy-icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--str-accent-soft, rgba(212, 175, 55, 0.15));
    color: var(--fs-accent, #d4af37);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 24px var(--str-accent-soft, rgba(212, 175, 55, 0.25));
    margin-bottom: 4px;
}

.mxv-energy-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--str-text-main, #ffffff);
    letter-spacing: -0.01em;
    max-width: 620px;
    line-height: 1.45;
}

.mxv-energy-desc {
    margin: 0;
    font-size: 14px;
    color: var(--str-text-muted, #94a3b8);
    line-height: 1.6;
    max-width: 560px;
}

.mxv-energy-badge {
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(234, 179, 8, 0.12);
    border: 1px solid rgba(234, 179, 8, 0.35);
    color: #facc15;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 20px;
}

/* ==========================================================================
   8. THEMING SUPPORT (PURE BLACK, COSMIC GLASS, PURE WHITE, NGŨ HÀNH)
   ========================================================================== */

/* 8.1 PURE BLACK / DARK MODE (#000000 Base) */
body.str-pure-black .mxv-official-notice,
body.str-pure-black .mxv-table-wrap,
body.str-pure-black .mxv-months-bar,
body.str-pure-black .mxv-calc-card,
body.str-pure-black .mxv-energy-notice-pane,
body.dark-mode:not(.str-bg-cosmic) .mxv-official-notice,
body.dark-mode:not(.str-bg-cosmic) .mxv-table-wrap,
body.dark-mode:not(.str-bg-cosmic) .mxv-months-bar,
body.dark-mode:not(.str-bg-cosmic) .mxv-calc-card,
body.dark-mode:not(.str-bg-cosmic) .mxv-energy-notice-pane {
    background: #101010 !important;
    border-color: var(--fs-accent-border, rgba(255, 255, 255, 0.12)) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6) !important;
}

body.str-pure-black .mxv-table th,
body.dark-mode:not(.str-bg-cosmic) .mxv-table th {
    background: #161616 !important;
    color: var(--fs-accent, #d4af37) !important;
    border-bottom: 1px solid var(--fs-accent-border, rgba(255, 255, 255, 0.12)) !important;
}

body.str-pure-black .mxv-table td,
body.dark-mode:not(.str-bg-cosmic) .mxv-table td {
    color: #ffffff !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.str-pure-black .mxv-table tbody tr:hover,
body.dark-mode:not(.str-bg-cosmic) .mxv-table tbody tr:hover {
    background: var(--str-accent-soft, rgba(255, 255, 255, 0.05)) !important;
}

body.str-pure-black .mxv-cat-btn,
body.dark-mode:not(.str-bg-cosmic) .mxv-cat-btn {
    background: #161616 !important;
    border-color: var(--fs-accent-border, rgba(255, 255, 255, 0.12)) !important;
    color: #cbd5e1 !important;
}

body.str-pure-black .mxv-cat-btn:hover,
body.dark-mode:not(.str-bg-cosmic) .mxv-cat-btn:hover {
    background: var(--str-accent-soft, rgba(255, 255, 255, 0.08)) !important;
    border-color: var(--fs-accent) !important;
    color: #ffffff !important;
}

body.str-pure-black .mxv-cat-btn.active,
body.dark-mode:not(.str-bg-cosmic) .mxv-cat-btn.active {
    background: var(--fs-accent) !important;
    border-color: var(--fs-accent) !important;
    color: var(--str-accent-fg, #0b0f17) !important;
}

body.str-pure-black .mxv-search-box input,
body.dark-mode:not(.str-bg-cosmic) .mxv-search-box input {
    background: #161616 !important;
    border-color: var(--fs-accent-border, rgba(255, 255, 255, 0.15)) !important;
    color: #ffffff !important;
}

body.str-pure-black .mxv-month-item,
body.dark-mode:not(.str-bg-cosmic) .mxv-month-item {
    background: #161616 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.str-pure-black .mxv-select,
body.str-pure-black .mxv-input,
body.str-pure-black .mxv-pos-btn,
body.str-pure-black .mxv-preset-btn,
body.str-pure-black .mxv-metric-item,
body.str-pure-black .mxv-pnl-ratio-card,
body.str-pure-black .mxv-risk-note,
body.dark-mode:not(.str-bg-cosmic) .mxv-select,
body.dark-mode:not(.str-bg-cosmic) .mxv-input,
body.dark-mode:not(.str-bg-cosmic) .mxv-pos-btn,
body.dark-mode:not(.str-bg-cosmic) .mxv-preset-btn,
body.dark-mode:not(.str-bg-cosmic) .mxv-metric-item,
body.dark-mode:not(.str-bg-cosmic) .mxv-pnl-ratio-card,
body.dark-mode:not(.str-bg-cosmic) .mxv-risk-note {
    background: #161616 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

body.str-pure-black .mxv-select option,
body.dark-mode:not(.str-bg-cosmic) .mxv-select option {
    background: #161616 !important;
    color: #ffffff !important;
}

body.str-pure-black .mxv-fee-box,
body.dark-mode:not(.str-bg-cosmic) .mxv-fee-box {
    background: rgba(255, 255, 255, 0.03) !important;
    border-color: var(--fs-accent-border, rgba(255, 255, 255, 0.12)) !important;
}

body.str-pure-black .mxv-fee-input,
body.dark-mode:not(.str-bg-cosmic) .mxv-fee-input {
    background: #101010 !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
}

body.str-pure-black .mxv-net-pnl-banner:not(.profit):not(.loss),
body.dark-mode:not(.str-bg-cosmic) .mxv-net-pnl-banner:not(.profit):not(.loss) {
    background: #141414 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

/* 8.2 COSMIC MODE SUPPORT (Vũ trụ Glassmorphism) */
body.str-bg-cosmic .mxv-official-notice,
body.str-bg-cosmic .mxv-table-wrap,
body.str-bg-cosmic .mxv-months-bar,
body.str-bg-cosmic .mxv-calc-card,
body.str-bg-cosmic .mxv-energy-notice-pane,
body.cosmic-mode .mxv-official-notice,
body.cosmic-mode .mxv-table-wrap,
body.cosmic-mode .mxv-months-bar,
body.cosmic-mode .mxv-calc-card,
body.cosmic-mode .mxv-energy-notice-pane {
    background: linear-gradient(
        145deg,
        var(--str-cosmic-card-a, rgba(14, 165, 233, 0.1)) 0%,
        rgba(15, 23, 42, 0.52) 42%,
        var(--str-cosmic-card-b, rgba(168, 85, 247, 0.08)) 100%
    ) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--fs-accent-border, var(--fs-accent)) !important;
    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

body.str-bg-cosmic .mxv-table th,
body.cosmic-mode .mxv-table th {
    background: rgba(11, 18, 32, 0.55) !important;
    color: var(--fs-accent, #38bdf8) !important;
    border-bottom: 1px solid var(--fs-accent-border, rgba(255, 255, 255, 0.12)) !important;
}

body.str-bg-cosmic .mxv-table td,
body.cosmic-mode .mxv-table td {
    color: #ffffff !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.str-bg-cosmic .mxv-table tbody tr:hover,
body.cosmic-mode .mxv-table tbody tr:hover {
    background: var(--str-accent-soft, rgba(255, 255, 255, 0.05)) !important;
}

body.str-bg-cosmic .mxv-cat-btn,
body.cosmic-mode .mxv-cat-btn {
    background: rgba(15, 23, 42, 0.55) !important;
    border-color: var(--fs-accent-border, rgba(255, 255, 255, 0.15)) !important;
    color: #cbd5e1 !important;
}

body.str-bg-cosmic .mxv-cat-btn:hover,
body.cosmic-mode .mxv-cat-btn:hover {
    background: var(--str-accent-soft, rgba(14, 165, 233, 0.15)) !important;
    border-color: var(--fs-accent) !important;
    color: #ffffff !important;
}

body.str-bg-cosmic .mxv-cat-btn.active,
body.cosmic-mode .mxv-cat-btn.active {
    background: var(--fs-accent) !important;
    border-color: var(--fs-accent) !important;
    color: var(--str-accent-fg, #0b0f17) !important;
}

body.str-bg-cosmic .mxv-search-box input,
body.cosmic-mode .mxv-search-box input {
    background: rgba(15, 23, 42, 0.55) !important;
    border-color: var(--fs-accent-border, rgba(255, 255, 255, 0.15)) !important;
    color: #ffffff !important;
}

body.str-bg-cosmic .mxv-month-item,
body.cosmic-mode .mxv-month-item {
    background: rgba(15, 23, 42, 0.45) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.str-bg-cosmic .mxv-select,
body.str-bg-cosmic .mxv-input,
body.str-bg-cosmic .mxv-pos-btn,
body.str-bg-cosmic .mxv-preset-btn,
body.str-bg-cosmic .mxv-metric-item,
body.str-bg-cosmic .mxv-pnl-ratio-card,
body.str-bg-cosmic .mxv-risk-note,
body.cosmic-mode .mxv-select,
body.cosmic-mode .mxv-input,
body.cosmic-mode .mxv-pos-btn,
body.cosmic-mode .mxv-preset-btn,
body.cosmic-mode .mxv-metric-item,
body.cosmic-mode .mxv-pnl-ratio-card,
body.cosmic-mode .mxv-risk-note {
    background: rgba(15, 23, 42, 0.55) !important;
    border-color: var(--fs-accent-border, rgba(255, 255, 255, 0.12)) !important;
    color: #ffffff !important;
}

body.str-bg-cosmic .mxv-select option,
body.cosmic-mode .mxv-select option {
    background: #0f172a !important;
    color: #ffffff !important;
}

body.str-bg-cosmic .mxv-fee-box,
body.cosmic-mode .mxv-fee-box {
    background: var(--str-accent-soft, rgba(14, 165, 233, 0.08)) !important;
    border-color: var(--fs-accent-border, rgba(255, 255, 255, 0.15)) !important;
}

body.str-bg-cosmic .mxv-fee-input,
body.cosmic-mode .mxv-fee-input {
    background: rgba(11, 18, 32, 0.75) !important;
    border-color: var(--fs-accent-border, rgba(255, 255, 255, 0.18)) !important;
    color: #ffffff !important;
}

body.str-bg-cosmic .mxv-net-pnl-banner:not(.profit):not(.loss),
body.cosmic-mode .mxv-net-pnl-banner:not(.profit):not(.loss) {
    background: rgba(15, 23, 42, 0.55) !important;
    border-color: var(--fs-accent-border, rgba(255, 255, 255, 0.15)) !important;
}

/* 8.3 PURE WHITE / LIGHT MODE SUPPORT */
body.str-pure-white .mxv-official-notice,
body.str-pure-white .mxv-table-wrap,
body.str-pure-white .mxv-months-bar,
body.str-pure-white .mxv-calc-card,
body.str-pure-white .mxv-energy-notice-pane {
    background: #ffffff !important;
    color: #111827 !important;
    border-color: var(--fs-accent-border, #e5e7eb) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06) !important;
}

body.str-pure-white .mxv-cat-btn,
body.str-pure-white .mxv-search-box input,
body.str-pure-white .mxv-select,
body.str-pure-white .mxv-input,
body.str-pure-white .mxv-metric-item,
body.str-pure-white .mxv-pnl-ratio-card,
body.str-pure-white .mxv-risk-note,
body.str-pure-white .mxv-month-item {
    background: #f8fafc !important;
    color: #111827 !important;
    border-color: #e2e8f0 !important;
}

body.str-pure-white .mxv-cat-btn.active {
    background: var(--fs-accent) !important;
    color: var(--str-accent-fg, #ffffff) !important;
    border-color: var(--fs-accent) !important;
}

body.str-pure-white .mxv-table th {
    background: #f8fafc !important;
    color: var(--fs-accent, #b45309) !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.str-pure-white .mxv-table td {
    color: #1f2937 !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

body.str-pure-white .mxv-table tbody tr:hover {
    background: var(--str-accent-soft, rgba(212, 175, 55, 0.06)) !important;
}

body.str-pure-white .mxv-exchange-tag {
    background: #f1f5f9 !important;
    color: #4b5563 !important;
    border-color: #e2e8f0 !important;
}

body.str-pure-white .mxv-notice-content p,
body.str-pure-white .mxv-form-label,
body.str-pure-white .mxv-metric-title,
body.str-pure-white .mxv-risk-note,
body.str-pure-white .mxv-energy-desc {
    color: #4b5563 !important;
}

body.str-pure-white .mxv-calc-header-title,
body.str-pure-white .mxv-energy-title {
    color: #111827 !important;
}

body.str-pure-white .mxv-select option {
    background: #ffffff;
    color: #111827;
}

body.str-pure-white .mxv-pos-btn,
body.str-pure-white .mxv-preset-btn {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: #475569 !important;
}

body.str-pure-white .mxv-fee-box {
    background: var(--str-accent-soft, rgba(212, 175, 55, 0.08)) !important;
    border-color: var(--fs-accent-border, #e2e8f0) !important;
}

body.str-pure-white .mxv-fee-input {
    background: #ffffff !important;
    color: #111827 !important;
    border-color: #cbd5e1 !important;
}

body.str-pure-white .mxv-net-pnl-banner:not(.profit):not(.loss) {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

body.str-pure-white .mxv-net-pnl-banner.profit {
    background: #ecfdf5 !important;
    border-color: #10b981 !important;
}

body.str-pure-white .mxv-net-pnl-banner.loss {
    background: #fef2f2 !important;
    border-color: #ef4444 !important;
}

body.str-pure-white .mxv-net-pnl-banner.profit .mxv-pnl-main-value { color: #059669 !important; }
body.str-pure-white .mxv-net-pnl-banner.loss .mxv-pnl-main-value { color: #dc2626 !important; }

/* 8.4 FENG SHUI / NGŨ HÀNH & THEMED BORDERS DYNAMIC INTEGRATION */
body.str-feng-shui-active .mxv-official-notice {
    border-left: 4px solid var(--fs-accent) !important;
}

body.str-feng-shui-active .mxv-badge-icon {
    background: var(--str-accent-soft) !important;
    color: var(--fs-accent) !important;
}

body.str-feng-shui-active .mxv-notice-content h4 {
    color: var(--fs-accent) !important;
}

body.str-feng-shui-active .mxv-fx-pill {
    background: var(--str-accent-soft) !important;
    border-color: var(--fs-accent-border) !important;
    color: var(--str-text-main) !important;
}

body.str-feng-shui-active .mxv-fx-pill span,
body.str-feng-shui-active .mxv-sym-badge,
body.str-feng-shui-active .mxv-vnd-highlight,
body.str-feng-shui-active .mxv-months-head,
body.str-feng-shui-active .mxv-month-code,
body.str-feng-shui-active .mxv-calc-header-title svg,
body.str-feng-shui-active .mxv-fee-label strong,
body.str-feng-shui-active .mxv-risk-note svg,
body.str-feng-shui-active .mxv-energy-badge {
    color: var(--fs-accent) !important;
}

body.str-feng-shui-active .mxv-calc-meta-pill {
    background: var(--str-accent-soft) !important;
    color: var(--fs-accent) !important;
}

body.str-feng-shui-active .mxv-btn-calc {
    background: var(--str-accent-soft) !important;
    border-color: var(--fs-accent) !important;
    color: var(--fs-accent) !important;
}

body.str-feng-shui-active .mxv-btn-calc:hover {
    background: var(--fs-accent) !important;
    color: var(--str-accent-fg, #0b0f17) !important;
}

body.str-feng-shui-active .mxv-preset-btn.active {
    background: var(--fs-accent) !important;
    border-color: var(--fs-accent) !important;
    color: var(--str-accent-fg, #0b0f17) !important;
}

body.str-feng-shui-active .mxv-range-slider::-webkit-slider-thumb {
    background: var(--fs-accent) !important;
    box-shadow: 0 0 10px var(--str-accent-soft) !important;
}

body.str-feng-shui-active .mxv-range-slider::-moz-range-thumb {
    background: var(--fs-accent) !important;
    box-shadow: 0 0 10px var(--str-accent-soft) !important;
}

body.str-themed-borders .mxv-official-notice,
body.str-themed-borders .mxv-table-wrap,
body.str-themed-borders .mxv-months-bar,
body.str-themed-borders .mxv-calc-card,
body.str-themed-borders .mxv-energy-notice-pane {
    border-color: var(--fs-accent-border, rgba(212, 175, 55, 0.45)) !important;
}

/* ==========================================================================
   9. RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 992px) {
    .mxv-calc-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .mxv-official-notice {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 16px;
    }
    
    .mxv-fx-pill-group {
        width: 100%;
        justify-content: flex-start;
    }

    .mxv-table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .mxv-search-box {
        width: 100%;
        flex: 1 1 auto;
    }

    .mxv-calc-card {
        padding: 20px 16px;
    }

    .mxv-metrics-grid {
        grid-template-columns: 1fr;
    }

    .mxv-pnl-main-value {
        font-size: 26px;
    }
}
