/* Paleta do WhatsApp */
:root {
  --verde: #25d366;
  --verde-forte: #00a884;
  --verde-cab: #008069;
  --verde-noite: #075e54;
  --verde-claro: #e7fce3;
  --bolha: #d9fdd3;
  --chat: #efeae2;
  --fundo: #f0f2f5;
  --card: #ffffff;
  --tinta: #111b21;
  --tinta-2: #3b4a54;
  --muted: #667781;
  --linha: #e9edef;
  --azul: #53bdeb;
  --alerta: #c27500;
  --alerta-claro: #fff4e0;
  --erro: #d93025;
  --erro-claro: #fdecea;
  --raio: 14px;
  --sombra: 0 1px 3px rgba(11, 20, 26, 0.08), 0 1px 2px rgba(11, 20, 26, 0.04);
  --sombra-alta: 0 12px 40px rgba(11, 20, 26, 0.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--fundo);
  color: var(--tinta);
  font: 15px/1.5 "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--verde-cab); }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.muted { color: var(--muted); }
.peq { font-size: 13px; }
[hidden] { display: none !important; }

/* ---------- Carregando / login ---------- */
.carregando { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--linha); border-top-color: var(--verde-forte); border-radius: 50%; animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: linear-gradient(var(--verde-cab) 0 220px, var(--fundo) 220px); }
.login-card { width: 100%; max-width: 400px; background: var(--card); border-radius: 18px; box-shadow: var(--sombra-alta); padding: 32px; }
.login-card .logo { margin-bottom: 20px; }
.login-card h1 { font-size: 22px; margin: 0 0 6px; }
.login-card p { margin: 0 0 20px; color: var(--muted); }

