/*
 * Layout do CRM. Os tokens e os componentes de marca vêm de
 * marca/tokens.css (que é design/tokens.css) — aqui fica só o que é
 * estrutura de tela.
 *
 * Identidade Pinheiros: cinza quente de fundo, painéis brancos
 * flutuando, rail verde escuro, verde vivo só no que é ação ou
 * estado. Canto redondo em tudo. Separação é sombra e espaço, não
 * borda — borda vira grade e mata o ar.
 */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.carregando {
  min-height: 60vh; display: grid; place-items: center;
  font-weight: 700; font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-muted);
}

/* ═══ Símbolo ═══════════════════════════════════════════════════
   Entra por mask: assim a flecha herda a cor do contexto — branca no
   rail, verde na tela clara — sem precisar de um arquivo por cor. */
.marca-simbolo {
  --altura: 30px;
  height: var(--altura);
  width: calc(var(--altura) * 399 / 764);   /* proporção real, 399:764 */
  background: currentColor;
  -webkit-mask: url('/marca/logo-mark.png') center / contain no-repeat;
  mask: url('/marca/logo-mark.png') center / contain no-repeat;
  flex: none;
}

/* wordmark: "PINHEIROS" claro + "COMPANY" verde, uma linha só */
.marca-nome {
  font-family: var(--font-display); font-weight: 800; font-size: 14px;
  letter-spacing: 0.14em; text-transform: uppercase; line-height: 1;
}
.marca-nome em { font-style: normal; color: var(--verde); }

/* ═══ Login ═════════════════════════════════════════════════════
   Uma das três telas onde a superfície de marca é permitida (login,
   splash, capa de relatório). Gradiente verde + malha de pontos +
   a flecha gigante sangrando pelo canto. */

.login {
  min-height: 100dvh;
  display: grid; place-items: center; padding: 24px;
  position: relative; overflow: hidden;
  background:
    radial-gradient(1200px 700px at 78% -10%, rgba(22, 192, 96, 0.28) 0%, transparent 60%),
    linear-gradient(160deg, #0d5a30 0%, #073f20 58%, #052d17 100%);
}
.login::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.10) 1px, transparent 1px);
  background-size: 18px 18px;
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 0%, transparent 72%);
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 0%, transparent 72%);
}
/* a flecha gigante, quase invisível, sangrando pela direita */
.login::after {
  content: ''; position: absolute;
  right: -8%; bottom: -22%; height: 130%; width: calc(130vh * 399 / 764);
  background: rgba(255, 255, 255, 0.055);
  -webkit-mask: url('/marca/logo-mark.png') center / contain no-repeat;
  mask: url('/marca/logo-mark.png') center / contain no-repeat;
  pointer-events: none;
}

.login-caixa {
  position: relative; z-index: 1;
  width: 100%; max-width: 380px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  padding: 38px 34px 34px;
}
.login-topo {
  display: flex; align-items: center; gap: 11px; margin-bottom: 26px;
  color: var(--verde-deep);
}
.login-topo .marca-nome { color: var(--text); }
.login-titulo {
  font-family: var(--font-display); font-weight: 800; font-size: 25px;
  text-transform: uppercase; letter-spacing: -0.01em; color: var(--navy);
}
.login-sub { color: var(--text-soft); font-size: 13px; margin: 6px 0 26px; }

.campo { margin-bottom: 16px; }
.campo > label {
  display: block; font-weight: 700; font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 7px;
}

input:not([type]), input[type=text], input[type=email], input[type=password],
input[type=number], input[type=search], input[type=date], input[type=time], input[type=tel], input[type=month], select, textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: var(--text);
  font-family: var(--font); font-weight: 500;
  /* 16px: abaixo disso o Safari do iPhone dá zoom sozinho ao focar */
  font-size: 16px;
  padding: 11px 16px;
  transition: background 120ms ease, border-color 120ms ease;
}
textarea { border-radius: var(--radius-card); min-height: 92px; resize: vertical; padding: 12px 16px; }
input:focus, select:focus, textarea:focus {
  background: var(--surface); border-color: var(--verde); outline: none;
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }

.btn-full { width: 100%; display: block; }

.aviso {
  border-radius: var(--radius-card);
  background: var(--danger-bg); color: var(--danger);
  padding: 11px 16px; margin-bottom: 16px;
  font-size: 13px; font-weight: 600;
}
.aviso-ok { background: var(--ok-bg); color: var(--ok); }

/* ═══ Casca ═════════════════════════════════════════════════════ */

.app { display: flex; gap: var(--gap); padding: var(--gap); min-height: 100dvh; }

.rail {
  width: var(--sidebar-w); flex: none;
  background: var(--sidebar); color: var(--text-on-dark);
  border-radius: var(--radius-card);
  padding: 30px 0 16px;
  display: flex; flex-direction: column;
  position: sticky; top: var(--gap);
  height: calc(100dvh - var(--gap) * 2);
  overflow: hidden;
}
/* malha de pontos do deck, bem discreta */
.rail::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 16px 16px;
  -webkit-mask-image: linear-gradient(#000, transparent 42%);
  mask-image: linear-gradient(#000, transparent 42%);
  pointer-events: none;
}
/*
 * Marca d'água: a flecha grande sangrando pelo canto de baixo.
 *
 * Fica atrás de tudo e bem de leve — se der pra "ler" o símbolo, está
 * forte demais e vira ruído atrás do nome dos menus. Sangrar pela
 * borda é de propósito: símbolo inteiro e centrado pareceria um logo
 * perdido no meio da coluna, não textura.
 */
.rail::after {
  content: ''; position: absolute;
  left: -14%; bottom: -8%;
  width: 150%; height: 62%;
  background: rgba(255, 255, 255, 0.055);
  -webkit-mask: url('/marca/logo-mark.png') left bottom / contain no-repeat;
  mask: url('/marca/logo-mark.png') left bottom / contain no-repeat;
  pointer-events: none;
}
.rail > * { position: relative; z-index: 1; }

/* bloco da marca: empilhado e com ar, não um lockup espremido */
.rail-marca {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 12px; padding: 0 22px 26px;
}
.rail-marca .marca-simbolo { color: #fff; opacity: .96; }
.rail-marca .marca-nome {
  color: #fff; font-size: 15px; letter-spacing: .16em; line-height: 1.35;
}
/* "COMPANY" desce pra segunda linha: é assim no material impresso */
.rail-marca .marca-nome em { display: block; color: var(--verde); font-size: 12.5px; }

.marca-linha {
  width: 30px; height: 2px; border-radius: 2px;
  background: var(--verde); opacity: .9;
}
.marca-tag {
  font-size: 9.5px; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: rgba(242, 246, 241, 0.42);
}

.menu { flex: 1; overflow-y: auto; padding: 0 12px; }
.menu-grupo { margin-bottom: 18px; }
.menu-rotulo {
  font-size: 9px; font-weight: 800; letter-spacing: .2em;
  text-transform: uppercase; color: rgba(242, 246, 241, 0.3);
  padding: 0 16px 7px;
}
.menu a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 16px; margin-bottom: 2px;
  border-radius: var(--radius-pill);
  font-size: 13.5px; font-weight: 600;
  color: rgba(242, 246, 241, 0.72);
  transition: background 120ms ease, color 120ms ease;
}
.menu a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
/* item ativo é pílula verde vivo — é a marca aparecendo na navegação */
.menu a.ativo { background: var(--verde); color: #fff; box-shadow: 0 2px 10px rgba(22, 192, 96, 0.3); }

/* contador do menu: só aparece quando tem número */
.conta {
  font-style: normal; font-size: 11px; font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: rgba(242, 246, 241, 0.55);
}
.conta:empty { display: none; }
/* vencido/esperando em vermelho: é o único lugar do menu onde a cor
   quer dizer "vá aqui agora" */
.conta.urgente {
  background: #e0503f; color: #fff;
  min-width: 19px; text-align: center;
  padding: 1px 6px; border-radius: 999px;
}
.menu a.ativo .conta { color: rgba(255, 255, 255, 0.85); }

.rail-rodape {
  padding: 14px 16px 0; margin: 12px 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* status do canal: bolinha + texto, o mesmo sinal do WhatsApp Web */
.rail-canal {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 600;
  color: rgba(242, 246, 241, 0.55);
  padding: 7px 6px; margin-bottom: 8px;
  border-radius: var(--radius-pill);
}
.rail-canal:hover { background: rgba(255, 255, 255, 0.06); }
.rail-canal .ponto {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: rgba(255, 255, 255, 0.3);
}
.rail-canal.conectado .ponto { background: var(--verde); box-shadow: 0 0 0 3px rgba(22, 192, 96, .2); }
.rail-canal.conectado { color: rgba(242, 246, 241, 0.72); }
.rail-canal.conectando .ponto { background: #e0a83a; animation: pulsa 1.4s ease-in-out infinite; }
@keyframes pulsa { 50% { opacity: .35; } }

.rail-eu { display: flex; align-items: center; gap: 10px; }
.rail-eu-texto { flex: 1; min-width: 0; }
.avatar {
  width: 32px; height: 32px; flex: none;
  border-radius: 50%; background: rgba(255, 255, 255, 0.12);
  display: grid; place-items: center;
  font-weight: 800; font-size: 13px; color: #fff;
}
.quem {
  font-weight: 700; font-size: 13.5px; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.papel {
  font-weight: 700; font-size: 9.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: rgba(242, 246, 241, 0.5);
}
.btn-sair {
  background: rgba(255, 255, 255, 0.1); color: #fff; border: none;
  border-radius: var(--radius-pill); padding: 7px 13px;
  font-weight: 700; font-size: 11.5px; cursor: pointer; flex: none;
}
.btn-sair:hover { background: rgba(255, 255, 255, 0.18); }

.conteudo { flex: 1; min-width: 0; padding: 12px 10px 60px; max-width: 1280px; }
.topo {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.topo p { color: var(--text-soft); font-size: 13.5px; margin-top: 7px; }
.topo-acoes { display: flex; gap: 8px; align-items: center; }

/* ═══ Cards ═════════════════════════════════════════════════════ */

.grade { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.card { padding: 18px 20px; }

.secao { margin-top: 26px; }
.secao > h3 {
  font-family: var(--font-display); font-weight: 800; font-size: 13px;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--navy); margin-bottom: 11px; padding-left: 2px;
}

.nota { font-size: 12.5px; color: var(--text-soft); margin-top: 7px; }

/* ═══ Tabela ════════════════════════════════════════════════════
   Mora dentro de um card branco; a divisória é clarinha e some na
   última linha, pra lista não virar grade. */

.tabela-card { padding: 6px 8px; overflow-x: auto; }
.tabela { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tabela th {
  text-align: left; font-weight: 700; font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted);
  padding: 12px 14px 10px; white-space: nowrap;
}
.tabela td {
  padding: 12px 14px; border-top: 1px solid var(--border);
  vertical-align: middle; font-weight: 500;
}
.tabela tbody tr:hover td { background: var(--surface-2); }
.tabela tbody tr:hover td:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.tabela tbody tr:hover td:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.tabela .num { text-align: right; font-variant-numeric: tabular-nums; }
.clicavel { cursor: pointer; }

.vazio {
  padding: 40px 24px; text-align: center;
  color: var(--text-muted); font-size: 13.5px; font-weight: 500;
}

/* ═══ Logo do cliente ═══════════════════════════════════════════ */

.logo-caixa {
  width: 92px; height: 92px; flex: none;
  border-radius: var(--radius-card); background: var(--surface-2);
  display: grid; place-items: center; overflow: hidden;
}
.logo-caixa img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.inicial {
  font-family: var(--font-display); font-weight: 800; color: var(--text-faint);
  font-size: 30px; line-height: 1;
}
.logo-mini {
  width: 34px; height: 34px; border-radius: var(--radius-pill);
  background: var(--surface-2); display: grid; place-items: center;
  overflow: hidden; flex: none;
}
.logo-mini img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.logo-mini .inicial { font-size: 14px; }

/* ═══ Assistente ════════════════════════════════════════════════ */

/* A tela inteira vira o chat: altura da janela, conversa rolando por
   dentro, campo preso embaixo. Um painel branco só — nada de caixas
   soltas no cinza. */
.conteudo-chat {
  display: flex; flex-direction: column;
  height: calc(100dvh - var(--gap) * 2); padding-bottom: 0;
  max-width: none;
}
.conteudo-chat .topo { margin-bottom: 14px; }
.conteudo-chat #corpo { flex: 1; min-height: 0; display: flex; }

.chat {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius-card);
  box-shadow: var(--shadow-2); overflow: hidden;
}

.chat-topo {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px 12px 18px; border-bottom: 1px solid var(--border);
}
.chat-contexto { display: flex; align-items: center; gap: 10px; margin: 0; min-width: 0; }
.chat-contexto span {
  font-weight: 700; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted);
}
.chat-contexto select { width: auto; max-width: 320px; font-size: 14px; padding: 8px 36px 8px 14px; }

.chat-rolagem { flex: 1; min-height: 0; overflow-y: auto; scroll-behavior: smooth; }
.chat-fio {
  max-width: 820px; margin: 0 auto; padding: 28px 24px 12px;
  display: flex; flex-direction: column; gap: 22px; min-height: 100%;
}

/* ── vazio: boas-vindas + sugestões ── */
.chat-vazio {
  margin: auto 0; padding: 24px 0 8px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.chat-vazio-marca {
  width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center;
  background: var(--verde-wash); color: var(--verde); margin-bottom: 18px;
}
.chat-vazio h2 {
  font-family: var(--font-display); font-weight: 800; font-size: 24px;
  letter-spacing: -0.01em; color: var(--navy);
}
.chat-vazio p { color: var(--text-soft); font-size: 14px; margin-top: 8px; }
.chat-sugestoes {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
  width: 100%; margin-top: 28px;
}
.chat-sugestao {
  display: flex; flex-direction: column; gap: 6px; text-align: left;
  padding: 14px 16px; border-radius: 14px; cursor: pointer;
  background: var(--surface-2); border: 1px solid transparent;
  font-size: 14px; font-weight: 500; line-height: 1.4; color: var(--text);
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.chat-sugestao:hover { background: var(--surface); border-color: var(--verde); transform: translateY(-1px); }
.chat-sugestao-tag {
  font-weight: 700; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--verde-dark, var(--verde));
}

/* ── mensagens ── */
.ia-msg { display: flex; gap: 12px; animation: ia-entra 180ms ease-out; }
.ia-msg-eu { justify-content: flex-end; }
.ia-balao {
  max-width: 75%; padding: 11px 16px; border-radius: 18px; border-bottom-right-radius: 6px;
  background: var(--verde); color: #fff; font-size: 14.5px; font-weight: 500;
  line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
}
.ia-avatar {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  display: grid; place-items: center; background: var(--verde-wash); color: var(--verde);
}
.ia-corpo { flex: 1; min-width: 0; padding-top: 5px; }
.ia-texto { font-size: 14.5px; line-height: 1.65; color: var(--text); overflow-wrap: anywhere; }
.ia-texto p + p, .ia-texto p + ul, .ia-texto p + ol, .ia-texto ul + p, .ia-texto ol + p { margin-top: 10px; }
.ia-texto ul, .ia-texto ol { padding-left: 20px; margin-top: 6px; }
.ia-texto li + li { margin-top: 4px; }
.ia-texto h4 { font-size: 15px; font-weight: 800; color: var(--navy); margin: 14px 0 4px; }
.ia-texto h4:first-child { margin-top: 0; }
.ia-texto strong { font-weight: 700; }
.ia-texto code {
  font-size: 13px; background: var(--surface-2); padding: 1px 6px; border-radius: 6px;
}
.ia-rodape {
  display: flex; align-items: center; gap: 12px; margin-top: 10px;
  font-weight: 700; font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-muted);
}
.ia-copiar {
  background: none; border: 0; cursor: pointer; padding: 3px 8px; border-radius: 6px;
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--text-soft);
}
.ia-copiar:hover { background: var(--surface-2); color: var(--text); }
.ia-erro {
  font-size: 14px; color: var(--danger); background: var(--danger-bg);
  padding: 10px 14px; border-radius: 12px; display: inline-block;
}

.digitando { display: inline-flex; gap: 5px; padding: 8px 0; }
.digitando i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted);
  animation: ia-pulo 1.1s infinite ease-in-out;
}
.digitando i:nth-child(2) { animation-delay: 0.15s; }
.digitando i:nth-child(3) { animation-delay: 0.3s; }
@keyframes ia-pulo { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }
@keyframes ia-entra { from { opacity: 0; transform: translateY(4px); } }

/* ── campo ── */
.chat-rodape { padding: 10px 24px 14px; }
.chat-campo {
  max-width: 820px; margin: 0 auto; position: relative;
  display: flex; align-items: flex-end; gap: 8px;
  background: var(--surface-2); border: 1px solid transparent; border-radius: 22px;
  padding: 6px 6px 6px 18px; transition: border-color 120ms ease, background 120ms ease;
}
.chat-campo:focus-within { background: var(--surface); border-color: var(--verde); }
.chat-campo textarea {
  flex: 1; min-height: 0; max-height: 200px; resize: none; overflow-y: auto;
  background: transparent; border: 0; border-radius: 0; padding: 9px 0; line-height: 1.45;
}
.chat-campo textarea:focus { background: transparent; border: 0; }
.chat-enviar {
  width: 38px; height: 38px; flex: none; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--verde); color: #fff;
  transition: background 120ms ease, opacity 120ms ease;
}
.chat-enviar:hover:not(:disabled) { background: var(--verde-hi); }
.chat-enviar:disabled { opacity: 0.35; cursor: default; }
.chat-aviso {
  max-width: 820px; margin: 8px auto 0; text-align: center;
  font-size: 11.5px; color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
  .ia-msg, .digitando i { animation: none; }
  .chat-sugestao:hover { transform: none; }
}

/* no celular o rail vira barra no topo com altura variável: o chat
   pega a janela menos um respiro em vez de calcular a partir da .app */
@media (max-width: 860px) {
  .conteudo-chat { height: auto; }
  /* desconta rail no topo, título e a barra de abas fixa embaixo */
  .chat { height: calc(100dvh - 330px); min-height: 380px; }
  .chat-fio { padding: 20px 14px 8px; }
  .chat-rodape { padding: 8px 10px 10px; }
  .chat-sugestoes { grid-template-columns: 1fr; }
  .chat-contexto select { max-width: 200px; }
  .ia-balao { max-width: 88%; }
  .ia-avatar { display: none; }
  .chat-aviso { display: none; }
}

