/**
 * XM-Bull Institutional Trading Terminal Design System
 * Inspired by Binance Pro, Bybit, TradingView, and Exness WebTrader
 */

:root {
    --xm-bg-main: #0b0e14;
    --xm-bg-card: #121620;
    --xm-bg-card-elevated: #161c28;
    --xm-bg-card-hover: #1c2433;
    --xm-bg-input: #1a202c;
    --xm-border-color: rgba(255, 255, 255, 0.08);
    --xm-border-light: rgba(255, 255, 255, 0.12);
    --xm-border-subtle: rgba(255, 255, 255, 0.04);
    
    --xm-green: #0ecb81;
    --xm-green-hover: #0bbb75;
    --xm-green-subtle: rgba(14, 203, 129, 0.12);
    --xm-green-glow: rgba(14, 203, 129, 0.25);
    
    --xm-red: #f6465d;
    --xm-red-hover: #e03e54;
    --xm-red-subtle: rgba(246, 70, 93, 0.12);
    --xm-red-glow: rgba(246, 70, 93, 0.25);
    
    --xm-yellow: #f0b90b;
    --xm-blue: #38bdf8;
    --xm-text-primary: #eaecef;
    --xm-text-secondary: #cbd5e1;
    --xm-text-muted: #848e9c;
    --xm-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* ==========================================================================
   GLOBAL TERMINAL RESETS & OVERRIDES
   ========================================================================== */
.trading-section {
    background-color: var(--xm-bg-main) !important;
    min-height: 100vh;
    color: var(--xm-text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Ensure no rogue list bullets inside trading widgets */
.xm-order-book-card ul,
.xm-order-book-card ol,
.xm-order-book-card li,
.xm-markets-card ul,
.xm-markets-card ol,
.xm-markets-card li,
.xm-trade-history-card ul,
.xm-trade-history-card ol,
.xm-trade-history-card li,
.xm-trade-card ul,
.xm-trade-card ol,
.xm-trade-card li,
.sell-side-order-list,
.buy-side-order-list,
.sell-side-order-list *,
.buy-side-order-list * {
    list-style: none !important;
    list-style-type: none !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
}

/* Tabular Numerals for Price Display (prevents jitter) */
.tabular-nums,
.xm-live-price-val,
.stat-value,
.xm-ob-row,
.btn-rate,
.metric-val {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* Custom Fluid Container */
.custom--container {
    max-width: 1720px !important;
    padding-left: 14px;
    padding-right: 14px;
    width: 100%;
}

/* Common Card Base */
.xm-master-ticker-bar,
.xm-order-book-card,
.xm-markets-card,
.xm-trade-history-card,
.xm-trade-card,
.trading-chart-wrapper,
.trading-table {
    background: var(--xm-bg-card) !important;
    border: 1px solid var(--xm-border-color) !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    color: var(--xm-text-primary);
}

/* ==========================================================================
   1. TOP MASTER TICKER BAR
   ========================================================================== */
.xm-master-ticker-bar {
    padding: 10px 16px;
    transition: border-color 0.2s ease;
}

.xm-pair-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(240, 185, 11, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--xm-yellow);
    flex-shrink: 0;
}

.xm-pair-symbol-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.market-status-badge {
    font-size: 10px !important;
    padding: 2px 7px !important;
    border-radius: 10px !important;
    font-weight: 600;
}

.market-status-badge.bg-success {
    background: rgba(14, 203, 129, 0.18) !important;
    color: var(--xm-green) !important;
    border: 1px solid rgba(14, 203, 129, 0.3);
}

.market-status-badge.bg-warning {
    background: rgba(245, 158, 11, 0.18) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.xm-ticker-primary-price {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--xm-border-color);
    padding: 4px 14px;
    border-radius: 6px;
}

.xm-live-price-val {
    font-size: 20px;
    font-family: var(--xm-font-mono);
    line-height: 1.2;
    transition: color 0.15s ease;
}

.xm-ticker-metrics-row .ticker-stat-item {
    border-left: 1px solid var(--xm-border-color);
    padding-left: 16px;
}

.ticker-stat-item .stat-label {
    display: block;
    font-size: 10px;
    color: var(--xm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.1;
    margin-bottom: 2px;
}

.ticker-stat-item .stat-value {
    display: block;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--xm-font-mono);
    line-height: 1.2;
}

/* Tick flash animations */
.tick-up {
    color: var(--xm-green) !important;
    animation: flashGreen 0.6s ease-out;
}

.tick-down {
    color: var(--xm-red) !important;
    animation: flashRed 0.6s ease-out;
}

@keyframes flashGreen {
    0% { background-color: var(--xm-green-subtle); }
    100% { background-color: transparent; }
}

@keyframes flashRed {
    0% { background-color: var(--xm-red-subtle); }
    100% { background-color: transparent; }
}

/* ==========================================================================
   2. LIVE CANDLESTICK CHART AREA
   ========================================================================== */
.trading-chart-wrapper {
    overflow: hidden;
    position: relative;
}

.trading-chart {
    height: 550px !important;
    min-height: 550px !important;
    width: 100%;
    position: relative;
    background: #0f172a;
    border-radius: 8px;
    overflow: hidden;
}

/* Chart Header Overrides */
.xm-terminal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: #111827;
    border-bottom: 1px solid var(--xm-border-color);
    flex-wrap: nowrap;
    gap: 8px;
    z-index: 5;
}

.xm-timeframe-toolbar,
.xm-chart-type-toolbar {
    display: inline-flex;
    background: #1e293b;
    padding: 2px;
    border-radius: 5px;
    gap: 2px;
}

.xm-tf-btn,
.xm-type-btn {
    background: transparent;
    border: none;
    color: var(--xm-text-muted);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.xm-tf-btn:hover,
.xm-type-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.xm-tf-btn.active,
.xm-type-btn.active {
    background: #3b82f6 !important;
    color: #ffffff !important;
}

/* ==========================================================================
   3. ORDER BOOK (DOM) DEPTH OF MARKET
   ========================================================================== */
.xm-order-book-card {
    padding: 12px 14px;
}

.xm-ob-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.xm-ob-title {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.3px;
}

.xm-ob-tabs {
    display: flex;
    align-items: center;
}

.xm-ob-tabs .nav-link {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--xm-border-color);
    color: var(--xm-text-muted);
    border-radius: 4px;
    padding: 3px 8px;
    margin-left: 3px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.xm-ob-tabs .nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.xm-ob-tabs .nav-link.active {
    background: #2b313a !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
    color: #ffffff !important;
}

.xm-ob-header-row {
    font-size: 10px;
    font-weight: 600;
    color: var(--xm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--xm-border-subtle);
}

.xm-ob-ladder {
    max-height: 195px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
}

.xm-ob-ladder::-webkit-scrollbar {
    width: 3px;
}

.xm-ob-ladder::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}

.xm-ob-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 3px 6px !important;
    margin: 1px 0 !important;
    font-size: 11px !important;
    font-family: var(--xm-font-mono) !important;
    line-height: 1.25 !important;
    cursor: pointer !important;
    border-radius: 2px !important;
    user-select: none !important;
    transition: all 0.1s ease !important;
}

.xm-ob-row:hover {
    filter: brightness(1.25);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.xm-ob-row span {
    display: inline-block;
}

.xm-ob-mid-bar {
    background: var(--xm-bg-card-elevated) !important;
    border: 1px solid var(--xm-border-color) !important;
    padding: 6px 10px;
    margin: 4px 0;
    border-radius: 4px;
}

.xm-ob-mid-price {
    font-size: 15px;
    font-weight: 700;
    font-family: var(--xm-font-mono);
}

.xm-ob-spread-info {
    font-size: 11px;
}

/* ==========================================================================
   4. TRADE PLACEMENT PANEL (ORDER EXECUTION FORM)
   ========================================================================== */
.xm-trade-card {
    padding: 16px 18px;
}

.xm-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--xm-border-subtle);
}