/* ---------- Estrutura ---------- */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.lateral { background: var(--card); border-right: 1px solid var(--linha); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.lateral .topo { background: var(--verde-cab); color: #fff; padding: 18px 20px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.logo-marca { width: 34px; height: 34px; border-radius: 10px; background: var(--verde); display: grid; place-items: center; color: #fff; }
.logo small { display: block; font-weight: 400; font-size: 12px; opacity: .8; }
.lateral .acao-principal { padding: 16px; }
.menu { display: flex; flex-direction: column; padding: 0 8px; gap: 2px; flex: 1; }
.menu a { display: flex; align-items: center; gap: 14px; padding: 11px 14px; border-radius: 10px; color: var(--tinta-2); text-decoration: none; font-weight: 500; }
.menu a:hover { background: var(--fundo); }
.menu a.ativo { background: var(--verde-claro); color: var(--verde-noite); font-weight: 600; }
.menu a .badge { margin-left: auto; }
.lateral .rodape { padding: 12px 16px; border-top: 1px solid var(--linha); display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.conteudo { min-width: 0; }
.cabecalho { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 32px 0; }
.cabecalho h1 { font-size: 24px; margin: 0; letter-spacing: -.2px; }
.cabecalho .sub { color: var(--muted); margin-top: 2px; }
.pagina { padding: 20px 32px 96px; max-width: 1100px; }

.status-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; background: var(--fundo); font-size: 13px; font-weight: 600; color: var(--tinta-2); text-decoration: none; white-space: nowrap; }
.status-chip .ponto { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status-chip.conectado .ponto { background: var(--verde); box-shadow: 0 0 0 3px rgba(37, 211, 102, .25); }
.status-chip.desconectado .ponto { background: var(--erro); }
.status-chip.aguardando_qr .ponto, .status-chip.reconectando .ponto, .status-chip.iniciando .ponto { background: var(--alerta); }

/* Navegação inferior (celular) */
.nav-baixo { display: none; }
.fab { display: none; }

/* ---------- Botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 99px; padding: 10px 20px; font-weight: 600; cursor: pointer; background: var(--verde-forte); color: #fff; text-decoration: none; transition: filter .15s, transform .05s; white-space: nowrap; }
.btn:hover { filter: brightness(.95); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; filter: none; }
.btn.bloco { width: 100%; }
.btn.grande { padding: 13px 26px; font-size: 16px; }
.btn.sec { background: var(--card); color: var(--verde-cab); box-shadow: inset 0 0 0 1px var(--linha); }
.btn.sec:hover { background: var(--fundo); filter: none; }
.btn.fantasma { background: transparent; color: var(--tinta-2); padding: 8px 12px; }
.btn.fantasma:hover { background: var(--fundo); filter: none; }
.btn.perigo { background: var(--erro); }
.btn.perigo-sec { background: var(--card); color: var(--erro); box-shadow: inset 0 0 0 1px #f3c5c1; }
.btn.mini { padding: 6px 12px; font-size: 13px; }
.btn-icone { border: 0; background: transparent; width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; cursor: pointer; color: var(--muted); }
.btn-icone:hover { background: var(--fundo); color: var(--tinta); }
.btn-icone:disabled { opacity: .3; cursor: default; background: none; }

/* ---------- Cards e blocos ---------- */
.card { background: var(--card); border-radius: var(--raio); box-shadow: var(--sombra); padding: 20px; }
.card + .card, .bloco + .bloco { margin-top: 16px; }
.card h2, .bloco-titulo { font-size: 17px; margin: 0 0 4px; }
.card-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.grade { display: grid; gap: 16px; }
.grade.g2 { grid-template-columns: repeat(2, 1fr); }
.grade.g3 { grid-template-columns: repeat(3, 1fr); }
.grade.g4 { grid-template-columns: repeat(4, 1fr); }
.secao { margin-top: 28px; }
.secao-cab { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 12px; }
.secao-cab h2 { font-size: 17px; margin: 0; }

.kpi { background: var(--card); border-radius: var(--raio); box-shadow: var(--sombra); padding: 18px 20px; }
.kpi .rot { color: var(--muted); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.kpi .num { font-size: 30px; font-weight: 700; letter-spacing: -.5px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .rot svg { width: 16px; height: 16px; color: var(--verde-forte); }

.dica { display: flex; gap: 12px; align-items: flex-start; background: var(--verde-claro); color: var(--verde-noite); border-radius: 12px; padding: 14px 16px; font-size: 14px; }
.dica svg { color: var(--verde-forte); margin-top: 1px; }
.dica.alerta { background: var(--alerta-claro); color: #6b4100; }
.dica.alerta svg { color: var(--alerta); }
.dica strong { font-weight: 600; }

.vazio { text-align: center; padding: 48px 24px; background: var(--card); border-radius: var(--raio); box-shadow: var(--sombra); }
.vazio .ilus { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; background: var(--verde-claro); color: var(--verde-forte); display: grid; place-items: center; }
.vazio .ilus svg { width: 30px; height: 30px; }
.vazio h3 { margin: 0 0 6px; font-size: 18px; }
.vazio p { margin: 0 auto 18px; color: var(--muted); max-width: 420px; }

/* Primeiros passos */
.passos { display: grid; gap: 4px; }
.passo { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 12px; }
.passo:hover { background: var(--fundo); }
.passo .bola { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--fundo); color: var(--muted); flex-shrink: 0; }
.passo.feito .bola { background: var(--verde); color: #fff; }
.passo .txt { flex: 1; min-width: 0; }
.passo .txt strong { display: block; }
.passo.feito .txt strong { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.progresso { height: 8px; background: var(--fundo); border-radius: 99px; overflow: hidden; }
.progresso > div { height: 100%; background: var(--verde); border-radius: 99px; transition: width .4s; }
.progresso.alerta > div { background: var(--alerta); }
.progresso.cheio > div { background: var(--erro); }

/* Etiquetas */
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--fundo); color: var(--tinta-2); white-space: nowrap; }
.tag.verde { background: var(--verde-claro); color: var(--verde-noite); }
.tag.alerta { background: var(--alerta-claro); color: var(--alerta); }
.tag.erro { background: var(--erro-claro); color: var(--erro); }
.tag.azul { background: #e3f4fc; color: #0b6e99; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--verde); color: #fff; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }

/* ---------- Listas ---------- */
.lista { background: var(--card); border-radius: var(--raio); box-shadow: var(--sombra); overflow: hidden; }
.linha { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--linha); }
.linha:last-child { border-bottom: 0; }
.linha.clicavel { cursor: pointer; }
.linha.clicavel:hover { background: #f7f8fa; }
.linha .ico { width: 42px; height: 42px; border-radius: 50%; background: var(--verde-claro); color: var(--verde-forte); display: grid; place-items: center; flex-shrink: 0; }
.linha .ico.cinza { background: var(--fundo); color: var(--muted); }
.linha .ico.erro { background: var(--erro-claro); color: var(--erro); }
.linha .corpo { flex: 1; min-width: 0; }
.linha .titulo { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linha .meta { font-size: 13px; color: var(--muted); }
.linha .lado { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.linha.inativo { opacity: .5; }
.pos { width: 28px; height: 28px; border-radius: 50%; background: var(--verde-cab); color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center; flex-shrink: 0; }

.detalhe { padding: 4px 18px 18px 74px; border-bottom: 1px solid var(--linha); background: #fbfcfc; }
.alvos { display: grid; gap: 6px; font-size: 14px; margin-top: 12px; }
.alvos > div { display: flex; justify-content: space-between; gap: 12px; }

/* Campanhas */
.camp-card { background: var(--card); border-radius: var(--raio); box-shadow: var(--sombra); padding: 20px; cursor: pointer; transition: box-shadow .15s, transform .15s; display: flex; flex-direction: column; gap: 12px; }
.camp-card:hover { box-shadow: var(--sombra-alta); transform: translateY(-2px); }
.camp-card h3 { margin: 0; font-size: 17px; }
.camp-card .nums { display: flex; gap: 18px; font-size: 13px; color: var(--muted); }
.camp-card .nums b { display: block; color: var(--tinta); font-size: 18px; }
.camp-card.arquivada { opacity: .55; }
.link-chip { display: flex; align-items: center; gap: 8px; background: var(--fundo); border-radius: 10px; padding: 8px 8px 8px 12px; font-size: 13px; min-width: 0; }
.link-chip code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, Menlo, monospace; color: var(--verde-noite); }
.link-grande { display: flex; align-items: center; gap: 10px; background: var(--verde-claro); border-radius: 12px; padding: 12px 12px 12px 16px; }
.link-grande code { flex: 1; font-size: 15px; font-weight: 600; color: var(--verde-noite); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, Menlo, monospace; }

/* Abas internas */
.abas { display: flex; gap: 4px; border-bottom: 1px solid var(--linha); margin: 0 0 20px; overflow-x: auto; scrollbar-width: none; }
.abas button { border: 0; background: none; padding: 12px 14px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.abas button svg { width: 17px; height: 17px; }
.abas button.ativa { color: var(--verde-cab); border-color: var(--verde-cab); }
.voltar { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.voltar:hover { color: var(--tinta); }

/* Barras do gráfico simples */
.barras { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding-top: 10px; }
.barras .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.barras .par { display: flex; gap: 3px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.barras .b { width: 40%; max-width: 18px; border-radius: 5px 5px 0 0; min-height: 2px; }
.barras .b.e { background: var(--verde); }
.barras .b.c { background: var(--azul); }
.barras .dia { font-size: 12px; color: var(--muted); }
.legenda { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.legenda span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legenda .e::before { background: var(--verde); }
.legenda .c::before { background: var(--azul); }
.origem { display: grid; grid-template-columns: 110px 1fr 40px; gap: 10px; align-items: center; font-size: 14px; padding: 4px 0; }

/* Ações em massa */
.acao-card { display: flex; gap: 14px; align-items: flex-start; text-align: left; border: 0; background: var(--card); border-radius: var(--raio); box-shadow: var(--sombra); padding: 18px; cursor: pointer; transition: box-shadow .15s; width: 100%; }
.acao-card:hover { box-shadow: var(--sombra-alta); }
.acao-card .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--verde-claro); color: var(--verde-forte); display: grid; place-items: center; flex-shrink: 0; }
.acao-card strong { display: block; margin-bottom: 2px; }
.acao-card span { font-size: 13px; color: var(--muted); }

/* ---------- Formulários ---------- */
.campo { display: grid; gap: 6px; }
.campo + .campo { margin-top: 16px; }
.campo > label, .rotulo { font-weight: 600; font-size: 14px; }
.campo .ajuda { font-size: 13px; color: var(--muted); }
.entrada, .campo input[type=text], .campo input[type=password], .campo input[type=number], .campo input[type=date], .campo input[type=time], .campo select, .campo textarea {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--linha); border-radius: 10px; background: #fff; outline: none; transition: border-color .15s;
}
.entrada:focus, .campo input:focus, .campo select:focus, .campo textarea:focus { border-color: var(--verde-forte); }
.campo textarea { resize: vertical; min-height: 140px; line-height: 1.5; }
.busca { position: relative; }
.busca svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.busca input { padding-left: 40px !important; }
.linha-form { display: flex; gap: 12px; }
.linha-form > * { flex: 1; }
.barra-formatar { display: flex; gap: 4px; }
.barra-formatar button { border: 1px solid var(--linha); background: #fff; border-radius: 8px; width: 34px; height: 32px; cursor: pointer; font-weight: 700; }
.barra-formatar button:hover { background: var(--fundo); }

.chave { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.chave input { display: none; }
.chave .trilho { width: 42px; height: 24px; border-radius: 99px; background: #c9d1d6; position: relative; transition: background .2s; flex-shrink: 0; }
.chave .trilho::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s; }
.chave input:checked + .trilho { background: var(--verde-forte); }
.chave input:checked + .trilho::after { transform: translateX(18px); }
.chave .txt strong { display: block; font-size: 14px; }
.chave .txt span { font-size: 13px; color: var(--muted); }

.opcao-card { display: flex; gap: 12px; align-items: flex-start; border: 2px solid var(--linha); border-radius: 12px; padding: 14px 16px; cursor: pointer; transition: border-color .15s, background .15s; }
.opcao-card input { margin-top: 3px; accent-color: var(--verde-forte); }
.opcao-card.sel { border-color: var(--verde-forte); background: #f6fdf8; }
.opcao-card strong { display: block; }
.opcao-card span { font-size: 13px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--linha); background: #fff; border-radius: 99px; padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--tinta-2); }
.chip:hover { border-color: var(--verde-forte); color: var(--verde-cab); }
.chip.sel { background: var(--verde-forte); border-color: var(--verde-forte); color: #fff; }

.check-lista { border: 1.5px solid var(--linha); border-radius: 12px; max-height: 300px; overflow: auto; }
.check-lista label { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--linha); cursor: pointer; }
.check-lista label:last-child { border-bottom: 0; }
.check-lista label:hover { background: #f7f8fa; }
.check-lista input { accent-color: var(--verde-forte); width: 18px; height: 18px; }
.check-lista .nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

table.tabela { width: 100%; border-collapse: collapse; }
.tabela th, .tabela td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--linha); vertical-align: middle; }
.tabela th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 600; background: #fafbfb; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela tr.inativo td { opacity: .5; }
.tabela select { padding: 6px 10px; border: 1.5px solid var(--linha); border-radius: 8px; background: #fff; max-width: 200px; }

/* ---------- Modal e assistente ---------- */
.modal-fundo { position: fixed; inset: 0; background: rgba(11, 20, 26, .45); display: grid; place-items: center; padding: 16px; z-index: 50; animation: aparece .15s; }
@keyframes aparece { from { opacity: 0; } }
.modal { background: var(--card); border-radius: 18px; box-shadow: var(--sombra-alta); width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: hidden; animation: sobe .2s; }
.modal.largo { max-width: 1000px; }
@keyframes sobe { from { transform: translateY(12px); opacity: 0; } }
.modal-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--linha); }
.modal-cab h2 { margin: 0; font-size: 18px; }
.modal-corpo { padding: 22px; overflow: auto; flex: 1; }
.modal-rodape { display: flex; justify-content: space-between; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--linha); background: #fafbfb; }

.etapas { display: flex; gap: 6px; align-items: center; padding: 14px 22px; border-bottom: 1px solid var(--linha); overflow-x: auto; }
.etapa { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.etapa .n { width: 24px; height: 24px; border-radius: 50%; background: var(--fundo); display: grid; place-items: center; font-size: 12px; }
.etapa.atual { color: var(--verde-cab); }
.etapa.atual .n { background: var(--verde-cab); color: #fff; }
.etapa.feita .n { background: var(--verde); color: #fff; }
.etapa-sep { width: 24px; height: 2px; background: var(--linha); flex-shrink: 0; }

.assist { display: grid; grid-template-columns: 1fr 340px; gap: 24px; }
.assist.sem-previa { grid-template-columns: 1fr; }
.assist h3 { margin: 0 0 4px; font-size: 18px; }
.assist .intro { color: var(--muted); margin: 0 0 18px; }

.tipos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tipo { border: 2px solid var(--linha); background: #fff; border-radius: 14px; padding: 18px 14px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; transition: border-color .15s, transform .1s; }
.tipo:hover { border-color: var(--verde-forte); transform: translateY(-2px); }
.tipo.sel { border-color: var(--verde-forte); background: #f6fdf8; }
.tipo .ico { width: 48px; height: 48px; border-radius: 50%; background: var(--verde-claro); color: var(--verde-forte); display: grid; place-items: center; }
.tipo strong { font-size: 15px; }
.tipo span { font-size: 12px; color: var(--muted); }

.arquivo-zona { border: 2px dashed #c9d1d6; border-radius: 12px; padding: 22px; text-align: center; cursor: pointer; color: var(--muted); transition: border-color .15s, background .15s; }
.arquivo-zona:hover { border-color: var(--verde-forte); background: #f6fdf8; }
.arquivo-zona strong { color: var(--verde-cab); }
.opcoes-enquete { display: grid; gap: 8px; }
.opcoes-enquete .op { display: flex; gap: 8px; }

.resumo-final { background: var(--fundo); border-radius: 12px; padding: 16px; display: grid; gap: 10px; font-size: 14px; }
.resumo-final > div { display: flex; gap: 10px; align-items: flex-start; }
.resumo-final svg { color: var(--verde-forte); width: 18px; height: 18px; margin-top: 1px; }

/* Prévia estilo celular */
.celular { background: var(--chat); border-radius: 18px; overflow: hidden; border: 1px solid var(--linha); position: sticky; top: 0; }
.celular-cab { background: var(--verde-cab); color: #fff; padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.celular-cab .av { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.25); display: grid; place-items: center; }
.celular-cab strong { display: block; font-size: 15px; }
.celular-cab span { font-size: 12px; opacity: .8; }
.celular-chat { padding: 16px 12px; min-height: 340px; max-height: 480px; overflow: auto; display: flex; flex-direction: column; gap: 8px;
  background-color: var(--chat);
  background-image: radial-gradient(rgba(0,0,0,.035) 1px, transparent 1px); background-size: 16px 16px; }
.sistema { align-self: center; background: #fff; color: var(--muted); font-size: 12px; padding: 5px 12px; border-radius: 8px; box-shadow: 0 1px .5px rgba(11,20,26,.13); text-align: center; max-width: 90%; }
.bolha { align-self: flex-end; background: var(--bolha); border-radius: 10px 0 10px 10px; padding: 6px 8px 4px 9px; max-width: 88%; box-shadow: 0 1px .5px rgba(11,20,26,.13); font-size: 14.2px; line-height: 1.4; word-wrap: break-word; position: relative; }
.bolha .txt { white-space: pre-wrap; }
.bolha .hora { float: right; font-size: 11px; color: var(--muted); margin: 6px 0 -2px 10px; display: flex; align-items: center; gap: 3px; }
.bolha .hora svg { width: 15px; height: 15px; color: var(--azul); stroke-width: 2.4; }
.bolha img, .bolha video { display: block; max-width: 100%; border-radius: 6px; margin: -2px -4px 4px; width: calc(100% + 8px); }
.bolha .mencao { color: #027eb5; }
.bolha .doc { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,.05); border-radius: 8px; padding: 10px; margin-bottom: 4px; }
.bolha .doc .pdf { width: 32px; height: 38px; border-radius: 4px; background: #e2574c; color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.bolha .audio { display: flex; align-items: center; gap: 10px; min-width: 220px; padding: 4px 0; }
.bolha .audio .play { width: 0; height: 0; border-left: 14px solid var(--muted); border-top: 9px solid transparent; border-bottom: 9px solid transparent; }
.bolha .audio .onda { flex: 1; height: 24px; background: repeating-linear-gradient(90deg, #8696a0 0 2px, transparent 2px 5px); mask: linear-gradient(transparent 20%, #000 20% 80%, transparent 80%); opacity: .7; border-radius: 2px; }
.bolha .audio .av { width: 36px; height: 36px; border-radius: 50%; background: var(--verde); display: grid; place-items: center; color: #fff; }
.bolha .enquete { min-width: 230px; }
.bolha .enquete strong { display: block; margin-bottom: 2px; }
.bolha .enquete .sub { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.bolha .enquete .op { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.bolha .enquete .op::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #8696a0; flex-shrink: 0; }
.bolha .enquete.multi .op::before { border-radius: 4px; }
.bolha .enquete .ver { text-align: center; color: #027eb5; font-weight: 600; border-top: 1px solid rgba(0,0,0,.08); padding-top: 8px; margin-top: 4px; font-size: 14px; }
.vazio-previa { align-self: center; color: var(--muted); font-size: 13px; margin-top: 40px; text-align: center; }

/* Conexão */
.conexao { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: center; }
.conexao ol { margin: 0; padding-left: 0; list-style: none; counter-reset: p; display: grid; gap: 18px; }
.conexao li { counter-increment: p; display: flex; gap: 14px; align-items: flex-start; font-size: 16px; }
.conexao li::before { content: counter(p); width: 28px; height: 28px; border-radius: 50%; background: var(--verde-cab); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.qr-caixa { width: 300px; height: 300px; border-radius: 16px; border: 1px solid var(--linha); display: grid; place-items: center; background: #fff; overflow: hidden; }
.qr-caixa img { width: 280px; height: 280px; }
.conectado-card { display: flex; align-items: center; gap: 18px; }
.conectado-card .av { width: 64px; height: 64px; border-radius: 50%; background: var(--verde); color: #fff; display: grid; place-items: center; }
.conectado-card .av svg { width: 30px; height: 30px; }

/* Toasts */
#toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--tinta); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--sombra-alta); font-size: 14px; display: flex; gap: 10px; align-items: center; animation: sobe .2s; }
.toast.ok svg { color: var(--verde); }
.toast.erro { background: var(--erro); }

/* ---------- Responsivo ---------- */
@media (max-width: 1000px) {
  .grade.g4 { grid-template-columns: repeat(2, 1fr); }
  .grade.g3 { grid-template-columns: repeat(2, 1fr); }
  .assist { grid-template-columns: 1fr; }
  .celular { position: static; }
  .conexao { grid-template-columns: 1fr; justify-items: center; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .lateral { display: none; }
  .cabecalho { padding: 16px 16px 0; }
  .cabecalho h1 { font-size: 20px; }
  .pagina { padding: 16px 16px 120px; }
  .grade.g2, .grade.g3 { grid-template-columns: 1fr; }
  .grade.g4 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi .num { font-size: 24px; }
  .tipos { grid-template-columns: repeat(2, 1fr); }
  .linha-form { flex-direction: column; }
  .detalhe { padding-left: 18px; }
  .tabela .esconde-mob { display: none; }
  .tabela th, .tabela td { padding: 10px; }
  .modal-fundo { padding: 0; align-items: end; }
  .modal { max-height: 94vh; border-radius: 18px 18px 0 0; }
  .qr-caixa { width: 260px; height: 260px; }
  .qr-caixa img { width: 240px; height: 240px; }
  .nav-baixo { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--card); border-top: 1px solid var(--linha); z-index: 40; padding-bottom: env(safe-area-inset-bottom); }
  .nav-baixo a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; }
  .nav-baixo a.ativo { color: var(--verde-cab); }
  .fab { display: grid; position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 16px; background: var(--verde-forte); color: #fff; place-items: center; border: 0; box-shadow: var(--sombra-alta); z-index: 41; cursor: pointer; }
  .fab svg { width: 26px; height: 26px; }
  .esconde-mob { display: none !important; }
}

/* Complementos */
.lado-cab { display: flex; align-items: center; gap: 10px; }
.so-mob { display: none !important; }
.msg-erro { color: var(--erro); min-height: 1.4em; margin: 8px 0 12px; font-size: 14px; }
.opcao-card.col { display: block; }
.opcao-topo { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.opcao-topo input { margin-top: 3px; accent-color: var(--verde-forte); }
.opcao-topo strong { display: block; }
.opcao-topo span { font-size: 13px; color: var(--muted); }
.bolha code { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
@media (max-width: 760px) {
  .so-mob { display: inline-flex !important; }
  div.so-mob { display: block !important; }
}

/* Foto do grupo e edição */
.foto-grupo { display: flex; align-items: center; gap: 16px; }
.foto-grupo .av { width: 72px; height: 72px; border-radius: 50%; background: var(--fundo); color: var(--muted); display: grid; place-items: center; overflow: hidden; flex-shrink: 0; }
.foto-grupo .av img { width: 100%; height: 100%; object-fit: cover; }
.link-grupo { border: 0; background: none; padding: 0; cursor: pointer; text-align: left; display: inline-flex; align-items: center; gap: 6px; color: var(--tinta); }
.link-grupo svg { width: 14px; height: 14px; color: var(--muted); opacity: 0; transition: opacity .15s; }
.link-grupo:hover strong { color: var(--verde-cab); }
.link-grupo:hover svg, tr:hover .link-grupo svg { opacity: 1; }
@media (max-width: 760px) { .link-grupo svg { opacity: 1; } }

/* Biblioteca */
mark.marcacao { background: #fff1b8; color: #7a5300; border-radius: 4px; padding: 0 3px; font-weight: 600; }
.filtros-bib { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.modelo-card { background: var(--card); border-radius: var(--raio); box-shadow: var(--sombra); padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.modelo-card h3 { margin: 0; font-size: 16px; }
.mc-topo { display: flex; justify-content: space-between; align-items: center; }
.mc-ico { width: 30px; height: 30px; border-radius: 50%; background: var(--verde-claro); color: var(--verde-forte); display: grid; place-items: center; }
.mc-ico svg { width: 16px; height: 16px; }
.mc-previa { background: var(--chat); border-radius: 10px; padding: 10px; flex: 1; display: flex; flex-direction: column; gap: 6px; min-height: 90px; }
.mc-previa img { width: 100%; max-height: 120px; object-fit: cover; border-radius: 8px; }
.mc-txt { background: var(--bolha); border-radius: 8px; padding: 7px 9px; font-size: 13.5px; line-height: 1.4; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.mc-arquivo { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 8px; padding: 8px 10px; font-size: 13px; color: var(--tinta-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mc-arquivo svg { width: 16px; height: 16px; color: var(--verde-forte); }
.mc-rodape { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.modelos-lista { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; max-height: 300px; overflow: auto; }
.modelo-item { display: flex; gap: 12px; align-items: center; text-align: left; border: 1.5px solid var(--linha); background: #fff; border-radius: 12px; padding: 10px 12px; cursor: pointer; min-width: 0; }
.modelo-item:hover { border-color: var(--verde-forte); background: #f6fdf8; }
.modelo-item .ico { width: 36px; height: 36px; border-radius: 50%; background: var(--verde-claro); color: var(--verde-forte); display: grid; place-items: center; flex-shrink: 0; }
.modelo-item .ico svg { width: 18px; height: 18px; }
.modelo-item .corpo { flex: 1; min-width: 0; }
.modelo-item strong { display: block; font-size: 14px; }
.modelo-item .corpo span { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guardar-bib { margin-top: 18px; border: 1.5px dashed var(--linha); border-radius: 12px; padding: 12px 14px; }
.guardar-bib summary { cursor: pointer; font-weight: 600; color: var(--verde-cab); display: flex; gap: 8px; align-items: center; list-style: none; }
.guardar-bib summary::-webkit-details-marker { display: none; }
.guardar-bib summary svg { width: 18px; height: 18px; }
@media (max-width: 760px) {
  .modelos-lista { grid-template-columns: 1fr; }
  .nav-baixo a { font-size: 10px; }
}

/* Confirmação acima de qualquer janela aberta */
.modal-fundo.confirmar { z-index: 70; }
