/* Section-specific styles */

/* Foldable archive sections */
#archivedEnrollments summary { list-style: none; }
#archivedEnrollments summary::-webkit-details-marker { display: none; }
#archivedEnrollments[open] summary i[data-lucide="chevron-down"] { transform: rotate(180deg); }

/* Outreach-specific badges (not in shared) */
.owner-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  opacity: 0.85;
}
.badge-send_failed { background: #fecaca; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; font-size: 13px; }

/* Draft warning states */
.list-item.has-warning { border-left: 3px solid var(--warning, #f59e0b); }
.draft-warning-banner {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 14px; margin: 0;
  background: #fef3c7; color: #92400e;
  font-size: 12px; line-height: 1.5;
  border-bottom: 1px solid #fde68a;
}

/* Logs banner */
.logs-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0 12px; margin-bottom: 12px;
  font-size: 11px; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.logs-banner b { color: var(--text-primary); font-weight: 600; }
.logs-banner-sep { opacity: .3; }

/* Wide modal body scroll (outreach modals) */
.modal-box.wide .modal-body { overflow-y: auto; max-height: 70vh; }

/* Campaign form sections */
.cf-section { margin-bottom: 16px; }
.cf-section:last-child { margin-bottom: 0; }
.cf-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-light, var(--border));
}
.cf-field { margin-bottom: 10px; }
.cf-field:last-child { margin-bottom: 0; }
.cf-field-hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 6px;
}
.cf-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  padding: 24px;
}

.dashboard-section {
  padding: 0 24px 24px;
}

.dashboard-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  padding-top: 28px;
  border-top: 1px solid var(--border-light);
}

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 13px;
  text-decoration: none;
  color: var(--text);
  transition: all var(--dur-fast) var(--ease-out);
  box-shadow: var(--shadow-sm);
}
.activity-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent-muted);
  transform: translateY(-1px);
}

.activity-item .activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-item .activity-icon svg { width: 18px; height: 18px; }
.activity-icon.sent { background: var(--success-bg); color: var(--success); }
.activity-icon.replied { background: var(--accent-light); color: var(--accent); }
.activity-icon.bounced { background: var(--danger-bg); color: var(--danger); }

.activity-text { flex: 1; min-width: 0; }
.activity-text strong { font-weight: 600; letter-spacing: -0.01em; }
.activity-time { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }

/* Onboarding */
.onboarding-container {
  max-width: 560px;
  margin: 0 auto;
  padding: 32px 24px;
}
.onboarding-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}
.onboarding-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.onboarding-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}
.onboarding-steps {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.onboarding-step {
  display: flex;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: all var(--dur-fast) var(--ease-out);
}
.onboarding-step.pending { border-left: 3px solid var(--accent); }
.onboarding-step.done { opacity: 0.6; }
.onboarding-step.done:hover { opacity: 0.85; }
.onboarding-step-indicator {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
}
.onboarding-step.pending .onboarding-step-indicator {
  background: var(--accent-light);
  color: var(--accent);
}
.onboarding-step.done .onboarding-step-indicator {
  background: var(--success-bg);
  color: var(--success);
}
.onboarding-step-content { flex: 1; min-width: 0; }
.onboarding-step-title {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.onboarding-step-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.5;
}
.onboarding-step-hint {
  font-size: 11px;
  color: var(--warning);
  margin-top: 4px;
}

/* Period bar */
.period-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px;
}

