/* static/binance/styles/dark_mode.css - BẢN FULL 100% CỦA DARK_MODE_3 ĐÃ CĂN GIỮA & CHỐNG CẮT XÉN */

/* --- SYSTEM VARIABLES (Chuẩn WCAG AA 4.5:1) --- */
:root { --bg-main: #080a0c; --bg-panel: #0c0e12; --bg-header: #12161c;
        --border-color: #1c2026;
        --text-primary: #eaecef; --text-muted: #cbd5e1; --text-dim: #e2e8f0;     
        --color-green: #0ecb81; --color-red: #ff6575; --color-yellow: #ffd043; 
        --wallet-panel-height: 105px;
    }
/* --- BASE STYLES & CĂN GIỮA KHUNG 1400PX --- */
* { box-sizing: border-box; margin: 0; padding: 0;
    }
html { background-color: var(--bg-main) !important; display: flex !important;
    justify-content: center !important; width: 100% !important; height: 100%;
    min-height: 100vh !important; margin: 0;
    padding: 0;
    overflow-x: hidden !important; /* Chống tràn ngang */
    overflow-y: auto !important;   /* Cho phép cuộn trang toàn cục chuẩn */}

body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main); color: var(--text-primary);
    flex-direction: column !important;
    overflow-y: auto; overflow-x: hidden !important; letter-spacing: -0.2px;
    width: 100% !important;
   /* max-width: 1400px !important;  CO DÃN TỪ 0PX TỚI TỐI ĐA 1400PX */
    margin: 0 auto !important;     /* CĂN GIỮA BODY TUYỆT ĐỐI */height: 100%;
    margin: 0;
    padding: 0;display: flex !important;
    min-height: 100vh !important; /* Bắt buộc tối thiểu bằng chiều cao màn hình */
}

header { height: 48px; background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color); border-right: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; flex-shrink: 0; position: sticky; top: 0; z-index: 100;
    width: 100%; /*max-width: 1400px !important; */
    }
.brand { font-size: 14px; font-weight: 800; color: var(--color-yellow);
    display: flex; align-items: center; gap: 4px;
    }
.engine-status { display: flex; align-items: center; gap: 5px; font-size: 9px;
    color: var(--text-muted); font-weight: 500; 
    }
.pulse-dot { width: 5px; height: 5px; background-color: var(--color-green); border-radius: 50%;
     box-shadow: 0 0 6px var(--color-green); transition: transform 0.1s ease; 
    }
main { display: block; width: 100%; flex: 1 0 auto !important; /* Co giãn tự do để đẩy Footer xuống */
    }
.workspace { display: flex;flex: 1 0 auto !important; flex-direction: column; gap: 16px; padding: 16px 20px;
    width: 100%; margin: 0 auto; flex-shrink: 0;
    box-sizing: border-box;
    }
/* Khối nội dung ở giữa giãn tự do */
.main-workspace-content,
.workspace,
main {
    flex: 1 0 auto !important;
    overflow: visible !important; /* BẮT BỘC: Không dùng overflow hidden/auto ở đây làm hỏng Sticky Footer */
}
    /* 🟢 FIX: ÉP PANEL DÙNG OVERFLOW HIDDEN CHỐNG BẢNG TRÀN LỆNH */
.panel {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: visible !important; /* 👈 QUAN TRỌNG: Phải là visible thì position: sticky của header mới hoạt động! */
}
.panel-header { padding: 10px 14px; background-color: var(--bg-header); 
    border-bottom: 1px solid var(--border-color); 
    font-size: 11px; 
    font-weight: 600; 
    color: var(--text-primary); 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
    }
.sticky-wallet-panel {
    position: sticky !important;
    top: 48px !important; /* Ngay dưới Header chính 48px */
    z-index: 90 !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.7) !important;
}
.sticky-panel-header {
    position: sticky !important;
    /* Tự động tính toán: 48px (Header) + Chiều cao thực tế của Capital Panel */
    top: calc(48px + var(--wallet-panel-height, 105px)) !important;
    z-index: 80 !important;
    
    background-color: var(--bg-header) !important; /* Nền đục che lấp coin cuộn bên dưới */
    border-bottom: 1px solid var(--border-color) !important;
    border-top-left-radius: 7px !important;
    border-top-right-radius: 7px !important;
    
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.7) !important;
    margin: 0 !important;
    padding: 10px 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
.sticky-panel-header > span {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}
.grid-header { background-color: var(--bg-header); color: var(--text-muted); font-size: 11px; font-weight: 500; text-transform: uppercase; border-bottom: 1px solid var(--border-color); }
.grid-row { border-bottom: 1px solid #14181f; font-size: 12px;
    font-variant-numeric: tabular-nums; background-color: var(--bg-panel); transition: background-color 0.2s; }
