/* Punch-derived admin theme.
   Source: /repos/punch/public/css/variables.css + main.css + pages/login.css.
   Token names retained for clarity (--oath-*); this is a self-contained sheet. */

:root {
  --oath-black: #000000;
  --oath-charcoal: #1a1a1a;
  --oath-white: #ffffff;
  --oath-gray-900: #2d2d2d;
  --oath-gray-800: #424242;
  --oath-gray-700: #545454;
  --oath-gray-600: #777777;
  --oath-gray-500: #9e9e9e;
  --oath-gray-400: #bdbdbd;
  --oath-gray-300: #e0e0e0;
  --oath-gray-200: #eeeeee;
  --oath-gray-100: #f5f5f5;
  --oath-gray-50: #fafafa;

  --success: #6b8f71;
  --success-light: #e8f0e9;
  --success-dark: #4a6b4f;
  --danger: #b07d7d;
  --danger-light: #f5eaea;
  --danger-dark: #8b5a5a;
  --warning: #b8956b;
  --warning-light: #f5f0e8;
  --warning-dark: #7a5d3a; /* ≥4.5:1 on --warning-light */
  --info: #5b7c99;
  --info-light: #e8eff5;
  --info-dark: #475f7a;

  /* Muted text — darker than gray-500 so it stays ≥4.5:1 on the white /
     gray-50 / gray-100 surfaces it sits on. */
  --text-muted: #6b6b6b;

  --font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-family-serif: 'Georgia', 'Times New Roman', Times, serif;
  --font-family-mono: 'SF Mono', 'Fira Code', 'Roboto Mono', monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.07), 0 4px 6px rgba(0, 0, 0, 0.04);

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);

  --sidebar-width: 260px;
  /* Fluid content column — the admin is data-dense (six 500-row
     DataTables + the 14-column vetting grid); capping it forced
     horizontal scrolling on large monitors. Cards/forms that want a
     narrow measure set their own max-widths. */
  --content-max-width: 100%;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--oath-gray-700);
  background-color: var(--oath-gray-100);
  margin: 0;
  padding: 0;
}

h1, h2, h3, h4 {
  color: var(--oath-gray-900);
  font-weight: 700;
  line-height: 1.25;
  margin-top: 0;
}

a { color: var(--oath-black); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--oath-gray-700); }

::selection { background-color: var(--oath-black); color: var(--oath-white); }

/* ============ LAYOUT ============ */

.app-shell { min-height: 100vh; }

.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--oath-white);
  border-right: 1px solid var(--oath-gray-200);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 400;
}

.sidebar-logo {
  padding: var(--space-6);
  border-bottom: 1px solid var(--oath-gray-200);
}

.sidebar-logo-text {
  font-family: var(--font-family-serif);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--oath-black);
  letter-spacing: -0.025em;
}

.sidebar-logo-sub {
  font-size: var(--text-xs);
  color: var(--oath-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 2px;
}

.sidebar-items {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.sidebar-section-label {
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--oath-gray-500);
  padding: var(--space-3) var(--space-4) var(--space-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  color: var(--oath-gray-600);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.nav-item:hover {
  background-color: var(--oath-gray-100);
  color: var(--oath-gray-900);
}

.nav-item.active {
  background-color: var(--oath-black);
  color: var(--oath-white);
}

.nav-icon {
  font-size: var(--text-lg);
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
}

.sidebar-footer {
  padding: var(--space-4);
  border-top: 1px solid var(--oath-gray-200);
}

.logout-form { margin: 0; }

.logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid var(--oath-gray-300);
  color: var(--oath-gray-700);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}

.logout-btn:hover {
  background-color: var(--oath-gray-100);
  color: var(--oath-gray-900);
  border-color: var(--oath-gray-400);
}

.sidebar-meta {
  font-size: var(--text-xs);
  color: var(--oath-gray-500);
  padding: var(--space-3) var(--space-2) 0;
  word-break: break-all;
}

.app-main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-content {
  flex: 1;
  padding: var(--space-8);
  max-width: var(--content-max-width);
  width: 100%;
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
  gap: var(--space-4);
}

.page-header-title {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--oath-gray-900);
  margin: 0;
  letter-spacing: -0.025em;
}

.page-header-subtitle {
  font-size: var(--text-sm);
  color: var(--oath-gray-600);
  margin-top: var(--space-1);
}

/* ============ COMPONENTS ============ */

.card {
  background: linear-gradient(to bottom, var(--oath-white), var(--oath-gray-50));
  border: 1px solid var(--oath-gray-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-6);
}

.card-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--oath-gray-200);
}

