/**
 * Follow-up Automation Builder V2 Styles
 * Premium, card-based, full-page layout with dotted background
 */

/* ===== Page Container ===== */
.fb-page {
  min-height: 100%;
  position: relative;
  padding-bottom: 100px;
}

/* ===== Dotted Background ===== */
.fb-dotted-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(circle, rgba(0, 0, 0, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
}

[data-theme="dark"] .fb-dotted-bg {
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
}

/* ===== Tab Navigation ===== */
.fb-tabs-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  padding: 4px;
  background: var(--bg-elevated);
  border-radius: 14px;
  border: 1px solid var(--border-color);
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.fb-tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fb-tab-btn .material-icons {
  font-size: 20px;
}

.fb-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.fb-tab-btn.active {
  background: var(--bg-surface);
  color: var(--accent-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .fb-tab-btn.active {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* ===== Content Container ===== */
.fb-content {
  position: relative;
  z-index: 1;
  max-width: 100%;
  margin: 0 auto;
  padding: 40px 48px;
}


/* ===== Saved Automations Section ===== */
.fb-saved-section.hidden {
  display: none;
}

.fb-saved-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.fb-saved-title-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fb-saved-subtitle {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ===== Header ===== */
.fb-header {
  text-align: center;
  margin-bottom: 40px;
}

.fb-header h1 {
  margin: 0 0 8px 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}

.fb-header p {
  margin: 0;
  font-size: 15px;
  color: var(--text-secondary);
}

/* ===== Builder Container ===== */
.fb-builder {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
}

/* ===== Cards Base ===== */
.fb-card {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.fb-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

.fb-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-elevated);
}

.fb-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fb-card-icon .material-icons {
  font-size: 20px;
}

.fb-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

/* Rotation Settings Button in Card Header */
.fb-rotation-settings-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: auto;
}

.fb-rotation-settings-btn:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
  background: rgba(99, 102, 241, 0.05);
  transform: translateY(-1px);
}

.fb-rotation-settings-btn .material-icons {
  font-size: 18px;
}

.fb-card-body {
  padding: 20px;
}

/* ===== Card Icon Colors ===== */
.fb-campaign-card .fb-card-icon {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}

.fb-icon-delay {
  background: rgba(251, 191, 36, 0.1);
  color: #f59e0b;
}

.fb-icon-email {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.fb-icon-end {
  background: rgba(52, 168, 83, 0.1);
  color: #34a853;
}

.fb-icon-settings {
  background: rgba(156, 163, 175, 0.1);
  color: #6b7280;
}

/* ===== Campaign Card ===== */
.fb-locked-badge {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.fb-locked-badge .material-icons {
  font-size: 14px;
}

.fb-locked-campaign {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(52, 168, 83, 0.05);
  border: 1px solid rgba(52, 168, 83, 0.2);
  border-radius: 10px;
  color: var(--text-primary);
  font-weight: 500;
}

.fb-locked-campaign .material-icons {
  color: #34a853;
  font-size: 20px;
}

/* ===== Inputs ===== */
.fb-select,
.fb-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  transition: all 0.2s ease;
}

.fb-select:focus,
.fb-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.fb-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

/* ===== Hints ===== */
.fb-hint {
  margin: 12px 0 0 0;
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ===== Connector ===== */
.fb-connector {
  width: 2px;
  height: 28px;
  background: var(--border-color);
}

/* ===== Sequence Placeholder ===== */
.fb-sequence-placeholder {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-tertiary);
}

.fb-sequence-placeholder .material-icons {
  font-size: 32px;
  margin-bottom: 12px;
}

/* bounce animation removed */

.fb-sequence-placeholder p {
  margin: 0;
  font-size: 14px;
}

/* ===== Sequence Container ===== */
.fb-sequence {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ===== Step Cards ===== */
.fb-step-card {
  position: relative;
}

.fb-remove-step {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.2s ease;
  z-index: 2;
}

.fb-step-card:hover .fb-remove-step {
  opacity: 1;
}

.fb-remove-step:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.fb-remove-step .material-icons {
  font-size: 18px;
}

/* ===== Delay Inputs ===== */
.fb-delay-inputs {
  display: flex;
  gap: 16px;
}

.fb-delay-field {
  flex: 1;
  text-align: center;
}

.fb-delay-field .fb-input {
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  padding: 14px;
}

.fb-delay-field label {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== Form Groups ===== */
.fb-form-group {
  margin-bottom: 16px;
}

.fb-form-group:last-child {
  margin-bottom: 0;
}

.fb-form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.fb-optional {
  font-weight: 400;
  color: var(--text-tertiary);
}

/* ===== Add Step Buttons ===== */
.fb-add-step {
  display: flex;
  gap: 12px;
  padding: 8px 0;
}

.fb-add-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 20px;
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fb-add-btn:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
  background: rgba(99, 102, 241, 0.05);
}

.fb-add-btn .material-icons {
  font-size: 20px;
}

/* ===== Settings Card ===== */
.fb-settings-card {
  margin-top: 32px;
}

.fb-setting-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.fb-setting-info {
  flex: 1;
}

.fb-setting-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.fb-setting-desc {
  font-size: 13px;
  color: var(--text-tertiary);
  line-height: 1.5;
}

/* ===== Switch ===== */
.fb-switch {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  flex-shrink: 0;
}

.fb-switch input {
  display: none;
}

.fb-switch-slider {
  width: 52px;
  height: 28px;
  background: #6b7280;
  border-radius: 28px;
  position: relative;
  transition: all 0.3s ease;
}

.fb-switch-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.fb-switch input:checked+.fb-switch-slider {
  background: #34a853;
}

.fb-switch input:checked+.fb-switch-slider::before {
  transform: translateX(24px);
}

.fb-switch-label {
  font-size: 13px;
  font-weight: 600;
  min-width: 60px;
}

.fb-switch-label.active {
  color: #34a853;
}

.fb-switch-label.inactive {
  color: #ef4444;
}

/* ===== Warning ===== */
.fb-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 10px;
  font-size: 13px;
  color: #b45309;
}

.fb-warning .material-icons {
  font-size: 18px;
  color: #f59e0b;
  flex-shrink: 0;
}

/* ===== Action Bar ===== */
.fb-action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 16px 24px;
  z-index: 100;
  transform: translateY(100%);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.fb-action-bar.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}

.fb-action-bar-inner {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fb-unsaved {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-tertiary);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.fb-unsaved.visible {
  opacity: 1;
}

.fb-unsaved .material-icons {
  font-size: 16px;
}

.fb-actions {
  display: flex;
  gap: 12px;
}

/* ===== Buttons ===== */
.fb-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.fb-btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.fb-btn-secondary:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.fb-btn-outline {
  background: transparent;
  color: var(--accent-color);
  border: 2px solid var(--accent-color);
}

.fb-btn-outline:hover {
  background: rgba(99, 102, 241, 0.1);
}

.fb-btn-primary {
  background: var(--accent-color);
  color: white;
}

.fb-btn-primary:hover {
  background: #4f46e5;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .fb-content {
    padding: 24px 16px;
  }

  .fb-delay-inputs {
    flex-direction: column;
    gap: 12px;
  }

  .fb-setting-row {
    flex-direction: column;
    gap: 16px;
  }

  .fb-actions {
    flex-direction: column;
    width: 100%;
  }

  .fb-btn {
    width: 100%;
  }

  .fb-action-bar-inner {
    flex-direction: column;
    gap: 16px;
  }
}


/* ===== Dashboard Styles ===== */

/* ===== Automations Grid ===== */
.fb-automations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  width: 100%;
}

/* ===== Automation Card ===== */
.fb-automation-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.08),
    0 4px 12px rgba(0, 0, 0, 0.05),
    0 0 0 1px rgba(255, 255, 255, 0.45) inset;
}

