/* ── EPW CRM Page (contacts.css) ──────────────────────────────────────────── */

/* Toolbar */
.cts-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

.cts-search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 340px;
}
.cts-search {
  width: 100%;
  padding: 6px 10px;
  background: #f8fafc;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  color: #1e293b;
  font-size: 0.8rem;
  box-sizing: border-box;
}
.cts-search::placeholder { color: #94a3b8; }
.cts-search:focus { outline: none; border-color: #06B6D4; }

/* Typeahead suggest dropdown */
.cts-suggest-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #06B6D4;
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 200;
  max-height: 360px;
  overflow-y: auto;
}
.cts-suggest-label {
  padding: 6px 12px 4px;
  font-size: 0.65rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cts-suggest-empty {
  padding: 12px;
  font-size: 0.75rem;
  color: #94a3b8;
  text-align: center;
}
.cts-suggest-item {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.1s;
}
.cts-suggest-item:last-child { border-bottom: none; }
.cts-suggest-item:hover { background: #f0f9ff; }
.cts-suggest-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cts-suggest-name mark {
  background: #fef3c7;
  color: #92400e;
  padding: 0 1px;
  border-radius: 2px;
}
.cts-suggest-sub {
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cts-filter-pills {
  display: flex;
  gap: 4px;
}

.cts-pill {
  padding: 4px 10px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.cts-pill:hover { border-color: #06B6D4; color: #0e7490; }
.cts-pill--active {
  background: #06B6D4;
  border-color: #06B6D4;
  color: #ffffff;
}

.cts-stat {
  color: #94a3b8;
  font-size: 0.75rem;
  white-space: nowrap;
  margin-left: 4px;
}

.cts-action-btn {
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}
.cts-add-btn { background: #06B6D4; color: #ffffff; }
.cts-add-btn:hover { background: #0891B2; }
.cts-sync-btn { background: #f1f5f9; color: #64748b; border: 1px solid #cbd5e1; }
.cts-sync-btn:hover { color: #1e293b; border-color: #94a3b8; }
.cts-sync-btn:disabled { opacity: 0.5; cursor: default; }

/* Alphabet nav */
.cts-alpha-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}
.cts-alpha-btn {
  padding: 3px 6px;
  background: none;
  border: 1px solid transparent;
  border-radius: 3px;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  min-width: 22px;
  text-align: center;
  transition: all 0.1s;
  line-height: 1.4;
}
.cts-alpha-btn:hover { background: #e0f2fe; color: #0e7490; border-color: #bae6fd; }
.cts-alpha-btn--active {
  background: #06B6D4;
  border-color: #06B6D4;
  color: #ffffff;
}
.cts-alpha-btn--all {
  color: #94a3b8;
  border-color: #e2e8f0;
  background: #fff;
  margin-right: 6px;
}
.cts-alpha-btn--all.cts-alpha-btn--active { background: #06B6D4; color: #fff; border-color: #06B6D4; }

/* Body layout */
.cts-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* List panel */
.cts-list-panel {
  width: 300px;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e2e8f0;
  background: #f8fafc;
  overflow: hidden;
}

.cts-list {
  flex: 1;
  overflow-y: auto;
}

.cts-empty {
  padding: 24px 16px;
  color: #94a3b8;
  font-size: 0.8rem;
  text-align: center;
}
.cts-empty--error { color: #ef4444; }

.cts-contact-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #e2e8f0;
  cursor: pointer;
  transition: background 0.1s;
  background: #ffffff;
}
.cts-contact-row:hover { background: #f0f9ff; }
.cts-row--active { background: #e0f2fe !important; }

.cts-avatar {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  background: #0e7490;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
}

.cts-row-info {
  flex: 1;
  min-width: 0;
}
.cts-row-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cts-row-sub {
  font-size: 0.7rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.cts-row-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 3px;
}

.cts-tag-pill {
  display: inline-block;
  padding: 1px 6px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.62rem;
  color: #64748b;
}

.cts-row-badges {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-end;
}

.cts-badge {
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.62rem;
  font-weight: 700;
}
.cts-badge--wa { background: #dcfce7; color: #166534; }
.cts-badge--dq { background: #f1f5f9; color: #64748b; border: 1px solid #cbd5e1; }

/* Pagination */
.cts-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
}
.cts-page-btn {
  padding: 4px 10px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  color: #64748b;
  font-size: 0.7rem;
  cursor: pointer;
}
.cts-page-btn:disabled { opacity: 0.4; cursor: default; }
.cts-page-btn:hover:not(:disabled) { color: #1e293b; }
.cts-page-info { font-size: 0.7rem; color: #94a3b8; }

/* Resizer handle */
.cts-resizer {
  width: 5px;
  cursor: col-resize;
  background: #e2e8f0;
  flex-shrink: 0;
  transition: background 0.15s;
}
.cts-resizer:hover,
.cts-resizer:active {
  background: #06B6D4;
}

/* Detail panel */
.cts-detail-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: #F9FAFB;
}

.cts-detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
  color: #94a3b8;
  font-size: 0.85rem;
}
.cts-empty-icon { font-size: 2.5rem; opacity: 0.3; }

/* Detail header */
.cts-detail-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}
.cts-detail-avatar {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 50%;
  background: #0e7490;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
}
.cts-detail-header-info { flex: 1; min-width: 0; }
.cts-detail-name {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
}
.cts-detail-subtitle {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 2px;
}

/* Quick actions */
.cts-quick-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.cts-quick-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
}
.cts-quick-btn:hover { background: #e0f2fe; color: #0e7490; }
.cts-quick-btn--disabled { opacity: 0.3; cursor: default; }

/* Tabs removed — single scroll layout used instead */

/* Tab content — now single scroll */
.cts-detail-tab-content,
.cts-single-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Section headings — divide the vertical scroll */
.cts-section-heading {
  font-size: 0.68rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 18px 0 7px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #e2e8f0;
  margin-top: 4px;
}
.cts-single-scroll > .cts-profile-form + .cts-section-heading:first-of-type,
.cts-section-heading:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}
.cts-section-count {
  background: #e0f2fe;
  color: #0369a1;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 0.65rem;
}

/* Profile form */
.cts-profile-form { display: flex; flex-direction: column; gap: 12px; }

.cts-field-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cts-field-row label {
  font-size: 0.68rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cts-field-row .cts-field-input {
  display: block;
}
.cts-field-row input,
.cts-field-row textarea {
  padding: 7px 10px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  color: #1e293b;
  font-size: 0.82rem;
  font-family: inherit;
  resize: vertical;
  width: 100%;
  box-sizing: border-box;
}
.cts-field-row input:focus,
.cts-field-row textarea:focus {
  outline: none;
  border-color: #06B6D4;
}
.cts-field-row span {
  font-size: 0.82rem;
  color: #1e293b;
  padding: 7px 0;
}

/* Furled (collapsed) empty fields */
.cts-field--furled {
  cursor: pointer;
  border-bottom: 1px dashed #e2e8f0;
  padding-bottom: 4px;
}
.cts-field--furled label {
  cursor: pointer;
}
.cts-field--furled label::after {
  content: ' +';
  color: #06B6D4;
  font-weight: 400;
  font-size: 0.72rem;
}
.cts-field--furled .cts-field-input {
  display: none;
}

.cts-profile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1px solid #e2e8f0;
}
.cts-dq-label { font-size: 0.75rem; color: #94a3b8; }
.cts-dq-label strong { color: #06B6D4; }

/* Buttons */
.cts-btn {
  padding: 7px 16px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-block;
}
.cts-btn--primary { background: #06B6D4; color: #ffffff; }
.cts-btn--primary:hover { background: #0891B2; }
.cts-btn--ghost { background: #f1f5f9; color: #64748b; border: 1px solid #cbd5e1; }
.cts-btn--ghost:hover { color: #1e293b; }

/* Activity tab */
.cts-activity-list { display: flex; flex-direction: column; gap: 10px; }
.cts-activity-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 14px;
}
.cts-activity-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.cts-activity-source {
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 700;
}
.cts-activity-source--wa { background: #dcfce7; color: #166534; }
.cts-activity-date { font-size: 0.7rem; color: #94a3b8; }
.cts-activity-subject { font-size: 0.78rem; color: #1e293b; font-weight: 600; margin-bottom: 3px; }
.cts-activity-preview { font-size: 0.75rem; color: #64748b; }

/* DF2026 tab */
.cts-df-card { display: flex; flex-direction: column; gap: 10px; }
.cts-df-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #06B6D4;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.cts-df-headshot img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e2e8f0;
}

/* Add Contact Modal */
.cts-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cts-modal {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  width: 480px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
.cts-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e293b;
}
.cts-modal-close {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 6px;
}
.cts-modal-close:hover { color: #1e293b; }
.cts-modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cts-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid #e2e8f0;
}

/* Score badges in detail header */
.cts-score-badges {
  display: flex;
  gap: 6px;
  margin-top: 5px;
  flex-wrap: wrap;
}
.cts-score-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
}
.cts-score-badge--dq { background: #e0f2fe; color: #0369a1; }
.cts-score-badge--empathy { background: #f3e8ff; color: #7c3aed; }
.cts-score-label { font-size: 0.6rem; font-weight: 600; opacity: 0.75; text-transform: uppercase; }

/* Merge warning banner */
.cts-merge-banner {
  background: #fef3c7;
  border-bottom: 1px solid #fcd34d;
  color: #92400e;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 8px 24px;
}

/* Org card (in profile tab) */
.cts-org-card {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 4px;
}
.cts-org-card--intel {
  background: #f8fafc;
  border-color: #e2e8f0;
}
.cts-org-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e293b;
}
.cts-org-meta {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 2px;
}
.cts-org-domain { color: #64748b; }
.cts-org-link { color: #0369a1; text-decoration: none; }
.cts-org-link:hover { text-decoration: underline; }
.cts-org-notes {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 5px;
  font-style: italic;
}

/* Comms tab */
.cts-comms-list { display: flex; flex-direction: column; gap: 10px; }
.cts-comms-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 14px;
}
.cts-comms-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}
.cts-comms-source {
  padding: 1px 7px;
  border-radius: 3px;
  font-size: 0.63rem;
  font-weight: 700;
}
.cts-comms-source--wa { background: #dcfce7; color: #166534; }
.cts-comms-source--detected { background: #f1f5f9; color: #64748b; }
.cts-comms-source--composed { background: #fef3c7; color: #92400e; }
.cts-comms-source--sent { background: #dbeafe; color: #1d4ed8; }
.cts-comms-date { font-size: 0.7rem; color: #94a3b8; }
.cts-comms-subject { font-size: 0.8rem; font-weight: 600; color: #1e293b; margin-bottom: 3px; }
.cts-comms-preview { font-size: 0.75rem; color: #64748b; }
.cts-empathy-tier-badge { font-size: 0.63rem; padding: 1px 6px; background: #f3e8ff; color: #7c3aed; border-radius: 3px; font-weight: 700; }
.cts-empathy-nugget { font-size: 0.75rem; color: #6d28d9; margin-top: 6px; background: #faf5ff; padding: 5px 8px; border-radius: 4px; border-left: 2px solid #a78bfa; }
.cts-draft-preview { font-size: 0.72rem; color: #94a3b8; margin-top: 5px; font-style: italic; white-space: pre-wrap; }

/* Intelligence tab */
.cts-intel-tab { display: flex; flex-direction: column; gap: 16px; }
.cts-intel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 24px;
  color: #94a3b8;
  font-size: 0.82rem;
  text-align: center;
}
.cts-intel-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 4px;
}

/* Watch grid */
.cts-intel-watch-grid {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 8px;
}
.cts-intel-kv {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
}
.cts-intel-k {
  min-width: 70px;
  color: #94a3b8;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}
.cts-intel-v { color: #1e293b; display: flex; align-items: center; gap: 8px; }
.cts-intel-keywords { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.cts-intel-keyword {
  padding: 2px 8px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 0.67rem;
  color: #475569;
}
.cts-intel-notes {
  margin-top: 8px;
  font-size: 0.75rem;
  color: #64748b;
  font-style: italic;
  border-top: 1px solid #f1f5f9;
  padding-top: 7px;
}

/* Priority bar */
.cts-priority-bar {
  display: inline-block;
  width: 60px;
  height: 5px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  vertical-align: middle;
}
.cts-priority-fill { height: 100%; background: #7c3aed; border-radius: 3px; }

/* DISC badge */
.cts-disc-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
}
.cts-disc-d { background: #fee2e2; color: #991b1b; }
.cts-disc-i { background: #fef3c7; color: #92400e; }
.cts-disc-s { background: #dcfce7; color: #166534; }
.cts-disc-c { background: #dbeafe; color: #1d4ed8; }

/* Signals */
.cts-signal-list { display: flex; flex-direction: column; gap: 8px; }
.cts-signal-item {
  border-left: 3px solid #e2e8f0;
  padding-left: 10px;
}
.cts-signal-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 3px;
  flex-wrap: wrap;
}
.cts-signal-source {
  font-size: 0.63rem;
  font-weight: 700;
  padding: 1px 6px;
  background: #f1f5f9;
  border-radius: 3px;
  color: #64748b;
}
.cts-signal-type { font-size: 0.67rem; color: #94a3b8; }
.cts-signal-date { font-size: 0.67rem; color: #94a3b8; margin-left: auto; }
.cts-signal-rel { font-size: 0.67rem; color: #7c3aed; font-weight: 600; }
.cts-signal-headline { font-size: 0.78rem; font-weight: 600; color: #1e293b; }
.cts-signal-detail { font-size: 0.73rem; color: #64748b; margin-top: 2px; }
.cts-signal-link { font-size: 0.68rem; color: #0369a1; text-decoration: none; margin-top: 2px; display: inline-block; }
.cts-signal-link:hover { text-decoration: underline; }

/* DQ block */
.cts-dq-block { display: flex; flex-direction: column; gap: 8px; }
.cts-dq-score-row { display: flex; align-items: center; gap: 10px; }
.cts-dq-number { font-size: 1.5rem; font-weight: 800; }
.cts-dq-slash { font-size: 0.8rem; color: #94a3b8; }
.cts-dq-bar-wrap { flex: 1; height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
.cts-dq-bar-fill { height: 100%; border-radius: 3px; transition: width 0.4s; }
.cts-hygiene-flags { display: flex; gap: 5px; flex-wrap: wrap; }
.cts-hygiene-flag {
  padding: 2px 8px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 10px;
  font-size: 0.65rem;
  color: #92400e;
  font-weight: 600;
}
.cts-merged-note { font-size: 0.75rem; color: #dc2626; font-weight: 600; }

/* Merge list */
.cts-merge-list { display: flex; flex-direction: column; gap: 6px; }
.cts-merge-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  padding: 6px 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 5px;
}
.cts-merge-role {
  font-size: 0.63rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
}
.cts-merge-role--winner { background: #dcfce7; color: #166534; }
.cts-merge-role--loser { background: #fee2e2; color: #991b1b; }
.cts-merge-name { font-weight: 600; color: #1e293b; flex: 1; }
.cts-merge-type { font-size: 0.67rem; color: #94a3b8; }
.cts-merge-conf { font-size: 0.67rem; color: #7c3aed; font-weight: 600; }

/* Toast */
.cts-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0e7490;
  color: #fff;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: cts-fadein 0.2s ease;
}
.cts-toast--error { background: #dc2626; }

@keyframes cts-fadein {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Category filter dropdown in toolbar */
.cts-category-select {
  padding: 5px 8px;
  background: #f8fafc;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  color: #1e293b;
  font-size: 0.75rem;
  cursor: pointer;
  max-width: 160px;
}
.cts-category-select:focus { outline: none; border-color: #06B6D4; }

/* Category edit select in detail panel */
.cts-category-edit {
  padding: 7px 10px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  color: #1e293b;
  font-size: 0.82rem;
  font-family: inherit;
  width: 100%;
}
.cts-category-edit:focus { outline: none; border-color: #06B6D4; }

/* Engagement badge on list rows */
.cts-badge--eng {
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.6rem;
  font-weight: 700;
  white-space: nowrap;
}

/* Category pill on list rows */
.cts-cat-pill {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 0.6rem;
  font-weight: 700;
  white-space: nowrap;
}
.cts-cat--close_circle        { background: #fce7f3; color: #9d174d; }
.cts-cat--professional_network { background: #dbeafe; color: #1d4ed8; }
.cts-cat--dargan_forum         { background: #dcfce7; color: #166534; }
.cts-cat--government           { background: #e0e7ff; color: #3730a3; }
.cts-cat--media                { background: #fef3c7; color: #92400e; }
.cts-cat--client               { background: #d1fae5; color: #065f46; }
.cts-cat--vendor               { background: #fce4ec; color: #880e4f; }
.cts-cat--community            { background: #f3e8ff; color: #6d28d9; }
.cts-cat--academic             { background: #e0f2fe; color: #0e7490; }
.cts-cat--service_account      { background: #f1f5f9; color: #64748b; }
.cts-cat--automated            { background: #f1f5f9; color: #94a3b8; }

/* Engagement summary in profile */
.cts-eng-summary {
  font-size: 0.75rem;
  color: #64748b;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 4px;
}
.cts-auto-tag {
  font-size: 0.65rem;
  color: #0369a1;
  background: #e0f2fe;
  padding: 1px 5px;
  border-radius: 6px;
}

/* ── PRO-313 Integration: DQ badge on list rows ────────────────────────────── */
.cts-badge--dq {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 6px;
  min-width: 22px;
  text-align: center;
}
.cts-dq-good { background: #dcfce7; color: #166534; }
.cts-dq-fair { background: #fef3c7; color: #92400e; }
.cts-dq-poor { background: #fee2e2; color: #991b1b; }

/* ── DQ filter dropdown ─────────────────────────────────────────────────────── */
.cts-dq-filter {
  padding: 4px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.72rem;
  background: #fff;
  cursor: pointer;
}

/* ── Hygiene button in toolbar ──────────────────────────────────────────────── */
.cts-hygiene-btn {
  font-size: 0.68rem;
  color: #6b7280;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  margin-left: 4px;
}
.cts-hygiene-btn:hover { background: #e5e7eb; color: #111; }
.cts-hygiene-btn:empty { display: none; }

/* ── Merge action buttons ───────────────────────────────────────────────────── */
.cts-merge-item {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 6px;
  background: #fafafa;
}
.cts-merge-top {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
}
.cts-merge-type {
  font-size: 0.65rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
}
.cts-merge-reason {
  font-size: 0.68rem;
  color: #374151;
}
.cts-merge-names {
  font-size: 0.72rem;
  color: #111;
  margin-bottom: 6px;
}
.cts-merge-actions {
  display: flex;
  gap: 6px;
}
.cts-btn--sm {
  font-size: 0.65rem;
  padding: 3px 10px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  cursor: pointer;
  background: #fff;
}
.cts-btn--approve { color: #166534; border-color: #86efac; }
.cts-btn--approve:hover { background: #dcfce7; }
.cts-btn--reject { color: #991b1b; border-color: #fca5a5; }
.cts-btn--reject:hover { background: #fee2e2; }
.cts-btn--delete { color: #7f1d1d; border-color: #dc2626; font-size: 0.65rem; }
.cts-btn--delete:hover { background: #fecaca; }
.cts-merge-status {
  font-size: 0.65rem;
  color: #6b7280;
  font-style: italic;
}
.cts-merge-banner {
  background: #fef3c7;
  color: #92400e;
  padding: 8px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  border-bottom: 1px solid #fde68a;
}

/* ── Hygiene sub-page ──────────────────────────────────────────────────────── */
.cts-hygiene-page {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cts-hyg-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  margin-top: 12px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}
.cts-hyg-title { font-size: 1.1rem; font-weight: 700; color: #1e293b; margin: 0; }
.cts-hyg-summary { font-size: 0.75rem; color: #64748b; margin-left: auto; }
.cts-hyg-body {
  display: flex;
  gap: 16px;
  padding: 16px 20px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.cts-hyg-col { display: flex; flex-direction: column; gap: 16px; min-width: 300px; flex-shrink: 0; }
.cts-hyg-col--wide { flex: 1; min-width: 0; }
.cts-hyg-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
}
.cts-hyg-card h3 {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 10px 0;
}
.cts-hyg-hint {
  font-size: 0.68rem;
  color: #94a3b8;
  margin: 0 0 12px 0;
}
.cts-hyg-loading, .cts-hyg-error, .cts-hyg-empty {
  padding: 40px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.82rem;
}
.cts-hyg-error { color: #dc2626; }

/* DQ histogram bars */
.cts-hyg-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.cts-hyg-bar-label {
  font-size: 0.68rem;
  color: #374151;
  width: 120px;
  flex-shrink: 0;
  text-align: right;
}
.cts-hyg-bar-track {
  flex: 1;
  height: 14px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
}
.cts-hyg-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}
.cts-hyg-bar-count {
  font-size: 0.68rem;
  color: #6b7280;
  width: 50px;
  text-align: right;
  flex-shrink: 0;
}

/* Pipeline phase rows */
.cts-hyg-phase-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
}
.cts-hyg-phase-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: #1e293b;
  width: 100px;
}
.cts-hyg-phase-last {
  font-size: 0.65rem;
  color: #94a3b8;
  flex: 1;
}
.cts-hyg-phase-affected {
  font-size: 0.65rem;
  color: #6b7280;
}

/* Merge review rows */
.cts-hyg-merge-list {
  max-height: calc(100vh - 280px);
  overflow-y: auto;
}
.cts-hyg-merge-group {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  margin-bottom: 6px;
  background: #fff;
  transition: opacity 0.3s;
}
.cts-hyg-group-header {
  display: flex;
  align-items: center;
  flex-direction: row-reverse;
  justify-content: flex-end;
  padding: 8px 10px;
  cursor: pointer;
}
.cts-hyg-group-header:hover { background: #f8fafc; }
.cts-hyg-merge-row {
  display: flex;
  align-items: center;
  flex-direction: row-reverse;
  justify-content: flex-end;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  margin-bottom: 4px;
  background: #fff;
  transition: opacity 0.3s;
}
.cts-hyg-merge-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.cts-hyg-merge-names { font-size: 0.75rem; color: #1e293b; font-weight: 500; }
.cts-hyg-merge-reason { font-size: 0.65rem; color: #94a3b8; }
.cts-hyg-merge-actions { display: flex; gap: 6px; flex-shrink: 0; margin-right: 10px; }
.cts-hyg-group-keep { font-weight: 600; color: #166534; font-size: 0.65rem; }
.cts-hyg-group-merge { font-weight: 600; color: #6b7280; font-size: 0.65rem; margin-left: 6px; }
.cts-hyg-more { font-size: 0.68rem; color: #94a3b8; text-align: center; padding: 10px 0; }
.cts-hyg-bulk-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e7eb;
}

/* Expandable contact detail within merge group */
.cts-hyg-group-detail {
  border-top: 1px solid #e5e7eb;
  padding: 8px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cts-hyg-detail-loading { font-size: 0.7rem; color: #94a3b8; padding: 6px 0; }
.cts-hyg-detail-card {
  flex: 1 1 200px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 10px;
  background: #f8fafc;
  font-size: 0.72rem;
}
.cts-hyg-detail-card--winner { border-color: #86efac; background: #f0fdf4; }
.cts-hyg-detail-card--err { color: #991b1b; background: #fef2f2; border-color: #fca5a5; }
.cts-hyg-detail-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.cts-hyg-detail-card-head strong { font-size: 0.76rem; color: #1e293b; }
.cts-hyg-detail-badge {
  font-size: 0.6rem;
  padding: 1px 6px;
  border-radius: 3px;
  background: #dcfce7;
  color: #166534;
  font-weight: 500;
}
.cts-hyg-detail-badge--loser { background: #fee2e2; color: #991b1b; }
.cts-hyg-detail-fields { display: flex; flex-direction: column; gap: 2px; }
.cts-hyg-detail-field { display: flex; gap: 6px; }
.cts-hyg-detail-label { color: #94a3b8; min-width: 70px; flex-shrink: 0; }
.cts-hyg-detail-value { color: #334155; word-break: break-all; }
.cts-hyg-detail-empty { color: #cbd5e1; font-style: italic; }
