/* ============================================================
   negocios.css — Módulo Negócios v2 (Onda 3)
   Namespace: .cf-neg-*  (não conflita com mod-negocios.js legado)
   ============================================================ */

.cf-neg-shell {
  display: grid; grid-template-columns: 280px 1fr;
  height: calc(100vh - 56px);
  background: #f6f9fc;
  transition: grid-template-columns .25s ease-out;
}
.cf-neg-shell:has(.cf-neg-sb.cf-neg-sb-collapsed) {
  grid-template-columns: 56px 1fr;
}
@media (max-width:920px) { .cf-neg-shell { grid-template-columns: 1fr; } }

/* ────────────────────────────────────────
   SIDEBAR (lateral esquerda — Agrupadores + Origens)
   ──────────────────────────────────────── */

.cf-neg-sb {
  background: #fff; border-right: 1px solid #ecf0f4;
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
}
.cf-neg-sb-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid #ecf0f4;
}
.cf-neg-sb-title {
  font-size: 13px; font-weight: 600; color: #0f172a;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.cf-neg-sb-add, .cf-neg-sb-collapse-toggle {
  width: 26px; height: 26px; border: none; border-radius: 6px;
  background: transparent; cursor: pointer; color: #64748b;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.cf-neg-sb-add:hover, .cf-neg-sb-collapse-toggle:hover { background: #f1f5f9; color: #1e5baa; }

/* ── Modo Collapsed (sidebar só com ícones) ── */
.cf-neg-sb.cf-neg-sb-collapsed { width: 56px; overflow: visible; }
.cf-neg-sb.cf-neg-sb-collapsed .cf-neg-sb-title,
.cf-neg-sb.cf-neg-sb-collapsed .cf-neg-sb-add,
.cf-neg-sb.cf-neg-sb-collapsed .cf-neg-sb-search,
.cf-neg-sb.cf-neg-sb-collapsed .cf-neg-sb-grupo-name,
.cf-neg-sb.cf-neg-sb-collapsed .cf-neg-sb-origem-name,
.cf-neg-sb.cf-neg-sb-collapsed .cf-neg-sb-count,
.cf-neg-sb.cf-neg-sb-collapsed .cf-neg-sb-grupo-add,
.cf-neg-sb.cf-neg-sb-collapsed .cf-neg-sb-origem-edit,
.cf-neg-sb.cf-neg-sb-collapsed .cf-neg-sb-chevron,
.cf-neg-sb.cf-neg-sb-collapsed .cf-neg-sb-empty,
.cf-neg-sb.cf-neg-sb-collapsed .cf-neg-sb-link,
.cf-neg-sb.cf-neg-sb-collapsed .cf-neg-sb-foot span { display: none; }
.cf-neg-sb.cf-neg-sb-collapsed .cf-neg-sb-grupo-head,
.cf-neg-sb.cf-neg-sb-collapsed .cf-neg-sb-origem,
.cf-neg-sb.cf-neg-sb-collapsed .cf-neg-sb-all { justify-content: center; padding: 7px 8px; }
.cf-neg-sb.cf-neg-sb-collapsed .cf-neg-sb-origens { padding-left: 0; }
.cf-neg-sb.cf-neg-sb-collapsed .cf-neg-sb-collapse-toggle { margin: 0 auto; }
.cf-neg-sb.cf-neg-sb-collapsed .cf-neg-sb-head { justify-content: center; }

.cf-neg-sb-search {
  position: relative;
  padding: 10px 12px; border-bottom: 1px solid #ecf0f4;
}
.cf-neg-sb-search > i {
  position: absolute; left: 22px; top: 50%; transform: translateY(-50%);
  color: #94a3b8; pointer-events: none;
}
.cf-neg-sb-search input {
  width: 100%; padding: 7px 10px 7px 32px;
  border: 1px solid #e2e8f0; border-radius: 6px;
  font-size: 12.5px; color: #0f172a; background: #fafbfc;
  font-family: inherit;
}
.cf-neg-sb-search input:focus { outline: none; border-color: #1e5baa; background: #fff; }

.cf-neg-sb-tree {
  flex: 1; overflow-y: auto; padding: 8px 6px;
  display: flex; flex-direction: column; gap: 2px;
}
.cf-neg-sb-loading, .cf-neg-sb-error, .cf-neg-sb-empty-state {
  padding: 24px 12px; text-align: center; font-size: 12px; color: #94a3b8;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.cf-neg-sb-error { color: #b45309; }
.cf-neg-sb-error code { font-size: 10px; background: #fff7e6; padding: 1px 4px; border-radius: 3px; }
.cf-neg-sb-empty-title { font-size: 13px; font-weight: 600; color: #475569; }
.cf-neg-sb-empty-msg { font-size: 11px; }

.cf-neg-sb-grupo { display: flex; flex-direction: column; gap: 1px; }
.cf-neg-sb-grupo-head {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border: none; border-radius: 6px;
  background: transparent; cursor: pointer;
  font-size: 13px; font-weight: 500; color: #475569;
  text-align: left; font-family: inherit; width: 100%;
  transition: background .15s;
  position: relative;
}
.cf-neg-sb-grupo-head:hover { background: #f8fafc; color: #0f172a; }
.cf-neg-sb-chevron {
  color: #94a3b8;
  transition: transform .15s;
}
.cf-neg-sb-grupo.open .cf-neg-sb-chevron { transform: rotate(90deg); }
.cf-neg-sb-grupo-icon {
  width: 22px; height: 22px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cf-neg-sb-grupo-name { flex: 1; }
.cf-neg-sb-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 18px; padding: 0 6px;
  background: #f1f5f9; color: #64748b;
  font-size: 11px; font-weight: 600; border-radius: 9px;
}
.cf-neg-sb-count-sm { min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
.cf-neg-sb-grupo-add {
  width: 18px; height: 18px; border: none; border-radius: 4px;
  background: transparent; color: #94a3b8; cursor: pointer;
  display: none; align-items: center; justify-content: center;
  margin-left: 4px;
}
.cf-neg-sb-grupo-head:hover .cf-neg-sb-grupo-add { display: flex; }
.cf-neg-sb-grupo-add:hover { background: #e0eaff; color: #1e5baa; }

.cf-neg-sb-origens {
  display: none; flex-direction: column; gap: 1px;
  padding-left: 18px; padding-top: 2px; padding-bottom: 4px;
}
.cf-neg-sb-grupo.open .cf-neg-sb-origens { display: flex; }

.cf-neg-sb-origem {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 8px; border: none; border-radius: 5px;
  background: transparent; cursor: pointer;
  font-size: 12.5px; color: #475569;
  text-align: left; font-family: inherit; width: 100%;
  transition: background .15s, color .15s;
  position: relative;
}
.cf-neg-sb-origem:hover { background: #f8fafc; color: #0f172a; }
.cf-neg-sb-origem.on {
  background: #f0f6ff; color: #1e5baa; font-weight: 600;
}
.cf-neg-sb-origem-icon {
  width: 18px; height: 18px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cf-neg-sb-origem-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-neg-sb-origem-edit {
  width: 18px; height: 18px; border: none; border-radius: 3px;
  background: transparent; color: #94a3b8; cursor: pointer;
  display: none; align-items: center; justify-content: center;
}
.cf-neg-sb-origem:hover .cf-neg-sb-origem-edit { display: flex; }
.cf-neg-sb-origem-edit:hover { background: #e0eaff; color: #1e5baa; }

.cf-neg-sb-empty {
  padding: 8px 10px; font-size: 11px; color: #94a3b8; font-style: italic;
}
.cf-neg-sb-link {
  background: transparent; border: none; cursor: pointer;
  color: #1e5baa; font-size: 11px; padding: 0; font-family: inherit;
}
.cf-neg-sb-link:hover { text-decoration: underline; }

.cf-neg-sb-foot {
  padding: 10px 12px; border-top: 1px solid #ecf0f4;
}
.cf-neg-sb-all {
  display: flex; align-items: center; gap: 7px;
  width: 100%; padding: 8px 10px; border: 1px solid transparent;
  border-radius: 6px; background: transparent; cursor: pointer;
  font-size: 12.5px; color: #475569; font-weight: 500;
  text-align: left; font-family: inherit;
  transition: background .15s, color .15s;
}
.cf-neg-sb-all:hover { background: #f8fafc; }
.cf-neg-sb-all.on { background: #f0f6ff; color: #1e5baa; border-color: #bfdbfe; }

/* ────────────────────────────────────────
   MAIN (Kanban)
   ──────────────────────────────────────── */

.cf-neg-main { overflow: hidden; display: flex; flex-direction: column; }
.cf-neg-loading, .cf-neg-empty {
  padding: 48px 24px; text-align: center; color: #64748b;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 13px;
}
.cf-neg-empty-title { font-size: 15px; font-weight: 600; color: #0f172a; margin-top: 8px; }
.cf-neg-empty-msg { font-size: 12.5px; max-width: 420px; line-height: 1.5; }
.cf-neg-empty-msg code { background: #f1f5f9; padding: 1px 6px; border-radius: 3px; font-family: 'IBM Plex Mono', monospace; font-size: 11px; }
.cf-neg-spin { animation: cf-neg-spin 1s linear infinite; }
@keyframes cf-neg-spin { to { transform: rotate(360deg); } }

.cf-neg-kanban {
  display: flex; flex-direction: column; height: 100%;
}
.cf-neg-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 22px; background: #fff;
  border-bottom: 1px solid #ecf0f4;
  gap: 14px; flex-wrap: wrap;
}
.cf-neg-head-left { display: flex; align-items: center; gap: 12px; }
.cf-neg-head-icon {
  width: 38px; height: 38px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
}
.cf-neg-head-title { font-size: 17px; font-weight: 600; color: #0f172a; font-family: 'IBM Plex Sans', sans-serif; }
.cf-neg-head-sub { font-size: 11.5px; color: #94a3b8; margin-top: 2px; }
.cf-neg-head-actions { display: flex; gap: 8px; align-items: center; }

.cf-neg-input, .cf-neg-textarea {
  padding: 8px 11px; border: 1px solid #e2e8f0; border-radius: 6px;
  font-size: 13px; color: #0f172a; background: #fff;
  font-family: inherit; transition: border-color .15s;
}
.cf-neg-input:focus, .cf-neg-textarea:focus { outline: none; border-color: #1e5baa; }
.cf-neg-input-sm { padding: 6px 9px; font-size: 12px; }
.cf-neg-textarea { resize: vertical; min-height: 70px; line-height: 1.5; }

.cf-neg-search {
  position: relative;
  display: flex; align-items: center;
}
.cf-neg-search > i {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  color: #94a3b8;
}
.cf-neg-search input {
  padding: 7px 10px 7px 28px; border: 1px solid #e2e8f0; border-radius: 6px;
  font-size: 12.5px; min-width: 200px; background: #fff;
  font-family: inherit;
}

.cf-neg-btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  background: #1e5baa; color: #fff; border: none;
  padding: 8px 13px; border-radius: 6px;
  font-size: 12.5px; font-weight: 500; cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.cf-neg-btn-primary:hover { background: #16498f; }

/* Board */
.cf-neg-board {
  flex: 1; display: flex; gap: 14px; padding: 18px 22px;
  overflow-x: auto; overflow-y: hidden;
}
.cf-neg-col {
  flex: 0 0 280px; display: flex; flex-direction: column; min-height: 0;
  background: #f1f5f9; border-radius: 9px;
  border: 1px solid #ecf0f4;
}
.cf-neg-col-over { border-color: #1e5baa; background: #f0f6ff; }
.cf-neg-col-head {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 12px; border-bottom: 1px solid #e2e8f0;
}
.cf-neg-col-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cf-neg-col-name { font-size: 12.5px; font-weight: 600; color: #0f172a; flex: 1; }
.cf-neg-col-count { font-size: 11px; color: #64748b; background: #fff; padding: 1px 7px; border-radius: 9px; font-weight: 600; }
.cf-neg-col-total { font-size: 10.5px; color: #475569; font-family: 'IBM Plex Mono', monospace; }

.cf-neg-col-body {
  flex: 1; overflow-y: auto; padding: 8px;
  display: flex; flex-direction: column; gap: 6px;
}
.cf-neg-col-empty {
  padding: 24px 12px; text-align: center; font-size: 11px; color: #94a3b8;
  border: 1px dashed #e2e8f0; border-radius: 6px;
}

/* Card */
.cf-neg-card {
  background: #fff; border: 1px solid #e8edf2; border-radius: 7px;
  padding: 10px 11px; cursor: pointer;
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color .15s, transform .1s, box-shadow .15s;
}
.cf-neg-card:hover {
  border-color: #1e5baa;
  box-shadow: 0 2px 8px rgba(30,91,170,0.08);
  transform: translateY(-1px);
}
.cf-neg-card-head { display: flex; align-items: center; gap: 6px; }
.cf-neg-card-name { font-size: 12.5px; font-weight: 600; color: #0f172a; flex: 1; line-height: 1.3; }

/* M9.1: AI score badge no card kanban — discreto, cor por faixa */
.cf-neg-card-ai {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 10px; font-weight: 600;
  padding: 2px 6px; border-radius: 999px;
  font-family: 'IBM Plex Sans', sans-serif;
  flex-shrink: 0; line-height: 1;
}
.cf-neg-card-ai-fechando { background: #DCFCE7; color: #15803D; }
.cf-neg-card-ai-quente   { background: #FEF3C7; color: #B45309; }
.cf-neg-card-ai-morno    { background: #DBEAFE; color: #1D4ED8; }
.cf-neg-card-ai-frio     { background: #F1F5F9; color: #64748B; }
.cf-neg-card-ai-unknown  { background: #F8FAFC; color: #94A3B8; }
.cf-neg-card-ai i { opacity: .85; }
.cf-neg-card-value { font-size: 13px; font-weight: 600; color: #10b981; font-family: 'IBM Plex Sans', sans-serif; }
.cf-neg-card-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.cf-neg-card-tag {
  display: inline-block; padding: 1px 7px; border-radius: 9px;
  font-size: 10px; font-weight: 500;
  background: #e0eaff; color: #1e5baa;
}
.cf-neg-card-foot { display: flex; justify-content: space-between; align-items: center; }
.cf-neg-card-owner {
  width: 22px; height: 22px; border-radius: 50%;
  background: #1e5baa; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600;
}
.cf-neg-card-owner-empty { background: #e2e8f0; color: #94a3b8; }
.cf-neg-card-date { font-size: 10.5px; color: #94a3b8; }

/* ────────────────────────────────────────
   DRAWER DE NEGÓCIO
   ──────────────────────────────────────── */

.cf-deal-drawer { padding: 0; }
.cf-deal-head {
  padding: 16px 20px 0 20px; background: #fff;
  border-bottom: 1px solid #ecf0f4;
}
.cf-deal-head-top {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.cf-deal-close {
  width: 30px; height: 30px; border: none; border-radius: 6px;
  background: transparent; color: #64748b; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  margin-right: auto;
  transition: background .15s;
}
.cf-deal-close:hover { background: #f1f5f9; color: #0f172a; }

.cf-deal-origem-pill {
  font-size: 11px; font-weight: 500; padding: 3px 9px; border-radius: 11px;
}
.cf-deal-status-pill {
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 11px;
}
.cf-deal-status-aberto  { background: #dbeafe; color: #1e40af; }
.cf-deal-status-ganho   { background: #d1fae5; color: #065f46; }
.cf-deal-status-perdido { background: #fee2e2; color: #991b1b; }

.cf-deal-name-input {
  width: 100%; font-size: 19px; font-weight: 600; color: #0f172a;
  font-family: 'IBM Plex Sans', sans-serif;
  background: transparent; border: none; outline: none;
  padding: 4px 8px; border-radius: 5px; margin-left: -8px;
  transition: background .15s;
}
.cf-deal-name-input:hover, .cf-deal-name-input:focus { background: #f8fafc; }

.cf-deal-head-meta {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 12px; color: #64748b; margin: 8px 0 12px 0;
}
.cf-deal-head-meta span { display: inline-flex; align-items: center; gap: 5px; }
.cf-deal-head-meta strong { color: #0f172a; font-weight: 600; }

/* M9.3: bloco preview de mensagens da conversa vinculada */
.cf-deal-conv-preview {
  padding: 12px 18px 14px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}

/* M14.P3: bloco "Contexto CRM" da pessoa (helper cfCrmContext) */
.cf-deal-crm-context {
  padding: 12px 18px 14px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}
.cf-deal-crm-head {
  display: flex; align-items: center; gap: 6px; margin-bottom: 10px;
}
.cf-deal-crm-head strong { color: #0f172a; font-size: 12px; font-weight: 600; }
.cf-deal-crm-body { display: flex; flex-direction: column; gap: 10px; }
.cf-deal-conv-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 8px;
  font-size: 11.5px; color: #4a5670;
}
.cf-deal-conv-head > div { display: inline-flex; align-items: center; gap: 6px; }
.cf-deal-conv-head strong { color: #0f172a; font-size: 12px; font-weight: 600; }
.cf-deal-btn-link {
  background: transparent; border: 0; cursor: pointer;
  font-size: 11px; color: #1E5BAA; font-weight: 500;
  display: inline-flex; align-items: center; gap: 3px;
  padding: 4px 6px; border-radius: 4px;   /* M28: era 2px 4px (altura ~23px) → atinge mínimo 24×24 */
  min-height: 24px;
  font-family: inherit;
}
.cf-deal-btn-link:hover { background: #1E5BAA15; color: #154A8E; }

.cf-deal-conv-msgs {
  display: flex; flex-direction: column; gap: 5px;
}
.cf-deal-conv-msg {
  display: flex; align-items: flex-end; gap: 6px;
  font-size: 11.5px;
}
.cf-deal-conv-msg-out { flex-direction: row-reverse; }
.cf-deal-conv-msg-bubble {
  max-width: 80%;
  padding: 5px 9px;
  border-radius: 8px;
  line-height: 1.35;
  word-break: break-word;
}
.cf-deal-conv-msg-in  .cf-deal-conv-msg-bubble {
  background: #fff; border: 1px solid #e2e8f0; color: #0f172a;
  border-bottom-left-radius: 2px;
}
.cf-deal-conv-msg-out .cf-deal-conv-msg-bubble {
  background: #DCF8C6; color: #0f172a;
  border-bottom-right-radius: 2px;
}
.cf-deal-conv-msg-time { font-size: 9.5px; color: #94a3b8; flex-shrink: 0; }

.cf-deal-tabs {
  display: flex; gap: 0;
  overflow-x: auto;
}
.cf-deal-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 14px; border: none; background: transparent;
  cursor: pointer; font-size: 12.5px; font-weight: 500; color: #94a3b8;
  border-bottom: 2px solid transparent;
  font-family: inherit; white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.cf-deal-tab:hover { color: #475569; }
.cf-deal-tab.on { color: #1e5baa; border-bottom-color: #1e5baa; }

.cf-deal-body {
  flex: 1; overflow-y: auto;
  padding: 18px 20px;
  background: #fafbfc;
  display: flex; flex-direction: column; gap: 16px;
}
.cf-deal-section {
  background: #fff; border: 1px solid #ecf0f4; border-radius: 9px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
}
.cf-deal-section-head {
  display: flex; justify-content: space-between; align-items: center;
}
.cf-deal-section-head h4 { font-size: 13px; font-weight: 600; color: #0f172a; margin: 0; }

.cf-deal-field { display: flex; flex-direction: column; gap: 5px; }
.cf-deal-field label { font-size: 11.5px; font-weight: 500; color: #475569; }

.cf-deal-empty-card {
  padding: 24px; text-align: center; color: #64748b;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 12.5px;
}
.cf-deal-empty-card small { font-size: 11px; color: #94a3b8; max-width: 320px; line-height: 1.5; }

.cf-deal-btn-link {
  background: transparent; border: none; cursor: pointer;
  color: #1e5baa; font-size: 12px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px;
  font-family: inherit; padding: 4px 6px; border-radius: 4px;
  transition: background .15s;
}
.cf-deal-btn-link:hover { background: #f0f6ff; }

.cf-deal-foot {
  padding: 12px 18px; border-top: 1px solid #ecf0f4;
  display: flex; align-items: center; gap: 8px;
  background: #fff;
}
.cf-deal-danger { color: #dc2626; }
.cf-deal-danger:hover { background: #fee2e2 !important; }
.cf-deal-btn-won {
  background: #10b981; color: #fff; border: 1px solid #10b981;
}
.cf-deal-btn-won:hover { background: #059669; }
.cf-deal-status-msg { font-size: 12px; color: #64748b; }

/* Timeline (histórico) */
.cf-deal-timeline { display: flex; flex-direction: column; gap: 14px; position: relative; }
.cf-deal-timeline::before {
  content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px;
  width: 1px; background: #e2e8f0;
}
.cf-deal-tl-item { display: flex; gap: 10px; align-items: flex-start; position: relative; }
.cf-deal-tl-dot {
  width: 11px; height: 11px; border-radius: 50%;
  flex-shrink: 0; margin-top: 4px;
  border: 2px solid #fff; box-shadow: 0 0 0 1px #e2e8f0;
}
.cf-deal-tl-body { flex: 1; }
.cf-deal-tl-text { font-size: 12.5px; color: #0f172a; line-height: 1.5; }
.cf-deal-tl-meta { font-size: 11px; color: #94a3b8; margin-top: 2px; }

/* ────────────────────────────────────────
   DRAWER DE ORIGEM
   ──────────────────────────────────────── */

.cf-orig-drawer { padding: 0; }
.cf-orig-head {
  padding: 16px 20px 0 20px; background: #fff;
  border-bottom: 1px solid #ecf0f4;
}
.cf-orig-head-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cf-orig-head-icon {
  width: 38px; height: 38px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cf-orig-head-title-block { flex: 1; min-width: 0; }
.cf-orig-name-input {
  width: 100%; font-size: 17px; font-weight: 600; color: #0f172a;
  background: transparent; border: none; outline: none;
  padding: 4px 7px; border-radius: 5px; margin-left: -7px;
  font-family: 'IBM Plex Sans', sans-serif;
}
.cf-orig-name-input:hover, .cf-orig-name-input:focus { background: #f8fafc; }
.cf-orig-head-sub { font-size: 11.5px; color: #94a3b8; margin-top: 2px; }

.cf-orig-colors { display: flex; flex-wrap: wrap; gap: 6px; }
.cf-orig-color {
  width: 26px; height: 26px; border-radius: 6px;
  border: 2px solid transparent; cursor: pointer;
  transition: border-color .15s, transform .1s;
}
.cf-orig-color.on { border-color: #0f172a; transform: scale(1.1); }

.cf-orig-icons {
  display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px;
}
.cf-orig-icon {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: 1px solid #e2e8f0;
  border-radius: 6px; background: #fff; cursor: pointer; color: #64748b;
  transition: border-color .15s, color .15s, background .15s;
}
.cf-orig-icon:hover { border-color: #1e5baa; color: #1e5baa; }
.cf-orig-icon.on { border-color: #1e5baa; background: #f0f6ff; color: #1e5baa; }

/* Stages list */
.cf-orig-stages { display: flex; flex-direction: column; gap: 6px; }
.cf-orig-stage {
  display: flex; align-items: center; gap: 8px;
  padding: 8px; background: #f8fafc; border: 1px solid transparent; border-radius: 6px;
}
.cf-orig-stage:hover { border-color: #e2e8f0; }
.cf-orig-stage-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.cf-orig-stage-name {
  flex: 1; padding: 5px 8px; border: 1px solid transparent;
  border-radius: 4px; background: transparent; font-size: 12.5px;
  color: #0f172a; font-family: inherit;
}
.cf-orig-stage-name:focus, .cf-orig-stage-name:hover { background: #fff; border-color: #e2e8f0; outline: none; }
.cf-orig-stage-kind {
  padding: 5px 7px; border: 1px solid #e2e8f0; border-radius: 4px;
  background: #fff; font-size: 11.5px; color: #475569; font-family: inherit;
}
.cf-orig-stage-color {
  width: 26px; height: 26px; border: 1px solid #e2e8f0; border-radius: 4px;
  cursor: pointer; padding: 0;
}
.cf-orig-stage-ctrls { display: flex; gap: 2px; }
.cf-orig-stage-ctrls button {
  width: 22px; height: 22px; border: none; background: transparent;
  border-radius: 3px; cursor: pointer; color: #94a3b8;
  display: flex; align-items: center; justify-content: center;
}
.cf-orig-stage-ctrls button:hover { background: #fee2e2; color: #dc2626; }
.cf-orig-stage-ctrls button:disabled { opacity: 0.3; cursor: not-allowed; }

.cf-orig-templates {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px;
}
.cf-orig-template-card {
  display: flex; flex-direction: column; gap: 3px; align-items: flex-start;
  padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 7px;
  background: #fff; cursor: pointer;
  text-align: left; font-family: inherit;
  transition: border-color .15s, background .15s;
}
.cf-orig-template-card:hover { border-color: #1e5baa; background: #f8fbff; }
.cf-orig-template-card strong { font-size: 13px; color: #0f172a; }
.cf-orig-template-card small { font-size: 11px; color: #64748b; line-height: 1.4; }
.cf-orig-tmpl-tag {
  font-size: 10px; padding: 1px 6px; border-radius: 8px;
  background: #e0eaff; color: #1e5baa; font-weight: 500;
  margin-top: 4px;
}
.cf-orig-empty-sm { font-size: 11px; color: #94a3b8; padding: 6px; }

/* ────────────────────────────────────────
   ETAPAS BOARD (etapa = coluna mini com atividades dentro)
   ──────────────────────────────────────── */
.cf-orig-stages-board {
  display: flex; gap: 10px; overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
}
.cf-orig-stages-board > .cf-orig-stage-board { flex: 0 0 240px; scroll-snap-align: start; }
.cf-orig-stages-board::-webkit-scrollbar { height: 8px; }
.cf-orig-stages-board::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.cf-orig-stages-board::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.cf-orig-stage-board {
  background: #f8fafc; border: 1px solid #ecf0f4; border-radius: 8px;
  display: flex; flex-direction: column; min-height: 140px;
}
.cf-orig-stage-board-head {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 10px; border-bottom: 1px solid #ecf0f4;
}
.cf-orig-stage-board-title { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; color: #0f172a; }
.cf-orig-stage-board-kind {
  font-size: 9.5px; padding: 1px 6px; border-radius: 7px;
  background: #fff; border: 1px solid #e2e8f0; color: #94a3b8; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.cf-orig-stage-board-ctrls { display: flex; gap: 1px; }
.cf-orig-stage-board-btn {
  width: 20px; height: 20px; border: none; background: transparent;
  border-radius: 3px; cursor: pointer; color: #94a3b8;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.cf-orig-stage-board-btn:hover { background: #e2e8f0; color: #0f172a; }
.cf-orig-stage-board-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.cf-orig-stage-board-btn-danger:hover { background: #fee2e2; color: #dc2626; }

.cf-orig-stage-acts { padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.cf-orig-stage-empty {
  font-size: 10.5px; color: #94a3b8; font-style: italic;
  padding: 8px 4px; text-align: center;
}
.cf-orig-act {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; background: #fff; border-radius: 5px;
  font-size: 12px; color: #334155;
  position: relative;
}
.cf-orig-act-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-orig-act-req {
  font-size: 9px; padding: 1px 5px; border-radius: 3px;
  background: #fef3c7; color: #92400e; font-weight: 600;
}
.cf-orig-act-edit, .cf-orig-act-del {
  width: 18px; height: 18px; border: none; background: transparent;
  border-radius: 3px; cursor: pointer; color: #94a3b8;
  display: none; align-items: center; justify-content: center;
}
.cf-orig-act:hover .cf-orig-act-edit, .cf-orig-act:hover .cf-orig-act-del { display: flex; }
.cf-orig-act-edit:hover { background: #e0eaff; color: #1e5baa; }
.cf-orig-act-del:hover { background: #fee2e2; color: #dc2626; }

.cf-orig-act-add {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 7px; border: 1px dashed #cbd5e1; border-radius: 5px;
  background: transparent; cursor: pointer;
  font-size: 11px; color: #1e5baa; font-weight: 500;
  font-family: inherit;
  transition: border-color .15s, background .15s;
}
.cf-orig-act-add:hover { border-color: #1e5baa; background: #f0f6ff; }

/* ────────────────────────────────────────
   ATIVIDADE TYPES (no modal Nova atividade)
   ──────────────────────────────────────── */
.cf-ativ-types {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px;
}
.cf-ativ-type {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border: 1px solid #e8edf2; border-radius: 7px;
  background: #fff; cursor: pointer; text-align: left;
  font-family: inherit; transition: border-color .15s, background .15s;
}
.cf-ativ-type:hover { border-color: #1e5baa; background: #f8fbff; }
.cf-ativ-type.on { border-color: #1e5baa; background: #f0f6ff; }
.cf-ativ-type-icon {
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cf-ativ-type-text { display: flex; flex-direction: column; gap: 1px; }
.cf-ativ-type-name { font-size: 12.5px; font-weight: 600; color: #0f172a; }
.cf-ativ-type-desc { font-size: 11px; color: #94a3b8; line-height: 1.3; }

/* ────────────────────────────────────────
   DEAL DRAWER — checklist atividades
   ──────────────────────────────────────── */
.cf-deal-progress-meta { font-size: 11px; color: #64748b; font-weight: 500; }
.cf-deal-progress {
  height: 5px; background: #e2e8f0; border-radius: 3px;
  overflow: hidden;
}
.cf-deal-progress-bar {
  height: 100%; transition: width .25s ease-out;
}
.cf-deal-acts { display: flex; flex-direction: column; gap: 4px; }
.cf-deal-act {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; background: #f8fafc; border-radius: 5px;
  cursor: pointer; transition: background .15s;
}
.cf-deal-act:hover { background: #f0f6ff; }
.cf-deal-act.done { opacity: 0.6; }
.cf-deal-act.done .cf-deal-act-label { text-decoration: line-through; color: #94a3b8; }
.cf-deal-act input { cursor: pointer; }
.cf-deal-act-label { flex: 1; font-size: 12.5px; color: #0f172a; }
.cf-deal-act-req {
  font-size: 9.5px; padding: 1px 5px; border-radius: 3px;
  background: #fef3c7; color: #92400e; font-weight: 600;
}

/* ────────────────────────────────────────
   ABA INTEGRAÇÕES DA ORIGEM
   ──────────────────────────────────────── */
.cf-orig-integ-tabs {
  display: flex; gap: 2px; padding: 4px;
  background: #f1f5f9; border-radius: 7px;
  margin-bottom: 14px; align-self: flex-start;
}
.cf-orig-integ-tab {
  padding: 6px 14px; border: none; background: transparent;
  border-radius: 5px; cursor: pointer;
  font-size: 12.5px; font-weight: 500; color: #64748b;
  font-family: inherit; transition: background .15s, color .15s;
}
.cf-orig-integ-tab:hover { color: #0f172a; }
.cf-orig-integ-tab.on { background: #fff; color: #1e5baa; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }

.cf-orig-rule {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: #fff; border: 1px solid #e8edf2; border-radius: 7px;
}
.cf-orig-rule + .cf-orig-rule { margin-top: 6px; }
.cf-orig-rule-icon {
  width: 30px; height: 30px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cf-orig-rule-text { flex: 1; }
.cf-orig-rule-name { font-size: 12.5px; font-weight: 600; color: #0f172a; }
.cf-orig-rule-name small { font-weight: 400; color: #64748b; }
.cf-orig-rule-meta { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.cf-orig-rule-del {
  width: 26px; height: 26px; border: none; background: transparent;
  border-radius: 5px; cursor: pointer; color: #94a3b8;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.cf-orig-rule-del:hover { background: #fee2e2; color: #dc2626; }

.cf-orig-hist-table {
  width: 100%; border-collapse: collapse;
}
.cf-orig-hist-table th, .cf-orig-hist-table td {
  padding: 8px 10px; text-align: left; border-bottom: 1px solid #f1f5f9;
  font-size: 12px; color: #475569;
}
.cf-orig-hist-table th {
  font-weight: 600; color: #94a3b8; font-size: 10.5px;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.cf-orig-hist-table code {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  background: #f1f5f9; padding: 1px 5px; border-radius: 3px;
}
.cf-orig-hist-status {
  font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 8px;
}
.cf-orig-hist-status-success { background: #d1fae5; color: #065f46; }
.cf-orig-hist-status-error { background: #fee2e2; color: #991b1b; }
.cf-orig-hist-status-ignored { background: #f1f5f9; color: #64748b; }
.cf-orig-hist-status-duplicate { background: #fef3c7; color: #92400e; }

/* Sessão 134 / Bloco H: filtros + linha clicável + botão detalhes */
.cf-orig-hist-filters {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.cf-orig-hist-filters .cf-neg-input { min-width: 140px; }

.cf-orig-hist-row { cursor: pointer; transition: background 0.12s; }
.cf-orig-hist-row:hover { background: #f8fafc; }
.cf-orig-hist-detail {
  background: transparent; border: 1px solid #e2e8f0;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 5px;
  color: #64748b; cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.cf-orig-hist-detail:hover { background: #1E5BAA; color: #fff; border-color: #1E5BAA; }

/* Modal detalhe webhook (namespace .whd-*) */
.whd-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  padding: 32px 16px;
  animation: whd-fade-in 0.15s ease-out;
}
.whd-overlay.whd-closing { animation: whd-fade-out 0.15s ease-in forwards; }
@keyframes whd-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes whd-fade-out { from { opacity: 1; } to { opacity: 0; } }

.whd-modal {
  background: #fff; border-radius: 12px;
  width: 100%; max-width: 760px;
  max-height: calc(100vh - 64px);
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
  animation: whd-pop 0.2s cubic-bezier(.34,1.56,.64,1);
}
@keyframes whd-pop {
  from { transform: scale(0.96) translateY(8px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

.whd-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid #ecf0f4;
}
.whd-head-left { display: flex; gap: 12px; align-items: flex-start; }
.whd-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600;
  padding: 4px 9px; border-radius: 9px;
  white-space: nowrap;
}
.whd-head h3 {
  margin: 0 0 3px;
  font-size: 15px; font-weight: 600; color: #0f172a;
  font-family: 'IBM Plex Sans', sans-serif;
}
.whd-head small {
  font-size: 11.5px; color: #64748b;
}
.whd-head code {
  font-family: 'IBM Plex Mono', monospace;
  background: #f1f5f9; padding: 1px 5px; border-radius: 3px;
  font-size: 11px;
}
.whd-close {
  background: transparent; border: none;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; cursor: pointer;
  color: #64748b;
  transition: background 0.15s;
}
.whd-close:hover { background: #f1f5f9; color: #0f172a; }

.whd-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 22px;
  display: flex; flex-direction: column; gap: 14px;
  background: #f8fafc;
}

.whd-section { background: #fff; border-radius: 8px; padding: 12px 14px; }
.whd-section h4 {
  margin: 0 0 8px;
  font-size: 12px; font-weight: 600; color: #475569;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.whd-section p { margin: 0; font-size: 12.5px; color: #0f172a; line-height: 1.5; }
.whd-pre {
  margin: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px; color: #1f2937;
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px; border-radius: 6px;
  max-height: 320px; overflow: auto;
  white-space: pre-wrap; word-wrap: break-word;
}
.whd-pre-err { color: #fca5a5; background: #1f1313; }

.whd-copy-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: transparent; border: 1px solid #e2e8f0;
  padding: 3px 8px; border-radius: 4px;
  font-size: 10.5px; color: #475569;
  cursor: pointer;
  transition: background 0.15s;
}
.whd-copy-btn:hover { background: #1E5BAA; color: #fff; border-color: #1E5BAA; }

/* Sessão 134/Bloco F: dia relativo + outcome picker */
.cf-deal-act-day,
.cf-orig-act-day {
  display: inline-flex; align-items: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; font-weight: 600;
  background: #eff6ff; color: #1E5BAA;
  padding: 1px 6px; border-radius: 9px;
  margin-left: 6px;
}

.cf-deal-outcome-btn {
  display: flex; align-items: flex-start; gap: 10px;
  background: #fff; border: 1px solid #e2e8f0;
  padding: 12px 14px; border-radius: 8px;
  cursor: pointer; text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.cf-deal-outcome-btn:hover {
  border-color: var(--c, #1E5BAA);
  background: #f8fafc;
}
.cf-deal-outcome-btn strong {
  display: block; font-size: 13px; color: #0f172a; font-weight: 600;
}
.cf-deal-outcome-btn small {
  display: block; font-size: 11.5px; color: #64748b; margin-top: 2px;
}

/* ────────────────────────────────────────
   INTEGRATION MODAL — passos
   ──────────────────────────────────────── */
.cf-int-cats { display: flex; flex-direction: column; gap: 14px; }
.cf-int-cat-name {
  font-size: 11px; font-weight: 600; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 0.4px;
  margin-bottom: 6px;
}
.cf-int-apps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
}
.cf-int-app {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 8px; border: 1px solid #e8edf2; border-radius: 7px;
  background: #fff; cursor: pointer; position: relative;
  font-family: inherit;
  transition: border-color .15s, background .15s;
}
.cf-int-app:not(.soon):hover { border-color: #1e5baa; background: #f8fbff; }
.cf-int-app.on { border-color: #1e5baa; background: #f0f6ff; }
.cf-int-app.soon { opacity: 0.55; cursor: not-allowed; }
.cf-int-app-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.cf-int-app-name { font-size: 11.5px; font-weight: 500; color: #0f172a; }
.cf-int-app-soon {
  position: absolute; top: 4px; right: 4px;
  font-size: 8.5px; padding: 1px 5px; border-radius: 6px;
  background: #fef3c7; color: #92400e; font-weight: 600;
}

.cf-int-events { display: flex; flex-direction: column; gap: 5px; }
.cf-int-event {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border: 1px solid #e8edf2; border-radius: 6px;
  background: #fff; cursor: pointer; text-align: left;
  font-size: 12.5px; color: #0f172a; font-family: inherit;
}
.cf-int-event:hover { border-color: #1e5baa; background: #f8fbff; }
.cf-int-event.on { border-color: #1e5baa; background: #f0f6ff; }

.cf-int-webhook-url {
  display: block; padding: 8px 10px; background: #0f172a; color: #cbd5e1;
  border-radius: 6px; font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; word-break: break-all; user-select: all;
}

/* ────────────────────────────────────────
   HOVER PREVIEW DO CARD
   ──────────────────────────────────────── */
.cf-neg-card-preview {
  position: fixed; z-index: 9999;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 9px;
  padding: 12px 14px; min-width: 240px; max-width: 320px;
  box-shadow: 0 8px 24px rgba(15,23,42,0.14);
  display: flex; flex-direction: column; gap: 7px;
  animation: cfPreviewIn .15s ease-out;
  pointer-events: none;
}
@keyframes cfPreviewIn { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: translateY(0); } }
.cf-neg-prev-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cf-neg-prev-head strong { font-size: 13px; color: #0f172a; }
.cf-neg-prev-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: #475569;
}
.cf-neg-prev-row strong { color: #0f172a; }
.cf-neg-prev-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.cf-neg-prev-notes {
  font-size: 11.5px; color: #64748b; font-style: italic;
  padding: 6px 8px; background: #f8fafc; border-radius: 5px; line-height: 1.4;
  border-left: 2px solid #e2e8f0;
}
.cf-neg-prev-foot {
  display: flex; align-items: center; gap: 4px;
  font-size: 10.5px; color: #94a3b8;
  padding-top: 4px; border-top: 1px solid #f1f5f9;
}

/* Sessão 134 / Bloco D / Onda 1: últimas 3 mensagens no preview */
.cf-neg-prev-msgs {
  display: flex; flex-direction: column; gap: 4px;
  padding: 6px 0;
  border-top: 1px solid #f1f5f9;
}
.cf-neg-prev-msgs-head {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; color: #64748b;
  text-transform: uppercase; letter-spacing: 0.4px;
  margin-bottom: 2px;
}
.cf-neg-prev-msgs-loading,
.cf-neg-prev-msgs-empty {
  font-size: 11px; color: #94a3b8; font-style: italic;
}
.cf-neg-prev-msg {
  display: flex; gap: 6px; align-items: flex-start;
  font-size: 11.5px;
  padding: 4px 7px;
  border-radius: 5px;
}
.cf-neg-prev-msg-in  { background: #f8fafc; }
.cf-neg-prev-msg-out { background: #d9fdd3; }
.cf-neg-prev-msg-body {
  flex: 1; color: #0f172a; line-height: 1.35;
  word-wrap: break-word; overflow-wrap: anywhere;
}
.cf-neg-prev-msg small {
  font-size: 9.5px; color: #64748b;
  flex-shrink: 0;
}

/* Sessão 134 / Bloco D / Onda 2: navegação prev/next no drawer */
.cf-deal-nav {
  display: inline-flex; align-items: center; gap: 4px;
  margin-left: auto;
  padding: 2px 4px;
  background: #f8fafc;
  border-radius: 6px;
}
.cf-deal-nav-btn {
  width: 24px; height: 24px;
  background: transparent; border: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  color: #64748b; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.cf-deal-nav-btn:hover:not(:disabled) { background: #fff; color: #1E5BAA; }
.cf-deal-nav-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.cf-deal-nav-counter {
  font-size: 11px; color: #64748b; font-weight: 500;
  min-width: 36px; text-align: center;
  font-family: 'IBM Plex Mono', monospace;
}

/* ────────────────────────────────────────
   TEMPLATES (cards no drawer de origem)
   ──────────────────────────────────────── */
.cf-orig-template-card {
  position: relative;
  padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 7px;
  background: #fff; transition: border-color .15s;
}
.cf-orig-template-card:hover { border-color: #cbd5e1; }
.cf-orig-tmpl-apply {
  background: transparent; border: none; cursor: pointer;
  text-align: left; padding: 0; width: 100%;
  display: flex; flex-direction: column; gap: 3px; font-family: inherit;
}
.cf-orig-tmpl-actions {
  position: absolute; top: 8px; right: 8px;
  display: flex; gap: 2px; opacity: 0; transition: opacity .15s;
}
.cf-orig-template-card:hover .cf-orig-tmpl-actions { opacity: 1; }
.cf-orig-tmpl-btn {
  width: 22px; height: 22px; border: none; background: #f1f5f9;
  border-radius: 4px; cursor: pointer; color: #64748b;
  display: flex; align-items: center; justify-content: center;
}
.cf-orig-tmpl-btn:hover { background: #e0eaff; color: #1e5baa; }
.cf-orig-tmpl-btn-danger:hover { background: #fee2e2; color: #dc2626; }
.cf-orig-tmpl-custom {
  font-size: 9px; padding: 1px 5px; border-radius: 6px;
  background: #ede9fe; color: #5b21b6; font-weight: 600; vertical-align: middle;
}

/* ────────────────────────────────────────
   TELA DE DISTRIBUIÇÃO SUPERVISOR
   ──────────────────────────────────────── */
.cf-dist {
  /* Sessão 134: full-width sem max-width */
  padding: 22px 28px;
  display: flex; flex-direction: column; gap: 18px;
}
.cf-dist-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
}
.cf-dist-title { font-size: 22px; font-weight: 600; margin: 0; font-family: 'IBM Plex Sans', sans-serif; color: #0f172a; }
.cf-dist-sub { font-size: 12.5px; color: #64748b; margin: 4px 0 0 0; }
.cf-dist-head-actions { display: flex; gap: 8px; align-items: center; }

/* KPIs no topo (sessão 134) — panorama supervisor */
.cf-dist-kpis {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
@media (max-width: 720px) { .cf-dist-kpis { grid-template-columns: 1fr; } }
.cf-dist-kpi {
  background: #fff; border: 1px solid #ecf0f4; border-radius: 10px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 4px;
}
.cf-dist-kpi strong {
  font-size: 22px; font-weight: 600; color: #0f172a;
  font-family: 'IBM Plex Sans', sans-serif; line-height: 1;
}
.cf-dist-kpi small { font-size: 11.5px; color: #64748b; }

/* Bulk-bar (modo geral) — distribuição em massa portada do legado */
.cf-dist-bulk {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 12px 16px;
  background: #fffbf2; border: 1px solid #fde68a; border-radius: 10px;
}
.cf-dist-bulk-info {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: #475569;
}
.cf-dist-bulk-info i { color: #f59e0b; }
.cf-dist-bulk-actions { display: flex; gap: 8px; align-items: center; }

/* Dashboard de supervisão (sessão 134) */
.cf-dist-supervision {
  background: #fff; border: 1px solid #ecf0f4; border-radius: 10px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.cf-dist-supervision .cf-dist-pane-head { padding: 0; border: none; }

.cf-dist-supervision-table {
  width: 100%; border-collapse: collapse; font-size: 12.5px;
}
.cf-dist-supervision-table thead tr { border-bottom: 1px solid #ecf0f4; }
.cf-dist-supervision-table th {
  text-align: left; padding: 8px 10px;
  font-size: 10.5px; color: #94a3b8; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.cf-dist-supervision-table td {
  padding: 10px; border-bottom: 1px solid #f1f5f9; vertical-align: middle;
  color: #334155;
}
.cf-dist-supervision-table tbody tr:last-child td { border-bottom: none; }

.cf-dist-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 500;
  padding: 3px 9px; border-radius: 11px;
}
.cf-dist-status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
}
.cf-dist-status-online  { background: #d1fae5; color: #065f46; }
.cf-dist-status-recent  { background: #fef3c7; color: #92400e; }
.cf-dist-status-idle    { background: #fed7aa; color: #9a3412; }
.cf-dist-status-offline { background: #f1f5f9; color: #64748b; }

/* Conversas órfãs */
.cf-dist-orfas-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.cf-dist-orfa {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 12px; background: #fafbfc; border: 1px solid #f1f5f9;
  border-radius: 7px; transition: background .15s;
}
.cf-dist-orfa.urgent { background: #fffbeb; border-color: #fde68a; }
.cf-dist-orfa.very-urgent { background: #fef2f2; border-color: #fecaca; }
.cf-dist-orfa-info { min-width: 0; flex: 1; }
.cf-dist-orfa-info strong { display: block; font-size: 12.5px; color: #0f172a; font-weight: 600; }
.cf-dist-orfa-info small { display: block; font-size: 11.5px; color: #64748b; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70ch; }
.cf-dist-orfa-time {
  font-size: 11.5px; font-weight: 500; color: #64748b;
  white-space: nowrap;
}
.cf-dist-orfa.urgent .cf-dist-orfa-time { color: #92400e; font-weight: 600; }
.cf-dist-orfa.very-urgent .cf-dist-orfa-time { color: #991b1b; font-weight: 700; }

/* Sessão 134: complementos do dashboard supervisão */
.cf-dist-orfas-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-bottom: 8px;
}
.cf-dist-orfas-head strong { font-size: 13px; color: #0f172a; }
.cf-dist-orfa-meta {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.cf-dist-orfa-unread {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  background: #dc2626; color: #fff; border-radius: 10px;
  font-size: 11px; font-weight: 600;
}

.cf-dist-row-alert { background: #fffbeb; }
.cf-dist-row-alert td { background: #fffbeb !important; }

.cf-dist-user-cell { display: flex; align-items: center; gap: 8px; }
.cf-dist-avatar-mini {
  width: 26px; height: 26px; border-radius: 50%;
  background: #e2e8f0; color: #475569;
  display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 600;
  flex-shrink: 0;
}
.cf-dist-role {
  display: block; font-size: 10.5px; color: #94a3b8;
  text-transform: capitalize;
}

.cf-dist-body {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 14px;
  align-items: start;
}
@media (max-width: 1100px) { .cf-dist-body { grid-template-columns: 1fr; } }

.cf-dist-pane {
  background: #fff; border: 1px solid #ecf0f4; border-radius: 10px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
}
.cf-dist-pane-head {
  display: flex; justify-content: space-between; align-items: center;
}
.cf-dist-pane-head h3 { font-size: 14px; font-weight: 600; margin: 0; color: #0f172a; }
.cf-dist-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 22px; padding: 0 8px;
  background: #1e5baa; color: #fff; border-radius: 11px;
  font-size: 11.5px; font-weight: 600;
}
.cf-dist-empty { font-size: 12px; color: #94a3b8; padding: 16px; text-align: center; }

.cf-dist-list { display: flex; flex-direction: column; gap: 6px; max-height: 600px; overflow-y: auto; }
.cf-dist-deal {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 12px; background: #f8fafc; border-radius: 7px;
}
.cf-dist-deal-info { flex: 1; min-width: 0; }
.cf-dist-deal-name { font-size: 12.5px; font-weight: 600; color: #0f172a; }
.cf-dist-deal-meta { display: flex; gap: 10px; font-size: 11px; color: #94a3b8; margin-top: 2px; flex-wrap: wrap; }
.cf-dist-deal-origem { font-weight: 500; }

.cf-dist-team { display: flex; flex-direction: column; gap: 6px; }
.cf-dist-member {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: #f8fafc; border-radius: 7px;
}
.cf-dist-member-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: #1e5baa; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 600; flex-shrink: 0;
}
.cf-dist-member-info { flex: 1; min-width: 0; }
.cf-dist-member-name { font-size: 12.5px; font-weight: 500; color: #0f172a; }
.cf-dist-member-meta { display: flex; gap: 10px; font-size: 10.5px; color: #94a3b8; margin-top: 1px; }
.cf-dist-member-bar {
  width: 60px; height: 5px; background: #e2e8f0; border-radius: 3px; overflow: hidden;
}
.cf-dist-member-bar-fill {
  height: 100%; background: linear-gradient(90deg, #10b981 0%, #f59e0b 70%, #dc2626 100%);
  transition: width .25s;
}
.cf-dist-member-toggle input { cursor: pointer; }
.cf-dist-member-del {
  width: 22px; height: 22px; border: none; background: transparent;
  border-radius: 4px; cursor: pointer; color: #94a3b8;
  display: flex; align-items: center; justify-content: center;
}
.cf-dist-member-del:hover { background: #fee2e2; color: #dc2626; }

.cf-dist-actions { padding-top: 8px; border-top: 1px solid #f1f5f9; }


/* 5o fluxo IA: badge de score IA no drawer + cards */
.cf-deal-ai-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 120ms;
}
.cf-deal-ai-badge:hover { transform: scale(1.05); }
.cf-deal-ai-badge strong {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
}
.cf-deal-ai-fechando { background: #D1FAE5; color: #065F46; }
.cf-deal-ai-quente   { background: #FEF3C7; color: #92400E; }
.cf-deal-ai-morno    { background: #DBEAFE; color: #1E40AF; }
.cf-deal-ai-frio     { background: #F1F5F9; color: #475569; }

.cf-deal-ai-btn-calc {
  display: inline-flex; align-items: center; gap: 4px;
  background: linear-gradient(135deg, #A855F7, #7C3AED);
  color: #fff;
  border: 0;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.cf-deal-ai-btn-calc:hover {
  background: linear-gradient(135deg, #9333EA, #6D28D9);
}
