/* ── Account Summary ── */
.account-summary {
    display:flex;
    flex-wrap:wrap;
    gap:16px 28px;
    margin-bottom:20px;
    padding:8px 0 12px;
    border-bottom:1px solid #1e222d;
    font-size:12px;
    color:#787b86;
}
.account-summary .item {
    display:flex;
    align-items:center;
    gap:4px;
}
.account-summary .item .value {
    color:#d1d4dc;
    font-weight:600;
    font-family:monospace;
}
.account-summary .item .value.positive { color:#00a854; }
.account-summary .item .value.negative { color:#f23645; }

/* ── Tabs Container ── */
.trading-tabs-container {
    background: linear-gradient(180deg, #05070c 0%, #0b0f19 50%, #05070c 100%);
    border-radius:8px;
    padding:15px;
    color:#fff;
}
.tab-headers {
    display:flex;
    gap:10px;
    border-bottom:2px solid #334155;
    padding-bottom:8px;
}
.tab-btn {
    background:transparent;
    border:none;
    color:#94a3b8;
    padding:8px 16px;
    font-size:14px;
    font-weight:600;
    cursor:pointer;
    border-radius:4px;
    transition:0.3s;
}
.tab-btn:hover { color:#fff; background:#334155; }
.tab-btn.active { color:#fff; background:#3b82f6; }
.tab-content-body {
    padding:10px 0;
    min-height:100px;
}

/* ── Trade Table ── */
.trade-table {
    width:100%;
    border-collapse:collapse;
    font-size:12px;
}
.trade-table thead th {
    text-align:left;
    padding:6px 8px;
    color:#787b86;
    font-weight:600;
    font-size:10px;
    text-transform:uppercase;
    letter-spacing:0.4px;
    border-bottom:1px solid #1e222d;
}
.trade-table tbody td {
    padding:6px 8px;
    border-bottom:1px solid #151a22;
    font-weight:500;
    vertical-align:middle;
}
.trade-table .type-buy { color:#00a854; }
.trade-table .type-sell { color:#f23645; }
.trade-table .profit-positive { color:#00a854; }
.trade-table .profit-negative { color:#f23645; }

/* ── Badges ── */
.badge {
    display:inline-block;
    padding:2px 8px;
    border-radius:12px;
    font-size:9px;
    font-weight:600;
    text-transform:uppercase;
}
.badge-open { background:#1a3a2a; color:#00a854; }
.badge-pending { background:#3a2a1a; color:#f0b90b; }
.badge-closed { background:#2a2a2a; color:#787b86; }

/* ── Action Button ── */
.action-btn {
    background:none;
    border:none;
    color:#787b86;
    font-size:16px;
    cursor:pointer;
    padding:0 4px;
}
.action-btn:hover { color:#f0b90b; }

/* ─── POPUP OVERLAY ─── */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.25s ease;
}
.popup-overlay.active {
    display: flex;
}

/* ─── POPUP CONTAINER ─── */
.popup-container {
    background: linear-gradient(145deg, #1a1f2e, #131722);
    border: 1px solid #2a3a4a;
    border-radius: 16px;
    padding: 0;
    max-width: 440px;
    width: 92%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

/* ─── POPUP HEADER ─── */
.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px 14px 24px;
    border-bottom: 1px solid #1e2632;
    background: rgba(255, 255, 255, 0.02);
}
.popup-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #f0f2f5;
    letter-spacing: 0.3px;
}
.popup-header h3 i {
    margin-right: 8px;
    color: #f0b90b;
}
.popup-close {
    background: none;
    border: none;
    color: #787b86;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: 0.2s;
}
.popup-close:hover {
    background: #2a3a4a;
    color: #fff;
}

/* ─── POPUP BODY ─── */
.popup-body {
    padding: 20px 24px 12px 24px;
    color: #d1d4dc;
}
.popup-body .info-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid #1a1f2a;
}
.popup-body .info-row .label {
    color: #787b86;
}
.popup-body .info-row .value {
    font-weight: 600;
    color: #f0f2f5;
}
.popup-body .info-row .value.positive { color: #00a854; }
.popup-body .info-row .value.negative { color: #f23645; }

/* ─── FORM FIELDS ─── */
.popup-field {
    margin: 14px 0 10px 0;
}
.popup-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #787b86;
    margin-bottom: 4px;
}
.popup-field input {
    width: 100%;
    padding: 10px 14px;
    background: #0b0e14;
    border: 1px solid #2a3a4a;
    border-radius: 8px;
    color: #d1d4dc;
    font-size: 14px;
    font-weight: 500;
    outline: none;
    transition: 0.25s;
    font-family: monospace;
}
.popup-field input:focus {
    border-color: #f0b90b;
    box-shadow: 0 0 0 3px rgba(240, 185, 11, 0.15);
}
.popup-field input::placeholder {
    color: #4a5568;
}

/* ─── POPUP ACTIONS (BUTTONS) ─── */
.popup-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 16px 0 4px 0;
}
.popup-actions button {
    flex: 1;
    min-width: 100px;
    padding: 10px 0;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.popup-actions button i {
    font-size: 14px;
}
.popup-actions button:active {
    transform: scale(0.96);
}
.popup-actions .btn-update {
    background: #00a854;
    color: #fff;
}
.popup-actions .btn-update:hover {
    background: #00c96a;
    box-shadow: 0 4px 20px rgba(0, 168, 84, 0.35);
}
.popup-actions .btn-close {
    background: #d32f2f;
    color: #fff;
}
.popup-actions .btn-close:hover {
    background: #f23645;
    box-shadow: 0 4px 20px rgba(242, 54, 69, 0.35);
}
.popup-actions .btn-cancel {
    background: #f0b90b;
    color: #131722;
}
.popup-actions .btn-cancel:hover {
    background: #ffd700;
    box-shadow: 0 4px 20px rgba(240, 185, 11, 0.35);
}
.popup-actions .btn-secondary {
    background: #2a3a4a;
    color: #d1d4dc;
}
.popup-actions .btn-secondary:hover {
    background: #3a4a5a;
}

/* ─── POPUP FOOTER ─── */
.popup-footer {
    padding: 12px 24px 18px 24px;
    border-top: 1px solid #1e2632;
    display: flex;
    justify-content: flex-end;
}
.popup-footer .popup-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}
.popup-footer .popup-btn-secondary {
    background: transparent;
    color: #787b86;
}
.popup-footer .popup-btn-secondary:hover {
    color: #d1d4dc;
    background: #1a1f2a;
}

/* ─── DIALOG OVERLAY ─── */
.dialog-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 999999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease;
}
.dialog-overlay.active {
    display: flex;
}

/* ─── DIALOG CONTAINER ─── */
.dialog-container {
    background: linear-gradient(145deg, #1a1f2e, #131722);
    border: 1px solid #2a3a4a;
    border-radius: 16px;
    padding: 0;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.9);
    overflow: hidden;
    animation: slideUp 0.25s ease;
}

/* ─── DIALOG HEADER ─── */
.dialog-header {
    padding: 18px 24px 10px 24px;
    border-bottom: 1px solid #1e2632;
    background: rgba(255, 255, 255, 0.02);
}
.dialog-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #f0f2f5;
}
.dialog-header h3 i {
    margin-right: 8px;
    color: #f0b90b;
}

/* ─── DIALOG BODY ─── */
.dialog-body {
    padding: 20px 24px 16px 24px;
    color: #d1d4dc;
    font-size: 14px;
    line-height: 1.6;
    min-height: 40px;
}
.dialog-body .highlight {
    color: #f0b90b;
    font-weight: 600;
}
.dialog-body .error-text {
    color: #f23645;
}

/* ─── DIALOG FOOTER ─── */
.dialog-footer {
    padding: 12px 24px 20px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #1e2632;
}
.dialog-footer .dialog-btn {
    padding: 8px 24px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 80px;
}
.dialog-footer .dialog-btn:active {
    transform: scale(0.96);
}
.dialog-footer .dialog-btn-confirm {
    background: #3b82f6;
    color: #fff;
}
.dialog-footer .dialog-btn-confirm:hover {
    background: #60a5fa;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.35);
}
.dialog-footer .dialog-btn-confirm.danger {
    background: #d32f2f;
}
.dialog-footer .dialog-btn-confirm.danger:hover {
    background: #f23645;
    box-shadow: 0 4px 20px rgba(242, 54, 69, 0.35);
}
.dialog-footer .dialog-btn-confirm.success {
    background: #00a854;
}
.dialog-footer .dialog-btn-confirm.success:hover {
    background: #00c96a;
    box-shadow: 0 4px 20px rgba(0, 168, 84, 0.35);
}
.dialog-footer .dialog-btn-cancel {
    background: transparent;
    color: #787b86;
}
.dialog-footer .dialog-btn-cancel:hover {
    background: #1a1f2a;
    color: #d1d4dc;
}
.dialog-footer .dialog-btn-only {
    background: #3b82f6;
    color: #fff;
    min-width: 100px;
}
.dialog-footer .dialog-btn-only:hover {
    background: #60a5fa;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.35);
}

/* ─── ANIMATIONS ─── */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 480px) {
    .popup-container {
        width: 96%;
        border-radius: 12px;
    }
    .popup-header { padding: 14px 16px 10px 16px; }
    .popup-body { padding: 16px 16px 8px 16px; }
    .popup-footer { padding: 10px 16px 14px 16px; }
    .popup-actions button {
        min-width: 70px;
        font-size: 12px;
        padding: 8px 0;
    }
}

/* ── Responsive ── */
@media (max-width:600px) {
    .trade-table { font-size:11px; }
    .trade-table thead th, .trade-table tbody td { padding:4px 6px; }
    .account-summary { gap:8px 16px; font-size:11px; }
    .popup-box { padding:18px; }
}