/* unseat.ai Dashboard — Brand-aligned CSS with Grid & Flexbox */

/* ── Design Tokens (Brand System) ────────────────────────── */
:root {
  /* Brand Colors */
  --rh-purple: #6d43f9;
  --rh-purple-light: #8b6dfa;
  --rh-purple-dark: #5a35d4;
  --rh-purple-bg: #f3f0ff;
  --rh-purple-bg-hover: #ede8ff;
  --rh-accent-1: #8f3eba;
  --rh-accent-2: #be3a7c;
  --rh-accent-3: #ed3b3e;

  /* Neutrals */
  --rh-bg: #fcfcfc;
  --rh-surface: #ffffff;
  --rh-border: #e8e5f0;
  --rh-text-primary: #1a1035;
  --rh-text-secondary: #6b6580;
  --rh-text-muted: #9b95a8;

  /* Shadows (purple-tinted) */
  --rh-shadow-sm: 0 1px 2px rgba(109, 67, 249, 0.04);
  --rh-shadow-md: 0 4px 12px rgba(109, 67, 249, 0.08);
  --rh-shadow-lg: 0 8px 24px rgba(109, 67, 249, 0.12);
  --rh-shadow-card: 0 1px 3px rgba(109, 67, 249, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);

  /* Typography */
  --rh-font: 'Inter', -apple-system, system-ui, sans-serif;
  --rh-font-size-xs: 0.75rem;
  --rh-font-size-sm: 0.875rem;
  --rh-font-size-base: 1rem;
  --rh-font-size-lg: 1.125rem;
  --rh-font-size-xl: 1.5rem;
  --rh-font-size-2xl: 1.875rem;
  --rh-font-size-3xl: 2.25rem;

  /* Spacing & Radius */
  --rh-radius-sm: 8px;
  --rh-radius-md: 12px;
  --rh-radius-lg: 16px;

  /* Transitions */
  --rh-transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Legacy mappings (backward compat for existing templates) */
  --primary: var(--rh-purple);
  --primary-hover: var(--rh-purple-dark);
  --primary-light: var(--rh-purple-bg);
  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: var(--rh-accent-3);
  --danger-light: #fee2e2;
  --bg: var(--rh-bg);
  --card-bg: var(--rh-surface);
  --text: var(--rh-text-primary);
  --text-muted: var(--rh-text-secondary);
  --border: var(--rh-border);
  --shadow: var(--rh-shadow-card);
  --shadow-md: var(--rh-shadow-md);
  --radius: var(--rh-radius-sm);
  --nav-width: 240px;
}

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

body {
  font-family: var(--rh-font);
  background: var(--rh-bg);
  color: var(--rh-text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
}

/* ── Layout ──────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: var(--nav-width) 1fr;
  min-height: 100vh;
}

.main-content {
  padding: 32px 40px;
  max-width: 1400px;
  background: var(--rh-bg);
  min-height: 100vh;
}

.page-title {
  font-size: var(--rh-font-size-xl);
  font-weight: 700;
  color: var(--rh-text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

/* ── Sidebar Navigation ──────────────────────────────────── */
.sidebar {
  background: var(--rh-surface);
  border-right: 1px solid var(--rh-border);
  width: 240px;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  padding: 4px 12px 24px;
  border-bottom: 1px solid var(--rh-border);
  margin-bottom: 16px;
}

.sidebar-logo {
  display: block;
  width: 160px;
  height: auto;
}

.sidebar-logo-dark {
  display: none;
  width: 160px;
  height: auto;
}

.sidebar-nav {
  list-style: none;
  flex: 1;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--rh-radius-sm);
  color: var(--rh-text-secondary);
  font-weight: 500;
  font-size: var(--rh-font-size-sm);
  transition: all var(--rh-transition);
  text-decoration: none;
}

.sidebar-nav li a svg {
  width: 18px;
  height: 18px;
  margin-right: 0.5rem;
  vertical-align: middle;
  opacity: 0.7;
  flex-shrink: 0;
}

.sidebar-nav li a:hover svg {
  opacity: 1;
}

.sidebar-nav li a.active svg {
  opacity: 1;
}

.sidebar-nav li.nav-group-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--rh-text-muted);
  padding: 16px 12px 4px;
  pointer-events: none;
}

.sidebar-nav li.nav-group-label:first-child {
  padding-top: 0;
}

.sidebar-nav li.nav-separator {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(109, 67, 249, 0.1);
}

.sidebar-nav li a:hover {
  background: var(--rh-purple-bg);
  color: var(--rh-purple);
}

.sidebar-nav li a.active {
  background: var(--rh-purple-bg);
  color: var(--rh-purple);
  font-weight: 600;
  border-left: 3px solid var(--rh-purple);
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ef4444;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  margin-left: auto;
}

/* Mobile hamburger toggle */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1001;
  background: var(--rh-surface);
  border: 1px solid var(--rh-border);
  border-radius: var(--rh-radius-sm);
  padding: 0.5rem;
  cursor: pointer;
  color: var(--rh-text-primary);
  box-shadow: var(--rh-shadow-md);
  line-height: 0;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 12px;
  border-top: 1px solid var(--rh-border);
  font-size: var(--rh-font-size-xs);
  color: var(--rh-text-muted);
}

.sidebar-footer a {
  color: var(--rh-text-muted);
}

.sidebar-footer .sidebar-logout {
  display: block;
  margin-top: 8px;
  font-size: var(--rh-font-size-xs);
  color: var(--rh-text-muted);
  text-decoration: none;
  transition: color var(--rh-transition);
}

.sidebar-footer .sidebar-logout:hover {
  color: var(--rh-accent-3);
}

.login-logo {
  text-align: center;
}

/* ── KPI Cards ───────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--rh-surface);
  border: 1px solid var(--rh-border);
  border-radius: var(--rh-radius-md);
  padding: 20px 24px;
  box-shadow: var(--rh-shadow-card);
  transition: all var(--rh-transition);
}

.kpi-card:hover {
  box-shadow: var(--rh-shadow-md);
  transform: translateY(-1px);
}

.kpi-card .label {
  font-size: var(--rh-font-size-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--rh-text-muted);
  margin-bottom: 8px;
}

.kpi-card .value {
  font-size: var(--rh-font-size-2xl);
  font-weight: 700;
  color: var(--rh-text-primary);
  letter-spacing: -0.02em;
  line-height: 1;
}

.kpi-card .trend {
  font-size: 0.82rem;
  margin-top: 8px;
  font-weight: 600;
}

/* Accent top-border variants */
.kpi-card.primary { border-top: 3px solid var(--rh-purple); }
.kpi-card.success { border-top: 3px solid #22c55e; }
.kpi-card.warning { border-top: 3px solid var(--rh-accent-2); }
.kpi-card.danger  { border-top: 3px solid var(--rh-accent-3); }

.trend-up {
  color: var(--success);
}

.trend-down {
  color: var(--danger);
}

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

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

/* ── Content Status Badges ──────────────────────────────── */
.status-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.status-published {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}
.status-planned {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}
.content-legend {
  font-size: 0.8rem;
  color: var(--rh-text-muted);
  margin-bottom: 1rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* ── Cards / Panels ──────────────────────────────────────── */
.card {
  background: var(--rh-surface);
  border: 1px solid var(--rh-border);
  border-radius: var(--rh-radius-md);
  box-shadow: var(--rh-shadow-card);
  margin-bottom: 1.5rem;
}

.card-header {
  font-size: var(--rh-font-size-base);
  font-weight: 600;
  color: var(--rh-text-primary);
  padding: 1rem 1.25rem;
  margin-bottom: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rh-border);
}

.card-body {
  padding: 24px;
}

/* ── Data Tables ─────────────────────────────────────────── */
/* ── Table Search Input ───────────────────────────────── */
.table-search {
  margin-bottom: 1rem;
}
.table-search input {
  width: 100%;
  max-width: 400px;
  padding: 0.5rem 1rem;
  border: 1px solid var(--rh-border);
  border-radius: var(--rh-radius-sm);
  background: var(--rh-surface);
  color: var(--rh-text-primary);
  font-size: var(--rh-font-size-sm);
  font-family: var(--rh-font);
  transition: border-color var(--rh-transition);
}
.table-search input:focus {
  outline: none;
  border-color: var(--rh-purple);
  box-shadow: 0 0 0 3px rgba(109, 67, 249, 0.1);
}
.table-search input::placeholder {
  color: var(--rh-text-muted);
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrap table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

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

thead th {
  font-size: var(--rh-font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rh-text-muted);
  padding: 12px 16px;
  border-bottom: 2px solid var(--rh-border);
  text-align: left;
  white-space: nowrap;
}

tbody td {
  padding: 12px 16px;
  color: var(--rh-text-secondary);
  font-size: var(--rh-font-size-sm);
  border-bottom: 1px solid rgba(232, 229, 240, 0.5);
}

tbody tr:nth-child(even) {
  background: rgba(243, 240, 255, 0.3);
}

tbody tr:hover td {
  background: var(--rh-purple-bg);
}

/* ── Chart Containers ────────────────────────────────────── */
.chart-container {
  position: relative;
  width: 100%;
  max-height: 360px;
  padding: 1rem 0;
}

.chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

/* ── Badges / Pills ──────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: var(--rh-font-size-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1.4;
  white-space: nowrap;
}

.badge-primary {
  background: var(--primary-light);
  color: var(--primary);
}

.badge-success {
  background: var(--success-light);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-light);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-light);
  color: var(--danger);
}

/* ── Progress Bars ───────────────────────────────────────── */
.progress {
  background: #f0ecfc;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 999px;
  background: var(--rh-purple);
  transition: width 0.6s ease;
}

.progress-bar.primary  { background: var(--rh-purple); }
.progress-bar.success  { background: #22c55e; }
.progress-bar.warning  { background: var(--rh-accent-2); }
.progress-bar.danger   { background: var(--rh-accent-3); }

/* ── Flash Messages ──────────────────────────────────────── */
.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.88rem;
  font-weight: 500;
}

.flash-error {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid #fca5a5;
}

.flash-success {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid #86efac;
}

.flash-warning {
  background: var(--warning-light);
  color: var(--warning);
  border: 1px solid #fcd34d;
}

/* ── Login Form ──────────────────────────────────────────── */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.login-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-top: 3px solid var(--rh-purple);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
}

.login-box h1 {
  font-size: 1.3rem;
  margin-bottom: 0.25rem;
}

.login-box p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  background: #ffffff;
  color: #1a1a2e;
  transition: border-color 0.15s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--rh-purple);
  box-shadow: 0 0 0 3px rgba(109, 67, 249, 0.15);
}

