:root {
  --bg: #080c11;
  --bg-deep: #05080c;
  --sidebar: #0b1016;
  --surface: #10161e;
  --surface-2: #141c25;
  --surface-3: #19232e;
  --border: rgba(160, 186, 203, 0.13);
  --border-strong: rgba(160, 186, 203, 0.23);
  --text: #eef6f4;
  --muted: #85949e;
  --muted-2: #5d6a73;
  --mint: #63e6b9;
  --lime: #b5f36a;
  --cyan: #54c8ea;
  --red: #ff6e72;
  --amber: #f6c35b;
  --violet: #a78bfa;
  --radius: 16px;
  --radius-small: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--bg); }
body { min-height: 100vh; margin: 0; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--mint); outline-offset: 2px;
}
[hidden] { display: none !important; }

.ambient { position: fixed; z-index: 0; width: 520px; height: 520px; border-radius: 50%; filter: blur(120px); opacity: .08; pointer-events: none; }
.ambient-one { right: -220px; top: -240px; background: var(--mint); }
.ambient-two { left: -260px; bottom: -280px; background: #1d63ef; }

.eyebrow { margin: 0 0 5px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.brand-lockup { display: flex; align-items: center; gap: 11px; color: #f5fbf8; font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.brand-lockup b { color: var(--mint); font-weight: 700; }
.brand-symbol { display: inline-flex; align-items: flex-end; gap: 3px; width: 30px; height: 30px; padding: 7px; border: 1px solid rgba(99, 230, 185, .38); border-radius: 9px; background: rgba(99, 230, 185, .08); box-shadow: inset 0 0 18px rgba(99, 230, 185, .05); }
.brand-symbol i { display: block; width: 3px; border-radius: 4px; background: var(--mint); }
.brand-symbol i:nth-child(1) { height: 7px; opacity: .55; }
.brand-symbol i:nth-child(2) { height: 13px; }
.brand-symbol i:nth-child(3) { height: 9px; opacity: .72; }

/* Login */
.login-screen { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.login-card { width: min(940px, 100%); min-height: 560px; display: grid; grid-template-columns: 1.08fr .92fr; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 24px; background: rgba(13, 19, 26, .94); box-shadow: 0 40px 110px rgba(0, 0, 0, .48); backdrop-filter: blur(22px); }
.login-visual { position: relative; overflow: hidden; min-height: 560px; background: radial-gradient(circle at 68% 40%, rgba(99, 230, 185, .12), transparent 44%), linear-gradient(145deg, #0b1118, #090d13); border-right: 1px solid var(--border); }
.login-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 48%, rgba(99, 230, 185, .025) 50%, transparent 52%); }
.signal-grid { position: absolute; inset: 0; opacity: .45; background-image: linear-gradient(rgba(126, 151, 166, .075) 1px, transparent 1px), linear-gradient(90deg, rgba(126, 151, 166, .075) 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(to bottom, transparent, #000 25%, #000 80%, transparent); }
.login-visual svg { position: absolute; left: 7%; right: 7%; top: 31%; width: 86%; overflow: visible; }
.login-visual path { fill: none; stroke: url(#login-line); stroke-width: 3; stroke-linecap: round; filter: drop-shadow(0 0 9px rgba(99, 230, 185, .3)); }
.login-visual circle { fill: var(--lime); filter: drop-shadow(0 0 10px rgba(181, 243, 106, .8)); }
.login-ticker { position: absolute; left: 42px; right: 42px; bottom: 40px; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; }
.login-ticker strong { display: flex; align-items: center; gap: 7px; color: var(--mint); font-size: 10px; letter-spacing: .14em; }
.login-ticker strong::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 10px var(--mint); }
.login-content { display: flex; flex-direction: column; justify-content: center; padding: 54px 52px; }
.login-content > .brand-lockup { margin-bottom: 58px; }
.login-content h1 { max-width: 360px; margin: 0; font-size: clamp(31px, 4vw, 44px); line-height: 1.03; letter-spacing: -.045em; }
.login-copy { margin: 18px 0 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.login-form { display: grid; gap: 12px; margin-top: 34px; }
.login-form label { color: #c7d2d2; font-size: 12px; font-weight: 700; }
.password-field { position: relative; }
.password-field input { width: 100%; height: 48px; padding: 0 48px 0 15px; color: var(--text); border: 1px solid var(--border-strong); border-radius: 10px; background: rgba(4, 8, 12, .48); transition: border-color .2s, box-shadow .2s; }
.password-field input::placeholder { color: var(--muted-2); }
.password-field input:focus { border-color: rgba(99, 230, 185, .6); box-shadow: 0 0 0 3px rgba(99, 230, 185, .08); outline: none; }
.password-field button { position: absolute; right: 7px; top: 7px; width: 34px; height: 34px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; }
.password-field button:hover { color: var(--mint); background: rgba(99, 230, 185, .07); }
.form-error { margin: 0; color: #ff9a9e; font-size: 12px; line-height: 1.45; }
.primary-button { height: 48px; display: flex; justify-content: space-between; align-items: center; padding: 0 17px; border: 0; border-radius: 10px; color: #07110e; background: linear-gradient(110deg, var(--mint), var(--lime)); font-weight: 800; transition: transform .2s, filter .2s; }
.primary-button:hover { transform: translateY(-1px); filter: brightness(1.04); }
.primary-button:disabled { cursor: wait; opacity: .65; transform: none; }
.security-note { display: flex; align-items: center; gap: 8px; margin-top: 17px; color: var(--muted-2); font-size: 11px; }
.security-note span { color: var(--mint); font-size: 8px; }

/* App shell and sidebar */
.app-shell { position: relative; z-index: 1; min-height: 100vh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 23px 16px 18px; border-right: 1px solid var(--border); background: rgba(9, 14, 20, .96); backdrop-filter: blur(18px); }
.sidebar-brand { padding: 0 8px; }
.environment-chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; margin: 25px 8px 19px; padding: 6px 9px; border: 1px solid rgba(84, 200, 234, .18); border-radius: 7px; color: #98cddd; background: rgba(84, 200, 234, .06); font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.environment-chip span { width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 7px var(--cyan); }
.main-nav { display: grid; gap: 4px; }
.nav-item { width: 100%; height: 42px; display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid transparent; border-radius: 9px; color: #87959f; background: transparent; text-align: left; font-size: 13px; font-weight: 650; transition: color .15s, background .15s, border-color .15s; }
.nav-item:hover { color: #dbe8e5; background: rgba(255, 255, 255, .025); }
.nav-item.active { color: #f0f9f6; border-color: rgba(99, 230, 185, .12); background: linear-gradient(90deg, rgba(99, 230, 185, .1), rgba(99, 230, 185, .025)); }
.nav-icon { color: var(--muted-2); font-family: Georgia, serif; font-size: 18px; }
.nav-item.active .nav-icon { color: var(--mint); }
.nav-item b { min-width: 20px; padding: 2px 6px; border-radius: 9px; color: var(--muted); background: rgba(255, 255, 255, .04); font-size: 9px; text-align: center; }
.sidebar-spacer { flex: 1; }
.sidebar-health { margin: 0 7px 14px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255, 255, 255, .018); }
.sidebar-health > div { display: flex; align-items: center; gap: 7px; }
.sidebar-health b { font-size: 11px; }
.sidebar-health small { display: block; margin-top: 6px; color: var(--muted-2); font-size: 9px; line-height: 1.35; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px rgba(246, 195, 91, .6); }
.status-dot.ok { background: var(--mint); box-shadow: 0 0 8px rgba(99, 230, 185, .65); }
.status-dot.error { background: var(--red); box-shadow: 0 0 8px rgba(255, 110, 114, .65); }
.logout-button { height: 36px; display: flex; justify-content: space-between; align-items: center; margin: 0 7px; padding: 0 10px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 11px; }
.logout-button:hover { color: #f0f5f4; background: rgba(255, 255, 255, .03); }

/* Workspace */
.workspace { min-width: 0; padding: 0 30px 50px; background: radial-gradient(circle at 55% -20%, rgba(40, 82, 91, .10), transparent 38%); }
.topbar { min-height: 88px; display: flex; align-items: center; gap: 24px; border-bottom: 1px solid var(--border); }
.topbar-title h1 { margin: 0; font-size: 21px; line-height: 1.1; letter-spacing: -.025em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.period-control { display: flex; padding: 3px; border: 1px solid var(--border); border-radius: 9px; background: rgba(0, 0, 0, .18); }
.period-control button { height: 29px; min-width: 41px; padding: 0 9px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 10px; font-weight: 750; }
.period-control button:hover { color: #dbe5e3; }
.period-control button.active { color: #092017; background: var(--mint); box-shadow: 0 4px 12px rgba(99, 230, 185, .16); }
.icon-button, .mobile-menu { width: 37px; height: 37px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 9px; color: var(--muted); background: rgba(255, 255, 255, .02); font-size: 17px; }
.icon-button:hover, .mobile-menu:hover { color: var(--mint); border-color: rgba(99, 230, 185, .25); }
.icon-button.spinning { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.live-badge { height: 29px; display: flex; align-items: center; gap: 7px; padding: 0 9px; border: 1px solid rgba(99, 230, 185, .18); border-radius: 7px; color: var(--mint); background: rgba(99, 230, 185, .055); font-family: "Cascadia Code", Consolas, monospace; font-size: 9px; font-weight: 800; letter-spacing: .09em; }
.live-badge span { width: 5px; height: 5px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 7px var(--mint); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.mobile-menu { display: none; }

.filterbar { min-height: 70px; display: flex; align-items: flex-end; gap: 12px; padding: 12px 0 14px; }
.filterbar label, .subfilters label { display: grid; gap: 5px; }
.filterbar label > span, .subfilters label > span { color: var(--muted-2); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
select { min-width: 145px; height: 34px; padding: 0 30px 0 10px; border: 1px solid var(--border); border-radius: 8px; color: #c7d3d1; background: #10171e; font-size: 11px; }
select:hover { border-color: var(--border-strong); }
.reset-filter { height: 34px; padding: 0 11px; border: 1px solid transparent; border-radius: 8px; color: var(--muted); background: transparent; font-size: 10px; }
.reset-filter:hover { color: var(--mint); background: rgba(99, 230, 185, .05); }
.data-freshness { margin: 0 0 8px auto; color: var(--muted-2); font-family: "Cascadia Code", Consolas, monospace; font-size: 9px; }
.loading-line { height: 2px; margin: -1px 0 17px; overflow: hidden; opacity: 0; }
.loading-line.active { opacity: 1; }
.loading-line span { display: block; width: 28%; height: 100%; border-radius: 4px; background: linear-gradient(90deg, transparent, var(--mint), transparent); animation: loading 1s ease-in-out infinite; }
@keyframes loading { from { transform: translateX(-110%); } to { transform: translateX(470%); } }

.view { display: none; }
.view.active { display: block; animation: reveal .28s ease-out; }
@keyframes reveal { from { opacity: 0; transform: translateY(4px); } }
.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(128px, 1fr)); gap: 10px; margin-bottom: 12px; }
.metric-grid.compact { grid-template-columns: repeat(4, minmax(160px, 1fr)); }
.metric-card { position: relative; min-height: 112px; overflow: hidden; padding: 16px; border: 1px solid var(--border); border-radius: 13px; background: linear-gradient(145deg, rgba(19, 27, 36, .94), rgba(13, 19, 26, .94)); }
.metric-card::after { content: ""; position: absolute; right: -30px; bottom: -45px; width: 90px; height: 90px; border-radius: 50%; background: var(--metric-color, var(--mint)); filter: blur(40px); opacity: .09; }
.metric-label { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 10px; font-weight: 700; }
.metric-label i { width: 6px; height: 6px; border-radius: 50%; background: var(--metric-color, var(--mint)); box-shadow: 0 0 7px color-mix(in srgb, var(--metric-color, var(--mint)) 55%, transparent); }
.metric-value { margin-top: 16px; font-family: "Cascadia Code", Consolas, monospace; font-size: clamp(18px, 2vw, 25px); font-weight: 650; letter-spacing: -.04em; white-space: nowrap; }
.metric-value.positive { color: var(--mint); }
.metric-value.negative { color: var(--red); }
.metric-meta { margin-top: 7px; color: var(--muted-2); font-size: 9px; }

.dashboard-grid { display: grid; gap: 12px; margin-bottom: 12px; }
.dashboard-grid-primary { grid-template-columns: minmax(0, 2.15fr) minmax(240px, .85fr); }
.dashboard-grid-secondary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(145deg, rgba(17, 24, 32, .95), rgba(12, 18, 25, .95)); box-shadow: 0 8px 25px rgba(0, 0, 0, .08); }
.panel-header { min-height: 65px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 17px; border-bottom: 1px solid rgba(160, 186, 203, .08); }
.panel-header h2 { margin: 0; font-size: 13px; letter-spacing: -.01em; }
.text-button { border: 0; color: var(--mint); background: transparent; font-size: 10px; font-weight: 700; }
.text-button:hover { color: var(--lime); }

/* Charts and data components */
.chart { position: relative; min-height: 220px; padding: 13px 14px 9px; }
.chart-large { height: 280px; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart-grid-line { stroke: rgba(160, 186, 203, .09); stroke-width: 1; }
.chart-zero-line { stroke: rgba(160, 186, 203, .24); stroke-width: 1; stroke-dasharray: 4 5; }
.chart-axis-label { fill: #5f6d76; font-family: "Cascadia Code", Consolas, monospace; font-size: 9px; }
.equity-line { fill: none; stroke: var(--mint); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 5px rgba(99, 230, 185, .22)); }
.equity-area { fill: url(#equity-gradient); }
.chart-point { fill: #0d141b; stroke: var(--mint); stroke-width: 1.8; }
.chart-empty, .empty-state { min-height: 160px; display: grid; place-items: center; padding: 25px; color: var(--muted-2); font-size: 11px; text-align: center; }
.chart-tooltip { position: absolute; z-index: 3; min-width: 128px; padding: 9px 10px; border: 1px solid var(--border-strong); border-radius: 8px; color: #dce8e6; background: rgba(6, 10, 14, .94); box-shadow: var(--shadow); pointer-events: none; font-size: 10px; transform: translate(-50%, -110%); }
.chart-tooltip b { display: block; margin-top: 3px; color: var(--mint); font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; }
.chart-legend { color: var(--muted); font-family: "Cascadia Code", Consolas, monospace; font-size: 10px; }
.bar-svg .bar-positive { fill: rgba(99, 230, 185, .72); }
.bar-svg .bar-negative { fill: rgba(255, 110, 114, .72); }
.bar-svg rect { transition: opacity .15s; }
.bar-svg rect:hover { opacity: .76; }

.wallet-panel { display: flex; flex-direction: column; }
#wallet-card { flex: 1; display: flex; flex-direction: column; padding: 18px; }
.wallet-balance { font-family: "Cascadia Code", Consolas, monospace; font-size: 29px; font-weight: 650; letter-spacing: -.05em; }
.wallet-balance small { margin-left: 5px; color: var(--muted); font-size: 10px; letter-spacing: 0; }
.wallet-spark { height: 4px; margin: 19px 0 16px; overflow: hidden; border-radius: 4px; background: rgba(255, 255, 255, .045); }
.wallet-spark span { display: block; width: 72%; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--cyan), var(--mint)); }
.wallet-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; }
.wallet-meta div { padding: 10px; border: 1px solid rgba(160, 186, 203, .08); border-radius: 9px; background: rgba(255, 255, 255, .015); }
.wallet-meta span { display: block; color: var(--muted-2); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.wallet-meta b { display: block; margin-top: 5px; font-family: "Cascadia Code", Consolas, monospace; font-size: 11px; }
.wallet-time { margin-top: 13px; color: var(--muted-2); font-size: 8px; }

.bar-list { display: grid; gap: 13px; padding: 17px; }
.bar-row { display: grid; gap: 7px; }
.bar-row-head { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 9px; font-size: 10px; }
.bar-row-head b { color: #d9e4e2; font-size: 10px; }
.bar-row-head span { color: var(--muted-2); }
.bar-row-head strong { min-width: 66px; font-family: "Cascadia Code", Consolas, monospace; font-size: 10px; text-align: right; }
.bar-track { height: 5px; overflow: hidden; border-radius: 5px; background: rgba(255, 255, 255, .045); }
.bar-fill { height: 100%; border-radius: 5px; background: var(--mint); }
.bar-fill.negative { margin-left: auto; background: var(--red); }
.blocker-list .bar-fill { background: linear-gradient(90deg, rgba(246, 195, 91, .45), var(--amber)); }

.position-list { display: grid; gap: 8px; padding: 14px; }
.position-card { position: relative; padding: 12px; border: 1px solid rgba(160, 186, 203, .09); border-radius: 10px; background: rgba(255, 255, 255, .015); }
.position-card::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 2px; border-radius: 4px; background: var(--mint); }
.position-card.short::before { background: var(--red); }
.position-head { display: flex; justify-content: space-between; align-items: center; }
.position-head b { font-family: "Cascadia Code", Consolas, monospace; font-size: 11px; }
.side-pill, .result-pill, .severity-pill, .decision-pill { display: inline-flex; align-items: center; padding: 3px 7px; border-radius: 6px; font-size: 8px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.side-pill.long, .result-pill.win, .decision-pill.enter_long { color: var(--mint); background: rgba(99, 230, 185, .09); }
.side-pill.short, .result-pill.loss, .decision-pill.enter_short { color: #ff9396; background: rgba(255, 110, 114, .09); }
.result-pill.pending, .severity-pill.warning, .decision-pill.wait { color: var(--amber); background: rgba(246, 195, 91, .09); }
.result-pill.open { color: var(--cyan); background: rgba(84, 200, 234, .09); }
.decision-pill.no_trade { color: var(--muted); background: rgba(160, 186, 203, .07); }
.position-levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 11px; }
.position-levels span { display: block; color: var(--muted-2); font-size: 7px; text-transform: uppercase; }
.position-levels b { display: block; margin-top: 3px; font-family: "Cascadia Code", Consolas, monospace; font-size: 9px; }
.position-strategy { margin: 9px 0 0; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }

/* Tables */
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.data-table th { height: 39px; padding: 0 13px; color: var(--muted-2); border-bottom: 1px solid var(--border); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { height: 48px; padding: 0 13px; color: #aebbb9; border-bottom: 1px solid rgba(160, 186, 203, .065); white-space: nowrap; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr.clickable { cursor: pointer; }
.data-table tbody tr.clickable:hover { background: rgba(99, 230, 185, .027); }
.data-table td.primary { color: #e5efed; font-weight: 750; }
.data-table td.mono { font-family: "Cascadia Code", Consolas, monospace; font-size: 9px; }
.positive { color: var(--mint) !important; }
.negative { color: var(--red) !important; }
.muted { color: var(--muted-2) !important; }
.symbol-cell { display: flex; align-items: center; gap: 8px; }
.coin-mark { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid rgba(160, 186, 203, .12); border-radius: 7px; color: var(--coin-color, var(--mint)); background: color-mix(in srgb, var(--coin-color, var(--mint)) 7%, transparent); font-family: "Cascadia Code", Consolas, monospace; font-size: 8px; font-weight: 850; }
.strategy-name { max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.trades-panel { margin-bottom: 12px; }
.trades-panel .panel-header { min-height: 58px; }
.full-table { min-height: 430px; }

/* Secondary views */
.section-lead { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin: 10px 0 18px; }
.section-lead h2 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.section-lead p:not(.eyebrow) { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.total-chip { padding: 8px 11px; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); background: rgba(255, 255, 255, .018); font-size: 10px; }
.subfilters { display: flex; gap: 13px; margin-bottom: 12px; padding: 13px; }
.pagination { min-height: 58px; display: flex; justify-content: space-between; align-items: center; padding: 0 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 9px; }
.page-buttons { display: flex; gap: 6px; }
.page-buttons button { min-width: 31px; height: 29px; border: 1px solid var(--border); border-radius: 7px; color: var(--muted); background: rgba(255, 255, 255, .018); font-size: 9px; }
.page-buttons button:hover:not(:disabled) { color: var(--mint); border-color: rgba(99, 230, 185, .25); }
.page-buttons button:disabled { cursor: default; opacity: .35; }
.page-buttons button.active { color: #07110e; border-color: var(--mint); background: var(--mint); }

.strategy-grid { grid-template-columns: minmax(0, 2fr) minmax(260px, .75fr); }
.strategy-grid-bottom { grid-template-columns: minmax(300px, .85fr) minmax(0, 1.5fr); }
.donut-layout { min-height: 246px; display: grid; place-items: center; padding: 18px; }
.donut-wrap { display: grid; grid-template-columns: 132px 1fr; align-items: center; gap: 17px; width: 100%; }
.donut { position: relative; width: 126px; height: 126px; border-radius: 50%; background: conic-gradient(var(--mint) 0 var(--maker), var(--cyan) var(--maker) var(--ioc), var(--violet) var(--ioc) 100%); }
.donut::after { content: ""; position: absolute; inset: 21px; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 1px var(--border); }
.donut-center { position: absolute; z-index: 1; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-center b { font-family: "Cascadia Code", Consolas, monospace; font-size: 19px; }
.donut-center span { color: var(--muted-2); font-size: 8px; text-transform: uppercase; }
.legend-list { display: grid; gap: 10px; }
.legend-item { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 8px; font-size: 9px; }
.legend-item i { width: 7px; height: 7px; border-radius: 2px; background: var(--legend-color); }
.legend-item span { color: var(--muted); }
.legend-item b { font-family: "Cascadia Code", Consolas, monospace; }
.signal-matrix { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 14px; }
.matrix-column { min-width: 0; padding: 11px; border: 1px solid rgba(160, 186, 203, .08); border-radius: 10px; background: rgba(255, 255, 255, .012); }
.matrix-column h3 { display: flex; justify-content: space-between; margin: 0 0 9px; color: #d9e5e2; font-family: "Cascadia Code", Consolas, monospace; font-size: 9px; }
.matrix-column h3 span { color: var(--muted-2); font-size: 8px; }
.matrix-row { display: flex; justify-content: space-between; align-items: center; gap: 7px; padding: 7px 0; border-top: 1px solid rgba(160, 186, 203, .06); }
.matrix-row:first-of-type { border-top: 0; }
.matrix-row > span:first-child { min-width: 0; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.timestamp { color: var(--muted-2); font-family: "Cascadia Code", Consolas, monospace; font-size: 8px; }

.system-grid { grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr); }
.status-list { display: grid; padding: 8px 16px 15px; }
.status-row { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 10px; min-height: 48px; border-bottom: 1px solid rgba(160, 186, 203, .065); }
.status-row:last-child { border-bottom: 0; }
.status-row b { display: block; font-size: 10px; }
.status-row small { display: block; margin-top: 3px; color: var(--muted-2); font-size: 8px; }
.status-row time { color: var(--muted-2); font-family: "Cascadia Code", Consolas, monospace; font-size: 8px; }
.storage-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; padding: 16px; }
.storage-stat { min-height: 82px; padding: 13px; border: 1px solid rgba(160, 186, 203, .08); border-radius: 10px; background: rgba(255, 255, 255, .014); }
.storage-stat span { color: var(--muted-2); font-size: 8px; text-transform: uppercase; letter-spacing: .07em; }
.storage-stat b { display: block; margin-top: 10px; font-family: "Cascadia Code", Consolas, monospace; font-size: 19px; }
.events-panel { margin-bottom: 12px; }
.event-list { display: grid; }
.event-row { display: grid; grid-template-columns: 120px 145px 75px 1fr; align-items: center; gap: 12px; min-height: 48px; padding: 8px 16px; border-bottom: 1px solid rgba(160, 186, 203, .06); font-size: 9px; }
.event-row:last-child { border-bottom: 0; }
.event-row time { color: var(--muted-2); font-family: "Cascadia Code", Consolas, monospace; font-size: 8px; }
.event-row b { color: #cad7d4; font-size: 9px; }
.event-row p { margin: 0; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.severity-pill.error, .severity-pill.critical { color: var(--red); background: rgba(255, 110, 114, .09); }
.severity-pill.info { color: var(--cyan); background: rgba(84, 200, 234, .09); }

/* Dialog and feedback */
.trade-dialog { width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 0; overflow: auto; border: 1px solid var(--border-strong); border-radius: 18px; color: var(--text); background: #0e151c; box-shadow: 0 35px 100px rgba(0, 0, 0, .55); }
.trade-dialog::backdrop { background: rgba(2, 5, 8, .78); backdrop-filter: blur(6px); }
.dialog-close { position: sticky; z-index: 3; float: right; top: 13px; right: 13px; width: 33px; height: 33px; margin: 13px 13px 0 0; border: 1px solid var(--border); border-radius: 9px; color: var(--muted); background: #131b23; font-size: 19px; }
.dialog-close:hover { color: #fff; }
.trade-detail-head { padding: 26px 27px 20px; border-bottom: 1px solid var(--border); }
.trade-detail-title { display: flex; align-items: center; gap: 10px; }
.trade-detail-title h2 { margin: 0; font-size: 23px; letter-spacing: -.035em; }
.trade-detail-subtitle { margin: 8px 0 0; color: var(--muted); font-size: 10px; }
.trade-detail-pnl { margin-top: 21px; font-family: "Cascadia Code", Consolas, monospace; font-size: 30px; font-weight: 650; }
.trade-detail-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; padding: 1px; background: var(--border); }
.detail-stat { min-height: 84px; padding: 15px; background: #10171f; }
.detail-stat span { color: var(--muted-2); font-size: 8px; text-transform: uppercase; }
.detail-stat b { display: block; margin-top: 8px; font-family: "Cascadia Code", Consolas, monospace; font-size: 11px; }
.detail-section { padding: 20px 27px; border-top: 1px solid var(--border); }
.detail-section h3 { margin: 0 0 13px; font-size: 11px; }
.timeline { position: relative; display: grid; gap: 13px; padding-left: 17px; }
.timeline::before { content: ""; position: absolute; left: 3px; top: 5px; bottom: 5px; width: 1px; background: var(--border-strong); }
.timeline-item { position: relative; display: grid; grid-template-columns: 110px 1fr; gap: 13px; color: var(--muted); font-size: 9px; }
.timeline-item::before { content: ""; position: absolute; left: -17px; top: 4px; width: 7px; height: 7px; border: 2px solid #0e151c; border-radius: 50%; background: var(--mint); }
.timeline-item time { color: var(--muted-2); font-family: "Cascadia Code", Consolas, monospace; font-size: 8px; }
.timeline-item b { color: #c8d5d2; font-size: 9px; }
.toast { position: fixed; z-index: 20; right: 24px; bottom: 24px; max-width: 330px; padding: 11px 14px; border: 1px solid var(--border-strong); border-radius: 9px; color: #dce7e5; background: rgba(13, 19, 26, .96); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s, transform .2s; font-size: 10px; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { border-color: rgba(255, 110, 114, .3); color: #ffb0b2; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .dashboard-grid-secondary { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid-secondary > :last-child { grid-column: span 2; }
  .signal-matrix { grid-template-columns: 1fr; }
}

@media (max-width: 920px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 12; left: 0; top: 0; width: 224px; transform: translateX(-102%); transition: transform .22s ease; box-shadow: 25px 0 70px rgba(0, 0, 0, .45); }
  .sidebar.open { transform: translateX(0); }
  .workspace { padding: 0 18px 40px; }
  .mobile-menu { display: grid; }
  .dashboard-grid-primary, .strategy-grid, .strategy-grid-bottom, .system-grid { grid-template-columns: 1fr; }
  .login-card { grid-template-columns: 1fr; width: min(520px, 100%); }
  .login-visual { display: none; }
  .login-content { min-height: 570px; }
}

@media (max-width: 680px) {
  .workspace { padding: 0 12px 30px; }
  .topbar { min-height: 76px; gap: 10px; }
  .topbar-title { flex: 1; }
  .topbar-title h1 { font-size: 16px; }
  .topbar-title .eyebrow { display: none; }
  .live-badge { display: none; }
  .period-control button { min-width: 34px; padding: 0 6px; }
  .filterbar { overflow-x: auto; align-items: flex-end; padding-bottom: 12px; }
  .filterbar label { min-width: 135px; }
  .filterbar select { width: 100%; min-width: 0; }
  .reset-filter, .data-freshness { display: none; }
  .metric-grid, .metric-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card { min-height: 104px; padding: 13px; }
  .dashboard-grid-secondary { grid-template-columns: 1fr; }
  .dashboard-grid-secondary > :last-child { grid-column: auto; }
  .panel-header { min-height: 58px; padding: 12px 13px; }
  .chart-large { height: 235px; }
  .section-lead { align-items: flex-start; }
  .section-lead h2 { font-size: 21px; }
  .subfilters { overflow-x: auto; }
  .subfilters label { min-width: 150px; }
  .event-row { grid-template-columns: 100px 1fr 65px; }
  .event-row p { display: none; }
  .trade-detail-grid { grid-template-columns: repeat(2, 1fr); }
  .login-screen { padding: 12px; }
  .login-card { min-height: 0; }
  .login-content { min-height: 540px; padding: 38px 27px; }
  .login-content > .brand-lockup { margin-bottom: 48px; }
}

@media (max-width: 420px) {
  .metric-grid, .metric-grid.compact { grid-template-columns: 1fr 1fr; gap: 7px; }
  .metric-value { font-size: 18px; }
  .topbar-actions { gap: 5px; }
  .icon-button { display: none; }
  .period-control button { min-width: 31px; }
  .wallet-meta, .storage-grid { grid-template-columns: 1fr; }
  .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .legend-list { width: 100%; }
  .timeline-item { grid-template-columns: 1fr; gap: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
