:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: #f4f7fa;
  background: #0b0f14;
  --bg: #0b0f14;
  --panel: #121922;
  --panel-2: #0e151e;
  --line: #263241;
  --muted: #98a6b7;
  --text: #f4f7fa;
  --blue: #6c8cff;
  --green: #50e2b5;
  --red: #ff8199;
  --amber: #e8b666;
}
:root[data-theme="light"] {
  color-scheme: light;
  color: #172638;
  background: #f3f6fb;
  --bg: #f3f6fb;
  --panel: #ffffff;
  --panel-2: #edf2f8;
  --line: #d1dbe7;
  --muted: #52657a;
  --text: #172638;
  --blue: #345bd6;
  --green: #08734e;
  --red: #b52e49;
  --amber: #865707;
}
* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--bg); }
button, input, select { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; line-height: 1.55; }
.eyebrow, .side-label { margin: 0 0 7px; color: #8ea4bd; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 17px; }
h2 { margin-bottom: 7px; font-size: clamp(22px, 3vw, 27px); letter-spacing: -.03em; }
h3 { margin-bottom: 7px; font-size: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 500; }
.brand-mark { display: grid; width: 37px; height: 37px; place-items: center; border-radius: 11px; background: var(--blue); color: #0b0f14; font-size: 19px; font-weight: 800; }
.brand-logo { display: block; width: min(100%, 260px); height: auto; max-height: 88px; padding: 8px 10px; border-radius: 9px; background: #fff; object-fit: contain; object-position: left center; }
.side-brand .brand-logo { width: min(100%, 150px); max-height: 50px; padding: 5px 7px; }
.auth-background { position: fixed; z-index: 0; inset: 0; overflow: hidden; background: #08101b; }
.auth-background-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .72; }
.auth-background-overlay { position: absolute; inset: 0; background: linear-gradient(115deg, #07101bd9, #0b1425a6 48%, #07101bd9), radial-gradient(ellipse at 50% 0%, #17274366, transparent 70%); }
.login-screen { position: relative; z-index: 1; display: grid; min-height: 100vh; place-items: center; padding: 24px; background: radial-gradient(ellipse at 50% 0%, #17274344 0, transparent 65%); }
.auth-pending .login-screen, .auth-pending #app-view { visibility: hidden; }
.auth-pending #auth-background { visibility: hidden; }
.login-card { width: min(100%, 420px); padding: clamp(24px, 5vw, 38px); border: 1px solid #344354cc; border-radius: 17px; background: #121922eF; box-shadow: 0 24px 80px #0009; backdrop-filter: blur(12px); }
.login-card .brand { margin-bottom: 33px; }
.login-card .eyebrow { margin-bottom: 9px; }
.login-card h1 { margin-bottom: 8px; font-size: 30px; }
.login-card > .muted { margin-bottom: 24px; }
label { display: block; color: #d9e1eb; font-size: 13px; font-weight: 650; }
.login-card label { margin: 17px 0 7px; }
input, select { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #344354; border-radius: 8px; outline: 0; background: #0d131b; color: var(--text); }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid #9caeff; outline-offset: 2px; }
.button { display: inline-flex; min-height: 39px; align-items: center; justify-content: center; gap: 8px; padding: 9px 14px; border: 1px solid #344354; border-radius: 8px; background: #18212c; color: var(--text); font-size: 13px; font-weight: 700; cursor: pointer; }
.button:hover { filter: brightness(1.12); }
.button:disabled { cursor: wait; opacity: .6; }
.button.primary { border-color: var(--blue); background: var(--blue); color: #09111f; }
.button.secondary { background: #151f2b; }
.button.danger { border-color: #654047; background: #301d25; color: #ff9dad; }
.login-card .button { width: 100%; margin-top: 12px; }
.switch-copy { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin: 18px 0 0; color: var(--muted); font-size: 12px; }
.text-button { padding: 0; border: 0; background: transparent; color: #a9bcff; font-size: inherit; font-weight: 700; cursor: pointer; }
.error { min-height: 0; margin: 10px 0 0; color: #ff9aa9; font-size: 13px; }
.error:empty { display: none; }
.footnote { margin: 20px 0 0; color: #78889a; font-size: 11px; line-height: 1.55; }
.app-shell { min-height: 100vh; }
.view { display: none; }
.view.active { display: block; animation: appear .16s ease-out; }
@keyframes appear { from { opacity: .6; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
.sidebar { position: fixed; z-index: 5; inset: 0 auto 0 0; display: flex; width: 246px; flex-direction: column; border-right: 1px solid var(--line); background: #0e141c; }
.side-brand { min-height: 76px; padding: 17px 21px; border-bottom: 1px solid var(--line); }
.side-label { margin: 26px 20px 10px; }
#admin-nav { display: grid; gap: 6px; padding: 0 11px; }
.nav-link { display: flex; min-height: 43px; align-items: center; gap: 13px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: #aebaca; font-size: 14px; text-align: left; white-space: nowrap; cursor: pointer; }
.nav-link > span { flex: 1; min-width: 0; white-space: nowrap; }
.nav-link:hover { background: #151f2b; color: #fff; }
.nav-link.active { background: #1b2b45; color: #c7d4ff; box-shadow: inset 3px 0 var(--blue); }
.sidebar-foot { margin-top: auto; padding: 18px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 12px #e8b66666; }
.main-wrap { min-height: 100vh; margin-left: 246px; }
.topbar { position: sticky; z-index: 4; top: 0; display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 16px; padding: 13px clamp(18px, 3vw, 35px); border-bottom: 1px solid var(--line); background: #0b1018ed; backdrop-filter: blur(14px); }
.topbar h1 { margin-top: 3px; }
.top-user { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; font-size: 13px; }
#admin-theme-toggle { flex-shrink: 0; min-width: 76px; }
.role-pill, .badge { display: inline-flex; align-items: center; justify-content: center; padding: 5px 9px; border: 1px solid #344354; border-radius: 999px; background: #17212c; color: #cbd7e3; font-size: 11px; font-weight: 700; white-space: nowrap; }
.role-pill { color: #c0d0ff; }
.content { width: min(100%, 1600px); margin: 0 auto; padding: 24px clamp(16px, 3vw, 35px) 32px; }
.notice { margin-bottom: 23px; padding: 12px 15px; border: 1px solid #334869; border-radius: 9px; background: #17243a; color: #c3d1ff; font-size: 13px; line-height: 1.5; }
.section-heading, .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-heading { margin-bottom: 18px; }
.section-heading p:last-child { margin-bottom: 0; }
.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 13px; margin-bottom: 17px; }
.metric { display: flex; min-height: 124px; flex-direction: column; justify-content: center; gap: 9px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(145deg, #141e29, #101720); }
.metric span { color: var(--muted); font-size: 12px; }
.metric strong { overflow-wrap: anywhere; font-size: clamp(20px, 2.3vw, 27px); font-variant-numeric: tabular-nums; }
.metric small { color: var(--muted); font-size: 11px; }
.metric.accent { border-color: #31436b; }
.metric.accent strong { color: #9db3ff; }
.metric.green { border-color: #245c4d; }
.metric.green strong { color: var(--green); }
.metric.coral strong { color: var(--red); }
.grid-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; margin-top: 15px; }
.overview-market-grid { grid-template-columns: minmax(0, 1fr); }
.panel { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.panel p:last-child { margin-bottom: 0; }
.panel-head { margin-bottom: 13px; }
.panel-head h3 { margin-bottom: 4px; }
.search { display: flex; width: min(100%, 330px); min-height: 41px; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--muted); }
.search input { min-height: 38px; padding-left: 0; border: 0; background: transparent; }
.table-panel { padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
th, td { padding: 12px 14px; border-bottom: 1px solid #202b38; font-size: 12px; }
th { background: #101720; color: #aab8c7; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
td { color: #dce4ed; }
tr:last-child td { border-bottom: 0; }
.positive { border-color: #245c4d; background: #15352e; color: var(--green); }
.negative { border-color: #654047; background: #301d25; color: var(--red); }
.empty { padding: 22px; color: var(--muted); font-size: 13px; text-align: center; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; align-content: start; }
.form-grid > label { display: grid; gap: 7px; }
.form-grid small { font-weight: 400; }
.wide { grid-column: 1 / -1; }
.plain-list { display: grid; gap: 10px; padding-left: 19px; color: #cbd5df; font-size: 13px; line-height: 1.45; }
.invite-result { display: grid; gap: 9px; margin-top: 14px; padding: 12px; border: 1px solid #3d537a; border-radius: 9px; background: #142137; color: #d5dfff; font-size: 12px; }
.invite-result code { overflow-wrap: anywhere; color: #fff; font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; user-select: all; }
.footer { margin-top: 27px; padding-top: 15px; border-top: 1px solid var(--line); color: #75869a; font-size: 11px; }
.modal { position: fixed; z-index: 10; inset: 0; display: grid; place-items: center; padding: 18px; }
.modal-backdrop { position: absolute; inset: 0; background: #030609c9; backdrop-filter: blur(4px); }
.modal-card { position: relative; width: min(100%, 1440px); max-height: 94vh; overflow: auto; padding: 19px; border: 1px solid #3a4a5d; border-radius: 15px; background: #0e151e; box-shadow: 0 28px 90px #000a; }
.modal-card > .panel-head { align-items: flex-start; }
.modal-card h2 { margin-bottom: 5px; font-size: 22px; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); font-size: 22px; cursor: pointer; }
.balance-summary { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 14px 0; padding: 14px 16px; border: 1px solid #245c4d; border-radius: 10px; background: #12251f; }
.balance-summary span { color: var(--muted); font-size: 12px; }
.balance-summary strong { color: var(--green); font-size: 22px; font-variant-numeric: tabular-nums; }
.summary-line { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.summary-line span { color: var(--muted); }
.account-panel { max-width: 760px; }
.account-panel p { margin: 18px 0 0; }
.details-cell { max-width: 310px; overflow-wrap: anywhere; white-space: normal; }
.summary-line { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.summary-line span { color: var(--muted); }
.account-panel { max-width: 760px; }
.account-panel p { margin: 18px 0 0; }
.details-cell { max-width: 310px; overflow-wrap: anywhere; white-space: normal; }
.modal-forms { align-items: start; }
.modal-forms .panel { display: grid; gap: 12px; }
.modal-forms .user-trade-monitor { display: grid; gap: 10px; grid-column: span 1; min-width: 0; }
.monitor-selected-position { min-height: 36px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); font-size: 12px; line-height: 1.55; }
.monitor-chart-host { width: 100%; height: 360px; min-height: 340px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--panel, #0b0f14); }
.monitor-chart-host { position: relative; }
.monitor-kline-canvas { width: 100%; height: 100%; }
.monitor-kline-status { position: absolute; inset: 8px auto auto 8px; z-index: 2; max-width: calc(100% - 16px); padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); color: var(--muted); font-size: 12px; }
.monitor-kline-status[hidden] { display: none; }
.monitor-position-button { width: 100%; color: var(--text); text-align: left; cursor: pointer; }
.monitor-position-button[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 3px 0 var(--accent); }
@media (max-width: 600px) { .monitor-chart-host { height: 300px; min-height: 260px; } }
.record-list { display: grid; gap: 9px; max-height: 230px; overflow: auto; }
.record { padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); font-size: 12px; line-height: 1.55; }
.record strong { color: var(--text); }
.toast-area { position: fixed; z-index: 20; top: 16px; right: 16px; display: grid; gap: 8px; }
.toast { max-width: min(390px, calc(100vw - 32px)); padding: 12px 15px; border: 1px solid #3a4a5d; border-radius: 9px; background: #182331; color: var(--text); font-size: 13px; box-shadow: 0 10px 35px #0008; }
:root[data-theme="light"] .sidebar { background: #fff; }
:root[data-theme="light"] .topbar { background: #ffffffed; }
:root[data-theme="light"] .eyebrow,
:root[data-theme="light"] .side-label,
:root[data-theme="light"] .footnote,
:root[data-theme="light"] .footer { color: var(--muted); }
:root[data-theme="light"] label,
:root[data-theme="light"] td,
:root[data-theme="light"] .plain-list { color: var(--text); }
:root[data-theme="light"] input,
:root[data-theme="light"] select { background: #fff; border-color: var(--line); }
:root[data-theme="light"] .button { background: #edf2f8; border-color: var(--line); }
:root[data-theme="light"] .button.primary,
:root[data-theme="light"] .brand-mark { background: var(--blue); color: #fff; }
:root[data-theme="light"] .button.danger { border-color: #ecc0ca; background: #fff0f2; color: #a9233c; }
:root[data-theme="light"] .button:hover { filter: brightness(.96); }
:root[data-theme="light"] .nav-link { color: var(--muted); }
:root[data-theme="light"] .nav-link:hover { background: #edf2f8; color: var(--text); }
:root[data-theme="light"] .nav-link.active { background: #e6edff; color: #244ab5; }
:root[data-theme="light"] .role-pill,
:root[data-theme="light"] .badge { background: #edf2f8; color: #344b66; border-color: var(--line); }
:root[data-theme="light"] .notice,
:root[data-theme="light"] .invite-result { background: #eaf0ff; color: #294b91; border-color: #c6d5f3; }
:root[data-theme="light"] .invite-result code { color: var(--text); }
:root[data-theme="light"] .metric { background: linear-gradient(145deg, #fff, #edf2fa); }
:root[data-theme="light"] .metric.accent { border-color: #c6d5f3; }
:root[data-theme="light"] .metric.accent strong { color: #345bd6; }
:root[data-theme="light"] th { background: #edf2f8; color: #465a70; }
:root[data-theme="light"] th,
:root[data-theme="light"] td { border-color: var(--line); }
:root[data-theme="light"] .positive,
:root[data-theme="light"] .balance-summary { background: #e5f6ee; color: var(--green); border-color: #a4d6bf; }
:root[data-theme="light"] .negative { background: #fff0f2; color: var(--red); border-color: #ecc0ca; }
:root[data-theme="light"] .error { color: var(--red); }
:root[data-theme="light"] .text-button { color: #345bd6; }
:root[data-theme="light"] .modal-card,
:root[data-theme="light"] .toast { background: var(--panel); border-color: var(--line); box-shadow: 0 20px 65px #233b6026; }
:root[data-theme="light"] .login-card { background: #fffffff2; border-color: var(--line); }
@media (max-width: 1120px) { .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .sidebar { position: static; width: auto; min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-brand { min-height: 60px; padding: 11px 16px; }
  .side-label, .sidebar-foot { display: none; }
  #admin-nav { display: flex; overflow-x: auto; padding: 8px; }
  .nav-link { flex: 0 0 auto; min-height: 38px; gap: 7px; padding: 0 10px; font-size: 12px; }
  .main-wrap { margin-left: 0; }
  .topbar { position: static; min-height: 67px; padding: 12px 16px; }
  .content { padding-top: 16px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-two { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .modal-forms { grid-template-columns: 1fr; }
}
@media (max-width: 450px) {
  .topbar { align-items: flex-start; }
  .top-user { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
  .top-user > span:first-child { max-width: 115px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top-user .button { min-height: 34px; padding: 7px 9px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .search { width: 100%; }
  .metrics { gap: 9px; }
  .metric { min-height: 106px; padding: 13px; }
  .metric strong { font-size: 19px; }
  .login-screen { padding: 14px; }
  .modal { padding: 8px; }
  .modal-card { max-height: 97vh; padding: 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-background-video { display: none; }
  .auth-background { background: radial-gradient(ellipse at 50% 0%, #172743 0, #0b0f14 70%); }
}

/* Sidebar disclosure: fixed page gutter avoids scrollbar shifts on toggle. */
html { scrollbar-gutter: stable; }
.top-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
#admin-sidebar-toggle { flex: 0 0 36px; }
.sidebar { overflow-y: auto; overflow-x: hidden; }
.sidebar-close { position: absolute; right: 10px; top: 20px; }
.side-brand { padding-right: 56px; }
.admin-sidebar-closed .sidebar { visibility: hidden; transform: translateX(-100%); pointer-events: none; }
.admin-sidebar-closed .main-wrap { margin-left: 0; }
@media (max-width: 760px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 8; width: min(246px, 85vw); height: 100dvh; border-right: 1px solid var(--line); }
  .side-label { display: block; }
  .sidebar-foot { display: block; }
  #admin-nav { display: grid; overflow: visible; padding: 0 11px; }
  .nav-link { min-height: 43px; font-size: 14px; }
  .sidebar-close { top: 12px; }
  .main-wrap { margin-left: 0; }
  body:not(.admin-sidebar-open) .sidebar { visibility: hidden; transform: translateX(-100%); }
  .topbar { flex-wrap: wrap; }
}

.academy-price-controls{padding:12px;border:1px solid var(--line);border-radius:9px;background:var(--panel-2)}.academy-price-buttons{display:flex;flex-wrap:wrap;gap:8px}.academy-monitor-heading{margin:8px 0 0}.academy-monitor-chart{width:100%;height:280px;overflow:hidden;border:1px solid var(--line);border-radius:9px;background:var(--panel-2);color:var(--muted);font-size:13px;display:grid;place-items:center;padding:12px;text-align:center}.academy-monitor-chart svg{width:100%;height:100%}@media(max-width:760px){.academy-monitor-chart{height:230px}.academy-price-buttons>*{flex:1 1 100%}}


.password-field { position: relative; display: block; width: 100%; min-width: 0; }
.password-field > input { padding-right: 44px; }
.password-toggle { position: absolute; top: 50%; right: 5px; display: grid; width: 34px; height: 34px; place-items: center; transform: translateY(-50%); border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.password-toggle:hover { background: var(--panel-2); color: var(--text); }
.password-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.password-feedback { margin: 8px 0 14px; color: var(--muted); font-size: 11px; }
.password-strength { margin: 0 0 6px; }
.password-strength strong[data-strength="weak"] { color: #ff8b8b; }
.password-strength strong[data-strength="medium"] { color: #f6c96b; }
.password-strength strong[data-strength="strong"] { color: #42d6a4; }
.password-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; margin: 0; padding: 0; list-style: none; }
.password-rules li::before { display: inline-block; width: 16px; color: #8290a2; content: "○"; }
.password-rules li.met { color: #42d6a4; }
.password-rules li.met::before { color: #42d6a4; content: "✓"; }
@media (max-width: 420px) { .password-rules { grid-template-columns: 1fr; } }