/* Drafts section */
.draft-subject {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.draft-snippet {
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}

.draft-recipient {
  font-size: 12px;
  color: var(--text-muted);
}

.draft-step {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Drafts list: bucket section headers (valid / unknown / invalid) - discrete, sticky */
.drafts-bucket-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--bg-subtle, rgba(255,255,255,0.015));
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 1;
}
.drafts-bucket-header:first-child { border-top: none; }
.drafts-bucket-header .drafts-bucket-count {
  margin-left: auto;
  font-weight: 500;
  opacity: 0.8;
}
.drafts-bucket-ok   { color: var(--success, #10b981); }
.drafts-bucket-warn { color: var(--warning, #f59e0b); }
.drafts-bucket-bad  { color: var(--danger,  #ef4444); }

/* Unified detail header */
.detail-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.detail-header-deleted { opacity: 0.6; }
.detail-header-title {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.02em;
}
.inline-editable-name {
  cursor: text;
  border-bottom: 1px dashed transparent;
  transition: border-color 0.15s;
}
.inline-editable-name:hover {
  border-bottom-color: var(--text-muted);
}
.detail-header-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.detail-header-stats {
  display: flex;
  gap: 20px;
  margin-top: 14px;
  font-size: 13px;
}
.detail-header-actions {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  flex-wrap: wrap;
}

/* Sequence detail */
.seq-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.seq-title {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.02em;
}

.seq-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.seq-actions {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.seq-stats {
  display: flex;
  gap: 20px;
  margin-top: 14px;
  font-size: 13px;
}

.seq-stat-val { font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.seq-stat-label { color: var(--text-muted); margin-left: 4px; }

/* Steps list */
.steps-list { padding: 16px; }

.step-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 8px;
  position: relative;
  transition: all var(--dur-fast) var(--ease-out);
  box-shadow: var(--shadow-sm);
}

.step-card:hover {
  border-color: var(--accent-muted);
  box-shadow: var(--shadow-md);
}

.step-order {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

.step-content { flex: 1; min-width: 0; }
.step-type {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.step-subject { font-size: 13px; color: var(--text); margin-top: 2px; font-weight: 500; }
.step-delay { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.step-stats {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

.step-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* Step connector line */
.step-card::before {
  content: '';
  position: absolute;
  left: 27px;
  top: -8px;
  width: 2px;
  height: 8px;
  background: var(--border);
}
.step-card:first-child::before { display: none; }
.step-delay-indicator + .step-card::before { display: none; }

/* Step delay indicator between steps */
.step-delay-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px 0;
}
.step-delay-line {
  width: 2px;
  height: 12px;
  background: var(--border);
}
.step-delay-badge {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 12px;
}
.step-delay-badge svg { flex-shrink: 0; }
.step-delay-clickable { cursor: pointer; transition: all var(--dur-fast); }
.step-delay-clickable:hover { border-color: var(--accent-muted); background: var(--accent-light); color: var(--accent); }

/* Step drag & drop */
.step-draggable { transition: opacity var(--dur-fast); }
.step-draggable.dragging { opacity: 0.3; }
.step-draggable.drag-over { border-top: 2px solid var(--accent); margin-top: -2px; }
.step-grip {
  display: none;
  width: 14px;
  height: 14px;
  cursor: grab;
  color: var(--text-muted);
  flex-shrink: 0;
}
.step-order { position: relative; }
.step-card:hover .step-grip { display: block; }
.step-card:hover .step-order > span { display: none; }

/* Step inline preview */
.step-expanded { border-color: var(--accent-muted); box-shadow: var(--shadow-md); }
.step-preview {
  margin: -4px 0 8px 0;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
}
.step-preview iframe {
  width: 100%;
  border: none;
  min-height: 120px;
  display: block;
}

/* Sent emails section */
.sent-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
}
.sent-total {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
}
.sent-table { width: 100%; }
.sent-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}
.sent-table td { font-size: 13px; }
.sent-row { cursor: pointer; transition: all var(--dur-fast) var(--ease-out); }
.sent-row:hover { background: var(--bg-hover); }
.sent-row.active { background: var(--accent-subtle); box-shadow: inset 3px 0 0 var(--accent); }
.sent-subject {
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sent-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px;
}

/* List/Campaign members table */
.members-section { padding: 16px; }
tr.enrollment-replied { background: rgba(99,102,241,0.06); }
tr.enrollment-bounced { background: rgba(239,68,68,0.05); }
.enrollment-overlap-badge { cursor: help; margin-left: 4px; }

/* Template editor */
.template-editor {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
}

.template-preview {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  padding: 20px;
  overflow-y: auto;
  min-height: 200px;
}

/* Template footer metadata */
.template-footer {
  margin-top: auto;
  padding: 14px 0 0;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 14px 16px;
  margin: 0 -16px -16px;
}

.tpl-footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.tpl-footer-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--text-secondary);
}

.tpl-footer-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tpl-footer-usage {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.tpl-usage-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: var(--radius);
  font-size: 12px;
  transition: background 0.15s;
}

.tpl-usage-item:hover {
  background: var(--bg-hover);
}

/* Sender health */
.sender-health {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}

.health-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.health-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 300ms ease;
}

.health-fill.good { background: var(--success); }
.health-fill.warning { background: var(--warning); }
.health-fill.bad { background: var(--danger); }

/* Sender avatar */
.sender-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 600;
  color: #fff;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}

/* Edit-in-place */
.eip {
  cursor: pointer;
  border-bottom: 1px dashed var(--border);
  transition: border-color var(--dur-fast);
}
.eip:hover { border-color: var(--accent); }
.eip.eip-inline { display: inline; }
.eip-input {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 1px 6px;
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-subtle);
}

/* Reply conversation */
.reply-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.reply-block.reply-received { border-left: 3px solid var(--accent); }
.reply-block.reply-sent { border-left: 3px solid var(--text-muted); opacity: 0.8; }
.reply-block-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.reply-meta {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
}
.reply-meta .reply-from { font-weight: 600; color: var(--text); }
.reply-meta .reply-date { margin-left: auto; }
.reply-email-body {
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-y: auto;
}
.reply-email-body-html {
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.55;
  overflow-y: auto;
}
.reply-original {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}
.reply-suggested {
  background: var(--accent-light);
  border: 1px solid var(--accent-muted);
  border-radius: var(--radius-lg);
  padding: 16px;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}

/* ─── Conversation panel (2-col Gmail-like layout) ─── */

/* Full-height flex panel: scroll area + AI banner + compose */
.conv-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  overflow: hidden;
}
.conv-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.conv-scroll::-webkit-scrollbar { width: 6px; }
.conv-scroll::-webkit-scrollbar-track { background: transparent; }
.conv-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Toolbar in col-preview header */
.conv-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.conv-toolbar-subject {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  font-size: 13px;
  color: var(--text);
}
.conv-toolbar-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* Message list - classic email layout, full-width stacked */
.conversation-container {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.conversation-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  color: var(--text-muted);
  font-size: 13px;
}
.conversation-loading .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Individual message - full-width, stacked, left border indicates direction */
.conv-msg {
  padding: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: background 0.15s;
  border-left: 3px solid transparent;
}
.conv-msg:hover { background: var(--bg-hover, var(--bg)); }
.conv-msg.msg-sent { border-left-color: var(--text-muted); }
.conv-msg.msg-received { border-left-color: var(--accent); }
.conv-msg .reply-email-body {
  font-size: 13px;
  padding: 8px 20px 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: hidden;
  max-width: 100%;
}

/* Collapsible message header */
.conv-msg-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 13px;
  min-height: 42px;
  min-width: 0;
  overflow: hidden;
}
.conv-msg-header .reply-from {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.conv-msg-header .reply-date {
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
}
.conv-msg-preview {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 12px;
  min-width: 0;
}
.conv-msg.expanded .conv-msg-preview { display: none; }
.conv-msg-body { border-top: 1px solid var(--border-light, var(--border)); }

/* Source tag on messages */
.conv-msg-tag {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 500;
  white-space: nowrap;
}
.conv-msg-tag.tag-sequence { background: var(--accent-light); color: var(--accent); }
.conv-msg-tag.tag-reply { background: rgba(16,185,129,0.1); color: #10b981; }
.conv-msg-tag.tag-manual { background: rgba(245,158,11,0.1); color: #f59e0b; }
.conv-msg-tag.tag-incoming { background: rgba(99,102,241,0.08); color: #6366f1; }

/* Quote folding */
.conv-quote-toggle {
  display: inline-block;
  cursor: pointer;
  color: var(--text-muted);
  padding: 1px 6px;
  margin: 2px 0;
  border-radius: 3px;
  background: var(--bg-hover, rgba(0,0,0,0.03));
  font-size: 11px;
  letter-spacing: 1px;
  user-select: none;
  line-height: 1;
}
.conv-quote-toggle:hover { background: var(--border); }
.conv-quoted {
  border-left: 2px solid var(--border);
  padding-left: 10px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* AI analysis line */
.conv-ai-analysis {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0 8px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Compose area */
.conv-compose {
  border-top: 1px solid var(--border);
  padding: 10px 14px;
  background: var(--bg-card);
  flex-shrink: 0;
}
.conv-compose-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  background: var(--bg);
  color: var(--text);
  min-height: 60px;
  max-height: 200px;
  box-sizing: border-box;
}
.conv-compose-input:focus {
  outline: none;
  border-color: var(--accent);
}
.conv-compose-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 6px;
}

/* Prompt customization */
.conv-prompt-section {
  margin-bottom: 8px;
}
.conv-prompt-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 0;
  user-select: none;
}
.conv-prompt-toggle:hover { color: var(--text-secondary); }
.conv-prompt-input {
  margin-top: 6px;
  font-size: 12px;
  min-height: 80px;
  max-height: 150px;
  color: var(--text-secondary);
}

/* Misc */
.conv-source-badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 500;
}
.conv-toggle-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

/* Timeline */
.timeline {
  padding: 16px;
}

.timeline-item {
  display: flex;
  gap: 12px;
  padding-bottom: 16px;
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 24px;
  bottom: 0;
  width: 2px;
  background: var(--border-light);
}
.timeline-item:last-child::before { display: none; }

.timeline-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 1;
}

.timeline-dot svg { width: 12px; height: 12px; }
.timeline-dot.sent { background: var(--success-bg); color: var(--success); }
.timeline-dot.draft { background: var(--warning-bg); color: var(--warning); }
.timeline-dot.bounced { background: var(--danger-bg); color: var(--danger); }
.timeline-dot.replied { background: var(--accent-light); color: var(--accent); }

.timeline-content { flex: 1; min-width: 0; }
.timeline-title { font-size: 13px; font-weight: 500; }
.timeline-time { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.timeline-body { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* Lifecycle timeline (history detail) */
.lifecycle-timeline { display: flex; flex-direction: column; padding: 16px; gap: 0; }
.lifecycle-step { display: flex; gap: 10px; position: relative; padding-bottom: 12px; }
.lifecycle-step:last-child { padding-bottom: 0; }
.lifecycle-step::before {
  content: ''; position: absolute; left: 11px; top: 24px; bottom: 0; width: 2px;
  background: var(--border-light);
}
.lifecycle-step:last-child::before { display: none; }
.lifecycle-step.step-pending::before { background: var(--border-light); }
.lifecycle-dot {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; z-index: 1;
}
.lifecycle-dot svg { width: 12px; height: 12px; }
.lifecycle-dot.dot-completed { background: var(--success-bg); color: var(--success); }
.lifecycle-dot.dot-pending { background: var(--bg); border: 2px solid var(--border); color: var(--text-muted); }
.lifecycle-dot.dot-error { background: var(--danger-bg); color: var(--danger); }
.lifecycle-info { flex: 1; min-width: 0; }
.lifecycle-label { font-size: 13px; font-weight: 500; }
.lifecycle-step.step-pending .lifecycle-label { color: var(--text-muted); }
.lifecycle-date { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.lifecycle-extra { font-size: 11px; color: var(--danger); font-weight: 500; margin-top: 1px; }

/* Timeline popover - inherits from .pulse-popover (components.css) */
.timeline-popover { max-width: 260px; }
.timeline-popover .lifecycle-timeline { padding: 12px 14px; gap: 0; }
.timeline-popover .lifecycle-step { padding-bottom: 8px; }
.timeline-popover .lifecycle-label { font-size: 12px; font-weight: 500; color: var(--text); }
.timeline-popover .lifecycle-date { font-size: 10px; }
.timeline-popover .lifecycle-dot { width: 20px; height: 20px; }
.timeline-popover .lifecycle-dot svg { width: 10px; height: 10px; }
.timeline-popover .lifecycle-step::before { left: 9px; top: 20px; }

/* Stat funnel */
.funnel { padding: 24px; }

.funnel-step {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.funnel-bar-container {
  flex: 1;
  height: 28px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.funnel-bar {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-sm);
  transition: width 500ms ease;
  min-width: 2px;
}

.funnel-label { width: 80px; font-size: 12px; font-weight: 500; text-align: right; }
.funnel-value { width: 50px; font-size: 13px; font-weight: 600; }

/* Webhook / Log rows */
.log-row {
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  display: flex;
  gap: 12px;
}

.log-time { color: var(--text-muted); flex-shrink: 0; width: 110px; white-space: nowrap; }
.log-type { font-weight: 600; width: 100px; flex-shrink: 0; }
.log-detail { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Filter pills (sequences) */
.filter-pills {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
}
.filter-pill {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  transition: all var(--dur-fast);
}
.filter-pill:hover { background: var(--bg-hover); }
.filter-pill.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 1px 3px rgba(99,102,241,.25);
}

/* Shared wrapper for email-list SearchBar (drafts, sent, replies) */
.email-list-search-wrap {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
}

/* Sent 3-col compact filters */
.sent-filters-compact {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
  align-items: center;
}
/* Bounce highlighting in sent list */
.list-item.is-bounced { border-left: 3px solid var(--danger); }
.badge-soft-bounce { background: #fed7aa; color: #9a3412; }

/* Contact link in sent preview */
.sent-contact-link { color: var(--accent); text-decoration: none; cursor: pointer; }
.sent-contact-link:hover { text-decoration: underline; }

.sent-filters-compact select { max-width: 130px; font-size: 11px; padding: 4px 6px; }
.sent-filters-compact .sent-total { margin-left: auto; font-size: 11px; color: var(--text-muted); }
.sent-seq-name { font-size: 11px; color: var(--text-muted); }

/* Campaign rows (sender detail) */
.campaign-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  font-size: 13px;
  border-radius: 0;
}
.campaign-row:hover { background: var(--bg-hover); }
.campaign-row-name { flex: 1; min-width: 0; font-weight: 500; }
.campaign-row-stat { font-size: 12px; color: var(--text-muted); }
.campaign-row-stat strong { color: var(--text); font-weight: 600; }

/* Search input in col headers */
.col-search {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  background: var(--bg);
  font-family: var(--font);
  transition: all var(--dur-fast);
}
.col-search:focus { outline: none; border-color: var(--accent); background: var(--bg-card); box-shadow: 0 0 0 3px var(--accent-glow); }

/* Provider cards (sender creation wizard) */
.provider-cards { display: flex; gap: 12px; margin: 8px 0; }
.provider-card {
  flex: 1;
  padding: 16px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  text-align: center;
  background: var(--bg-card);
}
.provider-card:hover { border-color: var(--accent-muted); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.provider-card.selected { border-color: var(--accent); background: var(--accent-light); }
.provider-card-icon { margin-bottom: 8px; }
.provider-card-icon svg { width: 24px; height: 24px; }
.provider-card-icon.gmail { color: #4285f4; }
.provider-card-icon.oauth { color: #f59e0b; }
.provider-card-icon.ses { color: var(--text-muted); }
.provider-card-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.provider-card-desc { font-size: 11px; color: var(--text-muted); line-height: 1.4; }
.provider-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.provider-badge.gmail { background: #e8f0fe; color: #1a73e8; }
.provider-badge.ses { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.provider-warn { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warning-bg); color: var(--warning); font-size: 12px; margin-top: 8px; }
.token-expired { color: var(--danger); }
.token-expiring { color: var(--warning, #f59e0b); }
.token-expiring-soon { color: var(--warning, #f59e0b); opacity: 0.7; }

/* Warmup schedule */
.warmup-schedule { font-size: 12px; }
.warmup-schedule th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); font-weight: 600; padding: 6px 10px; border-bottom: 1px solid var(--border); }
.warmup-schedule td { padding: 8px 10px; }
.warmup-row-current { background: rgba(99, 102, 241, 0.06); }
.warmup-row-current td { font-weight: 600; color: var(--primary, #6366f1); }
.warmup-row-past td { color: var(--text-muted); }
.warmup-current-badge {
  display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase;
  padding: 1px 6px; border-radius: 4px; background: var(--primary, #6366f1); color: #fff;
  vertical-align: middle; margin-left: 4px; letter-spacing: 0.3px;
}
.warmup-stat-card {
  flex: 1; min-width: 70px; padding: 8px 10px; border-radius: 8px;
  background: var(--bg-secondary); border: 1px solid var(--border); text-align: center;
}
.warmup-stat-val { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.warmup-stat-val.good { color: var(--success, #10b981); }
.warmup-stat-val.warning { color: var(--warning, #f59e0b); }
.warmup-stat-val.bad { color: var(--danger, #ef4444); }
.warmup-stat-unit { font-size: 12px; font-weight: 500; color: var(--text-muted); margin-left: 1px; }
.warmup-stat-label { font-size: 10px; color: var(--text-muted); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.3px; }

/* Sent email conversation context (before/after) */
.sent-context { border-top: 1px solid var(--border); }
.sent-context-summary {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; font-size: 12px; color: var(--text-muted);
  cursor: pointer; user-select: none;
}
.sent-context-summary:hover { color: var(--text-secondary); background: var(--bg-hover); }
.sent-context-summary i { transition: transform 0.2s; }
.sent-context.expanded .sent-context-summary i { transform: rotate(90deg); }
.sent-context-messages { max-height: 400px; overflow-y: auto; }

/* ─── Dashboard Extended ─── */

/* Hero KPI section */
.dash-hero { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .dash-hero { grid-template-columns: repeat(2, 1fr); } }

/* Delta arrows */
.kpi-delta {
  font-size: 12px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
  white-space: nowrap;
}
.kpi-delta.up { color: var(--success); background: var(--success-bg); }
.kpi-delta.down { color: var(--danger); background: var(--danger-bg); }

/* Benchmark indicator */
.benchmark-indicator {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.benchmark-elite { background: rgba(16,185,129,0.12); color: #10b981; }
.benchmark-bon { background: rgba(99,102,241,0.1); color: var(--accent); }
.benchmark-moyen { background: rgba(245,158,11,0.1); color: #f59e0b; }

/* Deliverability bar */
.deliverability-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}
.deliverability-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 500ms ease;
}
.deliverability-fill.success { background: var(--success); }
.deliverability-fill.warning { background: var(--warning); }
.deliverability-fill.danger { background: var(--danger); }

/* Two-column layout (senders + pipeline) */
.dash-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 0 24px 24px;
}
@media (max-width: 768px) { .dash-two-col { grid-template-columns: 1fr; } }
.dash-two-col-left, .dash-two-col-right { min-width: 0; }

/* Sender health cards (dashboard) */
.sender-health-list { display: flex; flex-direction: column; gap: 8px; }
.sender-health-card {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}
.sender-health-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
}
.sender-health-name { flex: 1; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sender-health-quota { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
.sender-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sender-status-dot.active { background: var(--success); }
.sender-status-dot.paused { background: var(--warning); }
.sender-status-dot.suspended { background: var(--danger); }
.sender-warmup-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(245,158,11,0.12);
  color: #f59e0b;
  font-weight: 600;
  white-space: nowrap;
}
.sender-warmup-badge.healthy {
  background: rgba(34,197,94,0.12);
  color: #22c55e;
}
.sender-warmup-stats {
  display: flex;
  gap: 10px;
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-family: var(--font-mono);
}

/* Pipeline bar */
.pipeline-bar {
  display: flex;
  height: 24px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--border);
}
.pipeline-segment {
  min-width: 2px;
  transition: width 500ms ease;
}
.pipeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-secondary);
}
.pipeline-legend-item { display: inline-flex; align-items: center; gap: 4px; }
.pipeline-legend-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }

/* Reply feed */
.reply-feed { display: flex; flex-direction: column; gap: 4px; }
.reply-feed-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  text-decoration: none;
  color: inherit;
  transition: all var(--dur-fast) var(--ease-out);
  font-size: 13px;
}
.reply-feed-item:hover { background: var(--bg-hover); border-color: var(--accent-muted); }
.reply-feed-text { flex: 1; min-width: 0; }
.reply-feed-text strong { font-weight: 600; font-size: 12px; }
.reply-feed-preview { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.reply-feed-time { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }

/* Sentiment dots */
.sentiment-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sentiment-dot.positive { background: var(--success); }
.sentiment-dot.neutral { background: var(--text-muted); }
.sentiment-dot.negative { background: var(--danger); }

/* Rate colors (comparison table) */
.rate-good { color: var(--success); font-weight: 600; }
.rate-avg { color: var(--warning); font-weight: 600; }
.rate-low { color: var(--text-muted); }

/* ─── Stats Tabs ─── */
.stats-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}
.stats-tab {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--dur-fast);
}
.stats-tab:hover { color: var(--text); }
.stats-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* Comparison table */
.comparison-table { width: 100%; }
.comparison-table th.sortable:hover { color: var(--accent); }

/* Funnel enhancements */
.funnel-dropoff {
  font-size: 11px;
  color: var(--danger);
  font-weight: 500;
  margin-left: auto;
}
.funnel-best-badge {
  font-size: 12px;
  vertical-align: middle;
}

/* ─── SVG Trends Chart ─── */
.svg-chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.svg-chart {
  width: 100%;
  height: auto;
}
.svg-chart-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}
.svg-chart-legend-item { display: inline-flex; align-items: center; gap: 4px; }
.svg-chart-legend-dot { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }

/* ─── Sender Health Checks ─── */

/* Inline dots in list items */
.hc-dots { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: middle; }
.hc-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%;
  font-size: 9px; font-weight: 700; line-height: 1;
}
.hc-dot.hc-ok { background: var(--success-bg, rgba(16,185,129,0.15)); color: var(--success, #10b981); }
.hc-dot.hc-fail { background: var(--danger-bg, rgba(239,68,68,0.12)); color: var(--danger, #ef4444); }
.hc-dot.hc-warn { background: rgba(245,158,11,0.12); color: #f59e0b; }
.hc-dot.hc-unknown { background: var(--bg-hover, rgba(0,0,0,0.04)); color: var(--text-muted); font-size: 8px; }

/* Health check detail rows */
.hc-checks { display: flex; flex-direction: column; gap: 0; }
.hc-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border-light, var(--border));
}
.hc-row:last-child { border-bottom: none; }
.hc-row-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-secondary, var(--bg)); color: var(--text-muted);
  flex-shrink: 0;
}
.hc-row-info { flex: 1; min-width: 0; }
.hc-row-label { font-size: 13px; font-weight: 500; }
.hc-row-desc { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.hc-row-status { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.hc-error {
  font-size: 11px; color: var(--danger); margin-top: 4px;
  padding: 4px 8px; border-radius: 4px; background: var(--danger-bg, rgba(239,68,68,0.06));
  word-break: break-word; max-width: 300px;
}

/* Health badges */
.hc-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: 10px; white-space: nowrap;
}
.hc-badge.hc-ok { background: var(--success-bg, rgba(16,185,129,0.12)); color: var(--success, #10b981); }
.hc-badge.hc-fail { background: var(--danger-bg, rgba(239,68,68,0.12)); color: var(--danger, #ef4444); }
.hc-badge.hc-warn { background: rgba(245,158,11,0.12); color: #f59e0b; }
.hc-badge.hc-unknown { background: var(--bg-hover); color: var(--text-muted); }
.hc-time { font-size: 10px; color: var(--text-muted); }

.hc-stale-warn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; margin-bottom: 8px;
  border-radius: 6px; background: rgba(245,158,11,0.08);
  font-size: 11px; color: #f59e0b;
}
