*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;background:#f2f4f7;color:#1d2433;font-size:16px;line-height:1.4}
h1{font-size:1.35rem;margin:0 0 .75rem}
.oculto{position:absolute;left:-9999px}
.cartao{background:#fff;border-radius:12px;box-shadow:0 2px 12px rgba(0,0,0,.08);padding:1.5rem;max-width:420px;width:calc(100% - 2rem)}
.centro{margin:12vh auto 0;text-align:center}
.centro form{display:flex;flex-direction:column;gap:.75rem;text-align:left;margin-top:1rem}
label{display:flex;flex-direction:column;gap:.25rem;font-size:.9rem}
input,select,textarea{font:inherit;padding:.6rem .7rem;border:1px solid #c9d1dd;border-radius:8px;background:#fff;width:100%}
.botao{font:inherit;background:#0b6b4f;color:#fff;border:0;border-radius:8px;padding:.7rem 1.1rem;cursor:pointer;font-weight:600}
.botao:disabled{background:#9db8ae;cursor:not-allowed}
.botao-sec{font:inherit;background:#fff;color:#1d2433;border:1px solid #c9d1dd;border-radius:8px;padding:.35rem .7rem;cursor:pointer}
.botao-perigo{background:#fff;color:#a32020;border:1px solid #e3b3b3}
.erro{background:#fde8e8;color:#8a1c1c;padding:.5rem .75rem;border-radius:8px}
.topo{display:flex;align-items:center;gap:.75rem;padding:.75rem 1rem;background:#0b6b4f;color:#fff}
.topo .usuario{margin-left:auto;font-size:.85rem;opacity:.9;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.topo .sair{margin:0}
/* chat */
.chat{display:flex;flex-direction:column;height:100vh;height:100dvh;max-width:820px;margin:0 auto;background:#fff}
.mensagens{list-style:none;margin:0;padding:1rem;flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:.5rem;background:#eef1f5}
.msg{max-width:80%;padding:.5rem .75rem;border-radius:12px;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.06);word-wrap:break-word}
.msg p{margin:.15rem 0 0;white-space:pre-wrap}
.msg.cliente{align-self:flex-end;background:#d9f2e6}
.msg.empresa{align-self:flex-start}
.autor{font-size:.75rem;color:#5b6577}
.estado{margin:0;padding:0 1rem;color:#8a1c1c;font-size:.9rem}
.estado:empty{display:none}
.envio{display:flex;gap:.5rem;padding:.75rem;border-top:1px solid #dde3ea;background:#fff}
.envio textarea{resize:none;flex:1}
/* painel */
.painel{display:flex;flex-direction:column;height:100vh;height:100dvh}
.alertas{display:flex;flex-direction:column;gap:.25rem;padding:.5rem 1rem;background:#fff7e0;border-bottom:1px solid #f0dca0;max-height:22vh;overflow-y:auto}
.alertas:empty{display:none}
.alerta{display:flex;gap:.5rem;align-items:center;font-size:.85rem}
.alerta span{flex:1}
.colunas{display:flex;flex:1;min-height:0}
.lista{width:340px;border-right:1px solid #dde3ea;background:#fff;display:flex;flex-direction:column;min-height:0}
.filtros{padding:.5rem}
.lista ul{list-style:none;margin:0;padding:0;overflow-y:auto;flex:1}
.lista li button{all:unset;box-sizing:border-box;display:block;width:100%;padding:.65rem 1rem;border-bottom:1px solid #eef1f5;cursor:pointer}
.lista li button:hover,.lista li button[aria-current=true]{background:#e8f4ef}
.lista .linha1{display:flex;justify-content:space-between;gap:.5rem;font-weight:600}
.lista .linha2{font-size:.8rem;color:#5b6577}
.selo{display:inline-block;font-size:.72rem;padding:.05rem .45rem;border-radius:999px;background:#e4e8ee;color:#1d2433;font-weight:500}
.selo.aberto{background:#d9f2e6}.selo.aguardando_abertura{background:#fff0c2}.selo.alerta{background:#fde8e8;color:#8a1c1c}
.detalhe{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0;background:#fff}
.detalhe .cab{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;padding:.6rem 1rem;border-bottom:1px solid #dde3ea}
.detalhe .cab strong{margin-right:auto}
.detalhe .envios{font-size:.8rem;color:#5b6577;padding:.4rem 1rem;border-bottom:1px solid #eef1f5}
.vazio{padding:2rem;color:#5b6577}
.voltar{display:none}
@media (max-width:760px){
  .lista{width:100%;border-right:0}
  .colunas.com-detalhe .lista{display:none}
  .colunas:not(.com-detalhe) .detalhe{display:none}
  .voltar{display:inline-block}
  .msg{max-width:90%}
}