.panel .grid-row:hover { background-color: #171b22; }

.grid-cell { padding: 10px 12px; text-align: right; display: flex; flex-direction: column; 
    justify-content: center; align-items: flex-end; }
.grid-cell.align-left { text-align: left; align-items: flex-start; }

.sym-block { font-weight: 700; color: #ffffff; font-size: 13.5px; }
.cell-stacked { display: flex; flex-direction: column; gap: 3px; width: 100%; }

.row-item { font-size: 12px; font-weight: 500; display: block; white-space: nowrap; }
.row-main { font-weight: 700; font-size: 12px; }

/* 🟢 CAPITAL GRID (>1024px: 8 CỘT CHỐNG PHÌNH SỐ DÀI) */
.risk-grid { 
    display: grid !important; 
    grid-template-columns: repeat(8, minmax(0, 1fr)) !important; 
    gap: 8px !important; 
    padding: 12px 14px; 
    width: 100% !important; 
    box-sizing: border-box !important;
}
.risk-card { 
    background-color: var(--bg-header); 
    border: 1px solid var(--border-color); 
    border-radius: 6px; 
    padding: 10px 12px; 
    display: flex; 
    flex-direction: column; 
    gap: 4px; 
    min-width: 0 !important;
    overflow: hidden !important;
}
.risk-card span { 
    font-size: 9px; 
    color: var(--text-muted); 
    text-transform: uppercase; 
    font-weight: 500; 
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
.risk-card strong { 
    font-size: 13.5px; 
    font-variant-numeric: tabular-nums; 
    color: var(--text-primary); 
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.clickable-th { cursor: pointer; user-select: none; transition: background-color 0.15s, color 0.15s; }
.clickable-th:hover { background-color: var(--border-color) !important; color: #ffffff !important; }
.sort-arrow { font-size: 10px; color: var(--color-yellow); margin-left: 2px; font-weight: 700; }

/* HIỆU ỨNG CHỚP NHÁY MÀU CHỮ MARK PRICE */
@keyframes tickUp { 
    0% { color: var(--color-green) !important; text-shadow: 0 0 8px rgba(14, 203, 129, 0.9); } 
    100% { color: #ffffff !important; text-shadow: none; } 
}
@keyframes tickDown { 
    0% { color: var(--color-red) !important; text-shadow: 0 0 8px rgba(255, 101, 117, 0.9); } 
    100% { color: #ffffff !important; text-shadow: none; } 
}
.tick-up { animation: tickUp 0.5s cubic-bezier(0.1, 0.8, 0.3, 1); }
.tick-down { animation: tickDown 0.5s cubic-bezier(0.1, 0.8, 0.3, 1); }

.green { color: var(--color-green) !important; } 
.red { color: var(--color-red) !important; } 
.yellow { color: var(--color-yellow) !important; }
.di-doi-col { color: #5e6673 !important; }

/* --- ORDER BOOK RESPONSIVE HORIZONTAL STRIPS --- */
.orders-card-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    width: 100%;
    overflow-x: auto !important;
}

.order-card {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    transition: background-color 0.2s, border-color 0.2s;
    position: relative;
}

.order-card:hover {
    background-color: #14181f;
    border-color: #2b3139;
}

.order-card.border-long { border-left: 4px solid var(--color-green); }
.order-card.border-short { border-left: 4px solid var(--color-red); }

.oc-left-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.oc-symbol { font-weight: 700; font-size: 13.5px; color: #fff; margin-right: 4px; }

.oc-side { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 4px; text-transform: uppercase; }
.oc-side.bg-green { background: rgba(14, 203, 129, 0.15); color: var(--color-green); border: 1px solid rgba(14, 203, 129, 0.3); }
.oc-side.bg-red { background: rgba(255, 101, 117, 0.15); color: var(--color-red); border: 1px solid rgba(255, 101, 117, 0.3); }

.oc-badge-yellow {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--color-yellow);
    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;
}

/* 🌟 KHỐI KPI LUÔN DÀN 3 CỘT NẰM NGANG TRÊN MỌI MÀN HÌNH (DESKTOP & MOBILE) */
.report-stats-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr) !important; /* CỐ ĐỊNH 3 CỘT */
    gap: 10px; 
    padding: 12px 14px; 
    width: 100%; 
}

.report-stats-card { 
    background-color: var(--bg-header); 
    border: 1px solid var(--border-color); 
    border-radius: 6px; 
    padding: 10px 12px; 
    display: flex; 
    flex-direction: column; 
    gap: 4px; 
    min-width: 0;
}

.stats-label { 
    font-size: 9.5px; 
    color: var(--text-muted); 
    font-weight: 700; 
    text-transform: uppercase; 
    letter-spacing: 0.3px; 
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stats-value { 
    font-size: 18px; 
    font-weight: 800; 
    font-variant-numeric: tabular-nums; 
    color: var(--text-primary); 
    white-space: nowrap;
}

.filter-group { 
    display: flex; 
    flex-direction: column; 
    gap: 4px; 
}

.filter-group label { 
    font-size: 10px; 
    color: var(--text-muted); 
    font-weight: 700; 
    text-transform: uppercase; 
}

/* Thẻ gom nhóm theo Symbol */
.symbol-block-card { 
    background-color: var(--bg-panel); 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    padding: 14px 16px; 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
}

.symbol-block-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 1px solid var(--border-color); 
    padding-bottom: 8px; 
}

.symbol-block-title { 
    font-weight: 800; 
    font-size: 14px; 
    color: var(--color-yellow); 
    display: flex; 
    align-items: center; 
    gap: 8px; 
}

.symbol-block-stats { 
    display: flex; 
    gap: 16px; 
    font-size: 12px; 
    font-weight: 600; 
    color: var(--text-muted); 
}

.log-flow-card { 
    padding: 10px 14px; 
    background-color: var(--bg-main); 
    border: 1px solid var(--border-color); 
    border-radius: 6px; 
    line-height: 1.6; 
    font-size: 12px; 
    color: var(--text-primary); 
    transition: all 0.2s; 
}

.log-flow-card:hover { 
    border-color: #2b3139; 
    background-color: #12161d; 
}

/* 📱 TINH CHỈNH TỰ ĐỘNG CO CHỮ KHI MÀN HÌNH NHỎ (≤ 512PX) */
@media (max-width: 512px) {
    .report-stats-grid { 
        gap: 6px !important; 
        padding: 8px 10px !important; 
    }
    .report-stats-card { 
        padding: 8px 6px !important; 
    }
    .stats-label { 
        font-size: 8px !important; 
    }
    .stats-value { 
        font-size: 13.5px !important; 
    }
}

.oc-data-group { display: flex; align-items: center; gap: 28px; flex: 1; justify-content: flex-end; }
.oc-item { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.oc-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; font-weight: 600; }
.oc-value { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* --- CORE HEDGE MATRIX STRIPS --- */
.matrix-strip-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
    width: 100% !important;
    overflow-x: auto !important;
    box-sizing: border-box !important;
}

/* 🟢 FIX: MATRIX STRIP CỐ ĐỊNH GRID 7 CỘT THẲNG HÀNG DỌC ABSOLUTE */
.matrix-strip {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 14px;
    display: grid !important;
    grid-template-columns: 160px repeat(6, minmax(0, 1fr)) !important;
    align-items: center;
    gap: 8px !important;
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    width: 100% !important;
    box-sizing: border-box !important;
}

.matrix-strip:hover {
    background-color: #12161d;
    border-color: #2b3139;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.ms-head-group {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
    min-width: 0 !important;
    overflow: hidden !important;
}

.ms-sym-title {
    font-size: 14px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.2px;
}

/* 🟢 FIX: CHỐNG ĐÙN KHUNG BỞI CON SỐ SIÊU DÀI */
.ms-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(18, 22, 28, 0.7);
    border: 1px solid rgba(28, 32, 38, 0.9);
    border-radius: 6px;
    padding: 8px 10px;
    height: 100%;
    justify-content: flex-start;
    min-width: 0 !important;
    overflow: hidden !important;
}

.ms-block-header {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 18px;
    line-height: 1;
}

.ms-block-long .ms-block-header { color: var(--color-green); }
.ms-block-short .ms-block-header { color: var(--color-red); }
.ms-block-market .ms-block-header { color: var(--color-yellow); }
.ms-block-pnl .ms-block-header { color: #ffffff !important; }  
.ms-block-stats .ms-block-header { color: #ffffff !important; }
.ms-block-risk .ms-block-header { color: #ffffff !important; } 

.ms-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* 2. Cấu hình Sticky Footer chuẩn */
footer { 
    width: 100% !important; 
    position: sticky !important;
    bottom: 0 !important; 
    z-index: 1000 !important;
    height: 60px !important;
    border-top: 1px solid var(--border-color) !important;
    background: var(--bg-panel) !important; 
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.5) !important;
    margin-top: 0 !important;
}

.footer-credits { 
    text-align: center; 
    padding: 25px 0; 
    font-size: 11px; 
    color: var(--text-dim); 
    letter-spacing: 1px; 
}

/* BREAKPOINTS RESPONSIVE DÀNH CHO MÀN HÌNH NHỎ HƠN 1024PX VÀ 512PX */
@media (max-width: 1024px) {
    .hide-md { display: none !important; }
    .risk-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
    .matrix-strip { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 10px; }
    .ms-head-group {
        grid-column: 1 / -1;
        border-bottom: 1px dashed var(--border-color);
        padding-bottom: 8px;
        margin-bottom: 2px;
    }
}

@media (max-width: 512px) {
    .hide-sm { display: none !important; }
    .workspace { padding: 12px 6px; }
    .grid-cell { padding: 6px 4px; }
    .risk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 6px !important; }
    .order-card { flex-wrap: wrap; padding: 10px; gap: 10px; }
    .oc-left-group { min-width: auto; width: 100%; justify-content: space-between; }
    .oc-data-group { width: 100%; justify-content: space-between; border-top: 1px dashed var(--border-color); padding-top: 8px; gap: 10px; }
    .matrix-strip { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; }
    .ms-head-group { grid-column: 1 / -1; }
}

/* --- TABS --- */
.main-nav-bar {
    background-color: var(--bg-panel);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    /*max-width: 1400px !important;*/
    margin: 0 auto !important;
    width: 100%;
}
.tab-container { display: flex; gap: 15px; margin: 0 20px; }
.tab-btn {
    background: transparent; border: none; color: var(--text-muted); font-size: 13px; font-weight: 600;
    padding: 12px 4px; cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.2s;
    letter-spacing: 0.5px;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--color-yellow); border-bottom-color: var(--color-yellow); }

/* --- BACKTEST UI --- */
.backtest-controls {
    display: flex; flex-wrap: wrap; gap: 15px; padding: 15px 20px; 
    background-color: var(--bg-header); border-bottom: 1px solid var(--border-color); align-items: flex-end;
}
.input-group { display: flex; flex-direction: column; gap: 5px; }
.input-group label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; font-weight: 600; }
.input-group input {
    background-color: var(--bg-main); border: 1px solid #2b3139; color: var(--text-primary);
    padding: 8px 12px; border-radius: 4px; font-size: 13px; outline: none;
}
.input-group input:focus { border-color: var(--color-yellow); }

.btn-run {
    background-color: var(--color-yellow); color: #000; border: none; padding: 9px 20px;
    border-radius: 4px; font-weight: 700; font-size: 13px; cursor: pointer; transition: 0.2s;
}
.btn-run:hover { background-color: #ffe259; }
.btn-run:disabled {
    background-color: #2b3139 !important;
    color: var(--text-muted) !important;
    cursor: not-allowed !important;
}

.log-grid { display: grid; grid-template-columns: 1.2fr 0.8fr 1fr 1fr 1fr 1fr 3fr; width: 100%; }

/* 🟢 FIX: CHỐNG BÙNG NỔ CHIỀU RỘNG NỘI DUNG LOG LOGS */
.log-reason, .log-flow-card, .reason-text, .fc-right-panel, .fc-left-panel, .grid-cell {
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
    min-width: 0 !important;
}

.log-reason { 
    font-size: 11px; 
    color: var(--text-primary); 
    white-space: pre-wrap !important; 
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    line-height: 1.45;
    background: rgba(12, 14, 18, 0.8);
    padding: 8px 10px;
    border-radius: 4px;
    border-left: 3px solid var(--color-yellow);
    margin-top: 4px;
    width: 100%;
}

.badge { padding: 2px 6px; border-radius: 3px; font-size: 10px; font-weight: 700; display: inline-block; }
.badge.new { background: rgba(255, 208, 67, 0.15); color: var(--color-yellow); }
.badge.filled { background: rgba(14, 203, 129, 0.15); color: var(--color-green); }
.badge.canceled { background: rgba(255, 101, 117, 0.15); color: var(--color-red); }

.log-table-container {
    max-height: 55vh; 
    overflow-y: auto;
    border-bottom: 1px solid var(--border-color);
}
.log-table-container::-webkit-scrollbar { width: 6px; }
.log-table-container::-webkit-scrollbar-track { background: var(--bg-panel); }
.log-table-container::-webkit-scrollbar-thumb { background: #2b3139; border-radius: 3px; }
.log-table-container::-webkit-scrollbar-thumb:hover { background: #474d57; }

/* --- AUTOCOMPLETE DROPDOWN --- */
.autocomplete-wrapper { position: relative; display: inline-block; }
.autocomplete-list {
    position: absolute; top: 100%; left: 0; z-index: 1000;
    background: var(--bg-header); border: 1px solid #2b3139; border-radius: 4px;
    width: 250px; max-height: 200px; overflow-y: auto;
    list-style: none; padding: 0; margin: 4px 0 0 0;
    box-shadow: 0 8px 16px rgba(0,0,0,0.6); display: none;
}
.autocomplete-list li {
    padding: 10px 12px; font-size: 12px; color: var(--text-primary);
    cursor: pointer; border-bottom: 1px solid var(--border-color);
}
.autocomplete-list li:hover { background-color: var(--border-color); color: var(--color-yellow); }
.autocomplete-list li.no-match { color: var(--color-red); cursor: default; font-style: italic; }
.autocomplete-list li.no-match:hover { background-color: transparent; color: var(--color-red); }

/* --- HOVER EFFECT DÀNH CHO SYMBOL HEADER BẤM ĐỂ MỞ RỘNG LOG --- */
.clickable-symbol-header {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease, padding 0.2s ease;
    border-radius: 6px;
    padding: 6px 8px;
}

.clickable-symbol-header:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.clickable-symbol-header .symbol-block-title {
    transition: transform 0.15s ease;
}

.clickable-symbol-header:hover .symbol-block-title {
    transform: translateX(3px);
}

/* --- SLIDER --- */
.slim-slider-container {
    background: var(--bg-header); border: 1px solid #2b3139; border-radius: 4px; padding: 10px;
    display: flex; flex-direction: column; gap: 8px; width: 220px; flex-shrink: 0;
}
.slim-slider {
    -webkit-appearance: none; width: 100%; height: 3px;
    background: #2b3139; border-radius: 2px; outline: none; transition: 0.2s;
}
.slim-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--color-green); cursor: pointer;
    box-shadow: 0 0 6px rgba(14, 203, 129, 0.6);
}
.slim-slider:disabled::-webkit-slider-thumb {
    background: #474d57; box-shadow: none; cursor: not-allowed;
}
.slider-ticks {
    display: flex; justify-content: space-between; padding: 0 4px;
    font-size: 9px; color: var(--text-muted); font-weight: 600; margin-top: 2px;
}
.slider-ticks span { cursor: pointer; }
.slider-ticks span:hover { color: var(--text-primary); }

/* --- REPORT TAB STYLES --- */
.report-container { padding: 20px; background-color: var(--bg-main); color: var(--text-primary); }
.report-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; border-bottom: 1px solid var(--border-color); padding-bottom: 15px; }
.report-title { font-size: 13px; font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: 8px; margin: 0; text-transform: uppercase; letter-spacing: 0.5px; }
.btn-refresh { background-color: var(--bg-panel); border: 1px solid var(--border-color); color: var(--color-yellow); padding: 5px 12px; border-radius: 4px; font-size: 11px; cursor: pointer; font-weight: 600; transition: background-color 0.2s, border-color 0.2s; }
.btn-refresh:hover { background-color: var(--border-color); }
.report-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 15px; margin-bottom: 25px; }
.report-stats-card { background-color: var(--bg-panel); border: 1px solid var(--border-color); padding: 12px 15px; border-radius: 6px; }
.stats-label { font-size: 9px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.stats-value { font-size: 18px; font-weight: 700; color: var(--text-primary); margin-top: 5px; }
.report-filter-panel { background-color: var(--bg-panel); border: 1px solid var(--border-color); padding: 15px; border-radius: 6px; margin-bottom: 25px; display: flex; flex-wrap: wrap; gap: 15px; align-items: flex-end; }
.filter-group { display: flex; flex-direction: column; gap: 5px; }
.filter-group label { font-size: 10px; color: var(--text-muted); font-weight: bold; text-transform: uppercase; }
.filter-group input, .filter-group select { background-color: var(--bg-main); border: 1px solid var(--border-color); color: #fff; padding: 6px 10px; border-radius: 4px; font-size: 12px; outline: none; font-family: inherit; }
.btn-filter { background-color: var(--color-yellow); color: #000; border: none; padding: 7px 18px; border-radius: 4px; font-size: 12px; font-weight: bold; cursor: pointer; transition: opacity 0.2s; }
.btn-filter:hover { opacity: 0.9; }

.symbol-block-card { background-color: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 8px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.symbol-block-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color); padding-bottom: 8px; margin-bottom: 4px; }
.symbol-block-title { font-weight: bold; font-size: 13px; color: var(--color-yellow); display: flex; align-items: center; gap: 8px; }
.symbol-block-stats { display: flex; gap: 15px; font-size: 11px; font-weight: 600; color: var(--text-muted); }
.symbol-block-logs { display: flex; flex-direction: column; gap: 10px; }
.log-flow-card { padding: 10px 14px; background-color: var(--bg-main); border: 1px solid var(--border-color); border-radius: 6px; line-height: 1.7; font-size: 12.5px; color: var(--text-primary); transition: all 0.2s ease-in-out; }
.log-flow-card:hover { border-color: rgba(255,255,255,0.12); transform: translateX(4px); }
.log-badge-highlight { color: #fff; background-color: rgba(255,255,255,0.03); padding: 1px 6px; border-radius: 4px; border: 1px solid rgba(255,255,255,0.08); }
.log-reason-text { font-weight: bold; border-bottom: 1px dashed rgba(255,255,255,0.15); }
.log-time-text { color: #64748b; }
.report-loading { padding: 30px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* --- CONTROL PANEL --- */
.bot-control-panel { background-color: #0c0e12; border: 1px solid #2b3139; border-radius: 8px; padding: 20px; margin-bottom: 20px; }
.add-coin-section { display: flex; gap: 10px; margin-bottom: 15px; }
.input-add-coin { flex: 1; background-color: #1c2026; border: 1px solid #2b3139; color: #eaecef; font-size: 16px; padding: 10px 15px; border-radius: 6px; outline: none; transition: 0.2s; }
.input-add-coin:focus { border-color: #f0b90b; }
.btn-add-coin { background-color: #f0b90b; color: #1c2026; border: none; font-weight: bold; font-size: 14px; padding: 0 20px; border-radius: 6px; cursor: pointer; }
.btn-add-coin:hover { opacity: 0.8; }
.panel-divider { border: 0; height: 1px; background: #2b3139; margin: 15px 0; }
.coin-control-card { background-color: #1c2026; border: 1px solid #2b3139; border-radius: 8px; padding: 12px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.coin-input-group { display: flex; align-items: center; gap: 8px; }
.coin-symbol-input { background-color: #0b0e11; border: 1px solid #2b3139; color: #eaecef; font-weight: bold; font-size: 16px; padding: 6px 10px; border-radius: 4px; width: 130px; text-align: center; }
.btn-quick-lock { background: transparent; border: none; cursor: pointer; font-size: 16px; padding: 6px; border-radius: 4px; transition: 0.2s; }

.switch-container { display: flex; align-items: center; gap: 8px; }
.switch { position: relative; display: inline-block; width: 38px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #2b3139; transition: .3s; border-radius: 20px; border: 1px solid #474f59; }
.slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 2px; bottom: 2px; background-color: #eaecef; transition: .3s; border-radius: 50%; }
input:checked + .slider { background-color: var(--color-green, #02c076); border-color: #02c076; }
input:checked + .slider:before { transform: translateX(18px); background-color: #0c0e12; }

/* Cập nhật hiển thị Log Engine có cấu trúc xuống dòng đẹp mắt */
.log-reason {
    font-size: 11px;
    color: var(--text-primary);
    white-space: pre-wrap !important;
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    line-height: 1.45;
    background: rgba(12, 14, 18, 0.8);
    padding: 8px 10px;
    border-radius: 4px;
    border-left: 3px solid var(--color-yellow);
    margin-top: 4px;
    width: 100%;
    word-break: break-word;
}

/* Badge trạng thái bổ sung cho các nhãn mới */
.badge.success { background: rgba(14, 203, 129, 0.15); color: var(--color-green); border: 1px solid rgba(14, 203, 129, 0.3); }
.badge.failed { background: rgba(255, 101, 117, 0.15); color: var(--color-red); border: 1px solid rgba(255, 101, 117, 0.3); }
.badge.warning { background: rgba(255, 208, 67, 0.15); color: var(--color-yellow); border: 1px solid rgba(255, 208, 67, 0.3); }
.badge.skipped { background: rgba(132, 142, 156, 0.15); color: var(--text-muted); border: 1px solid rgba(132, 142, 156, 0.3); }

/* Khung báo cáo Checkpoint định kỳ tháng */
.checkpoint-report-card {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    background: #12161c;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #2b3139;
    text-align: left;
    margin-bottom: 15px;
}
.checkpoint-item { display: flex; flex-direction: column; gap: 2px; }
.checkpoint-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; font-weight: 600; }
.checkpoint-val { font-size: 13px; font-weight: 700; color: #fff; }

/* --- FUNDING CYCLE GROUPED CARD --- */
.funding-card-block {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.funding-card-header {
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.fch-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fch-time {
    color: var(--color-yellow);
    font-family: monospace;
    font-weight: bold;
    font-size: 13px;
}

.fch-symbol {
    background: rgba(255, 208, 67, 0.15);
    color: var(--color-yellow);
    border: 1px solid rgba(255, 208, 67, 0.3);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 800;
    font-size: 12px;
}

.fch-right {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.fch-info-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
}

.fch-info-item strong {
    color: #ffffff;
}

.funding-card-body {
    display: flex !important;
    flex-direction: row !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
}

.fc-left-panel, .fc-right-panel {
    flex: 1 1 50% !important;
    min-width: 0 !important;
    max-width: 50% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}/* --- TOGGLE SWITCH STYLES (Từ terminal.js) --- */
.switch-container { 
  display: flex; 
  align-items: center; 
  gap: 6px; 
  margin-left: 6px; 
}

.switch { 
  position: relative; 
  display: inline-block; 
  width: 34px; 
  height: 18px; 
}

.switch input { 
  opacity: 0; 
  width: 0; 
  height: 0; 
}

.slider { 
  position: absolute; 
  cursor: pointer; 
  top: 0; left: 0; right: 0; bottom: 0; 
  background-color: #2b3139; 
  transition: .3s; 
  border-radius: 20px; 
  border: 1px solid #474f59; 
}

.slider:before { 
  position: absolute; 
  content: ""; 
  height: 12px; 
  width: 12px; 
  left: 2px; 
  bottom: 2px; 
  background-color: #eaecef; 
  transition: .3s; 
  border-radius: 50%; 
}

input:checked + .slider { 
  background-color: var(--color-green, #02c076); 
  border-color: #02c076; 
}

input:checked + .slider:before { 
  transform: translateX(16px); 
  background-color: #0c0e12; 
}

/* --- AUTHENTICATION & LOGIN BOX STYLES (Từ select_bot.html) --- */
.login-wrapper { 
  min-height: 100vh; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  background-color: var(--bg-main); 
}

.login-box { 
  width: 100%; 
  max-width: 400px; 
  padding: 30px; 
  background-color: var(--bg-panel); 
  border: 1px solid var(--border-color); 
  border-radius: 8px; 
  box-shadow: 0 12px 40px rgba(0,0,0,0.5); 
}

.form-group { 
  display: flex; 
  flex-direction: column; 
  gap: 8px; 
  margin-bottom: 20px; 
}

.form-group input { 
  background-color: var(--bg-main); 
  border: 1px solid var(--border-color); 
  color: #fff; 
  padding: 12px; 
  border-radius: 4px; 
  font-size: 14px; 
  outline: none; 
}

.form-group input:focus { 
  border-color: var(--color-yellow); 
}

.btn-auth { 
  width: 100%; 
  background-color: var(--color-yellow); 
  color: #000; 
  border: none; 
  padding: 12px; 
  border-radius: 4px; 
  font-weight: 700; 
  font-size: 14px; 
  cursor: pointer; 
  transition: 0.2s; 
}

.btn-auth:hover { 
  opacity: 0.9; 
}

.divider { 
  display: flex; 
  align-items: center; 
  text-align: center; 
  color: var(--text-muted); 
  font-size: 11px; 
  margin: 20px 0; 
  text-transform: uppercase; 
}

.divider::before, .divider::after { 
  content: ''; 
  flex: 1; 
  border-bottom: 1px solid var(--border-color); 
}

.divider:not(:empty)::before { 
  margin-right: .5em; 
}

.divider:not(:empty)::after { 
  margin-left: .5em; 
}

/* --- UPDATE PASSWORD BOX STYLES (Từ update_password.html) --- */
.update-password-body { 
  background-color: #0b0e11; 
  color: white; 
  font-family: sans-serif; 
  display: flex; 
  justify-content: center; 
  align-items: center; 
  height: 100vh; 
  margin: 0;
}

.password-box { 
  background-color: #1e2329; 
  padding: 30px; 
  border-radius: 8px; 
  width: 350px; 
  text-align: center; 
}

.password-box input { 
  width: 100%; 
  padding: 12px; 
  margin: 10px 0; 
  background: #12161a; 
  border: 1px solid #474d57; 
  color: white; 
  border-radius: 4px; 
  box-sizing: border-box;
}

.password-box button { 
  width: 100%; 
  padding: 12px; 
  background: #fcd535; 
  border: none; 
  font-weight: bold; 
  cursor: pointer; 
  border-radius: 4px;
}

#msg { 
  margin-top: 15px; 
  font-size: 14px; 
}

/* --- ALERTS & COMPACT FORM STYLES (Từ forgot_password.html & register.html) --- */
.form-group label { 
  font-size: 11px; 
  color: #848e9c; 
  font-weight: 600; 
  text-transform: uppercase; 
}

.form-group input { 
  background-color: #12161a; 
  border: 1px solid #474d57; 
  color: #fff; 
  padding: 14px; 
  border-radius: 4px; 
  font-size: 14px; 
  outline: none; 
  transition: 0.2s; 
  box-sizing: border-box; 
  width: 100%; 
}

.form-group input:focus { 
  border-color: #fcd535; 
}

.btn-auth { 
  text-transform: uppercase; 
}

.brand { 
  font-size: 22px; 
  font-weight: 800; 
  color: #fcd535; 
  letter-spacing: 1px; 
}

.error-alert { 
  background-color: rgba(246, 70, 93, 0.1); 
  border: 1px solid #f6465d; 
  color: #f6465d; 
  padding: 12px; 
  border-radius: 4px; 
  font-size: 13px; 
  margin-bottom: 20px; 
  text-align: center; 
  font-weight: 600; 
}

.success-alert { 
  background-color: rgba(14, 203, 129, 0.1); 
  border: 1px solid #0ecb81; 
  color: #0ecb81; 
  padding: 12px; 
  border-radius: 4px; 
  font-size: 13px; 
  margin-bottom: 20px; 
  text-align: center; 
  font-weight: 600; 
}

/* ==========================================================================
   AUTHENTICATION, ALERTS & FORMS STYLES 
   (Hợp nhất & chuẩn hóa từ select_bot.html, forgot_password.html, update_password.html)
   ========================================================================== */

/* Khung bao ngoài toàn màn hình cho các trang đăng nhập / xác thực */
.login-wrapper { 
  min-height: 100vh; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  background-color: var(--bg-main); 
  margin: 0;
}

/* Hộp biểu mẫu trung tâm */
.login-box, .password-box { 
  width: 100%; 
  max-width: 400px; 
  padding: 30px; 
  background-color: var(--bg-panel); 
  border: 1px solid var(--border-color); 
  border-radius: 8px; 
  box-shadow: 0 12px 40px rgba(0,0,0,0.5); 
  text-align: center;
}

/* Các cụm trường nhập liệu */
.form-group { 
  display: flex; 
  flex-direction: column; 
  gap: 8px; 
  margin-bottom: 20px; 
  text-align: left; 
}

.form-group label { 
  font-size: 11px; 
  color: var(--text-muted); 
  font-weight: 600; 
  text-transform: uppercase; 
}

.form-group input, .password-box input { 
  background-color: var(--bg-main); 
  border: 1px solid var(--border-color); 
  color: var(--text-primary); 
  padding: 14px; 
  border-radius: 4px; 
  font-size: 14px; 
  outline: none; 
  transition: 0.2s; 
  box-sizing: border-box; 
  width: 100%; 
}

.form-group input:focus, .password-box input:focus { 
  border-color: var(--color-yellow); 
}

/* Nút bấm hành động xác thực chính */
.btn-auth, .password-box button { 
  width: 100%; 
  background-color: var(--color-yellow); 
  color: #000; 
  border: none; 
  padding: 14px; 
  border-radius: 4px; 
  font-weight: 700; 
  font-size: 14px; 
  cursor: pointer; 
  transition: 0.2s; 
  text-transform: uppercase; 
}

.btn-auth:hover, .password-box button:hover { 
  opacity: 0.9; 
}

/* Định dạng tiêu đề thương hiệu riêng cho cụm đăng nhập (Tránh trùng với header hệ thống) */
.brand-auth { 
  font-size: 22px; 
  font-weight: 800; 
  color: var(--color-yellow); 
  letter-spacing: 1px; 
}

/* Phân đoạn nội dung mẫu đăng nhập */
.divider { 
  display: flex; 
  align-items: center; 
  text-align: center; 
  color: var(--text-muted); 
  font-size: 11px; 
  margin: 20px 0; 
  text-transform: uppercase; 
}

.divider::before, .divider::after { 
  content: ''; 
  flex: 1; 
  border-bottom: 1px solid var(--border-color); 
}

.divider:not(:empty)::before { margin-right: .5em; }
.divider:not(:empty)::after { margin-left: .5em; }

/* Thông báo trạng thái hệ thống */
#msg { 
  margin-top: 15px; 
  font-size: 14px; 
}

/* Khối hiển thị cảnh báo lỗi hoặc thành công */
.error-alert { 
  background-color: rgba(255, 101, 117, 0.1); 
  border: 1px solid var(--color-red); 
  color: var(--color-red); 
  padding: 12px; 
  border-radius: 4px; 
  font-size: 13px; 
  margin-bottom: 20px; 
  text-align: center; 
  font-weight: 600; 
}

.success-alert { 
  background-color: rgba(14, 203, 129, 0.1); 
  border: 1px solid var(--color-green); 
  color: var(--color-green); 
  padding: 12px; 
  border-radius: 4px; 
  font-size: 13px; 
  margin-bottom: 20px; 
  text-align: center; 
  font-weight: 600; 
}

/* ==========================================================================
   TOGGLE SWITCH STYLES (Trích xuất từ terminal.js)
   ========================================================================== */
.switch-container { 
  display: flex; 
  align-items: center; 
  gap: 6px; 
  margin-left: 6px; 
}

.switch { 
  position: relative; 
  display: inline-block; 
  width: 34px; 
  height: 18px; 
}

.switch input { 
  opacity: 0; 
  width: 0; 
  height: 0; 
}

/* --- CSS CẬP NHẬT: ÉP SIDEBAR NỔI ÔM SÁT CẠNH TRÁI KHỐI NỘI DUNG 1400PX --- */
.layout-wrapper {
    position: relative !important;
    display: flex !important;
    width: 100% !important;
    margin: 0 auto !important;
    min-height: auto !important; /* Để co giãn tự nhiên theo nội dung bên trong */
}

    .floating-sidebar {
        position: fixed !important; /* 🟢 CHUYỂN SANG ABSOLUTE ĐỂ BAY LÊN TRÊN KHÔNG ĐẨY KHUNG NỀN */
        left: 12px !important;
        top: 60px !important;
        bottom: 44px !important;
        width: 60px !important; /* Chiều rộng thu gọn mặc định */
        background: rgba(12, 14, 18, 0.92) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        border-radius: 12px !important;
        height: auto !important;
        max-height: calc(100vh - 104px) !important; /* Ôm trọn chiều cao màn hình */
        z-index: 9999 !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s, border-color 0.25s !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
    }

    /* 🟢 BUNG BẢNG RA MƯỢT MÀ KHI HOVER MÀ KHÔNG LÀM DỊCH CHUYỂN VỊ TRÍ GỐC */
    .floating-sidebar:hover {
        width: 245px !important;
        border-color: rgba(255, 208, 67, 0.3) !important;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.95) !important;
    }

    .sidebar-inner-container {
        display: flex !important; flex-direction: column;
        justify-content: space-between;
        height: 100%;
        width: 245px; /* Khóa chết nội dung text bên trong */
        padding: 16px 8px;
        box-sizing: border-box;
    }

    .sidebar-section-title {
        font-size: 9px !important;
        color: #475569 !important;
        font-weight: 700 !important;
        padding-left: 14px !important;
        margin-bottom: 6px !important;
        letter-spacing: 0.8px !important;
        text-transform: uppercase;
        white-space: nowrap;
        opacity: 0;
        transition: opacity 0.15s ease;
    }
    .floating-sidebar:hover .sidebar-section-title {
        opacity: 1 !important;
    }

    .sidebar-btn {
        display: flex !important;
        align-items: center !important;
        width: 100% !important;
        background: transparent !important;
        border: 1px solid transparent !important;
        color: #cbd5e1 !important;
        padding: 10px 0 !important;
        border-radius: 6px !important;
        cursor: pointer;
        text-align: left;
        white-space: nowrap;
    }

    .sidebar-btn .icon {
        min-width: 42px !important;
        font-size: 14px !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .sidebar-btn .label {
        font-size: 11.5px !important;
        font-weight: 600 !important;
        opacity: 0 !important;
        transform: translateX(-5px) !important;
        transition: opacity 0.2s ease, transform 0.2s ease !important;
        color: #cbd5e1 !important;
    }

    .floating-sidebar:hover .sidebar-btn .label {
        opacity: 1 !important;
        transform: translateX(0) !important;
    }

    .sidebar-btn:hover { background-color: rgba(255, 255, 255, 0.06) !important; color: #fff !important; }
    .sidebar-btn.active { background-color: rgba(255, 208, 67, 0.08) !important; border-color: rgba(255, 208, 67, 0.15) !important; color: #ffd043 !important; }
    .sidebar-btn.active .label { color: #ffd043 !important; }

    /* Không gian Main nhận khoảng đệm cố định 80px để chừa chỗ cho Mini-Icon */
    .main-workspace-content {
        flex: 1;
        min-width: 0;
        background-color: var(--bg-main);
        overflow-y: auto;
        padding-left: 85px !important; /* Khoảng đệm cố định hoàn hảo bám sát */
        transition: filter 0.3s ease, opacity 0.3s ease;
    }

    /* 🔥 CHIẾN LƯỢC AUTO BLUR: Làm mờ mịn nền phía sau bằng :has() */
    .layout-wrapper:has(.floating-sidebar:hover) .main-workspace-content {
        filter: blur(3px) brightness(50%) !important;
        opacity: 0.4;
        pointer-events: none; /* Khóa tương tác lệnh bên dưới khi menu đang mở */
    }