:root {
  --green-900: #14342a;
  --green-800: #1c4a3b;
  --green-700: #235a48;
  --green-600: #2d6a55;
  --green-500: #3a8a6e;
  --green-50: #eef5f3;
  --bg: #f4faf8;
  --card: #ffffff;
  --ink: #1d2b27;
  --muted: #6b7d77;
  --line: #e2ece8;
  --red: #d9534f;
  --amber: #e0a800;
  --roxo: #6b3bff;        /* roxo da marca Webiia */
  --barra: #12141a;       /* barra lateral: preto, não verde — o roxo da marca
                             sobre o verde dava 1.77:1 de contraste (reprova) */
  --radius: 12px;
  --shadow: 0 1px 3px rgba(20, 52, 42, 0.08), 0 1px 2px rgba(20, 52, 42, 0.04);
}
* { box-sizing: border-box; }
/* [hidden] PRECISA vencer qualquer display do CSS. Já me mordeu duas vezes:
   o botão de gravar ficava junto do enviar (.lc-ico usa grid) e o campo WABA
   continuava visível na conexão do Instagram (label.fld usa block). Regra
   geral em vez de remendo por seletor. */
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}
a { color: var(--green-600); text-decoration: none; }

.layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 210px; background: var(--barra); color: #a9b0bd;
  display: flex; flex-direction: column; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
}
.brand { padding: 18px 20px; font-weight: 800; font-size: 18px; color: #fff; letter-spacing: .5px;
  display: flex; align-items: baseline; gap: 7px; }