.xm-card-header .pair-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.xm-card-header .pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--xm-green);
    box-shadow: 0 0 8px var(--xm-green);
    animation: xmPulseDot 1.8s infinite;
}

@keyframes xmPulseDot {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.xm-card-header .pair-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
}

.xm-card-header .spread-badge {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: var(--xm-blue);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.xm-order-type-nav {
    display: flex;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--xm-border-color);
    border-radius: 6px;
    padding: 2px;
    gap: 2px;
}

.xm-order-type-btn {
    background: transparent;
    border: none;
    color: var(--xm-text-muted);
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 4px;
    transition: all 0.15s ease;
    cursor: pointer;
}

.xm-order-type-btn:hover:not(.active) {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.xm-order-type-btn.active {
    background: #2b313a !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Rate inputs for Limit / Stop Limit */
.xm-pending-rates-row {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--xm-border-color);
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 12px;
}

/* Volume / Lot Stepper Section */
.xm-volume-section {
    margin-bottom: 14px;
}

.xm-volume-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.xm-contract-size-text {
    font-size: 12px;
    color: var(--xm-text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.xm-contract-size-text strong {
    color: var(--xm-text-primary);
}

.xm-lot-stepper {
    display: flex;
    align-items: center;
    background: var(--xm-bg-input);
    border: 1px solid var(--xm-border-color);
    border-radius: 6px;
    overflow: hidden;
    height: 44px;
    transition: border-color 0.15s ease;
}

.xm-lot-stepper:focus-within {
    border-color: var(--xm-yellow);
    box-shadow: 0 0 0 1px var(--xm-yellow);
}

.xm-stepper-btn {
    background: rgba(255, 255, 255, 0.04);
    border: none;
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    width: 48px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.xm-stepper-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--xm-yellow);
}

.xm-lot-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
}

.xm-lot-input {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    width: 110px;
    outline: none;
    font-family: var(--xm-font-mono);
}

.xm-lot-unit {
    color: var(--xm-text-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.xm-quick-chips-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.xm-lot-chip {
    flex: 1;
    min-width: 48px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--xm-border-color);
    color: var(--xm-text-muted);
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 2px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.xm-lot-chip:hover {
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.xm-lot-chip.active {
    background: rgba(240, 185, 11, 0.15);
    border-color: var(--xm-yellow);
    color: var(--xm-yellow);
    font-weight: 700;
}

/* Telemetry Box Grid */
.xm-telemetry-box {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.xm-telemetry-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--xm-border-color);
    border-radius: 6px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.xm-telemetry-item .label {
    font-size: 10px;
    font-weight: 600;
    color: var(--xm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.xm-telemetry-item .value {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    font-family: var(--xm-font-mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dual 1-Click Execution Buttons */
.xm-dual-action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.xm-btn-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 14px;
    border-radius: 8px;
    border: none;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    outline: none;
}

.xm-btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.xm-btn-action:active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.xm-btn-action:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.xm-btn-sell {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
}

.xm-btn-sell:hover {
    background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
    box-shadow: 0 0 16px var(--xm-red-glow);
}

.xm-btn-buy {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
}

.xm-btn-buy:hover {
    background: linear-gradient(135deg, #34d399 0%, #059669 100%);
    box-shadow: 0 0 16px var(--xm-green-glow);
}

.xm-btn-action .btn-title {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.5px;
    line-height: 1.1;
    margin-bottom: 2px;
}

.xm-btn-action .btn-rate {
    font-size: 17px;
    font-weight: 800;
    font-family: var(--xm-font-mono);
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.xm-btn-action .btn-volume-sub {
    font-size: 11px;
    opacity: 0.85;
    font-weight: 500;
    margin-top: 2px;
}

/* ==========================================================================
   5. MARKETS WATCHLIST WIDGET
   ========================================================================== */
.xm-markets-card {
    padding: 12px 14px;
}

.xm-markets-header {
    margin-bottom: 8px;
}

.xm-markets-title {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.3px;
}

.xm-market-chips-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.xm-market-chips-scroll {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    gap: 6px !important;
    padding: 2px 0 6px 0 !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.xm-market-chips-scroll::-webkit-scrollbar {
    height: 3px;
}

.xm-market-chips-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}

.xm-market-chip {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    background: #1e2430;
    border: 1px solid var(--xm-border-color);
    color: var(--xm-text-muted);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    outline: none;
}

.xm-market-chip:hover {
    color: #ffffff;
    background: #272f3e;
    border-color: rgba(255, 255, 255, 0.16);
}

.xm-market-chip.active {
    background: var(--xm-yellow) !important;
    color: #0b0e14 !important;
    border-color: var(--xm-yellow) !important;
    font-weight: 700 !important;
}

.xm-markets-table-header {
    font-size: 10px;
    font-weight: 600;
    color: var(--xm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--xm-border-subtle);
}

.xm-markets-list-container {
    max-height: 250px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
}

.xm-markets-list-container::-webkit-scrollbar {
    width: 4px;
}

.xm-markets-list-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}

.xm-market-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    border-bottom: 1px solid var(--xm-border-subtle);
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.12s ease;
    border-radius: 4px;
}

.xm-market-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.xm-market-pct-badge {
    min-width: 54px;
    padding: 2px 5px !important;
    font-size: 11px !important;
    font-family: var(--xm-font-mono);
    text-align: right;
}

/* ==========================================================================
   6. MARKET TRADES STREAM
   ========================================================================== */
.xm-trade-history-card {
    padding: 12px 14px;
}

.xm-th-title {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
}

.xm-th-header {
    font-size: 10px;
    font-weight: 600;
    color: var(--xm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.xm-th-list-container {
    max-height: 220px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
}

.xm-th-list-container::-webkit-scrollbar {
    width: 4px;
}

.xm-th-list-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}

.xm-th-row {
    font-family: var(--xm-font-mono);
    font-size: 11px;
    border-bottom: 1px solid var(--xm-border-subtle);
}

.xm-th-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* ==========================================================================
   7. ACCOUNT SUMMARY STRIP & POSITIONS TABLE
   ========================================================================== */
.trading-table {
    padding: 16px;
}

.account-summary-bar {
    background: var(--xm-bg-card-elevated);
    border: 1px solid var(--xm-border-color);
}

.summary-metric .metric-title {
    color: var(--xm-text-muted);
}

.summary-metric .metric-val {
    font-family: var(--xm-font-mono);
}

/* Tabs */
.custom--tab .nav-link {
    background: transparent !important;
    color: var(--xm-text-muted) !important;
    font-weight: 500;
    border-radius: 6px !important;
    padding: 5px 12px !important;
    font-size: 12px;
    transition: all 0.15s ease;
}

.custom--tab .nav-link:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.04) !important;
}

.custom--tab .nav-link.active {
    background: #2b313a !important;
    color: var(--xm-yellow) !important;
    font-weight: 600;
}

/* Form Controls & Inputs */
.form--control,
.form-control {
    background-color: var(--xm-bg-input) !important;
    border: 1px solid var(--xm-border-color) !important;
    color: #ffffff !important;
    border-radius: 6px !important;
    font-size: 13px;
}

.form--control:focus,
.form-control:focus {
    border-color: var(--xm-yellow) !important;
    box-shadow: 0 0 0 0.2rem rgba(240, 185, 11, 0.15) !important;
}

/* Data Table */
.table-two {
    color: var(--xm-text-primary) !important;
    margin-bottom: 0;
}

.table-two th {
    background: var(--xm-bg-card-elevated) !important;
    color: var(--xm-text-muted) !important;
    font-size: 11px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--xm-border-color) !important;
    padding: 9px 12px !important;
    font-weight: 600;
}

.table-two td {
    border-bottom: 1px solid var(--xm-border-subtle) !important;
    padding: 8px 12px !important;
    vertical-align: middle !important;
    font-size: 12px !important;
    font-family: var(--xm-font-mono);
}

.table-two tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Helpers */
.text--success, .up { color: var(--xm-green) !important; }
.text--danger, .down { color: var(--xm-red) !important; }
.text--warning { color: var(--xm-yellow) !important; }
.text--info { color: var(--xm-blue) !important; }

/* ==========================================================================
   8. BUY / SELL DUAL FORMS & RANGE SLIDER SYSTEM
   ========================================================================== */
.order-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 991px) {
    .order-wrapper {
        grid-template-columns: 1fr;
    }
}

.buy-sell-form {
    background: var(--xm-bg-card);
    border: 1px solid var(--xm-border-color);
    border-radius: 8px;
    padding: 16px;
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.buy-sell__wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--xm-border-subtle);
}

.buy-sell__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--xm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.buy-sell__price {
    margin-bottom: 12px;
}

.input--group {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--xm-bg-input);
    border: 1px solid var(--xm-border-color);
    border-radius: 6px;
    padding: 0 10px;
    transition: all 0.2s ease;
}

.input--group:focus-within {
    border-color: var(--xm-yellow);
    box-shadow: 0 0 0 2px rgba(240, 185, 11, 0.15);
}

.input--group .buy-sell__price-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--xm-text-muted);
    text-transform: uppercase;
    min-width: 50px;
}

