/* Refined dark terminal theme. Palette comes from the original style.css. */
:root {
  color-scheme: dark;
  --bg:#09101b;
  --sidebar:#0d1522;
  --panel:#101c2d;
  --panel-alt:#132237;
  --border:#233146;
  --text:#edf3fc;
  --muted:#8696ad;
  --blue:#658bfa;
  --buy:#ef616e;
  --sell:#29bba0;
  --soft:#c9d5eb;
  --radius:14px;
  --shadow:0 12px 32px rgba(2,8,18,.18);
}
html,body {background:var(--bg);color:var(--text)}
body {font-size:13px}
button,select,input {transition:background-color .16s ease,border-color .16s ease,color .16s ease,box-shadow .16s ease,transform .16s ease}
button:active:not(:disabled) {transform:translateY(1px)}
button:focus-visible {outline:2px solid #91adff;outline-offset:2px}
input:focus,select:focus {box-shadow:0 0 0 3px rgba(101,139,250,.2)}
.sidebar {background:#0d1522;border-color:#223149}
.brand {padding-bottom:27px}
.nav {font-weight:560;border:1px solid transparent;border-radius:10px}
.nav:hover {background:#172841;color:#edf3fc}
.nav.active {background:linear-gradient(90deg,#263e6d,#1a3155);border-color:#39558b;color:#fff;box-shadow:inset 3px 0 #7da1ff;font-weight:720}
.nav.active .nav-symbol {color:#a9c1ff}
.nav-count {background:#334d78;color:#e6efff}
.layout {align-items:stretch}
.main {display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;margin:0 auto;padding:24px 32px 22px}
.topbar h1 {font-weight:750;letter-spacing:-.5px}
.provider-select {height:40px;background:#142238;border-color:#2a3b54}
.provider-select select {font-size:12px;color:#dce8f9}
.account-nav-button {display:flex;align-items:center;gap:9px;min-height:40px;padding:5px 12px 5px 7px}
.avatar-small {height:26px;width:26px;display:grid;place-items:center;border-radius:50%;background:#294a7e;color:#d5e5ff;font-weight:800;font-size:12px}
.button {border-radius:9px;background:#192c47;border-color:#2e4564;color:#e9f1ff}
.button:hover {background:#254165;border-color:#5779ae;color:#fff;filter:none}
.button.subtle {background:#14243a}
.button.subtle:hover {background:#1d3553}
.primary-button,.button.primary-button {background:#4a75ed;border-color:#648cf6;color:#fff}
.primary-button:hover,.button.primary-button:hover {background:#5b84f4;color:#fff}
.metrics,.account-metrics {gap:14px;margin-bottom:18px}
.metric {min-height:136px;padding:20px 21px;box-shadow:var(--shadow)}
.metric.primary {background:linear-gradient(135deg,#1c386a,#172b4e 76%);border-color:#476cb5}
.metric-big {font-size:clamp(21px,2vw,29px);font-weight:760;letter-spacing:-.8px;margin:11px 0 13px}
.metric-foot {border-color:#ffffff1b}
.panel {box-shadow:var(--shadow)}
.panel-head {padding:20px 21px 17px}
.panel-head h2,.quick-panel h2 {font-weight:700}
.mini-eyebrow {color:#7894ba}
.market-tools select,.market-tools input,#orderFilter,.field-row input,.modal-card input,.modal-card select,.statement-panel input {border-color:#30445d;background:#0d1a2c;color:#e7effb;border-radius:8px}
input::placeholder {color:#7387a1}
.market-tools select,.market-tools input,#orderFilter {height:36px}
th {background:#14243b;color:#a4b6cc;font-weight:650;border-bottom:1px solid #30435d}
td {border-color:#22334b;color:#c6d4e6}
tbody tr {transition:background-color .14s ease}
tbody tr:hover {background:#16263a}
.quote-row:hover {background:#1a304a}
.quote-row.selected {background:#203b5b;box-shadow:inset 3px 0 #6e98f0}
.stock-name {color:#f2f6ff}
.subtle-code {color:#8299b5}
.watch-star:hover {color:#ffd477}
.action-link {background:#1d3b63;border-color:#426998;color:#bed4ff}
.action-link:hover {background:#2a5180;border-color:#7096c7}
.table-footer,.chart-foot {color:#8398b1}
.ticket-stock {background:#162941;border-color:#2b425e}
.tag {background:#24406a;color:#bdd3ff}
.segment {background:#0b1728;border:1px solid #263b54;border-radius:9px}
.segment button:hover:not(.selected) {background:#1a2b42;color:#e5eefb}
.segment button.selected.buy {background:#813944;color:#ffe2e4}
.segment button.selected.sell {background:#176c5e;color:#d3fff0}
.kind-segment button.selected {background:#2b466d;color:#eaf2ff}
.field-row input:disabled {background:#111f31;color:#8190a4}
.quick-qty button {background:#192b43;border-color:#2e4562;border-radius:7px}
.quick-qty button:hover {background:#29456a;color:#e8f0ff;border-color:#597eaf}
.trade-estimate {border:1px solid #263b54;background:#0d1a2d}
.submit-buy {background:#bf4b56;border:1px solid #d65e69;border-radius:9px}
.submit-buy:hover {background:#d65d67;border-color:#ef8089}
.submit-sell {background:#188977;border:1px solid #27ae98;border-radius:9px}
.submit-sell:hover {background:#20a18b;border-color:#4ccab5}
.ticket-notice {color:#8ba0b9}
.quick-action:hover {background:#182a41}
.settle-hero {box-shadow:var(--shadow)}
.settle-button {background:#4e78e7;border-color:#638cf2}
.settle-button:hover {background:#6088ef}
.modal-overlay {background:rgba(2,8,18,.76);backdrop-filter:blur(5px)}
.modal-card {background:#15253a;border-color:#39506d;color:#edf3fc}
.modal-card h2 {color:#f2f6ff}
.modal-card p {color:#a7b8cd}
.modal-close:hover {color:#fff}
.toast {background:#263f5e;border-color:#5a78a0}
.toast.error {background:#542b35;border-color:#ae5c6d}

/* Account center: same structure and data as the light iteration. */
body.account-page .metrics {display:none}
.account-hero {display:flex;justify-content:space-between;align-items:center;padding:16px 24px;gap:18px;margin-bottom:16px;min-height:116px;background:linear-gradient(108deg,#172b49,#102039 78%);border-color:#36537d}
.tab-panel>.account-hero {min-height:116px}
.account-identity {display:flex;gap:14px;align-items:center;min-width:0}
.account-avatar {width:56px;height:56px;flex:none;border-radius:16px;background:#294a7b;display:grid;place-items:center;color:#d5e5ff;font-size:26px;font-weight:750;box-shadow:inset 0 0 0 1px #6385b055}
.account-identity h2 {font-size:21px;color:#f3f7ff;letter-spacing:-.4px;margin:4px 0 5px;font-weight:730;overflow-wrap:anywhere}
.account-subtitle {display:flex;gap:9px;align-items:center;flex-wrap:wrap;font-size:11px;color:#9cb0ca}
.account-mode {padding:4px 9px;border-radius:20px;color:#c5d8ff;background:#294771;font-weight:650}
.account-metrics {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:16px}
.account-stat {min-width:0;min-height:140px;padding:22px 22px;display:flex;flex-direction:column;gap:10px}
.account-stat:first-child {background:linear-gradient(140deg,#1a335c,#142742);border-color:#44659a}
.account-stat>span {font-size:12px;color:#a8bad0}
.account-stat strong {font-size:clamp(21px,1.9vw,29px);letter-spacing:-.7px;color:#f4f8ff;font-weight:760;white-space:nowrap;font-variant-numeric:tabular-nums}
.account-stat small {font-size:11px;color:#90a6bf}
.account-stat small.positive {color:var(--buy)!important}
.account-stat small.negative {color:var(--sell)!important}
.account-content-grid {display:grid;grid-template-columns:minmax(0,1.3fr) minmax(290px,.85fr);gap:16px;margin-bottom:16px;align-items:stretch}
.account-panel-pad {padding:24px 26px;min-width:0}
.account-section-head {display:flex;align-items:start;justify-content:space-between;gap:10px;margin-bottom:18px}
.account-section-head h2 {font-size:17px;margin:6px 0 0;color:#f1f5ff}
.account-subtle {font-size:11px;color:#8fa3bc}
.allocation-track {display:flex;overflow:hidden;width:100%;height:13px;border-radius:20px;background:#0a1626;margin:29px 0 21px;box-shadow:inset 0 0 0 1px #2d4059}
.allocation-track>div {height:100%;transition:width .3s ease}
.allocation-cash,.legend-cash {background:#668efa}
.allocation-frozen,.legend-frozen {background:#8799b0}
.allocation-stocks,.legend-stock {background:#43b7ae}
.allocation-legend {display:grid;gap:12px;padding-bottom:6px}
.allocation-legend>div {display:flex;align-items:center;gap:10px;color:#a0b2c8;font-size:12px}
.allocation-legend b {margin-left:auto;color:#e5efff;font-weight:670;font-variant-numeric:tabular-nums}
.legend-dot {width:9px;height:9px;display:inline-block;border-radius:3px}
.account-divider-line {height:1px;background:#2a3b51;margin:20px 0}
.account-kv {display:flex;align-items:center;justify-content:space-between;gap:14px;padding:9px 0;font-size:12px;color:#98abc3}
.account-kv b {color:#e4edfb;font-weight:680;text-align:right;font-variant-numeric:tabular-nums}
.account-operations>p {color:#9eb0c7;margin:0 0 22px;line-height:1.85;font-size:12px}
.account-primary-action,.account-secondary-action {display:flex;width:100%;align-items:center;gap:14px;text-align:left;border:1px solid #2b405a;border-radius:10px;padding:13px 15px;background:#13243a;color:#dce8f9;margin-bottom:11px}
.account-primary-action {background:#19345a;border-color:#3b608f}
.account-primary-action:hover {background:#244673;border-color:#6589b9}
.account-secondary-action:hover {background:#1c344f;border-color:#476789}
.account-primary-action span:nth-child(2),.account-secondary-action span:nth-child(2) {flex:1}
.account-primary-action b,.account-secondary-action b {font-size:12px;display:block}
.account-primary-action small,.account-secondary-action small {display:block;margin-top:4px;color:#94a8c1;font-size:11px}
.action-icon {width:35px;height:35px;display:grid;place-items:center;flex:none;border-radius:9px;background:#2b4d79;color:#d4e4ff;font-size:21px;font-weight:650}
.account-secondary-action .action-icon {background:#213751;color:#adc3df}
.account-bottom-grid {margin-bottom:0}
.account-fund-history .table-scroll {max-height:340px;overflow-y:auto}
.account-danger-zone .reset-explain strong {font-size:13px;color:#e8effb}
.account-danger-zone .reset-explain p {line-height:1.9;font-size:12px;color:#9caec3;margin:8px 0 17px}
.reset-outline {border-color:#76515b;color:#ffb8be;background:#3a252f}
.reset-outline:hover {background:#53303c;border-color:#b7707d;color:#fff}
.flow-type {display:inline-flex;align-items:center;padding:5px 9px;border-radius:7px;font-size:11px;font-weight:680}
.flow-deposit {background:#194b43;color:#82e2c4}
.flow-withdraw {background:#56323d;color:#ffadb8}
.modal-actions {display:flex;justify-content:flex-end;gap:10px;margin-top:24px}
.account-modal .modal-actions .button {min-width:120px}
#resetForm .field-label {display:block}
.reset-warning-icon {height:40px;width:40px;background:#512d39;color:#ff9faa;display:grid;place-items:center;border-radius:12px;font-size:21px;font-weight:800;margin-bottom:18px}
.reset-danger-button {background:#b84654;color:#fff;border-color:#d96672}
.reset-danger-button:hover {background:#ce5360;color:#fff;border-color:#ec7d87}
.reset-danger-button:disabled {background:#6c434d;color:#bba0a7;border-color:#83505c;opacity:.8}
@media(max-width:1370px){.main{padding:24px 22px}.account-stat{padding:19px 15px}.account-panel-pad{padding:22px}}
@media(max-width:1050px){.account-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.account-content-grid{grid-template-columns:1fr}.account-operations{max-width:none}}
@media(max-width:690px){.main{padding:20px 14px}.account-hero{padding:16px;align-items:flex-start;flex-direction:column}.account-avatar{width:50px;height:50px;border-radius:15px;font-size:24px}.account-identity{gap:12px}.account-identity h2{font-size:19px}.account-metrics{gap:9px}.account-stat{padding:15px 13px;min-height:116px}.account-stat strong{font-size:20px;white-space:normal}.account-panel-pad{padding:20px}.top-actions{gap:8px}.account-nav-button{padding:5px 8px}.modal-actions{flex-wrap:wrap}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{transition:none!important;animation:none!important}}
