:root {
    --bg: #070b18;
    --panel: #0d1426;
    --panel-2: #111a2f;
    --line: rgba(148, 163, 184, .16);
    --text: #e5ecff;
    --muted: #94a3b8;
    --blue: #3b82f6;
    --cyan: #22d3ee;
    --green: #22c55e;
    --red: #ef4444;
    --yellow: #f59e0b;
    --purple: #8b5cf6;
    --radius: 22px;
    --sidebar: 280px;
}

* {
    box-sizing: border-box;
}

body.trade-body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, .24), transparent 34%),
        radial-gradient(circle at top right, rgba(139, 92, 246, .18), transparent 32%),
        var(--bg);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.trade-shell {
    display: grid;
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
    min-height: 100vh;
}

.trade-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px 16px;
    background: linear-gradient(180deg, rgba(13, 20, 38, .96), rgba(8, 13, 28, .96));
    border-right: 1px solid var(--line);
    overflow: auto;
}

.brand-card {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(59, 130, 246, .18), rgba(34, 211, 238, .08));
    border: 1px solid rgba(59, 130, 246, .22);
    margin-bottom: 22px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    font-weight: 800;
    font-size: 24px;
    color: #fff;
}

.brand-title {
    font-weight: 800;
}

.brand-subtitle {
    font-size: 12px;
    color: var(--muted);
}

.nav-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: #64748b;
    margin: 18px 12px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 6px 0;
    padding: 12px 13px;
    border-radius: 16px;
    color: #cbd5e1;
    border: 1px solid transparent;
}

.nav-item:hover,
.nav-item.is-active {
    background: linear-gradient(135deg, rgba(59, 130, 246, .22), rgba(34, 211, 238, .10));
    border-color: rgba(34, 211, 238, .28);
    color: #fff;
}

.trade-topbar {
    height: 92px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 30px;
    border-bottom: 1px solid var(--line);
    background: rgba(7, 11, 24, .68);
    position: sticky;
    top: 0;
    z-index: 15;
    backdrop-filter: blur(18px);
}

.trade-eyebrow {
    margin: 0 0 3px;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .14em;
    font-weight: 800;
}

.trade-topbar h1 {
    margin: 0;
    font-size: 26px;
}

.trade-top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.market-pill,
.user-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    height: 42px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .72);
    border: 1px solid var(--line);
    color: #dbeafe;
    font-size: 13px;
    font-weight: 700;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 6px rgba(34, 197, 94, .13);
}

.avatar-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--purple), var(--blue));
    font-weight: 800;
}

.trade-content {
    padding: 30px;
    max-width: 1500px;
}

.grid {
    display: grid;
    gap: 18px;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel-grid {
    grid-template-columns: 2fr 1fr;
}

.split-grid {
    grid-template-columns: 1fr 1fr;
}

.card {
    background: linear-gradient(180deg, rgba(17, 26, 47, .92), rgba(12, 19, 35, .92));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 20px 70px rgba(2, 6, 23, .28);
    padding: 20px;
}

.stat-value {
    font-size: 30px;
    font-weight: 800;
    margin-top: 10px;
}

.stat-label,
.stat-meta,
.muted {
    color: var(--muted);
}

.positive {
    color: var(--green) !important;
}

.negative {
    color: var(--red) !important;
}

.warning {
    color: var(--yellow) !important;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.section-title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
}

.btn-primary-soft {
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    color: white;
    padding: 11px 14px;
    font-weight: 800;
    cursor: pointer;
}

.btn-ghost {
    border: 1px solid var(--line);
    background: rgba(148, 163, 184, .08);
    color: #dbeafe;
    border-radius: 14px;
    padding: 10px 14px;
    font-weight: 700;
}

.chart-wrap {
    height: 320px;
}

.table-wrap {
    overflow: auto;
}

.trade-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
    min-width: 760px;
}

.trade-table th {
    font-size: 12px;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #64748b;
    padding: 0 14px 6px;
}

.trade-table td {
    background: rgba(15, 23, 42, .72);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 14px;
    color: #dbeafe;
}

.trade-table td:first-child {
    border-left: 1px solid var(--line);
    border-radius: 16px 0 0 16px;
}

.trade-table td:last-child {
    border-right: 1px solid var(--line);
    border-radius: 0 16px 16px 0;
}

.coin {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
}

.coin-badge {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(59, 130, 246, .16);
    border: 1px solid rgba(59, 130, 246, .24);
}

.tag {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.tag.long {
    background: rgba(34, 197, 94, .14);
    color: #86efac;
}

.tag.short {
    background: rgba(239, 68, 68, .14);
    color: #fca5a5;
}

.tag.open {
    background: rgba(59, 130, 246, .14);
    color: #93c5fd;
}

.tag.closed {
    background: rgba(148, 163, 184, .14);
    color: #cbd5e1;
}

.watch-list {
    display: grid;
    gap: 12px;
}

.watch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 14px;
    border-radius: 16px;
    background: rgba(15, 23, 42, .72);
    border: 1px solid var(--line);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.field label {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 7px;
}

.input,
.select,
.textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: rgba(15, 23, 42, .8);
    color: #fff;
    border-radius: 14px;
    padding: 12px 13px;
    outline: none;
}

