/* CRM: kanban de Pesquisa/Vendas + ficha do lead. Reaproveita variáveis e
   primitivas de admin.css (--line, --muted, .btn, .card, .badge, .control). */

/* Cor da aba ativa combina com o badge do próprio pipeline (Pesquisa=azul, Vendas=verde) */
#sec-crm .actions .active-tab { color: white; border-color: transparent }
#sec-crm .actions [data-crm-tab="resumo"].active-tab { background: var(--ink) }
#sec-crm .actions [data-crm-tab="pesquisa"].active-tab { background: var(--blue) }
#sec-crm .actions [data-crm-tab="vendas"].active-tab { background: var(--green-dark) }

.crm-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity }
.crm-col { flex: 0 0 260px; background: #f0f2f3; border-radius: 14px; padding: 10px; max-height: calc(100vh - 260px); display: flex; flex-direction: column; scroll-snap-align: start }
.crm-col-head { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 13px; padding: 4px 6px 8px; color: var(--ink) }
.crm-col-count { background: white; border-radius: 999px; padding: 1px 8px; font-size: 12px; color: var(--muted) }
.crm-col-body { overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 60px; border-radius: 10px; transition: background .15s }
.crm-col-body.drag-over { background: rgba(32, 185, 111, .12) }
.crm-col-empty { font-size: 12px; color: var(--muted); text-align: center; padding: 14px 6px }

.crm-card { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 10px; cursor: grab; box-shadow: 0 2px 6px rgba(10, 20, 30, .05) }
.crm-card:active { cursor: grabbing }
.crm-card-name { font-weight: 800; font-size: 13px; margin-bottom: 2px }
.crm-card-city { font-size: 11px; color: var(--muted); margin-bottom: 6px }
.crm-card-row { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--ink); margin-bottom: 4px; gap: 6px }
.crm-card-row.overdue { color: var(--magenta); font-weight: 700 }
.crm-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 6px }
.crm-card-meta { font-size: 11px; color: var(--muted) }

/* Badge de pipeline (Pesquisa/Vendas) — visível no card e na ficha do lead */
.crm-pipe-badges { display: flex; gap: 4px; margin-bottom: 5px }
.crm-pipe-badge { font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; border-radius: 999px; padding: 2px 7px }
.crm-pipe-badge.pesquisa { background: var(--soft-blue); color: #24617e }
.crm-pipe-badge.vendas { background: #e2f6ea; color: #1c7a44 }

/* Filtros do CRM: fontes menores pra sobrar mais espaço vertical pras colunas do quadro */
#crmFiltersBox.controls { margin-bottom: 4px }
#crmFiltersBox .control-grid { gap: 6px }
#crmFiltersBox .control { font-size: 12px; padding: 6px 8px; min-height: 32px; border-radius: 9px }
#crmFiltersBox .chip { font-size: 11px; padding: 5px 10px }
#crmFiltersBox .filter-row { margin-top: 6px }

.crm-timeline-item { border-left: 3px solid var(--line); padding: 6px 0 6px 12px; margin-bottom: 10px }
.crm-timeline-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; flex-wrap: wrap }
.crm-timeline-head span { color: var(--muted) }
.crm-timeline-content { font-size: 13px; margin-top: 4px; white-space: pre-wrap }
.crm-timeline-meta { font-size: 12px; color: var(--muted); margin-top: 2px }

@media (max-width: 900px) {
  .crm-col { flex: 0 0 220px }
}
