@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --accent: #007AFF;
  --accent-strong: #005ecb;
  --accent-soft: rgba(0, 122, 255, 0.12);
  --bg: #f5f7fb;
  --bg-elevated: rgba(255,255,255,0.72);
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --surface-strong: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-soft: #94a3b8;
  --shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 18px 40px rgba(15, 23, 42, 0.10);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --success: #16a34a;
  --success-soft: rgba(22, 163, 74, 0.14);
  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, 0.14);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.14);
  --info: #2563eb;
  --info-soft: rgba(37, 99, 235, 0.14);
  --header-bg: rgba(255,255,255,0.82);
  --hero-bg: linear-gradient(135deg, #07152f 0%, #0b2b59 55%, #0e4f9a 100%);
  --table-stripe: rgba(148, 163, 184, 0.06);
  --table-hover: rgba(0, 122, 255, 0.06);
  --input-bg: #ffffff;
  --backdrop: rgba(15, 23, 42, 0.55);
  --chart-grid: rgba(148, 163, 184, 0.18);
  --chart-text: #64748b;
  --chart-tooltip-bg: #ffffff;
  --chart-tooltip-border: #dbe3ef;
}

:root[data-theme='dark'] {
  --accent: #4da3ff;
  --accent-strong: #7cbcff;
  --accent-soft: rgba(77, 163, 255, 0.16);
  --bg: #09111f;
  --bg-elevated: rgba(15,23,42,0.76);
  --surface: #111c2d;
  --surface-muted: #0f1728;
  --surface-strong: #162235;
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text: #e5edf8;
  --text-muted: #a6b4c8;
  --text-soft: #7b8aa0;
  --shadow-sm: 0 10px 26px rgba(2, 6, 23, 0.30);
  --shadow-md: 0 22px 46px rgba(2, 6, 23, 0.44);
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, 0.14);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.14);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, 0.14);
  --header-bg: rgba(9,17,31,0.82);
  --hero-bg: linear-gradient(135deg, #08111f 0%, #0d1c33 55%, #11335e 100%);
  --table-stripe: rgba(148, 163, 184, 0.05);
  --table-hover: rgba(77, 163, 255, 0.10);
  --input-bg: #0d1728;
  --backdrop: rgba(2, 6, 23, 0.72);
  --chart-grid: rgba(148, 163, 184, 0.14);
  --chart-text: #9fb0c6;
  --chart-tooltip-bg: #0f1728;
  --chart-tooltip-border: rgba(148, 163, 184, 0.16);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
html[data-theme='dark'] { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: radial-gradient(circle at top, rgba(0,122,255,0.08), transparent 30%), var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.page-shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
}

.app-header-inner {
  max-width: 1480px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.brand-logo {
  height: 34px;
  width: auto;
  display: block;
}
.brand-copy { min-width: 0; }
.brand-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.nav-link,
.theme-toggle,
.icon-button {
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: .18s ease;
}
.nav-link:hover,
.theme-toggle:hover,
.icon-button:hover {
  color: var(--text);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.nav-link.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(0,122,255,0.22);
}
.theme-toggle { width: 40px; padding: 0; }

.hero-panel,
.section-panel,
.card,
.chart-container,
.list-container,
.table-card,
.queue-panel,
.filters,
.upcoming-list,
.modal,
.login-card,
.section-heading,
.chart-shell,
.control-bar,
.empty-state,
.preview-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.hero-panel {
  background: var(--hero-bg);
  color: #fff;
  padding: 28px;
  border: none;
  box-shadow: var(--shadow-md);
}
.hero-panel p,
.hero-panel .hero-meta,
.hero-panel .hero-subtle { color: rgba(230, 238, 252, 0.78); }
.hero-title { font-size: 30px; font-weight: 800; letter-spacing: -0.04em; margin: 0 0 10px; }
.hero-description { margin: 0; max-width: 900px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; font-size: 13px; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin: 10px 0 24px;
}
.page-title { font-size: 30px; font-weight: 800; letter-spacing: -0.04em; margin: 0 0 6px; }
.page-subtitle { font-size: 14px; color: var(--text-muted); max-width: 880px; margin: 0; }
.timestamp { font-size: 13px; color: var(--text-muted); }

.toolbar,
.date-controls,
.actions-bar,
.button-row,
.controls,
.periods,
.top-links {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.section { margin: 0 0 28px; }
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.section-title::before {
  content: '';
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: var(--accent);
}
.section-note,
.helper,
.footer-note,
.status,
.meta,
.chart-note,
.chart-subtitle,
.list-item-subtitle,
.result-meta,
.queue-count,
.error-msg,
.ps-label,
.table-meta,
.preview-meta,
.kpi-note,
.period-help {
  color: var(--text-muted);
}

.grid { display: grid; gap: 18px; }
.grid.kpi-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.two-col { grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.85fr); }
.grid.analytics-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.card,
.chart-container,
.list-container,
.table-card,
.section-panel,
.queue-panel,
.chart-shell,
.control-bar,
.section-heading,
.filters,
.upcoming-list {
  padding: 20px;
}
.card:hover,
.chart-container:hover,
.list-container:hover,
.table-card:hover,
.queue-panel:hover {
  box-shadow: var(--shadow-md);
}
.card-label,
.stat-label,
.queue-label,
.kpi-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.card-value,
.stat-value,
.kpi-value {
  font-size: 34px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 8px;
}
.card-trend,
.stat-trend,
.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}
.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }
.trend-neutral { color: var(--text-muted); }

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.tab {
  height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-weight: 600;
}
.tab.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(0,122,255,0.22);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

