/* admin.css — Superadmin dashboard
 * Phase 11 plan 11-11
 * Reuses /css/brain.css palette + buttons; adds dashboard-specific layout.
 */

/* ── Forbidden fallback (probe failure / 403) ─────────────────────────── */
.forbidden {
  background: var(--bg-2);
  border: 1px solid var(--red);
  border-radius: 8px;
  padding: 40px 28px;
  text-align: center;
  max-width: 520px;
  margin: 60px auto;
}
.forbidden h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--red);
}
.forbidden .reason {
  color: var(--text);
  font-size: 13.5px;
  margin-bottom: 8px;
}
.forbidden .reason-secondary {
  color: var(--muted);
  font-size: 12.5px;
  margin-bottom: 22px;
}

/* ── Dashboard layout ─────────────────────────────────────────────────── */
.admin-section {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 22px;
  margin-bottom: 24px;
}
.admin-section h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.section-desc {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 16px;
}
.section-desc code {
  background: var(--bg-3);
  color: var(--text);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
}
.section-loading {
  color: var(--dim);
  font-size: 12px;
  padding: 12px 0;
}
.section-content:empty + .section-loading { display: block; }
.section-content:not(:empty) + .section-loading { display: none; }

.empty {
  color: var(--muted);
  font-size: 12.5px;
  padding: 18px 0;
  text-align: center;
}

/* ── Tables (overview / storage / sources share .matrix base) ─────────── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-family: inherit;
}
.admin-table thead th {
  background: var(--bg-3);
  color: var(--muted);
  text-align: left;
  font-weight: 600;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tbody tr:hover {
  background: var(--bg-3);
}
.admin-table tbody tr.total-row {
  background: var(--bg-3);
  font-weight: 600;
}
.admin-table tbody tr.total-row td {
  border-top: 1px solid var(--border-2);
  color: var(--text);
}

/* Team name cell — emphasis */
.admin-table td.team-name {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}
.admin-table td.team-name .team-uuid {
  display: block;
  color: var(--dim);
  font-size: 10px;
  font-weight: 400;
  margin-top: 2px;
}

/* Count cell — right-aligned numbers */
.admin-table td.count,
.admin-table td.bytes,
.admin-table th.count,
.admin-table th.bytes {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.admin-table td.count.zero { color: var(--dim); }

/* Drill-down button column */
.admin-table td.actions {
  text-align: right;
  white-space: nowrap;
}
.drill-down {
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--accent-bg);
  color: var(--accent);
  cursor: pointer;
  transition: all 0.15s ease;
}
.drill-down:hover {
  background: var(--accent);
  color: var(--bg);
}

/* ── Sparkline cell (activity section) ────────────────────────────────── */
.sparkline-cell {
  display: inline-flex;
  align-items: center;
  width: 100%;
  min-height: 40px;
}
.sparkline-cell svg {
  display: block;
  color: var(--accent);
}
.sparkline-cell svg circle {
  cursor: crosshair;
}

/* Total events column for activity */
.admin-table td.total-events {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* ── Top Sources — column visual aid ──────────────────────────────────── */
.admin-table th.source-col,
.admin-table td.source-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.admin-table td.source-cell.other {
  color: var(--muted);
  font-style: italic;
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .admin-section { padding: 14px 14px; }
  .admin-table { font-size: 11px; }
  .admin-table thead th,
  .admin-table tbody td { padding: 8px 6px; }
  .container { padding: 18px 12px 40px; }
  .sparkline-cell svg { max-width: 140px; }
}