.input--group .buy-sell__price-btc {
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    margin-left: auto;
    order: 3;
    padding-left: 6px;
}

.input--group input.form--control,
.input--group input.form-control {
    background: transparent !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: none !important;
    font-family: var(--xm-font-mono);
    font-size: 13px;
    font-weight: 600;
    height: 38px;
    padding: 6px 8px;
    flex: 1;
    order: 2;
    text-align: right;
}

/* Range Slider - High Contrast Dark Mode */
.custom--range {
    padding: 8px 0 14px 0 !important;
    position: relative;
}

.custom--range .slider-range,
.custom--range__range.slider-range {
    height: 6px !important;
    background: #1e2430 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 3px !important;
    position: relative;
    cursor: pointer;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.custom--range .ui-slider-range,
.custom--range .ui-widget-header {
    background: linear-gradient(90deg, #f0b90b 0%, #f59e0b 100%) !important;
    border-radius: 3px !important;
    height: 100% !important;
}

.custom--range .ui-slider-handle {
    width: 16px !important;
    height: 16px !important;
    background: #ffffff !important;
    border: 3px solid #f0b90b !important;
    border-radius: 50% !important;
    top: -5px !important;
    margin-left: -8px !important;
    cursor: grab !important;
    outline: none !important;
    box-shadow: 0 0 10px rgba(240, 185, 11, 0.5) !important;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    z-index: 5 !important;
}

.custom--range .ui-slider-handle:hover,
.custom--range .ui-slider-handle:active {
    transform: scale(1.15);
    box-shadow: 0 0 14px rgba(240, 185, 11, 0.8) !important;
}

/* Percentage Marks / Chips (Zero Bullets) */
.range-list {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    list-style: none !important;
    list-style-type: none !important;
    padding: 0 !important;
    margin: 8px 0 0 0 !important;
    width: 100% !important;
}

.range-list li,
.range-list__number {
    list-style: none !important;
    list-style-type: none !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    color: var(--xm-text-muted) !important;
    cursor: pointer !important;
    padding: 3px 8px !important;
    border-radius: 4px !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    transition: all 0.15s ease !important;
    user-select: none !important;
}

.range-list__number:hover,
.range-list__number.active {
    color: #ffffff !important;
    background: rgba(240, 185, 11, 0.18) !important;
    border-color: rgba(240, 185, 11, 0.4) !important;
}

.range-list__number span {
    display: none !important; /* Hide old crooked rotated squares */
}

/* Order Execution Buttons */
.buy-btn,
.btn--base-two.buy-btn {
    background: linear-gradient(135deg, #0ecb81 0%, #0bbb75 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    height: 42px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 4px 14px rgba(14, 203, 129, 0.3) !important;
    transition: all 0.15s ease !important;
}

.buy-btn:hover {
    background: linear-gradient(135deg, #0bbb75 0%, #089c61 100%) !important;
    box-shadow: 0 6px 18px rgba(14, 203, 129, 0.45) !important;
    transform: translateY(-1px);
}

.sell-btn,
.btn--danger.sell-btn {
    background: linear-gradient(135deg, #f6465d 0%, #e03e54 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    height: 42px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 4px 14px rgba(246, 70, 93, 0.3) !important;
    transition: all 0.15s ease !important;
}

.sell-btn:hover {
    background: linear-gradient(135deg, #e03e54 0%, #c92f44 100%) !important;
    box-shadow: 0 6px 18px rgba(246, 70, 93, 0.45) !important;
    transform: translateY(-1px);
}

/* ==========================================================================
   9. MOBILE SEGMENTED BAR & COMPREHENSIVE RESPONSIVENESS
   ========================================================================== */
.xm-mobile-nav-pills {
    background: var(--xm-bg-card);
    border: 1px solid var(--xm-border-color);
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    position: sticky;
    top: 0;
    z-index: 100;
}

.xm-mobile-nav-pills::-webkit-scrollbar {
    display: none;
}

.xm-mobile-tab-btn {
    flex: 1;
    min-width: 68px;
    padding: 7px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--xm-text-muted);
    background: transparent;
    border: none;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
    transition: all 0.15s ease;
    cursor: pointer;
}

.xm-mobile-tab-btn i {
    font-size: 13px;
}

.xm-mobile-tab-btn.active {
    background: var(--xm-bg-card-elevated);
    color: var(--xm-yellow);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(240, 185, 11, 0.25);
}

@media (max-width: 991px) {
    .xm-master-ticker-bar {
        padding: 10px 14px;
    }
    
    .trading-chart {
        height: 380px !important;
        min-height: 380px !important;
    }
    
    .xm-telemetry-box {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .xm-ticker-metrics-row .ticker-stat-item {
        padding-left: 10px;
    }

    /* On mobile, cards get clean bottom spacing */
    .trading-chart-wrapper,
    .trading-order-form-wrapper,
    .trading-orders-wrapper,
    .xm-order-book-card,
    .xm-markets-card,
    .xm-trade-history-card {
        margin-bottom: 8px;
    }

    /* Allow horizontal scrolling on positions data tables without breaking container */
    .trading-table .table-responsive {
        border-radius: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 767px) {
    .trading-chart {
        height: 340px !important;
        min-height: 340px !important;
    }

    .xm-master-ticker-bar {
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px;
    }

    .xm-ticker-metrics-row {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px !important;
        width: 100%;
        background: rgba(255, 255, 255, 0.02);
        padding: 8px 10px;
        border-radius: 6px;
        border: 1px solid var(--xm-border-subtle);
    }

    .ticker-stat-item {
        border-left: none !important;
        padding-left: 0 !important;
    }

    /* Mobile Trade Order Placement Card Optimization (< 768px) */
    .xm-trade-card {
        padding: 12px 10px !important;
    }

    .xm-card-header {
        margin-bottom: 8px !important;
        padding-bottom: 8px !important;
    }

    .xm-volume-section {
        margin-bottom: 8px !important;
    }

    .xm-lot-stepper {
        height: 42px !important;
    }

    .xm-stepper-btn {
        width: 44px !important;
        font-size: 18px !important;
    }

    .xm-lot-input {
        font-size: 15px !important;
    }

    .xm-lot-chip {
        min-width: 40px !important;
        padding: 6px 4px !important;
        font-size: 11px !important;
    }

    .xm-telemetry-box {
        gap: 6px !important;
        margin-bottom: 10px !important;
    }

    .xm-telemetry-item {
        padding: 6px 8px !important;
    }

    .xm-telemetry-item .label {
        font-size: 10px !important;
    }

    .xm-telemetry-item .value {
        font-size: 12px !important;
    }

    /* Keep BUY and SELL side-by-side on mobile so both are immediately visible */
    .xm-dual-action-row {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        margin-bottom: 8px !important;
    }

    .xm-btn-action {
        padding: 8px 10px !important;
        min-height: 50px !important;
    }

    .xm-btn-action .btn-title {
        font-size: 14px !important;
        font-weight: 800 !important;
        gap: 4px !important;
    }

    .xm-btn-action .btn-rate {
        font-size: 13px !important;
        font-weight: 700 !important;
        margin-top: 1px !important;
    }

    .xm-btn-action .btn-volume-sub {
        font-size: 9px !important;
        opacity: 0.85 !important;
    }
}

@media (max-width: 575px) {
    .custom--container {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .xm-pair-symbol-title {
        font-size: 16px;
    }

    .xm-live-price-val {
        font-size: 16px;
    }

    .xm-order-type-btn {
        padding: 5px 8px;
        font-size: 11px;
    }

    .xm-telemetry-item {
        padding: 8px 10px;
    }

    .range-list__number {
        font-size: 10px !important;
        padding: 3px 6px !important;
    }
}

/* ==========================================================================
   10. POSITIONS & ORDERS TABLE RESPONSIVENESS (MOBILE & SMALL SCREENS)
   ========================================================================== */
.table-wrapper-two {
    max-height: 480px;
    overflow-y: auto;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
    min-width: 0 !important;
    border-radius: 6px;
    border: 1px solid var(--xm-border-subtle);
}

.table-wrapper-two table {
    width: 100% !important;
    min-width: 860px !important;
    white-space: nowrap !important;
    margin-bottom: 0 !important;
}

.table-wrapper-two th,
.table-wrapper-two td {
    white-space: nowrap !important;
}

.table-wrapper-two::-webkit-scrollbar {
    height: 5px;
    width: 5px;
}

.table-wrapper-two::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.table-wrapper-two::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

@media (max-width: 991px) {
    .trading-table {
        padding: 12px !important;
    }

    .account-summary-bar {
        padding: 12px 10px !important;
    }
}

@media (max-width: 767px) {
    .trading-table {
        padding: 10px !important;
    }

    .trading-table__header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }

    .trading-table__header .flex-between {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .trading-table__title {
        font-size: 15px !important;
        margin-bottom: 0 !important;
    }

    #pills-tabtwenty {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        scrollbar-width: none !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100% !important;
        padding-bottom: 4px !important;
        gap: 4px;
    }

    #pills-tabtwenty::-webkit-scrollbar {
        display: none !important;
    }

    #pills-tabtwenty .nav-item {
        flex-shrink: 0 !important;
    }

    #pills-tabtwenty .nav-link {
        font-size: 11px !important;
        padding: 5px 10px !important;
        white-space: nowrap !important;
    }

    /* Account Summary Bar: 2 Columns on Mobile with Card Appearance */
    .account-summary-bar {
        padding: 10px !important;
    }

    .account-summary-bar .row {
        --bs-gutter-x: 6px !important;
        --bs-gutter-y: 6px !important;
    }

    .summary-metric {
        background: rgba(255, 255, 255, 0.02) !important;
        border: 1px solid var(--xm-border-subtle) !important;
        border-radius: 6px !important;
        padding: 8px 10px !important;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .summary-metric .metric-title {
        font-size: 10px !important;
        letter-spacing: 0.3px;
        margin-bottom: 2px;
    }

    .summary-metric .metric-val {
        font-size: 13px !important;
    }

    .closePositionBtn {
        font-size: 11px !important;
        padding: 4px 10px !important;
        white-space: nowrap !important;
    }
}

@media (max-width: 575px) {
    .trading-table {
        padding: 8px !important;
    }

    .summary-metric .metric-title {
        font-size: 9px !important;
    }

    .summary-metric .metric-val {
        font-size: 12px !important;
    }

    .table-two th {
        padding: 7px 9px !important;
        font-size: 10px !important;
    }

    .table-two td {
        padding: 7px 9px !important;
        font-size: 11px !important;
    }
}

/* ==========================================================================
   11. PERSISTENT MOBILE TRADING BOTTOM BAR & VISIBILITY GUARANTEES
   ========================================================================== */
@media (max-width: 991px) {
    /* Prevent page content from being obscured by the fixed bottom trading bar */
    .trading-section {
        padding-bottom: 75px !important;
    }

    /* Guaranteed unconditional visibility of trade order form on small devices */
    #panel-trade,
    .trading-order-form-wrapper,
    .xm-trade-card {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Fixed Bottom Action Bar for 1-Tap Mobile Trading (Binance / Exness Pro style) */
    .xm-mobile-fixed-trading-bar {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 1050 !important;
        background: rgba(11, 14, 20, 0.95) !important;
        backdrop-filter: blur(14px) !important;
        -webkit-backdrop-filter: blur(14px) !important;
        border-top: 1px solid var(--xm-border-color) !important;
        padding: 8px 12px !important;
        display: flex !important;
        gap: 10px !important;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.55) !important;
    }

    .xm-mobile-bar-btn {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 8px 12px !important;
        border-radius: 6px !important;
        border: none !important;
        font-weight: 700 !important;
        cursor: pointer !important;
        min-height: 48px !important;
        transition: transform 0.1s ease, filter 0.15s ease !important;
        user-select: none !important;
    }

    .xm-mobile-bar-btn:active {
        transform: scale(0.97) !important;
    }

    .xm-mobile-bar-btn.xm-bar-sell {
        background: linear-gradient(135deg, #f6465d 0%, #d92942 100%) !important;
        color: #ffffff !important;
        box-shadow: 0 2px 10px rgba(246, 70, 93, 0.35) !important;
    }

    .xm-mobile-bar-btn.xm-bar-buy {
        background: linear-gradient(135deg, #0ecb81 0%, #0a9961 100%) !important;
        color: #ffffff !important;
        box-shadow: 0 2px 10px rgba(14, 203, 129, 0.35) !important;
    }

    .xm-mobile-bar-btn .bar-btn-title {
        font-size: 13px !important;
        font-weight: 800 !important;
        letter-spacing: 0.5px !important;
        line-height: 1.1 !important;
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
    }

    .xm-mobile-bar-btn .bar-btn-rate {
        font-size: 12px !important;
        font-family: var(--xm-font-mono) !important;
        opacity: 0.95 !important;
        margin-top: 2px !important;
    }
}

/* Pulse Highlight when Jumped/Switched to Trade Panel on Mobile */
.xm-trade-focus-pulse {
    animation: xmTradeFocus 1.6s ease-out !important;
}

@keyframes xmTradeFocus {
    0% {
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.8) !important;
        border-color: #38bdf8 !important;
    }
    40% {
        box-shadow: 0 0 25px 8px rgba(56, 189, 248, 0.55) !important;
        border-color: #38bdf8 !important;
    }
    100% {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
        border-color: var(--xm-border-color) !important;
    }
}

.active-focus {
    transform: scale(1.02);
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.4) !important;
}

/* ==========================================================================
   12. POSITION CLOSE ACTIONS & MODAL STYLES (PRO TRADING THEME)
   ========================================================================== */

/* High-Contrast Close Position Button in Table */
.closePositionBtn {
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.4px !important;
    padding: 5px 12px !important;
    border-radius: 5px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    text-transform: uppercase !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Loss / Negative PnL State */
.closePositionBtn.btn--danger,
.closePositionBtn.btn-danger {
    background: rgba(246, 70, 93, 0.2) !important;
    color: #ff6b81 !important;
    border: 1px solid rgba(246, 70, 93, 0.7) !important;
    box-shadow: 0 2px 8px rgba(246, 70, 93, 0.2) !important;
}

.closePositionBtn.btn--danger:hover,
.closePositionBtn.btn-danger:hover,
.closePositionBtn.btn--danger:focus,
.closePositionBtn.btn-danger:focus {
    background: linear-gradient(135deg, #f6465d 0%, #d92942 100%) !important;
    color: #ffffff !important;
    border-color: #f6465d !important;
    box-shadow: 0 4px 14px rgba(246, 70, 93, 0.55) !important;
    transform: translateY(-1px) !important;
}

/* Profit / Positive PnL State */
.closePositionBtn.btn--success,
.closePositionBtn.btn-success {
    background: rgba(14, 203, 129, 0.2) !important;
    color: #2ebd85 !important;
    border: 1px solid rgba(14, 203, 129, 0.7) !important;
    box-shadow: 0 2px 8px rgba(14, 203, 129, 0.2) !important;
}

.closePositionBtn.btn--success:hover,
.closePositionBtn.btn-success:hover,
.closePositionBtn.btn--success:focus,
.closePositionBtn.btn-success:focus {
    background: linear-gradient(135deg, #0ecb81 0%, #0ba366 100%) !important;
    color: #ffffff !important;
    border-color: #0ecb81 !important;
    box-shadow: 0 4px 14px rgba(14, 203, 129, 0.55) !important;
    transform: translateY(-1px) !important;
}

.closePositionBtn i {
    font-size: 13px !important;
}

/* Clean Cancel / Trash Icon in Table */
.table-two .delete-icon {
    width: 26px !important;
    height: 26px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 5px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #94a3b8 !important;
    font-size: 11px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    visibility: visible !important;
    opacity: 0.85 !important;
}

.table-two .delete-icon:hover {
    background: rgba(246, 70, 93, 0.25) !important;
    border-color: rgba(246, 70, 93, 0.6) !important;
    color: #f6465d !important;
    opacity: 1 !important;
    transform: scale(1.05) !important;
}

/* ==========================================================================
   MODAL DIALOG STYLES (#closePositionModal & #confirmationModal)
   ========================================================================== */
#closePositionModal .modal-dialog,
#confirmationModal .modal-dialog {
    max-width: 440px !important;
    margin: 1.75rem auto !important;
}

#closePositionModal .modal-content,
#confirmationModal .modal-content,
.custom--modal .modal-content {
    background: #121620 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8) !important;
    color: #eaecef !important;
    overflow: hidden !important;
}

#closePositionModal .modal-header,
#confirmationModal .modal-header,
.custom--modal .modal-header {
    background: #161c28 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 14px 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

#closePositionModal .modal-title,
#confirmationModal .modal-title,
.custom--modal .modal-title {
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    letter-spacing: 0.3px !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

#closePositionModal .modal-header .close,
#confirmationModal .modal-header .close,
.custom--modal .modal-header .close,
.custom--modal .btn-close {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #94a3b8 !important;
    width: 30px !important;
    height: 30px !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    font-size: 16px !important;
    line-height: 1 !important;
    transition: all 0.2s ease !important;
    opacity: 1 !important;
    cursor: pointer !important;
}

#closePositionModal .modal-header .close:hover,
#confirmationModal .modal-header .close:hover,
.custom--modal .modal-header .close:hover {
    background: rgba(246, 70, 93, 0.2) !important;
    border-color: rgba(246, 70, 93, 0.5) !important;
    color: #f6465d !important;
}

#closePositionModal .modal-body,
#confirmationModal .modal-body,
.custom--modal .modal-body {
    background: #121620 !important;
    padding: 20px !important;
    color: #eaecef !important;
}

#closePositionModal .position-close-preview {
    background: #161d2b !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    padding: 14px 16px !important;
}

#closePositionModal .position-close-preview .border-secondary {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

#closePositionModal .modal-footer,
#confirmationModal .modal-footer,
.custom--modal .modal-footer {
    background: #161c28 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 14px 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
}

/* Modal Confirm Buttons - Solid high-contrast glowing red */
#closePositionModal button[type="submit"],
#confirmationModal button[type="submit"],
.btn-confirm-close {
    background: linear-gradient(135deg, #f6465d 0%, #d92942 100%) !important;
    color: #ffffff !important;
    border: 1px solid #f6465d !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    padding: 8px 22px !important;
    border-radius: 6px !important;
    letter-spacing: 0.3px !important;
    box-shadow: 0 4px 14px rgba(246, 70, 93, 0.45) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#closePositionModal button[type="submit"]:hover,
#confirmationModal button[type="submit"]:hover,
.btn-confirm-close:hover {
    background: linear-gradient(135deg, #ff536a 0%, #ea324b 100%) !important;
    border-color: #ff536a !important;
    box-shadow: 0 6px 20px rgba(246, 70, 93, 0.65) !important;
    transform: translateY(-1px) !important;
    color: #ffffff !important;
}

#closePositionModal button[type="submit"]:active,
#confirmationModal button[type="submit"]:active,
.btn-confirm-close:active {
    transform: translateY(0) !important;
}

#closePositionModal button[type="submit"]:disabled,
#confirmationModal button[type="submit"]:disabled,
.btn-confirm-close:disabled {
    opacity: 0.7 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Modal Cancel / Dismiss Buttons */
#closePositionModal .modal-footer .btn-dark,
#closePositionModal .modal-footer .btn--dark,
#confirmationModal .modal-footer .btn-dark,
#confirmationModal .modal-footer .btn--dark,
.btn-cancel-modal {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #cbd5e1 !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    padding: 8px 18px !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

#closePositionModal .modal-footer .btn-dark:hover,
#closePositionModal .modal-footer .btn--dark:hover,
#confirmationModal .modal-footer .btn-dark:hover,
#confirmationModal .modal-footer .btn--dark:hover,
.btn-cancel-modal:hover {
    background: rgba(255, 255, 255, 0.16) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}