.btn,
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-outline,
.date-preset-btn,
.period-btn {
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  transition: .18s ease;
}
.btn:hover,
.btn-primary:hover,
.btn-secondary:hover,
.btn-danger:hover,
.btn-outline:hover,
.date-preset-btn:hover,
.period-btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-secondary,
.btn-outline { background: var(--surface-muted); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.date-preset-btn.active,
.period-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-sm { height: 32px; padding: 0 10px; border-radius: 10px; font-size: 12px; }
.btn-link-reset { text-decoration: none; }

input[type='text'],
input[type='date'],
input[type='password'],
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  outline: none;
  transition: .18s ease;
}
textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.6;
}
input:focus,
select:focus,
textarea:focus {
  border-color: rgba(0,122,255,0.45);
  box-shadow: 0 0 0 4px rgba(0,122,255,0.12);
}
label { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.field { margin-bottom: 18px; position: relative; }
.date-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.custom-date-inputs { display: none; gap: 8px; align-items: center; flex-wrap: wrap; }
.custom-date-inputs.active { display: flex; }

.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
th {
  text-align: left;
  padding: 12px 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
td {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: 14px;
}
tbody tr:nth-child(even) td { background: var(--table-stripe); }
tbody tr:hover td { background: var(--table-hover); }
tr:last-child td { border-bottom: none; }
.num { text-align: right; white-space: nowrap; }
.path { word-break: break-word; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.badge-success, .badge-sent, .badge-generated { background: var(--success-soft); color: var(--success); }
.badge-warning, .badge-pending { background: var(--warning-soft); color: var(--warning); }
.badge-danger, .badge-failed { background: var(--danger-soft); color: var(--danger); }
.badge-info, .badge-generating, .badge-sending, .badge-primary { background: var(--info-soft); color: var(--info); }

.list-container { max-height: 520px; overflow: auto; }
.list-item,
.upcoming-item,
.queue-item,
.bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.list-item:last-child,
.upcoming-item:last-child,
.queue-item:last-child,
.bar-row:last-child { border-bottom: none; }
.list-item-title,
.result-title,
.qi-customer { font-weight: 700; }
.list-item-value,
.bar-value { font-weight: 700; color: var(--accent); white-space: nowrap; }

.bar-row { display: grid; grid-template-columns: minmax(150px, 1.4fr) minmax(200px, 3fr) 80px; }
.bar-track { height: 12px; background: var(--surface-strong); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #5bb6ff); border-radius: 999px; }
.chart-wrapper { position: relative; height: 340px; }
.chart-shell { min-height: 280px; }
.empty, .loading, .error, .queue-empty, .empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 120px;
  color: var(--text-muted);
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  background: var(--surface-muted);
  padding: 20px;
}
.error { color: var(--danger); }
.loading::after {
  content: '…';
  animation: pulseDots 1.2s infinite;
}
@keyframes pulseDots {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.alert {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.alert-success { border-color: rgba(22,163,74,.25); background: var(--success-soft); }
.alert-warning { border-color: rgba(217,119,6,.25); background: var(--warning-soft); }
.alert-critical { border-color: rgba(220,38,38,.25); background: var(--danger-soft); }
.alert-info { border-color: rgba(37,99,235,.25); background: var(--info-soft); }

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  display: none;
  max-height: 280px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
}
.search-results.active { display: block; }
.result-item { padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.result-item:last-child { border-bottom: none; }
.result-item:hover { background: var(--table-hover); }
.selected-customer {
  display: none;
  margin-top: 10px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(0,122,255,0.2);
  background: var(--accent-soft);
}
.selected-customer.active { display: block; }

.queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.queue-body { display: flex; flex-direction: column; }
.queue-item {
  display: grid;
  grid-template-columns: 2fr 1.4fr 120px 100px 160px;
  align-items: center;
  gap: 12px;
}
.qi-bot, .qi-time { color: var(--text-muted); font-size: 13px; }
.qi-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--backdrop);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}
.modal-overlay.active { display: flex; }
.modal { max-width: 560px; width: 100%; padding: 28px; position: relative; }
.close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  border-radius: 999px;
  color: var(--text-muted);
}
.preview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.topic-tag {
  display: inline-block;
  padding: 6px 10px;
  margin: 0 8px 8px 0;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}
.modal-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 420px;
  padding: 32px;
}
.login-logo { height: 42px; margin-bottom: 20px; }
.login-title { font-size: 30px; font-weight: 800; margin: 0 0 6px; letter-spacing: -0.04em; }
.login-copy { color: var(--text-muted); margin: 0 0 24px; }
.login-footnote { margin-top: 18px; font-size: 12px; color: var(--text-soft); }
.login-submit { width: 100%; }
.error-text { color: var(--danger); font-size: 13px; margin-bottom: 12px; }

.refresh-indicator {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
}

.funnel-stage {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  margin-bottom: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.funnel-bar-wrapper { width: 100%; }
.funnel-bar { position: relative; height: 36px; border-radius: 999px; background: linear-gradient(90deg, var(--accent), #5bb6ff); }
.funnel-percent { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: white; font-weight: 700; font-size: 13px; }
.funnel-dropoff { color: var(--danger); font-size: 12px; }

.recovery-template-grid {
  align-items: start;
}

.recovery-template-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.template-editor-card {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

#conversationThread {
  overflow: hidden;
  max-width: 100%;
}

.template-row {
  cursor: pointer;
  transition: background .18s ease, box-shadow .18s ease;
}

.template-row.is-selected td {
  background: var(--accent-soft) !important;
  color: var(--text);
}

.recovery-feed-card {
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  border-radius: 16px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, transparent), var(--surface));
  padding: 18px;
  margin-bottom: 14px;
}

.recovery-feed-card.segment-power_user { border-left-color: #f87171; }
.recovery-feed-card.segment-active_user { border-left-color: #fb923c; }
.recovery-feed-card.segment-never_started { border-left-color: #60a5fa; }
.recovery-feed-card.segment-setup_not_launched { border-left-color: #38bdf8; }
.recovery-feed-card.segment-quick_trial { border-left-color: #a78bfa; }

.recovery-feed-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.recovery-feed-metrics {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.recovery-feed-body {
  display: grid;
  gap: 10px;
  color: var(--text-muted);
  font-size: 14px;
}

.conversation-customer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-muted);
}

.conversation-customer-email-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.conversation-customer-email {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.conversation-customer-meta {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.copy-email-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: .18s ease;
}

.copy-email-button:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.copy-email-button svg {
  width: 14px;
  height: 14px;
}

.copy-email-button.is-copied {
  background: var(--success-soft, rgba(16, 185, 129, 0.12));
  border-color: color-mix(in srgb, var(--success) 35%, var(--border));
  color: var(--success);
}

.recovery-original-email-card {
  margin: -4px 0 16px 18px;
  border-left: 4px solid var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 28%, var(--surface));
}

.recovery-message-body {
  color: var(--text);
}

.email-formatted-content {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow: hidden;
  max-width: 100%;
}

.email-formatted-content img {
  max-width: 100%;
  height: auto;
}

.email-formatted-content p,
.email-formatted-content ul,
.email-formatted-content ol,
.email-formatted-content blockquote,
.email-formatted-content pre {
  margin: 0 0 0.9em;
}

.email-formatted-content p:last-child,
.email-formatted-content ul:last-child,
.email-formatted-content ol:last-child,
.email-formatted-content blockquote:last-child,
.email-formatted-content pre:last-child {
  margin-bottom: 0;
}

.email-formatted-content ul,
.email-formatted-content ol {
  padding-left: 1.4rem;
}

.email-formatted-content li + li {
  margin-top: 0.35em;
}

.email-formatted-content blockquote {
  padding-left: 12px;
  border-left: 3px solid var(--border-strong);
  color: var(--text-muted);
}

.email-formatted-content pre {
  white-space: pre-wrap;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.email-formatted-content a {
  color: var(--accent);
}

.sequence-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.sequence-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.sequence-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
  background: var(--text-soft);
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.08);
}
.sequence-status-dot.is-sent { background: var(--success); box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12); }
.sequence-status-dot.is-pending { background: #94a3b8; box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.12); }
.sequence-status-dot.is-failed { background: var(--danger); box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.12); }
.sequence-status-dot.is-skipped { background: var(--warning); box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.12); }

.sequence-status-text {
  color: var(--text-muted);
  font-weight: 600;
}

.sequence-status-empty {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 12px;
  font-weight: 700;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
}

.pagination-meta {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none !important;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 999px;
  display: inline-block;
  animation: spin 0.8s linear infinite;
}
.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }
@keyframes spin { to { transform: rotate(360deg); } }

.hide-mobile { display: initial; }

@media (max-width: 1100px) {
  .grid.analytics-grid { grid-template-columns: 1fr; }
  .span-3, .span-4, .span-6, .span-8, .span-12 { grid-column: span 1; }
  .grid.two-col { grid-template-columns: 1fr; }
  .queue-item { grid-template-columns: 1fr 1fr; }
  .template-editor-card { position: static; }
}

@media (max-width: 800px) {
  .page-shell { padding: 18px; }
  .app-header-inner,
  .page-shell { padding-left: 18px; padding-right: 18px; }
  .app-header-inner,
  .page-header,
  .controls,
  .toolbar { flex-direction: column; align-items: stretch; }
  .date-row,
  .preview-grid { grid-template-columns: 1fr; }
  .card-value, .stat-value, .kpi-value, .page-title, .hero-title { font-size: 28px; }
  .queue-item,
  .funnel-stage,
  .bar-row { grid-template-columns: 1fr; }
  .list-item,
  .upcoming-item,
  .recovery-feed-head,
  .conversation-customer-bar { flex-direction: column; align-items: flex-start; }
  .recovery-feed-metrics,
  .pagination-bar { justify-content: flex-start; }
  .recovery-template-filters { grid-template-columns: 1fr; }
  .hide-mobile { display: none; }
  .refresh-indicator { right: 18px; bottom: 18px; }
}

/* Fix: limit table height in analytics cards */
.analytics-grid .card table { max-height: 500px; display: block; overflow-y: auto; }
.analytics-grid .card table thead { position: sticky; top: 0; z-index: 1; }
.analytics-grid .card table thead th { background: var(--surface); }

/* Fix: ensure chart renders at proper height in full-width card */
.span-12 .chart-shell { min-height: 300px; max-height: 400px; }