.card-header h2 {
  font-size: var(--text-lg);
  font-weight: 700;
  margin: 0;
}

.card-header-sub {
  font-size: var(--text-sm);
  color: var(--oath-gray-600);
  margin-top: var(--space-1);
}

.card-body { padding: var(--space-6); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-weight: 500;
  font-size: var(--text-sm);
  letter-spacing: 0.025em;
  border-radius: var(--radius-md);
  padding: 0.5rem 1.25rem;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
}

.btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
  outline: none;
}

.btn-primary {
  background-color: var(--oath-black);
  border-color: var(--oath-black);
  color: var(--oath-white);
}

.btn-primary:hover {
  background-color: var(--oath-charcoal);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: var(--oath-white);
}

.btn-primary:disabled {
  background-color: var(--oath-gray-400);
  border-color: var(--oath-gray-400);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background-color: var(--oath-gray-200);
  border-color: var(--oath-gray-200);
  color: var(--oath-gray-800);
}

.btn-secondary:hover {
  background-color: var(--oath-gray-300);
  border-color: var(--oath-gray-300);
  color: var(--oath-gray-900);
}

.btn-danger {
  background-color: var(--danger);
  border-color: var(--danger);
  color: var(--oath-white);
}

.btn-danger:hover {
  background-color: var(--danger-dark);
  border-color: var(--danger-dark);
  color: var(--oath-white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-success {
  background-color: var(--success);
  border-color: var(--success);
  color: var(--oath-white);
}

.btn-success:hover {
  background-color: var(--success-dark);
  border-color: var(--success-dark);
  color: var(--oath-white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.form-group { margin-bottom: var(--space-4); }

.form-label {
  display: block;
  font-weight: 500;
  color: var(--oath-gray-900);
  font-size: var(--text-sm);
  margin-bottom: var(--space-1);
}

.form-control {
  display: block;
  width: 100%;
  background-color: var(--oath-white);
  border: 1px solid var(--oath-gray-300);
  border-radius: var(--radius-md);
  color: var(--oath-gray-900);
  font-size: var(--text-sm);
  padding: 0.5rem 0.875rem;
  font-family: inherit;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
  border-color: var(--oath-black);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
  outline: none;
}

.form-help {
  font-size: var(--text-xs);
  color: var(--oath-gray-600);
  margin-top: var(--space-1);
}

.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
  transition: opacity var(--transition-base);
}

/* Applied by admin.js before removing an auto-dismissed alert. */
.alert-fade-out { opacity: 0; }

.alert-danger { background-color: var(--danger-light); color: var(--danger-dark); }
.alert-success { background-color: var(--success-light); color: var(--success-dark); }

/* ============ STAT GRID ============ */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.stat-card {
  background: linear-gradient(to bottom, var(--oath-white), var(--oath-gray-50));
  border: 1px solid var(--oath-gray-200);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  box-shadow: var(--shadow-sm);
}

a.stat-card,
a.stat-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

/* Hover lift only on clickable stat cards — static cards stay put. */
a.stat-card:hover,
a.stat-card-link:hover {
  text-decoration: none;
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.stat-label {
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--oath-gray-600);
  margin-bottom: var(--space-1);
}

.stat-value {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--oath-gray-900);
  line-height: 1.1;
  font-family: var(--font-family-serif);
  letter-spacing: -0.025em;
}

.stat-value-sm {
  font-size: var(--text-lg);
  font-family: var(--font-family-mono);
  letter-spacing: 0;
}

.stat-sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-2);
}

