.dash-body {
  overflow-y: auto;
  overflow-x: hidden;
}

/* style.css sets `main { pointer-events: none }` so clicks pass through the
   flying-blobs page's decorative hero text to the blobs underneath it — but
   dashboard.html's <main> holds real interactive content (tabs, table,
   select), so it must opt back in. */
.dash-main {
  pointer-events: auto;
}

.dash-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  backdrop-filter: blur(14px);
  background: rgba(11,11,20,0.7);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.dash-back {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  background: var(--panel);
  padding: 7px 14px;
  border-radius: 999px;
}
.dash-back:hover { color: var(--text); }

.dash-main {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 20px 60px;
}

.dash-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.thread-select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.thread-select {
  background: var(--panel);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 13px;
}

.dash-main .pinned-banner {
  margin: 0 0 20px;
  max-width: none;
}

.dash-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 880px) {
  .dash-grid { grid-template-columns: 1fr; }
}

.dash-section-title {
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 10px;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--panel-strong);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 16px;
}
.metric-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel);
  border-radius: 10px;
  font-size: 15px;
  margin-bottom: 10px;
}
.metric-label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.metric-value { font-size: 26px; font-weight: 700; }
.metric-delta { font-size: 12px; margin-top: 4px; color: var(--muted); }
.metric-delta.up { color: #5cff9d; }
.metric-delta.down { color: #ff5c5c; }

.chart-card {
  background: var(--panel-strong);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 16px;
}
.chart-x-axis {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
  margin-top: 6px;
  padding: 0 4px;
}

.dash-table-wrap {
  background: var(--panel-strong);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  overflow-x: auto;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.dash-table thead th {
  text-align: left;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.dash-table thead th:nth-child(n+3) { text-align: center; }
.dash-table tbody tr {
  cursor: pointer;
  transition: background 0.15s ease;
}
.dash-table tbody tr:hover { background: rgba(255,255,255,0.04); }
.dash-table tbody tr:not(:last-child) td { border-bottom: 1px solid rgba(255,255,255,0.04); }
.dash-table td {
  padding: 10px 12px;
  vertical-align: middle;
}
.dash-table td:nth-child(n+3) { text-align: center; color: var(--muted); font-size: 12px; }

.dash-rank {
  width: 22px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.dash-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 140px;
}
.dash-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: white;
  background-size: cover;
  background-position: center;
}
.dash-avatar.has-avatar { color: transparent; }
.dash-user-name { font-size: 13px; white-space: nowrap; }

.dash-footer { position: static; margin-top: 30px; }

@media (max-width: 560px) {
  .dash-topbar { padding: 10px 14px; }
  .dash-topbar .brand span { display: none; }
  .dash-back { padding: 6px 10px; font-size: 12px; }

  .dash-main { padding: 14px 12px 40px; }
  .dash-toolbar { flex-direction: column; align-items: stretch; }
  #rangeTabs.tabs { width: 100%; }
  #rangeTabs .tab { flex: 1; text-align: center; }
  .thread-select-wrap { justify-content: space-between; }
  .thread-select { flex: 1; }

  .metric-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric-card { padding: 12px; }
  .metric-value { font-size: 21px; }

  .dash-table { font-size: 12px; }
  .dash-table td, .dash-table thead th { padding: 8px; }
  .dash-user { min-width: 110px; gap: 7px; }
  .dash-avatar { width: 26px; height: 26px; }
}