.linha-campos { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
/* nicho · cidade · UF numa linha só: UF é estreito */
.linha-campos.linha-cidade { grid-template-columns: 1fr 1fr 76px; }
@media (max-width: 560px) { .linha-campos.linha-cidade { grid-template-columns: 1fr 76px; } .linha-cidade > .campo:first-child { grid-column: 1 / -1; } }

/* ═══ Celular ═══════════════════════════════════════════════════ */

/* atalhos do rodapé só existem no celular */
.barra-abas { display: none; }

@media (max-width: 860px) {
  .app { flex-direction: column; padding: 8px 8px 0; gap: 8px; }

  /* topo: só símbolo + nome numa linha, sem a pilha da marca */
  .rail {
    width: auto; height: auto; position: static; overflow: visible;
    flex-direction: row; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 12px 10px 14px; border-radius: var(--radius-card);
  }
  .rail::after { display: none; }
  .rail-marca { padding: 0; flex-direction: row; align-items: center; gap: 9px; min-width: 0; }
  .rail-marca .marca-simbolo { --altura: 28px !important; }
  .rail-marca .marca-nome { font-size: 12px; letter-spacing: .14em; white-space: nowrap; }
  .rail-marca .marca-nome em { font-size: 10px; }
  .marca-linha, .marca-tag { display: none; }
  .rail-rodape {
    border-top: 0; padding: 0; margin: 0;
    display: flex; align-items: center; gap: 6px; min-width: 0;
  }
  /* canal vira só a bolinha: o texto não cabe ao lado do nome */
  .rail-canal { margin: 0; padding: 8px; }
  .rail-canal .canal-texto { display: none; }
  .rail-eu { gap: 6px; }
  .rail-eu-texto, .papel { display: none; }
  .avatar { width: 30px; height: 30px; font-size: 12px; }
  .btn-sair { padding: 7px 11px; }

  /* barra de atalhos embaixo, onde o polegar alcança */
  .barra-abas {
    position: fixed; left: 8px; right: 8px; bottom: max(8px, env(safe-area-inset-bottom)); z-index: 42;
    display: flex; gap: 2px; padding: 6px;
    background: var(--sidebar); border-radius: var(--radius-pill);
    box-shadow: var(--shadow-3);
  }
  .barra-abas a, .barra-abas-menu {
    flex: 1 1 0; min-width: 0; position: relative;
    display: flex; align-items: center; justify-content: center; gap: 5px;
    padding: 10px 4px; border-radius: var(--radius-pill);
    font-size: 12px; font-weight: 700; color: rgba(242, 246, 241, 0.72);
    white-space: nowrap;
  }
  .barra-abas a span { overflow: hidden; text-overflow: ellipsis; }
  .barra-abas a.ativo { background: var(--verde); color: #fff; }
  .barra-abas .conta { position: absolute; top: -5px; right: 4px; font-size: 10px; }
  .barra-abas-menu { border: 0; background: rgba(255, 255, 255, 0.1); color: #fff; cursor: pointer; font-family: inherit; }
  .menu-aberto .barra-abas-menu { background: #fff; color: var(--sidebar); }

  /* menu completo vira gaveta que sobe acima dos atalhos */
  .menu {
    display: none;
    position: fixed; left: 8px; right: 8px; z-index: 41;
    bottom: calc(max(8px, env(safe-area-inset-bottom)) + 64px);
    max-height: calc(100dvh - 96px); overflow-y: auto; overscroll-behavior: contain;
    padding: 16px 8px 6px;
    background: var(--sidebar); border-radius: 22px; box-shadow: var(--shadow-3);
  }
  .menu-aberto .menu {
    display: grid; grid-template-columns: 1fr 1fr; column-gap: 4px; align-content: start;
  }
  .menu-grupo { margin-bottom: 14px; min-width: 0; }
  .menu-rotulo { padding: 0 12px 6px; }
  .menu a { padding: 10px 12px; font-size: 13.5px; }
  .menu a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* fundo escurecido atrás da gaveta */
  .menu-aberto::before {
    content: ''; position: fixed; inset: 0; z-index: 40;
    background: rgba(16, 18, 17, .45);
  }

  .conteudo { padding: 4px 4px 90px; }
  .topo { margin-bottom: 16px; }
  .grade { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
  .metric { font-size: 27px; }
  .balao { max-width: 88%; }
}

/* ------------------------------------------------------------------ */
/* funil                                                               */
/* ------------------------------------------------------------------ */

/*
 * O board rola na horizontal e as colunas não encolhem. A alternativa
 * era espremer sete etapas na largura da tela, e card de negócio com
 * 90px de largura não é lido por ninguém.
 */
.board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 14px;
  scroll-snap-type: x proximate;
}

.coluna {
  flex: 0 0 272px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
}

.coluna-topo { padding: 0 4px 10px; }
.coluna-nome {
  font-weight: 700; font-size: 13px; letter-spacing: .02em;
  text-transform: uppercase; color: var(--text);
}
.coluna-soma { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.coluna-corpo {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 140px;
  padding: 8px;
  border-radius: var(--radius-lg, 18px);
  background: rgba(0, 0, 0, .035);
  transition: background .15s;
}
/* o alvo do drop precisa se anunciar, senão soltar vira chute */
.coluna-corpo.sobre { background: rgba(22, 192, 96, .14); }

.coluna-vazia {
  font-size: 12px; color: var(--text-muted);
  text-align: center; padding: 18px 0;
}

.negocio {
  background: var(--surface, #fff);
  border-radius: 12px;
  padding: 12px 13px;
  box-shadow: var(--shadow-1, 0 1px 3px rgba(0,0,0,.08));
  cursor: pointer;
  transition: box-shadow .15s, transform .15s;
}
.negocio:hover { box-shadow: var(--shadow-2, 0 6px 18px rgba(0,0,0,.12)); }
.negocio.arrastando { opacity: .45; transform: rotate(1.5deg); }

.negocio-titulo { font-weight: 700; font-size: 14px; line-height: 1.3; }
.negocio-empresa { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.negocio-rodape {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; gap: 8px;
}
.negocio-valor {
  font-weight: 700; font-size: 13px;
  font-variant-numeric: tabular-nums; color: var(--verde-deep, #0b6b35);
}
.negocio-valor small { font-weight: 500; color: var(--text-muted); }

/* ------------------------------------------------------------------ */
/* tarefas                                                             */
/* ------------------------------------------------------------------ */

.filtros {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: space-between; margin-bottom: 18px;
}
.abas {
  display: inline-flex; gap: 2px; padding: 3px;
  background: rgba(0, 0, 0, .05); border-radius: 999px;
}
.abas button {
  border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--text-soft, #5b5b57);
  padding: 7px 15px; border-radius: 999px;
  transition: background .15s, color .15s;
}
.abas button:hover { color: var(--text); }
.abas button.ativo {
  background: var(--surface, #fff); color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
}

.tarefa {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 18px;
  border-top: 1px solid var(--border, rgba(0,0,0,.06));
}
.tarefa:first-child { border-top: 0; }
.tarefa-texto { flex: 1; min-width: 0; }
.tarefa-titulo { font-weight: 600; font-size: 14px; }
.tarefa-nota { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.tarefa-prazo {
  font-size: 13px; font-variant-numeric: tabular-nums;
  color: var(--text-muted); white-space: nowrap;
}
.tarefa-prazo.vencida { color: var(--danger); font-weight: 700; }
/* concluída fica visível de propósito: sumir some com a prova de que
   foi feita, e a primeira pergunta do dia seguinte é "isso foi feito?" */
.tarefa.feita .tarefa-titulo { text-decoration: line-through; color: var(--text-muted); }

button.check {
  flex: 0 0 auto; width: 21px; height: 21px; padding: 0;
  border: 2px solid var(--border-hover, #cfcac2); border-radius: 50%;
  background: transparent; cursor: pointer;
  transition: background .15s, border-color .15s;
}
button.check:hover:not(:disabled) { border-color: var(--verde); }
button.check:disabled { cursor: default; opacity: .5; }
button.check.marcado {
  background: var(--verde) no-repeat center/11px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M1.5 6.4l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  border-color: var(--verde);
}

@media (max-width: 720px) {
  .coluna { flex-basis: 84vw; }
  .filtros { gap: 8px; }
  .abas { width: 100%; justify-content: space-between; }
}

/* ═══ Gráficos ══════════════════════════════════════════════════
   Mesmo vocabulário do deck de relatório: colunas pareadas verde
   escuro / verde vivo, medidor de meia-lua com agulha navy, barra
   horizontal em pílula. Quem lê o relatório reconhece o CRM. */

.graficos {
  display: grid; gap: var(--gap); margin-top: var(--gap);
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
}
.graficos-2 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

.dcard { padding: 22px 22px 20px; }
.dcard > h4 {
  font-family: var(--font-display); font-size: 14.5px; font-weight: 800;
  letter-spacing: -.01em; display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px;
}

.g-leg { display: flex; gap: 18px; justify-content: center; font-size: 11px;
         font-weight: 600; color: var(--text-soft); margin-bottom: 12px; }
.g-leg b { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.g-leg b.a, .g-mo i.a { background: var(--verde-deep); }
.g-leg b.b, .g-mo i.b { background: var(--verde); }
.g-leg b.c, .g-mo i.c { background: var(--navy); }

.g-wrap { position: relative; height: 210px; }
.g-lines { position: absolute; inset: 0 0 24px 46px; }
.g-lines i { position: absolute; left: 0; right: 0; height: 1px; background: var(--chart-grid); }
.g-lines i span { position: absolute; left: -46px; top: -6px; width: 38px; text-align: right;
                  font-size: 9.5px; color: var(--text-muted); font-weight: 600;
                  font-variant-numeric: tabular-nums; }
.g-bars { position: absolute; inset: 0 0 24px 46px; display: flex;
          align-items: flex-end; justify-content: space-around; }
.g-mo { height: 100%; display: flex; align-items: flex-end; gap: 3px; position: relative; }
.g-mo i { width: 13px; display: block; border-radius: 3px 3px 0 0; min-height: 2px; }
.g-mo em { position: absolute; bottom: -21px; left: -10px; right: -10px; text-align: center;
           font-style: normal; font-size: 10.5px; font-weight: 600; color: var(--text-muted); }

.med { text-align: center; display: grid; place-items: center; padding-top: 6px; }
.med svg { width: 100%; max-width: 168px; }
.pont { text-align: center; margin-top: 6px; }
.pont .n { font-family: var(--font-display); font-weight: 800; font-size: 40px;
           letter-spacing: -.03em; color: var(--navy); line-height: 1; }
.pont .s { font-size: 12.5px; color: var(--text-soft); margin-top: 8px; }

.barras-h { display: grid; gap: 14px; }
.bh-t { display: flex; justify-content: space-between; gap: 10px;
        font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.bh-t span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bh-t b { font-variant-numeric: tabular-nums; }
.bh-trilho { height: 10px; border-radius: var(--radius-pill); background: var(--verde-wash); overflow: hidden; }
.bh-trilho i { display: block; height: 100%; border-radius: inherit; background: var(--grad-verde); }

/* card de destaque: o número que responde "quanto a gente fatura" */
.card.destaque {
  color: #fff;
  background:
    radial-gradient(420px 200px at 100% 0%, rgba(43, 217, 124, .35), transparent 70%),
    linear-gradient(150deg, #0d5a30, #073f20);
}
.card.destaque .label, .card.destaque .nota { color: rgba(255, 255, 255, .72); }

/* ═══ Mensalidades ══════════════════════════════════════════════ */

.mensalidades {
  display: grid; gap: var(--gap); align-items: start;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
}
.mensalidades .tabela tfoot td {
  padding: 14px; border-top: 2px solid var(--border-hover);
  font-weight: 800; font-family: var(--font-display);
}
.input-valor, .input-dia {
  text-align: right; font-variant-numeric: tabular-nums; font-weight: 700;
  padding: 7px 10px; height: auto;
}
.input-valor { width: 128px; }
.input-dia { width: 58px; }
.input.invalido { border-color: var(--danger); background: var(--danger-bg); }

/* ── notas fiscais ── */
.notas-topo { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.notas-mes { display: flex; align-items: center; gap: 2px; }
.notas-mes strong {
  font-family: var(--font-display); font-weight: 800; font-size: 16px;
  text-transform: capitalize; min-width: 138px; text-align: center;
}
.notas-mes .btn { padding: 6px 12px; font-size: 16px; line-height: 1; }
.notas-conta { margin: 0; }
.notas-acoes { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.notas .tabela-card { padding: 0; box-shadow: none; overflow-x: auto; }
.notas .tabela { min-width: 720px; }
.notas-desc {
  max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text-soft);
}
.notas-erro {
  margin-top: 6px; max-width: 320px; font-size: 12px; line-height: 1.4;
  color: var(--danger); font-weight: 600; white-space: normal;
}
.notas-botoes { white-space: nowrap; text-align: right; }
.notas-botoes .btn { padding: 7px 12px; font-size: 13px; }
.notas-botoes .btn + .btn { margin-left: 4px; }
.modal-estreito { width: min(520px, 100%); }

.nf-cert { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.nf-cert-info {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 8px; padding: 12px 16px; border-radius: var(--radius-card); background: var(--surface-2);
}
.nf-cert-info > div { flex: 1; min-width: 200px; }
.nf-cert-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.nf-cert-form input[type=file] { flex: 1 1 220px; font-size: 13px; }
.nf-cert-form input[type=password] { flex: 1 1 200px; width: auto; }

@media (max-width: 760px) {
  .notas-acoes { margin-left: 0; width: 100%; }
  .notas-acoes .btn { flex: 1; }
  .notas-desc { max-width: 160px; }
}
tr.salvando { opacity: .5; pointer-events: none; }

/* ═══ Modal (importação) ════════════════════════════════════════ */

.modal-fundo {
  position: fixed; inset: 0; z-index: 50; padding: 24px;
  background: rgba(10, 20, 14, .45); backdrop-filter: blur(3px);
  display: grid; place-items: center;
}
.modal {
  width: min(880px, 100%); max-height: calc(100dvh - 48px);
  display: flex; flex-direction: column; box-shadow: var(--shadow-3); padding: 0;
}
.modal-topo {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding: 22px 24px 14px; border-bottom: 1px solid var(--border);
}
.modal-titulo { font-family: var(--font-display); font-weight: 800; font-size: 19px;
                margin-top: 4px; word-break: break-word; }
.modal-corpo { padding: 18px 24px 22px; overflow-y: auto; }
.modal-sub {
  font-family: var(--font-display); font-weight: 800; font-size: 12px;
  text-transform: uppercase; letter-spacing: .06em; color: var(--navy);
  margin: 22px 0 6px;
}
.modal-corpo .tabela-card { padding: 0; }
.modal-rodape {
  display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
  position: sticky; bottom: -22px; background: var(--surface);
  margin: 18px -24px -22px; padding: 16px 24px; border-top: 1px solid var(--border);
}
.marcar { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.marcar input, .modal .tabela input[type="checkbox"] { accent-color: var(--verde); width: 16px; height: 16px; }
.card-leve { background: var(--surface-2); box-shadow: none; padding: 14px 16px; }
.import-resumo { font-size: 14px; line-height: 1.55; }
.import-aviso {
  margin-top: 10px; padding: 10px 14px; border-radius: var(--radius);
  background: var(--warn-bg); color: var(--warn); font-size: 13px; font-weight: 600;
}

/* ═══ Conversas (inbox) ═════════════════════════════════════════
   Três colunas: lista, conversa, ficha. Altura presa na janela —
   quem rola é cada coluna, não a página, senão o campo de digitar
   some lá embaixo numa conversa longa. */

.inbox {
  display: grid; gap: var(--gap);
  grid-template-columns: 320px minmax(0, 1fr) 270px;
  height: calc(100dvh - 150px); min-height: 480px;
}
.inbox > section, .inbox > aside {
  background: var(--surface); border-radius: var(--radius-card);
  box-shadow: var(--shadow-1); min-height: 0; display: flex; flex-direction: column;
}

.inbox-busca { padding: 14px 14px 8px; }
.abas-inbox { margin: 0 14px 8px; display: flex; }
.abas-inbox button { flex: 1; padding: 6px 8px; font-size: 12px; }
.abas-inbox em { font-style: normal; font-weight: 800; margin-left: 4px; color: var(--verde-deep); }
.abas-inbox em:empty { display: none; }

.conversas { flex: 1; overflow-y: auto; padding: 4px 8px 10px; }
.conversa {
  width: 100%; display: flex; gap: 11px; align-items: center; text-align: left;
  border: 0; background: transparent; font: inherit; color: inherit; cursor: pointer;
  padding: 10px; border-radius: 14px; transition: background .12s;
}
.conversa:hover { background: var(--surface-2); }
.conversa.ativa { background: var(--verde-wash); }
.conversa .inicial, .ficha-topo .inicial {
  width: 40px; height: 40px; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-size: 15px; text-transform: uppercase;
  background: var(--verde-wash); color: var(--verde-deep);
}
.conversa.ativa .inicial { background: var(--verde); color: #fff; }
.conversa-texto { flex: 1; min-width: 0; display: grid; gap: 3px; }
.conversa-topo { display: flex; justify-content: space-between; gap: 8px; }
.conversa-topo b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversa-topo i { font-style: normal; font-size: 11px; color: var(--text-muted); flex: none; }
.conversa-previa { font-size: 12.5px; color: var(--text-soft); overflow: hidden;
                   text-overflow: ellipsis; white-space: nowrap; }
.conversa-sinais { display: grid; gap: 4px; justify-items: end; flex: none; }
.nao-lidas {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--verde); color: #fff; font-size: 11px; font-weight: 800;
  display: grid; place-items: center;
}
.espera { font-size: 10.5px; font-weight: 700; color: var(--warn); }

.inbox-conversa > .vazio, .inbox-conversa > .carregando { margin: auto; }
.conversa-cabeca {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.conversa-nome { font-family: var(--font-display); font-weight: 800; font-size: 15px; }
.conversa-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.conversa-acoes { display: flex; gap: 8px; }

.thread {
  flex: 1; overflow-y: auto; padding: 18px 20px;
  display: flex; flex-direction: column; gap: 6px;
  background:
    radial-gradient(circle at 1px 1px, rgba(16, 18, 17, .045) 1px, transparent 0) 0 0 / 18px 18px,
    var(--surface-2);
}
.msg {
  max-width: min(72%, 560px); padding: 9px 13px 6px; border-radius: 16px;
  font-size: 14px; line-height: 1.45; box-shadow: var(--shadow-1);
  overflow-wrap: anywhere;
}
/* pre-wrap só no texto: no balão inteiro, a indentação do template
   vira espaço em branco e o balão incha */
.msg-corpo, .msg-nota { white-space: pre-wrap; }
.msg-in { align-self: flex-start; background: var(--surface); border-bottom-left-radius: 5px; }
.msg-out { align-self: flex-end; background: #d9f7e5; border-bottom-right-radius: 5px; }
.msg-midia { margin: 2px 0 4px; }
.msg-midia audio { display: block; width: 280px; max-width: 100%; height: 40px; }
.msg-midia img, .msg-midia video { display: block; max-width: 280px; max-height: 320px; border-radius: 8px; background: rgba(0,0,0,.06); }
.msg-midia img { cursor: zoom-in; }
.msg-doc { font-weight: 600; text-decoration: none; }
.msg-midia-off { font-size: 12.5px; font-style: italic; color: var(--text-muted); }
.msg-meta { font-size: 10.5px; color: var(--text-muted); text-align: right; margin-top: 3px; }
.msg-meta .lido { color: var(--info); }
.msg-erro { background: var(--danger-bg); }
.msg-falha { font-size: 11.5px; font-weight: 700; color: var(--danger); margin-top: 4px; }
.msg-nota {
  align-self: center; max-width: 80%; padding: 8px 14px; border-radius: 12px;
  background: var(--warn-bg); color: #6b4c0e; font-size: 12.5px; font-weight: 500;
}
.msg-nota span { margin-left: 8px; font-size: 10.5px; opacity: .7; }

/* editar/apagar mensagem enviada (069) */
.msg-editada { font-style: italic; }
.msg-apagada { font-style: italic; color: var(--text-muted); font-size: 13px; }
.msg-ops { display: none; justify-content: flex-end; gap: 2px; margin-top: 2px; }
.msg-ops button {
  border: 0; background: transparent; cursor: pointer; padding: 2px 6px; border-radius: 6px;
  font: inherit; font-size: 11px; font-weight: 600; color: var(--text-muted);
}
.msg-ops button:hover { background: rgba(0, 0, 0, .06); color: var(--text); }
.msg-ops button[data-msg-apagar]:hover { color: var(--danger); }
.msg-nota .msg-ops { margin: 2px 0 0; }
.msg-nota span .msg-editada { margin-left: 0; font-size: inherit; opacity: 1; }
.msg:hover .msg-ops, .msg:focus-within .msg-ops,
.msg-nota:hover .msg-ops, .msg-nota:focus-within .msg-ops { display: flex; }
/* celular não tem hover: fica sempre à mostra, discreto */
@media (hover: none) { .msg-ops { display: flex; } .msg-ops button { font-size: 11.5px; } }

.redigir {
  display: flex; gap: 8px; align-items: flex-end;
  padding: 12px 14px 6px; border-top: 1px solid var(--border);
}
.redigir textarea {
  flex: 1; resize: none; max-height: 160px; min-height: 42px;
  font: inherit; font-size: 14px; padding: 10px 14px;
  border: 1px solid transparent; border-radius: 21px; background: var(--surface-2);
}
.redigir textarea:focus { outline: none; border-color: var(--verde); background: var(--surface); }
.nota-interna {
  display: flex; align-items: center; gap: 7px; padding: 4px 18px 12px;
  font-size: 12px; color: var(--text-soft); cursor: pointer;
}
.nota-interna input { accent-color: var(--warn); }

.inbox-ficha { overflow-y: auto; padding: 22px 18px; gap: 18px; }
.ficha-topo { display: grid; justify-items: center; text-align: center; gap: 4px; }
.ficha-topo .inicial.grande { width: 68px; height: 68px; font-size: 26px; margin-bottom: 6px; }
.ficha-nome { font-family: var(--font-display); font-weight: 800; font-size: 16px; }
.ficha-tel { font-size: 12.5px; color: var(--text-muted); }
.ficha-bloco {
  display: grid; gap: 6px; justify-items: start;
  padding-top: 16px; border-top: 1px solid var(--border);
}

/* ═══ WhatsApp (configurações) ══════════════════════════════════ */

.whats { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 22px; align-items: center; }
/* o PNG do Evolution vem em 348px: mostrar no tamanho nativo. Encolher
   com pixelated deixa os quadradinhos desiguais e o celular não lê. */
.whats-qr {
  width: 372px; height: 372px; max-width: 100%; border-radius: var(--radius-card); background: #fff;
  display: grid; place-items: center; box-shadow: var(--shadow-2); padding: 12px;
}
.whats-qr img { width: 348px; height: 348px; max-width: 100%; height: auto; }
.whats-codigo {
  margin-top: 16px; font-family: var(--font-display); font-weight: 800; font-size: 40px;
  letter-spacing: .12em; color: var(--navy);
}
.whats-passos { margin: 12px 0 0 18px; font-size: 13.5px; line-height: 1.8; color: var(--text-soft); }
.canal-linha {
  display: flex; align-items: center; gap: 12px; padding: 12px 0;
  border-top: 1px solid var(--border);
}
.canal-linha:first-child { border-top: 0; }
.canal-linha .ponto { width: 10px; height: 10px; border-radius: 50%; background: var(--text-faint); flex: none; }
.canal-linha .ponto.conectado { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); }
.canal-linha .ponto.conectando { background: var(--warn); animation: pulsa 1.4s infinite; }

@media (max-width: 1100px) {
  .graficos { grid-template-columns: 1fr 1fr; }
  .graficos > :first-child { grid-column: 1 / -1; }
  .mensalidades { grid-template-columns: 1fr; }
  .inbox { grid-template-columns: 290px minmax(0, 1fr); }
  .inbox-ficha { display: none !important; }
}
@media (max-width: 720px) {
  .graficos, .graficos-2 { grid-template-columns: 1fr; }
  .inbox { grid-template-columns: minmax(0, 1fr); height: auto; }
  .inbox-conversa { min-height: 70dvh; }
  .whats { grid-template-columns: 1fr; justify-items: center; }
  .modal-fundo { padding: 0; place-items: end stretch; }
  .modal { max-height: 92dvh; border-radius: var(--radius-card) var(--radius-card) 0 0; }
}

/* foto do contato por cima da inicial: se a imagem não carregar, o
   onerror remove o <img> e a inicial aparece sozinha */
.inicial.com-foto { position: relative; overflow: hidden; }
.inicial.com-foto img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit;
}

/* ---- atendimento com IA ---- */
.selo-ia {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--verde);
  background: var(--ok-bg); border-radius: var(--radius-pill); padding: 6px 11px;
}
.selo-ia::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.msg-ia {
  font-size: 9.5px; font-weight: 800; letter-spacing: .04em;
  color: var(--verde); border: 1px solid currentColor; border-radius: 4px; padding: 0 4px;
}
.ia-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.ia-chave { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.ia-chave input { width: 18px; height: 18px; accent-color: var(--verde); }
.ia-base { min-height: 260px; font-size: 14px; line-height: 1.5; }
.ia-teste { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.ia-teste-thread {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 360px; min-height: 90px; overflow-y: auto;
  background: var(--surface-2); border-radius: var(--radius-card); padding: 14px; margin-bottom: 10px;
}
.ia-teste-redigir { display: flex; gap: 8px; align-items: flex-end; }
.ia-teste-redigir textarea { flex: 1; min-height: 42px; resize: none; font-size: 14px; border-radius: 21px; padding: 10px 14px; }

/* ---- anexo e gravação de áudio ---- */
.btn-icone {
  flex: none; width: 42px; height: 42px; display: inline-grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--text-soft); cursor: pointer;
}
.btn-icone:hover { background: var(--surface-2); color: var(--text); }
.anexo-previa {
  display: flex; align-items: center; gap: 12px;
  margin: 10px 14px 0; padding: 10px 12px; border-radius: var(--radius-card); background: var(--surface-2);
}
.anexo-previa[hidden], .gravando[hidden], .redigir[hidden] { display: none; }
.anexo-previa img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.anexo-ico { font-size: 26px; width: 56px; text-align: center; }
.anexo-nome { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.anexo-nome span { display: block; font-weight: 500; font-size: 12px; color: var(--text-muted); }
.gravando {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px 6px; border-top: 1px solid var(--border);
}
.grav-ponto { width: 10px; height: 10px; border-radius: 50%; background: #e5484d; animation: piscar 1s infinite; }
.grav-tempo { font-weight: 700; font-variant-numeric: tabular-nums; }
@keyframes piscar { 50% { opacity: .25; } }

/* ═══ Prospecção ════════════════════════════════════════════════ */

.pp-status { display: flex; flex-wrap: wrap; gap: 8px; }
.pp-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 999px; font-size: 12.5px;
  background: var(--surface); box-shadow: var(--shadow-1); color: var(--text-soft);
}
.pp-chip b { color: var(--text); font-weight: 700; }
.pp-chip a { color: var(--verde-deep); }
.pp-chip .ponto { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--warn); }
.pp-chip.ok .ponto { background: var(--ok); }
.pp-lote {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 10px 14px; margin-bottom: 12px; border-radius: var(--radius-card);
  background: var(--verde-wash); position: sticky; top: 8px; z-index: 5;
}
.pp-lote b { margin-right: 6px; font-size: 13px; }
.pp-lote select { width: auto; }

/* filtros avançados da lista + busca avançada + disparo */
.pp-filtros-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.pp-filtros-grade .campo { margin: 0; }
.pp-topo-lista { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 13px; }
.pp-progresso { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin-top: 10px; }
.pp-progresso span { display: block; height: 100%; border-radius: 4px; background: var(--verde); transition: width .4s ease; }
.pp-rolagem { max-height: 260px; overflow: auto; }
.wa-previa {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; white-space: pre-wrap; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere;
}
.wa-previa mark { background: var(--verde-wash); color: var(--verde-dark); border-radius: 4px; padding: 0 3px; }
.wa-rodape { color: var(--text-soft); font-size: 12px; }
.wa-botoes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; white-space: normal; }
.wa-botoes span { border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; font-size: 12px; color: var(--info); background: var(--surface); }
.var-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.var-chips button { font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.var-chips button:hover { border-color: var(--verde); color: var(--verde-dark); }
.bm-tpl-grade { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 700px) { .bm-tpl-grade { grid-template-columns: 1fr; } }
.pp-passos { margin-top: 12px; display: grid; gap: 6px; }
.pp-passo-mini { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--text-soft); }
.pp-passo-mini .badge { flex: none; min-width: 118px; justify-content: center; }
.pp-passo { margin-bottom: 10px; }
.pp-passo select { width: auto; }
.pp-colunas { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); align-items: start; }
.pp-linha {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 7px 0; border-top: 1px solid var(--border); font-size: 13.5px;
}
.pp-linha:first-child { border-top: 0; }
.pp-linha > span { color: var(--text-muted); }
.pp-linha > b { font-weight: 600; text-align: right; word-break: break-word; }
.pp-problemas { margin: 10px 0 0 18px; font-size: 13.5px; line-height: 1.6; }
.pp-checks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pp-toque { padding: 12px 0; border-top: 1px solid var(--border); }
.pp-toque:first-of-type { border-top: 0; }
.pp-toque-corpo {
  margin-top: 6px; white-space: pre-wrap; font-size: 13px; line-height: 1.5;
  color: var(--text-soft); max-height: 220px; overflow-y: auto;
}

/* ═══ Etiquetas ═════════════════════════════════════════════════ */

.etqs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.etq {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 11.5px; font-weight: 700; line-height: 1.4;
}
.etq-verde    { background: var(--ok-bg);     color: var(--ok); }
.etq-azul     { background: var(--info-bg);   color: var(--info); }
.etq-amarelo  { background: var(--warn-bg);   color: var(--warn); }
.etq-vermelho { background: var(--danger-bg); color: var(--danger); }
.etq-roxo     { background: #efe8fb;          color: #7446c9; }
.etq-cinza    { background: var(--surface-3); color: var(--text-soft); }
.etq-mais {
  border: 1px dashed var(--border); background: none; border-radius: var(--radius-pill);
  padding: 3px 10px; font-size: 11.5px; font-weight: 600; color: var(--text-soft); cursor: pointer;
}
.etq-mais:hover { border-color: var(--verde); color: var(--verde); }
.etq-escolha { display: grid; gap: 8px; }
.etq-escolha label { display: flex; align-items: center; gap: 8px; cursor: pointer; }

/* ═══ Respostas rápidas (composer) ══════════════════════════════ */

.atalhos {
  margin: 0 14px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-2);
  max-height: 280px; overflow-y: auto; padding: 6px;
}
.atalho {
  display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 8px 10px; border-radius: 10px; cursor: pointer; font-size: 13px;
}
.atalho b { color: var(--verde-deep); }
.atalho span { color: var(--text-soft); }
.atalho.ativo, .atalho:hover { background: var(--surface-2); }
.atalho-corpo {
  font-size: 12px; color: var(--text-muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ═══ Campanhas A/B, automações, relatórios ═════════════════════ */

.ab-grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.ab-var { position: relative; }
.ab-var.vencedora { box-shadow: 0 0 0 2px var(--verde); }
.ab-texto { white-space: pre-wrap; font-size: 13px; color: var(--text-soft); margin-top: 8px; max-height: 120px; overflow: auto; }
.linha-acao { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: var(--surface-2); margin-bottom: 10px; }
.linha-acao .filtros { margin: 0; }
.rel-frame { width: 100%; height: 72vh; border: 0; border-radius: var(--radius-card); background: #fff; box-shadow: var(--shadow-2); }
.rel-lados { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
@media (max-width: 1000px) { .rel-lados { grid-template-columns: 1fr; } }
.linha-acao input, .linha-acao select, .linha-acao textarea { background: var(--surface); }

/* ═══ Extras: sino, busca, visões, campos, captura ═══════════════ */

/* topo: busca e sino */
.topo-acoes { flex-wrap: wrap; }
.topo-busca { width: auto; padding: 0 12px; gap: 8px; display: inline-flex; align-items: center; border-radius: var(--radius-pill); background: var(--surface); box-shadow: var(--shadow-1); }
.topo-busca-dica { font-size: 11px; font-weight: 700; color: var(--text-muted); letter-spacing: .04em; }
#sino { position: relative; background: var(--surface); box-shadow: var(--shadow-1); }
#sino em {
  position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: var(--danger); color: #fff;
  font: 700 10px/17px var(--font); font-style: normal; text-align: center;
}
#sino em[hidden] { display: none; }

/* popover do sino e das macros */
.sino-painel {
  position: absolute; z-index: 60; padding: 0; overflow: hidden;
  box-shadow: var(--shadow-3); max-height: min(520px, 75vh); display: flex; flex-direction: column;
}
.sino-topo { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.sino-topo .btn { padding: 5px 10px; font-size: 12px; }
.sino-permissao { display: flex; gap: 10px; align-items: center; padding: 10px 14px; background: var(--verde-wash); font-size: 12.5px; }
.sino-permissao .btn { flex: none; padding: 6px 12px; font-size: 12px; }
.sino-lista { overflow-y: auto; }
.sino-item, .busca-item {
  display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left;
  border: 0; background: transparent; cursor: pointer; font: inherit; color: var(--text);
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.sino-item:hover, .busca-item:hover, .busca-item.foco { background: var(--surface-2); }
.sino-item b, .busca-item b { font-size: 13.5px; }
.sino-item span, .busca-item span { font-size: 12.5px; color: var(--text-soft); overflow-wrap: anywhere; }
.sino-item i { font-size: 11px; color: var(--text-muted); font-style: normal; }
.sino-item.nova { box-shadow: inset 3px 0 0 var(--verde); }
.sino-item.nova b::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--verde); vertical-align: middle; }

/* toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 80; display: grid; gap: 8px; width: min(340px, calc(100vw - 32px)); }
.toast {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--radius-card);
  background: var(--navy-deep, #1d2a55); color: #fff; box-shadow: var(--shadow-3); text-decoration: none;
  border-left: 4px solid var(--verde); animation: toast-entra .2s ease-out; transition: opacity .4s, transform .4s;
}
.toast span { font-size: 12.5px; opacity: .85; }
.toast.saindo { opacity: 0; transform: translateY(8px); }
@keyframes toast-entra { from { opacity: 0; transform: translateY(8px); } }

/* busca global */
.busca-fundo { place-items: start center; padding-top: 12vh; }
.busca-caixa { width: min(620px, 100%); padding: 0; overflow: hidden; display: flex; flex-direction: column; max-height: 70vh; }
.busca-caixa > input { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 18px 20px; font-size: 16px; box-shadow: none; }
.busca-caixa > input:focus { outline: none; box-shadow: none; }
.busca-resultados { overflow-y: auto; }
.busca-dica { padding: 14px 20px; margin: 0; }
.busca-grupo { padding: 10px 20px 4px; font: 800 10.5px var(--font-display); text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.busca-resultados .busca-item { padding: 10px 20px; }
.busca-rodape { padding: 10px 20px; margin: 0; border-top: 1px solid var(--border); background: var(--surface-2); }

/* visões salvas */
.visoes { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.visao {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--radius-pill); padding: 6px 12px; font: 600 12.5px var(--font); color: var(--text-soft); cursor: pointer;
}
.visao:hover { color: var(--text); border-color: var(--border-hover); }
.visao.ativa { background: var(--verde-dark, #0b4a28); border-color: transparent; color: #fff; }
.visao small { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; opacity: .7; }
.visao i { font-style: normal; font-size: 15px; line-height: 1; opacity: .55; padding-left: 2px; }
.visao i:hover { opacity: 1; }
.visao-nova { border-style: dashed; background: transparent; }

.filtros-lista { justify-content: flex-start; align-items: center; }
.filtros-lista > input, .filtros-lista > select { width: auto; flex: 1 1 160px; max-width: 240px; }
.filtros-lista > input[type="search"] { flex-basis: 220px; max-width: 320px; }
.tabela-clicavel tbody tr { cursor: pointer; }
.tabela-clicavel tbody tr:hover td { background: var(--surface-2); }
.tabela-rolagem { overflow-x: auto; }

/* campos personalizados */
.campos-grade { display: grid; gap: 14px 20px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.campos-grade > div { min-width: 0; overflow-wrap: anywhere; }

/* duplicados */
.dup-grupo { margin-bottom: 12px; }
.dup-linha { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.dup-linha:last-of-type { border-bottom: 0; }
.dup-linha input { margin-top: 3px; accent-color: var(--verde); width: 16px; height: 16px; flex: none; }
.dup-linha span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dup-linha small { color: var(--text-soft); font-size: 12px; overflow-wrap: anywhere; }

/* captura de leads */
.cap-bloco { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.copiar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.copiar code {
  flex: 1 1 260px; min-width: 0; padding: 9px 12px; border-radius: 10px; background: var(--surface-2);
  font-size: 12.5px; overflow-wrap: anywhere;
}
.cap-codigo {
  margin: 8px 0; padding: 12px 14px; border-radius: 10px; background: var(--navy-deep, #1d2a55); color: #e8ecf5;
  font-size: 12px; line-height: 1.5; overflow-x: auto; white-space: pre;
}

/* distribuição */
.d-pessoas { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.d-horario { display: grid; gap: 8px; }
.d-dia { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.d-dia .marcar { width: 70px; }
.d-dia input[type="time"] { width: 120px; }
.d-dia input:disabled { opacity: .45; }

/* macros */
.macro-acao { padding: 10px 12px; }

@media (max-width: 860px) {
  .topo-busca-dica { display: none; }
  .topo-busca { width: 42px; padding: 0; justify-content: center; }
  .filtros-lista > input, .filtros-lista > select, .filtros-lista > input[type="search"] { flex: 1 1 calc(50% - 8px); max-width: none; }
  .busca-fundo { padding: 12px; }
  .busca-caixa { max-height: calc(100vh - 24px); }
  .busca-rodape { display: none; }
  .visoes { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .visao { flex: none; }
  .sino-permissao { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 520px) {
  /* busca inteira, filtros dois por linha: um por linha empurrava o
     quadro pra baixo de uma tela inteira de campos */
  .filtros-lista > input, .filtros-lista > select { flex-basis: calc(50% - 4px); min-width: 0; }
  .filtros-lista > input[type="search"] { flex-basis: 100%; }
  .filtros-lista > select { padding-left: 14px; padding-right: 30px; background-position: right 12px center; }
  .d-dia input[type="time"] { width: calc(50% - 30px); }
}

/* ═══ Gestão da agência — início, ficha, rotina, indicadores ═════ */

.aviso-warn   { background: var(--warn-bg); color: var(--warn); }
.aviso-neutro { background: var(--surface-3); color: var(--text-soft); }
.aviso-acao { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.aviso-botoes { display: flex; gap: 6px; flex-wrap: wrap; }
.aviso-botoes .btn { padding: 6px 12px; font-size: 12.5px; background: rgba(255, 255, 255, .6); }

.sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; font-weight: 500; }
.centro { text-align: center; }
.titulo-acoes { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.titulo-acoes > h3 { margin: 0; }
.acoes-linha { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.opcao { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.opcao input { accent-color: var(--verde); }
.escolha-lista { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.escolha-lista label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.escolha-lista input { accent-color: var(--verde); }
.mais-campos { margin: 4px 0 14px; }
.mais-campos summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--text-soft); margin-bottom: 12px; }
.abas em { font-style: normal; font-weight: 800; margin-left: 4px; color: var(--text-muted); }
.abas-rolagem { display: flex; width: max-content; max-width: 100%; overflow-x: auto; margin-bottom: 14px; }
.abas-rolagem button { flex: none; }
.alternar { display: inline-flex; gap: 2px; padding: 3px; background: rgba(0, 0, 0, .05); border-radius: 999px; }
.alternar button { border: 0; background: transparent; cursor: pointer; font: inherit; font-size: 12.5px;
  font-weight: 600; color: var(--text-soft); padding: 6px 13px; border-radius: 999px; }
.alternar button.ativo { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.tabela tfoot td { border-top: 1px solid var(--border); font-weight: 700; }

/* pessoas em bolinha */
.iniciais { display: inline-flex; }
.ini {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center;
  background: var(--verde-wash); color: var(--verde-deep);
  font-family: var(--font-display); font-weight: 800; font-size: 11px;
  box-shadow: 0 0 0 2px var(--surface);
}
.iniciais .ini + .ini { margin-left: -7px; }
.pessoa { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; }

/* links de trabalho */
.links-linha { display: inline-flex; gap: 4px; }
.link-ico {
  width: 24px; height: 24px; border-radius: 7px; display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 800; text-decoration: none;
  background: var(--verde-wash); color: var(--verde-deep);
}
.link-ico:hover { background: var(--verde); color: #fff; }
.link-ico.sem { background: var(--surface-2); color: var(--text-faint); }
.link-rot {
  font-size: 12.5px; font-weight: 700; color: var(--verde-deep); text-decoration: none;
  padding: 3px 10px; border-radius: var(--radius-pill); background: var(--verde-wash);
}
.link-rot:hover { background: var(--verde); color: #fff; }

/* início */
.inicio-topo { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.inicio-ola { font-family: var(--font-display); font-weight: 800; font-size: 24px; letter-spacing: -.02em; }
.inicio-frase { font-size: 13.5px; color: var(--text-soft); margin-top: 4px; font-style: italic; }
.inicio-grade { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.card-topo { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 12px 10px 6px; }
.card > .card-topo { padding: 0 0 10px; }
.card-topo h4 { font-family: var(--font-display); font-size: 14px; font-weight: 800; }
.card-topo .nota { margin: 0; }
.grupo-cliente + .grupo-cliente { margin-top: 6px; border-top: 1px solid var(--border); }
.grupo-topo { display: flex; align-items: center; gap: 9px; padding: 12px 18px 2px; font-size: 13px; font-weight: 700; }
.grupo-topo .logo-mini { width: 24px; height: 24px; }
.grupo-topo .logo-mini .inicial { font-size: 11px; }
.grupo-topo a { color: var(--text); text-decoration: none; }
.grupo-topo a:hover { color: var(--verde-deep); }
.grupo-cliente .tarefa { border-top: 0; padding: 9px 18px 9px 22px; }
.alertas { display: grid; gap: 8px; }
.alerta {
  display: block; padding: 10px 12px 10px 14px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600; line-height: 1.35; text-decoration: none;
  border-left: 3px solid currentColor;
}
.alerta[href]:hover { filter: brightness(.97); }
.alerta-danger { background: var(--danger-bg); color: var(--danger); }
.alerta-warn { background: var(--warn-bg); color: var(--warn); }
/* por que o alerta aparece pra você (038) */
.alerta-motivo { display: block; margin-top: 3px; font-size: 11.5px; font-weight: 500; color: var(--text-muted); }
.alertas-escopo button { font-size: 12px; padding: 4px 10px; }

/* calendário da semana */
.semana-nav { display: inline-flex; gap: 2px; align-items: center; }
.semana-nav .btn { padding: 6px 12px; }
.semana { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.semana-dia { background: var(--surface); border-radius: var(--radius-card); padding: 10px; min-height: 150px; display: flex; flex-direction: column; gap: 6px; }
.semana-dia.fds { background: var(--surface-2); }
.semana-dia.hoje { box-shadow: inset 0 0 0 2px var(--verde); }
.semana-cab { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 2px; }
.semana-cab b { font-family: var(--font-display); font-size: 17px; color: var(--text); letter-spacing: -.02em; }
.semana-dia.hoje .semana-cab b { color: var(--verde-deep); }
.cal-item {
  font-size: 12px; font-weight: 600; line-height: 1.3; padding: 6px 8px; border-radius: 8px;
  background: var(--verde-wash); color: var(--verde-deep); cursor: default; overflow-wrap: anywhere;
}
.cal-item[data-ir] { cursor: pointer; }
.cal-item small { display: block; font-size: 10.5px; font-weight: 700; opacity: .7; }
.cal-item.feita { background: var(--surface-2); color: var(--text-muted); text-decoration: line-through; }
.cal-item.criativo { background: var(--info-bg); color: var(--info); }
.cal-vazio { font-size: 11.5px; color: var(--text-faint); margin-top: auto; text-align: center; }

/* ficha do cliente */
.ficha-topo { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; }
.ficha-id { flex: 1; min-width: 240px; display: grid; gap: 10px; }
.ficha-linha { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ficha-abas { margin-bottom: 18px; }
.contrato-grade { display: grid; gap: 16px 22px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.contrato-grade > * { min-width: 0; }
/* link ou e-mail comprido quebra na própria coluna em vez de invadir a vizinha */
.contrato-valor { font-weight: 600; margin-top: 4px; font-size: 14px; overflow-wrap: anywhere; }

/* atividade */
.comentar { margin-bottom: 18px; }
.comentar textarea { width: 100%; resize: vertical; }
.comentar-rodape { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.comentar-rodape > .btn { margin-left: auto; }
#c-tarefa-campos { display: inline-flex; gap: 8px; flex-wrap: wrap; }
#c-tarefa-campos[hidden] { display: none; }
.mencao-caixa { position: relative; }
.mencao-lista {
  position: absolute; left: 0; top: 100%; z-index: 20; margin-top: 4px; min-width: 220px;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-2); padding: 4px;
}
.mencao-lista button {
  display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent;
  font: inherit; font-size: 13px; font-weight: 600; padding: 7px 9px; border-radius: 8px; cursor: pointer; text-align: left;
}
.mencao-lista button.ativo, .mencao-lista button:hover { background: var(--verde-wash); }
.mencao { color: var(--verde-deep); }
.linha-tempo { display: grid; gap: 4px; }
.lt-item { display: flex; gap: 12px; align-items: flex-start; padding: 8px 4px; font-size: 13.5px; }
.lt-ponto { width: 8px; height: 8px; border-radius: 50%; background: var(--border-hover); margin: 6px 9px 0; flex: none; }
.lt-corpo { flex: 1; min-width: 0; }
.lt-comentario .lt-corpo { background: var(--surface); border-radius: var(--radius-card); padding: 10px 14px; box-shadow: var(--shadow-1); }
.lt-cab { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.lt-texto { margin-top: 4px; line-height: 1.5; overflow-wrap: anywhere; }
.lt-apagar { margin-left: auto; border: 0; background: transparent; font: inherit; font-size: 12px; color: var(--text-muted); cursor: pointer; }
.lt-apagar:hover { color: var(--danger); }

/* documentos */
.doc-card { display: flex; flex-direction: column; }
.doc-previa { margin-top: 8px; font-size: 13px; line-height: 1.5; color: var(--text-soft); white-space: pre-wrap; flex: 1; }
.doc-texto { width: 100%; min-height: 360px; resize: vertical; line-height: 1.55; font-size: 14px; }

/* funil */
.metricas-faixa { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 16px; }
.metricas-faixa .card { padding: 12px 14px; }
.metricas-faixa .nota { margin-top: 2px; font-size: 11.5px; }
.negocio-sinais { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; font-size: 11px; color: var(--text-muted); font-weight: 600; align-items: center; }
.marcador { display: inline-block; padding: 1px 7px; border-radius: var(--radius-pill); font-size: 10.5px; font-weight: 800; }
.marcador.danger { background: var(--danger-bg); color: var(--danger); }
.marcador.warn { background: var(--warn-bg); color: var(--warn); }
.tabela-clicavel tbody tr { cursor: pointer; }

/* comercial */
.delta { font-size: 11.5px; font-weight: 800; color: var(--text-muted); white-space: nowrap; }
.delta.sobe { color: var(--ok); }
.delta.cai { color: var(--danger); }
.funil-barra + .funil-barra { margin-top: 14px; }
.funil-rot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; margin-bottom: 6px; }
.funil-rot span { color: var(--text-soft); font-variant-numeric: tabular-nums; }

/* rotina */
.rotina-tabela { min-width: 920px; }
.rotina-tabela td { vertical-align: middle; }
.rotina-tabela select { padding: 6px 8px; font-size: 12.5px; min-width: 92px; }
.rotina-tabela tr.completo td:first-child { box-shadow: inset 3px 0 0 var(--verde); }
.rotina-tabela .check { margin: 0 auto; display: block; }
.design-card .negocio-rodape { flex-wrap: wrap; gap: 6px; }
.design-card.atrasado { box-shadow: inset 3px 0 0 var(--danger); }
.design-cliente { display: flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; }
.design-cliente .logo-mini { width: 22px; height: 22px; }
.design-cliente .logo-mini .inicial { font-size: 10px; }
.design-prazo { font-size: 11.5px; font-weight: 700; color: var(--text-soft); }
.design-card.atrasado .design-prazo { color: var(--danger); }

@media (max-width: 860px) {
  .inicio-grade { grid-template-columns: 1fr; }
  .semana { grid-template-columns: repeat(7, minmax(120px, 1fr)); overflow-x: auto; padding-bottom: 6px; }
  .semana-dia { min-height: 120px; }
}
@media (max-width: 720px) {
  .ficha-topo .logo-caixa { width: 64px; height: 64px; }
  .inicio-ola { font-size: 20px; }
  .comentar-rodape > .btn { margin-left: 0; width: 100%; }
  .titulo-acoes { align-items: flex-start; }
}

.logo-vazia { font-family: var(--font-display); font-weight: 800; font-size: 34px; line-height: 1; color: var(--verde-deep); text-transform: uppercase; }
.docs-fixos { margin-bottom: var(--gap); }

/* ---------------------------------------------------------------- */
/* v8 — funil calendário, negócio em abas, formulários, suporte,     */
/* risco, pessoas, cobrança, anexos de comentário                    */
/* ---------------------------------------------------------------- */

.form-linha { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.form-linha > input, .form-linha > select { min-width: 0; }
.card.form-linha { margin-bottom: var(--gap); }
.aba-conta { font-style: normal; font-size: 10.5px; font-weight: 800; background: rgba(0, 0, 0, .07);
  border-radius: var(--radius-pill); padding: 1px 6px; margin-left: 4px; }
.card-alerta { box-shadow: inset 0 0 0 1.5px var(--danger), var(--shadow-1); }
.card-filtro { text-align: left; font: inherit; color: inherit; cursor: pointer; border: 0; }
.card-filtro.ativo { box-shadow: inset 0 0 0 2px var(--verde-deep), var(--shadow-1); }
.tabela-rola { overflow-x: auto; }
.tabela tr.feita td { color: var(--text-muted); text-decoration: line-through; }
.tabela td.atrasado { color: var(--danger); font-weight: 700; }
.tabela tr.inativo td { opacity: .55; }
.tabela tr.linha-sos td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.mini-logo { width: 24px; height: 24px; border-radius: 6px; object-fit: contain; background: var(--surface-2); }
.btn-link { border: 0; background: transparent; padding: 0; margin-left: 6px; font: inherit; font-size: 12px;
  font-weight: 700; color: var(--verde-deep); cursor: pointer; text-decoration: underline; }

/* meta capi */
.capi-faixa { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--text-soft);
  background: var(--surface); border-radius: var(--radius); padding: 8px 14px; margin-bottom: 12px; box-shadow: var(--shadow-1); }
.capi-ponto { width: 8px; height: 8px; border-radius: 50%; background: var(--verde); box-shadow: 0 0 0 3px var(--verde-wash); }
.capi-ponto.erro { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
.capi-link { margin-left: auto; font-weight: 700; color: var(--verde-deep); }
.capi-etapas { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.capi-etapa { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }

/* funil — calendário */
.cal-topo { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.cal-mes { font-family: var(--font-display); text-transform: uppercase; font-size: 15px; min-width: 170px; text-align: center; }
.cal-grade { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-semana { font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--text-muted); padding: 0 4px; }
.cal-dia { background: var(--surface); border-radius: var(--radius); min-height: 104px; padding: 6px; display: flex;
  flex-direction: column; gap: 4px; box-shadow: var(--shadow-1); transition: box-shadow .12s; }
.cal-dia.fora { background: transparent; box-shadow: none; }
.cal-dia.passado { background: var(--surface-2); }
.cal-dia.hoje { box-shadow: inset 0 0 0 2px var(--verde); }
.cal-dia.sobre, .cal-sem-data.sobre { box-shadow: inset 0 0 0 2px var(--verde-deep); background: var(--verde-wash); }
.cal-num { font-size: 12px; font-weight: 800; color: var(--text-muted); }
.cal-dia.hoje .cal-num { color: var(--verde-deep); }
.cal-card { background: var(--verde-wash); border-left: 3px solid var(--verde); border-radius: 6px; padding: 4px 6px;
  font-size: 11.5px; line-height: 1.3; cursor: pointer; overflow: hidden; }
.cal-card b, .cal-card span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-card span { color: var(--text-muted); font-size: 10.5px; }
.cal-card.tipo-ganho { background: var(--ok-bg); border-color: var(--ok); }
.cal-card.tipo-perdido { background: var(--surface-2); border-color: var(--text-faint); opacity: .7; }
.cal-card.arrastando { opacity: .4; }
.cal-sem-data { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; padding: 8px;
  border-radius: var(--radius); background: var(--surface); min-height: 56px; box-shadow: var(--shadow-1); }
@media (max-width: 720px) {
  .cal-grade { gap: 3px; }
  .cal-dia { min-height: 64px; padding: 3px; }
  .cal-card span { display: none; }
}

/* negócio */
.negocio-topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: var(--gap); }
.negocio-topo-id { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.score { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--radius-pill); font-size: 12px; cursor: help; }
.score b { font-weight: 800; }
.score-ok { background: var(--ok-bg); color: var(--ok); }
.score-warn { background: var(--warn-bg); color: var(--warn); }
.score-danger { background: var(--danger-bg); color: var(--danger); }
.score-detalhe { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.score-motivos { display: flex; gap: 6px; flex-wrap: wrap; }
.whats-caixa { max-height: 520px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; background: var(--surface-2); }
.whats-msg { max-width: 76%; padding: 7px 11px; border-radius: 12px; font-size: 13.5px; background: var(--surface); box-shadow: var(--shadow-1); }
.whats-msg small { display: block; font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }
.whats-msg.saiu { align-self: flex-end; background: var(--verde-wash); }
.whats-msg.nota-interna { background: var(--warn-bg); }
.nota-card { margin-bottom: 8px; }

/* formulários */
.form-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--gap); margin-top: var(--gap); }
.form-card { display: flex; flex-direction: column; gap: 14px; }
.form-card-topo { display: flex; gap: 12px; align-items: center; }
.form-cor { width: 38px; height: 38px; border-radius: 10px; border: 3px solid; flex: none; }
.form-nome { font-weight: 800; font-size: 15px; color: var(--text); }
.form-numeros { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.form-numeros div { background: var(--surface-2); border-radius: var(--radius); padding: 8px; text-align: center; }
.form-numeros b { display: block; font-family: var(--font-display); font-size: 17px; }
.form-numeros span { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; font-weight: 700; }
.form-ed-topo { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: var(--gap); }
.form-link { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 4px 0; }
.form-link code { background: var(--surface-2); padding: 6px 10px; border-radius: 6px; font-size: 12.5px; word-break: break-all; }
.nota.sujo { color: var(--warn); font-weight: 700; }
.form-bloco { margin-bottom: 10px; }
.form-bloco.apagado { opacity: .5; }
.form-bloco-topo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.form-num { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 8px;
  background: var(--verde-deep); color: #fff; font-weight: 800; font-size: 13px; }
.form-num.final { background: var(--verde); }
.form-opcao { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.form-opcao input { flex: 1; }
.form-letra { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; flex: none;
  border: 1.5px solid var(--border); font-size: 12px; font-weight: 800; color: var(--text-muted); }
.logica-linha { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 8px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.logica-linha select { min-width: 240px; max-width: 100%; }
.tema-pronto { border: 2px solid; border-radius: 8px; padding: 8px 14px; font: inherit; font-weight: 700; cursor: pointer; }
.tema-cor > span { display: flex; align-items: center; gap: 8px; }
.tema-cor input[type=color] { width: 44px; height: 32px; padding: 0; border: 0; background: none; cursor: pointer; }
.tema-amostra { border-radius: var(--radius-lg); padding: 36px 28px; min-height: 240px; box-shadow: var(--shadow-2); }
.previa-moldura { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-2); background: var(--surface); }
.previa-moldura iframe { display: block; width: 100%; height: 640px; border: 0; }

/* suporte */
.chamado-desc { background: var(--surface-2); margin-top: 6px; font-size: 13.5px; }
.chamado-msgs { max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin: 6px 0 12px; }
.chamado-msg { background: var(--surface-2); border-radius: 10px; padding: 8px 12px; font-size: 13.5px; max-width: 88%; }
.chamado-msg.nos { align-self: flex-end; background: var(--verde-wash); }
.chamado-msg .quem { font-size: 11px; font-weight: 700; color: var(--text-muted); margin-bottom: 2px; }
#responder textarea { width: 100%; }

/* risco */
.risco-motivos { display: flex; gap: 4px; flex-wrap: wrap; }

/* pessoas */
.alternar-radio { position: relative; }
.alternar-radio input { position: absolute; opacity: 0; pointer-events: none; }
.alternar-radio span { display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  color: var(--text-soft); cursor: pointer; }
.alternar-radio input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.alternar-radio input:focus-visible + span { outline: 2px solid var(--verde); }
.feedback-lista { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.feedback-item { border-top: 1px solid var(--border); padding-top: 10px; }

/* cobrança compartilhada */
.comp-lista { max-height: 300px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); margin-top: 6px; }
.comp-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border);
  cursor: pointer; font-size: 13.5px; }
.comp-item:last-child { border-bottom: 0; }
.comp-item > span:nth-child(2) { flex: 1; min-width: 0; }

/* anexos de comentário */
.comentar-anexos { display: inline-flex; gap: 2px; }
.btn-icone.gravando { color: var(--danger); background: var(--danger-bg); }
.anexo-previa { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; }
.anexo-previa audio, .lt-anexo audio { height: 36px; max-width: 100%; }
.anexo-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--radius-pill);
  background: var(--surface-2); color: var(--text); font-size: 12.5px; font-weight: 600; max-width: 100%; }
.anexo-chip small { color: var(--text-muted); font-weight: 500; }
.gravando-ponto { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); animation: piscar-rec 1s infinite; }
@keyframes piscar-rec { 50% { opacity: .25; } }
.lt-anexo { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.lt-imagem { max-width: 260px; max-height: 200px; border-radius: 8px; display: block; }

/* ═══ Diálogos do app (no lugar de alert/confirm/prompt) ═══════════ */
.btn-perigo { background: var(--danger); color: #fff; box-shadow: 0 2px 8px rgba(200,50,30,.25); }
.btn-perigo:hover { filter: brightness(1.08); }
.dialogo-texto { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--text-soft, var(--text)); }
.dialogo-opcoes { display: grid; gap: 8px; }
.dialogo-opcao {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; font: inherit; color: var(--text);
  transition: border-color 120ms, background 120ms;
}
.dialogo-opcao:hover, .dialogo-opcao:focus-visible { border-color: var(--verde); background: var(--verde-wash); outline: none; }
.dialogo-opcao span { font-size: 12px; color: var(--text-muted); text-transform: capitalize; }
.dialogo-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.dialogo-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--surface); font: 600 13px/1 var(--font); color: var(--text);
  cursor: pointer; user-select: none; transition: border-color 120ms, background 120ms, color 120ms;
}
.dialogo-chip input { position: absolute; opacity: 0; pointer-events: none; }
.dialogo-chip:hover { border-color: var(--verde); }
.dialogo-chip.ativo, .dialogo-chip:has(input:checked) { background: var(--verde-deep); border-color: var(--verde-deep); color: #fff; }
.dialogo-copiar { min-height: 140px; font-family: ui-monospace, monospace; font-size: 13px; }
.form-novo .linha-campos .campo { margin-bottom: 14px; }
.form-novo input[type=range] { width: 100%; accent-color: var(--verde); margin-top: 10px; }
.form-novo output { margin-left: 6px; color: var(--verde-deep); font-weight: 800; letter-spacing: 0; }
.toast.toast-erro { border-left-color: var(--danger); }
@media (max-width: 600px) {
  .modal-fundo { padding: 10px; align-items: end; }
  .modal { max-height: calc(100dvh - 20px); }
}

/* ---- conexões de IA ---- */
.ia-lista { list-style: none; margin: 0; padding: 0; }
.ia-item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.ia-item.desligada .ia-info { opacity: .55; }
.ia-ordem { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 28px; }
.ia-ordem span { font: 800 15px/1 var(--font); color: var(--verde-deep); margin-bottom: 2px; }
.ia-ordem .btn-icone {
  border: 0; background: none; color: var(--text-muted); font-size: 10px; line-height: 1; padding: 3px 6px;
  border-radius: 4px; cursor: pointer;
}
.ia-ordem .btn-icone:hover:not(:disabled) { background: var(--verde-wash); color: var(--verde-deep); }
.ia-ordem .btn-icone:disabled { opacity: .25; cursor: default; }
.ia-nome { font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ia-sub { font-size: 13px; color: var(--text-muted); margin-top: 3px; word-break: break-word; }
.ia-sub code { font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.ia-funcoes { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.ia-tag { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: var(--radius-pill); background: var(--surface-2); }
.ia-tag.todas { background: var(--verde-wash); color: var(--verde-deep); }
.ia-erro { font-size: 12px; color: var(--danger); margin-top: 6px; word-break: break-word; }
.ia-acoes { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.ia-status { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--text-muted); }
.ia-status.ok { background: var(--ok-bg); color: var(--verde-deep); }
.ia-status.erro { background: var(--danger-bg); color: var(--danger); }
.ia-status.off { background: var(--surface-2); }
.ia-teste { font-size: 13px; font-weight: 600; padding: 10px 12px; border-radius: var(--radius); margin-bottom: 10px; word-break: break-word; }
.ia-teste.ok { background: var(--ok-bg); color: var(--verde-deep); }
.ia-teste.erro { background: var(--danger-bg); color: var(--danger); }
@media (max-width: 600px) {
  .ia-item { grid-template-columns: auto 1fr; }
  .ia-acoes { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ---- WhatsApp: vários números, vários provedores ---- */
.wa-lista { list-style: none; margin: 0; padding: 0; }
.wa-item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.wa-item:first-child { padding-top: 0; }
.wa-item .ponto { width: 10px; height: 10px; border-radius: 50%; background: var(--text-faint); }
.wa-item .ponto.conectado { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); }
.wa-item .ponto.conectando { background: var(--warn); animation: pulsa 1.4s infinite; }
.wa-item .ponto.desconhecido { background: var(--danger); }
.wa-info { min-width: 0; }
.wa-nome { font-weight: 700; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.wa-numero { font-weight: 500; font-size: 13px; color: var(--text-muted); }
.wa-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 6px; }
.wa-status { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--text-muted); }
.wa-status.conectado { background: var(--ok-bg); color: var(--verde-deep); }
.wa-status.conectando { background: var(--warn-bg); color: var(--warn); }
.wa-status.desconhecido { background: var(--danger-bg); color: var(--danger); }
.wa-vazio { padding: 18px 0; }
.wa-rodape { padding-top: 14px; }
.wa-rodape .nota { margin: 0 0 10px; }
.wa-desc { margin: 8px 0 0; }
.wa-copiar { display: flex; gap: 8px; }
.wa-copiar input { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.wa-pronto { text-align: center; padding: 18px 0 6px; }
.wa-pronto-icone {
  width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ok-bg); color: var(--verde-deep); font-size: 26px; font-weight: 800;
}
.wa-pronto .btn { margin-top: 8px; }
@media (max-width: 600px) {
  .wa-item { grid-template-columns: auto 1fr; }
  .wa-item .ia-acoes { grid-column: 1 / -1; justify-content: flex-start; }
  .whats { grid-template-columns: 1fr; }
}

/* ── crescimento: alertas, arte, Instagram, templates, onboarding, vendas, propostas ── */

/* alertas das contas */
.alertas-card { margin-bottom: 14px; padding: 14px 16px; border-left: 4px solid var(--danger); }
.alertas-card.alertas-ok { border-left-color: var(--ok); padding: 10px 16px; }
.alertas-topo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.alertas-topo b { font-family: var(--font-display); font-size: 13px; text-transform: uppercase; letter-spacing: .02em; }
.alerta-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0 0; border-top: 1px solid var(--border); margin-top: 10px; }
.alerta-item .badge { flex: none; margin-top: 2px; }
.alerta-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.alerta-txt span { font-size: 12.5px; color: var(--text-muted); }
.alerta-critico .alerta-txt b { color: var(--danger); }

/* arte pra aprovação */
.arte-bloco { background: var(--surface-2); border-radius: var(--radius-card); padding: 14px; margin-bottom: 16px; }
.arte-topo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.arte-caixa { position: relative; width: fit-content; max-width: 100%; margin: 0 auto; border-radius: 10px; overflow: hidden; background: var(--surface-3); }
.arte-caixa img, .arte-caixa video { display: block; max-width: 100%; max-height: 460px; }
.arte-clicavel img { cursor: crosshair; }
.arte-pino {
  position: absolute; transform: translate(-50%, -50%); width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; background: var(--verde-dark);
  border: 2px solid #fff; box-shadow: var(--shadow-2); cursor: help;
}
.arte-pino.do-cliente { background: var(--warn); }
.arte-coments { display: grid; gap: 8px; margin-top: 12px; }
.arte-coment { display: flex; gap: 10px; background: var(--surface); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.arte-coment.do-cliente { box-shadow: inset 3px 0 0 var(--warn); }
.arte-coment p { margin: 4px 0 0; white-space: pre-wrap; }
.arte-pino-mini {
  flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: 10.5px; font-weight: 800; color: #fff; background: var(--verde-dark);
}
.arte-pino-mini.do-cliente { background: var(--warn); }
.arte-pino-mini.vazio { background: var(--surface-3); }
.arte-novo { display: flex; gap: 8px; margin-top: 12px; }
.arte-novo input { flex: 1; min-width: 0; }

/* Instagram */
.selo-ig {
  display: inline-grid; place-items: center; min-width: 18px; height: 16px; padding: 0 5px; margin-right: 5px; border-radius: 5px;
  font-size: 9.5px; font-weight: 800; letter-spacing: .02em; color: #fff; vertical-align: 1px;
  background: linear-gradient(45deg, #f09433, #dc2743 50%, #bc1888);
}
.ig-contas { display: grid; gap: 8px; margin: 12px 0; }
.ig-conta { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; }
.ig-conta img, .ig-foto-vazia { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.ig-foto-vazia { display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; background: linear-gradient(45deg, #f09433, #dc2743 50%, #bc1888); }
.ig-conta-txt { flex: 1; min-width: 0; display: grid; }
.ig-conta-txt span { font-size: 12.5px; color: var(--text-muted); }
.ig-ajuda { margin-top: 12px; }
.ig-ajuda summary, .prop-contrato summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--verde-deep); }
.copiar-linha { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border-radius: 10px; padding: 6px 6px 6px 12px; margin-top: 6px; }
.copiar-linha code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 12.5px; }

/* templates oficiais */
.tpl-previa { font-size: 12.5px; color: var(--text-soft); white-space: pre-wrap; margin-top: 4px; max-width: 520px; }
.tpl-previa-grande {
  background: #e7fbe9; color: var(--text); border-radius: 12px 12px 12px 4px; padding: 12px 14px;
  font-size: 13.5px; margin: 6px 0 14px; max-width: none; min-height: 48px;
}
.tpl-botao { display: inline-block; margin: 0 6px 4px 0; padding: 4px 12px; border-radius: var(--radius-pill); background: var(--surface); color: var(--info); font-weight: 700; font-size: 12px; }
.msg-acao {
  display: inline-block; margin-top: 6px; padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--surface-2); font: inherit; font-size: 11.5px; font-weight: 700; color: var(--verde-deep); cursor: pointer;
}
.msg-acao:hover { background: var(--verde-wash); }
.msg-acao:disabled { opacity: .6; cursor: default; }

/* onboarding */
.vazio-onb { text-align: center; padding: 28px 20px; }
.vazio-onb .nota { max-width: 460px; margin: 8px auto 16px; }
.onb-progresso { display: grid; gap: 8px; margin-bottom: 14px; }
.onb-barra { height: 8px; border-radius: var(--radius-pill); background: var(--surface-3); overflow: hidden; }
.onb-barra span { display: block; height: 100%; background: var(--verde); border-radius: inherit; transition: width .3s; }
.onb-lista { display: grid; }
.onb-item { display: flex; align-items: flex-start; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border); }
.onb-item .onb-check { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--verde); flex: none; }
.onb-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.onb-txt > span { font-size: 12.5px; color: var(--text-muted); }
.onb-item.feito .onb-txt b { text-decoration: line-through; color: var(--text-muted); }
.onb-resp { max-width: 160px; font-size: 12.5px; }
.onb-novo { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--border); }
.onb-novo input[name=titulo] { flex: 1; min-width: 200px; }
.onb-novo .opcao, .onb-cli { margin: 0; white-space: nowrap; }
.onb-modelo { display: grid; gap: 8px; }
.onb-modelo-linha { display: flex; align-items: center; gap: 8px; }
.onb-num { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: var(--verde-wash); color: var(--verde-deep); }
.onb-modelo-campos { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr 1.3fr; gap: 6px; }

/* vendas */
.vendas-resumo { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi-mini { display: grid; gap: 2px; padding: 14px 16px; margin: 0; }
.kpi-mini b { font-family: var(--font-display); font-size: 22px; font-weight: 800; }
.kpi-mini span { font-size: 12px; color: var(--text-muted); }
.kpi-mini.destaque { background: var(--verde-dark); color: #fff; }
.kpi-mini.destaque .label, .kpi-mini.destaque span { color: rgba(255, 255, 255, .75); }

/* propostas */
.proposta-card { display: grid; gap: 10px; }
.proposta-topo { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.proposta-valores { display: flex; flex-wrap: wrap; gap: 8px; }
.proposta-valores > div { display: grid; padding: 8px 14px; border-radius: 10px; background: var(--surface-2); min-width: 110px; }
.proposta-valores span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.proposta-valores b { font-size: 15px; }
.proposta-aceite { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--ok-bg); color: var(--text); }
.proposta-card .acoes-linha { margin: 0; }
.prop-itens { display: grid; gap: 6px; margin-bottom: 4px; }
.prop-item { display: grid; grid-template-columns: 1fr 130px auto auto; gap: 8px; align-items: center; }
.prop-item .opcao { margin: 0; white-space: nowrap; }
.prop-contrato { margin: 4px 0 14px; }
.contrato-texto { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; line-height: 1.55; }

@media (max-width: 800px) {
  .vendas-resumo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .onb-modelo-campos { grid-template-columns: 1fr; }
  .onb-modelo-linha { flex-wrap: wrap; }
  .onb-item { flex-wrap: wrap; }
  .onb-resp { max-width: none; flex: 1 1 100%; margin-left: 30px; }
}
@media (max-width: 600px) {
  .prop-item { grid-template-columns: 1fr 1fr; }
  .arte-novo { flex-direction: column; }
  .arte-caixa img, .arte-caixa video { max-height: 340px; }
}

/* ══ Acabamento geral ═══════════════════════════════════════════
   Tira a cara de "navegador" dos controles: select com seta própria,
   busca com lupa, rolagem fina, texto de campo no tamanho do resto da
   tela. Vem no fim do arquivo de propósito: sobrescreve o básico. */

.conteudo { max-width: 1600px; }

/* 14px no desktop; 16px só em tela de toque (o Safari dá zoom abaixo disso) */
input:not([type]), input[type=text], input[type=email], input[type=password],
input[type=number], input[type=search], input[type=date], input[type=time], input[type=tel], input[type=month], select, textarea {
  font-size: 14px;
}
@media (pointer: coarse) {
  input:not([type]), input[type=text], input[type=email], input[type=password],
  input[type=number], input[type=search], input[type=date], input[type=time], input[type=tel], input[type=month], select, textarea {
    font-size: 16px;
  }
}

select:not([multiple]), select:not([multiple]):focus {
  -webkit-appearance: none; appearance: none;
  padding-right: 40px; cursor: pointer; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235c615e' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 11px 8px;
}
select:not([multiple]):hover { background-color: var(--surface-3); }
select:not([multiple]):focus { background-color: var(--surface); }
select:disabled { cursor: default; opacity: .7; }

input[type=search], input[type=search]:focus {
  padding-left: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8f8b' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 15px center; background-size: 16px;
}
input[type=search]::-webkit-search-cancel-button { cursor: pointer; }

/* filtro de valor não precisa da setinha de número */
.filtros input[type=number]::-webkit-inner-spin-button,
.filtros input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.filtros input[type=number] { -moz-appearance: textfield; appearance: textfield; }

/* barra de filtros: campos claros sobre o fundo, alternância à direita */
.filtros-lista { gap: 8px; align-items: center; }
.filtros-lista > input, .filtros-lista > select { background-color: var(--surface); box-shadow: var(--shadow-1); }
.filtros-lista > select:hover { background-color: var(--surface-2); }
.filtros-lista > .alternar { margin-left: auto; }
.filtros-lista > input[type=number] { max-width: 170px; }

/* rolagem fina, sem trilho branco */
* { scrollbar-width: thin; scrollbar-color: rgba(16, 18, 17, .2) transparent; }
.menu { scrollbar-color: rgba(255, 255, 255, .18) transparent; }

/* trilho claro: com o verde escuro do tokens, "0 de 0" parecia 100% */
.bar { background: var(--surface-3); }

/* navegação de semana vira um grupo só */
.semana-nav {
  background: var(--surface); border-radius: var(--radius-pill); padding: 3px; box-shadow: var(--shadow-1);
}
.semana-nav .btn { padding: 7px 14px; border-radius: var(--radius-pill); font-size: 13px; }
.semana-nav .btn[aria-label] { font-size: 18px; line-height: 1; padding: 5px 12px 7px; color: var(--text-muted); }
.semana-nav .btn[aria-label]:hover { color: var(--text); }

/* vazio com um ícone discreto (só os que não ajustam o próprio espaço) */
.vazio:not([style]):not(.wa-vazio)::before {
  content: ''; display: block; width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 14px;
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a3a7a4' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 13h5l1.5 3h5L16 13h5'/%3E%3Cpath d='M5.5 5.5h13L21 13v5a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 18v-5z'/%3E%3C/svg%3E") center / 22px no-repeat;
}
.vazio { line-height: 1.55; }
.vazio:not([style]) { max-width: 560px; margin-left: auto; margin-right: auto; }
.card.vazio { max-width: none; }

/* ══ Kanban ══ */
.coluna { flex: 1 0 264px; min-width: 264px; }
.coluna-topo { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 0 6px 10px; }
.coluna-nome { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 800; font-size: 12.5px; letter-spacing: .04em; }
.coluna-nome::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--cor-etapa, var(--text-faint)); flex: none; }
.coluna[data-tipo=ganho] { --cor-etapa: var(--verde); }
.coluna[data-tipo=perdido] { --cor-etapa: var(--danger); }
.coluna-soma { margin: 3px 0 0 16px; }
.coluna-qtd {
  min-width: 24px; height: 22px; padding: 0 8px; border-radius: var(--radius-pill); display: grid; place-items: center;
  background: var(--surface); box-shadow: var(--shadow-1); font-size: 12px; font-weight: 700; color: var(--text-soft);
}
.coluna-corpo { background: rgba(255, 255, 255, .38); border-radius: 18px; padding: 8px; min-height: 160px; }
.coluna-corpo.sobre { background: rgba(22, 192, 96, .12); box-shadow: inset 0 0 0 2px rgba(22, 192, 96, .45); }
.coluna-vazia {
  flex: 1; display: grid; place-content: center; gap: 2px; min-height: 120px; padding: 16px;
  border: 1.5px dashed rgba(16, 18, 17, .12); border-radius: 14px;
  font-size: 12.5px; font-weight: 600; color: var(--text-muted); text-align: center;
}
.coluna-vazia small { font-size: 11.5px; font-weight: 500; color: var(--text-faint); }
.coluna-corpo.sobre .coluna-vazia { border-color: rgba(22, 192, 96, .6); color: var(--verde-deep); }
.board { padding-bottom: 10px; }

@media (max-width: 700px) {
  .filtros-lista > input, .filtros-lista > select { max-width: none; flex: 1 1 calc(50% - 4px); min-width: 0; }
  .filtros-lista > input[type=search] { flex-basis: 100%; }
  .filtros-lista > input[type=number] { max-width: none; }
  .filtros-lista > .alternar { margin-left: 0; }
}

/* ───── frente conteudo: Criativos IA e Instagram orgânico ───── */
.cr-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--gap, 14px); }
.cr-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.cr-arte { background: var(--surface-2); display: grid; place-items: center; }
.cr-arte img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cr-arte.cr-feed { aspect-ratio: 4 / 5; }
.cr-arte.cr-quadrado { aspect-ratio: 1 / 1; }
.cr-arte.cr-story { aspect-ratio: 9 / 16; max-height: 420px; }
.cr-miolo { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cr-topo { display: flex; gap: 4px; flex-wrap: wrap; }
.cr-headline { margin: 2px 0 0; font-size: 15px; line-height: 1.3; }
.cr-texto { margin: 0; white-space: pre-wrap; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.cr-video { font-size: 12.5px; }
.cr-video summary { cursor: pointer; font-weight: 700; color: var(--text-muted); }
.cr-video p { margin: 6px 0 0; }
.cr-acoes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border); }
.cr-acoes .btn { padding: 4px 8px; font-size: 12px; min-height: 0; }

.ig-conta { display: flex; align-items: center; gap: 8px; }
.ig-conta img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.ig-barras { width: 100%; height: 120px; display: block; fill: var(--verde); }
.ig-barras rect:hover { fill: var(--verde-deep); }
.ig-barras-eixo { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.ig-horas { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; margin-top: 6px; }
.ig-horas span { height: 26px; border-radius: 4px; background: var(--verde-deep); }
.ig-melhores { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.ig-post { display: flex; gap: 10px; padding: 10px; color: inherit; text-decoration: none; }
.ig-post-img { width: 76px; height: 96px; flex: none; object-fit: cover; border-radius: 8px; background: var(--surface-2); }
.ig-post-txt { min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.ig-post-txt p { margin: 0; overflow-wrap: anywhere; }
.ig-mini { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; background: var(--surface-2); display: block; }

.ct-cal .cal-dia { min-height: 96px; }
.ct-cal .cal-item { display: block; width: 100%; border: 0; text-align: left; font: inherit; font-size: 11.5px; padding: 4px 6px;
  cursor: pointer; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-item.cal-agendado { background: var(--info-bg); color: var(--info); }
.cal-item.cal-processando { background: var(--warn-bg); color: var(--warn); }
.cal-item.cal-publicado { background: var(--ok-bg); color: var(--ok); }
.cal-item.cal-erro { background: var(--danger-bg); color: var(--danger); }
.ct-legenda { display: flex; gap: 4px; flex-wrap: wrap; }

.ag-midias { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.ag-midia { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 12.5px; min-width: 0; }
.ag-midia a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-midia img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; flex: none; }
.ag-add { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.ag-add input[type=url], .ag-add select { flex: 1 1 220px; }
.ag-lista { margin: 4px 0 12px; padding-left: 18px; font-size: 12.5px; overflow-wrap: anywhere; }

@media (max-width: 700px) {
  .cr-grade, .ig-melhores { grid-template-columns: 1fr; }
  .ct-cal { gap: 3px; }
  .ct-cal .cal-dia { min-height: 64px; padding: 3px; }
  .ct-cal .cal-item { font-size: 0; height: 8px; padding: 0; border-radius: 4px; }
  .ig-horas span { height: 18px; }
}

/* ── atendente (Atendente IA: /atendente-ia) ── */
.at-abas { margin-bottom: 16px; flex-wrap: wrap; }
.at-chaves { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.at-horario { display: grid; gap: 8px; }
.at-dia { align-items: center; gap: 10px; }
.at-dia .ia-chave { min-width: 120px; }
.at-dia input[type="time"] { width: auto; }
.at-ferramentas { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 8px; }
.at-salvar { position: sticky; bottom: 0; padding: 12px 0; background: var(--bg); z-index: 2; }
.at-faq-item { margin-bottom: 10px; }
.at-licao { margin-bottom: 12px; }
.at-ia-dizia { margin: 0 0 12px; padding: 10px 12px; border-left: 3px solid var(--danger); background: var(--surface-2); border-radius: 6px; font-size: 13px; white-space: pre-wrap; }
.at-ia-dizia .label { margin-bottom: 4px; }
.at-resumo { margin-bottom: 14px; }
.at-resumo-nums { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 12px; }
.at-resumo-texto { white-space: pre-wrap; line-height: 1.55; margin-bottom: 10px; }
.at-resumo details summary, .at-fontes summary { cursor: pointer; font-size: 13px; }
.at-thread { min-height: 220px; max-height: 480px; overflow-y: auto; }
.at-fontes { margin-top: 4px; font-size: 12px; max-width: 520px; }
.at-fontes p { margin: 4px 0; }
@media (max-width: 640px) {
  .at-dia { flex-wrap: wrap; }
  .at-dia .ia-chave { min-width: 100%; }
}

/* ---------------------------- atendimento ---------------------------- */
/* filtros extras do inbox, ficha da conversa, tela /atendimento e aba Grupo */
.at-filtros { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 8px; }
.at-filtros .btn { padding: 4px 10px; font-size: 12.5px; }
.at-filtros .btn.ativo { background: var(--verde-wash); color: var(--verde-deep); border-color: var(--verde); }
.at-filtros select { flex: 1 1 120px; min-width: 0; font-size: 12.5px; padding: 4px 8px; }
.at-ag { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.at-ag:last-of-type { border-bottom: 0; }
.at-ag-texto { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-soft); margin: 2px 0; }
.at-ag-acoes { display: flex; gap: 4px; }
.at-ag-acoes .btn { padding: 2px 8px; font-size: 12px; }
.at-ranking { list-style: none; margin: 0; padding: 0; }
.at-ranking li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.at-ranking li:last-child { border-bottom: 0; }
.at-ranking li b { flex: 1; min-width: 0; }
.at-pos { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: var(--surface-2); color: var(--text-soft); flex: none; }
.at-ranking li:first-child .at-pos { background: var(--verde); color: #fff; }
.at-barra { display: block; height: 6px; border-radius: var(--radius-pill); background: var(--verde); min-width: 2px; }
.at-risco { display: flex; flex-direction: column; gap: 8px; }
.at-medidor { height: 8px; border-radius: var(--radius-pill); background: var(--surface-2); overflow: hidden; }
.at-medidor span { display: block; height: 100%; background: var(--verde); }
.at-medidor-medio span { background: var(--warn); }
.at-medidor-alto span { background: var(--danger); }
.at-grupo-thread { max-height: 420px; min-height: 160px; overflow-y: auto; }
.at-autor { font-size: 11.5px; font-weight: 700; color: var(--verde-deep); margin-bottom: 2px; }
.at-grupos { max-height: 360px; overflow-y: auto; }
.at-grupo-linha { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.at-grupo-linha:last-child { border-bottom: 0; }

/* frente consultor */
.cs { flex: 1; min-width: 0; min-height: 0; display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; }
.cs-lado {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-2); overflow: hidden;
}
.cs-lado-topo { padding: 12px; border-bottom: 1px solid var(--border); }
.cs-lista { flex: 1; min-height: 0; overflow-y: auto; padding: 6px; }
.cs-lista-vazia { color: var(--text-muted); font-size: 13px; padding: 14px 10px; margin: 0; }
.cs-item {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 10px; cursor: pointer;
}
.cs-item:hover, .cs-item:focus-visible { background: var(--surface-2); outline: none; }
.cs-item.ativo { background: var(--verde-wash); }
.cs-item-txt { flex: 1; min-width: 0; }
.cs-item-titulo { font-size: 13.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-item-sub { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-item-acoes { display: none; gap: 2px; }
.cs-item:hover .cs-item-acoes, .cs-item.ativo .cs-item-acoes { display: flex; }
.cs-item-acoes .btn-icone { font-size: 12px; }
.cs-pend {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--warn-bg); color: var(--warn); font-size: 11px; font-weight: 700;
}
.cs-lado-rodape { border-top: 1px solid var(--border); padding: 10px 14px; font-size: 12.5px; color: var(--text-soft); }
.cs-lado-rodape summary { cursor: pointer; font-weight: 600; color: var(--text); }
.cs-lado-rodape ul { margin: 8px 0; padding-left: 18px; max-height: 180px; overflow-y: auto; }
.cs-lado-rodape p { margin: 6px 0 0; color: var(--text-muted); }
.cs-topo-esq, .cs-topo-dir { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cs-abrir-lado { display: none; }
.cs-tag-acao {
  display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; background: var(--warn-bg); color: var(--warn);
}

.cs-ferr { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cs-ferr-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; background: var(--surface-2); color: var(--text-soft); border: 1px solid var(--border);
}
.cs-ferr-chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--verde); }
.cs-ferr-chip.acao::before { background: var(--warn); }
.cs-ferr-chip.falhou { color: var(--danger); background: var(--danger-bg); border-color: transparent; }
.cs-ferr-chip.falhou::before { background: var(--danger); }
.cs-modo {
  margin-top: 10px; padding: 8px 12px; border-radius: 10px; font-size: 12.5px;
  background: var(--info-bg); color: var(--info);
}
.cs-pensando { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.cs-tabela { overflow-x: auto; margin: 8px 0; }
.cs-tabela .tabela { font-size: 13px; }

.cs-acoes:empty { display: none; }
.cs-acao {
  margin-top: 12px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--warn); background: var(--warn-bg);
}
.cs-acao.feita { border-color: var(--ok); background: var(--ok-bg); }
.cs-acao.falhou { border-color: var(--danger); background: var(--danger-bg); }
.cs-acao.cancelada { border-color: var(--border); background: var(--surface-2); opacity: .8; }
.cs-acao-topo { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.cs-acao-status { font-size: 12px; font-weight: 600; color: var(--text-soft); }
.cs-acao.feita .cs-acao-status { color: var(--ok); }
.cs-acao.falhou .cs-acao-status { color: var(--danger); }
.cs-acao-resumo { font-size: 14px; color: var(--text); font-weight: 500; }
.cs-acao-aviso { margin-top: 6px; font-size: 12.5px; color: var(--warn); font-weight: 600; }
.cs-acao-erro { margin-top: 6px; font-size: 12.5px; color: var(--danger); }
.cs-acao-botoes { display: flex; gap: 8px; margin-top: 10px; }

.cs-uso-topo { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.cs-uso .num { text-align: right; font-variant-numeric: tabular-nums; }
.cs-uso tr[data-mes] { cursor: pointer; }
.cs-uso tr.cs-uso-aberto td { background: var(--verde-wash); }
.cs-uso-detalhe > td { background: var(--surface-2); padding: 8px 10px; }
.cs-uso-detalhe .tabela { font-size: 12.5px; }
.cs-precos input { width: 110px; }
.cs-metas textarea { width: 100%; }

.mcp .cap-codigo { margin: 6px 0 8px; max-height: 260px; overflow: auto; }
.cs-sub { margin: 22px 0 8px; font-family: var(--font-display); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-soft); }
.cs-chave { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; margin: 0; }
.cs-ok { color: var(--ok); font-weight: 600; }
.cs-falha { color: var(--danger); font-size: 12.5px; }
.cs-args { overflow-wrap: anywhere; max-width: 420px; }

@media (max-width: 900px) {
  .cs { grid-template-columns: minmax(0, 1fr); position: relative; }
  .cs-lado {
    position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 60;
    border-radius: 0; transform: translateX(-105%); transition: transform .2s ease;
  }
  .cs.lado-aberto .cs-lado { transform: none; }
  .cs-abrir-lado { display: inline-flex; }
  .cs-item-acoes { display: flex; }
  .chat-contexto select { max-width: 180px; }
}

/* ---------------------------- conversões ---------------------------- */
/* ROAS (ficha do cliente e /vendas), integrações de venda e regras de CAPI */
.vendas-resumo.cv-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cv-periodo { margin-bottom: 12px; }
.cv-periodo select { max-width: 220px; }
.cv-grafico { margin-bottom: 14px; }
.cv-legenda { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.cv-legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.cv-cor-receita, .cv-dia .cv-r { background: var(--verde); }
.cv-cor-gasto, .cv-dia .cv-g { background: var(--border-hover, #cfcac2); }
.cv-dias { display: flex; align-items: flex-end; gap: 3px; height: 140px; }
.cv-dia { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; gap: 1px; }
.cv-dia i { flex: 1 1 0; border-radius: 3px 3px 0 0; }
.cv-dia:hover i { opacity: .75; }
.cv-eixo { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-muted); margin-top: 6px; }
.cv-integ { padding: 14px 0; border-top: 1px solid var(--border); }
.cv-integ:first-of-type { margin-top: 12px; }
.cv-integ .aviso { margin-top: 8px; }
.cv-onde { margin-top: 10px; font-size: 13px; }
.cv-onde summary { cursor: pointer; color: var(--verde-deep, var(--verde)); font-weight: 600; }
.cv-passos { margin: 8px 0 0; padding-left: 20px; line-height: 1.55; }
.cv-passos li { margin-bottom: 4px; }
.cv-passos code { font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.cv-onde .cap-codigo { margin-top: 8px; }
@media (max-width: 720px) {
  .vendas-resumo.cv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cv-dias { height: 110px; gap: 1px; }
  .cv-integ .copiar-linha { flex-wrap: wrap; }
}

/* frente google */
.g-mini { font-size: 12px; color: var(--text-muted); margin-top: 2px; font-weight: 400; }
.g-sub { min-height: 60px; }
.g-site { margin-bottom: 14px; }
.g-site-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.g-site-acoes { display: flex; gap: 10px; white-space: nowrap; }
.g-site .copiar-linha code { overflow-wrap: anywhere; }
.g-passos { margin: 8px 0 0; padding-left: 20px; line-height: 1.55; }
.g-passos li { margin-bottom: 6px; }
.g-passos code, .g-site .nota code { font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.tabela tfoot.g-total td { font-weight: 600; border-top: 1px solid var(--border); }
@media (max-width: 720px) {
  .g-site-topo { flex-direction: column; }
  .g-site .copiar-linha { flex-wrap: wrap; }
}

/* ── frente: relatorios (metas do cliente) ── */
.rel-metas { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-top: 12px; }
.rel-meta { background: var(--surface-2); border-radius: var(--radius); padding: 12px 14px; }
.rel-meta > b { display: block; font: 800 20px/1.25 var(--font-display); margin: 6px 0; }
.rel-meta-topo { display: flex; gap: 6px; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.rel-meta-trilho { height: 8px; border-radius: var(--radius-pill); background: var(--surface-3); overflow: hidden; }
.rel-meta-trilho i { display: block; height: 100%; background: var(--verde); border-radius: inherit; }
.rel-meta-abaixo .rel-meta-trilho i { background: var(--warn); }
.rel-meta-batida { background: var(--verde-wash); }

/* ───────────── gestao: aprovações, cohort, Início montável ───────────── */
.gestao-copiar { display: flex; gap: 8px; }
.gestao-copiar input { flex: 1; min-width: 0; }
.gestao-texto { white-space: pre-wrap; font-size: 14px; line-height: 1.55; margin: 10px 0; background: var(--surface-2); }
.gestao-previa { display: block; max-width: 100%; max-height: 360px; border-radius: var(--radius); border: 1px solid var(--border); margin: 10px 0; }
.gestao-hist { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.gestao-hist li { padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); border-left: 3px solid var(--border); }
.gestao-hist li.cliente { border-left-color: var(--verde); background: var(--verde-wash); }
.gestao-comentar { display: flex; gap: 8px; align-items: flex-end; }
.gestao-comentar textarea { flex: 1; }
.gestao-passos { margin: 12px 0; padding-left: 20px; display: grid; gap: 4px; color: var(--text-soft); font-size: 13.5px; }
.gestao-motivo { margin-top: 6px; padding: 6px 10px; font-size: 12.5px; }
.gestao-acoes { white-space: nowrap; }
.gestao-acoes .btn { padding-inline: 8px; }
.gestao-barra { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.gestao-barra .bar { flex: 1; }
.gestao-barra span { font-size: 12.5px; font-weight: 700; min-width: 38px; text-align: right; }
.gestao-delta { font-size: 12.5px; font-weight: 700; }
.gestao-delta.sobe { color: var(--ok); }
.gestao-delta.desce { color: var(--danger); }
.gestao-cohort-rolagem { overflow-x: auto; }
.gestao-cohort td.gestao-cel {
  background: color-mix(in srgb, var(--verde) var(--r, 0%), var(--surface));
  color: var(--text); font-weight: 600; font-size: 12.5px; min-width: 52px;
}
.inicio-widget + .inicio-widget { margin-top: 4px; }
.gestao-widgets { display: grid; gap: 8px; margin: 12px 0; }
.gestao-widget { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.gestao-widget.desligado { opacity: .55; }
.gestao-widget .marcar span .sub { display: block; }
.gestao-setas { display: flex; gap: 4px; }
.gestao-setas .btn { padding: 4px 10px; }
@media (max-width: 640px) {
  .gestao-comentar, .gestao-copiar { flex-direction: column; align-items: stretch; }
  .gestao-acoes { white-space: normal; }
}

/* ── frente trafego ── */
.tr-pior { color: var(--danger); font-weight: 600; }
.tr-melhor { color: var(--ok); font-weight: 600; }
.tr-tendencia td:not(:first-child), .tr-tendencia th:not(:first-child) { text-align: right; white-space: nowrap; }

/* ── frente plataforma ── */
.plat-grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: var(--gap, 16px); margin-top: 16px; align-items: start; }
.plat-card h3 { font-family: var(--font-display); font-size: 13px; letter-spacing: .04em; text-transform: uppercase; margin: 0 0 12px; }
.plat-miolo > p { margin: 0 0 10px; }
.plat-miolo .badge + .nota { margin-left: 6px; }
.plat-botoes { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.plat-botoes-leves { margin-top: 6px; }
.plat-linha { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.plat-linha > * { flex: 1 1 180px; }
.plat-sub { font-family: var(--font-display); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); margin: 20px 0 8px; }
.plat-rotulo { margin-top: 18px; }
.plat-passos { margin: 0 0 12px; padding-left: 20px; font-size: 13.5px; line-height: 1.55; }
.plat-passos li + li { margin-top: 4px; }
.plat-qr { display: flex; justify-content: center; margin: 8px 0 4px; }
.plat-qr svg { border: 1px solid var(--border); border-radius: var(--radius); max-width: 100%; height: auto; }
.plat-chave { display: block; padding: 10px 12px; margin: 4px 0 16px; background: var(--surface-2); border-radius: var(--radius); font-size: 14px; letter-spacing: .06em; word-break: break-all; user-select: all; }
.plat-codigos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 12px 0; }
.plat-codigos code { padding: 8px 10px; text-align: center; background: var(--surface-2); border-radius: var(--radius); font-size: 14px; letter-spacing: .05em; }
.plat-lista { list-style: none; margin: 0; padding: 0; }
.plat-lista li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.plat-lista li:first-child { border-top: 0; }
.plat-lista li > div { min-width: 0; }
.plat-lista .badge { margin-left: 6px; }
.plat-lista .nota { display: block; margin-top: 2px; }
.plat-cats { display: grid; gap: 8px; margin-top: 8px; }
.plat-cats .marcar { align-items: flex-start; font-weight: 400; }
.plat-cats .marcar input { margin-top: 2px; flex: none; }
.plat-cats .marcar b { display: block; font-weight: 600; }
.plat-cats .marcar small { display: block; color: var(--text-muted); font-size: 12px; }
.plat-perm { display: grid; gap: 4px; }
.plat-perm-linha { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 13.5px; }
.plat-mudou { font-style: normal; font-size: 11px; font-weight: 600; color: var(--warn); margin-left: 4px; }
.plat-padrao { margin: 8px 0 0; }
.plat-busca { margin: 10px 0 8px; }
.plat-clientes { display: grid; gap: 6px; max-height: 240px; overflow-y: auto; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); }
.plat-clientes .marcar { font-weight: 500; }
.plat-link { display: flex; gap: 8px; align-items: center; }
.plat-link input { flex: 1; min-width: 0; }
.plat-eu { cursor: pointer; border-radius: var(--radius); }
.plat-eu:hover .quem { text-decoration: underline; }
.plat-eu:focus-visible { outline: 2px solid var(--verde); outline-offset: 2px; }
.plat-login-alt { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.plat-login-alt .btn-link { margin-left: 0; font-size: 13px; }
.ajuda-busca { margin-bottom: 16px; }
.ajuda-busca input { width: 100%; max-width: 560px; }
.ajuda-grupo { margin-bottom: 20px; }
.ajuda-grupo h3 { font-family: var(--font-display); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 8px; }
.ajuda-artigo { margin-bottom: 8px; }
.ajuda-artigo summary { cursor: pointer; font-weight: 700; list-style-position: inside; }
.ajuda-artigo[open] summary { margin-bottom: 8px; }
.ajuda-texto { font-size: 14px; line-height: 1.6; color: var(--text); max-width: 72ch; }
.ajuda-texto p { margin: 0 0 8px; }
.ajuda-texto ul { margin: 0 0 8px; padding-left: 20px; }
@media (max-width: 640px) {
  .plat-grade { grid-template-columns: 1fr; }
  .plat-perm-linha { flex-direction: column; align-items: flex-start; gap: 4px; }
  .plat-lista li { flex-direction: column; align-items: flex-start; }
  .plat-codigos { grid-template-columns: 1fr 1fr; }
}

/* ───── frente agendamento: agenda, tipos de reunião, formulários avançados ───── */
.ag-form { display: grid; gap: 12px; }
.ag-form .campo { margin: 0; }
.ag-seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: var(--radius-pill); }
.ag-seg button { border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 600; color: var(--text-soft);
  padding: 6px 14px; border-radius: var(--radius-pill); cursor: pointer; }
.ag-seg button.ativo { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.ag-controles { align-items: center; gap: 10px; }
.ag-nav { display: inline-flex; gap: 4px; }
.ag-nav .btn { padding: 6px 10px; }

/* seletor de horário (modal marcar/remarcar) */
.ag-slots-topo { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; font-weight: 700; }
.ag-slots-dia { margin-bottom: 12px; }
.ag-slots-dia .label { margin-bottom: 6px; text-transform: capitalize; }
.ag-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.ag-slot { border: 1.5px solid var(--border); background: var(--surface); border-radius: var(--radius); padding: 7px 0;
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums; }
.ag-slot:hover { border-color: var(--verde); }
.ag-slot.ativo { background: var(--verde); border-color: var(--verde); color: #fff; }
.ag-escolhido { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--radius);
  background: var(--verde-wash); color: var(--verde-deep); }
.ag-escolhido select { flex: 0 1 220px; }

/* escolha de lead */
.ag-lead-fixo { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px;
  background: var(--surface-2); border-radius: var(--radius); }
.ag-achados { display: grid; gap: 4px; margin-top: 6px; }
.ag-achados:empty { display: none; }
.ag-achado { display: flex; justify-content: space-between; gap: 10px; text-align: left; border: 1px solid var(--border);
  background: var(--surface); border-radius: var(--radius); padding: 8px 10px; font: inherit; font-size: 13px; cursor: pointer; }
.ag-achado:hover { border-color: var(--verde); }
.ag-achado span { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* detalhe da reunião */
.ag-detalhe { display: grid; gap: 10px; }
.ag-detalhe .label { display: block; margin-bottom: 2px; }
.ag-resp { display: grid; grid-template-columns: minmax(120px, 35%) 1fr; gap: 10px; padding: 6px 0; border-top: 1px solid var(--border);
  font-size: 13px; overflow-wrap: anywhere; }
.ag-resp span { color: var(--text-muted); }

/* lista do dia e da semana; .card.ag-lista pra não brigar com o .ag-lista da frente conteudo */
.card.ag-lista { display: grid; gap: 6px; margin: 0; padding: 12px; font-size: inherit; }
.ag-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; font: inherit; cursor: pointer;
  background: var(--surface-2); border-radius: var(--radius); padding: 10px 12px; border-left: 4px solid var(--cor, var(--verde)); }
.ag-item:hover { background: var(--surface-3); }
.ag-item.st-cancelada, .ag-item.st-faltou { opacity: .6; }
.ag-item.st-cancelada .ag-texto b { text-decoration: line-through; }
.ag-tarefa { background: var(--surface); border: 1px dashed var(--border); border-left: 4px solid var(--border-hover); }
.ag-tarefa.feito { opacity: .55; }
/* compromisso (tarefa tipo reunião): sólido, cor de informação; o que veio do Google ganha o "G" */
.ag-tarefa { border-style: solid; border-left-color: var(--info); }
.ag-g { display: inline-block; font-size: 10px; font-weight: 800; line-height: 1; padding: 2px 4px; border-radius: 4px;
  background: var(--info-bg); color: var(--info); vertical-align: 1px; }
.ag-google-erro { color: var(--danger); }
.ag-google { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px;
  padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
  font-size: 13px; color: var(--text-soft); }
.ag-google:empty { display: none; }
.ag-google .btn { padding: 5px 10px; }
/* compromisso pessoal de outra pessoa: só o horário */
.ag-ocupado { cursor: default; background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--surface) 6px 12px);
  border: 1px dashed var(--border); border-left: 4px solid var(--text-faint); color: var(--text-soft); }
.ag-ocupado:hover { background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--surface) 6px 12px); }
.ag-chip-ocupado { cursor: default; opacity: .75; font-style: italic; }
.ag-tarefa.feito .ag-texto b { text-decoration: line-through; }
.ag-hora { flex: none; min-width: 48px; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; line-height: 1.25; }
.ag-texto { flex: 1; min-width: 0; display: grid; }
.ag-texto b, .ag-texto small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-texto small { color: var(--text-muted); font-size: 12px; }
.ag-semana { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.ag-col { display: grid; align-content: start; gap: 6px; background: var(--surface); border-radius: var(--radius-card);
  padding: 8px; box-shadow: var(--shadow-1); min-height: 140px; }
.ag-col.hoje { box-shadow: 0 0 0 2px var(--verde); }
.ag-col.passado { opacity: .7; }
.ag-col .ag-item { flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px; }
.ag-col .ag-hora { min-width: 0; }
.ag-col-topo { border: 0; background: transparent; font: inherit; font-size: 12px; font-weight: 700; text-transform: capitalize;
  color: var(--text-soft); text-align: left; cursor: pointer; padding: 2px 2px 4px; }
.ag-col-topo:hover { color: var(--verde-dark); }
.ag-col-vazio { color: var(--text-faint); font-size: 12px; padding: 4px 2px; }

/* tipos de reunião */
.ag-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.ag-campos .campo { margin: 0; }
.ag-membros { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 4px 0; }
.ag-opcoes { display: flex; flex-direction: column; gap: 8px; margin: 4px 0; }
.ag-pergunta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px; margin-bottom: 8px;
  background: var(--surface-2); border-radius: var(--radius); }
.ag-pergunta > input, .ag-pergunta > select { min-width: 0; }
.ag-tipos { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--gap); }
.ag-tipo { border-top: 4px solid var(--cor, var(--verde)); }
.ag-tipo-topo { display: flex; align-items: center; gap: 8px; }
.ag-bolinha { width: 10px; height: 10px; border-radius: 50%; background: var(--cor, var(--verde)); flex: none; }
.ag-link { display: block; font-size: 12px; padding: 6px 8px; background: var(--surface-2); border-radius: var(--radius);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* horário semanal */
.ag-dias { display: grid; gap: 4px; margin: 12px 0; }
.ag-dia-linha { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--border); }
.ag-dia-linha:first-child { border-top: 0; }
.ag-dia-nome { flex: 0 0 140px; }
.ag-faixas { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; flex: 1; }
.ag-faixa { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px; background: var(--surface-2); border-radius: var(--radius); }
.ag-faixa input[type=time] { width: auto; padding: 4px 6px; }
.ag-faixa .btn { padding: 2px 8px; }

/* formulários avançados */
.form-opcao-img { flex-wrap: wrap; }
.form-opcao-img input[data-oc="imagem"] { flex: 2 1 200px; }
.form-miniatura { width: 40px; height: 40px; flex: none; display: inline-grid; place-items: center; border-radius: 6px;
  background: var(--surface-2); color: var(--text-faint); overflow: hidden; }
.form-miniatura img { width: 40px; height: 40px; object-fit: cover; display: block; }
.form-subir { cursor: pointer; flex: none; }
.aguarde { opacity: .55; pointer-events: none; cursor: progress; }
.form-ocultos { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.logica-regra { justify-content: flex-start; gap: 8px; }
.logica-regra select { min-width: 0; flex: 1 1 160px; }
.logica-regra input { flex: 1 1 120px; min-width: 0; }
.logica-regra > span { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.form-etapa { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.form-funil { display: grid; gap: 8px; }
.form-funil-linha { display: grid; grid-template-columns: minmax(140px, 32%) 1fr auto; gap: 12px; align-items: center; font-size: 13px; }
.form-funil-nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-funil-barra { height: 10px; background: var(--surface-2); border-radius: var(--radius-pill); overflow: hidden; }
.form-funil-barra i { display: block; height: 100%; background: var(--verde); border-radius: inherit; }
.form-funil-num { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.form-funil-num em { font-style: normal; color: var(--danger); font-weight: 600; margin-left: 4px; }
.tabela tr.form-spam td { color: var(--text-muted); }

@media (max-width: 760px) {
  .ag-semana { grid-template-columns: 1fr; }
  .ag-col { min-height: 0; }
  .ag-col .ag-item { flex-direction: row; align-items: center; }
  .ag-dia-nome { flex-basis: 100%; }
  .ag-resp { grid-template-columns: 1fr; gap: 2px; }
  .form-funil-linha { grid-template-columns: 1fr auto; }
  .form-funil-barra { grid-column: 1 / -1; grid-row: 2; }
}

/* ── frente comercial ── */
/* SLA no card: borda lateral pra ler o funil de longe sem abrir nada */
.negocio.sla-aviso { box-shadow: inset 3px 0 0 var(--warn), var(--shadow-1, 0 1px 3px rgba(0,0,0,.08)); }
.negocio.sla-estourou { box-shadow: inset 3px 0 0 var(--danger), var(--shadow-1, 0 1px 3px rgba(0,0,0,.08)); background: linear-gradient(90deg, var(--danger-bg), var(--surface) 40%); }
.marcador.quente { background: var(--verde-wash); color: var(--verde-deep); }
.marcador.neutro { background: var(--surface-2); color: var(--text-muted); }
.coluna-sla { font-size: 11px; color: var(--text-muted); font-weight: 600; margin-top: 2px; }
.cm-fora { color: var(--danger); font-weight: 700; }

.cm-barra { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.cm-barra select { width: auto; }
.cm-alertas { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; align-items: center; }
.cm-alertas .dialogo-chip { margin: 0; }
.cm-acoes { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.cm-espaco { flex: 1; }
.cm-massa {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  background: var(--verde-wash); border: 1px solid var(--verde); border-radius: var(--radius);
  padding: 8px 12px; margin-bottom: 10px; font-size: 13px;
}
.cm-massa select, .cm-massa input { width: auto; }
.cm-sel { width: 34px; text-align: center; }
.cm-sel input { width: auto; margin: 0; cursor: pointer; }
.cm-msg:empty { display: none; }
.cm-msg { margin: 10px 0; }

/* modo seleção: o card vira alvo de clique, não de arraste */
.selecionando .negocio { cursor: copy; user-select: none; }
.negocio.selecionado { box-shadow: inset 0 0 0 2px var(--verde-deep), var(--shadow-1, 0 1px 3px rgba(0,0,0,.08)); background: var(--verde-wash); }
tr.selecionado td { background: var(--verde-wash); }

.cm-barrinha { height: 5px; background: var(--surface-2); border-radius: var(--radius-pill); overflow: hidden; margin-top: 4px; min-width: 60px; }
.cm-barrinha span { display: block; height: 100%; background: var(--verde); border-radius: inherit; }
.cm-barrinha span.ruim { background: var(--danger); }

.cm-resumo { margin: 0; padding-left: 20px; font-size: 13px; display: grid; gap: 4px; }
.cm-resumo .cm-resumo { margin-top: 4px; }
.cm-log { display: grid; gap: 3px; font-size: 12.5px; }
.cm-log > div { border-bottom: 1px solid var(--border); padding: 3px 0; }
.cm-log > div:last-child { border-bottom: 0; }

/* resumo do fluxo no card: ramos com recuo e trilho */
.fluxo-ramo { border-left: 2px solid var(--verde); padding: 6px 0 2px 12px; margin-left: 4px; display: grid; gap: 6px; }

@media (max-width: 640px) {
  .cm-acoes { margin-left: 0; width: 100%; }
  .fluxo-ramo { padding-left: 8px; }
}

/* ═══ Funil por dentro (modulos/funil.js, migration 030) ═══════════ */

/* card: foto do WhatsApp no canto, título, menu ⋯ */
.negocio-cabeca { display: flex; align-items: flex-start; gap: 9px; }
.negocio-cabeca .negocio-titulo { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.fn-avatar {
  position: relative; flex: none; width: 28px; height: 28px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; background: var(--verde-wash); color: var(--verde-deep);
  font-family: var(--font-display); font-weight: 800; font-size: 11px; letter-spacing: .02em;
  box-shadow: 0 0 0 2px var(--surface-solida, var(--surface));
}
.fn-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fn-card-menu {
  flex: none; width: 26px; height: 24px; margin: -3px -5px 0 0; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-muted); font-size: 16px; line-height: 1; cursor: pointer;
}
.fn-card-menu:hover, .fn-card-menu:focus-visible { background: var(--surface-2); color: var(--text); }
.fn-menu {
  position: fixed; z-index: 400; min-width: 150px; padding: 5px; display: grid; gap: 2px;
  background: var(--surface-solida, var(--surface)); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-2, 0 8px 24px rgba(0,0,0,.18));
}
.fn-menu button {
  border: 0; background: transparent; color: var(--text); text-align: left; padding: 8px 10px;
  border-radius: 8px; font: inherit; font-size: 13.5px; cursor: pointer;
}
.fn-menu button:hover { background: var(--surface-2); }
.fn-menu button.perigo, .btn-perigo-texto { color: var(--danger); }

/* cards de resumo no topo do funil */
.fn-resumos { display: flex; flex-wrap: wrap; gap: 12px; padding: 2px 2px 14px; align-items: stretch; }
.fn-resumo {
  flex: 1 1 190px; max-width: 280px; min-width: 0; position: relative; padding: 14px 16px 12px;
  background: var(--card-grad, var(--surface)); border: 1px solid var(--border); border-radius: var(--radius-card, 16px);
  box-shadow: var(--shadow-1); overflow: hidden;
}
.fn-resumo::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--cor-etapa, var(--verde)); }
.fn-resumo-titulo { font-size: 12px; font-weight: 700; color: var(--text-soft, var(--text-muted)); letter-spacing: .02em; }
.fn-resumo-valor { font-family: var(--font-display); font-size: 24px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; color: var(--text); }
.fn-resumo-legenda { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; min-height: 1.3em; }
.fn-resumo-acoes { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 8px; }
.fn-resumo-acoes .btn, .fn-resumo-ctrl .btn { padding: 4px 8px; font-size: 12px; min-height: 0; }
.fn-resumo-ctrl { display: flex; flex-direction: column; justify-content: center; gap: 6px; flex: none; }
.fn-resumo-vazio { flex-basis: 340px; max-width: 460px; border-style: dashed; box-shadow: none; background: transparent; }
.fn-resumo-vazio::before { display: none; }
.fn-ponto { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--cor-etapa, var(--text-faint)); flex: none; vertical-align: middle; }

/* campos / prontuário */
.fn-campos { display: grid; gap: 14px 20px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.fn-campos-coluna { grid-template-columns: 1fr; gap: 10px; }
.fn-campo { min-width: 0; overflow-wrap: anywhere; }
.fn-campo-largo { grid-column: 1 / -1; }
.fn-campo textarea { width: 100%; min-height: 72px; }
.fn-longo { white-space: normal; line-height: 1.5; }
.fn-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.fn-chips .etq { background: var(--verde-wash); color: var(--verde-deep); }
.fn-caixinhas { display: flex; flex-wrap: wrap; gap: 6px; }
.fn-caixinha {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; margin: 0;
  border: 1px solid var(--border); border-radius: var(--radius-pill, 999px); background: var(--surface-2);
  font-size: 13px; font-weight: 500; cursor: pointer; user-select: none; text-transform: none; letter-spacing: 0;
}
.fn-caixinha input { width: auto; margin: 0; accent-color: var(--verde); }
.fn-caixinha:has(input:checked) { border-color: var(--verde); background: var(--verde-wash); color: var(--text); }
.fn-acoes-campos { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.fn-editar-campos { margin-top: 10px; }
.fn-config-campos { padding: 3px 9px; font-size: 12px; min-height: 0; margin-left: 6px; vertical-align: middle; font-weight: 600; }
.fn-prontuario-topo { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.fn-prontuario-topo .fn-config-campos { margin: 0; }
.fn-prontuario-negocio { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; margin-bottom: 8px; }
.fn-prontuario .fn-campos-coluna .label { margin-bottom: 1px; }
.fn-prontuario .fn-caixinha { padding: 5px 9px; font-size: 12.5px; }

/* lista de campos (configurar) */
.fn-lista-campos { display: grid; gap: 6px; }
.fn-linha-campo {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius, 12px); background: var(--surface-2);
}
.fn-linha-campo-txt { flex: 1; min-width: 0; display: grid; gap: 2px; overflow-wrap: anywhere; }
.fn-linha-campo-acoes { display: flex; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.fn-setas { display: inline-flex; gap: 0; flex: none; }
.fn-setas .btn, .fn-linha-campo-acoes .btn { padding: 4px 8px; min-height: 0; font-size: 12.5px; }

/* editor de etapas */
.fn-etapas { display: grid; gap: 6px; }
.fn-etapa {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: var(--radius, 12px); background: var(--surface-2);
}
.fn-etapa.arrastando { opacity: .45; }
.fn-etapa.alvo-antes { box-shadow: inset 0 3px 0 var(--verde); }
.fn-etapa.alvo-depois { box-shadow: inset 0 -3px 0 var(--verde); }
.fn-alca { cursor: grab; color: var(--text-faint); font-weight: 800; letter-spacing: -2px; padding: 0 2px; user-select: none; }
.fn-etapa input[type=color], .fn-nova-etapa input[type=color] {
  width: 32px; height: 32px; padding: 2px; border-radius: 50%; border: 1px solid var(--border); background: none; cursor: pointer; flex: none;
}
.fn-etapa { gap: 6px; }
.fn-etapa input:not([type=color]), .fn-etapa select { height: 36px; min-height: 0; padding: 6px 10px; font-size: 13.5px; }
.fn-etapa select { width: auto; padding-right: 28px; }
.fn-etapa [data-nome] { flex: 1 1 150px; min-width: 110px; }
.fn-etapa [data-tipo] { width: 142px; }
.fn-prazo { display: inline-flex; gap: 4px; align-items: center; }
.fn-prazo input { width: 62px; }
.fn-prazo select { width: 74px; }
.fn-qtd {
  min-width: 26px; height: 22px; padding: 0 8px; border-radius: var(--radius-pill, 999px); display: grid; place-items: center;
  background: var(--surface); font-size: 12px; font-weight: 700; color: var(--text-soft, var(--text-muted));
}
.fn-btn-auto, .fn-etapa .fn-apagar { padding: 5px 9px; font-size: 12.5px; min-height: 0; }
.fn-etapa .fn-apagar { color: var(--danger); }
.fn-nova-etapa { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.fn-nova-etapa [name=nome] { flex: 1 1 200px; }
.fn-nova-etapa select { width: auto; }
.fn-auto { margin-bottom: 10px; display: grid; gap: 8px; }
.fn-auto-topo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fn-auto-acoes { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

@media (max-width: 640px) {
  /* no celular a faixa rola de lado: cinco cards empilhados empurrariam o board pra longe */
  .fn-resumos { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; }
  .fn-resumo { flex: 0 0 168px; max-width: none; padding: 12px 13px 10px; scroll-snap-align: start; }
  .fn-resumo-valor { font-size: 20px; }
  .fn-resumo-vazio { flex-basis: 260px; }
  .fn-etapa { gap: 6px; }
  .fn-etapa [data-nome] { flex-basis: calc(100% - 80px); }
  .fn-linha-campo { flex-wrap: wrap; }
  .fn-linha-campo-acoes { width: 100%; }
}

/* ── Google completo: Tag Manager, Meu Negócio, nova campanha (modulos/google-completo.js) ── */
.gc-vazio { text-align: center; padding: 26px 18px; }
.gc-vazio p { margin: 0 0 12px; }
.gc-ligar { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; align-items: center; }
.gc-ligar > select, .gc-ligar > input { flex: 1 1 220px; max-width: 420px; }
.gc-topo { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.gc-topo-acoes { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.gc-topo-acoes select { width: auto; }
.gc-gtm-id { font-family: var(--font-display); font-size: 22px; font-weight: 800; letter-spacing: .02em; }
.gc-detalhes { margin-top: 12px; }
.gc-detalhes > summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--text-soft); padding: 6px 0; }
.gc-linha { display: flex; justify-content: space-between; gap: 12px; padding: 8px 2px; border-bottom: 1px solid var(--border); font-size: 13px; }
.gc-codigo { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 12px; margin: 6px 0; }
.gc-subabas { margin: 4px 0 14px; }
.gc-leg { display: flex; gap: 18px; font-size: 12px; color: var(--text-soft); margin-bottom: 8px; flex-wrap: wrap; }
.gc-leg b { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.gc-grafico { width: 100%; height: 140px; display: block; }
.gc-grafico .gc-hit { fill: transparent; }
.gc-grafico g:hover .gc-hit { fill: var(--surface-2); }
.gc-maps { fill: var(--chart-1, var(--verde)); background: var(--chart-1, var(--verde)); }
.gc-busca { fill: var(--chart-2, var(--info)); background: var(--chart-2, var(--info)); }
.gc-avaliacao { padding: 14px 16px; margin-bottom: 10px; }
.gc-av-topo { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.gc-av-texto { margin: 8px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.gc-estrelas { color: #e0a526; letter-spacing: 1px; }
.gc-estrelas i { font-style: normal; color: var(--surface-3); }
.gc-resposta { background: var(--surface-2); border-left: 3px solid var(--verde); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; white-space: pre-wrap; }
.gc-posts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.gc-post { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.gc-post img { width: 100%; height: 160px; object-fit: cover; display: block; }
.gc-post-txt { padding: 12px 14px; display: grid; gap: 6px; }
.gc-horario { display: grid; grid-template-columns: 90px 1fr; gap: 6px 10px; align-items: center; }
.gc-horario label { font-size: 13px; font-weight: 600; color: var(--text-soft); }
.gc-passos { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 16px; flex-wrap: wrap; counter-reset: gc; }
.gc-passos li { counter-increment: gc; font-size: 12px; font-weight: 700; color: var(--text-muted); padding: 5px 10px; border-radius: var(--radius-pill); background: var(--surface-2); }
.gc-passos li::before { content: counter(gc) ". "; }
.gc-passos li.ativo { background: var(--verde); color: var(--on-verde, #fff); }
.gc-passos li.feito { color: var(--verde-deep); }
.gc-campo-cont { position: relative; margin-bottom: 6px; }
.gc-campo-cont input { padding-right: 58px; }
.gc-cont { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.gc-cont.gc-estourou { color: var(--danger); font-weight: 800; }
.gc-previa { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 8px 0; background: var(--surface-2); }
.gc-previa-url { font-size: 12px; color: var(--text-soft); }
.gc-previa-titulo { color: var(--info); font-size: 17px; margin: 4px 0; overflow-wrap: anywhere; }
.gc-previa-desc { font-size: 13px; color: var(--text-soft); overflow-wrap: anywhere; }
.gc-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.gc-chips small { opacity: .75; font-weight: 600; }
.gc-x { border: 0; background: transparent; color: inherit; font-size: 15px; line-height: 1; cursor: pointer; padding: 0 0 0 4px; }
.gc-geo-lista { display: grid; gap: 6px; max-height: 240px; overflow: auto; }
.gc-geo-item { text-align: left; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text); padding: 8px 10px; cursor: pointer; font: inherit; }
.gc-geo-item:hover { border-color: var(--verde); }
.gc-revisao { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.gc-revisao > div { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; }
.gc-revisao b { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .gc-topo-acoes { width: 100%; }
  .gc-topo-acoes .btn { flex: 1 1 auto; }
  .gc-tabela thead { display: none; }
  .gc-tabela tr { display: grid; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .gc-tabela td { border: 0; padding: 0 4px; text-align: left !important; }
  .gc-horario { grid-template-columns: 76px 1fr; }
  .gc-post img { height: 140px; }
}

/* ───────── Meta completo (aba Meta da ficha, assistente de campanha, publicação) ───────── */
.meta-acoes { margin-bottom: 12px; }
.meta-ativos { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-bottom: 8px; }
.meta-ativo { display: grid; gap: 4px; align-content: start; padding: 14px 16px; margin: 0; }
.meta-ativo b { overflow-wrap: anywhere; }
.meta-ativo .btn { justify-self: start; margin-top: 4px; padding-left: 0; }
.meta-ativo-tipo { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.dialogo-chip.desligado { opacity: .45; cursor: not-allowed; }
.mw-passos { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.mw-passo { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.mw-passo.ativo { background: var(--verde-wash); border-color: var(--verde); color: var(--text); }
.mw-passo.feito { color: var(--ok); }
.mw-objetivos { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.mw-objetivo { position: relative; display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; background: var(--surface-2); }
.mw-objetivo input { position: absolute; opacity: 0; pointer-events: none; }
.mw-objetivo span { font-size: 12.5px; color: var(--text-muted); }
.mw-objetivo:hover { border-color: var(--border-hover); }
.mw-objetivo:has(input:checked) { border-color: var(--verde); background: var(--verde-wash); box-shadow: var(--anel); }
.mw-busca { position: relative; }
.mw-busca input { width: 100%; }
.mw-sugestoes { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); max-height: 240px; overflow: auto;
  background: var(--surface-solida); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, .25); }
.mw-sugestoes button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: none; color: var(--text); font: inherit; cursor: pointer; }
.mw-sugestoes button:hover, .mw-sugestoes button:focus { background: var(--verde-wash); }
.mw-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mw-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: 999px; background: var(--verde-wash); color: var(--text); font-size: 12.5px; }
.mw-chip input { width: 58px; padding: 2px 6px; min-height: 0; font-size: 12.5px; }
.mw-chip button { border: 0; background: none; color: inherit; font-size: 16px; line-height: 1; cursor: pointer; padding: 0 4px; }
.mw-check { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0; font-size: 14px; cursor: pointer; }
.mw-check input { margin-top: 3px; }
.mw-revisao { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 12px; }
.mw-revisao dt { color: var(--text-muted); font-size: 13px; }
.mw-revisao dd { margin: 0; overflow-wrap: anywhere; }
.mw-rodape { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.ag-add select { min-width: 0; max-width: 100%; }
@media (max-width: 640px) {
  .meta-ativos { grid-template-columns: 1fr; }
  .meta-acoes .btn { flex: 1 1 auto; }
  .mw-passo { flex: 1 1 auto; text-align: center; }
  .mw-revisao { grid-template-columns: 1fr; gap: 2px; }
  .mw-revisao dd { margin-bottom: 8px; }
  .mw-rodape .btn { flex: 1 1 auto; }
}
/* a ficha do cliente passou de 12 abas: a barra rola de lado em vez de
   esticar a página inteira (no celular, encolhia tudo junto) */
.ficha-abas { max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
@media (max-width: 900px) {
  .ficha-abas { display: flex; scrollbar-width: none; }
  .ficha-abas::-webkit-scrollbar { display: none; }
  .ficha-abas button { flex: 0 0 auto; white-space: nowrap; }
}
/* url e datetime-local ficaram fora da regra global de campo: nos formulários
   de publicação e campanha eles ganham a mesma cara dos outros campos */
.pub-form input[type=url], .pub-form input[type=datetime-local],
.mw-form input[type=url], .mw-form input[type=datetime-local] {
  width: 100%; background: var(--surface-2); border: 1px solid transparent; border-radius: var(--radius-pill);
  color: var(--text); font-family: var(--font); font-weight: 500; font-size: 14px; padding: 11px 16px;
  color-scheme: light dark;
}
@media (pointer: coarse) { .pub-form input[type=url], .pub-form input[type=datetime-local], .mw-form input[type=url], .mw-form input[type=datetime-local] { font-size: 16px; } }
.pub-form .campo label .nota, .mw-form .campo label .nota { text-transform: none; letter-spacing: 0; font-weight: 500; }
html[data-tema="claro"] .pub-form input[type=datetime-local], html[data-tema="claro"] .mw-form input[type=datetime-local] { color-scheme: light; }
html[data-tema="escuro"] .pub-form input[type=datetime-local], html[data-tema="escuro"] .mw-form input[type=datetime-local] { color-scheme: dark; }

/* ── agenda: vista Mês ──
   Semana começa na segunda, igual à vista Semana. No celular a célula
   vira número + bolinhas/contagem: chip com texto não cabe em 50px. */
.ag-mes { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; }
.ag-mes-cab { background: var(--surface-2); color: var(--text-muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; padding: 8px; text-align: center; }
.ag-mes-dia { position: relative; background: var(--surface); min-height: 112px; padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ag-mes-dia.fora { background: var(--surface-2); }
.ag-mes-dia.fora .ag-mes-num { color: var(--text-faint); }
.ag-mes-dia.passado .ag-mes-chips { opacity: .7; }
.ag-mes-num { align-self: flex-start; border: 0; background: transparent; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--text-soft);
  min-width: 26px; height: 26px; border-radius: var(--radius-pill); cursor: pointer; padding: 0 6px; font-variant-numeric: tabular-nums; }
.ag-mes-num:hover { background: var(--surface-3); color: var(--text); }
.ag-mes-dia.hoje { box-shadow: inset 0 0 0 2px var(--verde); }
.ag-mes-dia.hoje .ag-mes-num { background: var(--verde); color: var(--on-verde); }
.ag-mes-chips { display: grid; gap: 3px; min-width: 0; }
.ag-chip { display: flex; align-items: center; gap: 5px; width: 100%; min-width: 0; border: 0; font: inherit; font-size: 11.5px; cursor: pointer;
  text-align: left; padding: 3px 6px; border-radius: 6px; background: var(--surface-2); color: var(--text);
  border-left: 3px solid var(--cor, var(--verde)); }
.ag-chip:hover { background: var(--surface-3); }
.ag-chip-hora { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-soft); }
.ag-chip-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-chip-tarefa { background: transparent; border: 1px dashed var(--border); border-left: 3px solid var(--border-hover); }
.ag-chip.st-cancelada .ag-chip-txt, .ag-chip.feito .ag-chip-txt { text-decoration: line-through; }
.ag-chip.st-cancelada, .ag-chip.st-faltou, .ag-chip.feito { opacity: .6; }
.ag-mes-mais { align-self: flex-start; border: 0; background: transparent; font: inherit; font-size: 11.5px; font-weight: 700;
  color: var(--verde-deep); cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.ag-mes-mais:hover { background: var(--surface-3); }
.ag-mes-cel { display: none; }
@media (max-width: 760px) {
  .ag-mes-cab { padding: 6px 2px; font-size: 10.5px; letter-spacing: 0; }
  .ag-mes-dia { min-height: 58px; padding: 3px; align-items: center; }
  .ag-mes-num { align-self: center; font-size: 12px; min-width: 24px; height: 24px; padding: 0 4px; }
  .ag-mes-chips { display: none; }
  .ag-mes-cel { display: grid; justify-items: center; gap: 2px; border: 0; background: transparent; padding: 0; cursor: pointer; width: 100%; }
  .ag-mes-pontos { display: flex; gap: 2px; }
  .ag-mes-pontos i { width: 6px; height: 6px; border-radius: 50%; background: var(--cor, var(--verde)); }
  .ag-mes-qtd { font-size: 10px; font-weight: 700; color: var(--text-muted); }
}

/* ── rotina: Meu dia e Gestão da rotina (modulos/rotina.js) ── */
.rt-controles { align-items: center; }
.rt-periodo { flex: 1; min-width: 0; }
.rt-lista { list-style: none; margin: 0; padding: 4px 0; }
.rt-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); }
.rt-item:first-child { border-top: 0; }
.rt-item > .check { margin-top: 1px; }
.rt-item.feito .rt-titulo { text-decoration: line-through; color: var(--text-muted); }
.rt-item.atrasado { box-shadow: inset 3px 0 0 var(--warn); }
.rt-texto { flex: 1; min-width: 0; }
.rt-titulo { font-weight: 700; overflow-wrap: anywhere; }
.rt-cliente { font-weight: 600; color: var(--text-soft); }
.rt-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 2px; font-size: 12px; color: var(--text-muted); }
.rt-atraso { color: var(--warn); font-weight: 700; }
.rt-desc { margin-top: 4px; font-size: 12.5px; color: var(--text-soft); white-space: pre-line; overflow-wrap: anywhere; }
.rt-abrir { flex: none; padding: 4px 10px; font-size: 12px; }
.rt-lista-simples .rt-item { padding: 10px 0; }
.rt-sub { flex-wrap: wrap; }
.rt-tabela td { vertical-align: top; }
.rt-tabela tr.rt-inativo td { opacity: .55; }
.rt-acoes { white-space: nowrap; text-align: right; }
.rt-acoes .btn { padding: 4px 10px; font-size: 12.5px; }
.rt-dias { display: flex; flex-wrap: wrap; gap: 6px; }
.rt-dia { position: relative; cursor: pointer; }
.rt-dia input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.rt-dia span { display: inline-grid; place-items: center; min-width: 46px; height: 34px; padding: 0 10px; border-radius: var(--radius-pill);
  background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--text-soft); }
.rt-dia input:checked + span { background: var(--verde); border-color: var(--verde); color: var(--on-verde); }
.rt-dia input:focus-visible + span { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.rt-semana { min-width: 760px; }
.rt-semana th, .rt-semana td { text-align: center; }
.rt-semana th:first-child, .rt-semana td:first-child { text-align: left; }
.rt-semana th .sub { display: block; font-weight: 500; }
.rt-semana .hoje { background: var(--verde-wash); }
.rt-cel { border: 0; background: var(--surface-2); color: var(--text); font: inherit; font-size: 12.5px; cursor: pointer; border-radius: var(--radius);
  padding: 6px 8px; display: inline-grid; gap: 1px; min-width: 64px; }
.rt-cel:hover { background: var(--surface-3); }
@media (max-width: 760px) {
  .rt-item { padding: 12px; gap: 10px; }
  .rt-abrir { display: none; }
  .rt-periodo { flex-basis: 100%; order: 3; }
  .rt-acoes { white-space: normal; }
}

/* foto de perfil: bolinha do menu e cartão em Minha conta */
.rail-eu .avatar { overflow: hidden; text-decoration: none; }
.rail-eu .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rail-eu .avatar:hover { box-shadow: 0 0 0 2px var(--accent, #4caf50); }
.pc-foto { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.pc-foto-img { width: 88px; height: 88px; border-radius: 50%; overflow: hidden; flex: none; display: grid; place-items: center;
  background: var(--surface-2, rgba(127,127,127,.15)); font-weight: 800; font-size: 32px; color: var(--text, inherit); }
.pc-foto-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-foto-acoes { flex: 1; min-width: 180px; }
.pc-foto-acoes .nota { margin: 0 0 10px; }
.pc-foto-botoes { display: flex; gap: 8px; flex-wrap: wrap; }
.pc-foto-botoes label.btn { cursor: pointer; }
/* ═══ Construtor visual de fluxo ═══════════════════════════════ */
body.fx-aberto { overflow: hidden; }
/* dentro do CRM: ocupa a área de conteúdo, menu lateral continua à vista */
.conteudo.fx-dentro { max-width: none; padding-bottom: 0; }
.conteudo.fx-dentro > .topo, .conteudo.fx-dentro > #corpo { display: none; }
.fx-tela {
  --fx-linha: #c9c5bf;
  position: fixed; inset: 0; z-index: 45; background: var(--bg);
  display: flex; flex-direction: column; font-family: var(--font); color: var(--text);
}
.fx-tela svg {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.fx-tela .btn { display: inline-flex; align-items: center; gap: 6px; }

/* cores por categoria de bloco */
.fx-bot      { --fx-cor: var(--verde-deep); --fx-wash: var(--verde-wash); }
.fx-conversa { --fx-cor: var(--info);       --fx-wash: var(--info-bg); }
.fx-logica   { --fx-cor: var(--chart-4);    --fx-wash: #f0eafb; }
.fx-crm      { --fx-cor: var(--text-soft);  --fx-wash: var(--surface-3); }
.fx-fim      { --fx-cor: var(--danger);     --fx-wash: var(--danger-bg); }
.fx-inicio   { --fx-cor: var(--verde);      --fx-wash: var(--verde-wash); }
.fx-ico {
  width: 28px; height: 28px; flex: none; display: inline-grid; place-items: center;
  border-radius: 8px; background: var(--fx-wash, var(--surface-2)); color: var(--fx-cor, var(--text-soft));
}

/* topo */
.fx-topo {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.fx-titulo { flex: 1; min-width: 0; display: grid; gap: 1px; }
.fx-titulo input {
  font-family: var(--font-display); font-weight: 800; font-size: 16px;
  background: transparent; border-radius: var(--radius); padding: 5px 10px; max-width: 520px;
}
.fx-titulo input:hover { background: var(--surface-2); }
.fx-titulo input:focus { background: var(--surface-2); }
.fx-sub { font-size: 12px; color: var(--text-muted); padding-left: 10px; }
.fx-msg { font-size: 13px; font-weight: 600; max-width: 360px; }
.fx-msg-erro { color: var(--danger); background: var(--danger-bg); padding: 6px 12px; border-radius: var(--radius-pill); display: inline-block; }
.fx-chave { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--text-soft); cursor: pointer; user-select: none; }
.fx-chave input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fx-chave-trilho {
  width: 36px; height: 20px; border-radius: var(--radius-pill); background: var(--surface-3);
  position: relative; transition: background 140ms ease;
}
.fx-chave-trilho::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); box-shadow: var(--shadow-1); transition: transform 140ms ease;
}
.fx-chave input:checked + .fx-chave-trilho { background: var(--verde); }
.fx-chave input:checked + .fx-chave-trilho::after { transform: translateX(16px); }
.fx-chave input:focus-visible + .fx-chave-trilho { outline: 2px solid var(--verde); outline-offset: 2px; }

.fx-corpo { flex: 1; min-height: 0; display: grid; grid-template-columns: 248px 1fr 360px; }

/* paleta */
.fx-paleta { overflow: auto; padding: 8px 12px 20px; background: var(--surface); border-right: 1px solid var(--border); }
.fx-pal-grupo {
  font-family: var(--font-display); font-weight: 800; font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-muted); margin: 14px 6px 6px;
}
.fx-pal-item {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left;
  padding: 8px; border: 1px solid transparent; border-radius: 12px; background: transparent;
  cursor: grab; font: inherit; color: inherit;
}
.fx-pal-item:hover { background: var(--surface-2); border-color: var(--border); }
.fx-pal-item:active { cursor: grabbing; }
.fx-pal-txt { display: grid; gap: 2px; min-width: 0; }
.fx-pal-txt b { font-size: 13px; font-weight: 700; }
.fx-pal-txt small { font-size: 11.5px; color: var(--text-muted); line-height: 1.35; }
.fx-pal-nota { font-size: 11.5px; color: var(--text-muted); margin: 16px 6px 0; line-height: 1.4; }

/* palco: arrasta o fundo, grade de pontos */
.fx-palco {
  position: relative; overflow: hidden; cursor: grab; touch-action: none;
  background-color: var(--bg);
  background-image: radial-gradient(circle, rgba(16, 18, 17, 0.11) 1px, transparent 1.2px);
  background-size: 22px 22px;
}
.fx-palco.movendo { cursor: grabbing; }
.fx-mundo {
  position: absolute; left: 0; top: 0; transform-origin: 0 0;
  display: flex; flex-direction: column; align-items: center;
  width: max-content; padding: 0 40px 160px;
}
.fx-seq { display: flex; flex-direction: column; align-items: center; }

/* linhas entre blocos, com + e área de soltar */
.fx-liga { position: relative; width: 220px; height: 44px; flex: none; }
.fx-liga::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px;
  background: var(--fx-linha);
}
.fx-liga.morta { height: 18px; }
.fx-liga.morta::before { display: none; }
.fx-ramo .fx-liga.fim::before { background: repeating-linear-gradient(var(--fx-linha) 0 5px, transparent 5px 9px); }
.fx-mais {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 24px; height: 24px; padding: 0; display: grid; place-items: center;
  border-radius: 50%; border: 1.5px solid var(--fx-linha); background: var(--surface); color: var(--text-soft);
  cursor: pointer; opacity: 0; transition: opacity 120ms ease, background 120ms ease;
}
.fx-mais svg { width: 13px; height: 13px; stroke-width: 2.5; }
.fx-liga:hover .fx-mais, .fx-liga.fim .fx-mais, .fx-mais:focus-visible { opacity: 1; }
.fx-mais:hover { background: var(--verde); border-color: var(--verde); color: #fff; }
.arrastando .fx-liga[data-ok] .fx-mais { opacity: 1; border-style: dashed; border-color: var(--verde); }
.fx-liga.alvo::before { background: var(--verde); width: 3px; margin-left: -1.5px; }
.fx-liga.alvo .fx-mais { opacity: 0; }
.fx-liga.alvo::after {
  content: 'Soltar aqui'; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: var(--verde); color: #fff; font-size: 11px; font-weight: 700; white-space: nowrap;
  padding: 4px 12px; border-radius: var(--radius-pill); box-shadow: var(--shadow-2); pointer-events: none;
}

/* blocos */
.fx-no {
  position: relative; width: 264px; display: grid; gap: 8px; padding: 10px 12px 12px;
  background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--fx-cor, var(--border-hover));
  border-radius: 14px; box-shadow: var(--shadow-1); cursor: pointer; text-align: left;
  transition: box-shadow 120ms ease, opacity 120ms ease;
}
.fx-no:hover { box-shadow: var(--shadow-2); }
.fx-no:focus-visible { outline: 2px solid var(--verde); outline-offset: 2px; }
.fx-no.sel { box-shadow: 0 0 0 2px var(--fx-cor), var(--shadow-2); }
.fx-no.erro { border-color: var(--danger); border-top-color: var(--danger); }
.fx-no.morto { opacity: 0.5; }
.fx-no.alvo { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--verde), var(--shadow-2); }
.fx-no.alvo::after {
  content: 'destino do "voltar"'; position: absolute; top: -11px; right: 10px;
  background: var(--verde); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-pill);
}
.sumindo { opacity: 0.35; }
.fx-no-topo { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fx-no-tipo {
  font-family: var(--font-display); font-weight: 800; font-size: 11px; letter-spacing: 0.04em;
  text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fx-no-num { margin-left: auto; font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.fx-no-txt { font-size: 13px; color: var(--text-soft); line-height: 1.4; overflow-wrap: anywhere; display: grid; gap: 6px; }
.fx-no-meta { font-size: 11.5px; color: var(--text-muted); }
.fx-no-erro { font-size: 11.5px; font-weight: 600; color: var(--danger); }
.fx-balao {
  background: var(--surface-2); color: var(--text); border-radius: 12px 12px 12px 4px; padding: 8px 10px;
  white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
}
.fx-balao i { color: var(--text-muted); }
.fx-no-ops { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; counter-reset: op; }
.fx-no-ops li {
  counter-increment: op; font-size: 12.5px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-hover); border-radius: 8px; padding: 4px 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fx-no-ops li::before { content: counter(op) '. '; font-weight: 800; color: var(--fx-cor); }

/* gatilho em verde escuro (bloco de destaque) */
.fx-no.fx-inicio { background: var(--sidebar); color: var(--text-on-dark); border-color: transparent; border-top-color: var(--verde); }
.fx-no.fx-inicio .fx-ico { background: rgba(255, 255, 255, 0.12); color: var(--verde-soft); }
.fx-no.fx-inicio .fx-no-txt { color: #fff; }
.fx-no.fx-inicio .fx-no-meta { color: rgba(242, 246, 241, 0.7); }
.fx-no.fx-inicio.sel { box-shadow: 0 0 0 2px var(--verde), var(--shadow-2); }

/* caminhos: barra tipo organograma saindo do bloco */
.fx-bloco { display: flex; flex-direction: column; align-items: center; }
.fx-ramos { position: relative; display: flex; align-items: flex-start; padding-top: 18px; }
.fx-ramos::before {
  content: ''; position: absolute; top: 0; left: 50%; width: 2px; height: 18px; margin-left: -1px; background: var(--fx-linha);
}
.fx-ramo { position: relative; display: flex; flex-direction: column; align-items: center; padding: 18px 14px 0; }
.fx-ramo::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--fx-linha); }
.fx-ramo:first-child::before { left: 50%; }
.fx-ramo:last-child::before { right: 50%; }
.fx-ramo::after { content: ''; position: absolute; top: 0; left: 50%; width: 2px; height: 18px; margin-left: -1px; background: var(--fx-linha); }
.fx-ramo-rot {
  position: relative; z-index: 1; max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 11.5px; font-weight: 700; color: var(--verde-deep);
  background: var(--surface); border: 1px solid var(--border-hover); border-radius: var(--radius-pill); padding: 3px 10px;
}
.fx-ramo-rot.nao { color: var(--warn); }
.fx-fim-fluxo {
  font-family: var(--font-display); font-weight: 800; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-muted); background: var(--surface-3); padding: 5px 14px; border-radius: var(--radius-pill);
}

/* menu do + */
.fx-menu {
  position: absolute; z-index: 5; width: 240px; max-height: 380px; overflow: auto; padding: 6px;
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-3); cursor: default;
}
.fx-menu-grupo {
  font-family: var(--font-display); font-weight: 800; font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-muted); margin: 10px 8px 4px;
}
.fx-menu-grupo:first-child { margin-top: 4px; }
.fx-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 0; border-radius: 10px;
  background: transparent; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--text); text-align: left; cursor: pointer;
}
.fx-menu-item .fx-ico { width: 24px; height: 24px; border-radius: 7px; }
.fx-menu-item:hover, .fx-menu-item:focus-visible { background: var(--surface-2); outline: none; }

/* zoom e ajuda */
.fx-zoom {
  position: absolute; left: 16px; bottom: 16px; display: flex; align-items: center; gap: 2px; padding: 4px;
  background: var(--surface); border-radius: var(--radius-pill); box-shadow: var(--shadow-2); cursor: default;
}
.fx-zoom button {
  height: 30px; min-width: 30px; padding: 0 6px; border: 0; border-radius: var(--radius-pill); background: transparent;
  color: var(--text-soft); display: grid; place-items: center; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700;
}
.fx-zoom button:hover { background: var(--surface-2); color: var(--text); }
.fx-zoom-txt { min-width: 48px !important; font-variant-numeric: tabular-nums; }
.fx-ajuda { position: absolute; right: 16px; bottom: 22px; font-size: 11.5px; color: var(--text-muted); pointer-events: none; }

/* painel do bloco */
.fx-painel { overflow: auto; padding: 16px 18px 28px; background: var(--surface); border-left: 1px solid var(--border); }
.fx-painel-topo { display: flex; align-items: center; gap: 10px; }
.fx-painel-topo .fx-ico { width: 36px; height: 36px; border-radius: 10px; }
.fx-painel-topo .fx-ico svg { width: 18px; height: 18px; }
.fx-painel-topo h3 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 16px; }
.fx-painel-topo .label { margin: 0; }
.fx-painel-topo .btn-icone { margin-left: auto; width: 34px; height: 34px; }
.fx-dica { font-size: 12.5px; color: var(--text-soft); margin: 10px 0 0; line-height: 1.45; }
.fx-painel-erro .aviso { margin: 12px 0 0; }
.fx-form { display: grid; gap: 6px; margin-top: 6px; }
.fx-form .nota { margin-top: 2px; line-height: 1.45; }
.fx-rot {
  display: flex; align-items: center; gap: 6px; margin-top: 12px;
  font-weight: 700; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted);
}
.fx-conta { margin-left: auto; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.fx-linha { display: flex; gap: 8px; align-items: center; }
.fx-linha > input[type=number] { width: 110px; flex: none; }
.fx-dmais { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--text-soft); flex: none; }
.fx-dmais input { width: 90px; }
.fx-add { justify-self: start; margin-top: 2px; color: var(--verde-deep); }
.fx-opcoes, .fx-conds { display: grid; gap: 8px; }
.fx-opcao { display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; align-items: start; padding: 8px; background: var(--surface-2); border-radius: 14px; }
.fx-opcao-n {
  width: 24px; height: 24px; margin-top: 6px; border-radius: 50%; display: grid; place-items: center;
  background: var(--verde-wash); color: var(--verde-deep); font-family: var(--font-display); font-weight: 800; font-size: 12px;
}
.fx-opcao-campos { display: grid; gap: 6px; min-width: 0; }
.fx-opcao input, .fx-cond input, .fx-cond select { background: var(--surface); font-size: 14px; padding: 8px 12px; }
.fx-opcao-acoes { display: grid; }
.fx-opcao-acoes .btn-icone, .fx-cond .btn-icone { width: 28px; height: 28px; }
.fx-opcao-acoes .btn-icone:disabled { opacity: 0.3; cursor: default; }
.fx-cond { display: grid; gap: 6px; padding: 8px; background: var(--surface-2); border-radius: 14px; }
.fx-cond-linha { display: flex; gap: 6px; align-items: center; }
.fx-cond-linha > select { flex: 0 0 38%; }
.fx-previa { background: #efe7de; border-radius: 14px; padding: 14px; display: flex; }
.fx-wa {
  position: relative; margin-left: auto; max-width: 92%; padding: 8px 10px 18px; border-radius: 10px 10px 2px 10px;
  background: #d9fdd3; color: #111b21; font-size: 13.5px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}
.fx-wa mark { background: transparent; color: var(--verde-deep); font-weight: 700; }
.fx-wa-hora { position: absolute; right: 8px; bottom: 3px; font-size: 10.5px; color: #667781; }
.fx-painel-acoes {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border);
}
.fx-painel-acoes .btn-icone { width: 34px; height: 34px; }
.fx-painel-acoes .btn-icone:disabled { opacity: 0.3; cursor: default; }
.fx-perigo { color: var(--danger); margin-left: auto; }
.fx-painel-vazio { text-align: center; padding: 36px 10px; color: var(--text-soft); font-size: 13.5px; line-height: 1.5; }
.fx-painel-vazio .fx-ico { width: 48px; height: 48px; border-radius: 14px; margin-bottom: 8px; --fx-cor: var(--verde-deep); --fx-wash: var(--verde-wash); }
.fx-painel-vazio .fx-ico svg { width: 22px; height: 22px; }
.fx-painel-vazio h3 { font-family: var(--font-display); font-weight: 800; font-size: 16px; margin: 0 0 8px; color: var(--text); }

.fx-tela.fx-embutido {
  position: relative; inset: auto; z-index: auto;
  height: calc(100dvh - var(--gap) * 2 - 12px);
  border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-1);
  overflow: hidden;
}
/* com o menu lateral ao lado sobra menos largura: paleta e painel encolhem */
@media (min-width: 901px) and (max-width: 1600px) {
  .fx-embutido .fx-corpo { grid-template-columns: 200px 1fr 320px; }
  .fx-embutido .fx-pal-txt small, .fx-embutido .fx-ajuda { display: none; }
}

@media (max-width: 1180px) {
  .fx-corpo { grid-template-columns: 212px 1fr 320px; }
  .fx-pal-txt small { display: none; }
  .fx-ajuda { display: none; }
}
@media (max-width: 900px) {
  .fx-topo { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .fx-voltar span { display: none; }
  .fx-titulo { order: 0; flex-basis: calc(100% - 60px); }
  .fx-msg { order: 5; flex-basis: 100%; }
  .fx-corpo { grid-template-columns: 1fr; }
  .fx-paleta { display: none; }
  .fx-painel {
    position: fixed; left: 0; right: 0; bottom: 0; max-height: 64vh; z-index: 6;
    border-left: 0; border-radius: 18px 18px 0 0; box-shadow: var(--shadow-3);
    transform: translateY(100%); transition: transform 180ms ease;
  }
  .fx-tela.com-sel .fx-painel { transform: none; }
  .fx-zoom { bottom: 12px; left: 12px; }
}
/* no celular o menu vira barra no rodapé: o editor volta pra tela cheia */
@media (max-width: 860px) {
  .fx-tela.fx-embutido { position: fixed; inset: 0; z-index: 45; height: auto; border: 0; border-radius: 0; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  .fx-painel, .fx-mais, .fx-no, .fx-chave-trilho, .fx-chave-trilho::after { transition: none; }
}

/* ═══ Ficha: dados e campos personalizados ══════════════════════ */

.obs-ficha { white-space: pre-wrap; font-size: 13.5px; line-height: 1.55; color: var(--text-soft); margin-top: 6px; }

.campos-secao {
  font-family: var(--font-display); font-weight: 800; font-size: 10.5px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted);
  margin: 18px 0 8px;
}
.campos-secao:first-child { margin-top: 0; }

.lapis {
  border: 0; background: none; cursor: pointer; padding: 0 4px; margin-left: 2px;
  font-size: 12px; color: var(--text-faint); border-radius: 6px; line-height: 1;
}
.lapis:hover { color: var(--verde-deep); background: var(--verde-wash); }

.chip-campo {
  display: inline-flex; align-items: center; padding: 2px 9px; margin: 0 4px 4px 0;
  border-radius: var(--radius-pill); background: var(--verde-wash); color: var(--verde-deep);
  font-size: 12px; font-weight: 700;
}

.campo-multi { display: flex; flex-wrap: wrap; gap: 6px; }
.multi-opcao {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 5px 12px; border-radius: var(--radius-pill);
  background: var(--surface-3, #f3f1ee); font-size: 12.5px; font-weight: 600; color: var(--text-soft);
  transition: background .15s, color .15s;
}
.multi-opcao input { accent-color: var(--verde); margin: 0; }
.multi-opcao:has(input:checked) { background: var(--verde-wash); color: var(--verde-deep); }

/* ═══ Celular: acertos gerais ═══════════════════════════════════ */

@media (max-width: 860px) {
  /* topo: título com ajuda/busca/sino do lado; botões da tela descem
     pra uma linha própria em vez de quebrar um embaixo do outro */
  .topo { flex-wrap: wrap; align-items: flex-start; gap: 0 8px; }
  .topo > div:first-child { flex: 1 1 0; min-width: 0; }
  .topo-acoes { display: contents; }
  .topo-acoes > .btn-icone { order: 1; flex: none; }
  .topo::after { content: ''; order: 2; flex-basis: 100%; height: 0; }
  .topo-acoes > :not(.btn-icone) { order: 3; flex: 1 1 auto; margin-top: 12px; }
  .topo-acoes > .btn { justify-content: center; text-align: center; }
  .topo p { font-size: 13px; }
  .topo .page-title { font-size: 21px; line-height: 1.15; overflow-wrap: anywhere; }
}

@media (max-width: 720px) {
  /* abas rolam de lado: quebrar "Campanhas A/B" em duas linhas deixava
     cada aba de um tamanho */
  .abas {
    width: 100%; max-width: 100%; justify-content: flex-start;
    overflow-x: auto; scrollbar-width: none;
  }
  .abas::-webkit-scrollbar { display: none; }
  .abas button { flex: 1 0 auto; white-space: nowrap; }
  .abas.abas-inbox { width: auto; }
}

@media (max-width: 520px) {
  .filtros input[type=search] { flex: 1 1 100%; max-width: none; }
}

/* conversas no celular: uma tela de cada vez */
.conversa-voltar { display: none; }
@media (max-width: 720px) {
  .inbox:not(.com-conversa) .inbox-conversa { display: none; }
  .inbox.com-conversa .inbox-lista { display: none; }
  .inbox-conversa { min-height: calc(100dvh - 190px); }
  .conversa-voltar { display: inline-flex; flex: none; }
  .conversa-cabeca { flex-wrap: wrap; gap: 8px; }
  .conversa-cabeca > div:not(.conversa-acoes) { flex: 1 1 0; min-width: 0; }
  .conversa-acoes { flex: 1 1 100%; flex-wrap: wrap; gap: 6px; }
  .conversa-acoes .btn { padding: 8px 13px; font-size: 13px; }
  .redigir { flex-wrap: wrap; }
  .redigir textarea { flex: 1 1 100%; order: -1; }
}

/* tabela larga dentro de card rola sozinha em vez de alargar a página */
.card:has(> .tabela) { overflow-x: auto; }
@media (max-width: 720px) {
  .card > .tabela th, .card > .tabela td { white-space: nowrap; }
  /* gráfico de colunas: 12 meses × 3 barras não cabem com 13px cada */
  .g-bars { gap: 2px; }
  .g-mo { flex: 1 1 0; min-width: 0; justify-content: center; gap: 1px; }
  .g-mo i { width: auto; flex: 0 1 7px; }
  .g-mo em { font-size: 9px; left: -4px; right: -4px; }
  .g-bars:has(> .g-mo:nth-child(7)) > .g-mo:nth-child(even) em { visibility: hidden; }
}

/* sino: limpar tudo e tirar um aviso */
.sino-acoes { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.sino-acoes .btn { padding: 6px 10px; font-size: 12.5px; min-height: 0; }
.sino-linha { position: relative; }
.sino-linha .sino-item { width: 100%; padding-right: 38px; }
.sino-tirar {
  position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 17px; line-height: 1; color: var(--text-muted);
  background: transparent; border: 0; cursor: pointer; opacity: .55; transition: opacity .15s, background .15s;
}
.sino-linha:hover .sino-tirar, .sino-tirar:focus-visible { opacity: 1; }
.sino-tirar:hover { background: var(--surface-3); color: var(--text); }
@media (pointer: coarse) { .sino-tirar { opacity: 1; } }

/* ═══ Fila da inbox: ✓ aceitar · ✕ recusar · ! em espera ═══════════
   A linha desliza pro lado e as três ações entram uma atrás da outra.
   Computador: passar o mouse. Celular: arrastar pro lado ou tocar em "Novo". */
.conversa { position: relative; overflow: hidden; }
.conversa-corpo {
  flex: 1; min-width: 0; display: flex; gap: 11px; align-items: center;
  transition: transform .38s cubic-bezier(.22, .9, .25, 1), opacity .25s;
}
.fila-gatilho {
  font-size: 10.5px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; color: var(--verde-deep); background: var(--verde-wash);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--verde) 35%, transparent);
  animation: fila-pulso 2.4s ease-in-out infinite;
}
@keyframes fila-pulso { 50% { box-shadow: inset 0 0 0 1px var(--verde), 0 0 0 4px color-mix(in srgb, var(--verde) 14%, transparent); } }
.fila-acoes {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  display: flex; gap: 7px; pointer-events: none;
}
.fila-btn {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  opacity: 0; transform: translateX(46px) scale(.55);
  transition: transform .42s cubic-bezier(.3, 1.45, .45, 1), opacity .22s, box-shadow .15s, filter .15s;
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .35);
}
.fila-btn svg { width: 17px; height: 17px; }
.fila-ok { background: var(--verde); color: #fff; }
.fila-nao { background: var(--danger); color: #fff; }
.fila-espera { background: var(--warn); color: #1b1300; }
/* crescer no hover só com mouse: no toque o :hover gruda e o botão ficava grande */
@media (hover: hover) {
  .fila-btn:hover { filter: brightness(1.08); transform: scale(1.1) !important;
    box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 0%, var(--surface-2)), 0 6px 16px -4px rgba(0, 0, 0, .4); }
}
.fila-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--verde); }

/* abrir: empurra a linha e solta os botões em cascata */
@media (hover: hover) {
  .conversa.tem-fila:hover .conversa-corpo { transform: translateX(-132px); opacity: .55; }
  .conversa.tem-fila:hover .fila-acoes { pointer-events: auto; }
  .conversa.tem-fila:hover .fila-btn { opacity: 1; transform: none; }
}
.conversa.tem-fila.fila-aberta .conversa-corpo,
.conversa.tem-fila:focus-within .conversa-corpo { transform: translateX(-132px); opacity: .55; }
.conversa.tem-fila.fila-aberta .fila-acoes,
.conversa.tem-fila:focus-within .fila-acoes { pointer-events: auto; }
.conversa.tem-fila.fila-aberta .fila-btn,
.conversa.tem-fila:focus-within .fila-btn { opacity: 1; transform: none; }
.fila-btn:nth-child(2) { transition-delay: .04s; }
.fila-btn:nth-child(3) { transition-delay: .08s; }

/* saindo da fila: a linha desliza pra fora */
.conversa.fila-saindo { transition: opacity .35s, transform .35s; opacity: 0; transform: translateX(-40px); pointer-events: none; }
.conversa.fila-saindo-ok { transform: translateX(40px); }
@media (prefers-reduced-motion: reduce) {
  .conversa-corpo, .fila-btn, .conversa.fila-saindo { transition: none; }
  .fila-gatilho { animation: none; }
}

/* ═══ Logos dos clientes: todas do mesmo tamanho ═══════════════════
   A imagem preenche o círculo (cover) em vez de caber inteira com
   margem: logo larga, quadrada ou com borda branca ficam iguais. */
.logo-mini, .logo-caixa {
  overflow: hidden; background: var(--surface-2);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 10%, transparent);
}
.logo-mini { aspect-ratio: 1; border-radius: 50%; }
.logo-mini img, .logo-caixa img {
  width: 100%; height: 100%; padding: 0; object-fit: cover; object-position: center; display: block;
  border-radius: inherit;
}

/* Conteúdo: atalho pras integrações no lugar da tabela de contas */
.ct-contas-atalho { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.ct-contas-botoes { display: flex; gap: 8px; }

/* Início → Fila de leads: lista compacta (no celular a tabela espremia o nome) */
.fila-w { padding: 6px; display: grid; gap: 2px; }
.fila-w-item { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 4px; border-radius: 14px; }
.fila-w-item:hover { background: var(--surface-2); }
.fila-w-info {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-align: left;
  border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer;
}
.fila-w-ini {
  width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 14px; text-transform: uppercase;
  background: var(--verde-wash); color: var(--verde-deep);
}
.fila-w-txt { min-width: 0; display: grid; gap: 1px; }
.fila-w-txt b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fila-w-txt span { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fila-w-tempo { flex: none; font-size: 11px; font-weight: 700; color: var(--warn); white-space: nowrap; }
.fila-w-ok {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px 0 10px;
  border: 0; border-radius: 999px; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 800;
  background: var(--verde); color: #fff; transition: transform .15s, box-shadow .15s;
}
.fila-w-ok svg { width: 16px; height: 16px; }
.fila-w-ok:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -6px var(--verde); }
@media (max-width: 560px) {
  .fila-w-ok { width: 34px; padding: 0; justify-content: center; }
  .fila-w-ok span { display: none; }
}
/* o arrasto horizontal na linha da fila é nosso; o vertical continua rolando a lista */
.conversa.tem-fila { touch-action: pan-y; }
.conversa-topo b { min-width: 0; }
.conversa-texto { overflow: hidden; }
.conversa-texto > * { min-width: 0; }

/* Ligar: WhatsApp ou ligação comum */
.btn-ligar { display: inline-flex; align-items: center; gap: 6px; }
.btn-ligar-mini {
  display: inline-grid; place-items: center; width: 26px; height: 26px; margin-left: 6px; vertical-align: middle;
  border-radius: 50%; border: 0; cursor: pointer; background: var(--verde-wash); color: var(--verde-deep);
}
.btn-ligar-mini svg { width: 14px; height: 14px; }
.ligar-pop { position: absolute; z-index: 60; padding: 6px; display: grid; gap: 2px; }
.ligar-op { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 14px; color: var(--text); text-decoration: none; }
.ligar-op:hover { background: var(--surface-2); }
.ligar-op > span:last-child { display: grid; gap: 2px; min-width: 0; }
.ligar-op b { font-size: 13.5px; }
.ligar-op i { font-style: normal; font-size: 12px; color: var(--text-muted); }
.ligar-ico { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text); }
.ligar-wa { background: #25d366; color: #fff; }
.ligar-nota { margin: 4px 10px 6px; font-size: 11.5px; }
@media (max-width: 860px) { .btn-ligar span { display: none; } }

/* celular: listas em grade e selects nunca passam da largura da tela */
.form-lista { grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
/* :where() = especificidade baixa: não derruba o max-width próprio de cada tela (ex.: .filtros-lista 240px) */
:where(.filtros) > select, :where(.filtros) > input, :where(.filtros) select { max-width: 100%; min-width: 0; }
@media (max-width: 560px) { .filtros > select, .filtros > input { flex: 1 1 100%; } }

/* ═══ Fila: os três botões fora da linha do Inbox ═══════════════════
   Faixa da conversa aberta e "Fila de leads" do Início: sempre visíveis
   (a linha do Inbox esconde até passar o mouse/arrastar). */
button.fila-btn { border: 0; padding: 0; font: inherit; flex: none; }
.fila-vis .fila-btn { opacity: 1; transform: none; transition: transform .15s, box-shadow .15s, filter .15s, opacity .2s; }
.fila-btn:active { transform: scale(.88) !important; }
.fila-btn:disabled { cursor: default; opacity: .55; }
/* esperando o servidor: anel pulsando, sem trocar ícone nem tamanho */
.fila-btn.fila-apertado, .fila-btn.fila-apertado:disabled { opacity: 1; transform: none !important; filter: none; animation: fila-apertado .9s ease-in-out infinite; }
@keyframes fila-apertado { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, currentColor 0%, var(--verde-wash)); } }
.faixa-fila-acoes { display: flex; gap: 8px; flex: none; }

/* Início → Fila de leads: três ações, a linha sai deslizando */
.fila-w-acoes { display: flex; gap: 6px; flex: none; }
.fila-w-item {
  max-height: 72px;
  transition: opacity .3s, transform .35s cubic-bezier(.22, .9, .25, 1), max-height .3s .18s, padding .3s .18s, margin .3s .18s;
}
.fila-w-item.fila-saindo { opacity: 0; transform: translateX(-36px); max-height: 0; padding-top: 0; padding-bottom: 0; pointer-events: none; }
.fila-w-item.fila-saindo.fila-saindo-ok { transform: translateX(36px); }
.fila-w-tempo-m { display: none; }
@media (max-width: 420px) {
  .fila-w-item { gap: 8px; }
  .fila-w-ini { width: 32px; height: 32px; font-size: 13px; }
  .fila-w-tempo { display: none; }
  .fila-w-txt .fila-w-tempo-m { display: inline; color: var(--warn); font-weight: 700; }
  .fila-w-acoes { gap: 5px; }
  .fila-w-acoes .fila-btn { width: 31px; height: 31px; }
  .fila-w-acoes .fila-btn svg { width: 15px; height: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .fila-w-item, .fila-vis .fila-btn { transition: none; }
  .fila-btn.fila-apertado { animation: none; }
}

/* ═══ Conversa aberta no celular: cabe na tela visível ═════════════
   Fixa na área visível (altura do visualViewport, que já desconta o
   teclado do iPhone); só a lista de mensagens rola. A barra de atalhos
   some enquanto a conversa está aberta — o "voltar" fica no cabeçalho. */
@media (max-width: 720px) {
  body.chat-aberto { overflow: hidden; }
  body.chat-aberto .barra-abas { display: none; }
  /* o que fica atrás da conversa não pode deixar a página rolar */
  body.chat-aberto .app { height: 100vh; height: var(--chat-altura, 100dvh); overflow: hidden; }
  body.chat-aberto .inbox.com-conversa .inbox-conversa {
    position: fixed; left: 0; right: 0; top: var(--chat-topo, 0px); z-index: 44;
    height: 100vh; height: 100dvh; height: var(--chat-altura, 100dvh);
    min-height: 0; margin: 0; border-radius: 0; overflow: hidden;
    padding-top: env(safe-area-inset-top);
  }
  body.chat-aberto .inbox-conversa > * { flex: none; }
  body.chat-aberto .inbox-conversa > .thread { flex: 1 1 auto; min-height: 0; padding: 12px 10px; overscroll-behavior: contain; }
  body.chat-aberto .conversa-cabeca { padding: 8px 10px; gap: 6px; }
  /* ações do cabeçalho numa linha que rola de lado, em vez de duas linhas */
  body.chat-aberto .conversa-acoes { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  body.chat-aberto .conversa-acoes::-webkit-scrollbar { display: none; }
  body.chat-aberto .conversa-acoes > * { flex: none; }
  body.chat-aberto .faixa-dono { margin: 6px 8px 0; padding: 8px 10px; gap: 8px; }
  body.chat-aberto .msg { max-width: 86%; }
  /* campo numa linha só: anexo · texto · IA · áudio · enviar */
  .redigir { flex-wrap: nowrap; gap: 6px; padding: 8px 8px 4px; align-items: flex-end; }
  .redigir textarea {
    flex: 1 1 auto; order: 0; min-width: 0; width: auto;
    font-size: 16px; /* abaixo de 16px o iPhone dá zoom ao focar */
    min-height: 40px; padding: 8px 14px; line-height: 22px;
  }
  .redigir textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .redigir .btn { flex: none; padding: 9px 12px; font-size: 13px; }
  .redigir .btn-icone { flex: none; width: 36px; height: 40px; }
  .nota-interna { padding: 2px 14px calc(6px + env(safe-area-inset-bottom)); }
}
@media (max-width: 360px) {
  .redigir { gap: 4px; padding-inline: 6px; }
  .redigir .btn { padding: 9px 9px; }
  .redigir .btn-icone { width: 32px; }
}

/* cabeçalho da conversa no computador: as ações quebram linha em vez de
   empurrar "Resolver" pra fora do painel; dica do campo numa linha só */
.conversa-cabeca > div:not(.conversa-acoes) { min-width: 0; }
@media (min-width: 721px) {
  .conversa-cabeca > div:not(.conversa-acoes) { flex: 1 1 150px; }
  .conversa-acoes { flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
}
.redigir textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1600px) { .btn-ligar span { display: none; } }

/* ── rotina/gestão (agente rotina): explicação dos dois churns na Visão do negócio ── */
.churn-explica { margin-top: 12px; padding: 12px 16px; font-size: 13px; color: var(--text-soft); }
.churn-explica summary { cursor: pointer; font-weight: 600; color: var(--text); min-height: 24px; }
.churn-explica p { margin: 8px 0 0; line-height: 1.5; }

/* ── ficha do cliente (agente ficha): responsável no topo, atalho pra ficha,
   pergunta "salvar antes de fechar?" e papel do time do cliente ── */
.ficha-resp { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: 13.5px; color: var(--text-soft); }
.ficha-resp .fr-item { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.ficha-resp .fr-item b { color: var(--text); font-weight: 700; }
.ficha-resp .fr-rot { color: var(--text-muted); }
.ficha-resp .fr-time {
  border: 0; background: transparent; font: inherit; color: inherit; cursor: pointer;
  padding: 2px 8px 2px 2px; margin: -2px 0; border-radius: 999px; min-height: 36px;
}
.ficha-resp .fr-time:hover { background: var(--surface-2); }
.ficha-resp .fr-time:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.fr-rostos { display: inline-flex; }
.fr-rosto {
  width: 28px; height: 28px; border-radius: 50%; flex: none; overflow: hidden;
  display: inline-grid; place-items: center;
  background: var(--verde-wash); color: var(--verde-deep);
  font-family: var(--font-display); font-weight: 800; font-size: 12px;
  box-shadow: 0 0 0 2px var(--surface);
}
.fr-rosto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fr-rostos .fr-rosto + .fr-rosto { margin-left: -8px; }
.fr-mais { background: var(--surface-3); color: var(--text-soft); font-size: 11px; }
@media (max-width: 720px) {
  .ficha-resp { font-size: 13px; gap: 4px 12px; }
}

/* atalho "abrir ficha completa" na lista de clientes */
.fd-td { width: 52px; text-align: right; padding-left: 0 !important; }
.fd-td .sr-only, .sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.fd-btn { width: 40px; height: 40px; color: var(--text-muted); text-decoration: none; }
.fd-btn:hover, .fd-btn:focus-visible { color: var(--verde); background: var(--verde-wash); }
.cat-grupo-lista .fd-btn { margin: -6px -8px -6px 0; }
.cat-grupo-lista li > .num + .fd-btn { margin-left: 0; }
.cat-grupo-lista li > .fd-btn:not(.num + .fd-btn) { margin-left: auto; }

/* "Você alterou dados. Salvar antes de fechar?" (modulos/modal-sujo.js) */
.modal-fundo-pergunta { z-index: 60; }
.ms-rodape .ms-flex { flex: 1; }
@media (max-width: 520px) {
  .ms-rodape { flex-direction: column-reverse; align-items: stretch; gap: 8px; }
  .ms-rodape .ms-flex { display: none; }
  .ms-rodape .btn { width: 100%; min-height: 44px; }
}

/* papel no time do cliente: o campo "Outro…" logo abaixo do select */
.tc-form #tc-outro { margin-top: 8px; }
.tc-form .tc-dica { margin: 6px 0 0; }
/* no celular a tabela de clientes rola de lado: o atalho vai pra célula do nome, sempre à vista */
.fd-btn.fd-cel { display: none; }
@media (max-width: 720px) {
  .tabela .fd-td { display: none; }
  .fd-btn.fd-cel { display: inline-grid; float: right; margin: -4px -6px 0 8px; }
}
/* "Fechar" do topo das janelas nunca quebra letra por letra em tela estreita */
.modal-topo > [data-fechar] { white-space: nowrap; flex: none; }

/* ═══ mobile: editor de fluxo (Automações) no celular ═════════════
   Tela cheia por cima de tudo (a barra de atalhos some, ver tema.css),
   topo em duas linhas com "Voltar" sempre à vista, paleta e painel do
   bloco viram gavetas que sobem do rodapé. */
.fx-tela .fx-pal-abrir, .fx-pal-cabeca { display: none; }
@media (max-width: 900px) {
  .fx-topo {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center;
    gap: 6px 8px; padding: calc(env(safe-area-inset-top, 0px) + 8px) 10px 8px;
  }
  .fx-voltar { grid-column: 1; grid-row: 1; padding-left: 8px; padding-right: 12px; min-height: 40px; }
  .fx-voltar span { display: inline; }
  #fx-apagar { grid-column: 3; grid-row: 1; min-height: 40px; }
  #fx-salvar { grid-column: 4; grid-row: 1; min-height: 40px; }
  .fx-titulo { grid-column: 1 / 4; grid-row: 2; flex-basis: auto; }
  .fx-titulo input { max-width: none; width: 100%; padding-left: 6px; }
  .fx-sub { padding-left: 6px; }
  .fx-chave { grid-column: 4; grid-row: 2; justify-self: end; }
  .fx-msg { grid-column: 1 / -1; grid-row: 3; max-width: none; }
  .fx-msg:empty { display: none; }

  /* + nas linhas: sem hover no toque, então sempre à vista */
  .fx-mais { width: 30px; height: 30px; }
  .fx-ajuda { display: none; }
  .fx-tela .fx-pal-abrir {
    display: inline-flex; position: absolute; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    min-height: 44px; box-shadow: var(--shadow-2); z-index: 3;
  }
  .fx-zoom { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .fx-zoom button { height: 36px; min-width: 36px; }
  .fx-menu { width: min(260px, calc(100% - 16px)); max-height: min(380px, 60vh); }
  .fx-menu-item { min-height: 40px; }

  /* gavetas: painel do bloco e paleta */
  .fx-painel, .fx-tela.com-paleta .fx-paleta {
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    overscroll-behavior: contain;
  }
  .fx-painel { max-height: 72dvh; background: var(--surface-solida, var(--surface)); }
  /* com a gaveta do bloco aberta, zoom e "Blocos" saem do caminho */
  .fx-tela.com-sel .fx-zoom, .fx-tela.com-sel .fx-pal-abrir { visibility: hidden; }
  .fx-painel::before, .fx-tela.com-paleta .fx-paleta::before {
    content: ''; display: block; width: 38px; height: 4px; margin: -6px auto 10px;
    border-radius: 999px; background: var(--border-hover);
  }
  .fx-painel-topo .btn-icone, .fx-painel-acoes .btn-icone { width: 40px; height: 40px; }
  .fx-painel-acoes .btn { min-height: 40px; }
  .fx-tela.com-paleta .fx-paleta {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 7;
    max-height: 72dvh; padding-top: 14px; border-right: 0;
    border-radius: 18px 18px 0 0; box-shadow: var(--shadow-3);
    background: var(--surface-solida, var(--surface));
  }
  .fx-tela.com-paleta .fx-pal-cabeca {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 4px 6px;
    font-family: var(--font-display); font-size: 16px;
  }
  .fx-pal-cabeca .btn-icone { width: 40px; height: 40px; }
  .fx-tela.com-paleta .fx-pal-item { min-height: 44px; }
  .fx-tela.com-paleta .fx-pal-nota { display: none; }
  /* fundo escurecido atrás da paleta */
  .fx-tela.com-paleta::after {
    content: ''; position: fixed; inset: 0; z-index: 6; background: rgba(10, 14, 12, .45);
  }
  .fx-tela.com-paleta .fx-painel { display: none; }
}
@media (hover: none) {
  .fx-mais { opacity: 1; }
}
/* tela bem estreita: "‹ Voltar" curto pra caber Apagar e Salvar na mesma linha */
@media (max-width: 400px) {
  .fx-voltar span { display: none; }
  .fx-voltar::after { content: 'Voltar'; }
  .fx-topo { column-gap: 4px; padding-left: 6px; padding-right: 8px; }
  .fx-topo .btn { padding-left: 10px; padding-right: 10px; }
  .fx-chave { gap: 6px; font-size: 12px; }
}

/* ═══ mobile: aba "Grupo" da ficha do cliente ════════════════════
   Cabeçalho do grupo (ícone, nome, número) com as ações alinhadas à
   direita; conversa num quadro com borda; campo de mensagem colado
   embaixo. Sem grupo: estado vazio centralizado com o botão. */
.gp-card { padding: 0; overflow: hidden; }
.gp-cabeca {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.gp-avatar {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 14px;
  background: var(--verde-wash); color: var(--verde-deep, var(--verde));
}
.gp-id { display: grid; gap: 3px; min-width: 0; }
.gp-nome { font-size: 15px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp-id select { width: 100%; max-width: 420px; min-height: 40px; font-weight: 600; }
.gp-id select[hidden] { display: none; }
.gp-canal { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); min-width: 0; }
.gp-ponto { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--text-faint); }
.gp-ponto.ok { background: var(--verde); }
.gp-acoes { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.gp-acoes .btn { white-space: nowrap; }
.gp-card .at-grupo-thread { border-radius: 0; max-height: 460px; min-height: 200px; padding: 16px; }
.gp-card .gp-redigir { padding: 10px 12px 12px; }
.gp-vazio { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 36px 20px; }
.gp-vazio h3 { margin: 6px 0 0; font-family: var(--font-display); font-size: 16px; }
.gp-vazio .nota { max-width: 440px; margin: 0 0 8px; }
.gp-vazio .gp-avatar { width: 56px; height: 56px; border-radius: 18px; }
@media (max-width: 640px) {
  .gp-cabeca { grid-template-columns: auto minmax(0, 1fr); padding: 12px; }
  .gp-acoes { grid-column: 1 / -1; justify-content: stretch; }
  .gp-acoes .btn { flex: 1 1 0; min-height: 40px; padding-left: 10px; padding-right: 10px; }
  .gp-card .at-grupo-thread { max-height: 52vh; padding: 12px 10px; }
  .gp-card .gp-redigir { flex-wrap: nowrap; align-items: flex-end; }
  .gp-card .gp-redigir textarea { flex: 1 1 auto; order: 0; min-width: 0; font-size: 16px; }
  .gp-card .gp-redigir .btn { flex: none; min-height: 42px; }
}

/* tema claro: o bloco "Começa quando" usa o fundo da barra lateral, que no claro é claro */
:root[data-tema="claro"] .fx-no.fx-inicio { color: var(--text); }
:root[data-tema="claro"] .fx-no.fx-inicio .fx-no-txt { color: var(--text); }
:root[data-tema="claro"] .fx-no.fx-inicio .fx-no-meta { color: var(--text-muted); }
:root[data-tema="claro"] .fx-no.fx-inicio .fx-ico { background: var(--verde-wash); color: var(--verde-deep, var(--verde)); }

/* ═══ mobile: editor clássico de automação (modal) no celular ═══
   Um <select> com opção comprida dava ao modal uma largura mínima maior
   que a tela de 320px (o "Fechar" saía da tela). */
.modal-fundo > .modal { min-width: 0; }
.modal select { max-width: 100%; }
@media (max-width: 560px) {
  .modal .filtros > input[data-k="titulo"] { flex: 1 1 100% !important; min-width: 0; }
  .modal .filtros > [data-tira-t] { margin-left: auto; min-width: 40px; min-height: 40px; }
  .modal .filtros > label.nota { display: inline-flex; align-items: center; gap: 6px; }
}

/* ── botão logo abaixo de um parágrafo de nota: respiro em vez de colado ── */
/* o respiro vai no div (não no 1º botão): margem só no 1º botão de uma linha flex
   descia ele e esticava os vizinhos (Jurídico vazio: "Novo contrato" desalinhado) */
p.nota + .btn, :where(p.nota + div:has(> .btn:first-child)), p.nota + .acoes-linha { margin-top: 12px; }

/* ── botão Relatório da ficha do cliente: cor própria (azul), com ícone ── */
.btn.btn-relatorio { display: inline-flex; align-items: center; gap: 7px; color: #fff; border-color: transparent;
  background: linear-gradient(135deg, #3b7fe0, #6a5cf0); box-shadow: 0 4px 14px rgba(70, 110, 230, .32); }
.btn.btn-relatorio:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.btn.btn-relatorio[hidden] { display: none; }

/* ── rodapé das janelas no celular: botões do mesmo tamanho; com 3+ botões o
      principal ganha a linha de baixo inteira (antes caía sozinho num canto) ── */
@media (max-width: 600px) {
  .modal-rodape { gap: 10px; }
  .modal-rodape > span:empty, .modal-rodape > .ms-flex { display: none; }
  .modal-rodape > .btn { flex: 1 1 0; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; text-align: center; }
  .modal-rodape:has(> .btn ~ .btn ~ .btn) > .btn-primary { flex-basis: 100%; order: 9; }
}


/* ═══ Automações: lista, janelas e editor de fluxo no celular ═════
   Card: nome, selos, quando/execuções e as ações numa linha só. Até
   1100px Histórico/Testar/Pausar vão pro menu ⋯ (app.js telaAutomacoes);
   no celular Ligar · Editar · ⋯ dividem a largura do card. */
.au-card { margin-bottom: 14px; }
.au-cabeca { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 16px; align-items: start; }
.au-nome { margin: 0; overflow-wrap: anywhere; }
.au-selos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.au-selos .badge { white-space: nowrap; }
.au-info .au-meta { margin: 6px 0 0; }
.au-info .au-meta + .au-meta { margin-top: 2px; }
.au-acoes { position: relative; display: flex; align-items: center; gap: 6px; }
.au-acoes .btn { white-space: nowrap; }
.au-mais { display: none; }
.au-resumo { margin-top: 12px; }
.au-resumo-acoes { display: grid; gap: 4px; font-size: 13px; overflow-wrap: anywhere; }
.au-ver-tudo { margin-top: 6px; padding-left: 0; color: var(--verde-deep, var(--verde)); }
.au-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 200px; padding: 6px;
  display: grid; gap: 2px; background: var(--surface-solida, var(--surface));
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-3);
}
.au-menu button {
  min-height: 44px; padding: 0 14px; border: 0; border-radius: 10px; background: none; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--text); text-align: left;
}
.au-menu button:hover, .au-menu button:focus-visible { background: var(--surface-2); outline: none; }
.au-quebra { display: none; }

/* janela "Modelos" */
.au-modelo { margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.au-modelo-txt { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.au-modelo > .btn { flex: none; white-space: nowrap; }
/* histórico da regra simples */
.au-runs { display: grid; }
.au-run { padding: 12px 0; border-bottom: 1px solid var(--border); }
.au-run:first-child { padding-top: 0; }
.au-run:last-child { border-bottom: 0; }
.au-run-topo { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.au-run-quando { font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.au-run-log { display: grid; gap: 3px; margin-top: 6px; font-size: 13px; color: var(--text-soft); overflow-wrap: anywhere; }

@media (max-width: 1100px) {
  .au-sec { display: none; }
  .au-mais { display: inline-grid; place-items: center; flex: none; }
}

@media (max-width: 860px) {
  /* topo: "Montar fluxo / bot" com a chave de tema; Regra simples e Modelo lado a lado embaixo */
  .topo-acoes > .au-novo-fluxo { flex: 1 1 0; min-height: 44px; }
  .topo-acoes > .au-quebra { display: block; order: 4; flex-basis: 100%; height: 0; margin: 0; }
  .topo-acoes > .au-novo { order: 5; flex: 1 1 0; min-width: 0; min-height: 44px; margin-top: 8px; }
  .topo-acoes > .au-novo.btn-ghost { border: 1px solid var(--border-hover); }
  .topo-acoes:has(> .au-novo-fluxo) > .chave-tema { flex: none; }
}

@media (max-width: 640px) {
  .au-card { padding: 16px; }
  .au-cabeca { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .au-nome { font-size: 16px; line-height: 1.3; }
  .au-acoes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; gap: 8px; }
  .au-acoes .btn { min-height: 44px; justify-content: center; text-align: center; padding-left: 8px; padding-right: 8px; }
  .au-acoes.au-so-ver { grid-template-columns: minmax(0, 1fr); }
  .au-mais { width: 44px; height: 44px; }
  .au-menu { left: auto; right: 0; min-width: min(240px, 100%); }
  /* resumo comprido: corta com degradê e "Ver todos os passos" */
  .au-resumo { max-height: 196px; overflow: hidden; padding-top: 12px; border-top: 1px solid var(--border); }
  .au-resumo.au-cortado:not(.au-aberto) {
    -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent);
  }
  .au-resumo.au-aberto { max-height: none; }
  .au-ver-tudo { min-height: 40px; }

  .au-modelo { padding: 12px 14px; }
  .au-modelo > .btn { min-height: 40px; }

  /* execuções do fluxo: filtros rolam de lado, cada execução vira um cartão */
  :root .alternar.au-filtros {
    display: flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
  }
  .alternar.au-filtros::-webkit-scrollbar { display: none; }
  .alternar.au-filtros button { flex: none; white-space: nowrap; min-height: 40px; }
  .tabela-card:has(> .au-exec), .tabela-card:has(> .au-ab) {
    overflow: visible !important; padding: 0; border: 0; background: none; box-shadow: none;
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .au-exec thead, .au-ab thead { display: none; }
  .au-exec, .au-exec tbody, .au-ab, .au-ab tbody { display: block; width: 100%; }
  .au-exec tr:not(.au-exec-log), .au-ab tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; margin-top: 8px; padding: 12px 14px;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px;
  }
  .au-exec tr:first-child, .au-ab tr:first-child { margin-top: 0; }
  .au-exec td, .au-ab td { display: block; padding: 0; border: 0; text-align: left; white-space: normal !important; }
  .au-exec-quem { grid-column: 1; grid-row: 1; font-weight: 600; overflow-wrap: anywhere; }
  .au-exec-sit { grid-column: 2; grid-row: 1; text-align: right !important; }
  .au-exec-quando, .au-exec-passos { grid-row: 2; font-size: 12.5px; color: var(--text-muted); }
  .au-exec-passos { grid-column: 2; text-align: right !important; }
  .au-exec-passos::after { content: ' ' attr(data-rot); }
  .au-exec-botoes { grid-column: 1 / -1; display: flex !important; gap: 8px; margin-top: 6px; }
  .au-exec-botoes .btn { flex: 1 1 0; min-height: 40px; justify-content: center; border: 1px solid var(--border-hover); }
  .au-exec tr:has(+ tr.au-exec-log:not([hidden])) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
  .au-exec tr.au-exec-log { display: block; padding: 4px 14px 12px; background: var(--surface-2);
    border: 1px solid var(--border); border-top: 0; border-radius: 0 0 14px 14px; }
  .au-exec tr.au-exec-log[hidden] { display: none; }
  .au-exec-log .cm-log { overflow-wrap: anywhere; }
  .au-ab tr { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 6px 14px; }
  .au-ab td:first-child { grid-column: 1 / -1; font-size: 14px; }
  .au-ab td[data-rot] { display: flex; justify-content: space-between; gap: 8px; font-variant-numeric: tabular-nums; }
  .au-ab td[data-rot]::before { content: attr(data-rot); color: var(--text-muted); font-size: 12px; }

  /* regra simples (janela): os "×", "remover" e "+" com alvo de dedo */
  .modal:has(#au-salvar) [data-tira-c], .modal:has(#au-salvar) [data-tira-a],
  .modal:has(#au-salvar) #au-mais-c, .modal:has(#au-salvar) #au-mais-a, .modal:has(#au-salvar) [data-mais-t] { min-height: 40px; min-width: 40px; }
  /* condição: campo numa linha; operador e valor dividem a de baixo com o × */
  .modal:has(#au-salvar) .filtros > [data-c] { flex: 1 1 calc(50% - 40px) !important; width: auto !important; min-width: 0; }
  .modal:has(#au-salvar) .filtros > [data-tira-c] { flex: none; width: 40px; padding: 0; }
  .modal:has(#au-salvar) .filtros > [data-c][data-k="campo"] { flex-basis: 100% !important; }
  .modal:has(#au-salvar) .filtros > select { min-width: 0; }
}

@media (max-width: 900px) {
  /* editor de fluxo: alvos de dedo, textos sem quebrar e o "+" vira gaveta */
  .fx-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .fx-chave { min-height: 40px; }
  .fx-titulo input { min-height: 40px; }
  .fx-mais::after { content: ''; position: absolute; inset: -10px; border-radius: 50%; }
  .fx-zoom button { height: 40px; min-width: 40px; }
  .fx-menu {
    position: fixed !important; left: 0 !important; right: 0; top: auto !important; bottom: 0;
    width: auto; max-height: 70dvh; z-index: 7; border-radius: 18px 18px 0 0;
    padding: 14px 10px calc(16px + env(safe-area-inset-bottom, 0px));
    background: var(--surface-solida, var(--surface)); overscroll-behavior: contain;
  }
  .fx-menu::before {
    content: ''; display: block; width: 38px; height: 4px; margin: -4px auto 6px;
    border-radius: 999px; background: var(--border-hover);
  }
  .fx-menu-item { min-height: 44px; font-size: 14px; }
  .fx-tela:has(.fx-menu)::after { content: ''; position: fixed; inset: 0; z-index: 6; background: rgba(10, 14, 12, .45); }
  .fx-tela:has(.fx-menu) .fx-zoom, .fx-tela:has(.fx-menu) .fx-pal-abrir { visibility: hidden; }
  /* painel do bloco: campos de 40px e 16px (o iPhone não dá zoom ao focar) */
  .fx-painel input, .fx-painel select, .fx-painel textarea { font-size: 16px; }
  .fx-opcao input, .fx-cond input, .fx-cond select { min-height: 40px; font-size: 16px; }
  .fx-opcao { grid-template-columns: 24px minmax(0, 1fr); }
  .fx-opcao-acoes { grid-column: 2; display: flex; gap: 6px; }
  .fx-opcao-acoes [data-opdel] { margin-left: auto; }
  .fx-opcao-acoes .btn-icone, .fx-cond .btn-icone { width: 40px; height: 40px; flex: none; }
  .fx-add { min-height: 40px; }
}

/* ═══ QA (acabamento): espaçamentos colados e rótulos misturados ═══════
   - "Rótulo <span class=nota>opcional</span>" dentro do label em
     maiúsculas: a nota herdava MAIÚSCULA e ficava maior que o rótulo.
   - Início: o seletor "Minhas coisas" ocupava a linha inteira; o bloco
     Tarefas/Alertas grudava na Fila de leads; o título do card de
     tarefas (tabela-card) ficava sem respiro.
   - Ficha do cliente: cards empilhados na aba (Vendas etc.) sem espaço. */
.campo > label .nota, .secao > h3 .nota { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 11.5px; margin: 0 0 0 4px; }
.inicio-topo select { width: auto; min-width: 200px; max-width: 280px; margin-left: auto; }
.inicio-widget > .inicio-grade { margin-top: 22px; }
.card.tabela-card > .card-topo { padding: 10px 10px 6px; }
:where(#ficha-aba) > .card + .card, :where(#ficha-aba > #v-roas) + .card, :where(#ficha-aba) > .card + :where(#v-integracoes) { margin-top: 12px; }
p.nota + .card, p.nota + .tabela-card { margin-top: 12px; }
.filtros.cv-periodo select { max-width: 220px; }
@media (max-width: 720px) {
  .inicio-topo select { flex: 1 1 200px; max-width: none; margin-left: 0; }
  .filtros.cv-periodo select { max-width: none; }
}
@media (pointer: coarse) { .ficha-linha .etq-mais { min-height: 32px; padding-left: 12px; padding-right: 12px; } }
/* QA: rodapé de janela usado dentro de um card da página (ex.: "Registrar" em
   Pessoas → 1:1 e feedbacks) herdava as margens negativas e o fundo do modal e
   virava uma faixa escura vazando pra fora do card. Fora de modal, é só a linha de ações. */
.card .modal-rodape:not(.modal .modal-rodape) { position: static; margin: 14px 0 0; padding: 0; border-top: 0; background: none; justify-content: flex-end; }
/* QA: Assistente — o campo de pergunta herdava o anel/borda de foco do tema
   (retângulo dentro da cápsula) e mostrava as setinhas de rolagem com 1 linha;
   no celular o seletor de cliente passava da borda do card. */
:root[data-tema] .chat-campo textarea, :root[data-tema] .chat-campo textarea:focus { background: transparent; border: 0; box-shadow: none; outline: none; }
.chat-campo textarea { scrollbar-width: thin; }
@media (max-width: 560px) {
  .chat-topo .cs-topo-esq { flex: 1 1 auto; }
  .chat-contexto { flex: 1 1 auto; min-width: 0; }
  .chat-contexto > span { display: none; }
  .chat-contexto select { flex: 1 1 auto; min-width: 0; max-width: none; }
}
/* QA: o rodapé fixo das janelas (fundo sólido) cobria os cantos arredondados de baixo
   do modal — a janela ficava com a base quadrada. O corpo (que rola) recorta nos cantos. */
.modal > .modal-corpo { border-bottom-left-radius: inherit; border-bottom-right-radius: inherit; }

/* ── renovação do contrato: Renovar verde, "Não vai renovar" vermelho (btn-perigo) ── */
.btn.btn-renovar { background: linear-gradient(135deg, #2fbf71, #1f9d5c); color: #fff; border-color: transparent;
  box-shadow: 0 4px 14px rgba(31, 157, 92, .3); }
.btn.btn-renovar:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }

/* ── ficha → Contrato: vazio alinhado à esquerda e ações numa linha só ── */
.contrato-vazio { display: flex; flex-direction: column; gap: 4px; }
.contrato-vazio .nota { margin: 0; }
.contrato-acoes { align-items: center; }
#contrato-extra:empty { display: none; }
#contrato-extra > .ct-bloco-rot:first-child { margin-top: 18px; }

/* ── janelas no celular: respeitar a área segura do iPhone (relógio/entalhe em cima,
      barra de gesto embaixo). O app ocupa a tela toda (viewport-fit=cover) e o topo da
      janela — título e "Fechar" — ficava escondido atrás da barra de status ── */
@media (max-width: 720px) {
  .modal-fundo {
    padding: calc(env(safe-area-inset-top, 0px) + 10px) 8px calc(env(safe-area-inset-bottom, 0px) + 8px);
    align-items: end;
  }
  .modal {
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 18px);
    border-radius: var(--radius-card);
  }
  .modal-topo { flex: none; padding: 14px 16px 10px; align-items: center; }
  .modal-topo .modal-titulo { font-size: 17px; margin-top: 2px; }
  .modal-topo > .btn[data-fechar] { flex: none; min-height: 40px; }
  .modal-corpo { min-height: 0; flex: 1 1 auto; padding: 14px 16px 18px; }
  .modal-rodape { margin: 16px -16px -18px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px) * 0); bottom: -18px; }
}

/* botão de apagar cobrança na ficha: discreto, vermelho no hover */
.btn.btn-lixo { padding: 6px 9px; color: var(--text-muted); }
.btn.btn-lixo:hover:not(:disabled) { color: var(--danger); background: var(--danger-bg); }

/* chave da busca no Maps (modulos/prospeccao-chave.js) */
.pp-chip.clicavel { cursor: pointer; }
.pp-chip.clicavel:hover { filter: brightness(.97); }
.pp-chip .pp-chip-acao { color: var(--verde-deep); font-weight: 600; text-decoration: underline; }
.pp-chave-st { font-size: 12.5px; color: var(--text-soft); }
.pp-chave-st.ok b { color: var(--text); }
.pp-chave-st.falta { color: var(--warn); }

/* "hidden" sempre esconde: um display:grid/flex de componente vencia o atributo
   e deixava painel aberto pra sempre (ex.: seletor de clientes em Campanhas) */
[hidden] { display: none !important; }
