/* CRM Design System - Refined Editorial */

/* Typography */
/* Space Grotesk: display/headings (loaded via Google Fonts CDN in index.html) */
/* General Sans: body text (use system font stack as fallback) */
/* JetBrains Mono: metrics/numbers (defer CDN to when needed) */

:root {
  /* CRM Typography */
  --crm-font-display: 'Space Grotesk', var(--font-sans);
  --crm-font-body: 'General Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --crm-font-mono: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;

  /* CRM Color Palette - Warm Copper */
  --crm-accent: #c67f40;
  --crm-accent-hover: #b06e35;
  --crm-accent-light: #f5e6d3;
  --crm-accent-subtle: #faf5ef;

  /* CRM Neutrals */
  --crm-text-primary: #1a1a2e;
  --crm-text-secondary: #4a4a68;
  --crm-text-muted: #8888a0;
  --crm-bg-page: #fafafa;
  --crm-bg-card: #ffffff;
  --crm-bg-hover: #f5f5f7;
  --crm-border: #e5e5ea;
  --crm-border-light: #f0f0f3;

  /* CRM Status Colors */
  --crm-success: #2d8a56;
  --crm-warning: #d4940a;
  --crm-danger: #c53030;
  --crm-info: #2b6cb0;
  --crm-status-success: #16a34a;
  --crm-status-info: #2563eb;
  --crm-status-warning: #d97706;
  --crm-status-error: #991b1b;

  /* CRM Spacing Scale */
  --crm-space-xs: 4px;
  --crm-space-sm: 8px;
  --crm-space-md: 16px;
  --crm-space-lg: 24px;
  --crm-space-xl: 32px;
  --crm-space-2xl: 48px;

  /* CRM Shadows */
  --crm-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --crm-shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
  --crm-shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);

  /* CRM Border Radius */
  --crm-radius-sm: 4px;
  --crm-radius-md: 8px;
  --crm-radius-lg: 12px;
}

/* CRM Page Container */
.crm-page {
  padding: var(--crm-space-xl);
  max-width: 1400px;
  margin: 0 auto;
  font-family: var(--crm-font-body);
  color: var(--crm-text-primary);
  background: var(--crm-bg-page);
}

/* CRM Page Header */
.crm-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--crm-space-xl);
  padding-bottom: var(--crm-space-lg);
  border-bottom: 1px solid var(--crm-border-light);
}

.crm-page-header h1 {
  font-family: var(--crm-font-display);
  font-size: 2rem;
  font-weight: 600;
  margin: 0;
  color: var(--crm-text-primary);
}

/* CRM Card Component */
.crm-card {
  background: var(--crm-bg-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-md);
  box-shadow: var(--crm-shadow-sm);
  padding: var(--crm-space-lg);
  margin-bottom: var(--crm-space-lg);
}

/* CRM Buttons */
.crm-btn {
  font-family: var(--crm-font-body);
  font-size: 0.9rem;
  font-weight: 500;
  padding: var(--crm-space-sm) var(--crm-space-lg);
  border-radius: var(--crm-radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--crm-accent);
  color: white;
}

.crm-btn:hover {
  background: var(--crm-accent-hover);
  box-shadow: var(--crm-shadow-md);
}

.crm-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.crm-btn-secondary {
  background: transparent;
  color: var(--crm-accent);
  border: 1px solid var(--crm-accent);
}

.crm-btn-secondary:hover {
  background: var(--crm-accent-subtle);
  border-color: var(--crm-accent-hover);
}

.crm-btn-danger {
  background: var(--crm-danger);
  color: white;
}

.crm-btn-danger:hover {
  background: #a82828;
}

/* CRM Table */
.crm-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--crm-font-body);
  font-size: 0.9rem;
}

.crm-table th {
  text-align: left;
  padding: var(--crm-space-md);
  border-bottom: 2px solid var(--crm-border);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--crm-text-muted);
}

.crm-table td {
  padding: var(--crm-space-md);
  border-bottom: 1px solid var(--crm-border-light);
}