.textarea {
    min-height: 110px;
    resize: vertical;
}

.trade-menu-btn {
    display: none;
}

.trade-backdrop {
    display: none;
}

.mt-18 {
    margin-top: 18px;
}

.mb-18 {
    margin-bottom: 18px;
}

@media (max-width: 1180px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .panel-grid,
    .split-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr 1fr;
    }
}
.alert {
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-weight: 700;
}

.alert-success {
    background: rgba(34, 197, 94, .12);
    border: 1px solid rgba(34, 197, 94, .28);
    color: #86efac;
}

.alert-error {
    background: rgba(239, 68, 68, .12);
    border: 1px solid rgba(239, 68, 68, .28);
    color: #fca5a5;
}

.deposit-box {
    margin-top: 22px;
    display: grid;
    gap: 16px;
}

.qr-box {
    width: 180px;
    height: 180px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    background:
        linear-gradient(135deg, rgba(255,255,255,.92), rgba(226,232,240,.92));
    color: #020617;
    font-weight: 900;
    font-size: 28px;
}

.wallet-address {
    padding: 14px;
    border-radius: 16px;
    background: rgba(15, 23, 42, .8);
    border: 1px dashed rgba(34, 211, 238, .35);
    color: #67e8f9;
    font-weight: 800;
    word-break: break-all;
}
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(2, 6, 23, .72);
    backdrop-filter: blur(1px);
}

.modal-overlay.show {
    display: flex;
}

.modal-box {
    width: 100%;
    max-width: 720px;
    max-height: 92vh;
    overflow: auto;
    background: linear-gradient(180deg, rgba(17, 26, 47, .98), rgba(12, 19, 35, .98));
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 26px;
    padding: 24px;
    box-shadow: 0 30px 100px rgba(0, 0, 0, .45);
    animation: modalZoom .18s ease;
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.modal-head h2 {
    margin: 0;
    font-size: 24px;
}

.modal-close {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 14px;
    background: rgba(15, 23, 42, .8);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.modal-close:hover {
    background: rgba(239, 68, 68, .18);
    color: #fca5a5;
}

.deposit-address-box {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 18px;
    align-items: center;
    padding: 18px;
    border-radius: 22px;
    background: rgba(15, 23, 42, .62);
    border: 1px solid rgba(148, 163, 184, .14);
}

body.modal-open {
    overflow: hidden;
}

@keyframes modalZoom {
    from {
        opacity: 0;
        transform: scale(.96) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@media (max-width: 700px) {
    .deposit-address-box {
        grid-template-columns: 1fr;
    }

    .qr-box {
        width: 100%;
        max-width: 220px;
    }
}

@media (max-width: 860px) {
    .trade-shell {
        display: block;
    }

    .trade-sidebar {
        position: fixed;
        z-index: 40;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        transition: .24s ease;
    }

    .sidebar-open .trade-sidebar {
        transform: translateX(0);
    }

    .trade-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(2, 6, 23, .62);
        z-index: 35;
        opacity: 0;
        pointer-events: none;
    }

    .sidebar-open .trade-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .trade-menu-btn {
        display: inline-flex;
        flex-direction: column;
        gap: 4px;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        border-radius: 14px;
        border: 1px solid var(--line);
        background: rgba(15, 23, 42, .8);
    }

    .trade-menu-btn span {
        width: 18px;
        height: 2px;
        background: #fff;
        border-radius: 99px;
    }

    .trade-top-actions {
        display: none;
    }

    .trade-content {
        padding: 18px;
    }

    .stats-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .chart-wrap {
        height: 260px;
    }
}
.live-positions-head {
    align-items: flex-start;
}

.empty-state {
    border: 1px dashed var(--line);
    border-radius: 18px;
    color: #94a3b8;
    padding: 22px;
    text-align: center;
}

.live-position-list {
    display: grid;
    gap: 14px;
}

.binance-position-card {
    background: rgba(15, 23, 42, .72);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
}

.position-card-top,
.position-pnl-row,
.position-symbol-wrap,
.position-symbol-line,
.position-sl-tp {
    display: flex;
    align-items: center;
}

.position-card-top,
.position-pnl-row {
    justify-content: space-between;
    gap: 12px;
}

.position-symbol-wrap {
    gap: 10px;
    min-width: 0;
}

.position-symbol-line {
    flex-wrap: wrap;
    gap: 7px;
    color: #f8fafc;
    font-size: 16px;
}

.side-badge {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    display: grid;
    font-size: 14px;
    font-weight: 900;
    place-items: center;
}

.side-badge.long {
    background: #10b981;
    color: white;
}

.side-badge.short {
    background: #ef4444;
    color: white;
}

.mode-pill {
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 5px;
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 6px;
}

.position-status,
.metric-label,
.position-sl-tp {
    color: #94a3b8;
    font-size: 12px;
}

.position-close-btn {
    border: 0;
    border-radius: 10px;
    background: rgba(148, 163, 184, .14);
    color: #f8fafc;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    padding: 8px 11px;
    white-space: nowrap;
}

.position-pnl-row {
    border-top: 1px solid rgba(148, 163, 184, .14);
    margin-top: 13px;
    padding-top: 13px;
}

.metric-main {
    font-size: 24px;
    font-weight: 900;
    line-height: 1.25;
}

.position-metrics-grid {
    display: grid;
    gap: 14px 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 12px;
}

.metric-value {
    color: #f8fafc;
    font-size: 14px;
    font-weight: 800;
    margin-top: 4px;
}

.text-right {
    text-align: right;
}

.position-sl-tp {
    border-top: 1px solid rgba(148, 163, 184, .14);
    gap: 7px;
    margin-top: 14px;
    padding-top: 12px;
}

.positive {
    color: #10b981;
}

.negative {
    color: #ef4444;
}

@media (max-width: 720px) {
    .position-card-top,
    .position-pnl-row {
        align-items: flex-start;
    }

    .position-metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .metric-block.text-right {
        text-align: left;
    }
}
.top-user-select-form {
    margin: 0;
}

.top-user-select {
    min-width: 230px;
    max-width: 320px;
    height: 42px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.28);
    color: #e5e7eb;
    padding: 0 14px;
}

@media (max-width: 768px) {
    .trade-topbar {
        align-items: flex-start;
    }

    .trade-top-actions {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 10px;
    }

    .top-user-select-form {
        width: 100%;
    }

    .top-user-select {
        width: 100%;
        max-width: 100%;
        min-width: 100%;
    }

    .market-pill,
    .user-chip {
        width: 100%;
        justify-content: center;
    }
}
/* =========================================================
   REPORT LỆNH VÀ LỊCH SỬ VÍ
========================================================= */

.mb-18 {
    margin-bottom: 18px;
}

.report-period-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.report-period-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 16px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.report-period-button:hover {
    border-color: rgba(59, 130, 246, 0.55);
    color: #ffffff;
}

.report-period-button.is-active {
    border-color: #3b82f6;
    background: #2563eb;
    color: #ffffff;
}

.report-custom-filter {
    display: grid;
    grid-template-columns:
        minmax(180px, 260px)
        minmax(180px, 260px)
        auto;
    align-items: end;
    gap: 14px;
    margin-bottom: 20px;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.45);
}

.report-filter-submit {
    min-width: 150px;
}

.report-filter-submit button {
    width: 100%;
}

.report-trade-table {
    min-width: 1180px;
}

.report-wallet-table {
    min-width: 1100px;
}

.report-nowrap {
    white-space: nowrap;
}

.report-number {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.report-batch-id {
    max-width: 190px;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-note {
    min-width: 260px;
    max-width: 400px;
    line-height: 1.5;
    white-space: normal;
}

.report-empty {
    padding: 32px 15px;
    color: #94a3b8;
    text-align: center;
}

.report-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.report-menu-card {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.72);
    color: #e2e8f0;
    text-decoration: none;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease;
}

.report-menu-card:hover {
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, 0.55);
    background: rgba(30, 41, 59, 0.9);
}

.report-menu-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 15px;
    background: rgba(59, 130, 246, 0.13);
    font-size: 22px;
}