/* ============ TABLES ============ */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.data-table thead th {
  background-color: var(--oath-gray-100);
  color: var(--oath-gray-600);
  font-weight: 500;
  text-transform: uppercase;
  font-size: var(--text-xs);
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--oath-gray-300);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  white-space: nowrap;
}

.data-table tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--oath-gray-200);
  vertical-align: middle;
}

.data-table tbody tr:hover { background-color: var(--oath-gray-50); }
.data-table tbody tr:last-child td { border-bottom: none; }

.num-cell { text-align: right; font-variant-numeric: tabular-nums; }

/* ============ CHARTS ============ */

.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

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

.chart-card {
  background: var(--oath-white);
  border: 1px solid var(--oath-gray-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
}

.chart-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--oath-gray-900);
  margin: 0 0 var(--space-4);
}

.chart-canvas-wrap {
  position: relative;
  height: 280px;
}

/* Rendered by chart-loader.js when the Chart.js CDN fails to load. */
.chart-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  margin: 0;
  padding: var(--space-4);
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-style: italic;
  text-align: center;
}

/* ============ LOGIN PAGE ============ */

.page-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background-color: var(--oath-gray-100);
  padding: var(--space-4);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background-color: var(--oath-white);
  border: 1px solid var(--oath-gray-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.login-card-header {
  padding: var(--space-8) var(--space-8) var(--space-6);
  text-align: center;
}

.login-subtitle {
  font-size: var(--text-sm);
  color: var(--oath-gray-600);
}

.login-card-body { padding: 0 var(--space-8) var(--space-8); }

.login-submit {
  width: 100%;
  background-color: var(--oath-black);
  border: 1px solid var(--oath-black);
  color: var(--oath-white);
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.login-submit:hover {
  background-color: var(--oath-charcoal);
  border-color: var(--oath-charcoal);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ============ MOBILE NAV TOGGLE ============ */

.nav-toggle {
  display: none;
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 600;
  width: 44px;
  height: 44px;
  padding: 0;
  background-color: var(--oath-white);
  border: 1px solid var(--oath-gray-300);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.nav-toggle:hover { background-color: var(--oath-gray-100); }

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--oath-gray-900);
  border-radius: 2px;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.has-nav-open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.has-nav-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.has-nav-open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.45);
  z-index: 350;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.has-nav-open .nav-backdrop { opacity: 1; }

/* ============ RESPONSIVE ============ */

@media (max-width: 900px) {
  .app-sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-base);
    box-shadow: var(--shadow-lg);
  }
  .has-nav-open .app-sidebar { transform: translateX(0); }
  .app-main { margin-left: 0; }
  .app-content { padding: var(--space-4); padding-top: calc(var(--space-4) + 52px); }
  .nav-toggle { display: flex; }
}

/* ============ STATUS PILLS ============ */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.625rem;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  border-radius: var(--radius-full);
  line-height: 1.4;
  border: 1px solid transparent;
  white-space: nowrap;
}

.pill-success {
  background-color: var(--success-light);
  color: var(--success-dark);
  border-color: var(--success-light);
}

.pill-warning {
  background-color: var(--warning-light);
  color: var(--warning-dark);
  border-color: var(--warning-light);
}

.pill-danger {
  background-color: var(--danger-light);
  color: var(--danger-dark);
  border-color: var(--danger-light);
}

.pill-neutral {
  background-color: var(--oath-gray-200);
  color: var(--oath-gray-700);
  border-color: var(--oath-gray-200);
}

/* ============ SEO PROFILE BADGES ============ */
/* Grade badges from views/seo-profile.ts — shared by /admin/sites,
   /admin/sites/{domain}, /admin/vetting and the dashboard tile.
   Same shape as .pill; distinct palette so grades read at a glance:
   gold = amazing, green = good, gray = weak/empty, red = spammy,
   dashed outline = unvetted. */

.seo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.625rem;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  border-radius: var(--radius-full);
  line-height: 1.4;
  border: 1px solid transparent;
  white-space: nowrap;
}