.crm-table tbody tr {
  transition: background-color 0.15s ease;
}

.crm-table tbody tr:hover {
  background-color: var(--crm-bg-hover);
}

.crm-table tbody tr:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.01);
}

.crm-table tbody tr:nth-child(even):hover {
  background-color: var(--crm-bg-hover);
}

/* CRM Badges */
.crm-badge {
  display: inline-block;
  padding: var(--crm-space-xs) var(--crm-space-sm);
  border-radius: var(--crm-radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.crm-badge-lead {
  background: #e6f2ff;
  color: var(--crm-info);
}

.crm-badge-prospect {
  background: var(--crm-accent-light);
  color: var(--crm-accent-hover);
}

.crm-badge-customer {
  background: #e6f5ed;
  color: var(--crm-success);
}

.crm-badge-inactive {
  background: #f0f0f3;
  color: var(--crm-text-muted);
}

/* CRM Search Input */
.crm-search-input {
  font-family: var(--crm-font-body);
  width: 100%;
  max-width: 400px;
  padding: var(--crm-space-sm) var(--crm-space-md);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  font-size: 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.crm-search-input:focus {
  outline: none;
  border-color: var(--crm-accent);
  box-shadow: 0 0 0 3px var(--crm-accent-subtle);
}

/* CRM Form Input */
.crm-input {
  font-family: var(--crm-font-body);
  padding: var(--crm-space-sm) var(--crm-space-md);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  font-size: 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: var(--crm-bg-card);
  color: var(--crm-text-primary);
}

.crm-input:focus {
  outline: none;
  border-color: var(--crm-accent);
  box-shadow: 0 0 0 3px var(--crm-accent-subtle);
}

.crm-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--crm-bg-hover);
}

/* CRM Empty State */
.crm-empty-state {
  text-align: center;
  padding: var(--crm-space-2xl) var(--crm-space-lg);
  color: var(--crm-text-muted);
}

.crm-empty-state p {
  font-size: 1rem;
  margin: 0;
}

/* CRM Pagination */
.crm-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--crm-space-sm);
  margin-top: var(--crm-space-lg);
  padding-top: var(--crm-space-lg);
  border-top: 1px solid var(--crm-border-light);
}

.crm-pagination button {
  font-family: var(--crm-font-body);
  padding: var(--crm-space-xs) var(--crm-space-md);
  border: 1px solid var(--crm-border);
  background: white;
  border-radius: var(--crm-radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--crm-text-primary);
}

.crm-pagination button:hover:not(:disabled) {
  border-color: var(--crm-accent);
  color: var(--crm-accent);
  background: var(--crm-accent-subtle);
}

.crm-pagination button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.crm-pagination span {
  font-size: 0.85rem;
  color: var(--crm-text-secondary);
}

/* CRM Sidebar Navigation */
.nav-section-divider {
  height: 1px;
  background: var(--crm-border);
  margin: 8px 16px;
}

.nav-section-header {
  padding: 8px 20px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--crm-text-muted);
}

/* Responsive Styles */
@media (max-width: 768px) {
  .crm-page {
    padding: var(--crm-space-md);
  }

  .crm-page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--crm-space-md);
  }

  .crm-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .crm-search-input {
    max-width: 100%;
  }
}

/* Activity Timeline Styles (Phase 2) */
.activity-filters {
  display: flex;
  gap: var(--crm-space-sm);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--crm-space-md);
  padding: var(--crm-space-sm) var(--crm-space-md);
  background: var(--crm-bg-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-md);
}

.activity-filters select,
.activity-filters input[type="date"] {
  padding: 6px 10px;
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  font-family: var(--crm-font-body);
  font-size: 0.875rem;
  color: var(--crm-text-primary);
  background: var(--crm-bg-card);
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: var(--crm-space-sm);
}

.activity-item {
  display: flex;
  gap: var(--crm-space-md);
  padding: var(--crm-space-md);
  background: var(--crm-bg-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-md);
  border-left: 4px solid var(--crm-border);
  transition: box-shadow 0.15s ease;
}