.fb-automation-card:hover {
  border-color: var(--accent-color);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.12),
    0 8px 24px rgba(0, 0, 0, 0.08),
    0 0 0 1px var(--accent-color) inset;
}

.fb-card-focused {
  border-color: var(--accent-color) !important;
  box-shadow:
    0 8px 24px rgba(99, 102, 241, 0.22),
    0 0 0 1px var(--accent-color) inset !important;
  animation: fb-card-focus-pulse 1.2s ease;
}

@keyframes fb-card-focus-pulse {
  0% { transform: translateY(0); }
  30% { transform: translateY(-2px); }
  100% { transform: translateY(0); }
}

.fb-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.fb-card-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.fb-card-toggle {
  display: flex;
  justify-content: flex-end;
  margin-top: -6px;
  margin-bottom: 8px;
}

.fb-automation-card:hover .fb-card-actions {
  opacity: 1;
}

.fb-action-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}


.fb-action-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.fb-edit-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}


.fb-delete-btn:hover {
  background: rgba(244, 67, 54, 0.1);
  color: #f44336;
}

/* ===== Saved Pagination ===== */
.fb-saved-pagination {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.fb-page-btn {
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fb-page-btn:hover:not(:disabled) {
  border-color: rgba(99, 102, 241, 0.4);
  color: var(--text-primary);
}

.fb-page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.fb-page-indicator {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ===== Follow-up Activity Aggregation ===== */
.fb-activity-section {
  margin-top: 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 18px;
}

.fb-activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.fb-activity-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fb-activity-select {
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 12px;
  padding: 0 10px;
  min-width: 180px;
}

/* Legend uses activity-log-legend styles from activity-log.css */
.legend-icon.condition {
  color: #8b5cf6;
  background: rgba(139, 92, 246, 0.12);
}

.legend-item[data-filter="condition"] .badge-count {
  background: #8b5cf6;
  box-shadow: 0 1px 3px rgba(139, 92, 246, 0.3);
}

.legend-item.active .legend-icon.condition {
  color: #8b5cf6;
}

.fb-activity-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.fb-activity-subtitle {
  margin: 4px 0 0 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.fb-activity-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.fb-activity-refresh:hover {
  color: var(--text-primary);
  border-color: rgba(99, 102, 241, 0.4);
}

.fb-activity-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.fb-activity-stat {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 12px;
}

.fb-activity-stat-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.fb-activity-stat-label {
  font-size: 11px;
  color: var(--text-secondary);
}

.fb-activity-table {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-primary);
}

.fb-activity-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.fb-activity-table th,
.fb-activity-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  vertical-align: top;
}

.fb-activity-table tbody tr:nth-child(even) td {
  background: rgba(148, 163, 184, 0.06);
}

.fb-activity-table tbody tr:hover td {
  background: rgba(99, 102, 241, 0.08);
}

.fb-activity-table th {
  background: var(--bg-elevated);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.fb-activity-table tr:last-child td {
  border-bottom: none;
}

.fb-activity-loading,
.fb-activity-empty {
  padding: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  display: none;
}

.fb-activity-event {
  text-transform: capitalize;
  white-space: nowrap;
}

.fb-activity-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: none;
}

.fb-activity-badge.sent {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.fb-activity-badge.success {
  background: rgba(52, 168, 83, 0.12);
  color: #34a853;
}

.fb-activity-badge.info {
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
}

.fb-activity-badge.opened {
  background: rgba(52, 168, 83, 0.12);
  color: #34a853;
}

.fb-activity-badge.clicked {
  background: rgba(245, 158, 11, 0.14);
  color: #f59e0b;
}

.fb-activity-badge.stopped {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.fb-activity-badge.unsub {
  background: rgba(249, 115, 22, 0.12);
  color: #f97316;
}

.fb-activity-badge.error {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.fb-activity-badge.muted {
  background: rgba(148, 163, 184, 0.16);
  color: var(--text-secondary);
}

.fb-activity-detail {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
}

.fb-activity-load-more {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.fb-activity-load-btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fb-activity-load-btn:hover {
  border-color: rgba(99, 102, 241, 0.4);
  background: var(--bg-hover);
}

/* ===== Status Badges ===== */
.fb-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fb-status-badge .material-icons {
  font-size: 12px;
}

.fb-status-active {
  background: rgba(76, 175, 80, 0.15);
  color: #4caf50;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.fb-status-inactive {
  background: rgba(156, 163, 175, 0.15);
  color: #9ca3af;
  border: 1px solid rgba(156, 163, 175, 0.3);
}

.fb-status-paused {
  background: rgba(255, 171, 0, 0.15);
  color: #ffab00;
  border: 1px solid rgba(255, 171, 0, 0.3);
}

.fb-status-error {
  background: rgba(244, 67, 54, 0.15);
  color: #f44336;
  border: 1px solid rgba(244, 67, 54, 0.3);
}

/* ===== Card Content ===== */
.fb-card-content {
  flex: 1;
}

.fb-card-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.fb-card-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.fb-card-tag {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
}

.fb-card-strong {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-primary);
  padding: 0 0 2px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.25);
}

.fb-card-strong-auto {
  color: var(--text-primary);
}

.fb-card-strong-campaign {
  color: var(--text-secondary);
}

.fb-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.fb-card-meta .material-icons {
  font-size: 11px;
}

.fb-meta-sep {
  color: var(--text-tertiary);
}

.fb-card-subject {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  padding: 8px;
  background: var(--bg-primary);
  border-radius: 6px;
  border-left: 2px solid var(--accent-color);
  margin-bottom: 12px;
}

/* ===== Campaign Links Section (in sequence cards) ===== */
.fb-campaign-links {
  padding: 10px 16px;
  border-top: 1px solid var(--border-color);
  background: rgba(99, 102, 241, 0.02);
}

.fb-campaign-links.fb-no-links {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-tertiary);
  padding: 8px 16px;
}

.fb-links-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.fb-links-header .material-icons {
  color: var(--accent-color);
}

.fb-links-toggle {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  padding: 0;
  display: flex;
}

.fb-links-toggle:hover {
  color: var(--accent-color);
}

.fb-links-body.is-collapsed {
  display: none;
}

.fb-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
}

.fb-link-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.fb-link-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fb-link-name {
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fb-link-details {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 20px;
}

.fb-link-progress {
  font-size: 10px;
  color: var(--text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
}

.fb-link-status {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.fb-link-status .material-icons {
  font-size: 11px;
}

.fb-link-status-completed { color: #34a853; }
.fb-link-status-running { color: #3b82f6; }
.fb-link-status-active { color: #34a853; }
.fb-link-status-inactive { color: #9ca3af; }
.fb-link-status-stopped { color: #f44336; }
.fb-link-status-failed { color: #f44336; }
.fb-link-status-pending { color: #f9ab00; }
.fb-link-status-draft { color: #9ca3af; }
.fb-link-status-paused { color: #9ca3af; }

.fb-link-row-stopped {
  opacity: 0.5;
}

.fb-link-row-stopped .fb-link-name {
  text-decoration: line-through;
  text-decoration-color: var(--text-tertiary);
}

/* Stop/Resume button in link rows */
.fb-link-stop-btn {
  display: flex;
  align-items: center;
  gap: 2px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  padding: 2px 6px;
}

.fb-link-stop-btn .material-icons {
  font-size: 13px;
}

.fb-link-stop-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.fb-link-stop-btn:hover {
  background: rgba(244, 67, 54, 0.1);
  color: #f44336;
}

.fb-link-row-stopped .fb-link-stop-btn:hover {
  background: rgba(52, 168, 83, 0.1);
  color: #34a853;
}

.fb-automation-links {
  background: rgba(59, 130, 246, 0.03);
}

.fb-automation-links-empty .material-icons {
  color: #3b82f6;
}

/* Badges container on card */
.fb-card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

/* Stopped badge on sequence card */
.fb-stopped-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  color: #f44336;
  background: rgba(244, 67, 54, 0.08);
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.fb-stopped-badge .material-icons {
  font-size: 11px;
}

/* ===== Card Stats ===== */
.fb-card-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.fb-stat-item {
  text-align: center;
}

.fb-stat-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.fb-stat-label {
  font-size: 9px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  margin-top: 2px;
  letter-spacing: 0.4px;
}

@media (max-width: 900px) {
  .fb-card-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .fb-card-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .fb-card-actions {
    opacity: 1;
  }

  .fb-saved-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .fb-filters {
    flex-wrap: wrap;
  }
}

@media (max-width: 420px) {
  .fb-card-stats {
    grid-template-columns: 1fr;
  }
}

.fb-action-btn:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.fb-action-btn .material-icons {
  font-size: 18px;
}

.fb-edit-btn:hover {
  border-color: rgba(99, 102, 241, 0.4);
  color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
}


.fb-delete-btn:hover {
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* ===== Responsive Dashboard ===== */
@media (max-width: 600px) {
  .fb-automations-grid {
    grid-template-columns: 1fr;
  }

  .fb-card-stats {
    flex-wrap: wrap;
    gap: 8px;
  }
}


/* ===== Stats Summary Card ===== */
.fb-stats-summary {
  margin-bottom: 32px;
  padding: 0 48px;
}

.fb-stats-summary-inner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  padding: 20px 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  backdrop-filter: blur(10px);
}

.fb-summary-stat {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-radius: 12px;
  position: relative;
}

.fb-summary-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fb-summary-icon .material-icons {
  font-size: 20px;
}

.fb-summary-data {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fb-summary-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.fb-summary-label {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ===== Stop Conditions ===== */
.fb-stop-conditions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.fb-checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fb-checkbox-item:hover {
  border-color: var(--accent-color);
  background: rgba(99, 102, 241, 0.05);
}

.fb-checkbox-item input {
  display: none;
}

.fb-checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.fb-checkbox-item input:checked+.fb-checkbox-custom {
  background: var(--accent-color);
  border-color: var(--accent-color);
}

.fb-checkbox-item input:checked+.fb-checkbox-custom::after {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.fb-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.fb-checkbox-label .material-icons {
  font-size: 18px;
  color: var(--text-secondary);
}

.fb-setting-divider {
  height: 1px;
  background: var(--border-color);
  margin: 20px 0;
}

.fb-setting-section {
  margin-bottom: 16px;
}

/* ===== Compact Step Cards ===== */
.fb-step-card {
  position: relative;
}

.fb-step-card .fb-card-header {
  padding: 12px 16px;
}

.fb-step-card .fb-card-body {
  padding: 14px 16px;
}

.fb-step-card .fb-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.fb-step-card .fb-card-icon .material-icons {
  font-size: 18px;
}

.fb-step-card .fb-card-title {
  font-size: 14px;
}

/* Step engagement badges in header */
.fb-step-engagement {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.fb-eng-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.fb-eng-item .material-icons {
  font-size: 16px;
}

/* ===== Stats Modal ===== */
.fb-stats-modal .fb-modal-content {
  max-width: 700px;
}

.fb-stats-modal-content {
  border-radius: 16px;
  overflow: hidden;
}

.fb-stats-modal-header {
  background: linear-gradient(135deg, var(--accent-color) 0%, #a855f7 100%);
  color: white;
  padding: 20px 24px;
}

.fb-stats-modal-header .fb-modal-title {
  font-size: 18px;
  font-weight: 600;
}

.fb-modal-subtitle {
  font-size: 13px;
  opacity: 0.8;
  margin-top: 4px;
}

.fb-stats-modal-summary {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-color);
}

.fb-stats-modal-stat {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--bg-surface);
  border-radius: 10px;
}

.fb-stats-modal-stat .material-icons {
  font-size: 24px;
}

.fb-stats-modal-stat-data {
  display: flex;
  flex-direction: column;
}

.fb-stats-modal-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.fb-stats-modal-label {
  font-size: 11px;
  color: var(--text-secondary);
}

.fb-stats-modal-steps {
  padding: 20px;
}

.fb-stats-modal-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 16px 0;
}

.fb-stats-table {
  width: 100%;
  border-collapse: collapse;
}

.fb-stats-table th,
.fb-stats-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.fb-stats-table th {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fb-stats-table td {
  font-size: 13px;
  color: var(--text-primary);
}

.fb-step-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.fb-rate-bar {
  position: relative;
  width: 80px;
  height: 20px;
  background: var(--bg-elevated);
  border-radius: 10px;
  overflow: hidden;
}

.fb-rate-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, #34a853, #10b981);
  border-radius: 10px;
  transition: width 0.3s ease;
}

.fb-rate-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  z-index: 1;
}

/* ===== Automation Card Hover for Stats ===== */
.fb-automation-card {
  cursor: pointer;
}

.fb-automation-card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.12),
    0 8px 24px rgba(0, 0, 0, 0.08),
    0 0 0 1px var(--accent-color) inset;
}

/* ===== Responsive Stats Summary ===== */
@media (max-width: 900px) {
  .fb-stats-summary-inner {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .fb-stats-summary {
    padding: 0 16px;
  }

  .fb-stats-summary-inner {
    grid-template-columns: 1fr;
  }

  .fb-summary-stat {
    flex: 1 1 100%;
  }

  .fb-stop-conditions {
    grid-template-columns: 1fr;
  }

  .fb-stats-modal-summary {
    flex-wrap: wrap;
  }

  .fb-stats-modal-stat {
    flex: 1 1 calc(50% - 8px);
  }
}


/* ===== Modal Base Styles ===== */
.fb-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.fb-modal-content {
  background: var(--bg-surface);
  border-radius: 16px;
  max-width: 500px;
  width: 90%;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fb-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-elevated);
}

.fb-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.fb-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.fb-modal-close:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.fb-modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(85vh - 120px);
}

/* ===== Logs Table ===== */
.fb-logs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.fb-logs-table th,
.fb-logs-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.fb-logs-table th {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg-elevated);
}

.fb-logs-table tbody tr:hover {
  background: rgba(99, 102, 241, 0.05);
}

.fb-log-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.fb-log-badge.open,
.fb-log-badge.success {
  background: rgba(52, 168, 83, 0.15);
  color: #34a853;
}

.fb-log-badge.click {
  background: rgba(249, 171, 0, 0.15);
  color: #f9ab00;
}

.fb-log-badge.sent {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.fb-log-badge.error,
.fb-log-badge.failed {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.fb-log-badge.pending,
.fb-log-badge.skipped {
  background: rgba(156, 163, 175, 0.15);
  color: #9ca3af;
}

.fb-loading-logs,
.fb-no-logs,
.fb-error-logs {
  padding: 32px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

.fb-error-logs {
  color: #ef4444;
}

/* ===== Run Now Button ===== */
.fb-run-now-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.fb-run-now-btn:hover {
  background: var(--accent-color);
  color: white;
}

.fb-run-now-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.fb-run-now-btn .material-icons {
  font-size: 18px;
}

/* ===== Filter Buttons ===== */
.fb-filters {
  display: flex;
  gap: 8px;
}

.fb-filter-btn {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fb-filter-btn:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.fb-filter-btn.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
}

/* ===== Saved Section Header ===== */
.fb-saved-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
}

.fb-empty-filter {
  grid-column: 1 / -1;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

/* ===== Template Gallery ===== */
.fb-template-gallery {
  width: 100%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
  border: 2px dashed var(--border-color);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
}

.fb-template-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.fb-template-header .material-icons {
  color: var(--accent-color);
  font-size: 22px;
}

.fb-templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.fb-template-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.2s ease;
}

.fb-template-card:hover {
  border-color: var(--accent-color);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
  transform: translateY(-2px);
}

.fb-template-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.fb-template-icon .material-icons {
  color: white;
  font-size: 24px;
}

.fb-template-card h4 {
  margin: 0 0 6px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.fb-template-card p {
  margin: 0 0 16px 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.fb-template-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.fb-view-email-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.fb-view-email-btn:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
  background: rgba(99, 102, 241, 0.05);
}

.fb-view-email-btn .material-icons {
  font-size: 16px;
}

.fb-use-template-btn {
  padding: 8px 16px;
  background: var(--accent-color);
  border: none;
  border-radius: 6px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.fb-use-template-btn:hover {
  background: #5558e0;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* ===== Template Preview ===== */
.fb-template-preview {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  text-align: left;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fb-preview-email-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.fb-preview-email-item:last-child {
  margin-bottom: 0;
}

.fb-preview-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.fb-preview-subject {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.fb-preview-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: pre-wrap;
}

.fb-template-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin: 0;
}

/* ===== Template Select with View Button ===== */

/* ===== Template Select with View Button ===== */
.fb-template-select-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
}

.fb-template-select-wrapper .fb-select {
  flex: 1;
}

.fb-view-email-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.fb-view-email-btn:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
  background: rgba(99, 102, 241, 0.1);
}

.fb-view-email-btn .material-icons {
  font-size: 20px;
}

/* ===== Template Preview Modal ===== */
.fb-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fb-modal-overlay .fb-modal-content {
  background: var(--bg-surface);
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fb-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.fb-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.fb-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.fb-modal-close:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.fb-modal-body {
  padding: 24px;
}

.fb-email-preview {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.fb-preview-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fb-preview-section label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fb-preview-text {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.6;
}

.fb-preview-body-text {
  min-height: 150px;
  white-space: pre-wrap;
}

.fb-preview-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0 0 0;
  padding: 12px 16px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.fb-preview-note .material-icons {
  font-size: 18px;
  color: var(--accent-color);
}

/* ===== HTML Template Preview Styles ===== */
.fb-preview-modal {
  max-width: 800px !important;
}

.fb-preview-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.fb-preview-tab {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.fb-preview-tab:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.fb-preview-tab.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
}

.fb-preview-html-frame {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.fb-preview-iframe {
  width: 100%;
  height: 400px;
  border: none;
  display: block;
}

.fb-preview-html {
  margin-top: 0;
}

/* ===== New Rotation Modal Styles ===== */
.fb-rotation-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.fb-rotation-modal-container {
  background: var(--bg-surface);
  border-radius: 16px;
  max-width: 580px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.3s ease;
}

.fb-rotation-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fb-rotation-modal-header-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.fb-rotation-modal-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.fb-rotation-modal-icon .material-icons {
  font-size: 22px;
}

.fb-rotation-modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.fb-rotation-modal-subtitle {
  margin: 4px 0 0 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.fb-rotation-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.fb-rotation-modal-close:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.fb-rotation-modal-body {
  padding: 18px 24px;
  overflow-y: auto;
  flex: 1;
}

.fb-rotation-section {
  margin-bottom: 24px;
}

.fb-rotation-section:last-child {
  margin-bottom: 0;
}

.fb-rotation-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.fb-rotation-section-header .material-icons {
  font-size: 20px;
  color: var(--accent-color);
}

.fb-rotation-section-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.fb-rotation-section-desc {
  margin: 0 0 14px 30px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Sender List */
.fb-senders-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fb-sender-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg-elevated);
}

.fb-sender-item:hover {
  border-color: var(--accent-color);
  background: rgba(99, 102, 241, 0.05);
}

.fb-sender-item.primary {
  border-color: rgba(52, 168, 83, 0.3);
  background: rgba(52, 168, 83, 0.05);
}

.fb-sender-item.inactive {
  opacity: 0.5;
  cursor: not-allowed;
}

.fb-sender-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.fb-sender-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.fb-sender-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.fb-sender-details {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.fb-sender-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.fb-sender-email {
  font-size: 11px;
  color: var(--text-secondary);
}

.fb-primary-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(52, 168, 83, 0.15);
  color: #34a853;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.fb-primary-badge .material-icons {
  font-size: 14px;
}

.fb-inactive-badge {
  padding: 4px 10px;
  background: rgba(156, 163, 175, 0.15);
  color: #9ca3af;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.fb-sender-quota {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 4px 10px;
  background: var(--bg-tertiary);
  border-radius: 6px;
}

.fb-no-senders {
  padding: 40px 20px;
  text-align: center;
  background: var(--bg-elevated);
  border-radius: 12px;
  border: 2px dashed var(--border-color);
}

.fb-no-senders .material-icons {
  font-size: 48px;
  color: var(--text-tertiary);
  opacity: 0.3;
  margin-bottom: 12px;
}

.fb-no-senders p {
  margin: 0 0 4px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.fb-no-senders small {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* Strategy Options */
.fb-strategy-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fb-strategy-option {
  display: block;
  cursor: pointer;
}

.fb-strategy-option input[type="radio"] {
  display: none;
}

.fb-strategy-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-elevated);
  transition: all 0.2s ease;
}

.fb-strategy-card .material-icons {
  font-size: 24px;
  color: var(--text-tertiary);
}

.fb-strategy-card strong {
  display: block;
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.fb-strategy-card p {
  margin: 0;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.fb-strategy-option input[type="radio"]:checked + .fb-strategy-card {
  border-color: var(--accent-color);
  background: rgba(99, 102, 241, 0.08);
}

.fb-strategy-option input[type="radio"]:checked + .fb-strategy-card .material-icons {
  color: var(--accent-color);
}

/* Advanced Settings */
.fb-advanced-settings {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fb-setting-toggle {
  display: block;
  cursor: pointer;
}

.fb-setting-toggle input[type="checkbox"] {
  display: none;
}

.fb-setting-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-elevated);
  transition: all 0.2s ease;
}

.fb-setting-toggle:hover .fb-setting-content {
  border-color: var(--accent-color);
  background: rgba(99, 102, 241, 0.05);
}

.fb-setting-content strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.fb-setting-content p {
  margin: 0;
  font-size: 11px;
  color: var(--text-secondary);
}

.fb-toggle-switch {
  width: 48px;
  height: 26px;
  background: #d1d5db;
  border-radius: 26px;
  position: relative;
  transition: all 0.3s ease;
}

.fb-toggle-switch::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.fb-setting-toggle input[type="checkbox"]:checked + .fb-setting-content .fb-toggle-switch {
  background: var(--accent-color);
}

.fb-setting-toggle input[type="checkbox"]:checked + .fb-setting-content .fb-toggle-switch::before {
  transform: translateX(22px);
}

.fb-setting-input {
  padding: 14px 16px;
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-elevated);
}

.fb-setting-input label {
  display: block;
  margin-bottom: 10px;
}

.fb-setting-input strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.fb-setting-input p {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.fb-setting-input input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.fb-setting-input input[type="number"]:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Modal Footer */
.fb-rotation-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.fb-rotation-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.fb-rotation-btn.secondary {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.fb-rotation-btn.secondary:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.fb-rotation-btn.primary {
  background: var(--accent-color);
  color: white;
}

.fb-rotation-btn.primary:hover {
  background: #4f46e5;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.fb-rotation-btn .material-icons {
  font-size: 18px;
}

/* Responsive */
@media (max-width: 768px) {
  .fb-rotation-modal-container {
    max-width: 95%;
    border-radius: 16px;
  }

  .fb-rotation-modal-header,
  .fb-rotation-modal-body,
  .fb-rotation-modal-footer {
    padding: 16px 20px;
  }

  .fb-rotation-modal-icon {
    width: 40px;
    height: 40px;
  }

  .fb-rotation-modal-title {
    font-size: 18px;
  }

  .fb-sender-item {
    padding: 10px 12px;
  }

  .fb-sender-avatar {
    width: 36px;
    height: 36px;
  }
}

/* ===== Activity V2 Styles ===== */
.fb-activity-v2 {
  margin-top: 28px;
}

.fb-activity-v2 .fb-activity-title::after {
  content: " 📊";
}

.fb-step-cell {
  text-align: center;
  font-weight: 600;
  color: var(--accent-color);
  white-space: nowrap;
}

.fb-contact-link {
  margin-left: 6px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.fb-contact-link:hover {
  opacity: 1;
}

.fb-success-text {
  color: #10b981;
  font-weight: 600;
}

.fb-error-text {
  color: #ef4444;
  font-weight: 600;
}

/* ===== Activity V3 Styles ===== */
.fb-activity-v3 {
  margin-top: 28px;
}

.fb-activity-v3 .fb-activity-title::after {
  content: " 📋";
}

.fb-activity-timeline {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-primary);
  padding: 12px;
  max-height: 600px;
  overflow-y: auto;
}

.fb-timeline-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 8px;
  background: var(--bg-elevated);
  border-left: 3px solid var(--border-color);
  transition: all 0.2s ease;
}

.fb-timeline-item:hover {
  background: rgba(99, 102, 241, 0.08);
  border-left-color: var(--accent-color);
}

.fb-timeline-item.sent {
  border-left-color: #10b981;
}

.fb-timeline-item.opened {
  border-left-color: #34a853;
}

.fb-timeline-item.clicked {
  border-left-color: #f59e0b;
}

.fb-timeline-item.error {
  border-left-color: #ef4444;
}

.fb-timeline-item.unsub {
  border-left-color: #f97316;
}

.fb-timeline-item.info {
  border-left-color: #6366f1;
}

.fb-timeline-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.1);
}

.fb-timeline-item.sent .fb-timeline-icon {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.fb-timeline-item.opened .fb-timeline-icon {
  background: rgba(52, 168, 83, 0.12);
  color: #34a853;
}

.fb-timeline-item.clicked .fb-timeline-icon {
  background: rgba(245, 158, 11, 0.14);
  color: #f59e0b;
}

.fb-timeline-item.error .fb-timeline-icon {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.fb-timeline-item.unsub .fb-timeline-icon {
  background: rgba(249, 115, 22, 0.12);
  color: #f97316;
}

.fb-timeline-item.info .fb-timeline-icon {
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
}

.fb-timeline-icon .material-icons {
  font-size: 18px;
}

.fb-timeline-content {
  flex: 1;
  min-width: 0;
}

.fb-timeline-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.fb-timeline-event {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 13px;
}

.fb-timeline-step {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-color);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.fb-timeline-time {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.fb-timeline-contact {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.fb-timeline-automation {
  font-size: 11px;
  color: var(--text-tertiary);
  font-style: italic;
}

/* Scrollbar styling for timeline */
.fb-activity-timeline::-webkit-scrollbar {
  width: 6px;
}

.fb-activity-timeline::-webkit-scrollbar-track {
  background: var(--bg-elevated);
  border-radius: 3px;
}

.fb-activity-timeline::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.fb-activity-timeline::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.4);
}

/* ===== Activity V4 Styles ===== */
.fb-activity-v4 {
  margin-top: 28px;
}

.fb-activity-v4 .fb-activity-title::after {
  content: " ⚡";
}

/* Filters section */
.fb-activity-filters {
  display: flex;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.fb-filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 200px;
}

.fb-filter-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fb-filter-select,
.fb-filter-input {
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 13px;
  transition: all 0.2s ease;
}

.fb-filter-select:hover,
.fb-filter-input:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

.fb-filter-select:focus,
.fb-filter-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.fb-filter-input::placeholder {
  color: var(--text-tertiary);
}

/* Time column styles */
.fb-time-primary {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.fb-time-secondary {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Step + Trigger column */
.fb-step-trigger-cell {
  text-align: center;
  min-width: 100px;
}

.fb-step-num {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-color);
  line-height: 1.2;
}

.fb-trigger-text {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 2px;
  font-style: italic;
}

/* Enhanced detail styling */
.fb-activity-v4 .fb-activity-detail strong {
  color: var(--text-primary);
  font-weight: 600;
}

.fb-info-hint {
  font-size: 10px;
  color: var(--text-tertiary);
  font-style: italic;
  opacity: 0.7;
}

/* V1 Activity Log removed - using V4 only */

/* ===== Contact Progress Tracker ===== */
.fb-progress-tracker-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 28px;
}

.fb-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.fb-progress-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fb-progress-controls .fb-filter-select {
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  appearance: none;
  background-image: url('data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2724%27 height=%2724%27 viewBox=%270 0 24 24%27 fill=%27%236b7280%27%3E%3Cpath d=%27M7 10l5 5 5-5z%27/%3E%3C/svg%3E');
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 16px;
}

/* Pipeline Cards */
.fb-pipeline-cards {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 0;
  overflow-x: auto;
}

.fb-pipeline-card {
  flex: 1;
  min-width: 100px;
  text-align: center;
  padding: 16px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  transition: all 0.2s;
}

.fb-pipeline-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.fb-pipeline-card.total {
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(99, 102, 241, 0.06);
}
.fb-pipeline-card.total .fb-pipeline-number {
  color: #6366f1;
}

.fb-pipeline-card.active {
  border-color: rgba(59, 130, 246, 0.3);
  background: rgba(59, 130, 246, 0.06);
}
.fb-pipeline-card.active .fb-pipeline-number {
  color: #3b82f6;
}

.fb-pipeline-card.completed {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.06);
}
.fb-pipeline-card.completed .fb-pipeline-number {
  color: #22c55e;
}

.fb-pipeline-card.stopped {
  border-color: rgba(249, 115, 22, 0.3);
  background: rgba(249, 115, 22, 0.06);
}
.fb-pipeline-card.stopped .fb-pipeline-number {
  color: #f97316;
}

.fb-pipeline-card.error {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.06);
}
.fb-pipeline-card.error .fb-pipeline-number {
  color: #ef4444;
}

.fb-pipeline-number {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.fb-pipeline-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.fb-pipeline-arrow {
  color: var(--text-tertiary);
  opacity: 0.4;
  flex-shrink: 0;
}
.fb-pipeline-arrow .material-icons {
  font-size: 20px;
}

/* Progress Loading & Empty */
.fb-progress-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px;
  color: var(--text-secondary);
  font-size: 14px;
}

.fb-progress-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  text-align: center;
}
.fb-progress-empty .material-icons {
  font-size: 48px;
  opacity: 0.3;
  margin-bottom: 12px;
}
.fb-progress-empty p {
  margin: 0 0 4px 0;
  font-size: 14px;
}
.fb-progress-hint {
  font-size: 12px !important;
  color: var(--text-tertiary) !important;
}

/* Progress Table */
.fb-progress-table-wrap {
  margin-top: 16px;
}

.fb-progress-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

.fb-progress-table thead tr {
  background: var(--bg-elevated);
}
.fb-progress-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}
.fb-progress-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}
.fb-progress-table tbody tr:hover {
  background: rgba(99, 102, 241, 0.04);
}
.fb-progress-table tbody tr:last-child td {
  border-bottom: none;
}

/* Contact cell */
.fb-progress-contact {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fb-progress-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #818cf8);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.fb-progress-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.3;
}
.fb-progress-email {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.3;
}

/* Automation name */
.fb-progress-automation-name {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-block;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Progress bar */
.fb-progress-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fb-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
  min-width: 60px;
}
.fb-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
  background: #3b82f6;
}
.fb-progress-fill.completed {
  background: #22c55e;
}
.fb-progress-fill.stopped {
  background: #f97316;
}
.fb-progress-fill.error {
  background: #ef4444;
}
.fb-progress-pct {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 32px;
}

/* Step display */
.fb-progress-step {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-elevated);
  padding: 3px 8px;
  border-radius: 6px;
  margin-right: 6px;
}

/* Engagement icons */
.fb-engagement-icon {
  font-size: 15px !important;
  vertical-align: middle;
  margin-left: 2px;
}
.fb-engagement-icon.opened {
  color: #3b82f6;
}
.fb-engagement-icon.clicked {
  color: #a855f7;
}

/* Status badges */
.fb-progress-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.fb-progress-badge .material-icons {
  font-size: 14px;
}
.fb-progress-badge.active {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}
.fb-progress-badge.completed {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}
.fb-progress-badge.stopped {
  background: rgba(249, 115, 22, 0.1);
  color: #f97316;
}
.fb-progress-badge.error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Time */
.fb-progress-time {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
  .fb-pipeline-cards {
    flex-wrap: wrap;
    gap: 8px;
  }
  .fb-pipeline-card {
    min-width: 80px;
    padding: 12px 8px;
  }
  .fb-pipeline-number {
    font-size: 22px;
  }
  .fb-pipeline-arrow {
    display: none;
  }
  .fb-progress-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  .fb-progress-table {
    font-size: 11px;
  }
  .fb-progress-table th,
  .fb-progress-table td {
    padding: 8px 10px;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .fb-activity-filters {
    flex-direction: column;
  }

  .fb-filter-group {
    min-width: 100%;
  }
}

/* ===== Mini toggle for campaign stats modal ===== */
.snd-toggle-mini {
  width: 26px;
  height: 14px;
}

.snd-toggle-mini .snd-toggle-slider:before {
  height: 8px;
  width: 8px;
  left: 3px;
  bottom: 3px;
}

.snd-toggle-mini input:checked + .snd-toggle-slider:before {
  transform: translateX(12px);
}

/* Disabled row in campaign stats */
.fb-campaign-row-disabled {
  opacity: 0.45;
}

.fb-campaign-row-disabled td {
  text-decoration: line-through;
  text-decoration-color: var(--text-tertiary);
}

/* ===== Sequence Detail Grid (modal) ===== */
.fb-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.fb-detail-card {
  padding: 10px 12px;
  background: var(--bg-secondary, rgba(0, 0, 0, 0.02));
  border-radius: 8px;
}

.fb-detail-label {
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.fb-detail-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

