/* CRM de WhatsApp da Gloryful — layout inspirado no Umbler Talk.
   As cores vem da tela Configuracoes > Aparencia (variaveis abaixo sao o padrao). */

:root {
  --menu: #2f2d7e;
  --destaque: #419dbc;
  --amarelo: #f7c328;
  --fundo: #eff0f4;
  --branco: #ffffff;
  --texto: #1d1b3a;
  --texto-suave: #6b6a80;
  --borda: #e3e4ec;
  --perigo: #d64545;
  --ok: #2e9d6a;
  --bolha-saida: #e3f2f8;
  --bolha-ia: #ecebfa;
  --nota: #fff6d6;
  --raio: 14px;
  --sombra: 0 1px 2px rgba(29, 27, 58, 0.06), 0 6px 18px rgba(29, 27, 58, 0.06);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--texto);
  font-size: 15px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--fundo); }
body { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--menu); }
.oculto { display: none !important; }
svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ---------- botoes e campos ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px;
  padding: 10px 18px; background: var(--menu); color: #fff; font-weight: 600;
}
.btn:hover { filter: brightness(1.12); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.secundario { background: var(--fundo); color: var(--menu); }
.btn.perigo { background: var(--perigo); }
.btn.pequeno { padding: 6px 12px; font-size: 13px; }
.icone-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 10px;
  background: transparent; color: var(--texto-suave);
}
.icone-btn:hover { background: var(--fundo); color: var(--menu); }
.icone-btn.ativo { background: var(--menu); color: #fff; }
.icone-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.campo {
  width: 100%; border: 1px solid var(--borda); border-radius: 12px; padding: 10px 14px; background: #fff;
  outline: none;
}
.campo:focus { border-color: var(--destaque); box-shadow: 0 0 0 3px color-mix(in srgb, var(--destaque) 20%, transparent); }
textarea.campo { resize: vertical; min-height: 90px; line-height: 1.45; }
label.rotulo { display: block; font-size: 13px; font-weight: 600; color: var(--texto-suave); margin: 14px 0 6px; }
.dica { font-size: 13px; color: var(--texto-suave); margin: 6px 0 0; }
.erro { color: var(--perigo); font-size: 14px; min-height: 18px; }

/* ---------- login ---------- */
#tela-login { height: 100%; display: grid; place-items: center; padding: 16px; }
.cartao-login { width: min(380px, 100%); background: #fff; border-radius: 20px; padding: 32px; box-shadow: var(--sombra); }
.cartao-login h1 { margin: 0 0 4px; color: var(--menu); }
.cartao-login p { margin: 0 0 20px; color: var(--texto-suave); }
.cartao-login .btn { width: 100%; justify-content: center; margin-top: 16px; }

/* ---------- casca do app ---------- */
#app { display: flex; height: 100%; }
.menu {
  width: 68px; background: var(--menu); color: #fff; display: flex; flex-direction: column; align-items: center;
  padding: 14px 0; gap: 6px; flex-shrink: 0; z-index: 5;
}
.menu .logo { width: 56px; height: 40px; display: grid; place-items: center; margin-bottom: 14px; overflow: hidden; }
.menu .logo img { width: 100%; height: 100%; object-fit: contain; }
.logo-login { display: block; width: 180px; margin: 0 auto 18px; }
.oculto-visual { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.cartao-login p { text-align: center; }
.menu a, .menu button {
  position: relative; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  color: rgba(255,255,255,0.78); background: transparent; border: 0; text-decoration: none;
}
.menu a:hover, .menu button:hover { background: rgba(255,255,255,0.12); color: #fff; }
.menu a.ativo { background: #fff; color: var(--menu); box-shadow: 0 0 0 2px rgba(255,255,255,0.35); }
.menu .espaco { flex: 1; }
.menu [data-dica]:hover::after {
  content: attr(data-dica); position: absolute; left: 56px; top: 50%; transform: translateY(-50%);
  background: var(--texto); color: #fff; padding: 6px 10px; border-radius: 8px; font-size: 13px; white-space: nowrap; pointer-events: none;
}
.menu .contador {
  position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px;
  background: var(--amarelo); color: var(--texto); font-size: 11px; font-weight: 800; display: grid; place-items: center;
}
.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  background: color-mix(in srgb, var(--destaque) 30%, #fff); color: var(--menu); position: relative; flex-shrink: 0;
}
.avatar.grande { width: 72px; height: 72px; font-size: 26px; }
.menu .avatar { background: rgba(255,255,255,0.2); color: #fff; margin-top: 8px; }
.menu .avatar::after { content: ""; position: absolute; right: 0; bottom: 0; width: 11px; height: 11px; border-radius: 50%; background: #3ccf7a; border: 2px solid var(--menu); }

main#conteudo { flex: 1; min-width: 0; height: 100%; overflow: hidden; }
.pagina { height: 100%; overflow-y: auto; padding: 28px clamp(16px, 4vw, 48px) 48px; }
.pagina h1 { font-size: 30px; margin: 0 0 6px; }
.pagina > p.sub { color: var(--texto-suave); margin: 0 0 22px; max-width: 900px; }
.bloco { background: #fff; border-radius: 18px; padding: 22px; box-shadow: var(--sombra); margin-bottom: 18px; }
.bloco h2 { margin: 0 0 4px; font-size: 18px; }
.linha-acoes { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 14px; }

/* ---------- conversas ---------- */
.conversas { display: flex; height: 100%; }
.lista {
  width: 360px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--borda); display: flex; flex-direction: column; min-height: 0;
}
.lista-topo { display: flex; align-items: center; gap: 4px; padding: 16px 14px 10px 18px; }
.lista-topo h2 { flex: 1; margin: 0; font-size: 22px; }
.btn-mais { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--menu); color: #fff; display: grid; place-items: center; }
.busca { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-top: 1px solid var(--borda); border-bottom: 1px solid var(--borda); }
.busca input { flex: 1; border: 0; outline: none; padding: 6px 0; background: transparent; }
.busca select { border: 1px solid var(--borda); border-radius: 8px; padding: 4px 6px; background: #fff; font-size: 13px; max-width: 130px; }
/* 4 abas em 2 linhas: numa coluna estreita elas cortavam. */
.abas { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 12px 14px 8px; padding: 4px; background: var(--fundo); border-radius: 16px; }
.abas button {
  border: 0; background: transparent; border-radius: 12px; padding: 8px 10px; font-size: 13px; font-weight: 600;
  color: var(--texto-suave); white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.abas button.ativo { background: var(--menu); color: #fff; }
.abas .num { font-size: 11px; background: rgba(0,0,0,0.08); border-radius: 999px; padding: 1px 7px; }
.abas button.ativo .num { background: rgba(255,255,255,0.25); }
.abas button.alerta .num { background: var(--amarelo); color: var(--texto); }
#lista-conversas { list-style: none; margin: 0; padding: 4px 8px 16px; overflow-y: auto; flex: 1; }
.item-conversa { display: flex; gap: 12px; padding: 12px 10px; border-radius: 12px; cursor: pointer; align-items: flex-start; }
.item-conversa:hover { background: var(--fundo); }
.item-conversa.ativo { background: color-mix(in srgb, var(--destaque) 14%, #fff); }
.item-conversa .corpo { flex: 1; min-width: 0; }
.item-conversa .linha1 { display: flex; gap: 8px; align-items: baseline; }
.item-conversa .nome { flex: 1; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-conversa .hora { font-size: 12px; color: var(--texto-suave); }
.item-conversa .previa { font-size: 13px; color: var(--texto-suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.item-conversa .linha3 { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; align-items: center; }
.badge-nao-lidas { background: var(--destaque); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; margin-left: auto; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 8px;
  background: color-mix(in srgb, var(--cor, #419dbc) 16%, #fff); color: color-mix(in srgb, var(--cor, #419dbc) 75%, #000);
  border: 1px solid color-mix(in srgb, var(--cor, #419dbc) 35%, #fff);
}
.chip.janela { --cor: #d64545; }
.vazio-lista { text-align: center; color: var(--texto-suave); padding: 30px 10px; }

.chat { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--fundo); position: relative; }
.chat-vazio { flex: 1; display: grid; place-items: center; text-align: center; color: var(--texto); }
.chat-vazio svg { width: 120px; height: 120px; stroke-width: 1; color: color-mix(in srgb, var(--menu) 35%, #fff); }
.chat-vazio h2 { margin: 10px 0 0; }
.chat-topo {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto;
  grid-template-areas: "voltar avatar quem acoes" "voltar avatar etiquetas acoes";
  align-items: center; column-gap: 12px; padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--borda);
}
.chat-topo .btn-voltar { grid-area: voltar; }
.chat-topo > .avatar { grid-area: avatar; }
.chat-topo .quem { grid-area: quem; min-width: 0; }
.chat-topo .topo-etiquetas { grid-area: etiquetas; }
.chat-topo .acoes { grid-area: acoes; }
.chat-topo .numero-celular, .chat-topo .so-celular { display: none; }
.chat-topo .quem .nome { font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-topo .sub { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 3px; font-size: 13px; color: var(--texto-suave); }
.chat-topo .acoes { display: flex; gap: 2px; }
.btn-voltar { display: none; }
.aviso { margin: 10px 16px 0; padding: 10px 14px; border-radius: 12px; font-size: 14px; display: flex; gap: 10px; align-items: center; }
.aviso.transferida { background: #fff3cd; color: #6b5200; }
.aviso.janela { background: #fde8e8; color: #8a1f1f; }
.aviso .btn { margin-left: auto; }
#mensagens { flex: 1; overflow-y: auto; padding: 16px clamp(12px, 3vw, 36px); display: flex; flex-direction: column; gap: 8px; }
.bolha { max-width: min(560px, 78%); padding: 10px 14px 6px; border-radius: 16px; background: #fff; box-shadow: 0 1px 1px rgba(0,0,0,0.04); white-space: pre-wrap; word-wrap: break-word; line-height: 1.45; }
.bolha.entrada { align-self: flex-start; border-top-left-radius: 4px; }
.bolha.saida { align-self: flex-end; background: var(--bolha-saida); border-top-right-radius: 4px; }
.bolha.ia { background: var(--bolha-ia); }
.bolha .transcricao { margin-top: 4px; font-size: 13px; font-style: italic; color: var(--texto-suave); white-space: pre-wrap; }
.bolha.sistema { align-self: center; background: transparent; box-shadow: none; color: var(--texto-suave); font-size: 13px; }
.bolha.falhou { outline: 1px solid var(--perigo); }
.bolha .autor { font-size: 12px; font-weight: 700; color: var(--destaque); margin-bottom: 2px; }
.bolha.ia .autor { color: var(--menu); }
.bolha .meta { display: block; text-align: right; font-size: 11px; color: var(--texto-suave); margin-top: 4px; }
.bolha img { max-width: 100%; border-radius: 10px; display: block; margin-bottom: 4px; }
.bolha audio { width: 260px; max-width: 100%; }
.bolha .arquivo { display: inline-flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,0.04); text-decoration: none; }
.nota-inline { align-self: center; width: min(600px, 92%); background: var(--nota); border: 1px dashed #e5c65b; border-radius: 12px; padding: 8px 12px; font-size: 14px; white-space: pre-wrap; }
.nota-inline .meta { font-size: 11px; color: #8a7320; margin-top: 4px; display: flex; justify-content: space-between; }
.separador { align-self: center; font-size: 12px; color: var(--texto-suave); background: rgba(255,255,255,0.7); padding: 3px 12px; border-radius: 999px; }

.composer { margin: 10px 16px 16px; background: #fff; border-radius: 18px; box-shadow: var(--sombra); padding: 12px 14px; position: relative; }
.composer.arrastando { outline: 2px dashed var(--destaque); }
.composer .topo { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.composer .topo .alternar { margin-left: auto; display: flex; background: var(--fundo); border-radius: 999px; padding: 3px; }
.composer .topo .alternar button { border: 0; background: transparent; border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; color: var(--texto-suave); }
.composer .topo .alternar button.ativo { background: var(--menu); color: #fff; }
.composer.modo-nota { background: var(--nota); }
.composer textarea { width: 100%; border: 0; outline: none; resize: none; min-height: 48px; max-height: 180px; background: transparent; line-height: 1.45; padding: 4px 0; }
.composer .base { display: flex; align-items: center; gap: 2px; }
.composer .base .enviar { margin-left: auto; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--menu); color: #fff; display: grid; place-items: center; }
.composer .anexo { font-size: 13px; background: var(--fundo); border-radius: 10px; padding: 6px 10px; display: inline-flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.interruptor { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; cursor: pointer; user-select: none; }
.interruptor input { display: none; }
.interruptor .trilho { width: 38px; height: 22px; border-radius: 999px; background: #c9cad6; position: relative; transition: background 0.15s; }
.interruptor .trilho::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left 0.15s; }
.interruptor input:checked + .trilho { background: var(--ok); }
.interruptor input:checked + .trilho::after { left: 19px; }

/* ---------- popovers, modais e gaveta ---------- */
.popover {
  position: absolute; z-index: 30; background: #fff; border-radius: 14px; box-shadow: 0 10px 40px rgba(29,27,58,0.18);
  padding: 8px; min-width: 240px; max-height: 340px; overflow-y: auto;
}
.popover .op { display: flex; gap: 10px; align-items: center; width: 100%; border: 0; background: transparent; padding: 9px 10px; border-radius: 10px; text-align: left; }
.popover .op:hover, .popover .op.focado { background: var(--fundo); }
.popover .op small { display: block; color: var(--texto-suave); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.popover .titulo { font-size: 12px; font-weight: 700; color: var(--texto-suave); padding: 6px 10px; text-transform: uppercase; letter-spacing: 0.04em; }
.emojis { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emojis button { border: 0; background: transparent; font-size: 22px; padding: 4px; border-radius: 8px; }
.emojis button:hover { background: var(--fundo); }
.bola-cor { width: 14px; height: 14px; border-radius: 50%; background: var(--cor); flex-shrink: 0; }

.fundo-modal { position: fixed; inset: 0; background: rgba(20, 18, 50, 0.45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 20px; width: min(520px, 100%); max-height: 90vh; overflow-y: auto; padding: 24px; }
.modal h2 { margin: 0 0 6px; }
.modal .rodape { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.gaveta { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: #fff; z-index: 40; box-shadow: -10px 0 40px rgba(29,27,58,0.15); display: flex; flex-direction: column; }
.gaveta .cabeca { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--borda); }
.gaveta .cabeca h2 { flex: 1; margin: 0; font-size: 18px; }
.gaveta .corpo-gaveta { padding: 18px; overflow-y: auto; flex: 1; }
.perfil-contato { text-align: center; margin-bottom: 8px; }
.perfil-contato .avatar { margin: 0 auto 10px; }
.lista-simples { list-style: none; padding: 0; margin: 8px 0; }
.lista-simples li { padding: 10px 0; border-bottom: 1px solid var(--borda); display: flex; gap: 10px; align-items: center; font-size: 14px; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--texto); color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 60; font-size: 14px; box-shadow: var(--sombra); max-width: 92vw; }
.toast.erro-toast { background: var(--perigo); }

/* ---------- tabelas (contatos, etiquetas...) ---------- */
.tabela { width: 100%; border-collapse: collapse; }
.tabela th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--texto-suave); padding: 10px 12px; border-bottom: 1px solid var(--borda); }
.tabela td { padding: 12px; border-bottom: 1px solid var(--borda); vertical-align: middle; }
.tabela tr.clicavel { cursor: pointer; }
.tabela tr.clicavel:hover td { background: var(--fundo); }
.tabela .quem { display: flex; gap: 10px; align-items: center; font-weight: 600; }

/* ---------- agente de IA ---------- */
.passos { display: flex; gap: 0; margin: 4px 0 22px; overflow-x: auto; padding-bottom: 6px; }
.passos button { flex: 1; min-width: 120px; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; color: var(--texto-suave); position: relative; }
.passos button .n { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--borda); font-weight: 700; z-index: 1; }
.passos button::before { content: ""; position: absolute; top: 19px; left: -50%; width: 100%; height: 2px; background: var(--borda); }
.passos button:first-child::before { display: none; }
.passos button.ativo { color: var(--menu); font-weight: 700; }
.passos button.ativo .n { background: var(--menu); color: #fff; border-color: var(--menu); }
.grade-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.habilidade { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border: 1px solid var(--borda); border-radius: 14px; }
.habilidade .txt { flex: 1; }
.habilidade .txt b { display: block; }
.habilidade .txt span { font-size: 13px; color: var(--texto-suave); }
.estado-linha { display: flex; gap: 10px; align-items: center; padding: 8px 0; font-size: 14px; }
.bolinha { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); }
.bolinha.ruim { background: var(--perigo); }
.nota-md { line-height: 1.6; }
.nota-md h1, .nota-md h2, .nota-md h3 { margin: 18px 0 8px; }
.nota-md h1 { font-size: 22px; } .nota-md h2 { font-size: 18px; color: var(--menu); } .nota-md h3 { font-size: 16px; }
.nota-md blockquote { margin: 10px 0; padding: 10px 14px; background: var(--fundo); border-left: 4px solid var(--destaque); border-radius: 8px; }
.nota-md table { border-collapse: collapse; margin: 10px 0; font-size: 14px; display: block; overflow-x: auto; }
.nota-md td, .nota-md th { border: 1px solid var(--borda); padding: 6px 10px; vertical-align: top; }
.nota-md code { background: var(--fundo); padding: 1px 6px; border-radius: 6px; }
.nota-md .wikilink { color: var(--destaque); font-weight: 600; }
.nota-md hr { border: 0; border-top: 1px solid var(--borda); margin: 18px 0; }
.nota-md .citacao-texto { background: var(--bolha-saida); border-radius: 12px; padding: 10px 14px; margin: 8px 0; white-space: pre-wrap; }
.seletor-notas { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.seletor-notas button { border: 1px solid var(--borda); background: #fff; border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600; }
.seletor-notas button.ativo { background: var(--menu); border-color: var(--menu); color: #fff; }
.editor-nota { width: 100%; min-height: 60vh; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px; }
.teste-chat { display: flex; flex-direction: column; gap: 8px; background: var(--fundo); border-radius: 14px; padding: 14px; min-height: 280px; max-height: 55vh; overflow-y: auto; }
.teste-envio { display: flex; gap: 8px; margin-top: 10px; }
.teste-envio input { flex: 1; }
.cores { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.cores label { display: flex; align-items: center; gap: 10px; border: 1px solid var(--borda); border-radius: 12px; padding: 10px; font-size: 14px; font-weight: 600; }
.cores input[type="color"] { width: 42px; height: 32px; border: 0; background: transparent; padding: 0; }
.em-breve { text-align: center; padding: 40px 16px; }
.em-breve svg { width: 64px; height: 64px; color: var(--destaque); }
.em-breve ul { text-align: left; display: inline-block; color: var(--texto-suave); }
.submenu { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.submenu a { text-decoration: none; padding: 8px 16px; border-radius: 999px; background: #fff; font-weight: 600; font-size: 14px; color: var(--texto-suave); box-shadow: var(--sombra); }
.submenu a.ativo { background: var(--menu); color: #fff; }
.codigo-token { font-family: ui-monospace, Consolas, monospace; background: var(--fundo); padding: 12px; border-radius: 10px; word-break: break-all; }

/* Equipe: escolha do tipo de acesso ao criar o login */
.grade-campos label.opcao-acesso, .opcao-acesso { display: flex; flex-direction: row; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--borda); border-radius: 10px; margin-top: 6px; cursor: pointer; font-size: 14px; }
.opcao-acesso input { margin-top: 3px; flex-shrink: 0; }
.opcao-acesso:has(input:checked) { border-color: var(--menu); background: var(--fundo); }

/* Olhinho no titulo das telas com valores: so no celular (no computador ele fica no menu). */
.olho-titulo { display: none; }

/* ---------- celular ---------- */
@media (max-width: 820px) {
  #app { flex-direction: column-reverse; }
  .menu { width: 100%; height: 60px; flex-direction: row; padding: 0 8px; justify-content: space-around; gap: 0; }
  .menu .logo, .menu .espaco, .menu [data-so-desktop] { display: none; }
  .olho-titulo { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin-left: 10px; vertical-align: middle; border: 1px solid var(--borda); border-radius: 999px; background: #fff; color: var(--texto-suave); cursor: pointer; }
  .olho-titulo[aria-pressed="true"] { background: var(--menu); border-color: var(--menu); color: #fff; }
  .menu [data-dica]:hover::after { display: none; }
  main#conteudo { height: calc(100% - 60px); }
  .lista { width: 100%; border-right: 0; }
  .conversas.com-chat .lista { display: none; }
  .conversas:not(.com-chat) .chat { display: none; }
  .btn-voltar { display: inline-grid; }
  .chat-topo .acoes .icone-btn { width: 36px; height: 36px; }
  /* Topo da conversa no celular: nome e numero numa linha, etiquetas embaixo, acoes extras no menu "..." */
  .chat-topo {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    grid-template-areas: "voltar avatar quem acoes" "etiquetas etiquetas etiquetas etiquetas";
    column-gap: 8px; row-gap: 6px; padding: 8px 8px 8px 4px;
  }
  .chat-topo > .avatar { width: 38px; height: 38px; font-size: 14px; }
  .chat-topo .quem .nome { font-size: 16px; }
  .chat-topo .numero-celular { display: block; font-size: 12px; color: var(--texto-suave); white-space: nowrap; }
  .chat-topo .numero-desktop, .chat-topo .so-desktop { display: none; }
  .chat-topo .so-celular { display: inline-grid; }
  .chat-topo .topo-etiquetas { flex-wrap: nowrap; overflow-x: auto; margin: 0; padding-left: 8px; scrollbar-width: none; }
  .chat-topo .topo-etiquetas::-webkit-scrollbar { display: none; }
  .chat-topo .topo-etiquetas .chip { white-space: nowrap; flex: none; }
  .pagina { padding: 18px 16px 40px; }
  .pagina h1 { font-size: 24px; }
  .tabela .some-celular { display: none; }
}
.aviso-bloco { background: #FFF6D6; border-radius: 12px; padding: 10px 14px; margin: 12px 0 0; font-size: 14px; }

/* ---------- chatbot (menu com botões) ---------- */
.chatbot-aviso { margin: 0 0 18px; max-width: 900px; }
.chatbot-grade { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.chatbot-lado { position: sticky; top: 0; display: flex; flex-direction: column; gap: 10px; }
.opcao-bot { border: 1px solid var(--borda); border-radius: 14px; padding: 12px 16px 16px; margin: 12px 0; }
.opcao-bot-topo { display: flex; align-items: center; justify-content: space-between; }
.opcao-bot-n { width: 26px; height: 26px; border-radius: 50%; background: var(--menu); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.opcao-bot-acoes { display: flex; gap: 4px; }
.opcao-bot-acoes .icone-btn[disabled] { opacity: .3; cursor: default; }
.contador { font-weight: 400; float: right; }
.chatbot-rodape { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 20px; }
.celular { position: relative; height: 600px; border-radius: 30px; border: 8px solid var(--texto); background: #efe7dd; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--sombra); }
.celular-topo { display: flex; align-items: center; gap: 10px; background: #075e54; color: #fff; padding: 12px 14px; }
.celular-topo small { display: block; font-size: 11px; opacity: .8; }
.celular-avatar { width: 34px; height: 34px; border-radius: 50%; background: #fff; color: var(--menu); display: grid; place-items: center; font-weight: 800; }
.celular-chat { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.bolha-bot, .bolha-cliente { max-width: 85%; border-radius: 10px; font-size: 14px; line-height: 1.4; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.bolha-bot { align-self: flex-start; background: #fff; }
.bolha-cliente { align-self: flex-end; background: #d9fdd3; }
.bolha-texto { padding: 8px 10px; }
.bolha-botao { display: block; width: 100%; border: 0; border-top: 1px solid #e9edef; background: none; color: #008069; font-weight: 600; padding: 9px; cursor: pointer; font: inherit; font-weight: 600; }
.chat-aviso { align-self: center; background: #fff3c4; color: #54410a; font-size: 12px; padding: 4px 10px; border-radius: 8px; }
.lista-menu { position: absolute; inset: auto 0 0 0; max-height: 75%; overflow-y: auto; background: #fff; border-radius: 16px 16px 0 0; box-shadow: 0 -4px 20px rgba(0,0,0,.2); }
.lista-menu-topo { display: flex; align-items: center; gap: 8px; padding: 10px; border-bottom: 1px solid var(--borda); }
.lista-item { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 10px; text-align: left; border: 0; border-bottom: 1px solid #f0f2f5; background: none; padding: 12px 16px; cursor: pointer; font: inherit; }
.lista-item:hover { background: #f5f6f6; }
.lista-item small { display: block; color: var(--texto-suave); font-size: 12px; margin-top: 2px; }
.lista-radio { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 2px solid #8696a0; }
@media (max-width: 980px) {
  .chatbot-grade { grid-template-columns: 1fr; }
  .chatbot-lado { position: static; }
  .celular { height: 520px; max-width: 360px; width: 100%; margin: 0 auto; }
}
.popover .op[disabled] { opacity: .45; cursor: default; }

/* ---------- prescritores ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { text-align: left; background: #fff; border: 0; border-radius: 16px; padding: 14px 16px; box-shadow: var(--sombra); display: flex; flex-direction: column; gap: 2px; }
button.kpi { cursor: pointer; }
button.kpi:hover { outline: 2px solid color-mix(in srgb, var(--destaque) 45%, transparent); }
.kpi span { font-size: 12px; font-weight: 700; color: var(--texto-suave); text-transform: uppercase; letter-spacing: .04em; }
.kpi b { font-size: 26px; color: var(--menu); line-height: 1.15; }
.kpi small { font-size: 12px; color: var(--texto-suave); }
.chip { white-space: nowrap; }
.num-aba { margin-left: 6px; background: var(--amarelo); color: var(--texto); font-size: 11px; font-weight: 800; border-radius: 999px; padding: 1px 7px; }
.funil-chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: thin; }
.funil-chips button { flex: none; border: 1px solid var(--borda); background: #fff; border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600; color: var(--texto-suave); white-space: nowrap; }
.funil-chips button .num { margin-left: 4px; font-size: 11px; background: var(--fundo); border-radius: 999px; padding: 1px 7px; }
.funil-chips button.ativo { background: var(--menu); border-color: var(--menu); color: #fff; }
.funil-chips button.ativo .num { background: rgba(255,255,255,.22); }
.filtros { display: flex; gap: 8px; flex-wrap: wrap; }
.filtros .campo { width: auto; min-width: 120px; padding: 9px 12px; }
.filtros .busca.grande { flex: 1 1 100%; border: 1px solid var(--borda); border-radius: 12px; padding: 2px 12px; background: #fff; }
.filtros .busca.grande input { padding: 9px 0; }
.nome-presc { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 340px; }
.falta { color: var(--perigo); font-weight: 600; font-size: 12px; }
.tabela-presc td { vertical-align: middle; }
.tabela-presc code, .cupom-card .codigo, .rolagem-x code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.tabela-presc .dica svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }
.rolagem-x { overflow-x: auto; }
.link-nome { border: 0; background: none; padding: 0; font-weight: 700; color: var(--menu); text-align: left; }
.link-nome:hover { text-decoration: underline; }

.buscador { position: relative; }
.sugestoes { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin-top: 4px; background: #fff; border-radius: 12px; box-shadow: 0 10px 40px rgba(29,27,58,.18); padding: 6px; max-height: 280px; overflow-y: auto; }
.sugestoes .op { display: flex; gap: 10px; align-items: center; width: 100%; border: 0; background: none; text-align: left; padding: 8px; border-radius: 10px; }
.sugestoes .op:hover { background: var(--fundo); }
.sugestoes .op small { display: block; color: var(--texto-suave); font-size: 12px; }

/* ficha */
.gaveta.larga { width: min(620px, 100%); }
.topo-ficha { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.etapa-select { width: auto; padding: 6px 12px; font-weight: 700; border-radius: 999px; }
.acoes-ficha { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0 14px; }
.acoes-ficha .btn svg { width: 16px; height: 16px; }
.abas-ficha { display: flex; gap: 4px; border-bottom: 1px solid var(--borda); margin-bottom: 14px; overflow-x: auto; }
.abas-ficha button { border: 0; background: none; padding: 9px 14px; font-weight: 600; font-size: 14px; color: var(--texto-suave); border-bottom: 3px solid transparent; white-space: nowrap; }
.abas-ficha button.ativo { color: var(--menu); border-bottom-color: var(--menu); }
h3.sec { margin: 20px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--texto-suave); }
.fatos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; background: var(--fundo); border-radius: 14px; padding: 14px; }
.fatos > div { display: flex; flex-direction: column; gap: 3px; }
.fatos .cheio { grid-column: 1 / -1; }
.fatos span, .rotulo-mini { font-size: 12px; font-weight: 700; color: var(--texto-suave); }
.mini-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 14px 0; }
.mini-kpis > div { border: 1px solid var(--borda); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.mini-kpis span { font-size: 12px; font-weight: 700; color: var(--texto-suave); }
.mini-kpis b { font-size: 20px; color: var(--menu); }
.mini-kpis small { font-size: 12px; color: var(--texto-suave); }
.grade-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.grade-campos label { display: flex; flex-direction: column; gap: 4px; }
.grade-campos .campo-cheio { grid-column: 1 / -1; }
.grade-campos .campo { padding: 8px 12px; }
.cupons-duplo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }
.cupom-card { border: 1px solid var(--borda); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.cupom-card .codigo { font-size: 17px; font-weight: 700; color: var(--menu); word-break: break-all; }
.linha-tempo { list-style: none; padding: 0; margin: 14px 0 0; }
.linha-tempo li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--borda); font-size: 14px; }
.linha-tempo .ic { width: 30px; height: 30px; border-radius: 50%; background: var(--fundo); display: grid; place-items: center; flex: none; color: var(--menu); }
.linha-tempo .ic svg { width: 15px; height: 15px; }
.linha-tempo small { color: var(--texto-suave); }
.linha-tempo .t-nota .ic { background: var(--nota); }
.nota-form { display: flex; gap: 8px; align-items: flex-start; }
.nota-form textarea { min-height: 48px; }

/* agenda */
.nav-semana { display: flex; align-items: center; gap: 6px; }
.dia-agenda { border-top: 1px solid var(--borda); padding: 12px 0; }
.dia-agenda h3 { margin: 0 0 6px; font-size: 15px; text-transform: capitalize; }
.dia-agenda h3 > span:not(.chip) { color: var(--texto-suave); font-weight: 500; }
.dia-agenda.hoje { background: color-mix(in srgb, var(--destaque) 7%, #fff); margin: 0 -12px; padding: 12px; border-radius: 12px; border-top-color: transparent; }
.visita-item { display: flex; gap: 12px; padding: 10px 0; align-items: flex-start; }
.visita-item .hora { width: 52px; font-weight: 700; color: var(--menu); font-size: 14px; flex: none; }
.acoes-visita { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; max-width: 260px; }
.atrasadas { background: #fde8e8; border-radius: 14px; padding: 4px 14px 8px; margin-bottom: 12px; }
.atrasadas h3 { color: #8a1f1f; margin: 10px 0 0; font-size: 15px; }

/* relatorios */
.barras { display: flex; gap: 6px; align-items: flex-end; height: 210px; overflow-x: auto; padding-top: 8px; }
.barra-col { flex: 1 0 54px; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.barra-col .col { flex: 1; width: 100%; max-width: 44px; display: flex; flex-direction: column-reverse; background: var(--fundo); border-radius: 8px 8px 0 0; overflow: hidden; }
.barra-col i { display: block; width: 100%; }
.barra-col i.ind, .leg.ind { background: var(--destaque); }
.barra-col i.prop, .leg.prop { background: var(--amarelo); }
.barra-col .v { font-size: 11px; font-weight: 700; color: var(--menu); }
.barra-col .m { font-size: 11px; color: var(--texto-suave); text-align: center; line-height: 1.2; }
.leg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.funil-barras { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.fb { display: grid; grid-template-columns: 140px 1fr 60px; gap: 10px; align-items: center; font-size: 14px; }
.fb .trilho-b { background: var(--fundo); border-radius: 999px; height: 14px; overflow: hidden; }
.fb .trilho-b i { display: block; height: 100%; background: var(--destaque); border-radius: 999px; min-width: 2px; }
.fb .trilho-b i.venda { background: var(--ok); }
.fb b { text-align: right; }

/* dados / equipe */
fieldset.pergunta { border: 1px solid var(--borda); border-radius: 12px; padding: 12px 16px; margin: 14px 0 0; display: flex; flex-direction: column; gap: 8px; }
fieldset.pergunta legend { font-weight: 700; font-size: 14px; padding: 0 6px; }
.grupo-dup { border: 1px solid var(--borda); border-radius: 14px; padding: 12px 14px; margin: 10px 0; }
.grupo-dup.alerta { border-color: #f2b8b8; background: #fff8f8; }
.pessoa-dup { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--borda); }
.linha-login { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--borda); }
.opcao-login { font-size: 13px; text-align: center; margin-top: 14px; }
.opcao-login a { cursor: pointer; }

@media (max-width: 820px) {
  .kpis { display: flex; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .kpis .kpi { flex: 0 0 150px; }
  .kpi b { font-size: 22px; }
  .gaveta.larga { width: 100%; }
  .grade-campos, .cupons-duplo { grid-template-columns: 1fr; }
  .fb { grid-template-columns: 100px 1fr 50px; }
  .visita-item { flex-wrap: wrap; }
  .acoes-visita { max-width: none; justify-content: flex-start; }
  .nome-presc { max-width: 52vw; }
  .filtros .campo { flex: 1 1 140px; }
}

.aviso-inscricao { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; border-radius: 14px; padding: 12px 16px; margin-bottom: 12px; background: #fff3cd; color: #6b5200; font: inherit; cursor: pointer; }
.aviso-inscricao:hover { filter: brightness(.97); }
.aviso-inscricao svg { width: 20px; height: 20px; }
.tabela-parcerias td, .tabela-parcerias th { white-space: nowrap; }
.var-positiva { color: var(--ok); font-weight: 700; }
.var-negativa { color: var(--perigo); font-weight: 700; }
.decisao { background: #fff3cd; border-radius: 14px; padding: 12px 14px; margin: 0 0 14px; color: #5e4a00; }
a.btn { text-decoration: none; }
.grade-2 > .bloco { min-width: 0; }

/* Ficha: linha original das planilhas antigas */
.bloco-planilha { background: var(--fundo); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.bloco-planilha .linha-acoes { gap: 8px; flex-wrap: wrap; }
.dados-planilha { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 6px 12px; margin: 10px 0 0; font-size: 13px; }
.dados-planilha dt { color: var(--texto-suave); font-weight: 600; overflow-wrap: anywhere; }
.dados-planilha dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }

/* Graficos de pizza (relatorios) */
.pizzas { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; }
.pizza { display: flex; gap: 14px; align-items: center; }
.pizza svg { width: 132px; height: 132px; flex: none; }
.pizza svg [data-fatia] { cursor: pointer; transition: opacity .15s; }
.pizza svg [data-fatia]:hover { opacity: .8; }
.pizza ul { list-style: none; margin: 0; padding: 0; font-size: 13px; display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.pizza li { display: flex; align-items: center; gap: 7px; }
.pizza li[data-fatia] { cursor: pointer; }
.pizza li[data-fatia]:hover span { text-decoration: underline; }
.pizza li i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.pizza li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pizza li b { font-variant-numeric: tabular-nums; }
.pizza li small { color: var(--texto-suave); width: 36px; text-align: right; }
@media (max-width: 420px) { .pizza { flex-direction: column; align-items: stretch; } .pizza svg { align-self: center; } }

/* Envios: campos pequenos dentro das tabelas */
.campo-mini { padding: 6px 8px; font-size: 13px; border-radius: 8px; width: auto; min-width: 0; }
.tabela-envios td { vertical-align: top; }

/* Barra de periodo (relatorios) e de mes (parcerias) */
.barra-periodo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.barra-periodo .campo { width: auto; }
.barra-periodo #datas-livres { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.barra-periodo #datas-livres.oculto { display: none; }

/* Ficha: ha quantos dias foi a visita / o envio */
.tempo-ficha { display: inline-block; font-size: 13px; font-weight: 600; color: var(--menu); background: color-mix(in srgb, var(--menu) 10%, transparent); border-radius: 999px; padding: 3px 10px; margin: 0 0 8px; }

/* Responder citando uma mensagem (igual ao WhatsApp) */
.bolha { position: relative; }
.btn-responder { position: absolute; top: 4px; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--borda); background: #fff; color: var(--texto-suave); display: grid; place-items: center; opacity: 0; transition: opacity .15s; cursor: pointer; padding: 0; }
.btn-responder svg { width: 15px; height: 15px; }
.bolha.entrada .btn-responder { right: -34px; }
.bolha.saida .btn-responder { left: -34px; }
.bolha:hover .btn-responder, .btn-responder:focus-visible { opacity: 1; }
@media (hover: none) { .btn-responder { opacity: .75; } }
.citacao { display: flex; flex-direction: column; gap: 1px; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--menu); background: rgba(0,0,0,.05); border-radius: 8px; padding: 5px 8px; margin: 0 0 6px; font: inherit; font-size: 12.5px; cursor: pointer; color: inherit; }
.citacao b { color: var(--menu); font-size: 12px; }
.citacao span, .respondendo span { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.respondendo { display: flex; align-items: center; gap: 8px; border-left: 3px solid var(--menu); background: rgba(0,0,0,.04); border-radius: 8px; padding: 6px 8px; margin: 0 0 8px; font-size: 13px; }
.respondendo > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.respondendo b { color: var(--menu); font-size: 12px; }
.respondendo svg { width: 16px; height: 16px; flex: none; color: var(--menu); }
.bolha.piscar { animation: piscar-bolha 1.4s ease; }
@keyframes piscar-bolha { 0%, 100% { box-shadow: none; } 30% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--menu) 45%, transparent); } }

/* Aviso de versao nova */
.aviso-versao { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 1000; display: flex; align-items: center; gap: 12px;
  background: var(--menu); color: #fff; padding: 10px 12px 10px 16px; border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.18); font-size: 14px; max-width: calc(100vw - 32px); }
.aviso-versao .btn { background: #fff; color: var(--menu); }
@media (min-width: 900px) { .aviso-versao { bottom: 24px; } }

/* Alternador de duas opcoes fora da caixa de texto (ex.: Adicionar parceira) */
.alternar:not(.composer .alternar) { display: inline-flex; background: var(--fundo); border-radius: 999px; padding: 3px; }
.alternar:not(.composer .alternar) button { border: 0; background: transparent; border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600; color: var(--texto-suave); cursor: pointer; }
.alternar:not(.composer .alternar) button.ativo { background: #fff; color: var(--menu); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* Periodo dos relatorios: botoes a vista (em vez de uma caixinha) */
.bloco-periodo { padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; }
.linha-periodo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.linha-periodo > b { flex: 0 0 62px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--texto-suave); }
.linha-periodo.oculto { display: none; }
.linha-periodo .campo { width: auto; }
.chips-escolha { display: flex; gap: 6px; flex-wrap: wrap; }
.chips-escolha button { border: 1px solid var(--borda); background: #fff; border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600; color: var(--texto-suave); cursor: pointer; }
.chips-escolha button:hover { border-color: var(--menu); color: var(--menu); }
.chips-escolha button.ativo { background: var(--menu); border-color: var(--menu); color: #fff; }
@media (max-width: 720px) { .linha-periodo > b { flex-basis: 100%; } .linha-periodo .dica { margin-left: 0 !important; } }

/* Pizzas maiores, cada uma no seu cartao */
.pizzas { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.cartao-pizza { border: 1px solid var(--borda); border-radius: 14px; padding: 4px 16px 16px; min-width: 0; }
.cartao-pizza h3.sec { margin-top: 12px; }
.pizza svg { width: 168px; height: 168px; }
@media (max-width: 420px) { .pizzas { grid-template-columns: 1fr; } }

.tabela tr.linha-total td { background: var(--fundo); }
.var-sobe { color: #1f8a4c; font-weight: 700; }
.var-desce { color: var(--perigo); font-weight: 700; }
.aviso-bloco { background: #fff8e1; box-shadow: none; border: 1px solid #f1d98a; padding: 12px 16px; font-size: 14px; }

.atalhos-relatorio { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: -6px 0 14px; font-size: 13px; color: var(--texto-suave); }
.atalhos-relatorio button { border: 0; background: none; color: var(--menu); font-weight: 700; font-size: 13px; text-decoration: underline; cursor: pointer; padding: 2px 4px; }

/* Conteudos das parceiras (Instagram) */
.grade-midias { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.midia { background: #fff; border: 1px solid var(--borda); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.midia .quadro { position: relative; aspect-ratio: 4 / 5; background: #14132b; display: flex; align-items: center; justify-content: center; }
.midia .quadro img, .midia .quadro video { width: 100%; height: 100%; object-fit: cover; display: block; }
.midia .quadro .sem-previa { color: #fff; font-size: 13px; text-align: center; padding: 12px; }
.midia .selo { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 3px 9px; }
.midia .selo.cita { left: auto; right: 8px; background: #1f8a4c; }
.midia .info { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.midia .info .legenda { color: var(--texto-suave); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.midia .info a { color: var(--menu); font-weight: 700; text-decoration: none; }
.passos-insta { margin: 8px 0 14px; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.passos-insta code { background: var(--fundo); border-radius: 6px; padding: 1px 6px; font-size: 12px; }

/* Melhores clientes: quadradinhos para escolher quem vai na planilha */
.col-marca { width: 34px; padding-right: 0 !important; }
.col-marca input { width: 17px; height: 17px; cursor: pointer; accent-color: var(--menu); }
.barra-selecao { display: none; align-items: center; gap: 10px; flex-wrap: wrap; background: color-mix(in srgb, var(--menu) 8%, #fff); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; font-weight: 600; font-size: 14px; }
.barra-selecao.ativa { display: flex; position: sticky; top: 0; z-index: 5; }

/* Vendas > Entregas: o cartao do filtro escolhido fica marcado. */
button.kpi.kpi-filtro.ativo { outline: 2px solid var(--destaque); }

/* Funil: quadro kanban de clientes. */
.funil-pagina { display: flex; flex-direction: column; }
.kanban { display: flex; gap: 14px; overflow-x: auto; flex: 1; min-height: 320px; padding-bottom: 12px; align-items: stretch; }
.kanban-coluna { flex: none; width: 290px; max-width: 84vw; background: color-mix(in srgb, var(--cor) 7%, #fff); border-radius: 16px; border-top: 4px solid var(--cor); display: flex; flex-direction: column; max-height: 100%; }
.kanban-coluna.alvo { outline: 2px dashed var(--cor); outline-offset: -4px; }
.kanban-coluna header { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; }
.kanban-coluna header b { flex: 1; }
.kanban .num { font-size: 12px; font-weight: 700; background: #fff; border-radius: 999px; padding: 2px 9px; color: var(--texto-suave); }
.kanban .num.novas { background: var(--destaque); color: #fff; margin-left: auto; }
.kanban-lista { padding: 4px 10px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
.kanban-lista .vazio { text-align: center; margin: 18px 0; }
.kanban-cartao { background: #fff; border-radius: 12px; padding: 10px 12px; box-shadow: var(--sombra); cursor: grab; display: flex; flex-direction: column; gap: 6px; }
.kanban-cartao.arrastando { opacity: .45; }
.kanban-cartao .quem { display: flex; align-items: center; gap: 8px; min-width: 0; }
.kanban-cartao .quem > div:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.kanban-cartao .quem b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kanban-cartao small { color: var(--texto-suave); font-size: 12px; }
.kanban-cartao .etqs { display: flex; flex-wrap: wrap; gap: 4px; }
.linha-coluna { display: flex; gap: 6px; align-items: center; margin-top: 8px; }

/* Figurinha do WhatsApp dentro da conversa. */
.bolha img.figurinha { width: 132px; height: 132px; object-fit: contain; border-radius: 0; background: transparent; }

/* Menu do botao direito nas conversas. */
.popover .op:disabled { opacity: .5; cursor: default; background: transparent; }

/* Telas agrupadas num icone do menu: abas fixas no topo e a tela rolando embaixo. */
.com-abas { height: 100%; display: flex; flex-direction: column; }
.grupo-abas { flex: none; margin: 0; padding: 20px clamp(16px, 4vw, 48px) 0; }
.tela-grupo { flex: 1; min-height: 0; }
.tela-grupo .pagina { padding-top: 16px; }

/* Agenda em grade (semana): colunas por dia, linhas por hora. */
.cal { border: 1px solid var(--borda); border-radius: 14px; overflow: hidden; background: #fff; }
.cal-topo, .cal-corpo { display: grid; grid-template-columns: 54px repeat(7, minmax(0, 1fr)); }
.cal-topo { border-bottom: 1px solid var(--borda); }
.cal-dia { text-align: center; padding: 8px 0; border-left: 1px solid var(--borda); }
.cal-dia span { display: block; font-size: 11px; text-transform: uppercase; color: var(--texto-suave); font-weight: 600; }
.cal-dia b { font-size: 19px; display: inline-block; width: 34px; line-height: 34px; border-radius: 50%; }
.cal-dia.hoje b { background: var(--menu); color: #fff; }
.cal-corpo { max-height: 62vh; overflow-y: auto; }
.cal-horas div { height: var(--altura); font-size: 11px; color: var(--texto-suave); text-align: right; padding: 2px 8px 0 0; }
.cal-col { position: relative; border-left: 1px solid var(--borda); cursor: cell;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--altura) - 1px), var(--borda) calc(var(--altura) - 1px), var(--borda) var(--altura)); }
.cal-col.hoje { background-color: color-mix(in srgb, var(--destaque) 6%, #fff); }
.cal-col:hover { background-color: color-mix(in srgb, var(--menu) 4%, #fff); }
.cal-bloco { position: absolute; right: 3px; height: calc(var(--altura) - 4px); border: 0; border-left: 3px solid var(--cor); border-radius: 7px;
  background: color-mix(in srgb, var(--cor) 16%, #fff); color: var(--texto); font: inherit; font-size: 12px; line-height: 1.25; text-align: left;
  padding: 4px 6px; overflow: hidden; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.cal-bloco:hover { background: color-mix(in srgb, var(--cor) 28%, #fff); }
.cal-bloco span { color: var(--texto-suave); font-size: 11px; }
.cal-agora { position: absolute; left: 0; right: 0; height: 2px; background: #d64545; pointer-events: none; }
.cal-agora::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #d64545; }

/* Agenda do mes inteiro. */
.mes-topo, .mes-corpo { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.mes-topo div { text-align: center; padding: 8px 0; font-size: 11px; text-transform: uppercase; font-weight: 600; color: var(--texto-suave); border-bottom: 1px solid var(--borda); }
.mes-dia { min-height: 104px; padding: 6px; border-right: 1px solid var(--borda); border-bottom: 1px solid var(--borda); cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.mes-dia:nth-child(7n) { border-right: 0; }
.mes-dia:hover { background: color-mix(in srgb, var(--menu) 4%, #fff); }
.mes-dia > b { font-size: 13px; width: 26px; line-height: 26px; text-align: center; border-radius: 50%; }
.mes-dia.fora > b { color: #b3b3c4; font-weight: 500; }
.mes-dia.hoje > b { background: var(--menu); color: #fff; }
.mes-visita { border: 0; border-left: 3px solid var(--cor, #999); border-radius: 6px; background: color-mix(in srgb, var(--cor, #999) 16%, #fff); color: var(--texto);
  font: inherit; font-size: 12px; text-align: left; padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.mes-visita:hover { background: color-mix(in srgb, var(--cor, #999) 30%, #fff); }
.mes-visita.mais { border-left-color: transparent; background: transparent; color: var(--texto-suave); }

/* Pedir edicao de arte */
.ed-soltar { margin-top: 14px; border: 2px dashed var(--borda); border-radius: 12px; padding: 18px; text-align: center; color: var(--texto-suave); font-size: 14px; }
.ed-soltar.ativo { border-color: var(--destaque); background: color-mix(in srgb, var(--destaque) 8%, transparent); }
.ed-escolher { color: var(--destaque); text-decoration: underline; cursor: pointer; }
.ed-grade { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.ed-grade img { width: 120px; height: 150px; object-fit: cover; border-radius: 8px; border: 1px solid var(--borda); display: block; }
.ed-prontas > div { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.ed-prontas img { width: 220px; height: auto; max-height: 390px; object-fit: contain; background: var(--fundo); }
.ed-mini { position: relative; }
.ed-mini img { width: 90px; height: 110px; }
.ed-tirar { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--perigo); color: #fff; cursor: pointer; line-height: 1; }
.ed-legenda { white-space: pre-wrap; background: var(--fundo); padding: 10px 12px; border-radius: 10px; margin: 0 0 8px; font-size: 14px; }
@media (max-width: 600px) { .ed-prontas img { width: 100%; } }

/* Black November: disparos agendados (28/10/2026) */
.bk-resumo { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-top: 14px; }
.bk-resumo > div { background: var(--fundo); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.bk-resumo small { color: var(--texto-suave); font-size: 12px; }
.bk-resumo strong { font-size: 18px; }
.bk-linha { display: grid; grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1.1fr) auto; gap: 12px; align-items: start; padding: 10px 0; border-top: 1px solid var(--borda); }
.bk-linha:first-of-type { border-top: 0; }
.bk-hora { font-weight: 800; font-variant-numeric: tabular-nums; padding-top: 2px; }
.bk-meio { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bk-meio .dica { margin: 0; }
.bk-acoes { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.bk-hoje { outline: 2px solid var(--amarelo, #F7C328); }
.bk-passou { opacity: .75; }
.bk-msg { background: var(--fundo); border-left: 3px solid #25D366; border-radius: 8px; padding: 8px 10px; font-size: 13px; line-height: 1.45; white-space: pre-wrap; min-width: 0; }
.bk-msg span { display: block; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--texto-suave); margin-bottom: 2px; }
.bk-mini { font-size: 11px; opacity: .8; }
@media (max-width: 900px) { .bk-linha { grid-template-columns: 48px minmax(0, 1fr); } .bk-msg, .bk-acoes { grid-column: 2; } .bk-acoes { justify-content: flex-start; } }
.bk-abas { margin-bottom: 4px; }
.bk-graf-topo { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-end; margin: 10px 0 6px; }
.bk-graf-topo > div { display: flex; flex-direction: column; }
.bk-graf-topo small { color: var(--texto-suave); font-size: 12px; }
.bk-graf-topo strong { font-size: 20px; }
.bk-legenda { flex-direction: row !important; gap: 14px; margin-left: auto; font-size: 12px; color: var(--texto-suave); }
.bk-legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.bk-graf { overflow-x: auto; }
.bk-texto textarea { width: 100%; margin: 8px 0; }
.bk-graf svg { width: auto; height: auto; stroke: none; stroke-width: 0; max-width: none; }
.bk-graf svg line { stroke: #D9DAE6; stroke-width: 1; }

/* Gravar audio (30/10/2026) */
.icone-btn.gravando { color: #d64545; }
.ponto-gravando { width: 8px; height: 8px; border-radius: 50%; background: #d64545; display: inline-block; animation: piscar-gravando 1s infinite; }
@keyframes piscar-gravando { 50% { opacity: .2; } }
