:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-hover: #22263a;
  --border: #2a2e3f;
  --text: #e4e4e7;
  --text-muted: #9ca3af;
  --accent: #3b82f6;
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
  --green-bg: rgba(34, 197, 94, 0.1);
  --red-bg: rgba(239, 68, 68, 0.1);
  --amber-bg: rgba(245, 158, 11, 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

header h1 {
  font-size: 24px;
  font-weight: 600;
}

header .subtitle {
  color: var(--text-muted);
  font-size: 14px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.refresh-time {
  color: var(--text-muted);
  font-size: 13px;
}

.refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.refresh-btn:hover {
  background: var(--accent);
  color: #fff;
}

.nav-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.15s;
}
.nav-link:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.refresh-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: var(--border);
  color: var(--text-muted);
  background: transparent;
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: var(--surface);
  padding: 4px;
  border-radius: 8px;
  width: fit-content;
}

.tab {
  padding: 8px 20px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s;
}

.tab:hover { color: var(--text); background: var(--surface-hover); }
.tab.active { color: var(--text); background: var(--accent); }

.panel { display: none; }
.panel.active { display: block; }

/* Scope Coverage */
.scope-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.scope-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.scope-card .label {
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.scope-card .count {
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.scope-card .table-name {
  color: var(--text-muted);
  font-size: 11px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  margin-top: 4px;
}

/* Scope sections */
.scope-section {
  margin-bottom: 28px;
}

.scope-section h3 {
  font-size: 14px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Pipeline */
.pipeline-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: 8px;
  overflow: hidden;
}

.pipeline-table th,
.pipeline-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.pipeline-table th {
  background: var(--surface-hover);
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.pipeline-table tr:last-child td { border-bottom: none; }

.status-yes { color: var(--green); }
.status-no { color: var(--red); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-ref { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-season { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.badge-meeting { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-session { background: rgba(34, 197, 94, 0.15); color: #4ade80; }

.pipeline-notes {
  color: var(--text-muted);
  font-size: 12px;
  max-width: 300px;
}

/* Coverage Matrix */
.season-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.season-selector label {
  color: var(--text-muted);
  font-size: 14px;
}

.season-selector select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
}

.coverage-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: 8px;
  overflow: hidden;
  font-size: 13px;
}

.coverage-table th,
.coverage-table td {
  padding: 8px 10px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}

.coverage-table th {
  background: var(--surface-hover);
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.coverage-table td:first-child,
.coverage-table th:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 1;
}

.coverage-table th:first-child {
  background: var(--surface-hover);
}

.coverage-table tr:last-child td { border-bottom: none; }

.coverage-table td.has-data { color: var(--green); }
.coverage-table td.no-data { color: var(--text-muted); }

.coverage-wrapper {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.loading {
  color: var(--text-muted);
  padding: 40px;
  text-align: center;
}

.error-msg {
  color: var(--red);
  padding: 20px;
  text-align: center;
}

/* Summary stats */
.summary-bar {
  display: flex;
  gap: 24px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.summary-stat {
  font-size: 13px;
  color: var(--text-muted);
}

.summary-stat strong {
  color: var(--text);
}