.btn {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  width: 100%;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

/* ── Onboarding Wizard ───────────────────────────────────── */
.onboard-wrapper {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  padding: 3rem 1rem;
  background: var(--bg);
}

.onboard-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 2rem 2rem 2.5rem;
  width: 100%;
  max-width: 700px;
}

.onboard-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.onboard-header h1 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.onboard-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.onboard-step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--card-bg);
  transition: all 0.2s;
}

.onboard-step-dot.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.onboard-step-line {
  width: 40px;
  height: 2px;
  background: var(--border);
}

.onboard-step-content h2 {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}

.onboard-subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
}

.onboard-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}

.onboard-section-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 1.25rem 0 0.5rem;
}

.onboard-optional {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.onboard-add-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.25rem 0;
  margin-bottom: 0.5rem;
}

.onboard-add-btn:hover {
  text-decoration: underline;
}

.onboard-radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.onboard-radio {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.onboard-radio input[type="radio"] {
  width: auto;
  margin: 0 0.15rem 0 0;
}

.onboard-radio-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-left: 0.25rem;
}

.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--rh-border);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  background: var(--rh-bg);
  color: var(--rh-text);
}

.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(109, 67, 249, 0.15);
}

.onboard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  gap: 1rem;
}

.onboard-actions .btn-primary,
.onboard-actions .btn-secondary {
  width: auto;
  padding: 0.6rem 1.5rem;
}

.btn-secondary {
  background: var(--card-bg);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg);
}

/* Analysis spinner */
.onboard-analyzing {
  text-align: center;
  padding: 2rem 0;
}

.onboard-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1.5rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.onboard-progress-steps {
  text-align: left;
  max-width: 280px;
  margin: 1rem auto;
}

.onboard-progress-item {
  padding: 0.4rem 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  position: relative;
  padding-left: 1.5rem;
}

.onboard-progress-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--card-bg);
}

.onboard-progress-item.active::before {
  border-color: var(--primary);
  background: var(--primary);
}

.onboard-progress-item.done::before {
  border-color: #22c55e;
  background: #22c55e;
}

.onboard-progress-item.done {
  color: var(--text-primary);
}

/* ===== Cinematic insight reel (loading animation) ===== */
.loading-reel {
  position: relative;
  min-height: 140px;
}
.loading-insight {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: var(--rh-purple-bg);
  border: 1px solid rgba(109, 67, 249, 0.15);
  border-radius: 12px;
  padding: 20px 24px;
  text-align: left;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  pointer-events: none;
}
.loading-insight.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.loading-insight.exit-up {
  opacity: 0;
  transform: translateY(-12px);
}
.loading-insight-label {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rh-purple);
  margin-bottom: 6px;
}
.loading-insight-text {
  font-size: 0.84rem;
  color: var(--rh-text-secondary);
  line-height: 1.65;
}
.loading-insight-text strong {
  color: var(--rh-text-primary);
  font-weight: 700;
}
.reel-progress {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}
.reel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(109, 67, 249, 0.15);
  transition: all 0.4s ease;
}
.reel-dot.active {
  background: var(--rh-purple);
  box-shadow: 0 0 6px rgba(109, 67, 249, 0.4);
}
.reel-dot.seen {
  background: rgba(109, 67, 249, 0.35);
}

/* Review step — pillar cards */
.onboard-pillar-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  background: var(--bg);
}

.onboard-pillar-header h3 {
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.onboard-pillar-kw {
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 500;
}

.onboard-pillar-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0.35rem 0 0.75rem;
}

.onboard-cluster {
  margin-left: 1rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--border);
}

.onboard-cluster-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.onboard-cluster-header strong {
  font-size: 0.85rem;
}