.seo-badge-amazing {
  background-color: #f7f0da;
  color: #7a651f;
  border-color: #e6d9ae;
}

.seo-badge-good {
  background-color: var(--success-light);
  color: var(--success-dark);
  border-color: var(--success-light);
}

.seo-badge-weak {
  background-color: var(--oath-gray-200);
  color: var(--oath-gray-700);
  border-color: var(--oath-gray-200);
}

.seo-badge-empty {
  background-color: var(--oath-gray-100);
  color: var(--text-muted);
  border-color: var(--oath-gray-200);
}

.seo-badge-spammy {
  background-color: var(--danger-light);
  color: var(--danger-dark);
  border-color: var(--danger);
}

.seo-badge-unvetted {
  background-color: transparent;
  color: var(--text-muted);
  border: 1px dashed var(--oath-gray-400);
}

/* ============ CRON LOG TABLE ============ */

.cron-log-table { font-size: var(--text-xs); }
.cron-log-table thead th { font-size: 0.6875rem; }
.cron-log-table tbody td { padding: var(--space-2) var(--space-3); }
.cron-log-table .num-cell { font-family: var(--font-family-mono); }
.cron-log-table code {
  font-family: var(--font-family-mono);
  font-size: var(--text-xs);
  color: var(--oath-gray-900);
}

.cron-error {
  font-family: var(--font-family-mono);
  font-size: 0.6875rem;
  color: var(--danger-dark);
  background-color: var(--danger-light);
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm);
  word-break: break-word;
  display: inline-block;
  max-width: 32rem;
}

.cron-run-form { max-width: 320px; }

.muted { color: var(--text-muted); }

.empty-row {
  text-align: center;
  color: var(--oath-gray-500);
  font-style: italic;
  padding: var(--space-6) var(--space-4) !important;
}

/* ============ QUEUE / COLLAPSIBLE SECTIONS ============ */

.queue-section {
  background: linear-gradient(to bottom, var(--oath-white), var(--oath-gray-50));
  border: 1px solid var(--oath-gray-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-4);
  overflow: hidden;
}

.queue-summary {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--oath-gray-900);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background-color var(--transition-fast);
}

.queue-summary::-webkit-details-marker { display: none; }
.queue-summary:hover { background-color: var(--oath-gray-100); }

.queue-chevron {
  display: inline-block;
  width: 0.625rem;
  height: 0.625rem;
  border-right: 2px solid var(--oath-gray-600);
  border-bottom: 2px solid var(--oath-gray-600);
  transform: rotate(-45deg);
  transition: transform var(--transition-base);
  flex-shrink: 0;
  margin-left: 0.125rem;
}

.queue-section[open] .queue-chevron {
  transform: rotate(45deg);
}

.queue-label { flex: 1; }

.queue-section-body {
  padding: 0 var(--space-5) var(--space-5);
  border-top: 1px solid var(--oath-gray-200);
  background-color: var(--oath-white);
}

.queue-section-body > .data-table,
.queue-section-body > .sites-table-wrap {
  margin-top: var(--space-3);
}

.queue-empty {
  margin: var(--space-4) 0 var(--space-2);
  color: var(--success-dark);
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.queue-empty::before {
  content: '';
  display: inline-block;
  width: 0.5rem;
  height: 0.875rem;
  border-right: 2px solid var(--success);
  border-bottom: 2px solid var(--success);
  transform: rotate(45deg);
  margin-bottom: 0.25rem;
}

.queue-table { font-size: var(--text-sm); }

/* ============ LOGIN WORDMARK ============ */

.login-wordmark {
  font-family: var(--font-family-serif);
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--oath-black);
  letter-spacing: -0.025em;
  line-height: 1;
  margin-bottom: var(--space-2);
}

/* ============ SITES TABLE (/admin/sites) ============ */

.sites-empty { font-size: var(--text-sm); }

.sites-filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-3);
  align-items: end;
}

.sites-filter-group .form-label {
  margin-bottom: var(--space-1);
}

