:root {
  color-scheme: dark;
  --bg: #0b0e0d;
  --surface: #111613;
  --surface-2: #171d19;
  --line: #29322c;
  --line-soft: #202722;
  --text: #f1f5f2;
  --muted: #8f9b94;
  --green: #47d68a;
  --green-soft: rgba(71, 214, 138, .12);
  --amber: #efbd63;
  --red: #ff7b72;
  --blue: #7db7ff;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 10% -10%, rgba(71,214,138,.08), transparent 34rem), var(--bg); color: var(--text); }
button, input { font: inherit; }
button { cursor: pointer; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 14px clamp(18px, 4vw, 54px);
  border-bottom: 1px solid rgba(41,50,44,.85);
  background: rgba(11,14,13,.9);
  backdrop-filter: blur(18px);
}

.brand-row, .topbar-actions, .toolbar, .toolbar-right, .shard-list { display: flex; align-items: center; }
.brand-row { gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 54px; height: 54px; border: 1px solid rgba(71,214,138,.5); border-radius: 16px; background: linear-gradient(145deg, rgba(71,214,138,.2), rgba(71,214,138,.04)); color: var(--green); font-size: 25px; font-weight: 800; box-shadow: inset 0 0 18px rgba(71,214,138,.08); }
.brand-mark.small { width: 42px; height: 42px; border-radius: 12px; font-size: 19px; }
.eyebrow, .section-kicker { margin: 0; color: var(--green); font-size: 10px; font-weight: 750; letter-spacing: .16em; }
.topbar h1 { margin: 3px 0 0; font-size: 20px; line-height: 1; letter-spacing: -.02em; }
.topbar-actions { gap: 16px; }
.username { color: var(--muted); font-size: 13px; }
.freshness { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px rgba(239,189,99,.6); }
.freshness.ok .status-dot { background: var(--green); box-shadow: 0 0 10px rgba(71,214,138,.7); }
.freshness.stale .status-dot { background: var(--red); box-shadow: 0 0 10px rgba(255,123,114,.6); }

.shell { width: min(1540px, calc(100% - 36px)); margin: 30px auto 56px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric-card { position: relative; min-height: 145px; padding: 22px; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(145deg, rgba(23,29,25,.94), rgba(15,19,17,.96)); }
.metric-card.accent::after { content: ""; position: absolute; right: -45px; bottom: -70px; width: 180px; height: 180px; border-radius: 50%; background: rgba(71,214,138,.08); filter: blur(3px); }
.metric-card span { display: block; color: var(--muted); font-size: 12px; }
.metric-card strong { display: block; margin-top: 14px; font-size: clamp(26px, 3vw, 38px); line-height: 1; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.metric-card small { display: block; margin-top: 15px; color: #667169; font-size: 11px; }

.shard-strip { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-top: 12px; padding: 18px 22px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.shard-strip strong { display: block; margin-top: 4px; font-size: 14px; }
.shard-list { flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.shard-pill { padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-size: 12px; }
.shard-pill b { margin-left: 8px; color: var(--green); font-variant-numeric: tabular-nums; }

.workspace { margin-top: 22px; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: rgba(17,22,19,.86); }
.toolbar { justify-content: space-between; gap: 20px; min-height: 66px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; align-items: center; gap: 3px; overflow-x: auto; }
.tab { padding: 9px 12px; white-space: nowrap; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 13px; }
.tab:hover { color: var(--text); background: rgba(255,255,255,.03); }
.tab.active { color: var(--green); background: var(--green-soft); }
.toolbar-right { gap: 8px; }
.search { width: 210px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; outline: none; background: #0c100e; color: var(--text); font-size: 12px; }
.search:focus { border-color: rgba(71,214,138,.55); box-shadow: 0 0 0 3px rgba(71,214,138,.07); }
.quiet-button, .primary-button { border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); color: var(--text); }
.quiet-button { padding: 8px 11px; font-size: 12px; }
.quiet-button:hover { border-color: #435047; }
.primary-button { width: 100%; padding: 11px 14px; border-color: rgba(71,214,138,.5); background: var(--green); color: #07130c; font-weight: 750; }

.panel { display: none; min-height: 450px; }
.panel.active { display: block; }
.panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 23px 22px 17px; }
.panel-heading h2 { margin: 5px 0 0; font-size: 18px; letter-spacing: -.025em; }
.muted { color: var(--muted); font-size: 12px; }
.table-wrap { overflow: auto; border-top: 1px solid var(--line-soft); }
table { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
th { position: sticky; top: 0; z-index: 1; padding: 11px 16px; border-bottom: 1px solid var(--line); background: #121714; color: #6f7b73; text-align: left; font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
td { max-width: 420px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); color: #cbd3ce; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
tbody tr:hover td { background: rgba(255,255,255,.018); }
.ticker { color: var(--text); font-weight: 650; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.tag { display: inline-flex; align-items: center; min-width: 64px; justify-content: center; padding: 4px 7px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.02); color: var(--muted); font-size: 10px; text-transform: uppercase; }
.tag.resting, .tag.success, .tag.executed { border-color: rgba(71,214,138,.28); background: rgba(71,214,138,.08); color: var(--green); }
.tag.canceled, .tag.failed { border-color: rgba(255,123,114,.25); background: rgba(255,123,114,.07); color: var(--red); }
.tag.pending { border-color: rgba(239,189,99,.25); background: rgba(239,189,99,.07); color: var(--amber); }
.mono { max-width: 150px; color: #8c9991; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.empty-row td { padding: 52px 20px; color: #657168; text-align: center; }
.error-banner { margin: 14px 16px 0; padding: 11px 13px; border: 1px solid rgba(255,123,114,.3); border-radius: 10px; background: rgba(255,123,114,.08); color: #ffaaa4; font-size: 12px; }
.hidden { display: none !important; }

footer { display: flex; justify-content: space-between; width: min(1540px, calc(100% - 36px)); margin: -30px auto 30px; color: #59635d; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }

.login-body { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.login-card { width: min(410px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: 20px; background: rgba(17,22,19,.95); box-shadow: 0 25px 80px rgba(0,0,0,.35); }
.login-card .brand-mark { margin-bottom: 25px; }
.login-card h1 { margin: 8px 0 4px; font-size: 26px; letter-spacing: -.04em; }
.login-copy { margin: 0 0 28px; color: var(--muted); font-size: 13px; }
.login-card label { display: block; margin-top: 14px; color: #a9b3ad; font-size: 12px; }
.login-card input { width: 100%; margin-top: 7px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; outline: none; background: #0c100e; color: var(--text); }
.login-card input:focus { border-color: rgba(71,214,138,.55); box-shadow: 0 0 0 3px rgba(71,214,138,.07); }
.login-error { min-height: 18px; margin: 12px 0 5px; color: var(--red); font-size: 11px; }

@media (max-width: 980px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-right { justify-content: space-between; }
  .search { flex: 1; width: auto; }
}

@media (max-width: 640px) {
  .topbar { align-items: flex-start; padding: 13px 16px; }
  .topbar-actions { gap: 7px; }
  .username { display: none; }
  .freshness { padding: 6px 8px; }
  .freshness span:last-child { display: none; }
  .shell { width: calc(100% - 20px); margin-top: 16px; }
  .summary-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric-card { min-height: 122px; padding: 17px; border-radius: 13px; }
  .metric-card strong { font-size: 25px; }
  .metric-card small { margin-top: 12px; }
  .shard-strip { align-items: flex-start; flex-direction: column; }
  .shard-list { justify-content: flex-start; }
  .workspace { border-radius: 14px; }
  .panel-heading { padding: 20px 15px 14px; }
  th, td { padding-left: 12px; padding-right: 12px; }
  footer { width: calc(100% - 20px); }
}
