/* Plataforma de Agentes — identidade visual.
   Paleta "Grafite e Latão": fundos de pedra/grafite, tinta quase preta, um único acento petróleo para ação e latão para destaque.
   Layout: menu lateral fixo + conteúdo; no celular, barra superior. Os nomes de classe são a API das telas: não renomear. */
:root {
  --bg: #f4f2ed;            /* pedra clara, quente */
  --superficie: #ffffff;
  --superficie-2: #ece9e2;  /* hover, baloes, campos secundarios */
  --superficie-3: #e2ded5;
  --texto: #15181b;         /* tinta */
  --texto-2: #6b6760;       /* cinza quente */
  --texto-3: #9a958c;
  --linha: #e3dfd6;
  --linha-forte: #cfc9bd;
  --acento: #0f3f40;        /* petroleo profundo: acao principal */
  --acento-forte: #0a2d2e;
  --acento-suave: #e3edec;
  --acento-texto: #ffffff;
  --latao: #a8814a;         /* destaque, selecionado, marca */
  --latao-suave: #f3ebdc;
  --ok: #2f6b45; --ok-suave: #e4efe6;
  --aviso: #9a5b14; --aviso-suave: #f7eadb;
  --erro: #a1322f; --erro-suave: #f8e5e3;
  --info: #35567f; --info-suave: #e5ebf4;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --raio: 12px; --raio-p: 8px;
  --sombra: 0 1px 1px rgba(21, 24, 27, .04), 0 10px 30px -18px rgba(21, 24, 27, .22);
  --sombra-alta: 0 24px 60px -24px rgba(21, 24, 27, .45);
  --menu-l: 248px;
  --anel: 0 0 0 3px rgba(15, 63, 64, .18);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1113; --superficie: #16191c; --superficie-2: #1e2226; --superficie-3: #272c31;
    --texto: #ece9e3; --texto-2: #a39e95; --texto-3: #726d65;
    --linha: #262b30; --linha-forte: #343a40;
    --acento: #7fbfb9; --acento-forte: #a3d4cf; --acento-suave: #15302f; --acento-texto: #0b1a19;
    --latao: #c9a86a; --latao-suave: #2a2416;
    --ok: #8fcf9f; --ok-suave: #15291b; --aviso: #e6b06e; --aviso-suave: #2e2214; --erro: #ef9a93; --erro-suave: #341b1a;
    --info: #9bb8e3; --info-suave: #1a2434;
    --sombra: 0 1px 1px rgba(0, 0, 0, .3), 0 10px 30px -18px rgba(0, 0, 0, .7); --sombra-alta: 0 24px 60px -24px rgba(0, 0, 0, .8);
    --anel: 0 0 0 3px rgba(127, 191, 185, .22);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1113; --superficie: #16191c; --superficie-2: #1e2226; --superficie-3: #272c31;
  --texto: #ece9e3; --texto-2: #a39e95; --texto-3: #726d65;
  --linha: #262b30; --linha-forte: #343a40;
  --acento: #7fbfb9; --acento-forte: #a3d4cf; --acento-suave: #15302f; --acento-texto: #0b1a19;
  --latao: #c9a86a; --latao-suave: #2a2416;
  --ok: #8fcf9f; --ok-suave: #15291b; --aviso: #e6b06e; --aviso-suave: #2e2214; --erro: #ef9a93; --erro-suave: #341b1a;
  --info: #9bb8e3; --info-suave: #1a2434;
  --sombra: 0 1px 1px rgba(0, 0, 0, .3), 0 10px 30px -18px rgba(0, 0, 0, .7); --sombra-alta: 0 24px 60px -24px rgba(0, 0, 0, .8);
  --anel: 0 0 0 3px rgba(127, 191, 185, .22);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--texto); font: 14.5px/1.55 var(--sans); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