.onboard-cluster-kw {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.onboard-posts {
  margin-left: 0.75rem;
}

.onboard-post {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.2rem 0;
  font-size: 0.82rem;
}

.onboard-post-title {
  flex: 1;
}

.onboard-post-keyword {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.onboard-post-format {
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-muted);
}

/* Competitive gaps */
.onboard-gaps {
  margin-bottom: 0.5rem;
}

.onboard-gap {
  font-size: 0.82rem;
  padding: 0.35rem 0.75rem;
  background: var(--bg);
  border-left: 3px solid var(--primary);
  margin-bottom: 0.35rem;
  border-radius: 0 4px 4px 0;
}

/* Complete step */
.onboard-complete {
  text-align: center;
  padding: 1rem 0;
}

.onboard-check {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #22c55e;
  color: #fff;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.onboard-stat-row {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin: 1.25rem 0;
}

.onboard-stat {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.onboard-stat-num {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.onboard-next-steps {
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.85rem;
}

.onboard-next-steps h3 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.onboard-next-steps ul {
  margin: 0.5rem 0;
  padding-left: 1.25rem;
}

.onboard-next-steps li {
  margin-bottom: 0.25rem;
}

.onboard-next-steps code {
  font-size: 0.82rem;
  background: var(--card-bg);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
}

.onboard-summary {
  margin: 1rem 0;
}

/* Color picker styling */
input[type="color"] {
  width: 50px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px;
  cursor: pointer;
  background: var(--card-bg);
}

/* ── Onboard Credential Slides ─────────────────────────── */
.onboard-slide-header {
  margin-bottom: 1.5rem;
}
.onboard-slide-step {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light, #f3f0ff);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}
.onboard-slide-help {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--bg-secondary, #f8f9fa);
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  line-height: 1.6;
}
.onboard-slide-help ol {
  margin: 0.5rem 0 0 1.25rem;
  padding: 0;
}
.onboard-slide-help li {
  margin-bottom: 0.35rem;
}
.onboard-slide-help a {
  color: var(--primary);
  text-decoration: underline;
}
.onboard-service-email {
  display: inline-block;
  background: var(--bg-primary, #fff);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;
  font-size: 0.8rem;
  user-select: all;
  word-break: break-all;
}
.onboard-copy-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  cursor: pointer;
  font-size: 0.75rem;
  margin-left: 0.35rem;
  vertical-align: middle;
}
.onboard-copy-btn:hover {
  background: var(--bg-secondary, #f8f9fa);
}

/* ── Onboard Celebration Animation ────────────────────── */
.onboard-check-animate {
  animation: checkPop 0.5s ease-out;
}
@keyframes checkPop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); }
}

/* ── Skip Button ──────────────────────────────────────── */
.btn-skip {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0.5rem 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}
.btn-skip:hover {
  color: var(--text-secondary);
}

/* ── Platform Connection Status ───────────────────────── */
.platform-status {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1.25rem auto;
  max-width: 320px;
  text-align: left;
}
.platform-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.platform-item.connected {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}
.platform-item.pending {
  background: var(--bg);
  color: var(--text-muted);
}
.platform-icon {
  font-size: 1rem;
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
}
.platform-item.connected .platform-icon {
  color: #22c55e;
}
.platform-label {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 500;
}

/* ── Onboard Preflight Check ──────────────────────────── */
.onboard-preflight-results {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.preflight-item {
  display: grid;
  grid-template-columns: 32px 1fr 1.5fr;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  transition: background 0.2s;
}
.preflight-item:last-child {
  border-bottom: none;
}
.preflight-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.85rem;
  background: var(--bg-secondary, #f0f0f0);
  color: var(--text-secondary);
}
.preflight-label {
  font-weight: 600;
  color: var(--text-primary);
}
.preflight-message {
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-align: right;
}
.preflight-item.preflight-ok {
  background: #f0fdf4;
}
.preflight-item.preflight-ok .preflight-icon {
  background: #22c55e;
  color: white;
}
.preflight-item.preflight-ok .preflight-message {
  color: #15803d;
}
.preflight-item.preflight-fail {
  background: #fef2f2;
}
.preflight-item.preflight-fail .preflight-icon {
  background: #ef4444;
  color: white;
}
.preflight-item.preflight-fail .preflight-message {
  color: #dc2626;
}
@media (prefers-color-scheme: dark) {
  .preflight-item.preflight-ok {
    background: rgba(34, 197, 94, 0.1);
  }
  .preflight-item.preflight-ok .preflight-message {
    color: #4ade80;
  }
  .preflight-item.preflight-fail {
    background: rgba(239, 68, 68, 0.1);
  }
  .preflight-item.preflight-fail .preflight-message {
    color: #f87171;
  }
}

/* ── Admin Setup Checklist ──────────────────────────────── */
.setup-checklist {
  border-top: none;
}
.setup-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--rh-border);
}
.setup-item:last-child {
  border-bottom: none;
}
.setup-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.9rem;
  background: var(--rh-border);
  color: var(--rh-text-muted);
  margin-top: 0.15rem;
}
.setup-icon.setup-ok {
  background: #22c55e;
  color: white;
}
.setup-icon.setup-fail {
  background: #ef4444;
  color: white;
}
.setup-info strong {
  display: block;
  margin-bottom: 0.25rem;
}
.setup-info p {
  font-size: 0.85rem;
  color: var(--rh-text-secondary);
  margin: 0;
  line-height: 1.5;
}
.setup-info a {
  color: var(--rh-purple);
}
.setup-status {
  font-size: 0.85rem;
  color: var(--rh-text-muted);
  white-space: nowrap;
  margin-top: 0.25rem;
}
.setup-checkbox {
  display: flex;
  align-items: flex-start;
  margin-top: 0.15rem;
}
.setup-checkbox input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--rh-purple);
  cursor: pointer;
}

/* Keyword volume badges */
.onboard-kw-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  margin-left: 0.35rem;
  vertical-align: middle;
}
.onboard-kw-badge.vol-high {
  background: #dcfce7;
  color: #166534;
}
.onboard-kw-badge.vol-med {
  background: #fef9c3;
  color: #854d0e;
}
.onboard-kw-badge.vol-low {
  background: #fee2e2;
  color: #991b1b;
}

/* Intent badges */
.onboard-intent-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 600;
  padding: 0.05rem 0.3rem;
  border-radius: 2px;
  margin-left: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.onboard-intent-badge.intent-bofu {
  background: #ede9fe;
  color: #5b21b6;
}
.onboard-intent-badge.intent-mofu {
  background: #e0f2fe;
  color: #0369a1;
}
.onboard-intent-badge.intent-tofu {
  background: #f0fdf4;
  color: #15803d;
}

