.botao-chat {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 50%;
  background: #007bff;
  color: white;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: background 0.2s ease, transform 0.2s ease;
  z-index: 9999;
}

.botao-chat:hover {
  transform: scale(1.05);
}

.botao-chat.notificacao {
  background: #dc3545;
  animation: pulsar 1s infinite;
}

@keyframes pulsar {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.popup-chat {
  display: none;
  flex-direction: column;
  position: fixed;
  right: 20px;
  bottom: 90px;
  width: 320px;
  height: 420px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  z-index: 9999;
}

.popup-chat.ativo {
  display: flex;
}

.topo-chat {
  background: #007bff;
  color: white;
  padding: 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fechar-chat {
  background: transparent;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

.mensagens-chat {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.msg-linha {
  display: flex;
  width: 100%;
}

.msg-linha.eu {
  justify-content: flex-end;
}

.msg-linha.outro {
  justify-content: flex-start;
}

.msg {
  max-width: 75%;
  padding: 10px 12px 8px;
  border-radius: 14px;
  font-size: 14px;
  word-break: break-word;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.msg.eu {
  background: #007bff;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.msg.outro {
  background: #e4e4e4;
  color: #000;
  border-bottom-left-radius: 4px;
}

.msg strong {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
  opacity: 0.85;
}

.texto-msg {
  display: block;
  line-height: 1.4;
  white-space: pre-wrap;
}

/* novo: rodapé da mensagem com hora + visto */
.rodape-msg {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 6px;
}

.hora-msg {
  font-size: 11px;
  opacity: 0.75;
}

.visto-msg {
  font-size: 12px;
  line-height: 1;
  opacity: 0.9;
  font-weight: bold;
}

.visto-msg.lida {
  color: #4fc3f7;
}

.msg.outro .rodape-msg {
  justify-content: flex-start;
}

.rodape-chat {
  display: flex;
  border-top: 1px solid #ddd;
  background: #fff;
}

.rodape-chat input {
  flex: 1;
  border: none;
  padding: 10px;
  outline: none;
  font-size: 14px;
}

.rodape-chat button {
  border: none;
  background: #007bff;
  color: white;
  padding: 0 16px;
  cursor: pointer;
}

.rodape-chat button:hover {
  background: #0069d9;
}