/* ── Recent Runs page ── */

.recent-hero {
  padding: 3rem 0 2rem;
  background: linear-gradient(180deg, #F8F8FF 0%, #FFFFFF 100%);
  border-bottom: 1px solid var(--border);
}

.recent-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  margin-bottom: 0.75rem;
}

.recent-hero .lead {
  font-size: 1rem;
  color: var(--text-2);
  line-height: 1.7;
}

/* ── Tab switcher ── */
.recent-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 2rem;
  padding-bottom: 0;
}

.recent-tab-btn {
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: 0;
  transition: color 0.15s, border-color 0.15s;
}

.recent-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.recent-tab-btn:hover:not(.active) {
  color: var(--text-1);
}

/* ── Tab panes ── */
.recent-pane {
  display: none;
}

.recent-pane.active {
  display: block;
}

/* ── Tool section ── */
.recent-tool-section {
  margin-bottom: 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.recent-tool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}

.recent-tool-name {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-1);
  margin: 0;
}

.recent-tool-link {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  font-weight: 500;
}

.recent-tool-link:hover {
  text-decoration: underline;
}

/* ── Table inside tool section ── */
.recent-tool-section .table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.recent-tool-section .data-table {
  font-size: 0.82rem;
  min-width: 500px;
}

.recent-tool-section .data-table tbody tr {
  cursor: pointer;
}

.recent-tool-section .data-table tbody tr:hover td {
  background: var(--accent-bg);
}

/* ── Empty / loading states ── */
.recent-empty {
  padding: 1.25rem 1rem;
  color: var(--text-3);
  font-size: 0.85rem;
  text-align: center;
}

.recent-loading {
  padding: 1.25rem 1rem;
  color: var(--text-3);
  font-size: 0.85rem;
  text-align: center;
  font-style: italic;
}

/* ── Status badges (reuse scan-status-badge pattern) ── */
.status-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 3px;
  font-size: 0.73rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-badge.ok       { background: var(--success-bg, #dcfce7); color: var(--success, #166534); }
.status-badge.complete { background: var(--success-bg, #dcfce7); color: var(--success, #166534); }
.status-badge.running  { background: var(--warning-bg, #fef3c7); color: #92400e; }
.status-badge.error    { background: var(--error-bg,   #fee2e2); color: var(--error,   #b91c1c); }
.status-badge.pending  { background: var(--surface-2);            color: var(--text-3); }
.status-badge.broken   { background: var(--error-bg,   #fee2e2); color: var(--error,   #b91c1c); }

/* ── Score cell ── */
.score-cell {
  font-weight: 700;
  font-size: 0.82rem;
}

.score-cell.good   { color: var(--success, #166534); }
.score-cell.medium { color: #92400e; }
.score-cell.poor   { color: var(--error,   #b91c1c); }

/* ── Time cell ── */
.time-cell {
  color: var(--text-3);
  font-size: 0.78rem;
  white-space: nowrap;
}

/* ── URL cell truncation ── */
.url-trunc {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

@media (max-width: 600px) {
  .recent-tab-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.82rem;
  }

  .recent-tool-section .data-table {
    font-size: 0.76rem;
  }
}