.activity-item:hover {
  box-shadow: var(--crm-shadow-sm);
}

/* Call direction color-coded borders */
.activity-item.activity-call-inbound {
  border-left-color: var(--crm-success);
}

.activity-item.activity-call-outbound {
  border-left-color: var(--crm-info);
}

.activity-item.activity-note {
  border-left-color: var(--crm-warning);
}

.activity-item.activity-meeting {
  border-left-color: #8b5cf6;
}

.activity-item.activity-appointment {
  border-left-color: var(--crm-accent);
}

.activity-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.activity-icon-call-inbound {
  background: #dcfce7;
  color: #16a34a;
}

.activity-icon-call-outbound {
  background: #dbeafe;
  color: #2563eb;
}

.activity-icon-note {
  background: #fef3c7;
  color: #d97706;
}

.activity-icon-meeting {
  background: #ede9fe;
  color: #7c3aed;
}

.activity-icon-appointment {
  background: var(--crm-accent-light);
  color: var(--crm-accent);
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-header {
  display: flex;
  align-items: center;
  gap: var(--crm-space-sm);
  margin-bottom: 4px;
}

.activity-header .crm-badge {
  font-size: 0.75rem;
}

.activity-timestamp {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--crm-text-muted);
  white-space: nowrap;
}

.activity-body {
  font-size: 0.9rem;
  color: var(--crm-text-secondary);
  line-height: 1.5;
}

.activity-meta {
  display: flex;
  gap: var(--crm-space-md);
  font-size: 0.8rem;
  color: var(--crm-text-muted);
  margin-top: 4px;
}

.activity-recording {
  margin-top: var(--crm-space-sm);
}

.activity-recording audio {
  width: 100%;
  max-width: 400px;
  height: 36px;
}

.activity-recording .play-btn {
  padding: 4px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  background: var(--crm-accent-subtle);
  border: 1px solid var(--crm-accent-light);
  border-radius: var(--crm-radius-sm);
  color: var(--crm-accent);
}

.activity-recording .play-btn:hover {
  background: var(--crm-accent-light);
}

/* Direction badges */
.badge-inbound {
  background: #dcfce7;
  color: #16a34a;
}

.badge-outbound {
  background: #dbeafe;
  color: #2563eb;
}

.activity-pagination {
  display: flex;
  justify-content: center;
  padding: var(--crm-space-md) 0;
}

/* Responsive */
@media (max-width: 768px) {
  .activity-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .activity-item {
    flex-direction: column;
    gap: var(--crm-space-sm);
  }

  .activity-icon {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }

  .activity-header {
    flex-wrap: wrap;
  }

  .activity-timestamp {
    margin-left: 0;
    width: 100%;
  }
}

/* ===== Deal Pipeline Board ===== */
.pipeline-board {
  display: flex;
  gap: var(--crm-space-md, 16px);
  overflow-x: auto;
  padding-bottom: var(--crm-space-md, 16px);
  min-height: 500px;
}