/* Pillar aggregate volume */
.onboard-pillar-vol {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* ── Onboard Refine Strategy Section ────────────────────── */
.onboard-refine-section {
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.onboard-refine-section .btn-secondary:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* ── Onboard Upload / Advanced Context ──────────────────── */
.onboard-advanced-section {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.onboard-advanced-toggle {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.4rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.onboard-advanced-toggle:hover {
  color: var(--rh-purple);
}

.onboard-upload-group {
  margin-top: 1.25rem;
}

.onboard-upload-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

.onboard-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--rh-radius-sm);
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.onboard-upload-zone:hover {
  border-color: var(--rh-purple);
  background: var(--rh-purple-bg);
}

.onboard-upload-zone.drag-over {
  border-color: var(--rh-purple);
  background: var(--rh-purple-bg);
  border-style: solid;
}

.onboard-upload-icon {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.onboard-upload-browse {
  color: var(--rh-purple);
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
}

.onboard-upload-formats {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.onboard-upload-files {
  margin-top: 0.5rem;
}

.onboard-upload-file {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 0.3rem;
  font-size: 0.8rem;
}

.onboard-upload-filename {
  flex: 1;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.onboard-upload-size {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.onboard-upload-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
}

.onboard-upload-remove:hover {
  color: #e53e3e;
}

.onboard-upload-textarea {
  width: 100%;
  min-height: 80px;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: var(--rh-font);
  resize: vertical;
  margin-top: 0.5rem;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.onboard-upload-textarea:focus {
  outline: none;
  border-color: var(--rh-purple);
  box-shadow: 0 0 0 3px rgba(109, 67, 249, 0.15);
}

.onboard-upload-textarea::placeholder {
  color: var(--text-muted);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    height: 100vh;
    width: 260px;
    z-index: 1000;
    transition: left 0.3s ease;
    flex-direction: column;
    overflow-y: auto;
    border-right: 1px solid var(--rh-border);
    border-bottom: none;
    padding: 24px 16px;
  }

  .sidebar.mobile-open {
    left: 0;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
  }

  .sidebar-brand {
    border-bottom: 1px solid var(--rh-border);
    padding: 4px 12px 24px;
    margin-bottom: 16px;
  }

  .sidebar-logo,
  .sidebar-logo-dark {
    width: 140px;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow-x: visible;
  }

  .sidebar-nav li a {
    white-space: nowrap;
    padding: 10px 12px;
  }

  .sidebar-nav li a.active {
    border-left: 3px solid var(--rh-purple);
    border-bottom: none;
  }

  .sidebar-footer {
    display: flex;
    flex-direction: column;
    margin-top: auto;
  }

  .main-content {
    padding: 20px 16px;
    padding-top: 60px;
  }

  .chart-row {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* ── Theme Toggle Button ─────────────────────────────────── */
.theme-toggle {
  background: none;
  border: 1px solid var(--rh-border);
  border-radius: 6px;
  padding: 5px 7px;
  cursor: pointer;
  color: var(--rh-text-muted);
  transition: all var(--rh-transition);
  display: flex;
  align-items: center;
}
.theme-toggle:hover {
  color: var(--rh-purple);
  border-color: var(--rh-purple);
  background: var(--rh-purple-bg);
}
/* Show sun in dark mode, moon in light mode */
.theme-icon-sun { display: none; }
.theme-icon-moon { display: block; }
html.dark .theme-icon-sun { display: block; }
html.dark .theme-icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  html:not(.light) .theme-icon-sun { display: block; }
  html:not(.light) .theme-icon-moon { display: none; }
}

/* ── Light override (user chose light on a dark-preference system) ── */
html.light .sidebar-logo { display: block; }
html.light .sidebar-logo-dark { display: none; }

/* ── Dark Mode (manual toggle) ────────────────────────────── */
html.dark {
  --rh-bg: #0f172a;
  --rh-surface: #1e293b;
  --rh-text-primary: #e2e8f0;
  --rh-text-secondary: #94a3b8;
  --rh-text-muted: #64748b;
  --rh-border: #334155;
  --rh-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3);
  --rh-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --rh-purple-bg: rgba(109, 67, 249, 0.15);
  --bg: #0f172a;
  --card-bg: #1e293b;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #334155;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --primary-light: rgba(109, 67, 249, 0.15);
  --success-light: rgba(22, 163, 74, 0.15);
  --warning-light: rgba(217, 119, 6, 0.15);
  --danger-light: rgba(220, 38, 38, 0.15);
}
html.dark tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.03); }
html.dark tbody tr:hover td { background: rgba(109, 67, 249, 0.1); }
html.dark input[type="text"], html.dark input[type="email"], html.dark input[type="password"],
html.dark input[type="url"], html.dark input[type="number"], html.dark input[type="search"],
html.dark textarea, html.dark select,
html.dark .form-group input, html.dark .form-group textarea, html.dark .form-group select {
  background: #0f172a; color: #e2e8f0; border-color: var(--rh-border);
}
html.dark input::placeholder, html.dark textarea::placeholder { color: #64748b; }
html.dark input:focus, html.dark textarea:focus, html.dark select:focus {
  border-color: var(--rh-purple); box-shadow: 0 0 0 3px rgba(109, 67, 249, 0.25);
}
html.dark .form-group label, html.dark .onboard-step-content label { color: #e2e8f0; }
html.dark .sidebar-logo { display: none; }
html.dark .sidebar-logo-dark { display: block; }
html.dark .login-wrapper, html.dark .onboard-wrapper { background: var(--rh-bg); }
html.dark .login-box, html.dark .onboard-card { background: var(--rh-surface); border-color: var(--rh-border); color: var(--rh-text-primary); }
html.dark .login-box h1, html.dark .onboard-header h1, html.dark .onboard-step-content h2 { color: var(--rh-text-primary); }
html.dark .login-box p, html.dark .onboard-subtitle { color: var(--rh-text-secondary); }
html.dark .flash { background: var(--rh-surface); border-color: var(--rh-border); }
html.dark .value-warning-color { color: #fbbf24; }
html.dark .value-success-color { color: #4ade80; }

/* ── Dark Mode (system preference fallback) ──────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --rh-bg: #0f172a;
    --rh-surface: #1e293b;
    --rh-text-primary: #e2e8f0;
    --rh-text-secondary: #94a3b8;
    --rh-text-muted: #64748b;
    --rh-border: #334155;
    --rh-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3);
    --rh-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --rh-purple-bg: rgba(109, 67, 249, 0.15);
    --bg: #0f172a;
    --card-bg: #1e293b;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --border: #334155;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --primary-light: rgba(109, 67, 249, 0.15);
    --success-light: rgba(22, 163, 74, 0.15);
    --warning-light: rgba(217, 119, 6, 0.15);
    --danger-light: rgba(220, 38, 38, 0.15);
  }

  tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
  }

  tbody tr:hover td {
    background: rgba(109, 67, 249, 0.1);
  }

  /* All form inputs in dark mode — covers login, onboard, dashboard, conversion assets */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="url"],
  input[type="number"],
  input[type="search"],
  textarea,
  select,
  .form-group input,
  .form-group textarea,
  .form-group select {
    background: #0f172a;
    color: #e2e8f0;
    border-color: var(--rh-border);
  }

  input::placeholder,
  textarea::placeholder {
    color: #64748b;
  }

  input:focus,
  textarea:focus,
  select:focus {
    border-color: var(--rh-purple);
    box-shadow: 0 0 0 3px rgba(109, 67, 249, 0.25);
  }

  /* Labels in dark mode */
  .form-group label,
  .onboard-step-content label {
    color: #e2e8f0;
  }

  .sidebar-logo { display: none; }
  .sidebar-logo-dark { display: block; }

  /* Standalone pages (login, onboard) */
  .login-wrapper,
  .onboard-wrapper {
    background: var(--rh-bg);
  }

  .login-box,
  .onboard-card {
    background: var(--rh-surface);
    border-color: var(--rh-border);
    color: var(--rh-text-primary);
  }

  .login-box h1,
  .onboard-header h1,
  .onboard-step-content h2 {
    color: var(--rh-text-primary);
  }

  .login-box p,
  .onboard-subtitle {
    color: var(--rh-text-secondary);
  }

  .onboard-step-dot {
    border-color: var(--rh-border);
    color: var(--rh-text-muted);
    background: var(--rh-surface);
  }

  .onboard-step-dot.active {
    background: var(--rh-purple);
    border-color: var(--rh-purple);
    color: #fff;
  }

  .onboard-step-line {
    background: var(--rh-border);
  }

  .onboard-section-label {
    color: var(--rh-text-secondary);
  }

  .onboard-radio {
    border-color: var(--rh-border);
    background: var(--rh-surface);
  }

  .onboard-radio:hover {
    border-color: var(--rh-purple);
  }

  .onboard-radio-desc {
    color: var(--rh-text-secondary);
  }

  .onboard-pillar-card {
    background: var(--rh-surface);
    border-color: var(--rh-border);
  }

  .onboard-cluster {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--rh-border);
  }

  .onboard-post {
    background: rgba(255, 255, 255, 0.02);
  }

  .onboard-complete {
    color: var(--rh-text-primary);
  }

  .onboard-next-steps {
    background: rgba(109, 67, 249, 0.1);
    border-color: rgba(109, 67, 249, 0.2);
  }

  .onboard-next-steps code {
    background: rgba(0, 0, 0, 0.3);
    color: var(--rh-purple-light);
  }

  .onboard-upload-zone {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--rh-border);
  }

  .onboard-upload-zone:hover {
    background: rgba(109, 67, 249, 0.05);
  }

  .onboard-upload-file {
    background: var(--rh-surface);
    border-color: var(--rh-border);
  }

  .onboard-upload-textarea {
    background: #0f172a;
    color: var(--rh-text-primary);
    border-color: var(--rh-border);
  }

  .flash {
    background: var(--rh-surface);
    border-color: var(--rh-border);
  }

  /* Link intelligence inline color overrides */
  .link-orphan-heading {
    color: var(--warning);
  }

  .link-orphan-item {
    background: rgba(217, 119, 6, 0.1);
  }

  .link-underlinked-item {
    background: rgba(109, 67, 249, 0.08);
  }

  /* Content freshness inline color overrides */
  .value-warning-color {
    color: #fbbf24;
  }

  .value-success-color {
    color: #4ade80;
  }
}

/* ── Utility ─────────────────────────────────────────────── */
.text-muted {
  color: var(--text-muted);
}

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

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

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

.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

.mt-1 {
  margin-top: 0.5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.mb-1 {
  margin-bottom: 0.5rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

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

/* ── Empty States ───────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--rh-text-muted);
}

.empty-state h3 {
  color: var(--rh-text-primary);
  font-weight: 600;
  font-size: var(--rh-font-size-base);
  margin: 16px 0 8px;
}

.empty-state p {
  font-size: var(--rh-font-size-sm);
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.6;
}

.empty-state svg {
  width: 64px;
  height: 64px;
  color: var(--rh-purple);
  opacity: 0.4;
}

/* ── Page Load Animation ────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.main-content {
  animation: fadeInUp 0.3s ease-out;
}

/* ── Phase 9: Delta Indicators ──────────────────────────── */
.delta {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: var(--rh-font-size-xs);
  font-weight: 500;
}

.delta-up { color: #16a34a; }
.delta-down { color: var(--rh-accent-3); }
.delta-neutral { color: var(--rh-text-muted); }
.delta-new { color: var(--rh-purple); font-style: italic; }

.delta svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* ── Phase 9: Pending KPI (zero-value) ──────────────────── */
.kpi-pending {
  border-style: dashed;
  border-color: rgba(109, 67, 249, 0.2);
}

.value-pending {
  color: var(--rh-text-muted) !important;
  font-size: var(--rh-font-size-xl) !important;
}

.kpi-context {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--rh-purple);
  font-weight: 500;
  opacity: 0.8;
}

.kpi-context svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* ── Phase 9: Progress Banner ───────────────────────────── */
.progress-banner {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: linear-gradient(135deg, #f8f5ff 0%, #ede8ff 100%);
  border: 1px solid rgba(109, 67, 249, 0.12);
  border-radius: var(--rh-radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.progress-banner-icon {
  width: 40px;
  height: 40px;
  background: var(--rh-purple);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.progress-banner-icon svg {
  width: 20px;
  height: 20px;
  color: white;
}

.progress-banner-title {
  font-weight: 700;
  font-size: var(--rh-font-size-base);
  color: var(--rh-text-primary);
  margin-bottom: 4px;
}

.progress-banner-text {
  font-size: var(--rh-font-size-sm);
  color: var(--rh-text-secondary);
  line-height: 1.5;
}

/* ── Phase 9: Milestone Card ────────────────────────────── */
.milestone-card {
  grid-column: span 2;
}

.value-total {
  font-size: var(--rh-font-size-sm);
  font-weight: 400;
  color: var(--rh-text-muted);
}

.milestone-bar {
  position: relative;
  height: 8px;
  background: var(--rh-purple-bg);
  border-radius: 999px;
  margin: 12px 0 8px;
  overflow: visible;
}

.milestone-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rh-purple), var(--rh-accent-1));
  border-radius: 999px;
  transition: width 1s ease;
}

.milestone-subtext {
  display: flex;
  justify-content: space-between;
  font-size: var(--rh-font-size-xs);
  color: var(--rh-text-muted);
}

.milestone-velocity {
  color: var(--rh-purple);
  font-weight: 600;
}

/* ── Phase 9: Highlight Card (Striking Distance) ────────── */
.highlight-card {
  background: linear-gradient(135deg, #f8f5ff 0%, #f0ebff 100%);
  border: 1px solid rgba(109, 67, 249, 0.15);
  position: relative;
}

.highlight-badge {
  position: absolute;
  top: -8px;
  right: 16px;
  background: var(--rh-purple);
  color: white;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 10px;
  border-radius: 999px;
}

.highlight-subtext {
  font-size: var(--rh-font-size-xs);
  color: var(--rh-purple);
  margin-top: 4px;
  font-weight: 500;
}

/* ── Phase 9: Timeline ──────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--rh-purple), var(--rh-purple-bg));
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
  padding-left: 20px;
}

.timeline-dot {
  position: absolute;
  left: -20px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--rh-purple);
  background: white;
}

.timeline-dot.published {
  background: var(--rh-purple);
}

.timeline-title {
  font-size: var(--rh-font-size-sm);
  font-weight: 500;
  color: var(--rh-text-primary);
}

.timeline-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.timeline-date {
  font-size: var(--rh-font-size-xs);
  color: var(--rh-text-muted);
}

.badge-pillar {
  background: var(--rh-purple-bg);
  color: var(--rh-purple);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.card-header-badge {
  float: right;
  background: var(--rh-purple-bg);
  color: var(--rh-purple);
  font-size: var(--rh-font-size-xs);
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 600;
}

/* ── Phase 9: Pillar Progress Bars ──────────────────────── */
.pillar-row {
  display: grid;
  grid-template-columns: 140px 1fr 60px;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.pillar-name {
  font-weight: 600;
  font-size: var(--rh-font-size-sm);
  color: var(--rh-text-primary);
}

.pillar-count {
  font-size: var(--rh-font-size-xs);
  color: var(--rh-text-muted);
  margin-left: 8px;
}

.pillar-bar {
  height: 10px;
  background: var(--rh-purple-bg);
  border-radius: 999px;
  overflow: hidden;
}

.pillar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rh-purple), var(--rh-accent-1));
  border-radius: 999px;
  transition: width 0.8s ease;
}

.pillar-pct {
  text-align: right;
  font-size: var(--rh-font-size-xs);
  font-weight: 600;
  color: var(--rh-purple);
}

/* ── Pillar Performance Table ──────────────────────────── */
.pillar-perf-table {
  margin: 0;
}

.pillar-perf-table th,
.pillar-perf-table td {
  padding: 10px 14px;
}

.pillar-perf-name {
  font-weight: 600;
  font-size: var(--rh-font-size-sm);
  display: block;
  text-transform: capitalize;
}

.pillar-perf-keyword {
  display: block;
  font-size: var(--rh-font-size-xs);
  color: var(--rh-text-muted);
  margin-top: 2px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Phase 9: Next Up Card ──────────────────────────────── */
.next-up-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(232, 229, 240, 0.5);
}

.next-up-item:last-child {
  border-bottom: none;
}

.next-up-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rh-purple-bg);
  border: 2px solid var(--rh-purple);
  flex-shrink: 0;
}

.next-up-title {
  font-size: var(--rh-font-size-sm);
  font-weight: 500;
  color: var(--rh-text-primary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Phase 9: Date formatting ───────────────────────────── */
.date-pending {
  color: var(--rh-text-muted);
  font-style: italic;
  font-size: var(--rh-font-size-xs);
}

.date-published {
  color: #16a34a;
  font-weight: 500;
}

/* ── Phase 9: Pillar sections hide 0/0 ──────────────────── */
.pillar-section-upcoming {
  opacity: 0.5;
  border-style: dashed;
}

@media (max-width: 768px) {
  .milestone-card { grid-column: span 1; }
  .pillar-row { grid-template-columns: 100px 1fr 50px; }
  .progress-banner { flex-direction: column; }
}

/* ── Milestone Achievement Banner ──────────────────────── */
.milestone-banner {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.milestone-banner-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #fffdf0 0%, #fef9e7 100%);
  border: 1px solid #fcd34d;
  border-radius: var(--rh-radius-md);
  padding: 12px 18px;
  flex: 1;
  min-width: 200px;
}

.milestone-banner-item.milestone-achievement {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border-color: #fb923c;
}

.milestone-banner-item.milestone-opportunity {
  background: linear-gradient(135deg, #f8f5ff 0%, #ede8ff 100%);
  border-color: rgba(109, 67, 249, 0.3);
}

.milestone-banner-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.milestone-banner-icon svg {
  width: 20px;
  height: 20px;
  color: #d97706;
}

.milestone-achievement .milestone-banner-icon svg {
  color: #ea580c;
}

.milestone-opportunity .milestone-banner-icon svg {
  color: var(--rh-purple);
}

.milestone-banner-text {
  font-size: var(--rh-font-size-sm);
  font-weight: 600;
  color: var(--rh-text-primary);
}

/* ── Milestone Celebration Animation ─────────────────── */
.milestone-celebrate {
  animation: celebratePulse 2s ease-in-out;
}

@keyframes celebratePulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(109, 67, 249, 0.4); }
  25% { transform: scale(1.02); box-shadow: 0 0 20px 10px rgba(109, 67, 249, 0.2); }
  50% { transform: scale(1); box-shadow: 0 0 0 0 rgba(109, 67, 249, 0); }
  75% { transform: scale(1.01); box-shadow: 0 0 10px 5px rgba(109, 67, 249, 0.1); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(109, 67, 249, 0); }
}

/* ── Growth Since Start Banner ─────────────────────────── */
.growth-banner {
  background: var(--rh-surface);
  border: 1px solid var(--rh-border);
  border-radius: var(--rh-radius-md);
  padding: 16px 24px;
  margin-bottom: 20px;
  box-shadow: var(--rh-shadow-card);
}

.growth-banner-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: var(--rh-font-size-sm);
  color: var(--rh-text-primary);
  margin-bottom: 12px;
}

.growth-banner-header svg {
  width: 16px;
  height: 16px;
  color: var(--rh-purple);
}

.growth-since {
  font-weight: 400;
  color: var(--rh-text-muted);
  font-size: var(--rh-font-size-xs);
  margin-left: auto;
}

.growth-stats {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.growth-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.growth-stat-value {
  font-size: var(--rh-font-size-lg);
  font-weight: 700;
  color: var(--rh-text-primary);
}

.growth-stat-label {
  font-size: var(--rh-font-size-xs);
  color: var(--rh-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* ── Expectations Banner (replaces growth banner for new clients) ── */
.expectations-banner {
  background: var(--rh-surface);
  border: 1px solid var(--rh-border);
  border-radius: var(--rh-radius-md);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--rh-shadow-card);
  border-left: 4px solid var(--rh-purple);
}

.expectations-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: var(--rh-font-size-sm);
  color: var(--rh-text-primary);
  margin-bottom: 16px;
}

.expectations-header svg {
  width: 18px;
  height: 18px;
  color: var(--rh-purple);
}

.expectations-since {
  font-weight: 400;
  color: var(--rh-text-muted);
  font-size: var(--rh-font-size-xs);
  margin-left: auto;
}

.expectations-timeline {
  display: flex;
  gap: 0;
}

.expectations-phase {
  flex: 1;
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--rh-radius-sm);
  position: relative;
}

.expectations-phase + .expectations-phase {
  border-left: 1px solid var(--rh-border);
}

.expectations-phase.phase-active {
  background: var(--rh-purple-bg);
}

.expectations-phase.phase-done {
  opacity: 0.55;
}

.expectations-phase-marker {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--rh-text-muted);
  background: var(--rh-purple-bg);
  border: 2px solid var(--rh-border);
}

.phase-active .expectations-phase-marker {
  background: var(--rh-purple);
  color: white;
  border-color: var(--rh-purple);
}

.phase-done .expectations-phase-marker {
  background: #22c55e;
  color: white;
  border-color: #22c55e;
}

.phase-done .expectations-phase-marker svg {
  width: 14px;
  height: 14px;
}

.expectations-phase-info strong {
  display: block;
  font-size: var(--rh-font-size-xs);
  color: var(--rh-text-primary);
  margin-bottom: 2px;
}

.expectations-phase-info p {
  font-size: 0.78rem;
  color: var(--rh-text-secondary);
  line-height: 1.4;
  margin: 0;
}

@media (max-width: 768px) {
  .expectations-timeline {
    flex-direction: column;
  }
  .expectations-phase + .expectations-phase {
    border-left: none;
    border-top: 1px solid var(--rh-border);
  }
}

/* ── Traffic Value Card ────────────────────────────────── */
.traffic-value-card {
  background: var(--rh-surface);
  border: 1px solid var(--rh-border);
  border-radius: var(--rh-radius-md);
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: var(--rh-shadow-card);
  border-left: 4px solid #16a34a;
}

.traffic-value-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--rh-font-size-sm);
  font-weight: 600;
  color: var(--rh-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.traffic-value-header svg {
  width: 16px;
  height: 16px;
  color: #16a34a;
}

.traffic-value-main {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 12px;
}

.traffic-value-amount {
  font-size: var(--rh-font-size-2xl);
  font-weight: 700;
  color: #16a34a;
  letter-spacing: -0.02em;
}

.traffic-value-period {
  font-size: var(--rh-font-size-sm);
  color: var(--rh-text-muted);
}

.traffic-value-annual {
  font-size: var(--rh-font-size-sm);
  color: var(--rh-text-muted);
  margin-left: 8px;
}

.traffic-value-breakdown {
  display: flex;
  gap: 24px;
  margin-bottom: 8px;
}

.traffic-value-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.traffic-value-label {
  font-size: var(--rh-font-size-xs);
  color: var(--rh-text-muted);
}

.traffic-value-num {
  font-size: var(--rh-font-size-sm);
  font-weight: 600;
  color: var(--rh-text-primary);
}

.traffic-value-note {
  font-size: 11px;
  color: var(--rh-text-muted);
  font-style: italic;
}

/* ── Notifications Page ────────────────────────────────── */
.notif-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(232, 229, 240, 0.5);
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-publish .notif-icon {
  background: var(--success-light);
  color: var(--success);
}

.notif-quality_failure .notif-icon {
  background: var(--danger-light);
  color: var(--danger);
}

.notif-icon svg {
  width: 16px;
  height: 16px;
}

.notif-content {
  flex: 1;
  min-width: 0;
}

.notif-title {
  font-size: var(--rh-font-size-sm);
  font-weight: 600;
  color: var(--rh-text-primary);
  margin-bottom: 4px;
}

.notif-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.notif-format {
  font-size: var(--rh-font-size-xs);
  color: var(--rh-text-muted);
}

.notif-date {
  font-size: var(--rh-font-size-xs);
  color: var(--rh-text-muted);
}

.notif-link {
  display: inline-block;
  margin-top: 6px;
  font-size: var(--rh-font-size-xs);
  font-weight: 500;
  color: var(--rh-purple);
}

.notif-fixes {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.notif-fixes-label {
  font-size: 11px;
  color: var(--rh-text-muted);
  font-weight: 500;
}

.notif-fix-item {
  font-size: 11px;
  background: var(--warning-light);
  color: var(--warning);
  padding: 1px 6px;
  border-radius: 4px;
}

.notif-failures {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notif-failure-item {
  font-size: 11px;
  color: var(--danger);
  padding-left: 12px;
  position: relative;
}

.notif-failure-item::before {
  content: "\2022";
  position: absolute;
  left: 0;
}

/* ── Opportunity Keywords Table ──────────────────────── */
.opp-keyword {
  font-weight: 500;
  color: var(--rh-text-primary);
  display: block;
}

.opp-rec {
  display: block;
  font-size: 11px;
  color: var(--rh-text-muted);
  margin-top: 2px;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Responsive for new sections ───────────────────────── */
@media (max-width: 768px) {
  .milestone-banner {
    flex-direction: column;
  }
  .growth-stats {
    gap: 16px;
  }
  .traffic-value-breakdown {
    flex-direction: column;
    gap: 8px;
  }
  .traffic-value-main {
    flex-wrap: wrap;
  }
  .traffic-value-annual {
    margin-left: 0;
    display: block;
    width: 100%;
  }
  .dashboard-timing {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* ── KPI Breakdown Tags ──────────────────────────────────── */
.kpi-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  justify-content: center;
}
.kpi-breakdown-item {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--rh-purple-bg);
  color: var(--rh-text-secondary);
  white-space: nowrap;
}
.kpi-positive {
  background: #dcfce7;
  color: #16a34a;
}
.kpi-negative {
  background: #fee2e2;
  color: #ef4444;
}
.kpi-tag-positive {
  background: #dcfce7;
  color: #16a34a;
}
.kpi-tag-warning {
  background: #fef3c7;
  color: #d97706;
}
.kpi-tag-danger {
  background: #fee2e2;
  color: #ef4444;
}

/* ── Content Opportunities Card ──────────────────────────── */
.opportunity-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rh-border);
}
.opportunity-item:last-child {
  border-bottom: none;
}
.opp-content {
  flex: 1;
  min-width: 0;
}
.opp-content strong {
  font-size: 0.9rem;
}
.opp-position {
  font-size: 0.75rem;
  color: var(--rh-text-muted);
  margin-left: 0.5rem;
}
.opp-rec {
  font-size: 0.8rem;
  color: var(--rh-text-secondary);
  margin-top: 2px;
}
.badge-striking_distance { background: #dcfce7; color: #16a34a; }
.badge-content_gaps { background: #fef3c7; color: #d97706; }
.badge-rising_keywords { background: #dcfce7; color: #16a34a; }
.badge-declining_keywords { background: #fee2e2; color: #ef4444; }
.badge-new_opportunities { background: var(--rh-purple-bg); color: var(--rh-purple); }
.opp-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
.btn-approve {
  background: #22c55e;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
  font-size: 0.8rem;
  transition: var(--rh-transition);
}
.btn-approve:hover:not(:disabled) {
  background: #16a34a;
}
.btn-dismiss {
  background: transparent;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
  font-size: 0.8rem;
  transition: var(--rh-transition);
}
.btn-dismiss:hover:not(:disabled) {
  background: #f1f5f9;
}
.opp-approved {
  opacity: 0.6;
}
.opp-approved .btn-approve {
  background: #86efac;
}
.opp-dismissed {
  opacity: 0.4;
}
.btn-error {
  background: #ef4444 !important;
  color: #fff !important;
  border-color: #ef4444 !important;
}

/* ── Dashboard Timing Footer ─────────────────────────────── */
.dashboard-timing {
  display: flex;
  gap: 2rem;
  padding: 1rem 1.5rem;
  margin-top: 2rem;
  border-top: 1px solid var(--rh-border);
  color: var(--rh-text-muted);
  font-size: 0.8rem;
}
.timing-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.timing-label {
  font-weight: 600;
  color: var(--rh-text-secondary);
}

/* ── Hero Metric (ROI storytelling) ────────────────────────── */
.hero-metric {
  background: linear-gradient(135deg, var(--rh-purple) 0%, var(--rh-purple-dark) 100%);
  border-radius: var(--rh-radius-md);
  padding: 2rem 2.5rem;
  margin-bottom: 1.5rem;
  color: white;
}
.hero-headline {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.hero-subtext {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 0.75rem;
}
.hero-subtext strong {
  opacity: 1;
}
.hero-summary {
  font-size: 0.95rem;
  opacity: 0.8;
  line-height: 1.5;
}

/* ── KPI Section Headers ──────────────────────────────────── */
.kpi-section-header {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rh-text-muted);
  margin: 1.5rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rh-border);
}

/* ── Data Period ──────────────────────────────────────────── */
.data-period {
  font-size: 0.85rem;
  color: var(--rh-text-muted);
  margin-bottom: 1rem;
}

/* ── Traffic Value unit suffix ────────────────────────────── */
.value-unit {
  font-size: 0.5em;
  font-weight: 400;
  opacity: 0.7;
}

/* ── Extracted inline styles (dark-mode compatible) ───────── */

/* Content freshness / status color indicators */
.value-danger-color {
  color: var(--danger);
}

.value-warning-color {
  color: var(--warning);
}

.value-success-color {
  color: var(--success);
}

/* Link intelligence: orphan & under-linked page lists */
.link-orphan-heading {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--warning);
}

.link-page-list {
  list-style: none;
  padding-left: 0;
}

.link-orphan-item {
  margin-bottom: 0.4rem;
  padding: 0.5rem 0.75rem;
  background: rgba(217, 119, 6, 0.06);
  border-radius: 6px;
}

.link-underlinked-heading {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.link-underlinked-item {
  margin-bottom: 0.4rem;
  padding: 0.5rem 0.75rem;
  background: rgba(109, 67, 249, 0.04);
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Content page: pillar progress row */
.pillar-progress-row {
  margin-bottom: 1.25rem;
}

.pillar-progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.pillar-progress-name {
  font-weight: 600;
  text-transform: capitalize;
}

/* Content page: details/summary common patterns */
.content-details-summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  text-transform: capitalize;
  font-size: 0.95rem;
}

.content-details-body {
  padding: 0 1.25rem 1.25rem;
}

.content-cluster-header {
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.content-post-list {
  list-style: none;
  padding-left: 1.5rem;
}

.content-post-item {
  margin-bottom: 0.25rem;
}

.content-standalone-header {
  font-weight: 600;
  margin-bottom: 0.4rem;
}

/* Inline font-weight: 500 pattern (table cells) */
.fw-medium {
  font-weight: 500;
}

.font-small {
  font-size: 0.8rem;
}

/* ── Conversion Assets Page ─────────────────────────────── */

/* Asset form — hidden by default, slides open */
.asset-form {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.25s ease;
  opacity: 0;
  border-bottom: 1px solid var(--rh-border);
}

.asset-form.active {
  max-height: 1200px;
  opacity: 1;
}

.asset-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.25rem;
}

.asset-form .form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.asset-form .form-group input,
.asset-form .form-group select,
.asset-form .form-group textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--rh-border);
  border-radius: 6px;
  font-size: 0.88rem;
  font-family: var(--rh-font);
  transition: border-color var(--rh-transition);
  background: var(--rh-surface);
  color: var(--rh-text-primary);
}

.asset-form .form-group input:focus,
.asset-form .form-group select:focus,
.asset-form .form-group textarea:focus {
  outline: none;
  border-color: var(--rh-purple);
  box-shadow: 0 0 0 3px rgba(109, 67, 249, 0.1);
}

/* Asset type badges */
.badge-pdf_download {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}

.badge-template {
  background: rgba(109, 67, 249, 0.12);
  color: var(--rh-purple);
}

.badge-tool {
  background: rgba(249, 115, 22, 0.12);
  color: #f97316;
}

.badge-webinar {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
}

.badge-case_study {
  background: rgba(20, 184, 166, 0.12);
  color: #14b8a6;
}

.badge-ebook {
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
}

.badge-checklist {
  background: rgba(236, 72, 153, 0.12);
  color: #ec4899;
}

/* Buyer stage badges */
.badge-tofu {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

.badge-mofu {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

.badge-bofu {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ccc;
  border-radius: 20px;
  transition: background var(--rh-transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform var(--rh-transition);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--rh-purple);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
}

/* Toggle switch with inline label */
.toggle-switch-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  position: relative;
}

.toggle-switch-label input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-switch-label .toggle-slider {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

/* Settings panel */
.settings-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-panel-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: end;
}

.settings-panel .form-group select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--rh-border);
  border-radius: 6px;
  font-size: 0.88rem;
  font-family: var(--rh-font);
  background: var(--rh-surface);
  color: var(--rh-text-primary);
  transition: border-color var(--rh-transition);
}

.settings-panel .form-group select:focus {
  outline: none;
  border-color: var(--rh-purple);
  box-shadow: 0 0 0 3px rgba(109, 67, 249, 0.1);
}

/* Default CTA card */
.default-cta-card {
  border-left: 3px solid var(--rh-purple);
}

.default-cta-card .form-group input,
.default-cta-card .form-group textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--rh-border);
  border-radius: 6px;
  font-size: 0.88rem;
  font-family: var(--rh-font);
  background: var(--rh-surface);
  color: var(--rh-text-primary);
  transition: border-color var(--rh-transition);
}

.default-cta-card .form-group input:focus,
.default-cta-card .form-group textarea:focus {
  outline: none;
  border-color: var(--rh-purple);
  box-shadow: 0 0 0 3px rgba(109, 67, 249, 0.1);
}

@media (max-width: 900px) {
  .asset-form-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 768px) {
  .asset-form-grid {
    grid-template-columns: 1fr !important;
  }
  .settings-panel-row {
    grid-template-columns: 1fr;
  }
}

/* ── Content Refresh Pipeline ──────────────────────────── */

/* Page subtitle */
.page-subtitle {
  font-size: var(--rh-font-size-sm);
  color: var(--rh-text-secondary);
  margin-top: -16px;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* Trigger badges */
.badge-trigger-declining { background: #fee2e2; color: #ef4444; }
.badge-trigger-content_gap { background: #fef3c7; color: #d97706; }
.badge-trigger-striking_distance { background: #dbeafe; color: #2563eb; }
.badge-trigger-routine_90d { background: #f1f5f9; color: #64748b; }
.badge-trigger-deep_180d { background: #f3e8ff; color: #9333ea; }
.badge-trigger-rising_momentum { background: #dcfce7; color: #16a34a; }

/* Priority badges */
.badge-priority-urgent { background: #fee2e2; color: #ef4444; font-weight: 700; }
.badge-priority-high { background: #fef3c7; color: #d97706; }
.badge-priority-medium { background: #fef9c3; color: #a16207; }
.badge-priority-low { background: #f1f5f9; color: #64748b; }

/* Status badges */
.badge-status-pending { background: var(--rh-purple-bg); color: var(--rh-purple); }
.badge-status-in_progress { background: #dbeafe; color: #2563eb; }
.badge-status-completed { background: #dcfce7; color: #16a34a; }
.badge-status-dismissed { background: #f1f5f9; color: #94a3b8; }

/* Refresh type labels */
.refresh-type-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--rh-text-secondary);
  text-transform: capitalize;
}

/* Post title in refresh queue */
.refresh-post-title {
  font-weight: 600;
  color: var(--rh-text-primary);
  line-height: 1.3;
  display: inline-block;
}

a.refresh-post-title:hover {
  color: var(--rh-purple);
}

/* Age indicators */
.refresh-age {
  font-weight: 500;
  color: var(--rh-text-secondary);
}

.refresh-age-stale {
  color: #d97706;
}

.refresh-age-old {
  color: #ef4444;
  font-weight: 600;
}

/* Action bar */
.refresh-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.refresh-action-bar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.refresh-action-bar-right {
  font-size: 0.82rem;
  color: var(--rh-text-muted);
}

.refresh-status-msg {
  font-size: 0.85rem;
  color: var(--rh-text-muted);
  transition: color var(--rh-transition);
}

.refresh-status-loading {
  animation: pulse-text 1.5s ease-in-out infinite;
}

@keyframes pulse-text {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Filter tabs */
.refresh-filter-bar {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.refresh-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--rh-surface);
  border: 1px solid var(--rh-border);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--rh-text-secondary);
  transition: all var(--rh-transition);
  font-family: var(--rh-font);
}

.refresh-filter-btn:hover {
  background: var(--rh-purple-bg);
  border-color: var(--rh-purple-light);
  color: var(--rh-purple);
}

.refresh-filter-btn.active {
  background: var(--rh-purple);
  border-color: var(--rh-purple);
  color: #fff;
}

.refresh-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(0,0,0,0.08);
}

.refresh-filter-btn.active .refresh-filter-count {
  background: rgba(255,255,255,0.25);
}

.refresh-filter-count-danger {
  background: #fee2e2;
  color: #ef4444;
}

.refresh-filter-btn.active .refresh-filter-count-danger {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

.refresh-filter-count-warning {
  background: #fef3c7;
  color: #d97706;
}

.refresh-filter-btn.active .refresh-filter-count-warning {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* Action buttons */
.refresh-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: nowrap;
}

.btn-refresh-start {
  background: var(--rh-purple);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.3rem 0.85rem;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--rh-font);
  transition: all var(--rh-transition);
  white-space: nowrap;
}

.btn-refresh-start:hover {
  background: var(--rh-purple-dark);
  transform: translateY(-1px);
}

.btn-refresh-start:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-refresh-dismiss {
  background: transparent;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.3rem 0.85rem;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: var(--rh-font);
  transition: var(--rh-transition);
  white-space: nowrap;
}

.btn-refresh-dismiss:hover {
  background: #f1f5f9;
  color: #64748b;
}

.btn-refresh-dismiss:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-refresh-complete {
  background: #22c55e;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.3rem 0.85rem;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--rh-font);
  transition: all var(--rh-transition);
  white-space: nowrap;
}

.btn-refresh-complete:hover {
  background: #16a34a;
  transform: translateY(-1px);
}

.btn-refresh-complete:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Row states */
.refresh-dismissed {
  opacity: 0.35;
  background: #f9fafb;
}

.refresh-dismissed:hover {
  opacity: 0.6;
}

.refresh-completed {
  opacity: 0.5;
  background: #f0fdf4;
}

.refresh-completed:hover {
  opacity: 0.75;
}

/* Actions toggle button */
.btn-actions-toggle {
  background: transparent;
  border: 1px solid var(--rh-border);
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--rh-text-secondary);
  font-family: var(--rh-font);
  transition: var(--rh-transition);
}

.btn-actions-toggle:hover {
  background: var(--rh-purple-bg);
  border-color: var(--rh-purple-light);
}

.btn-actions-toggle.actions-open {
  background: var(--rh-purple-bg);
  border-color: var(--rh-purple-light);
  color: var(--rh-purple);
}

/* Recommended actions list */
.actions-list {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  font-size: 0.78rem;
  color: var(--rh-text-secondary);
  line-height: 1.6;
}

.actions-list li {
  margin-bottom: 0.15rem;
}

/* Dismiss form */
.refresh-dismiss-form {
  margin-top: 0.5rem;
}

.refresh-select {
  width: 100%;
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
  font-family: var(--rh-font);
  border: 1px solid var(--rh-border);
  border-radius: 6px;
  color: var(--rh-text-primary);
  background: var(--rh-surface);
  cursor: pointer;
  transition: border-color var(--rh-transition);
}

.refresh-select:focus {
  outline: none;
  border-color: var(--rh-purple-light);
  box-shadow: 0 0 0 3px rgba(109, 67, 249, 0.1);
}

/* Complete form inline */
.refresh-complete-form {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.refresh-complete-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--rh-text-primary);
  margin-bottom: 0.5rem;
}

.refresh-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.refresh-check-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--rh-text-secondary);
  cursor: pointer;
  padding: 0.2rem 0;
}

.refresh-check-item input[type="checkbox"] {
  accent-color: var(--rh-purple);
  cursor: pointer;
}

.refresh-check-item:hover {
  color: var(--rh-text-primary);
}

.refresh-textarea {
  width: 100%;
  margin-bottom: 0.25rem;
  font-size: 0.8rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--rh-border);
  border-radius: 6px;
  font-family: var(--rh-font);
  resize: vertical;
  color: var(--rh-text-primary);
}

.refresh-textarea:focus {
  outline: none;
  border-color: var(--rh-purple-light);
  box-shadow: 0 0 0 3px rgba(109, 67, 249, 0.1);
}

/* Trigger guide */
.refresh-trigger-guide {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.refresh-trigger-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.refresh-trigger-item .badge {
  align-self: flex-start;
}

.refresh-trigger-item p {
  font-size: 0.82rem;
  color: var(--rh-text-secondary);
  line-height: 1.5;
  margin: 0;
}

.card-body.collapsed {
  display: none;
}

/* Settings grid */
.refresh-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.refresh-setting-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: var(--rh-radius-sm);
  border: 1px solid #f0ecfc;
}

.refresh-setting-label {
  font-size: var(--rh-font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rh-text-muted);
}

.refresh-setting-value {
  font-size: var(--rh-font-size-lg);
  font-weight: 700;
  color: var(--rh-text-primary);
}

.refresh-setting-desc {
  font-size: 0.8rem;
  color: var(--rh-text-muted);
  line-height: 1.4;
}

@media (max-width: 768px) {
  .refresh-settings-grid {
    grid-template-columns: 1fr;
  }
  .refresh-actions {
    flex-direction: column;
  }
  .refresh-action-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .refresh-filter-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
  }
  .refresh-trigger-guide {
    grid-template-columns: 1fr;
  }
}

/* ── Scanner Inline Status Badges ──────────────────────────── */

.scanner-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  font-size: 0.73rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  text-decoration: none;
  cursor: default;
  transition: all var(--rh-transition);
}

.scanner-status-grace {
  background: #eef3f8;
  color: #5b7a95;
  border: 1px solid #d6e3ef;
}

.scanner-status-queued {
  background: #fff4e6;
  color: #c2590a;
  border: 1px solid #fdd9a8;
  cursor: pointer;
  text-decoration: none;
}

.scanner-status-queued:hover {
  background: #ffedcc;
  border-color: #f5c374;
  color: #a34c08;
}

.scanner-status-progress {
  background: #e8f0fe;
  color: #2563eb;
  border: 1px solid #bad3f9;
}

.scanner-status-completed {
  background: #ecf9ec;
  color: #16823a;
  border: 1px solid #bce8c2;
}

.scanner-status-dismissed {
  background: #f1f5f9;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
}

.scanner-status-unpublished {
  background: #f8f8f8;
  color: #b0aab8;
  border: 1px solid #e8e5f0;
  font-style: italic;
}

.scanner-status-none {
  color: var(--rh-text-muted);
  padding: 0;
  font-weight: 400;
}

/* ── Scanner Monitoring Summary Bar ────────────────────────── */

.scanner-monitoring-bar {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, #f0f4f9 0%, #eef2f8 100%);
  border: 1px solid #d6e3ef;
  border-radius: var(--rh-radius-md);
  box-shadow: var(--rh-shadow-sm);
}

.scanner-monitoring-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #dde8f3;
  border-radius: 8px;
  color: #5b7a95;
}

.scanner-monitoring-icon svg {
  width: 18px;
  height: 18px;
}

.scanner-monitoring-text {
  flex: 1;
}

.scanner-monitoring-headline {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--rh-text-primary);
  margin-bottom: 0.2rem;
}

.scanner-monitoring-detail {
  font-size: 0.82rem;
  color: var(--rh-text-secondary);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .scanner-monitoring-bar {
    flex-direction: column;
    gap: 0.6rem;
  }
}

/* ── Mobile Phone Gate (< 768px) ─────────────────────────── */
.mobile-gate {
  display: none;
}

@media (max-width: 767px) {
  .mobile-gate {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--rh-bg);
    padding: 2rem;
    text-align: center;
  }
  .mobile-gate-logo {
    width: 180px;
    margin-bottom: 2rem;
  }
  .mobile-gate-logo-dark {
    display: none;
  }
  html.dark .mobile-gate-logo {
    display: none;
  }
  html.dark .mobile-gate-logo-dark {
    display: block;
    width: 180px;
    margin-bottom: 2rem;
  }
  .mobile-gate-msg {
    font-size: 1rem;
    color: var(--rh-text-secondary);
    line-height: 1.6;
    max-width: 300px;
  }

  /* Hide everything else behind the gate */
  .mobile-menu-toggle,
  .layout {
    display: none;
  }
}

/* ── Tablet Safety Net (768-900px) ───────────────────────── */
@media (max-width: 900px) {
  .card-body {
    overflow-x: auto;
  }
  canvas {
    max-width: 100%;
  }
}

/* ── Onboard form row collapse ───────────────────────────── */
@media (max-width: 768px) {
  .onboard-row {
    grid-template-columns: 1fr;
  }
}

/* ── Research Library: case study result rows ────────────── */
@media (max-width: 900px) {
  .cs-result-row {
    grid-template-columns: 1fr 1fr 40px !important;
  }
  .cs-result-row .cs-change,
  .cs-result-row .cs-timeframe {
    display: none;
  }
}
