/* Encanta — base M-096 "Noto" (barra laranja, letra grande, cartões generosos) + caixa de mensagens do M-080 "Vora".
   Identidade: laranja Natura profundo (texto branco 4,5:1), areia quente, Poppins. Só tokens — nunca cor fixa nos componentes. */
:root {
  --bg: #FFF8F3; --surface: #FFFFFF; --surface-2: #FBF5F0; --surface-3: #F6EDE6;
  --ink: #2A1F19; --ink-2: #4A3C33; --muted: #6E6058; --line: #EFE5DD; --line-2: #E4D7CD;
  --acc: #CC4E0C; --acc-hover: #B8450A; --acc-ink: #FFFFFF; --acc-soft: #FDEADF; --acc-soft-2: #FFF3EC;
  --lat: #CC4E0C; --lat-ink: #FFFFFF; --lat-ativo: rgba(255,255,255,.18); --lat-sep: rgba(255,255,255,.22);
  --grafico: #E85D12; --grade: #F1E7DF;
  --ok: #2F7D4A; --ok-soft: #E3F3E8; --warn: #9A6206; --warn-soft: #FFF1D6; --bad: #B3382E; --bad-soft: #FBE4E1; --info: #2C6E80; --info-soft: #DFF0F4;
  --ia: #6B4FA0; --ia-soft: #EFE9F8;
  --bolha-cli: #FFFFFF; --bolha-ia: #FFF0E6; --bolha-eq: #CC4E0C; --bolha-eq-ink: #FFFFFF;
  --sombra: 0 12px 32px -12px rgba(204, 78, 12, .16), 0 2px 6px rgba(60, 30, 10, .04);
  --sombra-leve: 0 4px 14px -6px rgba(204, 78, 12, .14);
  --raio: 22px; --raio-m: 16px; --raio-s: 12px;
  --f: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) {
    --bg: #17110D; --surface: #221A15; --surface-2: #2A211B; --surface-3: #332820;
    --ink: #F5EDE6; --ink-2: #E1D4CA; --muted: #B5A69B; --line: #3A2E26; --line-2: #473930;
    --acc: #E8691F; --acc-hover: #F07A33; --acc-ink: #1B120C; --acc-soft: #3D2417; --acc-soft-2: #2E1D13;
    --lat: #2A1A11; --lat-ink: #FBEDE3; --lat-ativo: rgba(232,105,31,.22); --lat-sep: rgba(255,255,255,.1);
    --grafico: #E8691F; --grade: #33281F;
    --ok: #6CC48C; --ok-soft: #1D3325; --warn: #E6B45A; --warn-soft: #3A2C12; --bad: #F0857A; --bad-soft: #3D1E1B; --info: #7BC0D1; --info-soft: #1A3138;
    --ia: #B8A2E3; --ia-soft: #2C2340;
    --bolha-cli: #2A211B; --bolha-ia: #3A2519; --bolha-eq: #E8691F; --bolha-eq-ink: #1B120C;
    --sombra: 0 12px 32px -14px rgba(0,0,0,.7); --sombra-leve: 0 4px 14px -6px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.55 var(--f); -webkit-font-smoothing: antialiased; }
