:root {
  --bg: #050711;
  --surface: #0b0d19;
  --surface-2: #101421;
  --line: #22283a;
  --text: #f2f6ff;
  --muted: #8b96ad;
  --cyan: #00e0ad;
  --warn: #f5b84b;
  --bad: #ff5c7a;
  --green: #19d38a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1480px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 32px;
}

.topbar,
.table-head,
.filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 18px;
}

.eyebrow,
h1,
h2,
p {
  margin: 0;
}

.eyebrow {
  color: var(--cyan);
  font-size: 13px;
  font-weight: 800;
}

h1 {
  margin-top: 5px;
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  font-size: 18px;
}

.health-pill,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.health-pill.ok,
.badge.ok {
  border-color: rgba(25, 211, 138, 0.45);
  color: var(--green);
}

.health-pill.warn,
.badge.warn {
  border-color: rgba(245, 184, 75, 0.45);
  color: var(--warn);
}

.health-pill.bad,
.badge.bad {
  border-color: rgba(255, 92, 122, 0.45);
  color: var(--bad);
}

.exchange-tabs,
.metrics,
.filters,
.table-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.exchange-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
}

.tab,
.chip,
.refresh {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.tab.active,
.chip.active,
.refresh:hover {
  border-color: rgba(0, 224, 173, 0.55);
  background: rgba(0, 224, 173, 0.08);
  color: var(--cyan);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 12px;
  overflow: hidden;
}

.metric {
  min-height: 86px;
  padding: 16px;
  border-right: 1px solid var(--line);
}

.metric:last-child {
  border-right: 0;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  font-variant-numeric: tabular-nums;
}

.metric.ok strong {
  color: var(--green);
}

.metric.warn strong {
  color: var(--warn);
}

.metric.bad strong {
  color: var(--bad);
}

.filters {
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 12px;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-width: 78px;
  padding: 0 12px;
  background: var(--surface-2);
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.search input {
  width: 220px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.search input:focus {
  border-color: var(--cyan);
}

.table-panel {
  margin-top: 12px;
  overflow: hidden;
}

.table-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.table-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.refresh {
  min-width: 76px;
  border-color: var(--line);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-height: 50px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.pager-btn {
  min-width: 72px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}

.pager-btn:hover:not(:disabled) {
  border-color: rgba(0, 224, 173, 0.55);
  color: var(--cyan);
}

.pager-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.table-wrap {
  overflow: auto;
  max-height: calc(100dvh - 335px);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

th,
td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 700;
}

td {
  color: #dce5f7;
  font-variant-numeric: tabular-nums;
}

.symbol {
  color: var(--text);
  font-weight: 800;
}

.empty {
  height: 96px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 860px) {
  .shell {
    width: min(100vw - 20px, 1480px);
    padding-top: 16px;
  }

  .topbar,
  .table-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .exchange-tabs,
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric:nth-child(2) {
    border-right: 0;
  }

  .metric {
    border-bottom: 1px solid var(--line);
  }

  .metric:nth-child(n + 3) {
    border-bottom: 0;
  }

  .search,
  .search input {
    width: 100%;
  }

  .table-wrap {
    max-height: none;
  }
}
