.dash-page {
  padding: 80px 2rem 4rem;
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.dash-page .settings-header { margin-bottom: 0; }

/* ─── Dashboard card ─── */
.dashboard {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,0.5);
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.25rem;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}

.dashboard-title {
  font-size: 13px;
  color: #9aa0a4;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

/* ─── Header actions (permalink + settings) ─── */
.dashboard-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.project-permalink {
  font-size: 14px;
  color: var(--muted2);
  text-decoration: none;
  padding: 2px 6px;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
}
.project-permalink:hover { color: var(--text); background: rgba(255,255,255,0.05); }

.project-settings-link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted2);
  padding: 2px 6px;
  border-radius: 3px;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.project-settings-link:hover { color: var(--text); background: rgba(255,255,255,0.05); }

/* ─── Alert badge ─── */
.alert-badge {
  font-size: 11px;
  color: var(--green);
  background: rgba(61,186,116,0.1);
  border: 1px solid rgba(61,186,116,0.25);
  border-radius: 999px;
  padding: 1px 8px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.alert-badge:hover {
  background: rgba(61,186,116,0.18);
  border-color: rgba(61,186,116,0.45);
}

.alert-badge--off {
  color: var(--muted);
  background: transparent;
  border-color: var(--border);
}
.alert-badge--off:hover {
  background: rgba(255,255,255,0.04);
  border-color: var(--border2);
}

/* ─── Alert banner ─── */
.alert-banner {
  margin: 0.85rem 0.85rem 0;
  padding: 0.8rem 1rem;
  background: var(--red-dim);
  border: 1px solid rgba(224,92,58,0.25);
  border-radius: 4px;
  font-size: 13px;
  color: var(--accent);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.6;
}
.alert-banner:last-of-type { margin-bottom: 0.85rem; }
.alert-icon { flex-shrink: 0; margin-top: 2px; }

/* ─── Job list ─── */
.job-list { padding: 0.5rem 0; }

.job-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 1.5rem;
  padding: 0.8rem 1.25rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.job-row:last-child { border-bottom: none; }
.job-row:hover { background: rgba(255,255,255,0.02); }

.job-name {
  font-size: 14px;
  color: #d0d4d6;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.monitor-link {
  color: inherit;
  text-decoration: none;
}
.monitor-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.job-source {
  font-size: 11px;
  color: var(--muted2);
  padding: 2px 6px;
  border-radius: 2px;
  background: var(--bg3);
  border: 1px solid var(--border);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── Sparklines ─── */
.job-sparkline {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 22px;
}

.spark-bar {
  width: 4px;
  border-radius: 2px 2px 0 0;
  background: var(--green);
  opacity: 0.65;
  animation: sparkGrow 0.4s ease both;
}

.spark-bar.miss {
  background: var(--red);
  opacity: 0.9;
}

/* ─── Last run ─── */
.job-last {
  font-size: 12px;
  color: #7a8488;
  white-space: nowrap;
}

/* ─── Status ─── */
.job-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  min-width: 80px;
  justify-content: flex-end;
}

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-ok   { color: var(--green); }
.status-ok .status-dot { background: var(--green); }

.status-warn { color: var(--yellow); }
.status-warn .status-dot { background: var(--yellow); animation: pulse 1.5s infinite; }

.status-dead { color: var(--red); }
.status-dead .status-dot { background: var(--red); animation: pulse 0.8s infinite; }

/* ─── Empty states ─── */
.empty-state {
  padding: 2.5rem 1.25rem;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ─── Setup guide (empty state) ─── */

.setup-guide {
  max-width: 680px;
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
}

.setup-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 2rem;
}

.setup-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.setup-subtitle {
  font-size: 13px;
  color: var(--muted);
}

.setup-api-key {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 2.5rem;
}

.setup-api-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

.setup-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.setup-step {
  display: flex;
  gap: 1.25rem;
  padding-bottom: 2rem;
  position: relative;
}

.setup-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 32px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.step-body {
  flex: 1;
  min-width: 0;
  padding-top: 3px;
}

.step-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.step-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.step-desc code {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 4px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
}

.code-block {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.85rem 4rem 0.85rem 1rem;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.65;
  overflow-x: auto;
  white-space: pre;
  margin-bottom: 0.75rem;
}

.code-comment { color: var(--muted); }

.setup-footer {
  font-size: 12px;
  color: var(--muted);
  margin-top: 0.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.setup-link {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border2);
  transition: border-color 0.15s;
}
.setup-link:hover { border-color: var(--text); }

/* ─── Responsive ─── */
@media (max-width: 640px) {
  .job-row { grid-template-columns: 1fr auto; }
  .job-sparkline, .job-last { display: none; }
}