.brand span { color: var(--green-500); }
/* a arte tem 1125x365; travo pela ALTURA pra o "ii" não virar borrão */
.brand-img { height: 21px; width: auto; display: block; }
.brand em { font-style: normal; font-weight: 700; font-size: 15px; color: #fff; opacity: .92; }
.nav { flex: 1; padding: 8px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin: 2px 0;
  border-radius: 8px; font-weight: 500; cursor: pointer;
}
.nav a { color: #a9b0bd; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: var(--roxo); color: #fff; }
.nav .ico { width: 18px; text-align: center; opacity: .9; }
.sidebar .foot { padding: 14px 18px; font-size: 12px; color: #7b8395; border-top: 1px solid rgba(255,255,255,.08); }

/* Main */
.main { flex: 1; padding: 26px 32px; max-width: 1200px; }
.page-head { margin-bottom: 22px; }
.page-head h1 { margin: 0 0 4px; font-size: 22px; }
.page-head p { margin: 0; color: var(--muted); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* Cards / KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.kpi .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.kpi .val { font-size: 28px; font-weight: 800; margin-top: 6px; color: var(--green-800); }
.kpi .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px; }
.card h2 { margin: 0 0 12px; font-size: 16px; }

/* Buttons */
.btn { background: var(--green-600); color: #fff; border: none; padding: 9px 16px; border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 13px; }
.btn:hover { background: var(--green-700); }
.btn.ghost { background: #fff; color: var(--green-700); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--green-50); }
.btn.danger { background: #fff; color: var(--red); border: 1px solid #f0c9c7; }
.btn.sm { padding: 6px 10px; font-size: 12px; }

/* Inputs */
input[type=text], input[type=password], select, textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font-size: 13px; font-family: inherit;
  background: #fff; color: var(--ink); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(58,138,110,.12); }
label.fld { display: block; margin-bottom: 12px; }
label.fld span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }

/* Table */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); }
tr:hover td { background: var(--green-50); }

/* Badges / pills */
.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.pill.green { background: #e3f3ec; color: var(--green-700); }
.pill.gray { background: #eef1f0; color: var(--muted); }
.pill.red { background: #fbe6e5; color: var(--red); }
.pill.amber { background: #fcf3d6; color: #8a6d00; }
.tag { display: inline-block; background: var(--green-50); color: var(--green-700); border: 1px solid var(--line); padding: 2px 8px; border-radius: 999px; font-size: 11px; margin: 2px 3px 2px 0; }

/* Toggle */
.toggle { position: relative; width: 40px; height: 22px; background: #cdd6d2; border-radius: 999px; cursor: pointer; transition: .2s; flex-shrink: 0; }
.toggle.on { background: var(--green-500); }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: .2s; }
.toggle.on::after { left: 20px; }

/* Modal */
.overlay { position: fixed; inset: 0; background: rgba(20,40,33,.45); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { background: #fff; border-radius: 14px; padding: 22px; width: 460px; max-width: 92vw; max-height: 88vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal h3 { margin: 0 0 14px; }

/* Toast */
.toast { position: fixed; bottom: 22px; right: 22px; background: var(--green-800); color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: var(--shadow); z-index: 60; opacity: 0; transform: translateY(8px); transition: .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.err { background: var(--red); }

/* Live Chat */
/* O Live Chat e a unica tela que GANHA com espaco: mais conversa visivel sem
   rolar. O resto do painel mantem os 1200px, que e largura de leitura — tabela
   esticada em monitor largo fica com a ultima coluna a um palmo da primeira. */
body[data-rota="livechat"] .main { max-width: none; }
.lc { display: grid; grid-template-columns: 320px 1fr; gap: 14px; height: calc(100vh - 150px); }
@media (min-width: 1500px) { .lc { grid-template-columns: 380px 1fr; } }
@media (min-width: 1900px) { .lc { grid-template-columns: 420px 1fr; } }
/* coluna da lista: busca fixa em cima, lista rolando embaixo */
.lc-col { display: flex; flex-direction: column; min-height: 0; gap: 8px; }
.lc-search { position: relative; display: flex; align-items: center; }
.lc-search .lupa { position: absolute; left: 11px; font-size: 13px; opacity: .55; pointer-events: none; }
.lc-search input { width: 100%; padding: 9px 34px 9px 32px; border-radius: 10px; font-size: 13px; }
.lc-search button { position: absolute; right: 6px; width: 24px; height: 24px; border: 0; border-radius: 50%;
  background: var(--line); color: var(--muted); cursor: pointer; font-size: 11px; line-height: 1; }
.lc-search button:hover { background: var(--green-700); color: #fff; }
.lc-trecho { font-size: 11.5px; color: var(--green-700); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; margin-top: 2px; }
.lc-list { overflow-y: auto; padding: 6px; flex: 1; min-height: 0; }
.lc-item { padding: 10px 12px; border-radius: 8px; cursor: pointer; border-bottom: 1px solid var(--line); }
.lc-item:hover { background: var(--green-50); }
.lc-item.active { background: var(--green-50); box-shadow: inset 3px 0 0 var(--green-500); }
.lc-chat { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.lc-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: baseline; }
.lc-body { flex: 1; overflow-y: auto; padding: 18px; background: #f3f6f5; display: flex; flex-direction: column; gap: 8px; }
/* teto em px alem da porcentagem: em monitor largo, 70% vira uma linha de texto
   larga demais pra ler de um folego (o olho perde a proxima linha) */
.bubble { max-width: min(70%, 640px); padding: 7px 11px 6px; border-radius: 10px; position: relative;
  font-size: 13px; line-height: 1.4; word-break: break-word;
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: flex-end; column-gap: 9px; }
.bcorpo { flex: 1 1 auto; min-width: 0; white-space: pre-wrap; }
.bubble.in { align-self: flex-start; background: #fff; border: 1px solid var(--line); }
.bubble.out { align-self: flex-end; background: #d7f2e3; }
/* estático (não mais absolute): o horário ocupa espaço real e o texto curto
   nunca mais passa por baixo dele */
.bubble .bmeta { flex: 0 0 auto; margin-left: auto; font-size: 10px; color: var(--muted);
  white-space: nowrap; line-height: 1.6; }
/* lido: o mesmo azul do WhatsApp, pra leitura ser imediata pra quem já usa */
.bubble .bmeta .lido { color: #34b7f1; font-weight: 700; }
/* envio que a Meta recusou: a pessoa NÃO recebeu — não pode parecer entregue */
.bubble.falhou { background: #fdf0ef; border: 1px dashed #e0a49f; opacity: .9; }
.bubble.falhou .bmeta { color: #c0392b; font-weight: 700; }
.lc-compose { display: flex; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); align-items: center; }
.lc-compose input[type=text] { flex: 1; }
.lc-compose input[type=text]:disabled { background: #f4f5f6; cursor: not-allowed; }

/* botões redondos da barra (clipe, mic, template, enviar) */
.lc-ico { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer; transition: .15s; padding: 0; }
.lc-ico:hover:not(:disabled) { background: #f2f5f4; color: var(--ink); }
/* (o [hidden] global no topo já cobre isto — mantido por clareza)
   aparecem os dois ao mesmo tempo. */
.lc-ico[hidden] { display: none; }
.lc-ico:disabled { opacity: .4; cursor: not-allowed; }
.lc-ico.wa { color: #25d366; border-color: #25d36644; }
.lc-ico.wa:hover:not(:disabled) { background: #25d3661a; color: #1da851; }
/* janela fechada: o template é o ÚNICO caminho — o botão chama atenção sozinho */
.lc-ico.wa.pulse { background: #25d3661f; animation: wapulse 2s ease-in-out infinite; }
@keyframes wapulse { 0%,100% { box-shadow: 0 0 0 0 #25d36655; } 50% { box-shadow: 0 0 0 6px #25d36600; } }
.lc-ico.send { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.lc-ico.send:hover { filter: brightness(1.08); }
.lc-ico.danger:hover { background: #fdecec; color: #c0392b; border-color: #e7bcbc; }

/* barra em modo gravação */
.lc-compose.rec { gap: 10px; }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: #e74c3c; animation: recblink 1.1s steps(2) infinite; }
.lc-compose.pausado .rec-dot { animation: none; opacity: .45; }
@keyframes recblink { 50% { opacity: .15; } }
.rec-time { font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 600; min-width: 38px; }
.rec-wave { flex: 1; display: flex; align-items: center; gap: 3px; height: 22px; overflow: hidden; }
/* altura vem do JS (volume medido no microfone) — sem animacao em loop, que
   subia e descia igual no silencio e dava falsa sensacao de que estava captando */
.rec-wave { gap: 2px; }
.rec-wave i { flex: 1; min-width: 2px; background: var(--green-600); border-radius: 2px; height: 6%;
  transition: height .06s linear; }
.lc-compose.pausado .rec-wave i { background: var(--muted); opacity: .55; }

/* bolha de midia que falhou: largura minima, senao vira uma tirinha vertical */
.bubble.midia { min-width: 190px; }
.bmedia-erro { background: #f5f7f6; border: 1px dashed var(--line); border-radius: 8px;
  padding: 18px 12px; text-align: center; font-size: 12px; color: var(--muted); }

/* Partes da sequência (editor de fluxo): arrastáveis pela alça */
.parte { border: 1px solid var(--line); border-radius: 10px; padding: 9px; margin-bottom: 7px;
  background: var(--green-50); }
.parte-top { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.parte .alca { cursor: grab; color: var(--muted); font-size: 14px; line-height: 1; user-select: none;
  padding: 2px 3px; border-radius: 5px; }
.parte .alca:hover { background: #ffffffcc; color: var(--green-700); }
.parte .alca:active { cursor: grabbing; }
.parte.arrastando { opacity: .45; }
/* a linha marca ONDE vai cair — sem isso o arrasto é adivinhação */
.parte.alvo-cima { box-shadow: 0 -3px 0 -1px var(--green-500); }
.parte.alvo-baixo { box-shadow: 0 3px 0 -1px var(--green-500); }

/* mensagem final: mesmo cartao das partes, mas em branco pra sinalizar que ela
   e a que fecha (e a unica que leva botoes) */
.parte-fim { background: #fff; border-color: #cfe0d9; margin-top: 8px; }
.parte-fim textarea { width: 100%; }
.parte-fim .cnt { font-style: normal; font-size: 11px; color: var(--muted); }

/* Papeis e permissoes */
.papel { border: 1px solid var(--line); border-radius: 11px; padding: 12px 13px; margin-bottom: 10px; }
.papel-top { display: flex; align-items: center; gap: 8px; }
.papel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 9px; }
.papel-rc { display: flex; align-items: flex-start; gap: 8px; padding: 7px 9px; border: 1px solid var(--line);
  border-radius: 9px; cursor: pointer; background: #fbfdfc; }
.papel-rc:hover { border-color: var(--green-500); }
.papel-rc input { margin-top: 2px; flex: 0 0 auto; }
.papel-rc span { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.papel-rc b { font-size: 12.5px; }
.papel-rc em { font-style: normal; font-size: 11px; color: var(--muted); }
@media (max-width: 620px) { .papel-grid { grid-template-columns: 1fr; } }

/* Lista de sequências prontas (⚡ no Live Chat) */
.seq-i { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 13px; margin-bottom: 7px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer;
  text-align: left; font: inherit; transition: .12s; }
.seq-i:hover:not(:disabled) { border-color: var(--green-500); background: var(--green-50); }
.seq-i:disabled { opacity: .5; cursor: default; }
.seq-i[data-ja] { border-style: dashed; }
.seq-n { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.seq-n b { font-size: 13.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seq-n em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.seq-go { flex: 0 0 auto; font-size: 12px; font-weight: 700; color: var(--green-700); }

/* ---------- Cartão de conta (rodapé da barra lateral) ---------- */
.conta { display: flex; flex-direction: column; gap: 7px; }
.conta-eu { display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px; border: 0;
  border-radius: 9px; background: transparent; cursor: pointer; text-align: left; font: inherit; }
.conta-eu:hover:not(:disabled) { background: rgba(255,255,255,.07); }
.conta-eu:disabled { cursor: default; }
.conta-av { flex: 0 0 30px; height: 30px; border-radius: 50%; background: var(--roxo); color: #fff;
  display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 13px; }
.conta-txt { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.conta-txt b { color: #fff; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conta-txt em { font-style: normal; font-size: 11px; color: #7b8395; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.conta-linha { display: flex; align-items: center; gap: 6px; padding: 0 6px; }
.conta-inst { font-size: 10.5px; color: #7b8395; text-transform: uppercase; letter-spacing: .05em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 92px; }
.conta-plano { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  background: var(--roxo); color: #fff; border-radius: 999px; padding: 2px 8px; }
.conta-plano.off { background: rgba(255,255,255,.12); color: #8fb3a7; }
.conta-linha a { color: #a9b0bd; cursor: pointer; text-decoration: underline; font-size: 11.5px; }
.conta-plano-box { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--green-50); }

.plano-alerta { background: #fcf3d6; color: #8a6d00; border-radius: 9px; padding: 9px 11px;
  font-size: 12.5px; margin-bottom: 9px; }
.plano-alerta.ruim { background: #fbe6e5; color: #a03430; }

/* ---------- Agenda: dias, faixas de horário e períodos ---------- */
/* Dias da semana: o checkbox nativo dava um respingo azul do sistema no meio
   da paleta verde e a área de clique era só o quadradinho. Vira botão. */
.dias-sem { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.dias-sem .dia { cursor: pointer; user-select: none; }
.dias-sem .dia input { position: absolute; opacity: 0; width: 0; height: 0; }
.dias-sem .dia span { display: inline-block; min-width: 46px; text-align: center; padding: 7px 12px;
  border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; font-weight: 600;
  color: var(--muted); background: #fff; transition: .12s; }
.dias-sem .dia:hover span { border-color: var(--green-500); color: var(--green-700); }
.dias-sem .dia:has(input:checked) span { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.dias-sem .dia:focus-within span { box-shadow: 0 0 0 3px rgba(58,138,110,.16); }

/* Faixa de horário / período bloqueado: uma linha só, com respiro e o remover
   discreto à direita (antes era um botão do mesmo peso do resto, colado). */
.faixa { display: flex; align-items: center; gap: 9px; padding: 7px 9px; margin-bottom: 6px;
  border: 1px solid var(--line); border-radius: 10px; background: #fbfdfc; }
.faixa:hover { border-color: #cfe0d9; }
.faixa input[type=time], .faixa input[type=date] { width: auto; min-width: 116px; flex: 0 0 auto;
  font-variant-numeric: tabular-nums; }
.faixa .ate { font-size: 12.5px; color: var(--muted); flex: 0 0 auto; }
.faixa .lixo { flex: 0 0 auto; width: 26px; height: 26px; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; line-height: 1; }
.faixa .lixo:hover { background: #fbe6e5; color: var(--red); }

.lc-mais { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 17px;
  padding: 2px 7px; border-radius: 7px; line-height: 1; }
.lc-mais:hover { background: var(--green-50); color: var(--green-700); }

/* Menu da mensagem: a setinha só aparece no hover, pra não poluir a conversa */
.bubble { position: relative; }
.bmenu { position: absolute; top: 2px; right: 3px; width: 20px; height: 18px; border: 0;
  border-radius: 5px; background: #ffffffcc; color: var(--muted); cursor: pointer;
  font-size: 11px; line-height: 1; opacity: 0; transition: .12s; padding: 0; }
.bubble.out .bmenu { background: #c8ead9cc; }
.bubble:hover .bmenu { opacity: 1; }
.bmenu:hover { color: var(--green-700); }
.msg-menu { position: fixed; z-index: 70; background: #fff; border: 1px solid var(--line);
  border-radius: 11px; box-shadow: 0 12px 30px rgba(20,52,42,.18); padding: 5px; min-width: 168px; }
.msg-menu button { display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 8px 11px; border-radius: 7px; cursor: pointer; font: inherit; font-size: 13px; color: var(--ink); }
.msg-menu button:hover { background: var(--green-50); }
.msg-menu-emo { display: flex; gap: 2px; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 5px; }
.msg-menu-emo button { width: auto; flex: 1; text-align: center; font-size: 17px; padding: 5px 0; }

/* Citação dentro da bolha */
.bcit { border-left: 3px solid var(--green-500); background: #00000008; border-radius: 5px;
  padding: 5px 8px; margin-bottom: 5px; font-size: 12px; line-height: 1.35; }
.bcit b { display: block; color: var(--green-700); font-size: 11.5px; }
.bubble.out .bcit { background: #ffffff5c; }

/* Barra de citação acima do campo */
.cit-bar { display: flex; align-items: center; gap: 9px; margin: 0 10px; padding: 8px 11px;
  background: var(--green-50); border-left: 3px solid var(--green-500);
  border-radius: 8px 8px 0 0; }
.cit-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.cit-txt b { font-size: 11.5px; color: var(--green-700); }
.cit-txt em { font-style: normal; font-size: 12px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cit-x { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 13px;
  padding: 3px 6px; border-radius: 6px; }
.cit-x:hover { background: #ffffff; color: var(--red); }

/* figurinha: menor e sem fundo, como no WhatsApp */
.bsticker { max-width: 132px; max-height: 132px; display: block; }
.bubble:has(.bsticker) { background: transparent !important; border: 0 !important; padding: 0 4px 2px; }
.bubble:has(.bsticker) .bmeta { color: var(--muted); }

/* Abas do painel de emoji + grade de figurinhas */
.emo-abas { display: flex; gap: 4px; margin-bottom: 8px; position: sticky; top: -10px;
  background: #fff; padding-top: 2px; z-index: 1; }
.emo-aba { flex: 1; border: 0; background: #f2f5f4; color: var(--muted); cursor: pointer;
  padding: 7px 10px; border-radius: 8px; font: inherit; font-size: 12px; font-weight: 600; }
.emo-aba.on { background: var(--green-600); color: #fff; }
.fig-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 2px 0 8px; }
.fig-i { position: relative; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 9px;
  overflow: hidden; background: #f7faf9; }
.fig-i img { width: 100%; height: 100%; object-fit: contain; cursor: pointer; display: block; }
.fig-i:hover { border-color: var(--green-500); }
.fig-x { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border: 0;
  border-radius: 50%; background: #ffffffe0; color: var(--red); cursor: pointer; font-size: 10px;
  line-height: 1; opacity: 0; transition: .12s; }
.fig-i:hover .fig-x { opacity: 1; }
.fig-add { aspect-ratio: 1; border: 1px dashed var(--line); border-radius: 9px; background: none;
  cursor: pointer; font-size: 20px; color: var(--muted); }
.fig-add:hover { border-color: var(--green-500); color: var(--green-700); background: var(--green-50); }

/* Visualizador de imagem na própria janela (como o WhatsApp Web) */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(12,26,21,.92);
  display: flex; align-items: center; justify-content: center; padding: 44px 24px; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.lightbox.fig img { max-width: 340px; max-height: 340px; }
.lb-fav { position: absolute; bottom: 42px; left: 50%; transform: translateX(-50%);
  background: var(--green-500); color: #fff; border: 0; border-radius: 999px;
  padding: 11px 22px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.lb-fav:hover:not(:disabled) { background: var(--green-600); }
.lb-fav:disabled { opacity: .75; cursor: default; }
.lb-x, .lb-dl { position: absolute; top: 14px; width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: #ffffff1f; color: #fff; cursor: pointer; font-size: 20px; line-height: 36px;
  text-align: center; text-decoration: none; }
.lb-x { right: 16px; }
.lb-dl { right: 60px; font-size: 17px; }
.lb-x:hover, .lb-dl:hover { background: #ffffff33; }

/* Respostas rápidas: lista que abre ACIMA da barra ao digitar "/" */
.qr-pop { position: absolute; left: 10px; right: 10px; bottom: calc(100% + 8px); z-index: 40;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden auto;
  max-height: 292px; box-shadow: 0 -8px 28px rgba(20,52,42,.14); }
.lc-compose { position: relative; }
.qr-head { display: flex; align-items: center; padding: 8px 12px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.qr-head span { flex: 1; }
.qr-edit { border: 0; background: none; cursor: pointer; font-size: 14px; color: var(--green-700);
  padding: 2px 6px; border-radius: 6px; }
.qr-edit:hover { background: var(--green-50); }
.qr-i { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 9px 12px; border: 0;
  background: none; cursor: pointer; text-align: left; font: inherit; border-bottom: 1px solid var(--line); }
.qr-i:last-child { border-bottom: 0; }
.qr-i:hover, .qr-i.on { background: var(--green-50); }
.qr-i b { font-size: 12.5px; color: var(--green-700); }
.qr-i em { font-style: normal; font-size: 12px; color: var(--muted); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.qr-vazio { padding: 12px; font-size: 12.5px; color: var(--muted); }
/* gerenciamento */
.qr-linha { display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 7px;
  border: 1px solid var(--line); border-radius: 10px; }
.qr-linha-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.qr-linha-txt b { font-size: 13px; color: var(--green-700); }
.qr-linha-txt em { font-style: normal; font-size: 11.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-atalho { display: flex; align-items: center; gap: 4px; }
.qr-atalho > span { color: var(--muted); font-weight: 700; }

/* painel de emojis */
.emo-pop { position: fixed; z-index: 60; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 12px 32px #00000024; padding: 10px 12px 12px;
  width: 314px; max-height: 300px; overflow-y: auto; }
.emo-g { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  margin: 8px 0 5px; font-weight: 700; }
.emo-g:first-child { margin-top: 0; }
.emo-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 1px; }
.emo-grid button { border: 0; background: none; cursor: pointer; font-size: 19px; line-height: 1;
  padding: 5px 0; border-radius: 7px; }
.emo-grid button:hover { background: var(--green-50); }

/* menu do clipe */
.anexo-menu { position: fixed; z-index: 60; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px #0000001f; padding: 6px; display: flex; flex-direction: column; min-width: 186px; }
.anexo-menu button { border: 0; background: none; text-align: left; padding: 9px 12px; border-radius: 8px;
  cursor: pointer; font-size: 13px; color: var(--ink); }
.anexo-menu button:hover { background: #f2f5f4; }

/* mídia dentro da bolha */
.bubble.midia { padding: 5px 5px 18px; max-width: 320px; }
.bmedia { display: block; max-width: 100%; max-height: 300px; border-radius: 7px; }
.baudio { display: block; width: 260px; max-width: 100%; height: 40px; }
.bdoc { display: flex; gap: 7px; align-items: center; padding: 9px 11px; text-decoration: none; color: inherit;
  background: #00000008; border-radius: 7px; font-size: 12.5px; word-break: break-all; }
.bcap { padding: 5px 7px 0; font-size: 13px; }
.btpl { display: inline-block; background: #00000010; border-radius: 4px; padding: 0 5px; font-size: 11px; margin-right: 4px; }

/* ficha do contato (abre pelo nome no topo da conversa) */
.lc-nome { cursor: pointer; border-bottom: 1px dashed transparent; }
.lc-nome:hover { border-bottom-color: var(--green-700); color: var(--green-700); }
.modal.wide-ficha { width: 460px; }
.ficha .fc-avatar { width: 42px; height: 42px; flex-shrink: 0; border-radius: 50%; background: var(--green-700);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 17px; }
.ficha .fc-nome { font-size: 16px; font-weight: 700; border: 1px solid transparent; border-radius: 6px;
  padding: 2px 6px; margin: 0 0 1px -6px; width: 100%; background: none; }
.ficha .fc-nome:hover { border-color: var(--line); }
.ficha .fc-nome:focus { border-color: var(--green-700); background: #fff; }
.ficha .fc-etapa { background: var(--green-50); border-radius: 8px; padding: 7px 11px; font-size: 12.5px; margin: 12px 0 0; }
.ficha .fc-bloco { margin-top: 14px; }
.ficha .fc-tit { font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.ficha .fc-consulta { font-size: 13px; font-weight: 600; }
.ficha .fc-linha { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.ficha .fc-rot { font-size: 12px; font-weight: 600; color: var(--muted); width: 96px; flex-shrink: 0; text-align: right; }
.ficha .fc-val { flex: 1; min-width: 0; font-size: 13.5px; padding: 7px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: #fbfdfc; transition: .12s; }
.ficha .fc-val:hover { border-color: #c8d8d2; }
.ficha .fc-val:focus { border-color: var(--green-700); background: #fff; box-shadow: 0 0 0 3px rgba(35,90,72,.08); }
.ficha .fc-val.erro { border-color: #d9534f; background: #fdf3f2; }
.ficha .fc-remarca { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ficha .fc-remarca input { border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font-size: 13.5px;
  background: #fbfdfc; font-variant-numeric: tabular-nums; }
.ficha .fc-remarca input:focus { border-color: var(--green-700); background: #fff; }
.ficha textarea { width: 100%; font-size: 13px; }
.ficha .fc-rodape { font-size: 11.5px; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }

/* wizard de template */
/* o modal padrão é estreito (460px) e rola inteiro. Aqui quem rola é só o
   corpo — cabeçalho e rodapé ficam parados, senão o botão "Enviar" some. */
.modal.wide { width: 820px; max-width: 94vw; display: flex; flex-direction: column; overflow: hidden; }
.tw { display: flex; flex-direction: column; min-height: 0; }
.tw-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.tw-head h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 16px; }
.tw-head h3 svg { color: #25d366; }
.tw-steps { display: flex; gap: 6px; margin-left: auto; }
.tw-steps span { font-size: 11px; padding: 4px 10px; border-radius: 20px; background: #f0f2f2; color: var(--muted); white-space: nowrap; }
.tw-steps span.on { background: var(--green-700); color: #fff; font-weight: 600; }
.tw-steps span.feito { background: #25d3661f; color: var(--green-700); }
.tw-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding-right: 4px; }
.tw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.tw-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; cursor: pointer; transition: .15s; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
/* nome de template é longo e sem espaço (menhaflix_cupom_ultima_chance):
   sem isto ele empurra o card e nasce rolagem lateral */
.tw-card b { overflow-wrap: anywhere; }
.tw-card:hover { border-color: var(--green-700); background: #25d3660a; }
.tw-card p { margin: 0; font-size: 11.5px; color: var(--muted); line-height: 1.45; min-height: 34px; }
.tw-pick { color: var(--green-700); font-size: 11.5px; font-weight: 600; }
.tw-sel { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; margin-bottom: 14px; }
.tw-two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.tw-two > * { min-width: 0; } /* coluna de grid não encolhe sozinha; sem isso o texto longo vaza */
.tw-lbl { font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.tw-prev { background: #f3f6f5; border-radius: 9px; padding: 13px 15px; font-size: 13px; line-height: 1.5;
  border-left: 3px solid #25d366; min-height: 90px; word-break: break-word; }
.tw-box { border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px; }
/* Campo de variável: cartão com número + o trecho do template onde o valor cai.
   O rótulo "Corpo {{1}}" não dizia nada; o contexto é que faz a pessoa acertar. */
.tw-var { display: block; margin-bottom: 8px; padding: 9px 11px 10px; border: 1px solid var(--line);
  border-radius: 10px; background: #fbfdfc; transition: border-color .15s, background .15s; }
.tw-var:focus-within { border-color: var(--green-500); background: #fff;
  box-shadow: 0 0 0 3px rgba(58,138,110,.10); }
.tw-var.ok { border-color: #cfe6db; background: #fff; }
.tw-var-top { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.tw-num { flex: 0 0 18px; height: 18px; border-radius: 50%; background: var(--green-600); color: #fff;
  font-size: 10.5px; font-weight: 800; font-style: normal; display: grid; place-items: center; }
.tw-var.ok .tw-num { background: var(--green-800); }
.tw-var.ok .tw-num::after { content: "✓"; font-size: 10px; }
.tw-var.ok .tw-num { font-size: 0; }                 /* troca o número pelo ✓ quando preenchido */
.tw-ctx { font-size: 11.5px; color: var(--muted); line-height: 1.3; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.tw-ctx b { display: inline-block; min-width: 15px; text-align: center; color: var(--green-700);
  background: #e3f3ec; border-radius: 4px; margin: 0 2px; font-weight: 800; }
.tw-var input { width: 100%; }
/* no preview: o que foi digitado destaca, o que falta fica pálido */
.tw-mk { background: #d7f2e3; color: var(--green-900); border-radius: 4px; padding: 1px 4px; font-weight: 600; }
.tw-vazio { color: #b4c3bd; background: #eef1f0; border-radius: 4px; padding: 1px 5px; font-size: 11.5px; }
.tw-foot { display: flex; align-items: center; gap: 9px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
@media (max-width: 640px) { .tw-two { grid-template-columns: 1fr; } .tw-steps { width: 100%; margin-left: 0; } }

/* Bolha de template: etiqueta em cima, texto enviado embaixo */
.btpl-txt { margin-top: 5px; white-space: pre-wrap; }

/* Sugestão de tags no editor de fluxo (campo "Tags (vírgula)") */
.tagsug { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; z-index: 30;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden auto;
  max-height: 208px; box-shadow: 0 10px 28px rgba(20,52,42,.14); }
.tagsug-i { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 11px;
  border: 0; background: none; cursor: pointer; text-align: left; font: inherit; font-size: 12.5px;
  color: var(--ink); border-bottom: 1px solid var(--line); }
.tagsug-i:last-child { border-bottom: 0; }
.tagsug-i:hover, .tagsug-i.on { background: var(--green-50); }
.tagsug-i span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tagsug-i em { font-style: normal; font-size: 11px; color: var(--muted); background: var(--green-50);
  border-radius: 999px; padding: 1px 7px; flex-shrink: 0; }

/* Kanban */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; cursor: grab; }
.kanban:active { cursor: grabbing; }
.kanban .col { background: #eef3f1; border-radius: 10px; min-width: 260px; max-width: 260px; flex-shrink: 0; }
.kanban .col-head { padding: 12px; display: flex; flex-direction: column; gap: 2px; background: #fff; border-radius: 10px 10px 0 0; }
.kanban .col-head .muted { font-size: 11px; }
.kanban .col-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.kanban .deal { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px; cursor: grab; box-shadow: var(--shadow); }
.kanban .deal:active { cursor: grabbing; }
.kanban .deal-menu { cursor: pointer; color: var(--muted); font-weight: 700; padding: 0 4px; border-radius: 6px; line-height: 1; }
.kanban .deal-menu:hover { background: var(--green-50); color: var(--green-700); }

/* paleta de nós do editor */
.overlay.free { background: rgba(20, 40, 33, .18); }
.modal.pick { width: 360px; border-radius: 16px; padding: 20px; }
.modal.pick h3 { font-size: 17px; }
.picksub { color: var(--muted); font-size: 12.5px; margin: -8px 0 14px; line-height: 1.4; }
.picklist { display: flex; flex-direction: column; gap: 8px; max-height: 62vh; overflow-y: auto; padding: 2px; }
.pickitem { display: flex; align-items: center; gap: 12px; text-align: left; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; transition: box-shadow .12s, transform .12s, border-color .12s; }
.pickitem:hover { border-color: var(--green-500); box-shadow: 0 4px 12px rgba(20, 52, 42, .10); transform: translateY(-1px); }
.pickitem .pi-ic { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.pickitem .pi-tx { display: flex; flex-direction: column; gap: 1px; }
.pickitem .pi-tx b { font-size: 13px; color: var(--ink); }
.pickitem .pi-tx small { font-size: 11.5px; color: var(--muted); line-height: 1.35; font-weight: 400; }

/* KPIs v2 (ícone colorido + delta vs ontem) */
.kpi-ic { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.delta { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.delta.up { background: #e3f3ec; color: var(--green-700); }
.delta.down { background: #fbe6e5; color: var(--red); }

/* Alertas do dashboard */
.alerts { border-left: 4px solid var(--green-500); }
.alert-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.alert-item:last-child { border-bottom: none; }
/* alerta sobre uma pessoa leva pra conversa dela */
.alert-item .ev-corpo { flex: 1; min-width: 0; }
.alert-item .ev-corpo.clicavel { cursor: pointer; }
.alert-item:hover { background: var(--green-50); margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 8px; }
.ir-conversa { color: var(--green-700); font-weight: 600; font-size: 11.5px; white-space: nowrap; cursor: pointer; opacity: 0; transition: .12s; }
.alert-item:hover .ir-conversa { opacity: 1; }
/* ✓ resolver: discreto até você passar o mouse, pra não competir com o aviso */
.ev-ok { width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; color: var(--muted); cursor: pointer; font-size: 12px; line-height: 1; padding: 0;
  opacity: .35; transition: .12s; }
.alert-item:hover .ev-ok { opacity: 1; }
.ev-ok:hover { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.toast-acao { margin-left: 12px; background: none; border: 1px solid rgba(255,255,255,.45); color: inherit;
  border-radius: 6px; padding: 2px 9px; font-size: 12px; font-weight: 600; cursor: pointer; }
.toast-acao:hover { background: rgba(255,255,255,.15); }

/* acesso de visualização: quem entra precisa saber ANTES de tentar salvar algo */
.faixa-demo { position: fixed; top: 0; left: 0; right: 0; z-index: 90; background: var(--green-900); color: #eaf4f0;
  font-size: 12.5px; text-align: center; padding: 7px 14px; letter-spacing: .01em; }
.faixa-demo b { color: #7fe3b4; }
/* a sidebar é sticky com 100vh: sem descontar a faixa ela vaza 32px pra fora */
body.modo-demo { padding-top: 32px; }
body.modo-demo .sidebar { top: 32px; height: calc(100vh - 32px); }
.alert-item .aic { width: 28px; height: 28px; border-radius: 8px; background: var(--green-50); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Nuvem de tags clicável (contatos e broadcast) */
.tagcloud { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; max-height: 110px; overflow-y: auto; }
.chip-t { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 11px; font-size: 12px; cursor: pointer; color: var(--ink); }
.chip-t:hover { border-color: var(--green-500); }
.chip-t.on { background: var(--green-600); color: #fff; border-color: var(--green-600); }
.chip-t.on.ex { background: var(--red); border-color: var(--red); }

/* Broadcasts: anéis + rascunhos */
.ringbox { display: flex; justify-content: center; }
.bdraft { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; min-width: 220px; cursor: pointer; background: #fff; }
.bdraft:hover { border-color: var(--green-500); box-shadow: var(--shadow); }
.bdraft b { display: block; margin-bottom: 4px; }
.bdraft .pill { margin-bottom: 4px; }

/* prévia estilo WhatsApp (detalhe do template) */
.waprev { background: #e5ddd5; border-radius: 12px; padding: 16px; }
.wabubble { background: #fff; border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.5; box-shadow: 0 1px 1px rgba(0,0,0,.10); word-break: break-word; }
.wabubble .wahead { font-weight: 700; margin-bottom: 6px; }
.wabubble .wafoot { color: #8a9aa0; font-size: 11.5px; margin-top: 8px; }
.wabubble .watime { text-align: right; color: #9aa6ab; font-size: 10px; margin-top: 4px; }
.wavar { background: #e3f3ec; color: var(--green-700); border-radius: 4px; padding: 0 4px; font-family: ui-monospace, monospace; font-size: 12px; }
.wabtn { background: #fff; border-radius: 10px; margin-top: 6px; padding: 9px; text-align: center; color: #0a9de2; font-weight: 600; font-size: 13px; box-shadow: 0 1px 1px rgba(0,0,0,.10); }

/* picker de tags com busca (broadcast) */
.tagpick { margin-bottom: 6px; }
.tp-sel { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.tp-chip { display: inline-flex; align-items: center; gap: 7px; background: var(--green-50); border: 1px solid #cfe6dc; color: var(--green-700); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; }
.tp-chip.ex { background: #fbe6e5; border-color: #f0c9c7; color: var(--red); }
.tp-chip a { cursor: pointer; opacity: .6; font-weight: 700; }
.tp-chip a:hover { opacity: 1; }
.tp-inp { position: relative; }
.tp-inp input { width: 100%; }
.tp-drop { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 26px rgba(20,52,42,.16); max-height: 240px; overflow-y: auto; z-index: 20; padding: 4px; display: none; }
.tp-drop.open { display: block; }
.tp-opt { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; text-align: left; border: none; background: none; border-radius: 7px; padding: 8px 10px; cursor: pointer; font-size: 13px; color: var(--ink); }
.tp-opt:hover { background: var(--green-50); }
.tp-empty { padding: 10px; color: var(--muted); font-size: 12.5px; text-align: center; }
.sugg { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.sugg-i { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; border: 1px solid var(--line); border-radius: 9px; padding: 7px 11px; background: #fff; cursor: pointer; text-align: left; }
.sugg-i:hover { border-color: var(--green-500); background: var(--green-50); }
.sugg-i b { font-family: ui-monospace, "SF Mono", Menlo, monospace; color: var(--green-700); font-size: 12.5px; }
.sugg-i small { color: var(--muted); font-size: 11px; }
.bulkbar { align-items: center; gap: 12px; background: var(--green-50); border: 1px solid #cfe6dc; border-radius: 10px; padding: 9px 14px; margin-bottom: 12px; font-size: 13px; }
.robox { border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font-size: 13px; background: #f6f9f8; color: var(--ink); min-height: 20px; }

.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 40px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; }

/* ===== Responsivo (mobile / telas estreitas) ===== */
.lc-back { display: none; align-items: center; gap: 6px; background: none; border: none;
  color: var(--green-700); font-weight: 700; cursor: pointer; padding: 2px 6px 2px 0; font-size: 15px; }
@media (max-width: 820px) {
  /* shell: sidebar vira barra horizontal no topo */
  .layout { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: sticky; top: 0; z-index: 40;
    flex-direction: row; align-items: center; gap: 4px; }
  .brand { padding: 10px 8px; flex-shrink: 0; }
  .nav { display: flex; flex-direction: row; padding: 4px; gap: 2px; overflow-x: auto; flex: 1; }
  .nav a { padding: 8px 10px; margin: 0; white-space: nowrap; }
  .sidebar .foot { border-top: none; padding: 6px 10px; font-size: 11px; flex-shrink: 0; white-space: nowrap; }
  .sidebar .foot br { display: none; }
  .main { padding: 14px; max-width: 100%; }
  .page-head h1 { font-size: 22px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }

  /* Live Chat: 1 coluna com toggle lista ↔ conversa */
  .lc { grid-template-columns: 1fr; gap: 0; height: calc(100vh - 128px); }
  .lc .lc-chat { display: none; }
  .lc.show-chat .lc-col { display: none; }
  .lc.show-chat .lc-chat { display: flex; }
  .lc-back { display: inline-flex; }
  .bubble { max-width: 85%; }
}

/* chave "automação ligada / eu respondo" no topo da conversa */
.lc-head .spacer{flex:1}
.autosw{display:flex;align-items:center;gap:7px;font-size:.82rem;font-weight:600;cursor:pointer;
  background:var(--green-50);border:1px solid var(--line);border-radius:999px;padding:4px 12px;white-space:nowrap}
.autosw input{accent-color:var(--green-700);cursor:pointer;margin:0}
