/* O app Comercial (CRM): as três abas no alto (Chat, Pipeline, Follow-up); no Pipeline, os números no topo, o funil em Kanban e
   as folhas do lead; no Follow-up, o quadro, a agenda e as cadências (crm-followup.js). Materiais do sistema (cosmos.css e as
   peças de formulário do Projetos): botões chapados, ação em laranja, cantos pequenos, etiqueta com fundo sólido, e nenhuma faixa
   colorida na lateral do cartão. Sem vidro aqui dentro: a janela já é vidro. O Chat tem o desenho do WhatsApp (whatsapp.css). */

.janela.j-crm:not(.cheia) { max-width: 1500px; }
.cr { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; container-type: inline-size; }

/* as abas, lado a lado, no meio do alto */
.cr-guias { flex: none; align-self: center; display: inline-flex; gap: 2px; margin: 2px 0 12px; padding: 3px; border-radius: 9px; background: rgba(var(--f), .07); }
.cr-guias button { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 128px; height: 30px; padding: 0 16px; border-radius: 7px;
  font-size: 13.5px; font-weight: 500; color: var(--tinta-2); transition: background-color .16s ease, color .16s ease, transform .12s var(--ease-out); }
.cr-guias button.on { color: var(--tinta); background: rgba(var(--f), .17); font-weight: 600; }
.cr-guias button:active { transform: scale(.97); }
.cr-guias small { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--tinta); background: rgba(var(--f), .18); }
.cr-guias button:focus-visible { outline: none; box-shadow: 0 0 0 1.5px rgba(var(--f), .55); }
.cr-painel { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cr:not([data-guia="chat"]) .cr-p-chat, .cr:not([data-guia="pipeline"]) .cr-p-pipeline, .cr:not([data-guia="followup"]) .cr-p-followup { display: none; }
.cr-p-pipeline, .cr-p-followup { padding: 0 10px 10px; }
.cr-chat { flex: 1; min-height: 0; display: flex; flex-direction: column; border-top: 1px solid var(--wa-linha); }

/* os números soltos, sem cartão */
.cr-numeros { flex: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px 24px; padding: 6px 8px 16px; }
.cr-num { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cr-num > span { font-size: 12.5px; font-weight: 500; color: var(--tinta-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-num > b { font-size: clamp(20px, 2.3cqi, 30px); font-weight: 600; letter-spacing: -.025em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-num.verde > b { color: #3ecf8e; }
.cr-num.laranja > b { color: var(--laranja-claro); }
.cr-num.vermelho > b { color: #ee6b5a; }
.cr-num.ambar > b { color: var(--ambar); }

/* a barra: a busca, os filtros e o lead novo */
.cr-barra { flex: none; display: flex; align-items: center; gap: 8px; padding: 0 0 10px; }
.cr-barra .segmento button small { margin-left: 4px; font-size: 12px; color: var(--laranja-claro); }
.cr-busca { width: 220px; margin: 0; }
.cr-filtro { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 7px; font-size: 13.5px; font-weight: 500; color: var(--tinta-2); background: rgba(var(--f), .07); transition: background-color .14s ease, color .14s ease; }
.cr-filtro.on { color: var(--tinta); background: rgba(var(--f), .15); }
.cr-filtro span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-filtro .c-seta { opacity: .6; }
.cr-novo-lead { flex: none; }

/* o funil */
.cr-area { flex: 1; min-height: 0; display: flex; flex-direction: column; border-radius: 8px; background: var(--poco); overflow: hidden; }
.cr-quadro { flex: 1; min-height: 0; display: flex; gap: 8px; padding: 10px; overflow-x: auto; overscroll-behavior-x: contain; }
.cr-col { flex: 1 0 176px; min-width: 0; max-width: 340px; min-height: 0; display: flex; flex-direction: column; border-radius: 8px; background: rgba(var(--f), .045); }
.cr-col > header { flex: none; display: flex; align-items: center; gap: 6px; height: 38px; padding: 6px 6px 0 10px; }
.cr-col-nome { display: block; min-width: 0; height: 22px; padding: 0 8px; border-radius: 5px; font-size: 10.5px; font-weight: 700; line-height: 22px; letter-spacing: .03em; text-transform: uppercase; color: #12161d; background: var(--cor, #a3a3a3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-col-conta { flex: none; display: flex; align-items: baseline; gap: 6px; margin: 0; padding: 2px 12px 8px; font-size: 12.5px; color: var(--tinta-3); white-space: nowrap; }
.cr-col-conta b { margin-left: auto; font-weight: 600; color: var(--tinta-2); }
.cr-col-menu { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; color: var(--tinta-3); transition: background-color .14s ease, color .14s ease; }
.cr-renomear { flex: 1; min-width: 0; }
.cr-renomear input, .cr-col-nova-form input, .cr-novo-form input { width: 100%; min-width: 0; height: 30px; padding: 0 9px; border: 0; border-radius: 6px; outline: 0; font: inherit; font-size: 14px; color: var(--tinta); background: rgba(var(--f), .1); box-shadow: inset 0 0 0 1px rgba(var(--f), .26); }
.cr-col-rolo { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; padding: 0 6px 8px; overflow-y: auto; overscroll-behavior: contain; }
.cr-col-nova { flex: 0 0 42px; align-items: center; justify-content: center; flex-direction: row; gap: 6px; max-height: 42px; font-size: 13.5px; font-weight: 500; color: var(--tinta-3); cursor: pointer; transition: background-color .14s ease, color .14s ease; }
.cr-col-nova-form { flex: 0 0 220px; max-height: 50px; padding: 10px; }
.cr-col.alvo { background: rgba(var(--f), .1); }
.cr-cai { flex: none; display: block; height: 3px; margin: -1px 2px; border-radius: 2px; background: var(--laranja); }
.cr-cartao { flex: none; display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 10px 11px 11px; border-radius: 7px; text-align: left; color: var(--tinta); background: rgba(var(--f), .085); box-shadow: 0 1px 2px rgba(0, 0, 0, .22); transition: background-color .14s ease, transform .14s var(--ease-out); }
.cr-cartao:active { transform: scale(.985); }
.cr-cartao.arrastando { opacity: .3; }
.cr.arrastando, .cr.arrastando * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.cr-voando { position: absolute; z-index: 6; margin: 0; pointer-events: none; background: var(--sup-folha); box-shadow: 0 18px 40px -14px rgba(0, 0, 0, .7); will-change: transform; }
.cr-cartao-topo { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.cr-cartao-topo b { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.cr-empresa { margin-top: -4px; font-size: 12.5px; color: var(--tinta-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-cartao-meio { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 20px; }
.cr-valor { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.cr-selo { flex: none; display: inline-flex; align-items: center; height: 19px; padding: 0 7px; border-radius: 5px; font-style: normal; font-size: 11px; font-weight: 600; line-height: 1; white-space: nowrap; color: #12161d; background: var(--cor, #a3a3a3); }
.cr-origem { color: var(--tinta); background: rgba(var(--f), .14); max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.cr-ganhou { --cor: #34d399; height: 22px; }
.cr-quem { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-style: normal; font-size: 10.5px; font-weight: 700; color: #fff; background: #6b7688; }
.cr-passo { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 12.5px; color: var(--tinta-2); }
.cr-passo span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-passo b { flex: none; font-weight: 500; color: var(--tinta-3); }
.cr-passo.hoje, .cr-passo.hoje b { color: var(--ambar); }
.cr-passo.atrasado, .cr-passo.atrasado b { color: #ee6b5a; }
.cr-passo.vazio { color: var(--tinta-3); font-style: italic; }
.cr-parado { font-size: 12px; font-weight: 600; color: var(--laranja-claro); }
.cr-motivo { font-size: 12px; color: var(--tinta-3); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cr-novo { flex: none; display: flex; align-items: center; gap: 6px; width: 100%; height: 30px; padding: 0 8px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--tinta-3); text-align: left; transition: background-color .14s ease, color .14s ease; }
.cr-novo-form { flex: none; display: flex; }
.cr-vazio { margin: 0; padding: 16px 0; text-align: center; font-size: 13px; color: var(--tinta-3); }
.cr-fantasma { display: block; height: 82px; margin: 10px 6px 0; border-radius: 7px; background: rgba(var(--f), .06); animation: pj-pulso 1.6s ease-in-out infinite; }
.cr-estado { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; font-size: 14.5px; color: var(--tinta-2); }
.cr-etapas-abas { display: none; }
.cr-bola { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--cor); }
/* as cores da paleta das etapas */
.c-tinta.crt-marca { background: var(--laranja); } .c-tinta.crt-34d399 { background: #34d399; } .c-tinta.crt-60a5fa { background: #60a5fa; }
.c-tinta.crt-f472b6 { background: #f472b6; } .c-tinta.crt-facc15 { background: #facc15; } .c-tinta.crt-a78bfa { background: #a78bfa; }
.c-tinta.crt-f87171 { background: #f87171; } .c-tinta.crt-2dd4bf { background: #2dd4bf; } .c-tinta.crt-a3a3a3 { background: #a3a3a3; }

/* o lead aberto e as folhas */
.cr-veu { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 20px; background: var(--veu); animation: pj-veu .16s ease; }
.cr-veu[hidden] { display: none; }
.cr-folha { display: flex; flex-direction: column; width: min(1000px, 100%); height: min(720px, 100%); border-radius: 10px; color: var(--tinta); background: var(--sup-folha); box-shadow: var(--brilho), 0 30px 70px -24px rgba(0, 0, 0, .8); overflow: hidden; outline: none; animation: pj-folha .2s var(--ease-out); }
.cr-folha.sem-entrada { animation: none; }
.cr-veu > .sem-entrada { animation: none; }
.fu-ed-passo.novo { animation: fu-passo-novo .22s cubic-bezier(.23, 1, .32, 1); }
@keyframes fu-passo-novo { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .fu-ed-passo.novo { animation: none; } }
.cr-folha > header { flex: none; display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 10px 0 18px; }
.cr-folha > header .redondo { width: 30px; height: 30px; border-radius: 7px; }
.cr-etapa-selo { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: 5px; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; color: #12161d; background: var(--cor, #a3a3a3); cursor: pointer; }
.cr-etapa-selo .c-seta { opacity: .6; }
.cr-folha-corpo { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) var(--cr-folha-dir, 340px); }
.cr-folha-esq { min-height: 0; padding: 4px 22px 22px 18px; overflow-y: auto; overscroll-behavior: contain; }
.cr-folha-esq h2 { margin: 0 0 12px -8px; padding: 2px 8px; border-radius: 6px; outline: 0; font-size: 22px; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; overflow-wrap: anywhere; cursor: text; user-select: text; -webkit-user-select: text; transition: background-color .14s ease, box-shadow .14s ease; }
.cr-folha-esq h2:focus { background: rgba(var(--f), .07); box-shadow: inset 0 0 0 1px rgba(var(--f), .2); }
.cr-folha-esq section { margin-top: 18px; }
.cr-folha h3 { margin: 0 0 8px; font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--tinta-3); }
.cr-campos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 18px; margin: 0; }
.cr-campos > div { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.cr-campos dt { flex: none; width: 96px; font-size: 13px; color: var(--tinta-3); }
.cr-campos dd { flex: 1; min-width: 0; display: flex; margin: 0; }
.cr-in { width: 100%; min-width: 0; height: 30px; margin-left: -8px; padding: 0 8px; border: 0; border-radius: 6px; outline: 0; font: inherit; font-size: 14px; color: var(--tinta); background: none; transition: background-color .14s ease, box-shadow .14s ease; }
.cr-in::placeholder, .cr-area-texto::placeholder, .cr-nota-nova textarea::placeholder { color: var(--tinta-3); opacity: 1; }
.cr-in:focus { background: rgba(var(--f), .08); box-shadow: inset 0 0 0 1px rgba(var(--f), .22); }
.cr-valor-bt { display: inline-flex; align-items: center; gap: 7px; min-width: 0; max-width: 100%; min-height: 30px; margin-left: -8px; padding: 3px 8px; border-radius: 6px; text-align: left; font-size: 14px; color: var(--tinta); cursor: pointer; transition: background-color .14s ease; }
.cr-valor-bt > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-valor-bt .c-seta { flex: none; opacity: .5; }
.cr-valor-bt[aria-expanded="true"] { background: rgba(var(--f), .1); }
.cr-sem { color: var(--tinta-3); }
.cr-passo-campo { display: flex; gap: 8px; }
.cr-passo-campo .cr-in { flex: 1; margin-left: 0; background: rgba(var(--f), .06); }
.cr-data { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 6px; font-size: 13.5px; color: var(--tinta); background: rgba(var(--f), .09); transition: background-color .14s ease; }
.cr-data.atrasado { color: #ee6b5a; }
.cr-area-texto { display: block; width: calc(100% + 16px); min-height: 60px; margin: 0 -8px; padding: 6px 8px; border: 0; border-radius: 6px; outline: 0; resize: none; overflow: hidden; font: inherit; font-size: 14.5px; line-height: 1.5; color: var(--tinta); background: none; transition: background-color .14s ease, box-shadow .14s ease; }
.cr-area-texto:focus { background: rgba(var(--f), .07); box-shadow: inset 0 0 0 1px rgba(var(--f), .2); }
.cr-texto { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--tinta-2); overflow-wrap: anywhere; }
.cr-acoes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.cr-folha-dir { min-height: 0; padding: 14px 16px 18px; overflow-y: auto; overscroll-behavior: contain; background: var(--poco); }
.cr-nota-nova { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 12px; }
.cr-nota-nova textarea { flex: 1; min-width: 0; min-height: 34px; max-height: 200px; padding: 7px 10px; border: 0; border-radius: 8px; outline: 0; resize: none; font: inherit; font-size: 14px; line-height: 1.4; color: var(--tinta); background: rgba(var(--f), .08); }
.cr-nota-nova textarea:focus { box-shadow: inset 0 0 0 1px rgba(var(--f), .24); }
.cr-nota { margin-bottom: 8px; padding: 8px 10px; border-radius: 8px; background: rgba(var(--f), .07); }
.cr-nota p { margin: 0; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; user-select: text; -webkit-user-select: text; }
.cr-nota small, .cr-tempo small { display: block; margin-top: 3px; font-size: 12px; color: var(--tinta-3); }
.cr-linha-titulo { margin-top: 18px !important; }
.cr-tempo { margin: 0; padding: 0; list-style: none; }
.cr-tempo li { padding: 6px 0; font-size: 13.5px; line-height: 1.4; color: var(--tinta-2); box-shadow: inset 0 -1px 0 rgba(var(--f), .06); overflow-wrap: anywhere; }
.cr-form { display: flex; flex-direction: column; width: min(540px, 100%); max-height: 100%; border-radius: 10px; color: var(--tinta); background: var(--sup-folha); box-shadow: var(--brilho), 0 30px 70px -24px rgba(0, 0, 0, .8); overflow: hidden; animation: pj-folha .2s var(--ease-out); }
.cr-form-curta { width: min(440px, 100%); }
.cr-form > header { flex: none; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 10px 8px 18px; font-size: 16px; font-weight: 600; }
.cr-form > header span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cr-form > header .redondo { width: 30px; height: 30px; border-radius: 7px; }
.cr-form-corpo { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; padding: 4px 18px 6px; overflow-y: auto; overscroll-behavior: contain; }
.cr-form .segmento { align-self: flex-start; }
.cr-form .curto-valor { max-width: 220px; }
.cr-form-erro { margin: 0; font-size: 13.5px; line-height: 1.4; color: var(--erro); }
.cr-form > footer { flex: none; display: flex; align-items: center; gap: 8px; padding: 14px 18px 16px; }

@media (hover: hover) and (pointer: fine) {
  .cr-cartao:hover { background: rgba(var(--f), .13); }
  .cr-col-menu:hover, .cr-novo:hover, .cr-col-nova:hover { color: var(--tinta); background: rgba(var(--f), .09); }
  .cr-filtro:hover { color: var(--tinta); background: rgba(var(--f), .12); }
  .cr-guias button:not(.on):hover { color: var(--tinta); background: rgba(var(--f), .08); }
  .cr-valor-bt:hover, .cr-in:hover:not(:focus), .cr-area-texto:hover:not(:focus), .cr-folha-esq h2:hover:not(:focus) { background: rgba(var(--f), .06); }
  .cr-data:hover { background: rgba(var(--f), .14); }
}
.cr :is(.cr-cartao, .cr-col-menu, .cr-novo, .cr-col-nova, .cr-filtro, .cr-valor-bt, .cr-data, .cr-etapa-selo, .cr-etapas-abas button):focus-visible { outline: none; box-shadow: 0 0 0 1.5px rgba(var(--f), .5); }

/* janela estreita: os números em duas fileiras */
@container (max-width: 980px) {
  .cr-numeros { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cr-busca { width: 160px; }
}

@media (max-width: 860px) {
  .cr-guias { align-self: stretch; margin: 0 8px 10px; }
  .cr-guias button { flex: 1; min-width: 0; height: 38px; padding: 0 8px; }
  .cr-p-pipeline, .cr-p-followup { padding: 0 8px calc(8px + env(safe-area-inset-bottom)); }
  .cr-numeros { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; padding: 2px 4px 12px; }
  .cr-num > span { font-size: 11.5px; }
  .cr-num > b { font-size: 18px; }
  .cr-barra { flex-wrap: wrap; row-gap: 8px; }
  .cr-novo-lead { order: 2; margin-left: auto; height: 40px; }
  .cr-barra > .espaco { display: none; }
  .cr-busca { order: 3; flex: 1 1 100%; width: auto; height: 40px; }
  .cr-busca input { font-size: 16px; }
  .cr-filtro { order: 4; flex: 1; height: 40px; justify-content: center; }
  .segmento button { min-height: 36px; }
  .cr-etapas-abas { flex: none; display: flex; gap: 4px; padding: 8px 8px 0; overflow-x: auto; scrollbar-width: none; }
  .cr-etapas-abas::-webkit-scrollbar { display: none; }
  .cr-etapas-abas button { flex: none; display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 7px; font-size: 14px; font-weight: 500; color: var(--tinta-3); }
  .cr-etapas-abas button.on { color: var(--tinta); background: rgba(var(--f), .13); }
  .cr-etapas-abas small { font-size: 12px; color: var(--tinta-3); }
  .cr-quadro { overflow-x: hidden; padding: 8px; }
  .cr-quadro .cr-col { display: none; flex: 1 1 auto; max-width: none; }
  .cr-quadro .cr-col.aba { display: flex; }
  .cr-col > header { height: 44px; }
  .cr-col-menu { width: 36px; height: 36px; }
  .cr-col-nova, .cr-col-nova-form { display: none; }
  .cr-novo { height: 40px; font-size: 15px; }
  .cr-cartao-topo b { font-size: 15.5px; }
  .cr-veu { padding: 0; }
  /* no telefone a folha é a tela toda: opaca, para o funil de trás não aparecer através dela */
  .cr-folha, .cr-form { width: 100%; height: 100%; border-radius: 0; background: var(--ev-base); }
  .cr-folha > header .redondo, .cr-form > header .redondo { width: 38px; height: 38px; }
  .cr-folha-corpo { display: block; overflow-y: auto; }
  .cr-folha-esq, .cr-folha-dir { overflow: visible; }
  .cr-folha-esq { padding: 4px 16px 20px; }
  .cr-folha-dir { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .cr-campos { grid-template-columns: minmax(0, 1fr); }
  .cr-in, .cr-valor-bt, .cr-data { min-height: 38px; font-size: 16px; }
  .cr-etapa-selo { height: 36px; }
  .cr-area-texto, .cr-nota-nova textarea, .cr-renomear input, .cr-col-nova-form input, .cr-novo-form input { font-size: 16px; }
  .cr-form > footer { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .cr-form .pj-dupla { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .cr-fantasma, .cr-veu, .cr-folha, .cr-form { animation: none; } }

/* ------------------------------------------------------------ o follow-up no lead aberto (Pipeline) */
.cr-cad-lead .botao { margin-top: 2px; }
.cr-cad-estado { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cr-cad-estado > span { flex: 1 1 140px; min-width: 0; display: flex; flex-direction: column; }
.cr-cad-estado b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-cad-estado small, .cr-cad-fim { display: block; font-size: 12.5px; color: var(--tinta-3); }
.cr-cad-fim { margin-bottom: 6px; }

/* ------------------------------------------------------------ a aba Follow-up (crm-followup.js) */
.fu { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.fu-momento { flex: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px 24px; padding: 6px 8px 16px; }
.fu-barra { flex: none; display: flex; align-items: center; gap: 8px; padding: 0 0 10px; }
.fu-barra .botao { flex: none; }
.fu-area { flex: 1; min-height: 0; display: flex; flex-direction: column; border-radius: 8px; background: var(--poco); overflow: hidden; }

/* o quadro e a agenda: uma coluna por situação (ou por dia), como o funil */
.fu-quadro { flex: 1; min-height: 0; display: flex; gap: 8px; padding: 10px; overflow-x: auto; overscroll-behavior-x: contain; }
.fu-col { flex: 1 0 180px; min-width: 0; max-width: 330px; min-height: 0; display: flex; flex-direction: column; border-radius: 8px; background: rgba(var(--f), .045); }
.fu-col > header, .fu-prazo > header { flex: none; display: flex; align-items: center; gap: 6px; height: 40px; padding: 6px 10px 2px; }
.fu-col > header small, .fu-prazo > header small { font-size: 12.5px; font-weight: 600; color: var(--tinta-3); }
.fu-col-nome { display: inline-block; min-width: 0; max-width: 100%; height: 22px; padding: 0 8px; border-radius: 5px; font-style: normal; font-size: 10.5px; font-weight: 700; line-height: 22px; letter-spacing: .03em; text-transform: uppercase;
  color: #12161d; background: var(--cor, #a3a3a3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fu-col-rolo { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; padding: 4px 6px 8px; overflow-y: auto; overscroll-behavior: contain; }
.fu-vazio { margin: 0; padding: 18px 8px; text-align: center; font-size: 13px; color: var(--tinta-3); }

/* o cartão: o lead, a etapa, a cadência, o que acontece no próximo toque, os passos e, no pé, o estado de agora */
.fu-cartao { flex: none; display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 10px 11px 0; border-radius: 7px; text-align: left; color: var(--tinta); background: rgba(var(--f), .085);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .22); overflow: hidden; transition: background-color .14s ease, transform .14s var(--ease-out); }
.fu-cartao:active { transform: scale(.985); }
.fu-c-topo { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.fu-c-topo b { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fu-c-topo time { flex: none; margin-top: 1px; font-size: 12px; font-weight: 600; color: var(--tinta-2); white-space: nowrap; }
.fu-c-sub { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12.5px; color: var(--tinta-3); }
.fu-c-sub > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fu-etapa { flex: none; display: inline-flex; align-items: center; max-width: 140px; height: 18px; padding: 0 6px; border-radius: 4px; font-style: normal; font-size: 10.5px; font-weight: 700; letter-spacing: .02em;
  color: #12161d; background: var(--cor, #a3a3a3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fu-c-cad { font-size: 12.5px; font-weight: 600; color: var(--tinta-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fu-c-o { font-size: 13px; line-height: 1.38; color: var(--tinta-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.fu-passos { display: flex; align-items: center; gap: 4px; min-width: 0; }
.fu-passos i { flex: none; width: 14px; height: 4px; border-radius: 2px; background: rgba(var(--f), .16); }
.fu-passos i.feito { background: #34d399; opacity: .55; }
.fu-passos i.on { background: var(--tinta); }
.fu-passos small { margin-left: 4px; font-size: 12px; font-weight: 600; color: var(--tinta-3); white-space: nowrap; }
.fu-c-estado { display: flex; align-items: center; gap: 6px; margin: 2px -11px 0; padding: 7px 11px 8px; font-size: 12px; font-weight: 600; line-height: 1.3; color: var(--tinta-2); background: rgba(var(--f), .05); }
.fu-c-estado .ico { flex: none; }
.fu-c-estado span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fu-cartao.est-atrasado .fu-c-estado { color: #ee6b5a; background: rgba(238, 107, 90, .14); }
.fu-cartao.est-respondeu .fu-c-estado { color: #0d2318; background: #34d399; }
.fu-cartao.est-ganho .fu-c-estado { color: #3ecf8e; }
.fu-cartao:is(.est-pausada, .est-encerrado, .est-tirado, .est-perdido, .est-retorno) .fu-c-estado { color: var(--tinta-3); }
.fu-cartao:is(.est-encerrado, .est-tirado, .est-perdido) :is(.fu-c-topo b, .fu-c-o) { color: var(--tinta-3); }
.fu-cartao.est-pausada .fu-passos i.on { background: var(--tinta-3); }

/* as cadências: o agente que faz os toques e uma coluna por prazo */
.fu-cads { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 10px; overflow-y: auto; overscroll-behavior: contain; }
.fu-agente { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; background: rgba(var(--f), .06); }
.fu-ag-txt { flex: 1 1 180px; min-width: 0; display: flex; flex-direction: column; }
.fu-ag-txt b { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fu-ag-txt small { font-size: 12.5px; color: var(--tinta-3); overflow-wrap: anywhere; }
.fu-agente > .espaco { flex: 1 0 0; }
.fu-prazos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: start; }
.fu-prazo { min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 0 6px 8px; border-radius: 8px; background: rgba(var(--f), .045); }
.fu-prazo > header { padding: 6px 4px 0; }
.fu-cad { display: flex; flex-direction: column; gap: 8px; padding: 10px 11px 10px; border-radius: 7px; background: rgba(var(--f), .085); box-shadow: 0 1px 2px rgba(0, 0, 0, .22); }
.fu-cad > header { display: flex; align-items: flex-start; gap: 8px; }
.fu-cad-abre { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; margin: -4px 0 0 -6px; padding: 4px 6px; border-radius: 6px; text-align: left; color: var(--tinta); transition: background-color .14s ease; }
.fu-cad-abre b { max-width: 100%; font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fu-cad-abre small { max-width: 100%; font-size: 12.5px; line-height: 1.35; color: var(--tinta-3); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fu-cad .chave { flex: none; }
/* a chave ligada em verde: o laranja fica só na ação principal da tela */
.fu .chave input:checked + i { background: #30d158; }
.fu-trilho { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.fu-trilho li { position: relative; display: grid; grid-template-columns: 20px 52px minmax(0, 1fr); align-items: start; gap: 8px; padding: 0 0 8px; font-size: 13px; }
.fu-trilho li::before { content: ""; position: absolute; left: 9.5px; top: 20px; bottom: 0; width: 1px; background: rgba(var(--f), .16); }
.fu-trilho li:last-child { padding-bottom: 0; }
.fu-trilho li:last-child::before { display: none; }
.fu-trilho li > i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 700; color: var(--tinta); background: rgba(var(--f), .14); }
.fu-trilho li > b { padding-top: 2px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.fu-trilho li > span { padding-top: 2px; line-height: 1.38; color: var(--tinta-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.fu-regras { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.fu-regras li { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; height: 24px; padding: 0 8px; border-radius: 5px; font-size: 12px; font-weight: 500; color: var(--tinta-2); background: rgba(var(--f), .07); }
.fu-regras li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fu-regras .ico { flex: none; opacity: .8; }
.fu-cad-pe { font-size: 12px; color: var(--tinta-3); }
.fu-cad.desligada :is(.fu-trilho, .fu-regras, .fu-cad-pe) { opacity: .5; }

/* o detalhe: a linha do tempo dos passos */
.fu-det { width: min(660px, 100%); height: min(680px, 100%); outline: none; }
.fu-det > header { align-items: flex-start; padding-top: 14px; }
.fu-det-quem { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.fu-det-quem b { font-size: 18px; font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }
.fu-det-quem small { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; font-weight: 400; color: var(--tinta-3); }
.fu-det-corpo { gap: 12px; }
.fu-det-cad { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fu-det-cad b { min-width: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.fu-det-estado { display: flex; align-items: center; gap: 7px; margin: 0; padding: 8px 10px; border-radius: 7px; font-size: 13.5px; font-weight: 600; color: var(--tinta-2); background: rgba(var(--f), .06); }
.fu-det-estado.est-atrasado { color: #ee6b5a; background: rgba(238, 107, 90, .14); }
.fu-det-estado.est-respondeu { color: #0d2318; background: #34d399; }
.fu-det-corpo h3 { margin: 4px 0 0; font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--tinta-3); }
.fu-linha { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.fu-linha li { position: relative; display: flex; gap: 12px; padding: 0 0 14px; min-width: 0; }
.fu-linha li::before { content: ""; position: absolute; left: 11.5px; top: 24px; bottom: 0; width: 1px; background: rgba(var(--f), .16); }
.fu-linha li:last-child { padding-bottom: 0; }
.fu-linha li:last-child::before { display: none; }
.fu-linha li > i { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--tinta-2); background: rgba(var(--f), .1); }
.fu-linha li > span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding-top: 3px; }
.fu-linha li b { font-size: 13.5px; font-weight: 600; color: var(--tinta-2); }
.fu-linha li small { font-size: 13px; line-height: 1.42; color: var(--tinta-3); overflow-wrap: anywhere; }
.fu-linha li.feito > i { color: #0d2318; background: #34d399; }
.fu-linha li.feito b { color: var(--tinta); }
.fu-linha li.agora > i { color: var(--ev-base, #12161d); background: var(--tinta); }
.fu-linha li.agora b { color: var(--tinta); }
.fu-linha li.agora small { color: var(--tinta-2); }
.fu-linha li.agora.atrasado > i { color: #fff; background: #ee6b5a; }
.fu-linha li.agora.atrasado b { color: #ee6b5a; }
.fu-linha li.fora { opacity: .55; }
.fu-linha li.fim > i { color: var(--tinta-3); }
.fu-antes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.fu-antes li { display: flex; flex-direction: column; padding: 7px 10px; border-radius: 7px; background: rgba(var(--f), .06); }
.fu-antes b { font-size: 13.5px; font-weight: 600; }
.fu-antes small { font-size: 12.5px; color: var(--tinta-3); }
.fu-det-pe { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 18px 16px; }

/* pôr em cadência */
.fu-por-form { height: min(640px, 100%); }
.fu-busca { margin: 0; }
.fu-busca input, .fu-busca input:focus-visible { outline: none; box-shadow: none; }
.fu-leads { display: flex; flex-direction: column; gap: 4px; }
.fu-lead { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 4px 10px; border-radius: 7px; text-align: left; color: var(--tinta); transition: background-color .14s ease; }
.fu-lead > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fu-lead b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fu-lead small { font-size: 12.5px; color: var(--tinta-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fu-escolhido { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; background: rgba(var(--f), .07); }
.fu-escolhido > span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.fu-escolhido b { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fu-escolhido small { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12.5px; color: var(--tinta-3); }
.fu-escolhas { display: flex; flex-direction: column; gap: 12px; }
.fu-escolhas-grupo { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.fu-escolha { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 9px 12px; border-radius: 7px; text-align: left; color: var(--tinta); background: rgba(var(--f), .06); transition: background-color .14s ease; }
.fu-escolha b { font-size: 14px; font-weight: 600; }
.fu-escolha small { font-size: 12.5px; color: var(--tinta-3); }
.fu-escolha.on { background: rgba(var(--f), .2); }
.fu-escolha.on b::after { content: "✓"; margin-left: 8px; color: var(--tinta-2); }

/* o editor da cadência */
.fu-editor { width: min(640px, 100%); height: min(760px, 100%); }
.fu-seg-prazo { align-self: flex-start; }
.fu-ed-passos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fu-ed-passo { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 8px; background: var(--poco); }
.fu-ed-topo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--tinta-2); }
.fu-ed-topo > i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--tinta); background: rgba(var(--f), .14); }
.fu-conta { display: inline-flex; align-items: center; height: 30px; border-radius: 6px; background: rgba(var(--f), .08); overflow: hidden; }
.fu-conta button { display: grid; place-items: center; width: 28px; height: 30px; color: var(--tinta-2); transition: background-color .14s ease; }
.fu-conta button:disabled { opacity: .3; cursor: default; }
.fu-conta input { width: 40px; height: 30px; border: 0; outline: 0; padding: 0; text-align: center; font: inherit; font-size: 14px; font-weight: 600; color: var(--tinta); background: none; }
.fu-unis button { height: 26px; padding: 0 9px; font-size: 12.5px; }
.fu-ed-tira { width: 28px; height: 28px; border-radius: 6px; }
.fu-ed-o { display: block; width: 100%; min-height: 54px; padding: 7px 9px; border: 0; border-radius: 6px; outline: 0; resize: none; font: inherit; font-size: 14px; line-height: 1.45; color: var(--tinta); background: rgba(var(--f), .06); }
.fu-ed-o:focus { background: rgba(var(--f), .09); }
.fu-ed-o::placeholder { color: var(--tinta-3); opacity: 1; }
.fu-ed-mais { align-self: flex-start; margin-top: 8px; }
.fu-ed-exemplo { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 8px; background: rgba(var(--f), .05); }
.fu-ed-exemplo b { font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--tinta-3); }
.fu-ed-exemplo ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.fu-ed-exemplo li { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px 0 4px; border-radius: 5px; font-size: 12.5px; font-weight: 500; color: var(--tinta-2); background: rgba(var(--f), .08); }
.fu-ed-exemplo li i { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--tinta); background: rgba(var(--f), .16); }

@media (hover: hover) and (pointer: fine) {
  .fu-cartao:hover, .fu-cad:hover { background: rgba(var(--f), .13); }
  .fu-cad-abre:hover, .fu-lead:hover, .fu-conta button:not(:disabled):hover { background: rgba(var(--f), .08); }
  .fu-escolha:not(.on):hover { background: rgba(var(--f), .11); }
}
.fu :is(.fu-cartao, .fu-cad-abre, .fu-lead, .fu-escolha):focus-visible, .fu-det:focus-visible { outline: none; box-shadow: 0 0 0 1.5px rgba(var(--f), .5); }

@container (max-width: 1120px) {
  .fu-momento { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 20px; }
}
@media (max-width: 860px) {
  .fu-momento { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; padding: 2px 4px 12px; }
  .fu-barra { flex-wrap: wrap; row-gap: 8px; }
  .fu-barra .segmento { flex: 1 1 100%; }
  .fu-barra .segmento button { flex: 1; min-height: 36px; }
  .fu-barra > .espaco { display: none; }
  .fu-barra .botao { flex: 1; height: 40px; justify-content: center; }
  /* no telefone a folha do follow-up cobre o app inteiro, como a do lead */
  .cr-painel, .fu { position: static; }
  /* no telefone as colunas descem uma embaixo da outra, e a área inteira rola */
  .fu-area { overflow-y: auto; overscroll-behavior: contain; }
  .fu-quadro { flex: none; display: flex; flex-direction: column; overflow: visible; padding: 8px; }
  .fu-col { flex: none; max-width: none; }
  .fu-col.vazia { display: none; }
  .fu-col-rolo { overflow: visible; }
  .fu-cads { flex: none; overflow: visible; padding: 8px; }
  .fu-prazos { grid-template-columns: minmax(0, 1fr); }
  .fu-cad-abre { min-height: 40px; }
  .fu-lead, .fu-escolha { min-height: 48px; }
  .fu-det, .fu-por-form, .fu-editor { width: 100%; height: 100%; border-radius: 0; background: var(--ev-base); }
  .fu-det-pe { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .fu-det-pe .botao { height: 40px; }
  .fu-det-pe > .espaco { display: none; }
  .fu-conta, .fu-conta button, .fu-conta input { height: 38px; }
  .fu-conta button { width: 38px; }
  .fu-unis button { height: 36px; }
  .fu-ed-tira { width: 38px; height: 38px; }
  .fu-ed-o, .fu-conta input, .fu-busca input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .fu-cartao, .fu-cad { transition: none; } }