.pipeline-column {
  min-width: 260px;
  max-width: 300px;
  flex: 1;
  background: var(--crm-bg-secondary, #f8f7f5);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}

.pipeline-column-header {
  padding: var(--crm-space-sm, 12px) var(--crm-space-md, 16px);
  border-bottom: 2px solid var(--crm-accent, #c67f40);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pipeline-column-header h3 {
  margin: 0;
  font-family: var(--crm-font-display, 'Space Grotesk', sans-serif);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex: 1;
}

.pipeline-column-count {
  background: var(--crm-accent, #c67f40);
  color: white;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
}

.pipeline-column-value {
  font-size: 0.75rem;
  color: var(--crm-text-secondary, #666);
  width: 100%;
}

.pipeline-column-body {
  flex: 1;
  padding: var(--crm-space-sm, 12px);
  display: flex;
  flex-direction: column;
  gap: var(--crm-space-sm, 12px);
  min-height: 100px;
}

.pipeline-column-empty {
  text-align: center;
  color: var(--crm-text-tertiary, #999);
  font-size: 0.8125rem;
  padding: var(--crm-space-lg, 24px) var(--crm-space-sm, 12px);
}

/* Deal cards */
.deal-card {
  background: white;
  border-radius: 8px;
  padding: var(--crm-space-sm, 12px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  cursor: grab;
  transition: box-shadow 0.15s, transform 0.15s;
  border-left: 3px solid var(--crm-accent, #c67f40);
}

.deal-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transform: translateY(-1px);
}

.deal-card-ghost {
  opacity: 0.4;
  background: var(--crm-accent, #c67f40);
  border-radius: 8px;
}

.deal-card-dragging {
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  transform: rotate(2deg);
}

.deal-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.deal-card-name {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--crm-text-primary, #1a1a1a);
  line-height: 1.3;
}

.deal-card-amount {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--crm-accent, #c67f40);
  white-space: nowrap;
  margin-left: 8px;
}

.deal-card-body {
  font-size: 0.8125rem;
  color: var(--crm-text-secondary, #666);
}

.deal-card-contact {
  margin: 0 0 4px 0;
}

.deal-card-meta {
  margin: 0;
  font-size: 0.75rem;
  color: var(--crm-text-tertiary, #999);
}

/* Pipeline summary bar */
.pipeline-summary {
  display: flex;
  gap: var(--crm-space-lg, 24px);
  padding: var(--crm-space-md, 16px) 0;
  margin-bottom: var(--crm-space-md, 16px);
  flex-wrap: wrap;
}

.pipeline-summary-stat {
}

.pipeline-summary-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--crm-text-tertiary, #999);
  margin-bottom: 4px;
}

.pipeline-summary-value {
  font-size: 1.25rem;
  font-weight: 700;
  font-family: var(--crm-font-display, 'Space Grotesk', sans-serif);
  color: var(--crm-text-primary, #1a1a1a);
}

/* Deal modal */
.deal-form-group {
  margin-bottom: var(--crm-space-md, 16px);
}

.deal-form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--crm-text-primary, #1a1a1a);
  margin-bottom: 6px;
}

.deal-form-group input,
.deal-form-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--crm-border, #e0ddd8);
  border-radius: 6px;
  font-size: 0.875rem;
  font-family: inherit;
}

.deal-form-group input:focus,
.deal-form-group select:focus {
  outline: none;
  border-color: var(--crm-accent, #c67f40);
  box-shadow: 0 0 0 3px rgba(198, 127, 64, 0.15);
}

/* Responsive: stack columns vertically on narrow screens */
@media (max-width: 768px) {
  .pipeline-board {
    flex-direction: column;
  }

  .pipeline-column {
    min-width: 100%;
    max-width: 100%;
  }
}

/* ===== Campaign Integration Styles (Phase 3.1) ===== */

/* Campaign badges for contact/activity associations */
.crm-campaign-badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--crm-accent-light, #f5e6d3);
  color: var(--crm-accent, #c67f40);
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Campaign tag for activity timeline items */
.crm-campaign-tag {
  display: inline-block;
  padding: 1px 6px;
  background: #e8f0fe;
  color: #1a73e8;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 6px;
}

/* Campaign history list */
.crm-campaign-history {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.crm-campaign-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--crm-bg-secondary, #f8f7f4);
  border-radius: 6px;
}

.crm-campaign-date {
  font-size: 0.8rem;
  color: var(--crm-text-secondary, #6b7280);
}

/* Campaign metrics component */
.crm-campaign-metrics-header {
  margin-bottom: 16px;
}

.crm-campaign-metrics-body {
  min-height: 120px;
}

.crm-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.crm-metric-card {
  background: white;
  border: 1px solid var(--crm-border, #e5e3df);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.crm-metric-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--crm-text-primary, #1f2937);
  font-family: 'Space Grotesk', sans-serif;
}

.crm-metric-label {
  font-size: 0.8rem;
  color: var(--crm-text-secondary, #6b7280);
  margin-top: 4px;
}

/* Campaign sync results panel */
.crm-sync-results {
  padding: 12px 16px;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 8px;
  margin-top: 12px;
  font-size: 0.85rem;
}

.crm-sync-results.error {
  background: #fef2f2;
  border-color: #fca5a5;
}

/* Loading state */
.crm-loading {
  text-align: center;
  padding: var(--crm-space-md);
  color: var(--crm-text-muted);
  font-style: italic;
}

/* Error state */
.crm-error {
  color: var(--crm-danger, #c53030);
  font-size: 0.85rem;
  padding: var(--crm-space-sm);
}

/* Select dropdown styling */
.crm-select {
  padding: 10px 12px;
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  font-size: 0.9rem;
  font-family: var(--crm-font-body);
  cursor: pointer;
  background: var(--crm-bg-card);
  color: var(--crm-text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.crm-select:focus {
  outline: none;
  border-color: var(--crm-accent);
  box-shadow: 0 0 0 3px var(--crm-accent-subtle);
}

/* ===== Phase 65 Call Follow-ups ===== */

/* 1. Page layout (queue view) */
.follow-up-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--crm-space-md);
  padding: var(--crm-space-md);
  background: var(--crm-bg-card);
  border: 1px solid var(--crm-border-light);
  border-radius: var(--crm-radius-md);
  margin-bottom: var(--crm-space-md);
}
.follow-up-filters > label {
  display: inline-flex;
  align-items: center;
  gap: var(--crm-space-xs);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--crm-text-muted);
}
.follow-up-pending-count {
  font-size: 0.875rem;
  color: var(--crm-text-muted);
  margin-bottom: var(--crm-space-md);
}
.follow-up-list {
  display: flex;
  flex-direction: column;
  gap: var(--crm-space-md);
}
.follow-up-expired-section {
  margin-top: var(--crm-space-xl);
  padding-top: var(--crm-space-lg);
  border-top: 1px dashed var(--crm-border-light);
}

/* 2. Card base + action-type left borders */
.follow-up-card {
  background: var(--crm-bg-card);
  border: 1px solid var(--crm-border);
  border-left-width: 4px;
  border-radius: var(--crm-radius-md);
  padding: var(--crm-space-md);
  display: flex;
  flex-direction: column;
  gap: var(--crm-space-md);
  transition: box-shadow 150ms ease-out;
}
.follow-up-card:hover { box-shadow: var(--crm-shadow-sm); }

.follow-up-card--email     { border-left-color: var(--crm-info); }    /* #2b6cb0 */
.follow-up-card--sms       { border-left-color: #7c3aed; }             /* violet (matches .activity-meeting) */
.follow-up-card--callback  { border-left-color: var(--crm-accent); }   /* #c67f40 */
.follow-up-card--sequence  { border-left-color: var(--crm-success); }  /* #2d8a56 */

/* 3. Card header + identity + meta (typography locked to 4 sizes) */
.follow-up-card-header {
  display: flex;
  flex-wrap: wrap;
  gap: var(--crm-space-sm);
  align-items: center;
}
.follow-up-card-identity {
  font-family: var(--crm-font-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--crm-text-primary);
}
.follow-up-card-meta {
  font-family: var(--crm-font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--crm-text-muted);
}
.follow-up-card-summary {
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--crm-text-primary);
}

/* 4. Quoted-request pull-quote (LOAD-BEARING per UI-SPEC lines 70-79) */
.follow-up-card-quoted-request {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.55;
  font-style: italic;
  border-left: 3px solid var(--crm-accent);
  padding: var(--crm-space-sm) var(--crm-space-md); /* 12px left inset via md token */
  background: var(--crm-bg-hover);
  margin: 0;
  border-radius: 0 var(--crm-radius-sm) var(--crm-radius-sm) 0;
}

/* 5. Priority + status chips (semantic colors from UI-SPEC lines 111-121) */
.follow-up-chip {
  display: inline-flex;
  align-items: center;
  padding: var(--crm-space-xs) var(--crm-space-sm);
  border-radius: var(--crm-radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.follow-up-chip--priority-high    { background: #fee2e2; color: var(--crm-danger); }
.follow-up-chip--priority-medium  { background: #fef3c7; color: var(--crm-warning); }
.follow-up-chip--priority-low     { background: #e6f2ff; color: var(--crm-info); }

.follow-up-chip--status-pending   { background: var(--crm-accent-light); color: var(--crm-accent-hover); }
.follow-up-chip--status-approved  { background: #e6f5ed; color: var(--crm-success); }
.follow-up-chip--status-rejected  { background: #fdedec; color: var(--crm-danger); }
.follow-up-chip--status-expired   { background: #f0f0f3; color: var(--crm-text-muted); }
.follow-up-chip--status-snoozed   { background: #ede9fe; color: #7c3aed; }

/* 6. Action preview variants */
.follow-up-action-preview {
  background: var(--crm-bg-hover);
  border-radius: var(--crm-radius-md);
  padding: var(--crm-space-md);
}
.preview--email .preview-subject-value {
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.preview-subject-label,
.preview-body-separator,
.preview-sms-counter,
.preview-sequence-help {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--crm-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.preview-body-separator {
  border: none;
  border-top: 1px solid var(--crm-border);
  margin: var(--crm-space-sm) 0;
}
.preview-email-body {
  max-height: 240px;
  overflow-y: auto;
  padding: var(--crm-space-md);
  background: var(--crm-bg-card);
  border-radius: var(--crm-radius-md);
  font-size: 0.875rem;
  line-height: 1.5;
}
.preview-sms-body {
  font-family: var(--crm-font-mono);
  font-size: 1rem;
  line-height: 1.5;
  white-space: pre-wrap;
}
.preview-sms-counter {
  font-family: var(--crm-font-mono);
  text-align: right;
  margin-top: var(--crm-space-xs);
  text-transform: none;
  letter-spacing: normal;
}
.preview-sms-counter--warning { color: var(--crm-warning); }
.preview-sms-counter--danger  { color: var(--crm-danger); }

.preview--callback .preview-callback-time-primary {
  font-family: var(--crm-font-mono);
  font-size: 1rem;
  font-weight: 600;
}
.preview--callback .preview-callback-time-secondary {
  font-family: var(--crm-font-mono);
  font-size: 0.75rem;
  color: var(--crm-text-muted);
}
.preview--sequence .preview-sequence-name {
  font-size: 1rem;
  font-weight: 600;
}

/* 7. Card action row + edit-inline form */
.follow-up-card-actions {
  display: flex;
  gap: var(--crm-space-sm);
  flex-wrap: wrap;
}
.follow-up-card-edit-form {
  display: flex;
  flex-direction: column;
  gap: var(--crm-space-sm);
}
.follow-up-card-edit-form textarea.crm-input {
  font-family: var(--crm-font-mono);
  min-height: 120px;
  resize: vertical;
}
.follow-up-card-edit-form .crm-input--dirty {
  border-color: var(--crm-warning);
  box-shadow: 0 0 0 1px var(--crm-warning);
}

/* 8. Auto-reject banner */
.auto-reject-banner {
  background: #fef2f2;
  border: 1px solid var(--crm-danger);
  border-radius: var(--crm-radius-md);
  padding: var(--crm-space-md);
  color: var(--crm-danger);
}
.auto-reject-banner-heading {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: var(--crm-space-xs);
}
.auto-reject-banner-detail {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--crm-text-muted);
}

/* 9. Rejection modal */
.rejection-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.rejection-modal {
  width: 480px; max-width: 90vw;
  background: var(--crm-bg-card);
  border-radius: var(--crm-radius-lg);
  box-shadow: var(--crm-shadow-lg);
  padding: var(--crm-space-lg);
}
.rejection-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 1rem; font-weight: 600;
  margin-bottom: var(--crm-space-md);
}
.rejection-modal-body { display: flex; flex-direction: column; gap: var(--crm-space-sm); }
.rejection-modal-body label {
  display: flex; align-items: center; gap: var(--crm-space-sm);
  font-size: 0.875rem; font-weight: 400;
}
.rejection-modal-footer {
  display: flex; justify-content: flex-end; gap: var(--crm-space-sm);
  margin-top: var(--crm-space-lg);
}

/* 10. Sidebar badge (copper, NOT red) */
.follow-up-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--crm-accent);
  color: #ffffff;
  border-radius: 50%;
  width: 18px; height: 18px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  margin-left: var(--crm-space-sm);
  flex-shrink: 0;
}

/* 11. Transcript pane + recording */
.follow-up-transcript-pane {
  background: var(--crm-bg-hover);
  border-top: 1px solid var(--crm-border-light);
  padding: var(--crm-space-md);
  max-height: 300px;
  overflow-y: auto;
  font-size: 0.875rem;
  line-height: 1.6;
  white-space: pre-wrap;
}
.follow-up-transcript-pane audio {
  width: 100%; max-width: 400px; height: 36px;
  margin-bottom: var(--crm-space-sm);
}

/* 12. Admin rejection dashboard */
.rejection-dashboard-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--crm-space-md);
  margin-bottom: var(--crm-space-lg);
}
.rejection-dashboard-metric-card {
  background: var(--crm-bg-card);
  border: 1px solid var(--crm-border-light);
  border-radius: var(--crm-radius-md);
  padding: var(--crm-space-lg);
  text-align: center;
}
.rejection-dashboard-metric-value {
  font-family: var(--crm-font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--crm-accent);
  line-height: 1.2;
}
.rejection-dashboard-metric-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--crm-text-muted);
  text-transform: uppercase;
  margin-top: var(--crm-space-xs);
}
.rejection-dashboard-taxonomy-chart { display: flex; flex-direction: column; gap: var(--crm-space-xs); }
.rejection-chart-row {
  display: flex; align-items: center; gap: var(--crm-space-md);
  padding: var(--crm-space-xs) 0;
}
.rejection-chart-label { flex: 0 0 180px; font-size: 0.875rem; color: var(--crm-text-primary); }
.rejection-chart-track { flex: 1; height: 16px; background: var(--crm-accent-light); border-radius: var(--crm-radius-sm); overflow: hidden; }
.rejection-chart-fill  { height: 100%; background: var(--crm-accent); }
.rejection-chart-count { flex: 0 0 auto; font-family: var(--crm-font-mono); font-size: 0.75rem; color: var(--crm-text-muted); min-width: 80px; text-align: right; }
.rejection-dashboard-window-toggle {
  display: inline-flex; gap: var(--crm-space-xs);
}
.rejection-dashboard-window-toggle .pill {
  padding: var(--crm-space-xs) var(--crm-space-md);
  border: 1px solid var(--crm-border);
  border-radius: 999px;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}
.rejection-dashboard-window-toggle .pill.active {
  background: var(--crm-accent);
  color: #fff;
  border-color: var(--crm-accent);
}

/* 13. Motion */
.follow-up-card.dismissing {
  opacity: 0.4;
  transform: translateX(8px);
  transition: opacity 150ms ease-out, transform 150ms ease-out;
}
.rejection-modal-overlay { animation: fu-fade-in 120ms ease-out; }
.rejection-modal         { animation: fu-modal-in 160ms ease-out; }
@keyframes fu-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fu-modal-in {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

/* 14. Responsive */
@media (max-width: 768px) {
  .follow-up-filters { flex-direction: column; }
  .follow-up-card { padding: var(--crm-space-sm); }
  .rejection-dashboard-summary { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .follow-up-card-header { gap: var(--crm-space-xs); }
  .rejection-dashboard-summary { grid-template-columns: 1fr; }
  .rejection-chart-label { flex: 0 0 120px; }
  .follow-up-card-actions .crm-btn {
    /* Icon-only on mobile per UI-SPEC line 631 — text hidden via span.label */
  }
  .follow-up-card-actions .crm-btn .label { display: none; }
}

/* 15. Focus ring override (UI-SPEC line 615) */
.follow-up-card .crm-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--crm-bg-card), 0 0 0 5px var(--crm-accent);
}
