/* CRM Aptus — estilo */
:root {
  --fundo: #f3f5f7;
  --painel: #ffffff;
  --borda: #e3e7ec;
  --texto: #1d2733;
  --muted: #6b7785;
  --pri: #0e7c66;
  --pri-escuro: #0a5f4e;
  --pri-claro: #e3f3ef;
  --ent: #ffffff;
  --sai: #dcf5ec;
  --alerta: #c2410c;
  --erro: #b42318;
  --raio: 10px;
  --sombra: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--fundo); color: var(--texto); font-size: 14px; line-height: 1.45; }
a { color: var(--pri); }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- topo */
.topo { height: 54px; background: #12212e; color: #e8eef3; display: flex; align-items: center; gap: 18px; padding: 0 16px; position: sticky; top: 0; z-index: 20; }
.marca { color: #fff; font-weight: 700; text-decoration: none; white-space: nowrap; font-size: 15px; }
.marca i { color: #34d399; }
.menu { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.menu a { color: #b8c4cf; text-decoration: none; padding: 8px 12px; border-radius: 8px; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.menu a:hover { background: rgba(255,255,255,.06); color: #fff; }
.menu a.ativo { background: rgba(52,211,153,.14); color: #fff; }
.topo-dir { display: flex; align-items: center; gap: 12px; }
.usuario-nome { color: #cfd8e0; white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.sair { color: #b8c4cf; padding: 6px; background: none; border: 0; cursor: pointer; font-size: inherit; }
.form-sair { display: inline; margin: 0; }
.presenca { border: 0; border-radius: 999px; padding: 6px 14px 6px 10px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.presenca .ponto { width: 10px; height: 10px; border-radius: 50%; }
.presenca.on { background: #10b981; color: #fff; }
.presenca.on .ponto { background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.3); }
.presenca.off { background: #475569; color: #e2e8f0; }
.presenca.off .ponto { background: #94a3b8; }
.presenca.almoco { background: #f59e0b; color: #fff; }
.presenca.almoco .ponto { background: #fff; }
.presenca-caixa { position: relative; }
.presenca-menu { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border-radius: 10px; box-shadow: 0 10px 30px rgba(15,23,42,.25); padding: 6px; z-index: 1000; width: 290px; }
.presenca-menu button { display: grid; grid-template-columns: 14px 1fr; column-gap: 8px; align-items: center; width: 100%; border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-weight: 600; color: #0f172a; font-size: 13px; }
.presenca-menu button:hover { background: #f1f5f9; }
.presenca-menu small { grid-column: 2; font-weight: 400; color: #64748b; font-size: 11.5px; }
.presenca-menu .ponto { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.p-on { background: #10b981; } .p-almoco { background: #f59e0b; } .p-off { background: #94a3b8; }

/* -------------------------------------------------------------- botões */
.btn { border: 1px solid var(--borda); background: #fff; color: var(--texto); padding: 7px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap; }
.btn:hover { background: #f8fafb; }
.btn.primario { background: var(--pri); border-color: var(--pri); color: #fff; }
.btn.primario:hover { background: var(--pri-escuro); }
.btn.perigo { color: var(--erro); }
.btn.azul { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn.azul:hover { background: #1d4ed8; }
.btn.icone { padding: 7px 9px; }
.btn:disabled { opacity: .5; cursor: default; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--cor, var(--pri)) 14%, white); color: color-mix(in srgb, var(--cor, var(--pri)) 75%, black); font-weight: 600; white-space: nowrap; }
.tag.cinza { --cor: #64748b; }
.tag.laranja { --cor: #ea580c; }
.tag.bot { --cor: #7c3aed; }
.tag.canal { --cor: #94a3b8; font-weight: 500; }

/* ---------------------------------------------------------- atendimento */
.pg-atendimento { overflow: hidden; }
.atend { display: grid; grid-template-columns: 360px 1fr auto; height: calc(100vh - 54px); }
.lista { background: var(--painel); border-right: 1px solid var(--borda); display: flex; flex-direction: column; min-height: 0; }
.abas { display: flex; flex-wrap: wrap; gap: 2px 2px; padding: 10px 8px 6px; }
.abas button { border: 0; background: transparent; padding: 6px 8px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; }
.abas button b { background: #e2e8f0; color: #334155; border-radius: 999px; padding: 0 6px; font-size: 11px; margin-left: 2px; }
.abas button b:empty { display: none; }
.abas button.ativa { background: var(--pri-claro); color: var(--pri-escuro); }
.abas button[data-aba="fila"] b { background: #fed7aa; color: #9a3412; }
.busca { margin: 4px 10px 8px; position: relative; }
.busca i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 12px; }
.busca input { width: 100%; border: 1px solid var(--borda); border-radius: 8px; padding: 8px 10px 8px 32px; font-size: 13px; background: #f8fafb; }
.lista-itens { overflow-y: auto; flex: 1; }
.vazio-lista { padding: 40px 20px; text-align: center; color: var(--muted); }
.item { display: flex; gap: 10px; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 12px; border-bottom: 1px solid #f0f2f5; cursor: pointer; position: relative; font: inherit; color: inherit; }
.item:hover { background: #f8fafb; }
.item.sel { background: var(--pri-claro); }
/* Conversa que acabou de cair para a pessoa (transferida/sorteada) e ainda não foi respondida */
.item.novo { background: #e0f2fe; box-shadow: inset 3px 0 0 #38bdf8; }
.item.novo:hover { background: #d3ecfb; }
.item.novo.sel { background: #cfe8fa; }
.tag.novo { --cor: #0284c7; }
.avatar { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; background: color-mix(in srgb, var(--cor, #0e7c66) 18%, white); color: color-mix(in srgb, var(--cor, #0e7c66) 80%, black); display: grid; place-items: center; font-weight: 700; font-size: 14px; position: relative; }
.canal-mini { position: absolute; right: -3px; bottom: -3px; background: #fff; border-radius: 50%; font-size: 13px; padding: 2px; color: #22c55e; }
.canal-mini.fa-instagram { color: #e1306c; }
.item-meio { flex: 1; min-width: 0; }
.l1 { display: flex; justify-content: space-between; gap: 8px; }
.l1 .nome { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l1 .quando { color: var(--muted); font-size: 11px; white-space: nowrap; }
.l2 { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 1px 0 4px; }
.l2 i { font-size: 10px; }
.l3 { display: flex; gap: 4px; flex-wrap: wrap; }
.badge { position: absolute; right: 12px; bottom: 10px; background: #10b981; color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 6px; }

.chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #eef1f4; }
.chat-vazio { margin: auto; text-align: center; color: var(--muted); padding: 20px; }
.chat-vazio > i { font-size: 46px; opacity: .35; }
.chat-vazio .dica { background: #fff7ed; color: #9a3412; padding: 10px 14px; border-radius: 8px; max-width: 360px; }
.chat-conteudo { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-topo { background: var(--painel); border-bottom: 1px solid var(--borda); padding: 10px 14px; display: flex; align-items: center; gap: 12px; }
.chat-quem { flex: 1; min-width: 0; }
.chat-quem .nome { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-quem .sub { color: var(--muted); font-size: 12px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.chat-acoes { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.voltar { display: none; border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--texto); }

.mensagens { flex: 1; overflow-y: auto; padding: 16px 6%; display: flex; flex-direction: column; gap: 4px; }
.carregando { margin: auto; color: var(--muted); }
.msg { max-width: min(560px, 78%); padding: 7px 10px 5px; border-radius: 10px; box-shadow: 0 1px 1px rgba(0,0,0,.06); word-wrap: break-word; overflow-wrap: anywhere; }
.msg.ent { align-self: flex-start; background: var(--ent); border-top-left-radius: 3px; }
.msg.sai { align-self: flex-end; background: var(--sai); border-top-right-radius: 3px; }
.msg.bot { background: #efe9fd; }
.m-autor { font-size: 11px; font-weight: 700; color: var(--pri-escuro); margin-bottom: 2px; }
.msg.bot .m-autor { color: #6d28d9; }
.m-rodape { font-size: 10.5px; color: var(--muted); text-align: right; margin-top: 2px; }
.m-rodape .lido { color: #0ea5e9; }
.m-rodape .falhou { color: var(--erro); }
.m-erro { font-size: 11.5px; color: var(--erro); border-top: 1px dashed #f3b4ae; margin-top: 4px; padding-top: 4px; }
.m-img { max-width: 100%; max-height: 320px; border-radius: 7px; display: block; cursor: zoom-in; }
.msg audio { width: 260px; max-width: 100%; }
.m-audio { display: flex; align-items: center; gap: 6px; max-width: 100%; }
.m-audio audio { flex: 1 1 auto; min-width: 0; }
.m-vel { flex: none; min-width: 44px; height: 30px; border-radius: 99px; border: 1px solid rgba(0,0,0,.15); background: #fff; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; color: #334155; padding: 0 8px; }
.m-vel:hover { background: #f1f5f9; }
.m-vel.ativo { background: #0f766e; border-color: #0f766e; color: #fff; }
.msg video { max-width: 100%; max-height: 320px; border-radius: 7px; }
.m-doc { display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,.04); padding: 8px 10px; border-radius: 7px; text-decoration: none; color: var(--texto); }
.m-doc i { font-size: 22px; color: var(--pri); }
.m-texto { margin-top: 2px; }
.sep-data { text-align: center; margin: 10px 0 4px; }
.sep-data span { background: #dfe5ea; color: #475569; font-size: 11.5px; padding: 3px 10px; border-radius: 6px; }
.sep-conv { text-align: center; color: var(--muted); font-size: 11.5px; margin: 14px 0 0; border-top: 1px dashed #c8d0d8; padding-top: 6px; }
.evento { text-align: center; margin: 4px 0; }
.evento span { display: inline-block; background: #fff8e6; color: #7a5a00; font-size: 12px; padding: 4px 10px; border-radius: 8px; max-width: 90%; }

.faixa { background: #fff7ed; color: #9a3412; padding: 8px 14px; font-size: 13px; border-top: 1px solid #fde4c8; }
.compositor { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; background: var(--painel); border-top: 1px solid var(--borda); }
.anexo { cursor: pointer; color: var(--muted); font-size: 19px; padding: 8px; }
.campo { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.campo textarea { width: 100%; resize: none; border: 1px solid var(--borda); border-radius: 10px; padding: 10px 12px; font: inherit; max-height: 160px; background: #f8fafb; }
.campo textarea:focus { outline: 2px solid var(--pri-claro); border-color: var(--pri); background: #fff; }
.arquivo-chip { display: flex; align-items: center; gap: 8px; background: var(--pri-claro); border-radius: 8px; padding: 6px 10px; font-size: 13px; flex-wrap: wrap; }
.arquivo-chip span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arquivo-chip button { border: 0; background: none; cursor: pointer; }
.como-doc { font-size: 12px; color: var(--muted); display: flex; gap: 4px; align-items: center; }
.enviar { border: 0; background: var(--pri); color: #fff; width: 42px; height: 42px; border-radius: 50%; cursor: pointer; font-size: 16px; flex: 0 0 42px; }
.enviar:disabled { opacity: .5; }

.info { width: 380px; background: var(--painel); border-left: 1px solid var(--borda); overflow-y: auto; }
.info-topo { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--borda); }
.i-bloco { padding: 12px 14px; border-bottom: 1px solid #f0f2f5; }
.i-nome { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.i-tit { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.i-linha { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.i-linha span { color: var(--muted); }
.i-linha b { text-align: right; font-weight: 600; }

/* ---------------------------------------------------------------- modais */
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal-caixa { background: #fff; border-radius: 14px; width: min(480px, 100%); padding: 20px; box-shadow: 0 20px 50px rgba(0,0,0,.2); max-height: 90vh; overflow-y: auto; }
.modal-caixa h3 { margin: 0 0 6px; }
.modal-pe { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.deps { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 12px 0; }
.dep { border: 2px solid var(--borda); background: #fff; border-radius: 10px; padding: 10px; cursor: pointer; text-align: left; font-weight: 600; display: flex; flex-direction: column; gap: 2px; border-left: 5px solid var(--cor); font: inherit; font-weight: 600; }
.dep small { color: var(--muted); font-weight: 500; }
.dep.sel { border-color: var(--pri); background: var(--pri-claro); border-left-color: var(--cor); }
.rot { display: block; font-weight: 600; margin: 10px 0 6px; font-size: 13px; }
.pessoas { display: flex; flex-direction: column; gap: 6px; }
.pessoa { display: flex; gap: 8px; align-items: center; padding: 7px 10px; border: 1px solid var(--borda); border-radius: 8px; cursor: pointer; }
.opcoes-fim { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.opcao { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--borda); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.opcao span { display: flex; flex-direction: column; }
.opcao small { color: var(--muted); }
.inp { width: 100%; border: 1px solid var(--borda); border-radius: 8px; padding: 9px 11px; font: inherit; }
.visor { background: rgba(0,0,0,.85); display: flex; flex-direction: column; gap: 12px; }
.visor img { max-width: 92vw; max-height: 82vh; border-radius: 6px; }

/* ---------------------------------------------------------------- avisos */
#avisos { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 2000; }
.aviso { background: #12212e; color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: var(--sombra); max-width: 380px; transition: opacity .4s; }
.aviso.erro { background: var(--erro); }
.aviso.sai { opacity: 0; }

/* ------------------------------------------------------- páginas admin */
.pagina { max-width: 1100px; margin: 0 auto; padding: 22px 16px 60px; }
.pagina h1 { font-size: 22px; margin: 0 0 4px; }
.pagina .intro { color: var(--muted); margin: 0 0 18px; }
.cartao { background: var(--painel); border: 1px solid var(--borda); border-radius: 12px; padding: 18px; margin-bottom: 16px; box-shadow: var(--sombra); }
.cartao h2 { font-size: 16px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.tabela { width: 100%; border-collapse: collapse; }
.tabela th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--borda); }
.tabela td { padding: 9px 8px; border-bottom: 1px solid #f0f2f5; vertical-align: middle; }
.tabela-rolagem { overflow-x: auto; }
.form-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px 16px; }
.form-grade label, .campo-form { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 13px; }
.form-grade label small, .campo-form small { font-weight: 400; color: var(--muted); }
.form-grade input, .form-grade select, .form-grade textarea, .campo-form input, .campo-form select, .campo-form textarea { border: 1px solid var(--borda); border-radius: 8px; padding: 9px 11px; font: inherit; font-weight: 400; background: #fff; }
.form-grade .largo, .campo-form.largo { grid-column: 1 / -1; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { flex-direction: row; align-items: center; gap: 6px; font-weight: 500; border: 1px solid var(--borda); padding: 6px 10px; border-radius: 8px; }
.acoes-form { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.alerta { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; }
.alerta.ok { background: #ecfdf5; color: #065f46; }
.alerta.erro { background: #fef2f2; color: var(--erro); }
.alerta.info { background: #eff6ff; color: #1e40af; }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #94a3b8; margin-right: 5px; }
.status-dot.on { background: #10b981; }
.codigo { font-family: ui-monospace, Menlo, Consolas, monospace; background: #f1f5f9; padding: 2px 6px; border-radius: 5px; font-size: 12.5px; word-break: break-all; }
.qr-img { max-width: 260px; border: 8px solid #fff; box-shadow: var(--sombra); }

/* ---------------------------------------------------------------- login */
.pg-login { display: grid; place-items: center; min-height: 100vh; background: linear-gradient(160deg, #12212e, #0e7c66); padding: 16px; }
.login-caixa { background: #fff; border-radius: 16px; padding: 28px; width: min(380px, 100%); box-shadow: 0 30px 60px rgba(0,0,0,.25); }
.login-caixa h1 { margin: 0 0 4px; font-size: 22px; }
.login-caixa .campo-form { margin-top: 12px; }
.login-caixa .btn { width: 100%; justify-content: center; padding: 11px; margin-top: 18px; font-size: 15px; }

/* -------------------------------------------------------------- celular */
@media (max-width: 1100px) {
  .atend { grid-template-columns: 320px 1fr; }
  .info { position: fixed; right: 0; top: 54px; bottom: 0; z-index: 30; box-shadow: -8px 0 30px rgba(0,0,0,.12); }
}
@media (max-width: 760px) {
  .topo { gap: 8px; padding: 0 10px; }
  .marca span, .menu a span, .usuario-nome { display: none; }
  .atend { grid-template-columns: 1fr; }
  .atend .chat { display: none; }
  .atend.com-chat .lista { display: none; }
  .atend.com-chat .chat { display: flex; }
  .voltar { display: block; }
  .chat-acoes .btn:not(.icone) { padding: 7px 9px; font-size: 0; gap: 0; }
  .chat-acoes .btn i { font-size: 14px; }
  .mensagens { padding: 12px 10px; }
  .msg { max-width: 88%; }
  .info { width: 100%; }
}

/* modo teste */
.faixa-teste { background: #7c3aed; color: #fff; text-align: center; font-size: 12.5px; font-weight: 600; padding: 5px 10px; }
.pg-atendimento .faixa-teste ~ .atend { height: calc(100vh - 54px - 28px); }
.celular { background: #e5ddd5; border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 6px; max-height: 560px; overflow-y: auto; }
.celular .msg.ent { align-self: flex-end; background: #dcf8c6; }
.celular .msg.sai { align-self: flex-start; background: #fff; }
.celular .botoes { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.celular .botoes span { background: #fff; border: 1px solid #d0d7de; border-radius: 8px; text-align: center; padding: 6px; color: #0e7c66; font-weight: 600; }

/* logo do canal no lugar das iniciais */
.avatar.canal { background: color-mix(in srgb, var(--cor) 14%, white); color: var(--cor); font-size: 22px; }
.chat-topo .avatar.canal { font-size: 24px; }

/* painel lateral com abas */
.info-topo { gap: 6px; padding: 8px 8px 0; align-items: flex-end; position: sticky; top: 0; background: var(--painel); z-index: 2; }
.painel-abas { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.painel-abas button { border: 0; background: none; padding: 8px 9px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.painel-abas button.ativa { color: var(--pri-escuro); border-bottom-color: var(--pri); }
.btn.mini { padding: 4px 8px; font-size: 12px; }
.inp.mini { width: 110px; padding: 5px 8px; text-align: right; }
.orc-cab { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.orc-add { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; background: #f8fafb; padding: 10px; border-radius: 10px; border: 1px solid var(--borda); }
.linha2 { display: flex; gap: 6px; }
.linha2 .inp { flex: 1; }
.busca-prod { position: relative; }
.res-prod { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--borda); border-radius: 8px; box-shadow: 0 10px 24px rgba(0,0,0,.12); max-height: 260px; overflow-y: auto; z-index: 5; }
.res-prod button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; font: inherit; cursor: pointer; border-bottom: 1px solid #f0f2f5; }
.res-prod button:hover { background: var(--pri-claro); }
.res-prod small { color: var(--muted); display: block; }
.res-prod .muted { padding: 10px; }
.orc-itens td { padding: 7px 4px; font-size: 13px; }
.orc-itens .dir { text-align: right; white-space: nowrap; font-weight: 600; }
.orc-total { display: flex; justify-content: space-between; padding: 8px 4px; border-top: 2px solid var(--borda); margin-top: 2px; font-size: 14px; }
.fretes { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.frete-op { display: flex; align-items: center; gap: 8px; border: 1px solid var(--borda); border-radius: 9px; padding: 8px 10px; cursor: pointer; }
.frete-op span { flex: 1; display: flex; flex-direction: column; }
.frete-op small { color: var(--muted); }
.frete-op.sel { border-color: var(--pri); background: var(--pri-claro); }
.form-grade.compacta { grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.form-grade.compacta .largo { grid-column: 1 / -1; }
.campo-form input, .campo-form select { padding: 7px 9px; }
.valores > div:not(.frete-mini) { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; }
.valores span { color: var(--muted); }
.valores .total { border-top: 2px solid var(--borda); margin-top: 4px; padding-top: 6px; font-size: 15px; }
.valores .total span { color: var(--texto); font-weight: 700; }
.pd-passos { display: flex; flex-direction: column; gap: 4px; margin: 14px 0 0; }
.passo { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.passo span { width: 20px; height: 20px; border-radius: 50%; background: #e2e8f0; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #475569; }
.passo.ok { color: var(--pri-escuro); }
.passo.ok span { background: var(--pri); color: #fff; }
.ped { border: 1px solid var(--borda); border-radius: 9px; padding: 8px 10px; margin-bottom: 6px; }
.ped.ativo { border-left: 4px solid var(--pri); }
.ped-l1 { display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.ped-l2 { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.ped-acoes { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.i-tit .btn.mini { float: right; margin-top: -4px; }
@media (max-width: 760px) { .chat-acoes #btn-info span { display: none; } }
.form-grade.compacta { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.form-grade.compacta > *, .info .campo-form { min-width: 0; }
.info .campo-form input, .info .campo-form select, .info .inp:not(.mini) { width: 100%; box-sizing: border-box; }
.info { overflow-x: hidden; }
/* painel por departamento */
.sec { border-bottom: 1px solid #eef1f4; padding: 12px 14px; }
.sec h4 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.sec h4 i { color: var(--pri); }
.bloco-tit { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin: 16px 0 8px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bloco-tit:first-child { margin-top: 0; }
.escolhido { background: var(--pri-claro); color: var(--pri-escuro); padding: 7px 10px; border-radius: 8px; margin-bottom: 8px; font-size: 13px; }
.frete-mini { margin: 6px 0; padding: 8px; background: #f8fafb; border-radius: 8px; }
.rt-itens { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.rt-item { display: flex; align-items: center; gap: 8px; border: 1px solid var(--borda); border-radius: 9px; padding: 7px 9px; cursor: pointer; }
.rt-item span { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.rt-item small { color: var(--muted); }
.rt-item .inp.mini { width: 80px; }
.info-topo b { padding: 4px 6px 10px; }
.info .campo-form input[type=checkbox], .info .campo-form input[type=radio] { width: auto; flex: 0 0 auto; }
.info .alerta { margin-bottom: 10px; }

.abas.apagadas button { opacity: .45; }
.busca-aviso { font-size: 12px; color: var(--muted); padding: 6px 14px; background: #f8fafb; border-bottom: 1px solid #f0f2f5; }

.l3 { align-items: center; }
.subabas { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 8px 6px; }
.subabas button { border: 1px solid var(--borda); background: #fff; padding: 2px 8px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 11.5px; line-height: 18px; white-space: nowrap; display: inline-flex; align-items: center; }
.subabas button b { background: #e2e8f0; color: #334155; border-radius: 999px; padding: 0 5px; font-size: 10.5px; line-height: 15px; margin-left: 4px; }
.subabas button b:empty { display: none; }
.subabas button.ativa { background: var(--pri-claro); color: var(--pri-escuro); border-color: var(--pri); }
.subabas button[data-aba="neg_sem"] b { background: #fed7aa; color: #9a3412; }
.valores .frete-mini { display: block; }
.valores .frete-mini span { color: var(--texto); }
.valores .frete-mini small { color: var(--muted); }
.valores .frete-mini .escolhido { display: none; }
.m-indisp { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; background: #f1f5f9; border-radius: 8px; padding: 6px 10px; margin-bottom: 4px; }

/* Ordenação e anexos por arrastar */
.ordenar-lista { display:flex; align-items:center; gap:6px; padding:0 10px 8px; font-size:11px; color:var(--muted); }
.ordenar-lista select { min-width:0; flex:1; padding:5px 4px; border:1px solid var(--borda); border-radius:7px; background:var(--painel); color:inherit; font-size:11px; }
.chat-conteudo { position:relative; }
.drop-arquivo:not([hidden]) { position:absolute; inset:55px 8px 75px; z-index:50; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:12px; background:rgba(224,247,245,.95); border:3px dashed #00866e; border-radius:12px; color:#006653; font-size:17px; pointer-events:none; }
.drop-arquivo i { font-size:42px; }

/* Sugestões de respostas rápidas no compositor */
.campo { position: relative; }
.respostas-sugestoes:not([hidden]) { position:absolute; bottom:100%; left:0; right:0; max-height:280px; overflow-y:auto; background:var(--branco,#fff); color:#172b40; border:1px solid #cbd5e1; border-radius:10px; box-shadow:0 8px 24px #0002; z-index:80; }
.resposta-opcao { display:flex; flex-direction:column; gap:3px; width:100%; text-align:left; padding:10px 12px; background:#fff; color:#172b40; border:0; border-bottom:1px solid #edf2f7; cursor:pointer; }
.resposta-opcao:hover,.resposta-opcao.escolhida { background:#e7f5f1; }
.resposta-opcao small { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; max-width:100%; color:#64748b; }

/* v2.5.5 — refinamento visual do painel de negociação (sem alterar regras) */
.info { background:#f8fafc; }
.info-topo { background:#fff; border-bottom:1px solid #e2e8f0; }
.info .sec { background:#fff; margin:10px 10px 0; padding:15px; border:1px solid #e2e8f0; border-radius:12px; box-shadow:0 2px 8px rgba(15,23,42,.035); }
.info .sec:last-child { margin-bottom:12px; }
.info .sec h4 { color:#334155; font-size:12px; font-weight:800; letter-spacing:.055em; padding-bottom:9px; border-bottom:1px solid #edf2f7; }
.info .bloco-tit { color:#334155; font-weight:800; }
.info .campo-form input:not([type=checkbox]):not([type=radio]), .info .campo-form select, .info .inp:not(.mini) { border-radius:9px; border-color:#dce4ee; background:#fff; min-height:36px; }
.info .campo-form input:focus, .info .campo-form select:focus, .info .inp:focus { outline:2px solid #b5e7d8; outline-offset:1px; }
.info .valores { background:#f7fcfa; border:1px solid #d5efe4; border-radius:10px; padding:10px; }
.info .valores .frete-mini { background:#fff; border:1px solid #e1eee8; }
.info .passo { border-radius:8px; }
.info .btn { border-radius:9px; }
.info .btn.azul { font-weight:700; }
@media(max-width:1100px) { .info .sec { margin:8px 6px 0; padding:11px; } }

/* CRM 2.5.6: ações rápidas e estado da janela oficial */
.transferencias-rapidas{display:flex;align-items:center;gap:7px;flex-wrap:wrap;padding:8px 12px;background:#eef8f6;border-top:1px solid #bde6dc;font-size:12px}
.transferencias-rapidas[hidden],.janela-status[hidden]{display:none!important}
.transferencias-rapidas .btn{padding:5px 10px;font-size:12px}
.janela-status{padding:7px 12px;font-size:12px;border-top:1px solid #dce7e5}
.janela-status.aberta{color:#08744c;background:#e8f8ef}
.janela-status.fechada{color:#925c12;background:#fff3d8}

/* v2.5.9: resumo financeiro destacado no início da Negociação */
.neg-resumo-destaque{border:1px solid #b7e5d4;border-radius:12px;background:#f4fcf8;padding:12px;margin:4px 0 18px;color:#183b32}
.neg-resumo-topo{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;font-size:12px;font-weight:700;margin-bottom:12px}
.neg-resumo-topo i{color:#087c62;margin-right:5px}
.neg-resumo-linha{display:flex;justify-content:space-between;gap:12px;font-size:12px;padding:6px 0;border-bottom:1px solid #deeee7}
.neg-resumo-linha strong{white-space:nowrap}
.neg-resumo-total{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:12px 0 2px;font-size:14px;font-weight:800;color:#087c62}
.neg-resumo-total strong{font-size:19px;white-space:nowrap}

/* Seleção de templates oficiais */
.templates-area{padding:8px 12px;border-top:1px solid var(--borda,#ddd)}
#templates-lista{max-height:230px;overflow:auto;padding:8px 0;display:flex;flex-direction:column;gap:6px}
#templates-lista[hidden]{display:none}
.template-opcao{text-align:left;white-space:normal;justify-content:flex-start}

/* v2.6.5 — ações de mensagens */
/* Responder / Reagir: ícones pequenos que aparecem ao passar o mouse na mensagem */
.msg { position: relative; }
.m-acoes { position: absolute; top: 2px; right: -70px; padding-left: 8px; display: flex; gap: 4px; opacity: 0; pointer-events: none; transition: opacity .12s; }
.msg:hover .m-acoes, .m-acoes:focus-within { opacity: 1; pointer-events: auto; }
.m-acoes button { width: 28px; height: 28px; border-radius: 50%; border: 1px solid #e2e8f0; background: #fff; color: #64748b; font-size: 12px; cursor: pointer; display: grid; place-items: center; padding: 0; box-shadow: 0 1px 3px rgba(15,23,42,.1); }
.m-acoes button:hover { background: #ecfdf5; color: #047857; }
@media (hover: none) { .m-acoes { position: static; opacity: .7; pointer-events: auto; margin-top: 4px; } .m-acoes button { width: 24px; height: 24px; } }
#resposta-citacao:not([hidden]) {display:flex;justify-content:space-between;align-items:center;background:#eaf8f2;border-left:3px solid #129777;padding:7px;font-size:12px;margin-bottom:5px;gap:8px}
#resposta-citacao button {border:0;background:transparent;cursor:pointer;font-size:18px}
.ped-cab { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* 2.8 — nova conversa, seleção em lote, emojis, áudio, reações, templates */
button.anexo { border: 0; background: transparent; }
.anexo:hover, .anexo.ativo { color: var(--pri); }
#btn-gravar.ativo { color: #dc2626; }
.compositor { position: relative; }
.lista-acoes { display: flex; gap: 6px; padding: 0 10px 8px; }
.lista-acoes .btn.ativo { background: var(--pri-claro); border-color: var(--pri); color: var(--pri-escuro); }
.barra-lote { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px 10px; margin: 0 10px 8px; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 8px; font-size: 12.5px; }
.barra-lote span { flex: 1; font-weight: 600; color: #9a3412; }
.item.com-check { padding-left: 6px; }
.item-check { display: flex; align-items: center; padding-right: 2px; }
.item-check input { width: 16px; height: 16px; pointer-events: none; }
.emoji-painel { position: absolute; bottom: 62px; left: 12px; z-index: 30; width: 300px; max-height: 220px; overflow-y: auto; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 8px; background: #fff; border: 1px solid var(--borda); border-radius: 12px; box-shadow: 0 10px 30px rgba(15,23,42,.15); }
.emoji-painel button { border: 0; background: transparent; font-size: 20px; padding: 4px; border-radius: 6px; cursor: pointer; }
.emoji-painel button:hover { background: #f1f5f9; }
.gravando { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px; font-size: 13px; color: #991b1b; }
.gravando b { font-variant-numeric: tabular-nums; margin-right: auto; }
.gravando .ponto { width: 10px; height: 10px; border-radius: 50%; background: #dc2626; animation: piscar 1s infinite; }
@keyframes piscar { 50% { opacity: .25; } }
.reacoes-pop { position: fixed; z-index: 60; display: flex; gap: 2px; padding: 6px; background: #fff; border: 1px solid var(--borda); border-radius: 999px; box-shadow: 0 10px 30px rgba(15,23,42,.18); }
.reacoes-pop button { border: 0; background: transparent; font-size: 22px; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; }
.reacoes-pop button:hover { background: #f1f5f9; transform: scale(1.15); }
.tf-previa { white-space: pre-wrap; background: #e7f6ee; border-radius: 10px; padding: 10px 12px; font-size: 13.5px; max-height: 220px; overflow-y: auto; }
#modal-nova .modal-caixa, #modal-template .modal-caixa { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; }

/* 2.9 — menu de administração, dashboard, comentários */
.menu-admin { position: relative; }
.menu-admin summary { list-style: none; cursor: pointer; color: #b8c4cf; padding: 8px 12px; border-radius: 8px; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.menu-admin summary::-webkit-details-marker { display: none; }
.menu-admin summary:hover, .menu-admin[open] summary { background: rgba(255,255,255,.06); color: #fff; }
.menu-admin.ativo summary { background: rgba(52,211,153,.14); color: #fff; }
.menu-admin .seta { font-size: 10px; }
.menu-admin-lista { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 230px; background: #fff; border: 1px solid var(--borda); border-radius: 12px; box-shadow: 0 14px 40px rgba(15,23,42,.18); padding: 6px; display: flex; flex-direction: column; }
.menu-admin-lista a { color: var(--texto); text-decoration: none; padding: 9px 12px; border-radius: 8px; display: flex; gap: 10px; align-items: center; font-size: 14px; }
.menu-admin-lista a i { color: var(--muted); width: 16px; text-align: center; }
.menu-admin-lista a:hover { background: #f1f5f9; }
.menu-admin-lista a.ativo { background: var(--pri-claro); color: var(--pri-escuro); }
@media (max-width: 900px) { .menu-admin summary span { display: none; } }
.pagina.larga { max-width: 1280px; }
.filtro-periodo { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 8px 0 4px; }
.inp.mini { padding: 4px 8px; font-size: 13px; width: auto; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 12px 0 16px; }
.kpi { background: var(--painel); border: 1px solid var(--borda); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--sombra); }
.kpi span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi b { font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); font-size: 12px; }
.kpi.destaque { border-color: var(--pri); background: var(--pri-claro); }
.kpis.agora .kpi b { font-size: 22px; }
.grade-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.barras-dia { display: flex; align-items: flex-end; gap: 4px; height: 190px; overflow-x: auto; padding-top: 10px; }
.bd { flex: 1 0 22px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; min-width: 22px; }
.bd-barra { width: 70%; max-width: 34px; background: var(--pri); border-radius: 4px 4px 0 0; }
.bd span { font-size: 10px; color: var(--muted); white-space: nowrap; }
.bd-v { font-size: 10.5px; font-weight: 700; color: #047857; min-height: 13px; }
.barra-h { display: grid; grid-template-columns: 150px 1fr 50px; align-items: center; gap: 10px; margin: 8px 0; font-size: 13.5px; }
.barra-h div { background: #f1f5f9; border-radius: 6px; height: 12px; overflow: hidden; }
.barra-h i { display: block; height: 100%; border-radius: 6px; }
.barra-h b { text-align: right; }
.comentario .cm-topo { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.cm-texto { font-size: 15px; margin: 4px 0 6px; }
.cm-post { font-size: 12.5px; margin-bottom: 6px; }
.cm-resposta { background: #f1f5f9; border-radius: 8px; padding: 8px 10px; font-size: 13.5px; margin-bottom: 8px; }
.cm-acoes textarea { width: 100%; margin-bottom: 6px; }

/* Botões grandes do pedido (como no CRM antigo) */
.pd-botoes { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.pd-botoes-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn.grande { width: 100%; justify-content: center; padding: 11px 12px; font-size: 14px; font-weight: 600; border-radius: 10px; white-space: normal; text-align: center; }
.btn.verde { background: #10b981; border-color: #10b981; color: #fff; }
.btn.verde:hover { background: #059669; }
.btn.cinza { background: #94a3b8; border-color: #94a3b8; color: #fff; }
.btn.grande:disabled { opacity: .75; }
.credito-box { grid-column: 1 / -1; border: 1px solid var(--borda); border-radius: 10px; padding: 10px 12px; background: #f8fafc; display: flex; flex-direction: column; gap: 6px; }
.credito-box.tem { border-color: #2563eb; background: #eff6ff; }
.credito-l1 { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.credito-l1 b { font-size: 18px; color: #1d4ed8; }

.filtros-admin select { flex:1; }
.filtros-admin select.ativo { border-color:#f59e0b; background:#fffbeb; color:#92400e; font-weight:600; }

/* ------------------------------------------------------------ chat interno */
.btn-chat { position: relative; border: 0; background: rgba(255,255,255,.08); color: #e2e8f0; border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 7px; }
.btn-chat:hover, .btn-chat.ativo { background: rgba(255,255,255,.18); }
.btn-chat.tem { background: #2563eb; color: #fff; }
.btn-chat #chat-badge { position: absolute; top: -5px; right: -5px; background: #ef4444; color: #fff; border-radius: 999px; font-size: 10.5px; min-width: 18px; height: 18px; padding: 0 5px; display: flex; align-items: center; justify-content: center; border: 2px solid #0f172a; }
#chat-painel { position: fixed; right: 12px; top: 64px; bottom: 12px; width: 370px; max-width: calc(100vw - 24px); background: #fff; border-radius: 14px; box-shadow: 0 18px 50px rgba(15,23,42,.3); z-index: 900; display: flex; flex-direction: column; overflow: hidden; color: #0f172a; }
#chat-painel[hidden] { display: none; }
.chat-cab { display: flex; align-items: center; gap: 6px; padding: 12px 12px 12px 16px; background: #0f172a; color: #fff; }
.chat-cab b { flex: 1; order: 2; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-cab #chat-voltar { order: 1; } .chat-cab #chat-fechar { order: 3; }
.chat-x { border: 0; background: none; color: inherit; cursor: pointer; font-size: 15px; padding: 4px 8px; border-radius: 6px; }
.chat-x:hover { background: rgba(148,163,184,.25); }
#chat-lista-box, #chat-sala-box { flex: 1; display: flex; flex-direction: column; min-height: 0; }
#chat-lista-box[hidden], #chat-sala-box[hidden] { display: none; }
#chat-busca { margin: 10px 12px 4px; width: auto; }
#chat-lista { overflow-y: auto; flex: 1; padding-bottom: 8px; }
.chat-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #64748b; font-weight: 700; padding: 10px 16px 4px; }
.chat-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; text-align: left; padding: 8px 14px; cursor: pointer; color: inherit; }
.chat-item:hover { background: #f1f5f9; }
.chat-av { position: relative; width: 36px; height: 36px; border-radius: 50%; background: #e2e8f0; color: #334155; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.chat-av.grupo { background: #dbeafe; color: #1d4ed8; font-size: 14px; }
.chat-pt { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff; background: #94a3b8; }
.chat-pt.on { background: #10b981; } .chat-pt.almoco { background: #f59e0b; }
.chat-meio { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-meio b { font-size: 13.5px; font-weight: 600; }
.chat-meio small, .chat-dir small { color: #64748b; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item.nao-lida .chat-meio b, .chat-item.nao-lida .chat-meio small { font-weight: 700; color: #0f172a; }
.chat-dir { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.chat-n { background: #2563eb; color: #fff; border-radius: 999px; font-size: 11px; min-width: 19px; height: 19px; padding: 0 5px; display: flex; align-items: center; justify-content: center; }
#chat-msgs { flex: 1; overflow-y: auto; padding: 12px; background: #f1f5f9; display: flex; flex-direction: column; gap: 6px; }
.chat-vazio { text-align: center; margin: auto; }
.chat-msg { max-width: 82%; align-self: flex-start; background: #fff; border-radius: 12px 12px 12px 4px; padding: 7px 10px 5px; font-size: 13.5px; box-shadow: 0 1px 1px rgba(15,23,42,.06); word-wrap: break-word; }
.chat-msg.meu { align-self: flex-end; background: #dbeafe; border-radius: 12px 12px 4px 12px; }
.chat-msg small { display: block; text-align: right; color: #64748b; font-size: 10.5px; margin-top: 2px; }
.chat-msg a { color: #1d4ed8; }
.chat-de { display: block; font-size: 11.5px; color: #1d4ed8; margin-bottom: 1px; }
.chat-link-conv { display: inline-flex; align-items: center; gap: 6px; margin-top: 5px; background: #ecfdf5; color: #047857 !important; border: 1px solid #a7f3d0; border-radius: 8px; padding: 4px 8px; font-size: 12.5px; font-weight: 600; text-decoration: none; }
#chat-anexo { background: #ecfdf5; color: #047857; font-size: 12.5px; padding: 6px 12px; display: flex; align-items: center; gap: 6px; border-top: 1px solid #a7f3d0; }
#chat-anexo[hidden] { display: none; }
#chat-anexo .chat-x { margin-left: auto; }
#chat-form { display: flex; align-items: flex-end; gap: 6px; padding: 8px 10px; border-top: 1px solid #e2e8f0; background: #fff; }
#chat-form .chat-x { color: #475569; margin-bottom: 4px; }
#chat-texto { flex: 1; resize: none; border: 1px solid #cbd5e1; border-radius: 18px; padding: 8px 12px; font: inherit; font-size: 13.5px; max-height: 120px; outline: none; }
#chat-texto:focus { border-color: #2563eb; }
.chat-enviar { border: 0; background: #2563eb; color: #fff; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; flex: none; }
@media (max-width: 900px) { .btn-chat .rot-chat { display: none; } #chat-painel { top: 56px; right: 6px; left: 6px; width: auto; max-width: none; } }

/* contador de não lidas no canto de baixo: as etiquetas não passam por baixo dele */
.item:has(.badge) .l3 { padding-right: 30px; }

/* mensagens: botões/opções e notas sem colchetes */
.m-opcoes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.m-opcoes span, .m-botao { display: inline-block; border: 1px solid #93c5fd; background: #eff6ff; color: #1d4ed8; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 600; }
.m-nota { color: #64748b; font-style: italic; }

.m-contato { display: flex; align-items: center; gap: 10px; background: rgba(15,23,42,.04); border: 1px solid #e2e8f0; border-radius: 10px; padding: 8px 10px; min-width: 200px; margin-bottom: 4px; }
.m-contato > i { font-size: 22px; color: #2563eb; }
.m-contato div { flex: 1; display: flex; flex-direction: column; }
.m-contato small { color: #64748b; }
.m-copiar { border: 0; background: none; cursor: pointer; color: #475569; font-size: 14px; padding: 4px 6px; border-radius: 6px; }
.m-copiar:hover { background: #e2e8f0; }

/* mensagem citada (respondendo a) */
.m-citada { display: flex; gap: 8px; align-items: center; background: rgba(15,23,42,.06); border-left: 3px solid #10b981; border-radius: 6px; padding: 5px 8px; margin-bottom: 5px; font-size: 12.5px; color: #475569; max-width: 100%; }
.msg.sai .m-citada { border-left-color: #2563eb; }
.m-citada[data-ir] { cursor: pointer; }
.m-citada img { width: 42px; height: 42px; object-fit: cover; border-radius: 4px; flex: none; }
.m-citada div { display: flex; flex-direction: column; min-width: 0; }
.m-citada b { font-size: 11.5px; color: #0f766e; }
.msg.sai .m-citada b { color: #1d4ed8; }
.m-citada span { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.msg.piscar { box-shadow: 0 0 0 3px #f59e0b; transition: box-shadow .3s; }
/* ícones Responder nas nossas mensagens: do lado esquerdo do balão */
.msg.sai .m-acoes { right: auto; left: -40px; padding-left: 0; padding-right: 8px; }

#outros-canais { display: inline-flex; gap: 8px; flex-wrap: wrap; margin-left: 8px; vertical-align: middle; }

.compositor.bloqueado { opacity: .55; }
.compositor.bloqueado textarea { background: #f1f5f9; cursor: not-allowed; }

.outra-conv { color: #2563eb; text-decoration: none; font-weight: 600; white-space: nowrap; }
.outra-conv:hover { text-decoration: underline; }

.arquivo-chip span { white-space: normal; }
.arq-item { display: inline-flex; align-items: center; gap: 2px; font-style: normal; background: #fff; border: 1px solid #cbd5e1; border-radius: 6px; padding: 1px 4px 1px 7px; margin: 2px 4px 2px 0; font-size: 12px; max-width: 220px; }
.arq-item button { border: 0; background: none; cursor: pointer; color: #64748b; font-size: 14px; line-height: 1; }

.pd-auto-linha { text-align: right; font-size: 11.5px; margin: -4px 0 6px; }

.tag-almoco { background: #fff4e5; color: #b45309; border-radius: 99px; padding: 1px 8px; font-size: 11.5px; font-weight: 600; }

/* Página só do chat (perfil "Somente chat") */
body.pagina-chat #chat-painel { left: 50%; right: auto; transform: translateX(-50%); width: min(760px, calc(100vw - 24px)); top: 110px; }
@media (max-width: 900px) { body.pagina-chat #chat-painel { left: 6px; right: 6px; transform: none; width: auto; top: 100px; } }
body.pagina-chat .chat-link-conv { pointer-events: none; opacity: .7; }
/* Página só do chat: contatos à esquerda, conversa à direita (tela larga) */
body.pagina-chat #chat-painel { top: 76px; }
#chat-sala-cab { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid #e2e8f0; background: #fff; }
#chat-sala-cab[hidden], #chat-form[hidden] { display: none; }
.chat-item.sel { background: #dbeafe; }
@media (min-width: 760px) {
  body.pagina-chat #chat-painel { width: min(1200px, calc(100vw - 24px)); display: grid; grid-template-columns: minmax(260px, 340px) 1fr; grid-template-rows: auto minmax(0, 1fr); }
  body.pagina-chat .chat-cab { grid-column: 1 / -1; }
  body.pagina-chat #chat-lista-box { grid-column: 1; grid-row: 2; border-right: 1px solid #e2e8f0; }
  body.pagina-chat #chat-sala-box { grid-column: 2; grid-row: 2; }
}
body.pagina-chat .presenca-menu { z-index: 1000; }
body.pagina-chat .topo { position: relative; z-index: 950; }
/* Página só do chat: tela inteira (sem "janela") */
body.pagina-chat #chat-painel { left: 0; right: 0; bottom: 0; width: auto; max-width: none; transform: none; border-radius: 0; box-shadow: none; }
@media (min-width: 760px) {
  body.pagina-chat #chat-painel { width: auto; grid-template-columns: minmax(280px, 360px) 1fr; }
  body.pagina-chat .chat-cab { display: none; }
  body.pagina-chat #chat-lista-box { grid-row: 1 / -1; background: #fff; }
  body.pagina-chat #chat-sala-box { grid-row: 1 / -1; }
}
@media (max-width: 759px) { body.pagina-chat #chat-painel { left: 0; right: 0; } }
.chat-dep { font-style: normal; font-size: 11px; color: #475569; background: #eef2f6; border-radius: 99px; padding: 0 7px; width: fit-content; max-width: 100%; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.form-grade [hidden] { display: none !important; }
#chat-dep { margin: 4px 12px 4px; width: auto; font-size: 13px; padding: 6px 8px; }
.pd-puxar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; background: #f1f5f9; border: 1px dashed #cbd5e1; border-radius: 10px; padding: 8px 10px; margin: 4px 0 10px; font-size: 12.5px; color: #334155; }
.pd-puxar .inp { width: 150px; }
.pd-puxar small { flex-basis: 100%; }

/* chat: erro de envio dentro do painel */
#chat-erro { margin: 0 10px 6px; padding: 8px 10px; border-radius: 8px; background: #fef2f2; color: #b91c1c; font-size: 13px; border: 1px solid #fecaca; }
#chat-erro[hidden] { display: none; }
/* Transferências (log) */
.filtros-transf { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 12px; align-items: end; }
.filtros-transf label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 0; }
.filtros-transf label.largo { grid-column: span 2; }
.filtros-transf input, .filtros-transf select { border: 1px solid var(--borda); border-radius: 8px; padding: 8px 10px; font: inherit; font-weight: 400; color: var(--texto, #0f172a); background: #fff; width: 100%; }
.filtros-transf .acoes-form { grid-column: 1 / -1; }
.tabela-transf td { vertical-align: top; }
.tabela .num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
@media (max-width: 600px) { .filtros-transf label.largo { grid-column: auto; } }
/* Dashboard: seções e mensagens por número */
.dash-sec { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 -4px; font-weight: 700; }
.tabela-msgs tr.total td { font-weight: 700; border-top: 2px solid var(--borda); }
.tabela-msgs th.num { text-align: right; }
/* Dashboard: equipe */
.tabela-dash th.num, .tabela-dash td.num { text-align: right; }
.tabela-dash td { vertical-align: middle; }
.ponto-st { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; margin-right: 4px; vertical-align: middle; }
.ponto-st.on { background: #16a34a; } .ponto-st.almoco { background: #f59e0b; }
.pill-bom, .pill-medio, .pill-ruim { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.pill-bom { background: #dcfce7; color: #166534; } .pill-medio { background: #fef3c7; color: #92400e; } .pill-ruim { background: #fee2e2; color: #991b1b; }
.nota-dash { margin: 8px 0 0; font-size: 12.5px; }
.legenda-dash ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.kpi a.kpi-link { font-size: 12px; color: #b91c1c; text-decoration: underline; }
/* Falhas e sem resposta */
.abas-pend { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 6px; }
.abas-pend a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--borda); background: var(--painel); color: inherit; text-decoration: none; font-weight: 600; }
.abas-pend a b { background: #f1f5f9; border-radius: 999px; padding: 0 8px; font-size: 12.5px; }
.abas-pend a.ativa { border-color: var(--pri); background: var(--pri-claro); }
a.kpi { color: inherit; text-decoration: none; } a.kpi:hover { border-color: var(--pri); }
.tabela tr.sel td { background: var(--pri-claro); }
/* Cliente bloqueado no ERP — aviso no topo da conversa, para todos os setores */
.faixa-bloqueio{display:flex;gap:10px;align-items:flex-start;padding:9px 14px;background:#fef2f2;color:#991b1b;border-bottom:1px solid #fecaca;font-size:13px}
.faixa-bloqueio[hidden]{display:none!important}
.faixa-bloqueio i{margin-top:2px}
.faixa-bloqueio small{display:block;color:#b91c1c;font-size:12px;margin-top:2px}

/* Painel de números conectados (CANAL_MONITOR) */
.canais-caixa{position:relative}
.btn-canais{display:inline-flex;align-items:center;gap:7px;border:0;border-radius:999px;padding:7px 13px;font-weight:700;font-size:13px;cursor:pointer;color:#fff;background:#16a34a}
.btn-canais.instavel{background:#d97706}
.btn-canais.caido{background:#dc2626;animation:canal-pisca 1.1s ease-in-out infinite}
@keyframes canal-pisca{50%{box-shadow:0 0 0 6px rgba(220,38,38,.35)}}
.canais-menu{position:absolute;right:0;top:calc(100% + 8px);width:min(440px,92vw);background:#fff;color:#0f172a;border-radius:12px;box-shadow:0 12px 40px rgba(15,23,42,.25);z-index:60;padding:8px;max-height:70vh;overflow:auto}
.cm-cab{display:flex;justify-content:space-between;align-items:baseline;padding:6px 8px 8px}.cm-cab small{color:#64748b}
.cm-lin{display:grid;grid-template-columns:12px 1fr auto;gap:10px;align-items:center;padding:9px 8px;border-radius:9px}
.cm-lin+.cm-lin{border-top:1px solid #f1f5f9}
.cm-dot{width:10px;height:10px;border-radius:50%;background:#94a3b8}
.cm-lin.ok .cm-dot{background:#22c55e}.cm-lin.instavel .cm-dot{background:#f59e0b}.cm-lin.caido .cm-dot{background:#dc2626}
.cm-lin.caido{background:#fef2f2}
.cm-nome small,.cm-st small{display:block;color:#64748b;font-size:11.5px;font-weight:400}
.cm-st{text-align:right;font-size:12.5px}.cm-lin.caido .cm-st b{color:#b91c1c}.cm-lin.ok .cm-st b{color:#15803d}.cm-lin.instavel .cm-st b{color:#b45309}
.cm-link,.cm-notif{display:block;width:100%;text-align:center;margin-top:6px;padding:8px;border-radius:8px;background:#f1f5f9;color:#0f172a;font-weight:600;font-size:13px;text-decoration:none;border:0;cursor:pointer}
.faixa-caido{background:#dc2626;color:#fff;padding:9px 16px;font-weight:600;font-size:14px;text-align:center}
.faixa-caido a{color:#fff;text-decoration:underline}

/* Figurinhas */
.fig-painel { position: absolute; bottom: 62px; left: 12px; z-index: 30; width: 360px; max-width: calc(100vw - 24px); padding: 10px; background: #fff; border: 1px solid var(--borda); border-radius: 12px; box-shadow: 0 10px 30px rgba(15,23,42,.15); display: grid; gap: 8px; }
.fig-topo { display: flex; justify-content: space-between; align-items: center; }
.fig-topo label { cursor: pointer; }
.fig-grade { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; max-height: 260px; overflow-y: auto; }
.fig-grade button { border: 0; background: #f8fafc; border-radius: 10px; padding: 4px; cursor: pointer; aspect-ratio: 1; }
.fig-grade button:hover { background: #e0f2fe; }
.fig-grade img { width: 100%; height: 100%; object-fit: contain; display: block; }
.fig-vazio { grid-column: 1 / -1; color: #64748b; font-size: 13px; padding: 10px 4px; }
.fig-dica { color: #94a3b8; font-size: 11.5px; }
.m-fig { width: 150px; height: 150px; object-fit: contain; display: block; }
.m-fig-salvar { border: 0; background: transparent; color: #0369a1; font-size: 12px; cursor: pointer; padding: 2px 0; }

/* Retrabalho no orçamento */
.ret-box{border:1px dashed #e2e8f0;border-radius:10px;padding:8px;margin:0 0 10px}
.ret-box.ativo{border:1px solid #fdba74;background:#fff7ed}
.ret-tipo{display:flex;gap:6px;flex-wrap:wrap}
.ret-campos{margin-top:8px;display:flex;flex-direction:column;gap:6px}
.btn.laranja-cheio{background:#ea580c;border-color:#ea580c;color:#fff}
.btn.laranja-cheio:hover{background:#c2410c}
.alerta.ret-alerta{background:#fff7ed;border:1px solid #fdba74;color:#7c2d12}

/* NF-e com erro ao incluir */
#nfe-modal{position:fixed;inset:0;background:rgba(15,23,42,.55);z-index:3000;display:flex;align-items:center;justify-content:center;padding:16px}
.nfe-modal-caixa{background:#fff;border-radius:14px;max-width:620px;width:100%;padding:20px 22px;box-shadow:0 20px 50px rgba(0,0,0,.3);border-top:6px solid #dc2626}
.nfe-modal-caixa h3{margin:0 0 8px;color:#b91c1c;font-size:18px}
.nfe-modal-msg{background:#fef2f2;border:1px solid #fecaca;color:#7f1d1d;border-radius:8px;padding:10px;font-size:13.5px;margin:8px 0;word-break:break-word}
.nfe-modal-caixa ol{margin:8px 0 12px 18px;padding:0;font-size:13.5px}
.nfe-modal-bts{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:8px}
