:root {
    --iq-bg: #060b12;
    --iq-panel: #0d1520;
    --iq-border: rgba(148, 178, 208, 0.16);
    --iq-green: #1fd6a4;
    --iq-red: #ff5d72;
    --iq-text: #eef5fb;
    --iq-muted: #8fa3b8;
    --iq-accent: #e8b86d;
    --iq-input: #0a121c;
    --iq-blue: #3aa0ff;
    color-scheme: dark;
}

html { color-scheme: dark; }
body {
    background-color: var(--iq-bg);
    background-image: radial-gradient(circle at 12% -10%, rgba(33, 103, 121, 0.2), transparent 32%), linear-gradient(145deg, #0e1921 0%, #0a1117 58%, #101820 100%);
    color: var(--iq-text);
    font-family: 'Outfit', sans-serif;
}

input, textarea, select, button { font-family: inherit; }
input, textarea, select { color-scheme: dark; }
input::placeholder, textarea::placeholder, .form-control::placeholder { color: #8d9dac !important; opacity: 1; }

.sidebar {
    background: linear-gradient(180deg, #13212a 0%, #101922 100%);
    border-color: rgba(145, 167, 181, 0.15);
    box-shadow: 12px 0 35px rgba(0, 0, 0, 0.18);
}
.sidebar-header { border-color: rgba(145, 167, 181, 0.14); }
.sidebar a {
    margin-left: 8px;
    border-radius: 8px;
    color: #a6b4c0;
}
.sidebar a:hover { background: rgba(255, 255, 255, 0.055); color: #f4f7fa; }
.sidebar a.active {
    border-left: 2px solid var(--iq-green);
    background: rgba(36, 198, 166, 0.1);
    color: #55d7bf;
}
.mobile-toggle {
    border-radius: 8px;
    background: #17252f;
    border-color: rgba(145, 167, 181, 0.24);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.main-content { min-width: 0; }
.page-title { color: #f2f6f8; letter-spacing: 0; }
.iq-card {
    border-color: rgba(145, 167, 181, 0.15);
    border-radius: 10px;
    background: linear-gradient(145deg, #14212a, #111a22);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
}
.stat-card {
    border-color: rgba(145, 167, 181, 0.14);
    border-radius: 9px;
    background: #0f1a22;
}
.stat-icon { color: #66a7b5; opacity: 0.42; }

.table-responsive {
    max-width: 100%;
    overflow-x: auto;
    border-color: rgba(145, 167, 181, 0.15);
    border-radius: 9px;
    background: rgba(8, 15, 20, 0.28);
}
.iq-table th {
    background: #14212a;
    color: #a7b6c2;
}
.iq-table td { color: #e2eaf0; }
.iq-table tbody tr:hover { background: rgba(82, 163, 157, 0.055); }

.btn-iq, .btn, .admin-action-btn {
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}
.btn-iq { border-radius: 8px; }
.btn-iq-primary, .btn-primary { background-color: #427bd0; color: #fff; }
.btn-iq-primary:hover, .btn-primary:hover { background-color: #528ce2; color: #fff; }
.btn-iq-success, .btn-success { background-color: #159d83; color: #fff; }
.btn-iq-success:hover, .btn-success:hover { background-color: #1bb399; color: #fff; }
.btn-iq-danger, .btn-danger { background-color: #c64e5b; color: #fff; }
.btn-iq-danger:hover, .btn-danger:hover { background-color: #dc5b68; color: #fff; }
.badge-iq, .badge { border-radius: 6px; }

.form-control, .form-select, select {
    min-width: 0;
    border-color: #2a3b47;
    border-radius: 8px;
    background-color: #0d1720;
    color: #eef3f7;
}
.form-select, select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 38px;
    background-image:
        linear-gradient(45deg, transparent 50%, #91a5b4 50%),
        linear-gradient(135deg, #91a5b4 50%, transparent 50%);
    background-position: calc(100% - 16px) 50%, calc(100% - 12px) 50%;
    background-size: 4px 4px, 4px 4px;
    background-repeat: no-repeat;
}
.form-select option, select option { background: #111d26; color: #edf3f7; }
.form-control:focus, .form-select:focus, select:focus, textarea:focus {
    border-color: rgba(36, 198, 166, 0.68);
    background-color: #0d1720;
    box-shadow: 0 0 0 3px rgba(36, 198, 166, 0.12);
    color: #f4f7f9;
}
.form-check-input { border-color: #3b4c58; background-color: #0d1720; }
.form-check-input:checked { border-color: var(--iq-green); background-color: #159d83; }
.form-label { color: #aebbc5; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid rgba(75, 211, 188, 0.78);
    outline-offset: 2px;
}

.modal-content {
    border-color: rgba(145, 167, 181, 0.2);
    border-radius: 10px;
    background: #121d26;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
}
.modal-header, .modal-footer { border-color: rgba(145, 167, 181, 0.15); }
.modal-backdrop.show { opacity: 0.72; backdrop-filter: blur(5px); }
.toast {
    border-color: rgba(145, 167, 181, 0.2);
    border-radius: 9px;
    background: #14212a;
    color: #edf3f7;
}
.toast-header { border-color: rgba(145, 167, 181, 0.14); background: #101a22; color: #edf3f7; }

/* Client trading room */
.top-bar {
    background: rgba(16, 26, 39, 0.96);
    border-bottom-color: rgba(151, 169, 193, 0.18);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}
.left-sidebar, .right-sidebar {
    background: #111a2a;
    border-color: rgba(151, 169, 193, 0.16);
}
.main-stage { background: #121c2d; }
.chart-shell { background: #121c2d; }
.chart-toolbar { background: rgba(18, 28, 45, 0.96); border-bottom-color: rgba(151, 169, 193, 0.14); }
.chart-symbol-mark { border-color: rgba(39, 211, 109, 0.25); background: rgba(39, 211, 109, 0.1); color: #27d36d; }
.chart-market-name { color: #f4f7fb; }
.chart-market-subtitle, .chart-status { color: #8999b0; }
.chart-timeframe.active { border-color: rgba(39, 211, 109, 0.32); background: rgba(39, 211, 109, 0.12); color: #55df8b; }
.asset-btn, .iq-input, .iq-dropdown-head, .asset-select-head { background: #182438; border-color: rgba(151, 169, 193, 0.2); }
.right-sidebar { padding: 16px; }
.control-label { color: #9facc1; }
.order-book { background: rgba(8, 14, 25, 0.42); border-color: rgba(151, 169, 193, 0.12); }
.btn-call { background: #19ad65; box-shadow: 0 8px 24px rgba(25, 173, 101, 0.25); }
.btn-put { background: #db5868; box-shadow: 0 8px 24px rgba(219, 88, 104, 0.22); }
.btn-trade-iq { border-radius: 7px; }
.trade-confirm-card, .blind-card, .alert-box, .result-card { background: #172237; border-color: rgba(151, 169, 193, 0.2); }
.trade-confirm-head { background: rgba(8, 14, 25, 0.28); }
.btn-confirm.go.up { background: #19ad65; }
.btn-confirm.go.down { background: #db5868; }

.login-card, .register-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(145, 167, 181, 0.2);
    border-radius: 12px;
    background: linear-gradient(150deg, rgba(21, 34, 44, 0.98), rgba(15, 24, 32, 0.98));
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
}
.login-card::before, .register-card::before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #0d6efd, #70a9ff 58%, #d7e7ff);
    content: "";
}
.login-card .logo-text, .register-card .logo-text { color: #f2f6f8; letter-spacing: 0; }
.login-card .form-control, .register-card .form-control { min-height: 46px; }
.login-card .btn-primary, .register-card .btn-primary {
    border-radius: 8px;
    background: #0d6efd;
    color: #fff;
}
.login-card .btn-primary:hover, .register-card .btn-primary:hover { background: #3d8bfd; }
.login-card .text-link, .register-card .text-link { color: #69b6e8; }
.login-card .alert-danger, .register-card .alert-danger {
    border-color: rgba(240, 101, 112, 0.32);
    border-radius: 8px;
    background: rgba(240, 101, 112, 0.1);
    color: #ff8d95;
}

@media (max-width: 768px) {
    .main-content { width: 100%; min-width: 0; }
    .page-header-row, .page-header-actions { min-width: 0; }
    .page-header-actions > * { max-width: 100%; }
    .table-actions { max-width: 100%; }
}

@media (max-width: 480px) {
    .login-card, .register-card { padding: 28px 20px; }
    .table-actions { gap: 4px; }
    .modal-dialog { margin: 10px; }
}

/* Shared blue accent for all authenticated controls. */
.btn-call { background: #0d6efd !important; box-shadow: 0 8px 24px rgba(13, 110, 253, 0.28) !important; }
.btn-confirm.go.up { background: #0d6efd !important; }

#btnMethodUSDT, #btnMethodUPI {
    border-color: rgba(13, 110, 253, 0.55) !important;
    background: rgba(13, 110, 253, 0.08) !important;
    color: #75adff !important;
}
#btnMethodUSDT:hover, #btnMethodUPI:hover,
#btnMethodUSDT.active, #btnMethodUPI.active {
    border-color: #0d6efd !important;
    background: #0d6efd !important;
    color: #fff !important;
    box-shadow: 0 6px 18px rgba(13, 110, 253, 0.22);
}