:root {
  color: #17211b;
  background: #f4f6f5;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  font-synthesis: none;
  letter-spacing: 0;
  --ink: #17211b;
  --muted: #68736c;
  --line: #dce2de;
  --surface: #ffffff;
  --green: #0c7a53;
  --green-soft: #e8f4ee;
  --amber: #a75d08;
  --amber-soft: #fff3df;
  --red: #b42318;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: #f4f6f5; }
.topbar {
  height: 72px; padding: 0 32px; display: flex; align-items: center;
  justify-content: space-between; gap: 24px; color: #fff;
  background: #14251d; border-bottom: 3px solid #d69a32;
}
.brand, .topbar-actions, .connection, .status-value, .section-heading { display: flex; align-items: center; }
.brand { gap: 12px; min-width: 0; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto;
  border: 1px solid #6d8a7a; color: #f0b64b; font-family: Georgia, serif; font-size: 23px;
}
.brand h1, .brand p, .metric p, .section-heading h2, .section-heading p { margin: 0; }
.brand h1 { font-size: 18px; font-weight: 700; line-height: 1.15; }
.brand p { margin-top: 3px; color: #acc0b5; font-size: 12px; }
.topbar-actions { gap: 16px; color: #c9d6cf; font-size: 12px; }
.connection { gap: 7px; color: #dce8e1; }
.status-dot, .large-status-dot {
  display: inline-block; border-radius: 50%; background: #f0b64b;
  box-shadow: 0 0 0 3px rgba(240, 182, 75, .16);
}
.status-dot { width: 7px; height: 7px; }
.large-status-dot { width: 10px; height: 10px; }
.connection.online .status-dot, .metric-status.online .large-status-dot { background: #40c38b; }
.connection.offline .status-dot, .metric-status.offline .large-status-dot { background: #ea6b62; }
.icon-button {
  width: 34px; height: 34px; border: 1px solid #52685c; border-radius: 4px;
  color: #fff; background: transparent; font-size: 19px; cursor: pointer;
}
.icon-button:hover { background: #263c31; }
.icon-button:disabled { cursor: wait; opacity: .55; }
.topbar form { margin: 0; }
.text-button {
  padding: 6px 8px; border: 0; color: #cad7d0; background: transparent;
  font: inherit; cursor: pointer;
}
.text-button:hover { color: #fff; }
main { max-width: 1480px; margin: 0 auto; padding: 26px 32px 40px; }
.overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric {
  min-height: 128px; padding: 19px 20px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 6px;
}
.metric-label { color: var(--muted); font-size: 12px; font-weight: 600; }
.metric-value {
  margin-top: 13px !important; color: var(--ink); font-size: 27px; line-height: 1.15;
  font-variant-numeric: tabular-nums; font-weight: 720;
}
.status-value { gap: 10px; }
.metric-meta { margin-top: 8px !important; color: #849087; font-size: 12px; }
.rate-value { color: var(--green); }
.return-metric.positive .metric-value { color: var(--green); }
.return-metric.negative .metric-value { color: var(--red); }
.workspace {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px;
  margin-top: 28px; align-items: start;
}
.primary-column { min-width: 0; }
.data-section { padding: 0 0 28px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.section-heading { justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-heading h2 { font-size: 16px; line-height: 1.3; }
.section-heading p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.mode-badge, .threshold {
  padding: 5px 8px; border-radius: 4px; white-space: nowrap; font-size: 11px; font-weight: 700;
}
.mode-badge { color: var(--green); background: var(--green-soft); text-transform: uppercase; }
.threshold { color: var(--amber); background: var(--amber-soft); }
.table-wrap {
  position: relative; width: 100%; min-height: 82px; overflow-x: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
}
table { width: 100%; min-width: 680px; border-collapse: collapse; }
th, td {
  height: 44px; padding: 0 15px; text-align: right; border-bottom: 1px solid #edf0ee;
  white-space: nowrap; font-size: 12px; font-variant-numeric: tabular-nums;
}
th { color: #7a867e; background: #fafbfa; font-size: 11px; font-weight: 650; }
th:first-child, td:first-child, th:nth-child(2), td:nth-child(2) { text-align: left; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8faf9; }
.symbol-cell { color: var(--ink); font-weight: 700; }
.positive-text { color: var(--green); font-weight: 650; }
.negative-text { color: var(--red); font-weight: 650; }
.rank { color: #94a098; }
.empty-state {
  display: none; min-height: 80px; align-items: center; justify-content: center;
  color: #8b968f; font-size: 12px;
}
.empty-state.visible { display: flex; }
.activity { padding-left: 24px; border-left: 1px solid var(--line); }
.event-list { padding: 0; margin: 0; list-style: none; }
.event-list li {
  position: relative; padding: 0 0 18px 18px; color: #435047; font-size: 12px; line-height: 1.55;
}
.event-list li::before {
  content: ""; position: absolute; top: 5px; left: 0; width: 7px; height: 7px;
  border-radius: 50%; background: #8ba095;
}
.event-list li::after {
  content: ""; position: absolute; top: 16px; bottom: 3px; left: 3px;
  width: 1px; background: var(--line);
}
.event-list li:last-child::after { display: none; }
.event-kind { display: block; color: var(--ink); font-weight: 700; }
.event-time { display: block; margin-top: 3px; color: #929c96; font-size: 11px; }
.system-details { margin: 12px 0 0; padding-top: 8px; border-top: 1px solid var(--line); }
.system-details div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; }
.system-details dt, .system-details dd { margin: 0; font-size: 11px; }
.system-details dt { color: #7c8780; }
.system-details dd {
  max-width: 170px; overflow: hidden; color: #334038; text-overflow: ellipsis;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.login-page { background: #14251d; }
.login-shell {
  width: min(100%, 440px); min-height: 100vh; display: grid; place-items: center;
  padding: 24px; color: #fff;
}
.login-panel { width: 100%; }
.login-brand { margin-bottom: 38px; }
.login-brand .brand-mark { width: 46px; height: 46px; font-size: 27px; }
.login-brand h1 { font-size: 23px; }
.login-form { padding-top: 26px; border-top: 1px solid #52685c; }
.login-form label { display: block; margin: 0 0 7px; color: #b9c9c0; font-size: 12px; font-weight: 650; }
.login-form input {
  width: 100%; height: 44px; margin: 0 0 17px; padding: 0 12px;
  border: 1px solid #5a7164; border-radius: 4px; outline: 0;
  color: #fff; background: #1b3025; font: inherit;
}
.login-form input:focus { border-color: #e3ab48; box-shadow: 0 0 0 3px rgba(227, 171, 72, .13); }
.login-form button {
  width: 100%; height: 44px; border: 0; border-radius: 4px; color: #17211b;
  background: #e3ab48; font: inherit; font-weight: 750; cursor: pointer;
}
.login-form button:hover { background: #edb956; }
.login-error { margin: -5px 0 14px; color: #ffb6ad; font-size: 12px; }
@media (max-width: 980px) {
  .overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace { grid-template-columns: 1fr; }
  .activity { padding-left: 0; border-left: 0; }
}
@media (max-width: 600px) {
  .topbar { height: auto; min-height: 68px; padding: 12px 16px; }
  .brand p, #updated-at { display: none; }
  .topbar-actions { gap: 10px; }
  main { padding: 18px 14px 32px; }
  .overview { gap: 8px; }
  .metric { min-height: 112px; padding: 15px 14px; }
  .metric-value { font-size: 22px; }
  .metric-meta { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .workspace { margin-top: 22px; }
  .threshold { display: none; }
}