a { color: var(--acc); }
h1, h2, h3 { font-family: var(--f); margin: 0; letter-spacing: -.01em; }
h1 { font-size: 32px; font-weight: 500; line-height: 1.2; }
h2 { font-size: 20px; font-weight: 500; }
h3 { font-size: 17px; font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .pequeno { font-size: 14px; } .mini { font-size: 13px; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--acc) 45%, transparent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- botões e campos (pílulas do Noto) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 500; font-size: 15px; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { border-color: var(--acc); color: var(--acc); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.pri { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); box-shadow: var(--sombra-leve); }
.btn.pri:hover { background: var(--acc-hover); border-color: var(--acc-hover); color: var(--acc-ink); }
.btn.suave { background: var(--acc-soft); border-color: transparent; color: var(--acc); }
.btn.perigo { color: var(--bad); }
.btn.perigo:hover { border-color: var(--bad); }
.btn.fantasma { background: transparent; border-color: transparent; }
.btn.pq { min-height: 38px; padding: 0 16px; font-size: 14px; }
.btn.ic { width: 46px; padding: 0; }
.btn.ic.pq { width: 38px; }
.btn svg { width: 20px; height: 20px; flex: none; }
.campo { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.campo > span { font-size: 14px; color: var(--ink-2); font-weight: 500; }
.inp, select.inp, textarea.inp { width: 100%; min-height: 48px; background: var(--surface); border: 1.5px solid var(--line-2); border-radius: var(--raio-s); padding: 10px 14px; min-width: 0; }
.inp:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 4px var(--acc-soft); }
textarea.inp { resize: vertical; min-height: 96px; }
.busca { position: relative; }
.busca svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.busca .inp { padding-left: 46px; border-radius: 999px; }
.linha { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.entre { justify-content: space-between; }
.grade2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grade3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.pilha > * + * { margin-top: 20px; }
@media (max-width: 1100px) { .grade3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .grade2, .grade3 { grid-template-columns: 1fr; } }

/* ---------- estrutura: barra laranja (Noto) ---------- */
.app { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh; }
.lateral { background: var(--lat); color: var(--lat-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.marca { display: flex; align-items: center; gap: 12px; padding: 30px 26px 26px; }
.marca img { width: 46px; height: 46px; }
.marca b { font-size: 19px; font-weight: 600; line-height: 1.1; display: block; }
.marca small { font-size: 13px; opacity: .88; }
.nav { display: flex; align-items: center; gap: 14px; padding: 13px 26px; color: var(--lat-ink); text-decoration: none; font-size: 16px; font-weight: 500; position: relative; }
.nav svg { width: 22px; height: 22px; flex: none; }
.nav:hover { background: rgba(255,255,255,.08); }
.nav.ativo { background: var(--lat-ativo); font-weight: 600; }
.nav.ativo::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--lat-ink); }
.nav .cont { margin-left: auto; background: var(--lat-ink); color: var(--lat); border-radius: 99px; font-size: 12px; padding: 1px 9px; font-weight: 700; }
.nav-sep { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; opacity: .85; padding: 22px 26px 8px; border-top: 1px solid var(--lat-sep); margin-top: 12px; }
.lateral .rodape { margin-top: auto; padding: 18px 20px 22px; border-top: 1px solid var(--lat-sep); }
.lateral .rodape .avatar { background: rgba(255,255,255,.2); color: var(--lat-ink); }
.lateral .rodape .btn { border-color: rgba(255,255,255,.45); background: transparent; color: var(--lat-ink); }
.lateral .rodape .btn:hover { background: rgba(255,255,255,.12); }
.assinatura-vai { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--lat-sep); font-size: 11px; letter-spacing: .02em; }
.assinatura-vai span { opacity: .72; }
.assinatura-vai strong { font-size: 12px; letter-spacing: .04em; }
.conteudo { min-width: 0; display: flex; flex-direction: column; }
.topo { display: flex; align-items: center; gap: 14px; padding: 22px 40px; position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); }
.topo .busca { flex: 0 1 420px; }
.topo .busca .inp { background: var(--surface); border-color: transparent; box-shadow: var(--sombra-leve); }
.topo .espaco { flex: 1; }
.btn-redondo { width: 50px; height: 50px; border-radius: 50%; border: 1.5px solid var(--line-2); background: var(--surface); display: inline-grid; place-items: center; cursor: pointer; position: relative; color: var(--ink-2); flex: none; }
.btn-redondo svg { width: 22px; height: 22px; }
.btn-redondo:hover { border-color: var(--acc); color: var(--acc); }
.btn-redondo .ponto { position: absolute; top: 9px; right: 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); border: 2px solid var(--surface); }
.btn-redondo.ligado { background: var(--acc-soft); color: var(--acc); border-color: transparent; }
.topo select.inp { width: auto; min-width: 190px; border-radius: 999px; box-shadow: var(--sombra-leve); border-color: transparent; }
.cab-pagina { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 4px 40px 24px; }
.cab-pagina p { margin: 6px 0 0; color: var(--muted); max-width: 760px; }
.pagina { padding: 0 40px 56px; }
.menu-btn { display: none !important; }
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .lateral { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 60; transform: translateX(-102%); transition: transform .22s; box-shadow: var(--sombra); }
  .lateral.aberta { transform: none; }
  .menu-btn { display: inline-grid !important; }
  .fundo-menu { position: fixed; inset: 0; background: rgba(20,10,5,.4); z-index: 55; }
  .topo { padding: 14px 20px; }
  .cab-pagina { padding: 4px 20px 18px; }
  .pagina { padding: 0 20px 40px; }
}
@media (max-width: 640px) {
  .topo { gap: 8px; }
  .topo .busca, .topo .so-largo { display: none; }
  h1 { font-size: 26px; }
  .topo select.inp { min-width: 0; max-width: 150px; font-size: 14px; }
  .btn-redondo { width: 44px; height: 44px; }
}

