* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f0f2f5;
  color: #111;
  height: 100vh;
}
.oculto { display: none !important; }

.tela-login {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #075e54;
}
.caixa-login {
  background: white;
  padding: 32px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 280px;
}
.caixa-login h1 { margin: 0 0 8px; font-size: 20px; text-align: center; }
.caixa-login input {
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 15px;
}
.caixa-login button {
  background: #25d366;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
}
.erro { color: #d33; font-size: 13px; margin: 0; min-height: 16px; }

.app { height: 100vh; display: flex; flex-direction: column; }
.topo {
  background: #075e54;
  color: white;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.topo h1 { font-size: 17px; margin: 0; flex-shrink: 0; }
.topo nav { display: flex; gap: 8px; flex: 1; }
.aba {
  background: transparent;
  border: none;
  color: #cde;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}
.aba.ativa { background: rgba(255,255,255,0.15); color: white; font-weight: 600; }
.sair { background: transparent; border: 1px solid rgba(255,255,255,0.4); color: white; padding: 6px 12px; border-radius: 6px; cursor: pointer; }

main { flex: 1; overflow: hidden; }
.painel { height: 100%; display: flex; }

.lista-conversas { width: 320px; background: white; border-right: 1px solid #ddd; overflow-y: auto; }
.item-conversa {
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}
.item-conversa:hover { background: #f5f5f5; }
.item-conversa.selecionada { background: #e9f7f1; }
.item-conversa .nome { font-weight: 600; font-size: 14px; }
.item-conversa .telefone { font-size: 12px; color: #667; }
.badge-precisa-humano {
  display: inline-block;
  background: #d9534f;
  color: white;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 4px;
}

.thread { flex: 1; display: flex; flex-direction: column; background: #e5ddd5; }
.thread-vazia { flex: 1; display: flex; align-items: center; justify-content: center; color: #777; }
.thread-cabecalho { background: white; padding: 12px 16px; border-bottom: 1px solid #ddd; }
.thread-cabecalho strong { display: block; font-size: 15px; }
.thread-cabecalho span { font-size: 12px; color: #667; }

.mensagens { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.bolha {
  max-width: 60%;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
}
.bolha.recebida { align-self: flex-start; background: white; }
.bolha.enviada { align-self: flex-end; background: #dcf8c6; }
.bolha .remetente { display: block; font-size: 11px; color: #075e54; font-weight: 600; margin-bottom: 2px; }

.caixa-envio { display: flex; gap: 8px; padding: 12px; background: #f0f2f5; }
.caixa-envio input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 20px;
  border: 1px solid #ccc;
  font-size: 14px;
}
.caixa-envio button {
  background: #25d366;
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
}
