/* ============================================================================
   shared/cf-crm-context.css — estilos do helper de Ficha CRM 360
   Prefixo: cf-crm-*. Carregar onde o helper for usado (chat já tem seu CSS).
   ============================================================================ */

.cf-crm-shell {
  display: flex; flex-direction: column; gap: 12px;
  font-family: 'Inter', system-ui, sans-serif;
}

/* Hero */
.cf-crm-hero {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 6px; padding: 14px 12px;
  background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
  border: 1px solid #ecf0f4; border-radius: 10px;
}
.cf-crm-hero-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; font-weight: 600;
  font-family: 'IBM Plex Sans', sans-serif;
}
.cf-crm-hero-name {
  font-size: 14px; color: #0f172a; font-weight: 600;
  margin-top: 4px; word-break: break-word;
}
.cf-crm-hero-phone {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; color: #1E5BAA; text-decoration: none;
  padding: 3px 8px; border-radius: 12px; background: #eff6ff;
  font-family: 'IBM Plex Mono', monospace;
}
.cf-crm-hero-phone:hover { background: #dbeafe; }
.cf-crm-hero-phone-empty { font-size: 11px; color: #94a3b8; font-style: italic; }
.cf-crm-hero-email { font-size: 11.5px; color: #64748b; }

/* M37: chip "Estado da pessoa" no hero da Ficha CRM */
.cf-crm-hero-estado {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 2px 8px; border-radius: 999px;
  margin-top: 6px;
  cursor: help;
}
.cf-crm-hero-estado-matriculado { background: #dcfce7; color: #166534; }
.cf-crm-hero-estado-aluno       { background: #dbeafe; color: #1E5BAA; }
.cf-crm-hero-estado-oportunidade{ background: #fef3c7; color: #92400e; }
.cf-crm-hero-estado-lead        { background: #fef3c7; color: #92400e; }
.cf-crm-hero-estado-contato     { background: #f1f5f9; color: #475569; }

/* Ficha aluno */
.cf-crm-aluno-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; background: #f0f6ff; border: 1px solid #bfdbfe;
  border-radius: 10px; cursor: pointer; width: 100%;
  font-family: inherit; text-align: left;
  transition: background .15s, border-color .15s;
}
.cf-crm-aluno-card:hover { background: #dbeafe; border-color: #93c5fd; }
.cf-crm-aluno-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; font-weight: 600; flex-shrink: 0;
}
.cf-crm-aluno-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cf-crm-aluno-info > small:first-child {
  font-size: 9.5px; color: #1e40af; text-transform: uppercase;
  letter-spacing: .04em; font-weight: 600;
}
.cf-crm-aluno-info strong {
  font-size: 13px; color: #0f172a; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cf-crm-aluno-email {
  font-size: 11px; color: #64748b;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cf-crm-aluno-cta {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 600; color: #1E5BAA;
  flex-shrink: 0;
}
.cf-crm-aluno-empty {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; background: #f8fafc; border: 1px dashed #cbd5e1;
  border-radius: 8px; color: #64748b;
}
.cf-crm-aluno-empty > i { color: #94a3b8; margin-top: 2px; flex-shrink: 0; }
.cf-crm-aluno-empty strong { display: block; font-size: 12px; color: #475569; }
.cf-crm-aluno-empty small { display: block; font-size: 11px; color: #94a3b8; margin-top: 2px; line-height: 1.45; }

/* Deal card */
.cf-crm-deal-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: #fff; border: 1px solid #e2e8f0;
  border-radius: 8px; cursor: pointer; width: 100%;
  font-family: inherit; text-align: left;
  transition: background .15s, border-color .15s;
}
.cf-crm-deal-card:hover { background: #f8fafc; border-color: #cbd5e1; }
.cf-crm-deal-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cf-crm-deal-info > small:first-child {
  font-size: 9.5px; color: #64748b; text-transform: uppercase;
  letter-spacing: .04em; font-weight: 600;
}
.cf-crm-deal-info strong {
  font-size: 12.5px; color: #0f172a; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cf-crm-deal-meta { font-size: 11px; color: #64748b; }
.cf-crm-deal-empty {
  padding: 10px 12px; background: #f8fafc; border: 1px dashed #e2e8f0;
  border-radius: 8px;
}
.cf-crm-deal-empty small { font-size: 11.5px; color: #94a3b8; line-height: 1.5; }

/* Sanfonas */
.cf-crm-acc {
  border: 1px solid #ecf0f4; border-radius: 8px;
  background: #fff; overflow: hidden;
}
.cf-crm-acc > summary {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 12px; cursor: pointer;
  font-size: 11px; color: #475569; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
  list-style: none; user-select: none;
  transition: background .12s;
}
.cf-crm-acc > summary::-webkit-details-marker { display: none; }
.cf-crm-acc > summary::after {
  content: ''; margin-left: auto;
  width: 6px; height: 6px;
  border-right: 1.5px solid #cbd5e1;
  border-bottom: 1.5px solid #cbd5e1;
  transform: rotate(-45deg); transition: transform .15s;
}
.cf-crm-acc[open] > summary::after { transform: rotate(45deg); }
.cf-crm-acc > summary:hover { background: #f8fafc; }
.cf-crm-acc > summary > i { color: #64748b; }
.cf-crm-acc-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: #f1f5f9; color: #475569; border-radius: 9px;
  font-size: 10px; font-weight: 700;
  margin-left: 4px;
}
.cf-crm-acc-body {
  padding: 10px 12px 12px; border-top: 1px solid #f1f5f9;
  display: flex; flex-direction: column; gap: 8px;
}

/* Mini cards (LTV, tickets, próxima reunião) */
.cf-crm-mini-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 12px; background: #fff;
  border: 1px solid #ecf0f4; border-radius: 8px;
}
.cf-crm-mini-card + .cf-crm-mini-card { margin-top: 6px; }
.cf-crm-mini-eye {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; color: #64748b;
  text-transform: uppercase; letter-spacing: .04em; font-weight: 600;
}
.cf-crm-mini-row { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; }
.cf-crm-mini-big {
  font-size: 18px; font-weight: 700; font-family: 'IBM Plex Sans', sans-serif;
  color: #0f172a; line-height: 1;
}
.cf-crm-mini-sub { font-size: 11.5px; color: #64748b; }
.cf-crm-mini-foot { font-size: 10.5px; color: #94a3b8; margin-top: 4px; }
.cf-crm-mini-title { font-size: 12.5px; color: #1e3a8a; display: block; }
.cf-crm-mini-good { background: #f0fdf4; border-color: #bbf7d0; }
.cf-crm-mini-good .cf-crm-mini-eye { color: #15803d; }
.cf-crm-mini-good .cf-crm-mini-big { color: #065f46; }
.cf-crm-mini-warn { background: #fff7ed; border-color: #fed7aa; }
.cf-crm-mini-warn .cf-crm-mini-eye { color: #9a3412; }
.cf-crm-mini-info { background: #eff6ff; border-color: #bfdbfe; }

/* M33b: ações no card mini (próxima reunião — Entrar/Ver) */
.cf-crm-mini-actions {
  display: flex; gap: 6px; margin-top: 8px;
}
.cf-crm-mini-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; font-size: 11px; font-weight: 600;
  background: #fff; color: #1E5BAA;
  border: 1px solid #cbd5e1; border-radius: 5px;
  cursor: pointer; text-decoration: none;
  transition: background .12s;
}
.cf-crm-mini-btn:hover { background: #f8fafc; }
.cf-crm-mini-btn-primary {
  background: #1E5BAA; color: #fff; border-color: #1E5BAA;
}
.cf-crm-mini-btn-primary:hover { background: #164a8c; }

/* M35b: chip de status do retorno (Vencido / Hoje) */
.cf-crm-mini-status {
  display: inline-flex; align-items: center;
  font-size: 9px; font-weight: 700; letter-spacing: 0.04em;
  padding: 1px 6px; border-radius: 4px;
  margin-left: 6px; text-transform: uppercase;
}
.cf-crm-mini-status.is-vencido { background: #fee2e2; color: #991b1b; }
.cf-crm-mini-status.is-hoje    { background: #fef3c7; color: #92400e; }

/* ─── M34b: Modal cfAtividade (ligação / nota) ─────────────────────────── */
.cf-ativ-modal .cf-ativ-context {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px;
  background: #f8fafc; border-radius: 6px;
  margin-bottom: 12px;
  font-size: 12px;
}
.cf-ativ-outcomes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px;
}
.cf-ativ-outcome {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 150ms ease;
  font-size: 12px;
}
.cf-ativ-outcome:hover { background: #f8fafc; border-color: #cbd5e1; }
.cf-ativ-outcome:has(input:checked) {
  background: #eff6ff; border-color: #1E5BAA; color: #1E5BAA;
  font-weight: 600;
}
.cf-ativ-outcome input { margin: 0; }
.cf-ativ-outcome span {
  display: inline-flex; align-items: center; gap: 4px;
}

.cf-ativ-extra {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}
.cf-ativ-extra summary {
  cursor: pointer; font-size: 12px; color: #475569; font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px;
  list-style: none;
}
.cf-ativ-extra summary::-webkit-details-marker { display: none; }
.cf-ativ-extra[open] summary { color: #1E5BAA; margin-bottom: 8px; }

.cf-ativ-check {
  display: flex; align-items: center; gap: 6px;
  margin-top: 6px; font-size: 12px; color: #475569;
  cursor: pointer;
}
.cf-ativ-check input { margin: 0; }
.cf-crm-mini-info .cf-crm-mini-eye { color: #1e40af; }

.cf-crm-mini-tk {
  display: flex; align-items: flex-start; gap: 6px;
  padding: 6px 0;
}
.cf-crm-mini-tk + .cf-crm-mini-tk { border-top: 1px dashed #fed7aa; }
.cf-crm-mini-tk-dot {
  width: 6px; height: 6px; border-radius: 50%; margin-top: 5px; flex-shrink: 0;
  background: #94a3b8;
}
.cf-crm-mini-tk-aberto { background: #dc2626; }
.cf-crm-mini-tk-em_atendimento { background: #f59e0b; }
.cf-crm-mini-tk-aguardando_aluno { background: #3b82f6; }
.cf-crm-mini-tk-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.cf-crm-mini-tk-text strong {
  font-size: 11.5px; color: #0f172a; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cf-crm-mini-tk-text small { font-size: 10.5px; color: #94a3b8; }

/* Conversas relacionadas */
.cf-crm-related-row {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 10px; background: #f8fafc; border: 1px solid transparent;
  border-radius: 7px; cursor: pointer; width: 100%;
  font-family: inherit; text-align: left;
  transition: background .12s, border-color .12s;
}
.cf-crm-related-row:hover { background: #f0f6ff; border-color: #bfdbfe; }
.cf-crm-related-row + .cf-crm-related-row { margin-top: 4px; }
.cf-crm-related-top {
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
}
.cf-crm-related-top strong {
  font-size: 12px; color: #0f172a; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cf-crm-related-top small { font-size: 10.5px; color: #94a3b8; flex-shrink: 0; }
.cf-crm-related-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
}
.cf-crm-related-bottom small {
  font-size: 10.5px; color: #64748b;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cf-crm-related-status {
  flex-shrink: 0; padding: 1px 7px; border-radius: 8px;
  font-size: 9.5px; font-weight: 500;
}
.cf-crm-related-status-open { background: #dcfce7; color: #166534; }
.cf-crm-related-status-pending { background: #fef3c7; color: #92400e; }
.cf-crm-related-status-closed { background: #f1f5f9; color: #64748b; }

.cf-crm-empty {
  font-size: 11.5px; color: #94a3b8; font-style: italic;
  padding: 8px 0; display: block;
}

/* M15: ações rápidas parametrizadas */
.cf-crm-actions-group { display: flex; flex-direction: column; gap: 6px; }
.cf-crm-actions-group + .cf-crm-actions-group { margin-top: 10px; }
.cf-crm-actions-eye {
  display: flex; align-items: center; gap: 5px;
  font-size: 10px; color: #94a3b8;
  text-transform: uppercase; letter-spacing: .04em; font-weight: 600;
}
.cf-crm-actions-primary { display: flex; flex-direction: column; gap: 6px; }
.cf-crm-actions-secondary { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cf-crm-qa-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 5px; padding: 8px 10px;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 6px;
  font-size: 11.5px; font-weight: 500; color: #4a5670;
  cursor: pointer; transition: background .12s, color .12s, border-color .12s;
  font-family: inherit; line-height: 1;
}
.cf-crm-qa-btn:hover:not(:disabled) { background: #f1f5f9; color: #0f172a; border-color: #cbd5e1; }
.cf-crm-qa-btn:disabled { opacity: .55; cursor: not-allowed; background: #f8fafc; }
.cf-crm-qa-btn.is-soft { color: #94a3b8; }
.cf-crm-qa-btn.cf-crm-qa-primary {
  background: #1E5BAA; color: #fff; border-color: #1E5BAA;
}
.cf-crm-qa-btn.cf-crm-qa-primary:hover:not(:disabled) {
  background: #154A8E; border-color: #154A8E; color: #fff;
}
.cf-crm-actions-primary .cf-crm-qa-btn { width: 100%; padding: 10px 12px; font-size: 12px; }
.cf-crm-qa-btn i { flex-shrink: 0; }

/* M15: bloco atendimento (status + responsável) */
.cf-crm-atend-row { display: flex; flex-direction: column; gap: 3px; }
.cf-crm-atend-row + .cf-crm-atend-row { margin-top: 8px; }
.cf-crm-atend-row label { font-size: 10.5px; color: #94a3b8; font-weight: 500; }
.cf-crm-input {
  padding: 7px 9px; border: 1px solid #e2e8f0; border-radius: 6px;
  font-size: 12px; color: #0f172a; background: #fff; font-family: inherit;
}
.cf-crm-input:focus { outline: none; border-color: #1E5BAA; }

/* M15: pílula de automação ativa (barra horizontal) */
.cf-crm-automation-bar {
  background: #fffbeb; border-bottom: 1px solid #fde68a;
  padding: 6px 16px; display: flex; align-items: center;
}
.cf-crm-automation-bar[hidden] { display: none; }
.cf-crm-automation-bar.is-paused { background: #f8fafc; border-bottom-color: #e2e8f0; }
.cf-crm-automation-pill {
  display: inline-flex; align-items: center; gap: 6px; width: 100%;
  background: transparent; border: none; padding: 0; cursor: pointer;
  font: inherit; font-size: 11.5px; color: #92400e; font-weight: 500;
}
.cf-crm-automation-pill > span:first-of-type { flex: 1; text-align: left; }
.cf-crm-automation-pill:hover { text-decoration: underline; }
.cf-crm-automation-bar.is-paused .cf-crm-automation-pill { color: #64748b; }
.cf-crm-automation-go {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10.5px; font-weight: 600; color: #b45309;
  opacity: 0; transition: opacity .15s;
}
.cf-crm-automation-bar:hover .cf-crm-automation-go { opacity: 1; }
.cf-crm-automation-bar.is-paused .cf-crm-automation-go { color: #94a3b8; }

/* M16.3: pílula de classificação da pessoa (lead/contato/aluno) */
.cf-crm-person-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 12px;
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
}
.cf-crm-person-pill-neutral { background: #f1f5f9; color: #475569; }
.cf-crm-person-pill-info    { background: #eff6ff; color: #1e40af; }
.cf-crm-person-pill-warn    { background: #fef3c7; color: #92400e; }
.cf-crm-person-pill-good    { background: #dcfce7; color: #166534; }

/* M18: bloco "Canal de entrada" (canal + origem + setor) */
.cf-crm-canal-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 12px;
  background: #fafbfc; border: 1px solid #ecf0f4; border-radius: 8px;
}
.cf-crm-canal-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.cf-crm-canal-label {
  font-size: 10px; color: #94a3b8; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
  min-width: 50px;
}
.cf-crm-canal-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 600;
}
.cf-crm-canal-pill {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 10px;
  font-size: 11px; font-weight: 500;
}
.cf-crm-canal-meta { font-size: 11px; color: #64748b; }

/* M20.3: card "Possível aluno encontrado" — sugestão de vínculo */
.cf-crm-aluno-suggest {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px;
  background: #fffbeb; border: 1px solid #fde68a;
  border-radius: 10px;
}
.cf-crm-aluno-suggest-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; color: #92400e;
}
.cf-crm-aluno-suggest-sub {
  font-size: 11px; color: #92400e; line-height: 1.45;
}
.cf-crm-aluno-suggest-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; background: #fff; border-radius: 7px;
}
.cf-crm-aluno-suggest-card .cf-crm-aluno-avatar { width: 32px; height: 32px; font-size: 10.5px; }
.cf-crm-aluno-suggest-card .cf-crm-aluno-info strong { font-size: 12.5px; color: #0f172a; }
.cf-crm-aluno-suggest-card .cf-crm-aluno-info small { font-size: 11px; color: #64748b; display: block; }
.cf-crm-aluno-suggest-actions {
  display: grid; grid-template-columns: 1fr auto; gap: 6px;
}
.cf-crm-aluno-suggest-actions .cf-crm-qa-btn { padding: 8px 10px; }
