/* ==========================================================================
   PICOQUANT - LIVE PURE CHART & VISUAL TRADING TERMINAL (DARK THEME)
   ========================================================================== */

#view-chart.workspace {
    padding-top: 0px !important;
    margin-top: 0px !important;
    gap: 8px !important;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}

/* 1. CONTROL HEADER BAR */
.chart-header-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: var(--bg-panel, #12161c);
    border: 1px solid var(--border-color, #2b3139);
    border-radius: 8px;
    margin: 1px 4px 0 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    flex-wrap: nowrap;
    gap: 8px;
}

.chart-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    flex: 1;
    min-width: 0;
}

.chart-control-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 0;
    min-width: 0;
}

.chart-ctrl-label {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted, #848e9c);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
}

.chart-ctrl-select {
    width: 100%;
    height: 30px;
    padding: 0 8px;
    background: #181d24;
    border: 1px solid #2b3139;
    color: #eaecef;
    font-size: 11.5px;
    font-weight: 600;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    min-width: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.chart-ctrl-select:focus {
    border-color: var(--color-yellow, #f0b90b);
}

/* Khung thời gian tích hợp trực tiếp trong Toolbar của Khung Chart */
.chart-tf-floating-bar,
.chart-tf-btn-group {
    display: inline-flex;
    align-items: center;
    background: #181d24;
    border: 1px solid #2b3139;
    border-radius: 4px;
    overflow: hidden;
    height: 24px;
    margin: 0 2px;
    box-shadow: none;
    position: static;
}

.chart-tf-floating-bar .tf-btn,
.chart-tf-btn-group .tf-btn {
    background: transparent;
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-muted, #848e9c);
    padding: 0 8px;
    height: 100%;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.chart-tf-floating-bar .tf-btn:last-child,
.chart-tf-btn-group .tf-btn:last-child {
    border-right: none;
}

.chart-tf-floating-bar .tf-btn:hover,
.chart-tf-btn-group .tf-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.chart-tf-floating-bar .tf-btn.active,
.chart-tf-btn-group .tf-btn.active {
    background: var(--color-yellow, #f0b90b);
    color: #000;
    font-weight: 800;
}

/* Header Right */
.chart-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.chart-price-control-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
    justify-content: center;
}

.chart-price-box-wrapper {
    display: flex;
    align-items: center;
    height: 32px;
    padding: 0 12px;
    background: #181d24;
    border: 1px solid #2b3139;
    border-radius: 4px;
    box-sizing: border-box;
}

.chart-price-val {
    font-size: 13.5px;
    font-weight: 800;
    color: #10b981;
    font-family: 'JetBrains Mono', 'Roboto Mono', monospace;
    letter-spacing: 0.5px;
}

.btn-chart-order-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, rgba(240, 185, 11, 0.2), rgba(245, 158, 11, 0.1));
    border: 1px solid rgba(240, 185, 11, 0.4);
    color: var(--color-yellow, #f0b90b);
    font-size: 11.5px;
    font-weight: 700;
    padding: 0 12px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-chart-fullscreen {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color, #2b3139);
    color: var(--text-muted, #848e9c);
    font-size: 11px;
    font-weight: 700;
    padding: 0 10px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-chart-fullscreen:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
}

.btn-chart-fullscreen.is-active {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.4);
    color: #38bdf8;
}

.btn-chart-order-toggle:hover {
    background: var(--color-yellow, #f0b90b);
    color: #000;
    box-shadow: 0 0 12px rgba(240, 185, 11, 0.4);
}

/* ==========================================================================
   CHẾ ĐỘ PHÓNG TO TOÀN MÀN HÌNH (EXPANDED FULLSCREEN WORKSPACE)
   ========================================================================== */
#view-chart.is-maximized {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    min-height: 100vh !important;
    z-index: 99999 !important;
    background: var(--bg-main, #0b0e11) !important;
    padding: 8px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
}

#view-chart.is-maximized .chart-header-panel {
    margin: 0 0 4px 0 !important;
    padding: 4px 10px !important;
    flex-shrink: 0 !important;
}

#view-chart.is-maximized .chart-workspace-full {
    flex: 1 1 auto !important;
    height: calc(100% - 48px) !important;
    min-height: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

#view-chart.is-maximized .chart-main-canvas-panel {
    flex: 1 1 auto !important;
    height: 100% !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 8px 12px 10px 12px !important;
}

#view-chart.is-maximized .chart-canvas-header {
    flex-shrink: 0 !important;
    padding-bottom: 6px !important;
    margin-bottom: 4px !important;
}

#view-chart.is-maximized .chart-ohlc-bar {
    flex-shrink: 0 !important;
    padding: 2px 8px !important;
    margin-bottom: 4px !important;
}