/* ---------- cartões ---------- */
.card { background: var(--surface); border-radius: var(--raio); padding: 26px; box-shadow: var(--sombra); min-width: 0; }
.card.plano { box-shadow: none; border: 1.5px solid var(--line); }
.card-tit { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-bottom: 24px; }
.kpi { background: var(--surface); border-radius: var(--raio); padding: 24px; box-shadow: var(--sombra); display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: var(--ink); min-width: 0; }
.kpi .ic { width: 52px; height: 52px; border-radius: 16px; background: var(--acc-soft); color: var(--acc); display: grid; place-items: center; }
.kpi .ic svg { width: 26px; height: 26px; }
.kpi .rot { font-size: 15px; color: var(--muted); }
.kpi .val { font-size: 34px; font-weight: 600; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .sub { font-size: 13px; color: var(--muted); }
.kpi.destaque { background: linear-gradient(145deg, var(--acc), color-mix(in srgb, var(--acc) 78%, #7a2a05)); color: var(--acc-ink); }
.kpi.destaque .ic { background: rgba(255,255,255,.2); color: var(--acc-ink); }
.kpi.destaque .rot, .kpi.destaque .sub { color: color-mix(in srgb, var(--acc-ink) 88%, transparent); }
@media (max-width: 1250px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .kpis { grid-template-columns: 1fr 1fr; gap: 12px; } .kpi { padding: 18px; } .kpi .val { font-size: 26px; } .kpi .ic { width: 42px; height: 42px; } }

/* ---------- tabelas (Noto: cabeçalho em faixa, linha alta com foto) ---------- */
.tabela { width: 100%; border-collapse: separate; border-spacing: 0; }
.tabela th { text-align: left; font-size: 15px; font-weight: 500; color: var(--ink-2); padding: 16px 18px; background: var(--surface-2); white-space: nowrap; }
.tabela th:first-child { border-radius: 14px 0 0 14px; } .tabela th:last-child { border-radius: 0 14px 14px 0; }
.tabela td { padding: 16px 18px; border-bottom: 1.5px solid var(--line); vertical-align: middle; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela tr.click { cursor: pointer; }
.tabela tr.click:hover td { background: var(--acc-soft-2); }
.rolavel { overflow-x: auto; }
.prod { display: flex; align-items: center; gap: 14px; min-width: 0; }
.foto { width: 56px; height: 56px; border-radius: 14px; background: #fff; border: 1.5px solid var(--line); object-fit: contain; flex: none; }
.foto.p { width: 44px; height: 44px; border-radius: 11px; }
.foto.g { width: 88px; height: 88px; border-radius: 18px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; border-radius: 10px; padding: 5px 12px; white-space: nowrap; }
.pill.novo { background: var(--acc-soft); color: var(--acc); } .pill.separado { background: var(--ia-soft); color: var(--ia); } .pill.saiu { background: var(--info-soft); color: var(--info); }
.pill.entregue, .pill.retirado, .pill.ok, .pill.conectado { background: var(--ok-soft); color: var(--ok); } .pill.cancelado, .pill.erro { background: var(--bad-soft); color: var(--bad); }
.pill.ia { background: var(--ia-soft); color: var(--ia); } .pill.humano { background: var(--warn-soft); color: var(--warn); }
.pill.encerrada, .pill.pendente, .pill.desligado { background: var(--surface-3); color: var(--muted); }
.pill.pq { font-size: 12px; padding: 3px 9px; border-radius: 8px; }
.etiqueta { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; border-radius: 99px; padding: 4px 12px; background: var(--surface-3); color: var(--ink-2); }
.etiqueta button { border: 0; background: none; cursor: pointer; padding: 0; color: var(--muted); font-size: 16px; line-height: 1; }

/* ---------- abas: segmentado (Vora) e sublinhado (Noto) ---------- */
.segmento { display: inline-flex; background: var(--surface-3); border-radius: 999px; padding: 5px; gap: 4px; flex-wrap: wrap; }
.segmento button { border: 0; background: transparent; border-radius: 999px; padding: 9px 18px; font-size: 15px; font-weight: 500; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.segmento button[aria-pressed="true"] { background: var(--surface); color: var(--acc); box-shadow: var(--sombra-leve); font-weight: 600; }
.segmento button b { margin-left: 6px; font-weight: 700; }
.sublinhado { display: flex; gap: 30px; border-bottom: 1.5px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.sublinhado button { border: 0; background: none; padding: 12px 0; font-size: 15px; font-weight: 500; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-2); cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -1.5px; white-space: nowrap; }
.sublinhado button[aria-pressed="true"] { color: var(--acc); border-bottom-color: var(--acc); }
.sublinhado button b { margin-left: 6px; }

/* ---------- estados ---------- */
.vazio { text-align: center; padding: 56px 20px; color: var(--muted); }
.vazio svg { width: 52px; height: 52px; color: var(--acc); opacity: .55; margin-bottom: 12px; }
.vazio b { display: block; color: var(--ink); font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.carregando { padding: 56px; text-align: center; color: var(--muted); }
.carregando::before { content: ''; display: block; width: 32px; height: 32px; margin: 0 auto 12px; border: 3px solid var(--line); border-top-color: var(--acc); border-radius: 50%; animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
.aviso { border-radius: var(--raio-m); padding: 16px 20px; background: var(--acc-soft-2); border: 1.5px solid color-mix(in srgb, var(--acc) 28%, transparent); margin-bottom: 20px; display: flex; gap: 14px; align-items: flex-start; }
.aviso.erro { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.aviso svg { width: 22px; height: 22px; flex: none; margin-top: 2px; color: var(--acc); }
.aviso.erro svg { color: var(--bad); }

/* ---------- gráfico ---------- */
.grafico { position: relative; }
.grafico svg { display: block; width: 100%; height: auto; overflow: visible; }
.grafico .dica { position: absolute; pointer-events: none; background: var(--surface); border-radius: 12px; box-shadow: var(--sombra); padding: 10px 14px; font-size: 14px; white-space: nowrap; transform: translate(-50%, calc(-100% - 14px)); border: 1.5px solid var(--line); }

/* ---------- ATENDIMENTO (layout Mensagens do Vora: três painéis) ---------- */
.atend { display: grid; grid-template-columns: 380px minmax(0, 1fr) 350px; grid-template-rows: minmax(0, 1fr); gap: 20px; height: calc(100vh - 94px); padding: 0 40px 24px; }
.painel-a { background: var(--surface); border-radius: var(--raio); box-shadow: var(--sombra); display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; }
.lista-cab { padding: 22px 22px 14px; display: flex; flex-direction: column; gap: 14px; border-bottom: 1.5px solid var(--line); }
.eu-status { display: flex; align-items: center; gap: 12px; }
.eu-status b { display: block; font-size: 16px; }
.disp { font-size: 13px; color: var(--ok); display: inline-flex; align-items: center; gap: 6px; }
.disp::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.filtros-conv { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.filtros-conv button { border: 1.5px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer; color: var(--ink-2); }
.filtros-conv button[aria-pressed="true"] { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.itens-conv { overflow-y: auto; flex: 1; }
.conv { display: flex; gap: 14px; padding: 16px 22px; cursor: pointer; border-bottom: 1.5px solid var(--line); position: relative; }
.conv:hover { background: var(--surface-2); }
.conv.ativa { background: var(--acc-soft-2); }
.conv.ativa::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: var(--acc); }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--acc-soft); color: var(--acc); display: grid; place-items: center; font-weight: 600; font-size: 16px; flex: none; position: relative; }
.avatar.g { width: 88px; height: 88px; font-size: 30px; margin: 0 auto; }
.avatar.p { width: 38px; height: 38px; font-size: 14px; }
.avatar .canal { position: absolute; right: -2px; bottom: -2px; width: 20px; height: 20px; border-radius: 50%; background: #25A244; border: 2.5px solid var(--surface); display: grid; place-items: center; }
.avatar .canal svg { width: 11px; height: 11px; color: #fff; }
.conv .meio { flex: 1; min-width: 0; }
.conv .nome { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; font-size: 16px; }
.conv .nome span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .hora { font-size: 13px; color: var(--muted); font-weight: 400; flex: none; }
.conv .prev { color: var(--muted); font-size: 14px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin-top: 2px; }
.conv .tags { display: flex; gap: 6px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.bolinha { background: var(--acc); color: var(--acc-ink); border-radius: 99px; font-size: 12px; min-width: 22px; height: 22px; padding: 0 7px; display: inline-grid; place-items: center; font-weight: 700; margin-left: auto; }
.chat-cab { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-bottom: 1.5px solid var(--line); flex-wrap: wrap; }
.chat-cab .quem { flex: 1 1 180px; min-width: 0; }
.chat-cab .quem b { display: block; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-cab .quem span { font-size: 13px; color: var(--muted); }
.chat-msgs { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.msg { display: flex; gap: 10px; align-items: flex-end; max-width: 78%; }
.msg.dir { align-self: flex-end; flex-direction: row-reverse; }
.bolha { padding: 12px 16px; border-radius: 20px; white-space: pre-wrap; word-wrap: break-word; font-size: 15px; line-height: 1.5; box-shadow: 0 1px 2px rgba(0,0,0,.04); min-width: 0; }
.bolha.cliente { background: var(--bolha-cli); border: 1.5px solid var(--line); border-bottom-left-radius: 6px; }
.bolha.ia { background: var(--bolha-ia); border-bottom-right-radius: 6px; }
.bolha.atendente { background: var(--bolha-eq); color: var(--bolha-eq-ink); border-bottom-right-radius: 6px; }
.bolha img { display: block; width: 240px; max-width: 100%; border-radius: 14px; background: #fff; margin-bottom: 8px; }
.bolha .meta { font-size: 12px; opacity: .8; margin-top: 6px; text-align: right; }
.bolha.falhou { outline: 2px solid var(--bad); }
.selo-ia { font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--ia); background: var(--ia-soft); border-radius: 6px; padding: 1px 6px; margin-right: 4px; }
.nota-sis { align-self: center; font-size: 13px; color: var(--muted); background: var(--surface); border: 1.5px dashed var(--line-2); border-radius: 99px; padding: 5px 16px; max-width: 90%; text-align: center; }
.chat-envio { padding: 14px 20px 18px; border-top: 1.5px solid var(--line); background: var(--surface); position: relative; }
.chat-envio .caixa { display: flex; gap: 10px; align-items: flex-end; background: var(--surface-2); border: 1.5px solid var(--line-2); border-radius: 22px; padding: 8px 8px 8px 18px; }
.chat-envio .caixa:focus-within { border-color: var(--acc); box-shadow: 0 0 0 4px var(--acc-soft); }
.chat-envio textarea { flex: 1; border: 0; background: transparent; resize: none; min-height: 44px; max-height: 160px; padding: 10px 0; outline: none; font-size: 15px; }
.acoes-envio { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.acoes-envio .btn { min-height: 36px; padding: 0 14px; font-size: 14px; background: var(--surface-2); border-color: transparent; }
.acoes-envio .btn:hover { background: var(--acc-soft); color: var(--acc); }
.acoes-envio .btn svg { width: 18px; height: 18px; }
.enviar { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--acc); color: var(--acc-ink); display: grid; place-items: center; cursor: pointer; flex: none; }
.enviar svg { width: 20px; height: 20px; }
.enviar:disabled { opacity: .5; }
.rapidas { position: absolute; left: 20px; right: 20px; bottom: calc(100% - 6px); background: var(--surface); border-radius: var(--raio-m); box-shadow: var(--sombra); border: 1.5px solid var(--line); max-height: 340px; overflow-y: auto; z-index: 10; padding: 8px; }
.rapidas button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.rapidas button:hover, .rapidas button.sel { background: var(--acc-soft-2); }
.rapidas b { color: var(--acc); font-weight: 600; margin-right: 8px; }
.rapidas span { color: var(--muted); font-size: 14px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ficha { overflow-y: auto; padding: 26px 22px; flex: 1; min-height: 0; }
.ficha .topo-ficha { text-align: center; padding-bottom: 20px; border-bottom: 1.5px solid var(--line); }
.ficha .topo-ficha b { display: block; font-size: 19px; margin-top: 12px; }
.ficha section { padding: 18px 0; border-bottom: 1.5px solid var(--line); }
.ficha section:last-child { border-bottom: 0; }
.ficha h3 { font-size: 15px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ficha dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 14px; }
.ficha dt { color: var(--muted); } .ficha dd { margin: 0; word-break: break-word; }
.compra { display: flex; gap: 12px; align-items: center; padding: 10px 0; }
.compra + .compra { border-top: 1px solid var(--line); }
.compra .info { flex: 1; min-width: 0; font-size: 14px; }
.compra .info b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nota-int { background: var(--warn-soft); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin-bottom: 8px; }
.nota-int small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.voltar-lista, .fechar-ficha { display: none !important; }
@media (max-width: 1440px) {
  .atend { grid-template-columns: 350px minmax(0, 1fr); }
  .atend .ficha-painel { display: none; }
  .atend.com-ficha .ficha-painel { display: flex; position: fixed; right: 24px; top: 96px; bottom: 24px; width: 380px; z-index: 30; }
  .fechar-ficha { display: inline-grid !important; }
}
@media (min-width: 1441px) { .so-ficha-flutuante { display: none !important; } }
@media (max-width: 1024px) { .atend { padding: 0 20px 16px; height: calc(100vh - 80px); } }
@media (max-width: 860px) {
  .atend { grid-template-columns: 1fr; gap: 0; padding: 0 12px 12px; }
  .atend.com-conversa .lista-painel { display: none; }
  .atend:not(.com-conversa) .chat-painel { display: none; }
  .voltar-lista { display: inline-grid !important; }
  .msg { max-width: 92%; }
  .atend.com-ficha .ficha-painel { left: 12px; right: 12px; top: 76px; bottom: 12px; width: auto; }
  .chat-msgs { padding: 16px; }
}

/* ---------- fila de preço ---------- */
.fila { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 20px; }
.fila-item { display: flex; flex-direction: column; gap: 16px; }
.fila-item .pergunta { background: var(--surface-2); border-radius: var(--raio-m); padding: 14px 16px; }
.fila-item form { display: flex; gap: 10px; }
.fila-item form .inp { font-size: 18px; font-weight: 600; }
@media (max-width: 420px) { .fila { grid-template-columns: 1fr; } }

/* ---------- vitrine de produtos ---------- */
.grade-prod { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
@media (max-width: 520px) { .grade-prod { grid-template-columns: 1fr 1fr; gap: 12px; } }
.cartao-prod { background: var(--surface); border-radius: var(--raio); box-shadow: var(--sombra); overflow: hidden; display: flex; flex-direction: column; border: 0; text-align: left; padding: 0; font: inherit; color: inherit; }
button.cartao-prod { cursor: pointer; }
button.cartao-prod:hover { outline: 2.5px solid var(--acc); }
.cartao-prod img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; padding: 12px; }
.cartao-prod .b { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.marca-p { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.preco { font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.preco s { color: var(--muted); font-weight: 400; font-size: 14px; margin-right: 6px; }
.perfil-p { font-size: 13px; color: var(--acc); }

/* ---------- diálogos (nunca alert/confirm do navegador) ---------- */
.dlg-fundo { position: fixed; inset: 0; background: rgba(30,15,5,.45); display: grid; place-items: center; z-index: 100; padding: 16px; }
.dlg { background: var(--surface); border-radius: 26px; padding: 30px; width: min(520px, 100%); box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); max-height: 90vh; overflow-y: auto; }
.dlg.largo { width: min(920px, 100%); }
.dlg h2 { font-size: 22px; margin-bottom: 10px; }
.dlg .acoes { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 14px 22px; border-radius: 999px; z-index: 110; box-shadow: var(--sombra); font-size: 15px; font-weight: 500; max-width: calc(100% - 32px); }
.gaveta { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--surface); z-index: 90; box-shadow: -20px 0 60px -20px rgba(0,0,0,.35); display: flex; flex-direction: column; border-radius: 26px 0 0 26px; }
.gaveta.larga { width: min(1000px, 100%); }
.gaveta .cab { display: flex; align-items: center; justify-content: space-between; padding: 24px 28px; border-bottom: 1.5px solid var(--line); gap: 12px; }
.gaveta .corpo { padding: 24px 28px; overflow-y: auto; flex: 1; }
.gaveta .pe { padding: 18px 28px; border-top: 1.5px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 640px) { .gaveta { border-radius: 0; } .gaveta .cab, .gaveta .corpo, .gaveta .pe { padding-left: 18px; padding-right: 18px; } }

/* montar pedido */
.montar { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; }
@media (max-width: 860px) { .montar { grid-template-columns: 1fr; } }
.item-carrinho { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.item-carrinho .info { flex: 1; min-width: 0; font-size: 14px; }
.qtd { display: inline-flex; align-items: center; border: 1.5px solid var(--line-2); border-radius: 999px; flex: none; }
.qtd button { border: 0; background: none; width: 34px; height: 34px; cursor: pointer; font-size: 18px; color: var(--acc); }
.qtd span { min-width: 22px; text-align: center; font-weight: 600; }
.totais { display: grid; grid-template-columns: 1fr auto; gap: 8px; font-size: 15px; margin: 16px 0; }
.totais .total { font-size: 22px; font-weight: 700; }
.resultados-busca { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; max-height: 52vh; overflow-y: auto; padding: 4px; }
.resultados-busca .cartao-prod img { padding: 8px; }
.resultados-busca .cartao-prod .b { padding: 10px 12px 12px; font-size: 13px; }
.resultados-busca .preco { font-size: 15px; }

/* ---------- login ---------- */
.login-tela { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-arte { background: var(--lat); color: var(--lat-ink); padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login-arte h1 { font-size: clamp(36px, 4.2vw, 56px); line-height: 1.08; max-width: 560px; font-weight: 600; }
.login-arte p { max-width: 480px; opacity: .92; font-size: 18px; }
.assinatura-login { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; font-size: 12px; }
.assinatura-login span { max-width: 320px; opacity: .8; }
.assinatura-login strong { white-space: nowrap; letter-spacing: .04em; }
.login-form { display: grid; place-items: center; padding: 32px 20px; }
.login-form form { width: min(420px, 100%); }
@media (max-width: 860px) { .login-tela { grid-template-columns: 1fr; } .login-arte { padding: 32px 24px; min-height: 300px; } .assinatura-login { align-items: flex-start; flex-direction: column; gap: 6px; } }
.data-sep { align-self: center; margin: 10px auto 2px; padding: 4px 14px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 12.5px; font-weight: 500; }
/* textos só para leitor de tela ficam presos dentro das áreas que rolam (não esticam a página) */
.painel-a, .ficha, .itens-conv, .chat-msgs, .gaveta .corpo, .dlg { position: relative; }
@media (max-width: 640px) {
  .chat-cab { padding: 12px 14px; gap: 8px; }
  .chat-cab > .avatar { display: none; }
  .chat-cab .quem { flex: 1 1 120px; }
  .chat-cab .btn-redondo { width: 42px; height: 42px; }
  .chat-cab .btn.pq { min-height: 40px; padding: 0 14px; }
  .acoes-envio { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -4px 10px; padding: 0 4px; }
  .acoes-envio::-webkit-scrollbar { display: none; }
  .acoes-envio .btn { flex: none; }
  .chat-envio { padding: 12px; }
  .so-largo { display: none !important; }
}
.gaveta .fechar-ficha { display: none !important; }

/* ---------- Encanta: marca e Encantar ---------- */
.marca .nome-marca { font-size: 25px; font-weight: 600; letter-spacing: -.01em; }
.encantar-card .card-tit svg { color: var(--acc); width: 24px; height: 24px; flex: none; }
.mini-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.mini-kpis > div { background: var(--surface-2); border-radius: var(--raio-m); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.mini-kpis .rot { font-size: 13px; color: var(--muted); }
.mini-kpis b { font-size: 26px; font-weight: 600; }
.mini-kpis small { font-size: 13px; color: var(--muted); }
@media (max-width: 900px) { .mini-kpis { grid-template-columns: 1fr 1fr; } }
.estrelas { color: #E8A317; letter-spacing: 1px; font-size: 16px; white-space: nowrap; }
.estrelas span { color: var(--line-2); }
.estrelas-num { color: #B7790A; font-weight: 600; }
.nota-grande { font-size: 56px; font-weight: 600; line-height: 1; }
.barras-nota { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.barras-nota > div { display: grid; grid-template-columns: 44px 1fr 32px; align-items: center; gap: 10px; font-size: 14px; }
.barras-nota .trilho { height: 10px; border-radius: 9px; background: var(--surface-3); overflow: hidden; }
.barras-nota .trilho i { display: block; height: 100%; background: #E8A317; border-radius: 9px; }
.barras-nota b { text-align: right; font-weight: 500; }
.pilha-mini { display: flex; flex-direction: column; gap: 10px; }
.aval { background: var(--surface-2); border-radius: var(--raio-m); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.aval.baixa { background: var(--bad-soft, #FDECEC); }
.regras { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 760px) { .regras { grid-template-columns: 1fr; } }
.regra { display: flex; gap: 14px; align-items: flex-start; background: var(--surface-2); border-radius: var(--raio-m); padding: 16px; cursor: pointer; }
.regra input[type=checkbox] { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--acc); flex: none; }
.regra b { display: block; margin-bottom: 2px; }
.regra span { font-size: 14px; color: var(--muted); }
.grupo-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--raio-m); background: var(--surface-2); }
.grupo-item .avatar svg { width: 20px; height: 20px; }
.grupo-item.ativo { background: var(--acc-soft-2); box-shadow: inset 0 0 0 1.5px var(--acc-soft); }
.chave { position: relative; display: inline-block; width: 50px; height: 30px; flex: none; cursor: pointer; }
.chave input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chave i { position: absolute; inset: 0; border-radius: 99px; background: var(--line-2); transition: background .15s; }
.chave i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.chave input:checked + .sr + i, .chave input:checked ~ i { background: var(--acc); }
.chave input:checked ~ i::after { transform: translateX(20px); }
.chave input:focus-visible ~ i { outline: 3px solid var(--acc-soft); outline-offset: 2px; }
.envio-grupo { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1.5px solid var(--line); }
.envio-grupo:last-child { border-bottom: 0; }
.previa-whats { white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.bolha-grupo { background: #E7F8DC; color: #1F2A1C; border-radius: 16px; padding: 8px; margin: 12px 0; white-space: pre-wrap; font-size: 15px; max-height: 60vh; overflow: auto; }
.bolha-grupo img { width: 100%; max-height: 260px; object-fit: contain; background: #fff; border-radius: 12px; display: block; margin-bottom: 8px; }
.bolha-grupo > div { padding: 0 6px 6px; }
/* campanhas e réguas */
.camp { cursor: pointer; transition: transform .12s, box-shadow .12s; }
.camp:hover { transform: translateY(-2px); box-shadow: var(--sombra); }
.trilho-camp { height: 8px; border-radius: 9px; background: var(--surface-3); overflow: hidden; margin: 10px 0 6px; }
.trilho-camp i { display: block; height: 100%; background: var(--acc); border-radius: 9px; }
.regra.regua { cursor: default; }
.regra.regua.ativa { background: var(--acc-soft-2); box-shadow: inset 0 0 0 1.5px var(--acc-soft); }
.mini-inp { width: 64px; min-height: 32px; padding: 2px 8px; font-size: 14px; display: inline-block; margin: 0 4px; }
.avancado { background: var(--surface-2); border-radius: var(--raio-m); padding: 12px 16px; margin-bottom: 12px; }
.avancado summary { cursor: pointer; font-weight: 500; }
.gaveta .cab .pill { margin-left: auto; margin-right: 10px; }
@keyframes pulsar { from { opacity: .45 } to { opacity: 1 } }
/* inteligência artificial */
.escolha-ia { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
@media (max-width: 760px) { .escolha-ia { grid-template-columns: 1fr; } }
.opcao-ia { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: var(--raio-m); background: var(--surface-2); cursor: pointer; border: 1.5px solid transparent; }
.opcao-ia.sel { background: var(--acc-soft-2); border-color: var(--acc); }
.opcao-ia input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--acc); flex: none; }
.opcao-ia b { display: block; margin-bottom: 2px; }
.opcao-ia span { font-size: 14px; color: var(--muted); }
/* grupos e QR code */
.autor-g { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.autor-g span { font-weight: 400; color: var(--muted); font-size: 12px; }
.conv.saiu { opacity: .55; }
.part { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.part:last-child { border-bottom: 0; }
.part .info { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; }
.part .info b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.part .info span { font-size: 12.5px; }
.acoes-part { display: flex; gap: 4px; width: 100%; padding-left: 46px; }
.acoes-part .btn { min-height: 30px; padding: 0 10px; font-size: 12.5px; }
.qr-dlg { max-width: 760px; }
.qr-corpo { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: center; margin-top: 12px; }
@media (max-width: 700px) { .qr-corpo { grid-template-columns: 1fr; } }
.qr-img { width: 300px; height: 300px; max-width: 100%; display: grid; place-items: center; background: #fff; border-radius: var(--raio-m); box-shadow: inset 0 0 0 1.5px var(--line); margin: 0 auto; }
.qr-img img { width: 100%; height: 100%; object-fit: contain; }
.qr-passos { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.qr-ok { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 24px; }
.qr-ok svg { width: 56px; height: 56px; color: #1FA855; }
.qr-ok b { font-size: 20px; }
