:root {
  --bg: #0B1220;
  --surface: #121B2E;
  --surface-2: #16213A;
  --border: #232E48;
  --text: #E7ECF5;
  --text-muted: #7C8AA5;
  --rx: #4FD1C5;
  --rx-dim: #1F4A48;
  --tx: #F0A868;
  --tx-dim: #4A371F;
  --danger: #E5626B;
  --ok: #4FD1C5;
  --radius: 7px;
  --font-ui: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  background-attachment: fixed;
  background-position: -1px -1px;
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 18, 32, 0.85);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-left { display: flex; align-items: center; gap: 12px; }

.status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--text-muted);
  box-shadow: 0 0 0 4px rgba(124, 138, 165, 0.15);
  transition: background .3s, box-shadow .3s;
}
.status-dot.ok {
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(79, 209, 197, 0.18);
  animation: pulse 2.4s infinite;
}
.status-dot.error {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(229, 98, 107, 0.18);
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(79, 209, 197, 0.18); }
  50% { box-shadow: 0 0 0 8px rgba(79, 209, 197, 0.08); }
}

.topbar-title { font-weight: 600; font-size: 15px; letter-spacing: 0.2px; }
.topbar-sub { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }

.topbar-right { display: flex; align-items: center; gap: 18px; }
.status-text { font-size: 13px; color: var(--text-muted); }
.clock { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); min-width: 78px; text-align: right; }

.layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hero {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.hero-metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  border-top: 2px solid var(--border);
}
.hero-rx { border-top-color: var(--rx); }
.hero-tx { border-top-color: var(--tx); }

.hero-label {
  display: block;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.hero-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.2px;
}
.hero-rx .hero-value { color: var(--rx); }
.hero-tx .hero-value { color: var(--tx); }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px 8px;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}
.panel-head h2 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}
.panel-sub { font-size: 12.5px; color: var(--text-muted); }

.range-toggle { display: flex; gap: 4px; }
.range-toggle button {
  font-family: var(--font-ui);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.range-toggle button.active {
  color: var(--bg);
  background: var(--rx);
  border-color: var(--rx);
}

.chart-panel canvas { width: 100%; }

.table-wrap { overflow-x: auto; padding-bottom: 14px; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

thead th {
  text-align: left;
  font-weight: 500;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.3px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }

td.mono, .mono { font-family: var(--font-mono); }
td.rx { color: var(--rx); }
td.tx { color: var(--tx); }

.empty-row td {
  color: var(--text-muted);
  text-align: center;
  padding: 26px 10px;
}

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; }
  .layout { padding: 16px; }
  .topbar { padding: 14px 16px; }
}