#view-chart.is-maximized .chart-canvas-wrapper {
    flex: 1 1 auto !important;
    height: 100% !important;
    min-height: 350px !important;
    position: relative !important;
    width: 100% !important;
}

#view-chart.is-maximized .live-chart-container {
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
}

#view-chart.is-maximized .chart-orders-panel {
    display: none !important;
}

/* Nút Action Toolbar trong Khung Canvas */
.btn-chart-toolbar-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color, #2b3139);
    color: var(--text-muted, #848e9c);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-chart-toolbar-action:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-chart-toolbar-action.is-active {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.4);
    color: #38bdf8;
}

.btn-chart-toolbar-action.btn-multichart-toggle {
    background: rgba(240, 185, 11, 0.08);
    border-color: rgba(240, 185, 11, 0.25);
    color: var(--color-yellow, #f0b90b);
}

.btn-chart-toolbar-action.btn-multichart-toggle:hover {
    background: rgba(240, 185, 11, 0.18);
    border-color: rgba(240, 185, 11, 0.5);
    color: #fff;
}

.btn-chart-toolbar-action.btn-multichart-toggle.is-active {
    background: var(--color-yellow, #f0b90b);
    border-color: var(--color-yellow, #f0b90b);
    color: #000;
    box-shadow: 0 0 10px rgba(240, 185, 11, 0.4);
}

/* ==========================================================================
   MULTI-CHART GRID PANEL STYLES (ĐA BIỂU ĐỒ)
   ========================================================================== */
.chart-multi-grid-panel {
    display: flex;
    flex-direction: column;
    background: var(--bg-panel, #12161c);
    border: 1px solid var(--border-color, #2b3139);
    border-radius: 8px;
    padding: 10px 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    width: 100%;
    box-sizing: border-box;
    min-height: 520px;
}

#view-chart.is-maximized .chart-multi-grid-panel {
    flex: 1 1 auto !important;
    height: 100% !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 8px 12px 10px 12px !important;
    overflow: hidden !important;
}

.multi-grid-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color, #2b3139);
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
}

.multi-grid-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 800;
}

.multi-grid-badge {
    font-size: 9.5px;
    font-weight: 800;
    color: var(--color-yellow, #f0b90b);
    background: rgba(240, 185, 11, 0.12);
    border: 1px solid rgba(240, 185, 11, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.multi-grid-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.multi-tf-group {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.25);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.multi-tf-label {
    font-size: 9.5px;
    font-weight: 700;
    color: var(--text-muted, #848e9c);
    margin-right: 2px;
}

.btn-multi-tf {
    background: transparent;
    border: none;
    color: var(--text-muted, #848e9c);
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-multi-tf:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.btn-multi-tf.active {
    background: var(--color-yellow, #f0b90b);
    color: #000;
    font-weight: 800;
}

.multi-chart-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    overflow-y: auto;
    padding-right: 2px;
}

#view-chart.is-maximized .multi-chart-cards-grid {
    flex: 1 1 auto !important;
    height: calc(100% - 44px) !important;
    max-height: calc(100% - 44px) !important;
    min-height: 0 !important;
    overflow-y: auto !important;
}

@media (max-width: 1280px) {
    .multi-chart-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .multi-chart-cards-grid {
        grid-template-columns: 1fr;
    }
}

.multi-chart-card {
    background: #181d24;
    border: 1px solid var(--border-color, #2b3139);
    border-radius: 6px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    min-height: 250px;
}

.multi-chart-card:hover {
    border-color: rgba(240, 185, 11, 0.4);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.multi-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 6px;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.multi-card-sym-info {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.multi-card-symbol {
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.3px;
}

.multi-card-price {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 800;
    color: #10b981;
    padding: 1px 4px;
    border-radius: 3px;
    background: rgba(16, 185, 129, 0.1);
}

.multi-card-change {
    font-size: 11px;
    font-weight: 700;
}
.multi-card-change.positive { color: #10b981; }
.multi-card-change.negative { color: #ef4444; }

.multi-card-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-card-expand {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted, #848e9c);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    height: 22px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-card-expand:hover {
    background: var(--color-yellow, #f0b90b);
    border-color: var(--color-yellow, #f0b90b);
    color: #000;
}

.multi-card-canvas {
    width: 100%;
    height: 200px;
    min-height: 180px;
    position: relative;
    flex: 1 1 auto;
}

.btn-chart-refresh {
    background: #181d24;
    border: 1px solid #2b3139;
    color: var(--text-muted, #848e9c);
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    font-size: 11px;
}

.btn-chart-refresh:hover {
    background: #2b3139;
    color: #fff;
    transform: rotate(45deg);
}

/* 2. FULL WORKSPACE GRID */
.chart-workspace-full {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0 4px;
    box-sizing: border-box;
}

.chart-main-canvas-panel {
    display: flex;
    flex-direction: column;
    background: var(--bg-panel, #12161c);
    border: 1px solid var(--border-color, #2b3139);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    position: relative;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.chart-canvas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px solid #2b3139;
    margin-bottom: 6px;
    flex-wrap: wrap;
    gap: 10px;
}

.chart-canvas-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #fff;
    flex-wrap: wrap;
}

.chart-canvas-title strong#chartTitleSymbol {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.3px;
    color: #ffffff;
}

.chart-canvas-title .chart-price-val {
    font-size: 13.5px;
    font-weight: 800;
    color: #10b981;
    font-family: 'JetBrains Mono', 'Roboto Mono', monospace;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 4px;
    line-height: 1.2;
}

.chart-canvas-title .btn-chart-refresh {
    background: #181d24;
    border: 1px solid #2b3139;
    color: var(--text-muted, #848e9c);
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    font-size: 11px;
}

.chart-canvas-title .btn-chart-refresh:hover {
    background: #2b3139;
    color: #fff;
    transform: rotate(45deg);
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0ecb81;
}

.pulse-dot {
    animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(14, 203, 129, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(14, 203, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(14, 203, 129, 0); }
}

.chart-badge-exchange {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
}

.chart-badge-strat {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
}

/* Indicators toolbar */
.chart-indicator-toggles {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.chart-toggle-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-muted, #848e9c);
    cursor: pointer;
    user-select: none;
}

.chart-toggle-item input[type="checkbox"] {
    accent-color: var(--color-yellow, #f0b90b);
    cursor: pointer;
}

.ind-color-box {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    display: inline-block;
}

.ind-ema7  { background: #f59e0b; }
.ind-ema25 { background: #3b82f6; }
.ind-ema99 { background: #ec4899; }
.ind-boll  { background: #06b6d4; }
.ind-vol   { background: #26a69a; }

/* OHLC hover bar */
.chart-ohlc-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 4px 8px;
    background: rgba(24, 29, 36, 0.6);
    border-radius: 4px;
    font-size: 11.5px;
    font-family: 'JetBrains Mono', 'Roboto Mono', monospace;
    color: var(--text-muted, #848e9c);
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.ohlc-item strong {
    color: #fff;
    margin-left: 3px;
}

.text-green { color: #10b981 !important; }
.text-red   { color: #ef4444 !important; }
.text-yellow{ color: #f59e0b !important; }

/* Canvas Container & Wrapper */
.chart-canvas-wrapper {
    position: relative !important;
    width: 100% !important;
    box-sizing: border-box;
}

.live-chart-container {
    width: 100%;
    height: 440px;
    min-height: 380px;
    position: relative;
}

/* ==========================================================================
   3. VISUAL TRADING TERMINAL OVERLAY PANEL (ĐẶT BÊN TRÁI BIỂU ĐỒ)
   ========================================================================== */

.chart-order-overlay {
    position: absolute;
    top: 14px;
    left: 18px; /*  ĐẶT BẢNG ĐIỀU KHIỂN SANG BÊN TRÁI */
    right: auto;
    width: 290px;
    max-height: calc(100% - 28px);
    overflow-y: auto;
    z-index: 30;
    background: rgba(18, 22, 28, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    padding: 12px;
    box-sizing: border-box;
    opacity: 0.35;
    transition: opacity 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    user-select: none;
}

.chart-order-overlay:hover,
.chart-order-overlay:focus-within,
.chart-order-overlay.is-focused,
.chart-order-overlay.is-active {
    opacity: 1.0;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

/* Mobile Drag Handle inside sheet */
.sheet-drag-handle {
    display: none;
    width: 100%;
    padding: 4px 0 10px 0;
    cursor: grab;
    align-items: center;
    justify-content: center;
}

.sheet-drag-pill {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.3);
}

/* Header */
.chart-order-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 10px;
}

.chart-order-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.5px;
}

.chart-order-icon {
    color: var(--color-yellow, #f0b90b);
}

.chart-order-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-order-action-icon {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.btn-order-action-icon:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.btn-close-order-mobile {
    display: none;
}

/* Mode Switch (MỞ LỆNH vs ĐÓNG LỆNH) & Side Switch */
.order-mode-switch,
.order-side-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 10px;
}

.mode-btn,
.side-btn {
    padding: 8px 4px;
    font-size: 12px;
    font-weight: 800;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.mode-btn.btn-mode-open.active,
.side-btn.btn-side-long.active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(5, 150, 105, 0.4));
    border-color: #10b981;
    color: #34d399;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.mode-btn.btn-mode-close.active,
.side-btn.btn-side-short.active {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(217, 119, 6, 0.4));
    border-color: #f59e0b;
    color: #fbbf24;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

/* Order Type Switch */
.order-type-switch {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    padding: 2px;
    margin-bottom: 10px;
}

.type-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 10.5px;
    font-weight: 700;
    padding: 5px 0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.type-btn.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* Inputs Group */
.order-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.order-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
}

/* Order Unit Switch (USDT vs COIN) */
.order-unit-switch {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 1px;
    gap: 2px;
}

.unit-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.2;
}

.unit-btn:hover {
    color: #fff;
}

.unit-btn.active {
    background: rgba(240, 185, 11, 0.22);
    color: var(--color-yellow, #f0b90b);
    border: 1px solid rgba(240, 185, 11, 0.45);
}

.order-balance-hint {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 9.5px;
    color: #64748b;
    margin-top: 3px;
}

.order-balance-hint strong {
    color: #94a3b8;
    font-family: 'JetBrains Mono', monospace;
}

/* Vị thế đang nắm giữ khi ở tab Đóng Lệnh */
.order-held-pos-hint {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 5px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    font-size: 11px;
}

.held-pos-title {
    color: #94a3b8;
    font-size: 10px;
    font-weight: 600;
}

.held-pos-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.pos-tag {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10.5px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.2s;
    user-select: none;
    cursor: pointer;
}

.pos-tag-long {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
}
.pos-tag-long:hover {
    background: rgba(16, 185, 129, 0.3);
    border-color: #10b981;
}

.pos-tag-short {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
}
.pos-tag-short:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
}

.btn-pick-price {
    background: transparent;
    border: none;
    color: var(--color-yellow, #f0b90b);
    font-size: 9.5px;
    cursor: pointer;
    font-weight: 700;
    padding: 0;
}

.btn-pick-price:hover {
    text-decoration: underline;
}

.order-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.order-glass-input {
    width: 100%;
    height: 32px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 5px;
    color: #fff;
    padding: 0 45px 0 10px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'JetBrains Mono', 'Roboto Mono', monospace;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.order-glass-input:focus {
    border-color: var(--color-yellow, #f0b90b);
}

.order-input-suffix {
    position: absolute;
    right: 10px;
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
}

.order-quick-hint {
    font-size: 9px;
    color: #64748b;
}

/* Quick % Pills */
.order-quick-pct-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-top: 4px;
}

.pct-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 0;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s;
}

.pct-btn:hover {
    background: rgba(240, 185, 11, 0.2);
    color: var(--color-yellow, #f0b90b);
    border-color: rgba(240, 185, 11, 0.4);
}

/* Leverage Slider */
.order-lev-val {
    color: var(--color-yellow, #f0b90b);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.order-range-slider {
    width: 100%;
    height: 4px;
    accent-color: var(--color-yellow, #f0b90b);
    cursor: pointer;
}

.order-quick-lev-tags {
    display: flex;
    justify-content: space-between;
    margin-top: 3px;
}

.order-quick-lev-tags span {
    font-size: 9px;
    color: #64748b;
    font-weight: 700;
    cursor: pointer;
    padding: 1px 4px;
    border-radius: 2px;
}

.order-quick-lev-tags span:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* TP / SL Accordion */
.order-tpsl-section {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    margin-bottom: 10px;
    overflow: hidden;
}

.tpsl-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    font-size: 10.5px;
    font-weight: 700;
    color: #cbd5e1;
    cursor: pointer;
}

.tpsl-chevron {
    font-size: 8px;
    color: #64748b;
    transition: transform 0.2s;
}

.tpsl-content {
    padding: 8px 10px 10px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.tpsl-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.tpsl-col label {
    font-size: 9px;
    font-weight: 700;
    display: block;
    margin-bottom: 3px;
}

.text-green-lbl { color: #34d399; }
.text-red-lbl   { color: #f87171; }

.tpsl-hint {
    font-size: 9px;
    color: #848e9c;
    margin-top: 6px;
    line-height: 1.3;
}

/* Summary Box */
.order-summary-box {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 10.5px;
    color: #94a3b8;
}

.summary-row strong {
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
}

/* Execute Buttons Grid */
.order-exec-buttons-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 4px;
}

.btn-execute-order {
    width: 100%;
    height: 38px;
    border: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: #fff;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
    white-space: nowrap;
    padding: 0 4px;
}

.btn-exec-long {
    background: linear-gradient(135deg, #10b981, #059669);
}

.btn-exec-long:hover {
    background: linear-gradient(135deg, #34d399, #10b981);
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.5);
    transform: translateY(-1px);
}

.btn-exec-short {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.btn-exec-short:hover {
    background: linear-gradient(135deg, #f87171, #ef4444);
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.5);
    transform: translateY(-1px);
}

.is-side-long .btn-execute-order:not(.btn-exec-short) {
    background: linear-gradient(135deg, #10b981, #059669);
}

.is-side-short .btn-execute-order:not(.btn-exec-long) {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* Collapsed State */
.chart-order-overlay.is-collapsed {
    width: auto;
    padding: 6px 10px;
}

.chart-order-overlay.is-collapsed .chart-order-body {
    display: none;
}

.chart-order-overlay.is-collapsed .chart-order-header {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* 4. MOBILE SWIPE-UP BAR (Ẩn mặc định trên Desktop) */
.chart-mobile-swipe-bar {
    display: none;
}

/* ==========================================================================
   RESPONSIVE DESIGN CHO CÁC KÍCH THƯỚC MÀN HÌNH
   ========================================================================== */

@media (max-width: 1024px) {
    .chart-order-overlay {
        top: 10px;
        left: 10px; /*  GIỮ BÊN TRÁI CHO TABLET */
        right: auto;
        width: 270px;
    }
}

@media (max-width: 768px) {
    .live-chart-container {
        height: 380px;
        min-height: 340px;
    }

    .chart-tf-floating-bar,
    .chart-tf-btn-group {
        top: 6px;
        right: 55px;
    }

    .chart-tf-floating-bar .tf-btn,
    .chart-tf-btn-group .tf-btn {
        padding: 3px 7px;
        font-size: 10px;
    }

    .btn-chart-order-toggle {
        display: none;
    }

    /* Backdrop che mờ khi mở Bottom Sheet */
    /* Backdrop che mờ khi mở Bottom Sheet */
    .chart-mobile-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.55);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
        z-index: 840; /* Nằm dưới Footer (1000) và Bảng đặt lệnh (850) */
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.28s cubic-bezier(0.25, 1, 0.5, 1);
    }

    .chart-mobile-backdrop.is-active {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    .chart-workspace-full,
    .chart-main-canvas-panel,
    .chart-canvas-wrapper {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        filter: none !important;
        transform: none !important;
    }

    #view-chart.workspace {
        padding-bottom: 96px !important;
    }

    /* Bảng Đặt Lệnh Dính Đáy & Bottom Sheet trên Mobile (Nằm gọn dưới footer 42px) */
    .chart-order-overlay {
        position: fixed !important;
        top: auto !important;
        bottom: 42px !important; /* DÍNH NẰM CHUẨN XÁC TRÊN THANH FOOTER (42PX) KHÔNG ĐÈ LÊN FOOTER */
        left: 80px !important;
        right: 10px !important;
        width: auto !important;
        height: auto;
        max-height: calc(100vh - 85px);
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        border-radius: 14px 14px 0 0;
        border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
        background: rgba(18, 22, 28, 0.98);
        border: 1px solid rgba(255, 255, 255, 0.18);
        border-bottom: none !important;
        margin: 0 !important;
        margin-bottom: 0 !important;
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.85);
        padding: 4px 14px 10px 14px;
        transform: translateY(calc(100% - 92px));
        will-change: transform;
        transition: transform 0.3s cubic-bezier(0.2, 0.95, 0.3, 1), border-color 0.2s, box-shadow 0.2s, background 0.2s;
        z-index: 850 !important; /* Nằm dưới Footer (1000) */
        opacity: 1 !important;
        box-sizing: border-box;
        touch-action: pan-y;
    }

    /* Khi mở rộng: trượt toàn bộ nội dung lên màn hình và luôn nằm dưới footer */
    .chart-order-overlay.is-mobile-open {
        transform: translateY(0);
        overflow-y: auto;
        padding-bottom: 18px;
        border-color: rgba(240, 185, 11, 0.45);
        box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.95);
        z-index: 880 !important; /* Luôn nằm dưới Footer (1000) */
    }

    /* Nội dung chi tiết luôn render để kéo trượt 60fps mượt mà */
    .chart-order-overlay .order-form-details {
        display: block !important;
    }

    .chart-order-overlay.is-dragging {
        transition: none !important;
        will-change: transform;
        z-index: 880 !important;
    }

    .chart-order-overlay .order-mode-switch,
    .chart-order-overlay .order-side-switch {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-top: 2px;
        margin-bottom: 6px;
    }

    .chart-order-overlay.is-mobile-open .order-mode-switch,
    .chart-order-overlay.is-mobile-open .order-side-switch {
        margin-bottom: 8px;
    }

    .chart-order-overlay .order-exec-buttons-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-top: 6px;
    }

    .chart-order-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 2px 0 4px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        margin-bottom: 6px;
        cursor: pointer;
        touch-action: none;
        user-select: none;
    }

    .sheet-drag-handle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding: 2px 0 1px 0;
        cursor: grab;
        touch-action: none;
        user-select: none;
    }

    .sheet-drag-pill {
        width: 36px;
        height: 4px;
        border-radius: 2px;
        background: var(--color-yellow, #f0b90b);
        opacity: 0.85;
        animation: swipePillPulse 2s infinite ease-in-out;
    }

    @keyframes swipePillPulse {
        0%, 100% { transform: translateY(0); opacity: 0.6; }
        50% { transform: translateY(-2px); opacity: 1; box-shadow: 0 0 6px var(--color-yellow, #f0b90b); }
    }

    .chart-order-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 2px 0 2px 0;
        cursor: pointer;
        touch-action: none;
        user-select: none;
    }

    .chart-order-title {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 12px;
        font-weight: 800;
        letter-spacing: 0.5px;
    }

    .swipe-hint-badge {
        display: inline-flex;
        align-items: center;
        gap: 3px;
        font-size: 10px;
        color: var(--color-yellow, #f0b90b);
        font-weight: 700;
        background: rgba(240, 185, 11, 0.12);
        border: 1px solid rgba(240, 185, 11, 0.3);
        padding: 2px 6px;
        border-radius: 10px;
        margin-left: 4px;
    }

    .swipe-arrow {
        color: var(--color-yellow, #f0b90b);
        font-size: 9px;
        animation: bounceArrow 1.5s infinite;
    }

    @keyframes bounceArrow {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-3px); }
    }

    .chart-header-mobile-actions {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .btn-swipe-quick-long,
    .btn-swipe-quick-short {
        padding: 5px 12px;
        border: none;
        border-radius: 5px;
        color: #fff;
        font-size: 11px;
        font-weight: 800;
        cursor: pointer;
        transition: transform 0.15s, filter 0.15s;
    }

    .btn-swipe-quick-long:active,
    .btn-swipe-quick-short:active {
        transform: scale(0.96);
    }

    .btn-swipe-quick-long {
        background: linear-gradient(135deg, #10b981, #059669);
        box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    }

    .btn-swipe-quick-short {
        background: linear-gradient(135deg, #ef4444, #dc2626);
        box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    }

    /* Trạng thái hiển thị nút khi Đóng / Mở trên mobile */
    .chart-order-overlay:not(.is-mobile-open) .chart-header-mobile-actions {
        display: flex;
    }
    .chart-order-overlay:not(.is-mobile-open) .chart-order-actions {
        display: none;
    }
    .chart-order-overlay:not(.is-mobile-open) .swipe-hint-badge {
        display: inline-flex;
    }

    .chart-order-overlay.is-mobile-open .chart-header-mobile-actions {
        display: none;
    }
    .chart-order-overlay.is-mobile-open .chart-order-actions {
        display: flex;
    }
    .chart-order-overlay.is-mobile-open .swipe-hint-badge {
        display: none;
    }

    .btn-close-order-mobile {
        display: flex;
    }

    .btn-collapse-order {
        display: none;
    }
}

@media (max-width: 624px) {
    .chart-order-overlay {
        left: 48px !important;
        right: 4px !important;
        padding: 4px 8px 10px 8px;
    }
}

/* ==========================================================================
   5. CHART PENDING ORDERS QUEUE PANEL (BẢNG HÀNG ĐỢI LỆNH CHỜ DƯỚI CHART)
   ========================================================================== */

.chart-orders-panel {
    display: flex;
    flex-direction: column;
    background: var(--bg-panel, #12161c);
    border: 1px solid var(--border-color, #2b3139);
    border-radius: 8px;
    margin: 0 4px 12px 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
    z-index: 1;
    transition: all 0.2s ease;
}

.chart-orders-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(24, 29, 36, 0.7);
    border-bottom: 1px solid var(--border-color, #2b3139);
    flex-wrap: wrap;
    gap: 10px;
}

.chart-bottom-tabs-group {
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

.chart-bottom-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 5px 10px;
    cursor: pointer;
    color: var(--text-muted, #94a3b8);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.chart-bottom-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.chart-bottom-tab.active {
    color: #fff;
    background: rgba(240, 185, 11, 0.12);
    border-color: rgba(240, 185, 11, 0.35);
    box-shadow: 0 0 10px rgba(240, 185, 11, 0.15);
}

.chart-bottom-tab.active#tabBtnChartTrades {
    background: rgba(59, 130, 246, 0.14);
    border-color: rgba(59, 130, 246, 0.38);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.15);
}

.chart-tab-icon {
    font-size: 12px;
}

.chart-tab-title {
    text-transform: uppercase;
}

.chart-orders-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.2s ease;
}

.chart-orders-title-group:hover {
    opacity: 0.85;
}

.chart-orders-icon {
    font-size: 13px;
}

.chart-orders-title {
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-primary, #eaecef);
}

.chart-orders-badge-count {
    font-size: 10.5px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 10px;
    background: rgba(240, 185, 11, 0.15);
    color: var(--color-yellow, #f0b90b);
    border: 1px solid rgba(240, 185, 11, 0.35);
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.2;
}

.chart-orders-badge-count.trades-badge {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.35);
}

.trade-status-badge {
    font-size: 9.5px !important;
    font-weight: 800 !important;
}

.trade-id-tag {
    font-size: 10px;
    color: #64748b;
    font-family: 'JetBrains Mono', monospace;
    margin-left: 2px;
}

.chart-orders-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Checkbox Toggle: Chỉ xem cặp hiện tại / Toàn bộ */
.chart-orders-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 4px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.chart-orders-filter-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(240, 185, 11, 0.3);
}

.chart-orders-filter-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.filter-toggle-slider {
    position: relative;
    display: inline-block;
    width: 28px;
    height: 16px;
    background: #2b3139;
    border-radius: 16px;
    transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.filter-toggle-slider::before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 2px;
    bottom: 2px;
    background: #94a3b8;
    border-radius: 50%;
    transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.chart-orders-filter-toggle input:checked + .filter-toggle-slider {
    background: var(--color-yellow, #f0b90b);
}

.chart-orders-filter-toggle input:checked + .filter-toggle-slider::before {
    transform: translateX(12px);
    background: #000;
}

.filter-toggle-label {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
}

.filter-toggle-label strong {
    color: var(--color-yellow, #f0b90b);
    font-family: 'JetBrains Mono', monospace;
    margin-left: 2px;
}

.chart-orders-sort-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.chart-orders-select {
    height: 28px;
    padding: 0 8px;
    background: #181d24;
    border: 1px solid #2b3139;
    color: #eaecef;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.chart-orders-select:focus {
    border-color: var(--color-yellow, #f0b90b);
}

.btn-orders-sort-dir {
    background: #181d24;
    border: 1px solid #2b3139;
    color: #94a3b8;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    transition: all 0.2s;
}

.btn-orders-sort-dir:hover {
    background: #2b3139;
    color: #fff;
}

.btn-chart-orders-refresh {
    background: #181d24;
    border: 1px solid #2b3139;
    color: #94a3b8;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-chart-orders-refresh:hover {
    background: #2b3139;
    color: #fff;
    transform: rotate(45deg);
}

/* Danh sách thẻ lệnh chờ */
.chart-orders-card-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
    width: 100%;
    box-sizing: border-box;
    max-height: 480px;
    overflow-y: auto;
}

.chart-orders-panel.is-collapsed .chart-orders-card-grid {
    display: none !important;
}

.chart-orders-panel.is-collapsed .chart-orders-header {
    border-bottom: none;
}

.chart-orders-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px 16px;
    color: var(--text-muted, #848e9c);
    font-size: 12px;
    font-weight: 600;
    width: 100%;
}

.chart-orders-empty .empty-icon {
    font-size: 16px;
}

/* Responsive cho Orders Panel trên Mobile */
@media (max-width: 768px) {
    .chart-orders-panel {
        margin: 0 4px 10px 4px;
    }

    .chart-orders-header {
        padding: 8px 10px;
        gap: 8px;
    }

    .chart-orders-filters {
        width: 100%;
        justify-content: space-between;
        gap: 6px;
    }

    .chart-orders-filter-toggle {
        padding: 3px 8px;
    }

    .chart-orders-card-grid {
        padding: 8px 10px;
        max-height: 380px;
    }
}

/* ==========================================================================
   6. ORDER BOOK QUEUE CARDS & STRIPS (INSIDE CHART)
   ========================================================================== */
.live-order-card {
    background: #181d24;
    border: 1px solid var(--border-color, #2b3139);
    border-radius: 6px;
    padding: 10px 16px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    transition: background-color 0.2s, border-color 0.2s;
    position: relative;
}

.live-order-card:hover {
    background-color: #14181f;
    border-color: #38414e;
}

.live-order-card.live-border-long { border-left: 4px solid var(--color-green, #10b981); }
.live-order-card.live-border-short { border-left: 4px solid var(--color-red, #ef4444); }

.oc-left-group { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    flex-wrap: wrap; 
    width: 100%;
    justify-content: space-between;
    border-bottom: 1px dashed var(--border-color, #2a2e39);
    padding-bottom: 8px;
}

.oc-header-row-1, .oc-header-row-2 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.oc-symbol { 
    font-weight: 700; 
    font-size: 13.5px; 
    color: var(--text-primary, #eaecef); 
    margin-right: 4px; 
}

.oc-badge-ex {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--color-yellow, #f0b90b);
    background: rgba(240, 185, 11, 0.12);
    border: 1px solid rgba(240, 185, 11, 0.3);
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
}

.live-oc-side { 
    font-size: 10px; 
    font-weight: 700; 
    padding: 2px 8px; 
    border-radius: 4px; 
    text-transform: uppercase; 
}

.live-oc-side.bg-green { background: rgba(14, 203, 129, 0.15); color: var(--color-green, #10b981); border: 1px solid rgba(14, 203, 129, 0.3); }
.live-oc-side.bg-red { background: rgba(255, 101, 117, 0.15); color: var(--color-red, #ef4444); border: 1px solid rgba(255, 101, 117, 0.3); }
.live-oc-side.bg-yellow { background: rgba(240, 185, 11, 0.15); color: var(--color-yellow, #f0b90b); border: 1px solid rgba(240, 185, 11, 0.3); }

.oc-badge-yellow {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--color-yellow, #f0b90b);
    background: rgba(255, 208, 67, 0.15);
    border: 1px solid rgba(255, 208, 67, 0.3);
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
}

.live-oc-badge-gray {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--text-muted, #8b92a5);
    background: rgba(139, 146, 165, 0.15);
    border: 1px solid rgba(139, 146, 165, 0.3);
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
}

.btn-order-cancel {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(239, 68, 68, 0.14);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    line-height: inherit;
    text-transform: uppercase;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    outline: none;
    margin: 0;
    box-sizing: border-box;
}

.btn-order-cancel:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.45);
    transform: translateY(-1px);
}

.btn-order-cancel:active {
    transform: scale(0.95);
}

.btn-order-cancel-icon {
    font-size: 8.5px;
    font-weight: 900;
}

.oc-data-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    width: 100%;
}

.oc-item { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.oc-item:first-child { align-items: flex-start; }
.oc-item:first-child .live-o-trigger-box { text-align: left; }
.oc-label { font-size: 11px; color: var(--text-muted, #8b92a5); text-transform: uppercase; font-weight: 600; }
.oc-value { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-primary, #eaecef); }

@media (max-width: 624px) {
    .oc-left-group {
        display: grid;
        grid-template-columns: repeat(4, auto);
        justify-content: space-between;
        align-items: center;
        gap: 8px;
    }
    .live-order-card.is-collapsed .oc-data-group { display: none !important; }
    .oc-header-row-1, .oc-header-row-2 { justify-content: space-between; width: 100%; }
    .live-order-card { flex-direction: column; align-items: stretch; padding: 10px 12px; gap: 8px; }
}