a { color: var(--acento); text-decoration-thickness: 1px; text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-family: var(--serif); font-weight: 400; font-size: 2rem; letter-spacing: 0; }
h2 { font-size: 1.05rem; } h3 { font-size: .95rem; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: .88em; }
.num { font-variant-numeric: tabular-nums; }
.mudo { color: var(--texto-2); }
.pequeno { font-size: .84rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
::selection { background: var(--latao-suave); color: var(--texto); }
* { scrollbar-width: thin; scrollbar-color: var(--linha-forte) transparent; }

/* Layout */
.app { min-height: 100%; }
.layout { display: grid; grid-template-columns: var(--menu-l) 1fr; min-height: 100vh; }
.menu { background: var(--superficie); border-right: 1px solid var(--linha); padding: 22px 14px 18px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.marca { display: flex; align-items: center; gap: 10px; padding: 0 6px; min-width: 0; }
.logotipo { width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--acento); color: var(--acento-texto); display: grid; place-items: center; }
.logotipo svg { width: 19px; height: 19px; }
.marca-texto { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.marca strong { font-size: .92rem; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.empresa-linha { display: flex; align-items: center; gap: 4px; min-width: 0; }
.marca .empresa { font-size: .8rem; color: var(--texto-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn.trocar { padding: 1px 6px; font-size: .74rem; color: var(--latao); gap: 3px; }
.btn.trocar svg { width: 12px; height: 12px; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-grupo { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: var(--texto-3); padding: 14px 10px 6px; font-weight: 600; }
.nav-grupo:first-child { padding-top: 0; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--raio-p); color: var(--texto-2); text-decoration: none; font-weight: 500; font-size: .9rem; transition: background .12s, color .12s; position: relative; }
.nav a:hover { background: var(--superficie-2); color: var(--texto); }
.nav a.ativo { background: var(--acento-suave); color: var(--acento-forte); }
.nav a.ativo::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--latao); }
.nav svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.menu-rodape { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 14px 4px 0; border-top: 1px solid var(--linha); font-size: .84rem; }
.quem { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--latao-suave); color: var(--latao); display: grid; place-items: center; font-size: .72rem; font-weight: 600; letter-spacing: .04em; flex: none; }
.quem-texto { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.quem-texto strong { font-weight: 600; font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quem-texto span { font-size: .74rem; }
.conteudo { padding: 34px clamp(18px, 3.4vw, 48px) 72px; min-width: 0; max-width: 1480px; }
.conteudo > .cabecalho { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 26px; }
.cabecalho p { color: var(--texto-2); max-width: 68ch; margin-top: 6px; }
.acoes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Botões */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: var(--raio-p); border: 1px solid var(--linha-forte); background: var(--superficie); cursor: pointer; font-weight: 500; font-size: .9rem; line-height: 1.2; white-space: nowrap; transition: background .12s, border-color .12s, transform .06s, box-shadow .12s; }
.btn:hover { background: var(--superficie-2); border-color: var(--texto-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primario { background: var(--acento); border-color: var(--acento); color: var(--acento-texto); box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset; }
.btn.primario:hover { background: var(--acento-forte); border-color: var(--acento-forte); }
.btn.perigo { color: var(--erro); border-color: transparent; background: var(--erro-suave); }
.btn.perigo:hover { border-color: var(--erro); background: var(--erro-suave); }
.btn.pequeno { padding: 5px 10px; font-size: .82rem; gap: 5px; }
.btn.texto { border-color: transparent; background: transparent; color: var(--texto-2); }
.btn.texto:hover { background: var(--superficie-2); color: var(--texto); }
.btn svg { width: 15px; height: 15px; }

/* Formulários */
.campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.campo label, .campo .rotulo { font-weight: 500; font-size: .84rem; color: var(--texto); }
.campo .ajuda { font-size: .8rem; color: var(--texto-2); line-height: 1.45; }
.campo input, .campo select, .campo textarea, .entrada { width: 100%; padding: 9px 12px; border: 1px solid var(--linha-forte); border-radius: var(--raio-p); background: var(--superficie); min-height: 40px; transition: border-color .12s, box-shadow .12s; }
.campo input::placeholder, .campo textarea::placeholder, .entrada::placeholder { color: var(--texto-3); }
.campo textarea { min-height: 112px; resize: vertical; line-height: 1.5; }
.campo textarea.mono { font-family: var(--mono); font-size: .86rem; }
.campo input:focus, .campo select:focus, .campo textarea:focus, .entrada:focus { border-color: var(--acento); outline: none; box-shadow: var(--anel); }
.campo select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--texto-2) 50%), linear-gradient(135deg, var(--texto-2) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.linha-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.form { display: flex; flex-direction: column; gap: 18px; }
.troca { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: .9rem; }
.troca input { width: 16px; height: 16px; accent-color: var(--acento); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 40px; padding: 5px 8px; border: 1px solid var(--linha-forte); border-radius: var(--raio-p); background: var(--superficie); }
.chips:focus-within { border-color: var(--acento); box-shadow: var(--anel); }
.chips input { border: 0; background: transparent; flex: 1; min-width: 120px; padding: 4px; outline: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 500; letter-spacing: .01em; background: var(--superficie-2); color: var(--texto-2); border: 1px solid transparent; white-space: nowrap; }
.chip button { border: 0; background: transparent; cursor: pointer; padding: 0 2px; color: var(--texto-2); line-height: 1; }
.chip.ok { background: var(--ok-suave); color: var(--ok); }
.chip.aviso { background: var(--aviso-suave); color: var(--aviso); }
.chip.erro { background: var(--erro-suave); color: var(--erro); }
.chip.info { background: var(--info-suave); color: var(--info); }
.chip.acento { background: var(--latao-suave); color: var(--latao); }
.chip.botao { cursor: pointer; transition: border-color .12s, background .12s; }
.chip.botao:hover { border-color: var(--linha-forte); }
.chip.botao.ativo { border-color: var(--acento); background: var(--acento-suave); color: var(--acento-forte); }
.lista-textos { display: flex; flex-direction: column; gap: 10px; }
.lista-textos .item { display: flex; gap: 8px; align-items: flex-start; }
.lista-textos textarea { flex: 1; min-height: 72px; }
.lista-textos .contador { font-size: .74rem; color: var(--texto-3); font-variant-numeric: tabular-nums; }

/* Cartões e tabelas */
.cartao { background: var(--superficie); border: 1px solid var(--linha); border-radius: var(--raio); padding: 20px 22px; box-shadow: var(--sombra); min-width: 0; }
.cartao > h2, .cartao > h3 { margin-bottom: 12px; }
.cartoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.kpi { position: relative; overflow: hidden; }
.kpi .valor { font-family: var(--serif); font-size: 2.4rem; font-weight: 400; font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -0.01em; }
.kpi .rotulo { color: var(--texto-2); font-size: .8rem; margin-top: 8px; text-transform: uppercase; letter-spacing: .08em; font-weight: 500; }
.kpi.alerta .valor { color: var(--aviso); }
.grade { display: grid; gap: 18px; }
.grade.duas { grid-template-columns: 2fr 1fr; }
.grade.meio { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .grade.duas, .grade.meio { grid-template-columns: 1fr; } }
.rolagem { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--linha); vertical-align: top; }
th { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--texto-3); font-weight: 600; font-family: var(--sans); padding-top: 4px; padding-bottom: 8px; }
tbody tr:last-child td { border-bottom: 0; }
tr.clicavel { cursor: pointer; }
tr.clicavel:hover td { background: var(--superficie-2); }
tr.selecionada td { background: var(--acento-suave); }
.paginacao { display: flex; align-items: center; gap: 10px; justify-content: flex-end; padding-top: 12px; font-size: .84rem; color: var(--texto-2); }
.vazio { padding: 40px 16px; text-align: center; color: var(--texto-2); display: flex; flex-direction: column; gap: 10px; align-items: center; }
.vazio strong { color: var(--texto); font-weight: 500; }
.carregando { color: var(--texto-3); padding: 24px; text-align: center; font-size: .9rem; }
.erro-caixa { background: var(--erro-suave); color: var(--erro); border: 1px solid transparent; padding: 11px 14px; border-radius: var(--raio-p); }
.aviso-caixa { background: var(--aviso-suave); color: var(--aviso); border-left: 3px solid var(--aviso); padding: 11px 14px; border-radius: 0 var(--raio-p) var(--raio-p) 0; }
.ok-caixa { background: var(--ok-suave); color: var(--ok); border-left: 3px solid var(--ok); padding: 11px 14px; border-radius: 0 var(--raio-p) var(--raio-p) 0; }
.info-caixa { background: var(--superficie-2); color: var(--texto-2); border-left: 3px solid var(--latao); padding: 11px 14px; border-radius: 0 var(--raio-p) var(--raio-p) 0; line-height: 1.5; }
.info-caixa code { background: var(--superficie); padding: 1px 5px; border-radius: 4px; }
.barra { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--superficie-2); }
.barra span { display: block; height: 100%; }
.barra .b-env { background: var(--ok); } .barra .b-fila { background: var(--info); } .barra .b-pul { background: var(--aviso); } .barra .b-err { background: var(--erro); }
.legenda { display: flex; flex-wrap: wrap; gap: 12px; font-size: .78rem; color: var(--texto-2); }
.legenda i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.abas { display: flex; gap: 2px; border-bottom: 1px solid var(--linha); margin-bottom: 20px; overflow-x: auto; }
.abas button { border: 0; background: transparent; padding: 10px 14px; cursor: pointer; color: var(--texto-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; font-size: .9rem; transition: color .12s; }
.abas button:hover { color: var(--texto); }
.abas button.ativo { color: var(--texto); border-color: var(--latao); }
.passos { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; font-size: .82rem; }
.passos span { padding: 4px 11px; border-radius: 999px; background: var(--superficie-2); color: var(--texto-2); font-weight: 500; }
.passos span.ativo { background: var(--acento); color: var(--acento-texto); }
.passos span.feito { background: var(--ok-suave); color: var(--ok); }
.lista-simples { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lista-simples li { padding: 10px 0; border-bottom: 1px solid var(--linha); display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.lista-simples li > span:first-child { color: var(--texto-2); }
.lista-simples li:last-child { border-bottom: 0; }
.checklist li { align-items: flex-start; }
.checklist .ponto { width: 8px; height: 8px; border-radius: 50%; background: var(--aviso); flex: none; margin-top: 8px; }
.checklist .ponto.ok { background: var(--ok); }

/* Toast e modal */
.toasts { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: min(400px, calc(100vw - 32px)); }
.toast { background: var(--texto); color: var(--bg); padding: 11px 15px; border-radius: var(--raio-p); box-shadow: var(--sombra-alta); font-size: .88rem; border-left: 3px solid var(--latao); }
.toast.erro { border-left-color: var(--erro); }
.toast.ok { border-left-color: var(--ok); }
.modal-fundo { position: fixed; inset: 0; background: rgba(15, 17, 19, .55); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { background: var(--superficie); border: 1px solid var(--linha); border-radius: 14px; padding: 22px 24px; width: min(560px, 100%); max-height: 90vh; overflow: auto; box-shadow: var(--sombra-alta); display: flex; flex-direction: column; gap: 16px; }
.modal.larga { width: min(860px, 100%); }
.modal header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.modal header h2 { font-family: var(--serif); font-weight: 400; font-size: 1.45rem; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }

/* Tela de entrada */
.tela-cheia { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 70% -10%, var(--latao-suave), transparent 60%), var(--bg); }
.entrada { width: min(430px, 100%); display: flex; flex-direction: column; gap: 22px; }
.entrada .cartao { padding: 30px 32px; }
.entrada .logo { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1rem; letter-spacing: -0.01em; }
.entrada .logo::before { content: ""; width: 30px; height: 30px; border-radius: 9px; background: var(--acento); flex: none; }
.entrada h1 { font-size: 1.8rem; }

/* Conversas */
.conversas { display: grid; grid-template-columns: 340px 1fr; gap: 16px; height: calc(100vh - 160px); min-height: 480px; }
.conv-lista { display: flex; flex-direction: column; min-height: 0; padding: 14px; }
.conv-lista .filtros { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.conv-lista .itens { overflow: auto; flex: 1; display: flex; flex-direction: column; margin: 0 -6px; }
.conv-item { display: flex; flex-direction: column; gap: 3px; padding: 11px 12px; border-radius: var(--raio-p); cursor: pointer; border-left: 2px solid transparent; transition: background .12s; }
.conv-item:hover { background: var(--superficie-2); }
.conv-item.ativo { border-left-color: var(--latao); background: var(--acento-suave); }
.conv-item .topo { display: flex; justify-content: space-between; gap: 8px; font-weight: 500; font-size: .9rem; }
.conv-item .previa { font-size: .82rem; color: var(--texto-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-thread { display: flex; flex-direction: column; min-height: 0; }
.conv-thread .topo { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--linha); margin-bottom: 12px; }
.conv-thread .topo h2 { font-family: var(--serif); font-weight: 400; font-size: 1.35rem; }
.conv-thread .mensagens { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 10px; padding: 6px 2px; }
.balao { max-width: 76%; padding: 10px 14px; border-radius: 14px 14px 14px 4px; background: var(--superficie-2); align-self: flex-start; white-space: pre-wrap; word-break: break-word; line-height: 1.5; }
.balao.saida { align-self: flex-end; background: var(--acento-suave); border-radius: 14px 14px 4px 14px; }
.balao .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 7px; font-size: .72rem; color: var(--texto-2); }
.balao .acoes-rascunho { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.conv-thread .envio { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--linha); }
.conv-thread .envio textarea { flex: 1; min-height: 46px; max-height: 140px; resize: vertical; padding: 10px 12px; border: 1px solid var(--linha-forte); border-radius: var(--raio-p); background: var(--superficie); }
.conv-thread .envio textarea:focus { border-color: var(--acento); outline: none; box-shadow: var(--anel); }

/* CRM painel lateral */
.painel-lateral { position: fixed; top: 0; right: 0; height: 100vh; width: min(480px, 100vw); background: var(--superficie); border-left: 1px solid var(--linha); box-shadow: var(--sombra-alta); padding: 22px 24px; overflow: auto; z-index: 40; display: flex; flex-direction: column; gap: 16px; }
.painel-lateral h2 { font-family: var(--serif); font-weight: 400; font-size: 1.4rem; }
.eventos { display: flex; flex-direction: column; gap: 6px; font-size: .82rem; }
.eventos li { display: flex; gap: 8px; } .eventos time { color: var(--texto-3); white-space: nowrap; font-family: var(--mono); font-size: .74rem; }

/* Sala de testes */
.sala { display: grid; grid-template-rows: 1fr auto; height: 520px; }
.sala .mensagens { overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 8px 2px; }
.sala .detalhe { font-size: .74rem; color: var(--texto-3); font-family: var(--mono); margin-top: 4px; }

/* Gráfico */
.grafico svg { width: 100%; height: auto; display: block; }
.grafico text { font-family: var(--mono); font-size: 11px; fill: var(--texto-2); }

/* QR */
.qr { display: flex; justify-content: center; padding: 12px; background: #fff; border-radius: var(--raio-p); }
.qr img { width: 240px; height: 240px; max-width: 100%; }

/* Responsivo */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .menu { position: sticky; top: 0; height: auto; flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--linha); z-index: 30; overflow-x: auto; }
  .marca { flex: none; } .marca strong { display: none; }
  .nav { flex-direction: row; gap: 2px; } .nav-grupo { display: none; }
  .nav a { padding: 7px 9px; font-size: .84rem; } .nav a::before { display: none; }
  .nav a span { display: none; }
  .menu-rodape { margin-top: 0; margin-left: auto; flex-direction: row; align-items: center; border-top: 0; padding: 0; }
  .menu-rodape .quem { display: none; }
  .conteudo { padding: 18px 16px 50px; }
  h1 { font-size: 1.6rem; }
  .conversas { grid-template-columns: 1fr; height: auto; }
  .conversas.ver-thread .conv-lista { display: none; }
  .conversas:not(.ver-thread) .conv-thread { display: none; }
  .conv-thread { height: calc(100vh - 140px); }
  .painel-lateral { width: 100vw; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* CRM: funil */
.funil .colunas { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 1fr); gap: 14px; align-items: start; padding-bottom: 8px; }
.coluna { background: var(--superficie-2); border-radius: var(--raio); padding: 10px; min-height: 120px; }
.coluna.vazia { opacity: .7; }
.coluna > header { display: flex; justify-content: space-between; align-items: center; padding: 2px 6px 10px; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--texto-2); }
.cartoes-coluna { display: flex; flex-direction: column; gap: 10px; }
.cartao.lead { padding: 14px 14px 10px; box-shadow: none; }
.lead-topo { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.lead-nome { font-weight: 600; color: var(--texto); text-decoration: none; line-height: 1.3; }
.lead-nome:hover { color: var(--acento); }
.lead .ultima { background: var(--superficie-2); border-radius: var(--raio-p); padding: 8px 10px; margin: 6px 0; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.lead .proximo { color: var(--texto-2); margin: 6px 0; border-left: 2px solid var(--latao); padding-left: 8px; }
.lead .sugestao { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--texto-2); margin: 6px 0; }
.lead-rodape { justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--linha); }
.lead .mover { font-size: .8rem; padding: 4px 26px 4px 8px; min-height: 30px; border: 1px solid var(--linha-forte); border-radius: var(--raio-p); background: var(--superficie); appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--texto-2) 50%), linear-gradient(135deg, var(--texto-2) 50%, transparent 50%); background-position: calc(100% - 13px) 50%, calc(100% - 8px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }

/* CRM: resultados e tarefas */
.funil-barras { display: flex; flex-direction: column; gap: 10px; }
.funil-linha { display: grid; grid-template-columns: minmax(110px, 190px) 1fr 96px; gap: 12px; align-items: center; font-size: .88rem; }
.funil-rot { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.funil-trilho { background: var(--superficie-2); border-radius: 999px; height: 14px; overflow: hidden; }
.funil-barra { height: 100%; border-radius: 999px; background: var(--acento); transition: width .4s; }
.funil-num { text-align: right; white-space: nowrap; }
.tarefas li { align-items: flex-start; }
@media (max-width: 600px) { .funil-linha { grid-template-columns: 1fr 80px; } .funil-rot { grid-column: 1 / -1; } }

/* Seleção em lote */
.col-sel { width: 36px; text-align: center; padding-left: 6px; padding-right: 6px; }
.col-sel input { width: 16px; height: 16px; accent-color: var(--acento); cursor: pointer; vertical-align: middle; }
tr.marcada td { background: var(--latao-suave); }
.barra-lote { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; margin-bottom: 10px; border-radius: var(--raio-p); background: var(--superficie-2); border: 1px solid var(--linha); position: sticky; top: 8px; z-index: 5; }
.barra-lote select { min-height: 30px; padding: 4px 26px 4px 8px; font-size: .82rem; border: 1px solid var(--linha-forte); border-radius: var(--raio-p); background: var(--superficie); }

/* Aviso de versão nova */
.faixa-versao { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: var(--raio-p); background: var(--texto); color: var(--bg); box-shadow: var(--sombra-alta); border-left: 3px solid var(--latao); z-index: 70; font-size: .88rem; max-width: calc(100vw - 32px); }
.faixa-versao .btn.texto { color: var(--bg); opacity: .8; }