.report-menu-card strong {
    display: block;
    margin-bottom: 7px;
    font-size: 17px;
}

.report-menu-card p {
    margin: 0;
    color: #94a3b8;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .report-period-buttons {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-period-button {
        width: 100%;
        padding-left: 8px;
        padding-right: 8px;
    }

    .report-custom-filter {
        grid-template-columns: 1fr;
    }

    .report-filter-submit {
        width: 100%;
    }

    .report-menu-grid {
        grid-template-columns: 1fr;
    }
}
/* =========================================================
   REPORT DATE FILTER
========================================================= */

.report-date-filter {
    display: grid;
    grid-template-columns:
        minmax(220px, 270px)
        minmax(160px, 190px)
        minmax(160px, 190px)
        auto;
    align-items: end;
    gap: 10px;
    margin-bottom: 20px;
}

.report-date-filter .field {
    margin: 0;
}

.report-date-filter .field label {
    display: block;
    margin-bottom: 6px;
}

.report-custom-date-field {
    transition:
        opacity 0.2s ease,
        filter 0.2s ease;
}

.report-custom-date-field.is-disabled {
    opacity: 0.5;
}

.report-custom-date-field.is-disabled .input {
    cursor: not-allowed;
    background: #e9eef4;
    color: #8492a6;
}

.report-date-filter-submit {
    min-width: 145px;
}

.report-date-filter-submit button {
    width: 100%;
    min-height: 42px;
}

@media (max-width: 900px) {
    .report-date-filter {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-date-filter-submit {
        min-width: 0;
    }
}

@media (max-width: 600px) {
    .report-date-filter {
        grid-template-columns: 1fr;
    }

    .report-date-filter-submit button {
        width: 100%;
    }
}