.sites-filter-checks {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding-top: var(--space-4);
}

.sites-filter-checks .form-label {
  font-weight: 400;
  font-size: var(--text-xs);
  color: var(--oath-gray-700);
  margin: 0;
}

.sites-filter-actions {
  display: flex;
  gap: var(--space-2);
  align-items: flex-end;
}

.sites-table-wrap {
  overflow-x: auto;
}

.sites-table {
  font-size: var(--text-xs);
  white-space: nowrap;
}

.sites-table tbody td {
  padding: var(--space-2) var(--space-3);
}

.sites-table .sites-pill-cell {
  text-align: center;
  width: 1%;
}

.sites-table .sites-time-cell {
  white-space: nowrap;
  font-size: var(--text-xs);
}

.sites-domain-link {
  color: var(--oath-gray-900);
  font-weight: 500;
}

.sites-domain-link:hover {
  color: var(--oath-black);
  text-decoration: underline;
}

.sites-sort-link {
  display: inline-flex;
  align-items: center;
  color: var(--oath-gray-600);
  font-weight: 500;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sites-sort-link:hover { color: var(--oath-black); }
.sites-sort-link.active { color: var(--oath-black); }

.sites-purge-form {
  margin: 0;
  display: inline;
}

.sites-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
  font-size: var(--text-sm);
}

.sites-page-link {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--oath-gray-300);
  color: var(--oath-gray-700);
  text-decoration: none;
  font-weight: 500;
}

.sites-page-link:hover {
  background-color: var(--oath-gray-100);
  color: var(--oath-gray-900);
}

.sites-page-link.disabled {
  color: var(--oath-gray-400);
  border-color: var(--oath-gray-200);
  pointer-events: none;
}

.sites-page-summary {
  color: var(--oath-gray-600);
  font-size: var(--text-sm);
}

/* =====================================================================
   Cache performance section (/admin/traffic — appended)
   ===================================================================== */

.cache-section-header {
  margin-top: var(--space-12);
  border-top: 1px solid var(--oath-gray-200);
  padding-top: var(--space-8);
}

.cache-section .card-header h2 {
  margin: 0;
}

/* Hit-rate card gets a soft accent so the headline number reads first. */
.cache-stat-hitrate {
  background: var(--success-light);
  border-color: var(--success);
}

.cache-stat-hitrate .stat-value {
  color: var(--success-dark);
}

/* Wide chart card spans the full row by default; on narrow screens it
   just flows naturally. */
.chart-card.chart-card-wide {
  grid-column: 1 / -1;
}

.cache-domain-table th,
.cache-domain-table td {
  white-space: nowrap;
}

/* ============ PROBES PAGE (/admin/probes) ============ */

.probe-unrec-table {
  font-size: var(--text-sm);
}
.probe-unrec-table td { vertical-align: top; }
.probe-unrec-table .num-cell { font-family: var(--font-family-mono); }

.probe-path {
  font-family: var(--font-family-mono);
  font-size: var(--text-xs);
  color: var(--oath-gray-900);
  word-break: break-all;
  max-width: 32rem;
  display: inline-block;
}

.probe-hint {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.probe-hint-content {
  background-color: var(--success-light);
  color: var(--success-dark);
}
.probe-hint-scanner {
  background-color: var(--danger-light);
  color: var(--danger-dark);
}

.probe-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}

.probe-inline-form {
  display: inline-block;
  margin: 0;
}

/* Small-button variant — .btn-small kept as an alias for back-compat. */
.btn-sm,
.btn-small {
  padding: 0.25rem 0.625rem;
  font-size: var(--text-xs);
  line-height: 1.4;
}

.form-control-sm {
  padding: 0.25rem 0.5rem;
  font-size: var(--text-xs);
  height: auto;
}

/* The "Block" button is a <summary> on a <details>. When closed it
   looks like a normal btn-danger; when open the form drops below. */
.probe-block-details {
  display: inline-block;
  position: relative;
}
.probe-block-details > summary {
  list-style: none;
  cursor: pointer;
}
.probe-block-details > summary::-webkit-details-marker { display: none; }

.probe-block-form {
  position: absolute;
  z-index: 10;
  top: calc(100% + var(--space-2));
  left: 0;
  background: var(--oath-white);
  border: 1px solid var(--oath-gray-300);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 200px;
}

.probe-block-form .form-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--oath-gray-700);
  margin: 0;
}

.probe-pattern-table,
.probe-phase2-table,
.probe-dismissed-table {
  font-size: var(--text-sm);
}

.probe-pattern-table code,
.probe-phase2-table code,
.probe-dismissed-table code {
  font-family: var(--font-family-mono);
  font-size: var(--text-xs);
  word-break: break-all;
}

/* ============ MIGRATIONS (/admin/migrations) ============ */

.migration-progress-bar {
  display: flex;
  width: 100%;
  height: 28px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--oath-gray-100);
  border: 1px solid var(--oath-gray-200);
}

.migration-progress-seg {
  height: 100%;
  transition: width var(--transition-base);
}

.migration-progress-worker { background-color: var(--success); }
.migration-progress-migrating { background-color: var(--warning); }
.migration-progress-pages { background-color: var(--oath-gray-400); }

.migration-progress-legend {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-3);
  font-size: var(--text-xs);
}

/* ============ SITE DETAIL (/admin/sites/{domain}) ============ */

.site-detail-dl {
  display: grid;
  grid-template-columns: minmax(180px, max-content) 1fr;
  gap: var(--space-2) var(--space-6);
  margin: 0;
}

.site-detail-dl dt {
  font-weight: 500;
  color: var(--oath-gray-700);
  font-size: var(--text-sm);
}

.site-detail-dl dd {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--oath-gray-900);
}

/* ============ DATATABLES OVERRIDES ============ */
/* Punch-ify the DataTables 2 controls (base sheet ships from the
   jsdelivr CDN on enhanced pages only). admin.css loads BEFORE the DT
   base CSS, so these selectors carry a body prefix to win the cascade;
   !important appears only where the DT base itself uses it (paging
   button colors). Kept minimal — we restyle the controls, not the grid. */

body div.dt-container {
  font-size: var(--text-sm);
  color: var(--oath-gray-700);
}

body div.dt-container .dt-search input.dt-input,
body div.dt-container .dt-length select.dt-input {
  background-color: var(--oath-white);
  border: 1px solid var(--oath-gray-300);
  border-radius: var(--radius-md);
  color: var(--oath-gray-900);
  font-family: inherit;
  font-size: var(--text-sm);
  padding: 0.375rem 0.75rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

body div.dt-container .dt-search input.dt-input:focus,
body div.dt-container .dt-length select.dt-input:focus {
  border-color: var(--oath-black);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
  outline: none;
}

body div.dt-container .dt-search label,
body div.dt-container .dt-length label,
body div.dt-container div.dt-info {
  color: var(--text-muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

body div.dt-container .dt-paging .dt-paging-button {
  background: none;
  border: 1px solid var(--oath-gray-300);
  border-radius: var(--radius-md);
  color: var(--oath-gray-700) !important;
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: 500;
  margin-left: 2px;
  padding: var(--space-1) var(--space-3);
  transition: all var(--transition-fast);
}

body div.dt-container .dt-paging .dt-paging-button:hover:not(.disabled):not(.current) {
  background: var(--oath-gray-100);
  border-color: var(--oath-gray-400);
  color: var(--oath-gray-900) !important;
}

body div.dt-container .dt-paging .dt-paging-button.current,
body div.dt-container .dt-paging .dt-paging-button.current:hover {
  background: var(--oath-black);
  border-color: var(--oath-black);
  color: var(--oath-white) !important;
}

body div.dt-container .dt-paging .dt-paging-button.disabled,
body div.dt-container .dt-paging .dt-paging-button.disabled:hover {
  background: none;
  border-color: var(--oath-gray-200);
  color: var(--oath-gray-400) !important;
}

