/* admin.css - estilo inspirado no WhatsApp Web */

body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", sans-serif;
  background: #111;
  color: #fff;
  height: 100vh;
  display: flex;
}

.container {
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 350px;
  background: #202c33;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #2c3e50;
}

.sidebar-header {
  padding: 15px;
  background: #111b21;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid #2c3e50;
}

.sidebar-header h2 {
  margin: 0 0 10px;
  font-size: 18px;
  color: #25d366;
}

#searchInput {
  padding: 10px;
  border-radius: 6px;
  border: none;
  background: #2a3942;
  color: #fff;
}

.filters {
  margin-top: 10px;
  display: flex;
  gap: 5px;
}

.filters .filter {
  flex: 1;
  background: #2a3942;
  color: #fff;
  border: none;
  padding: 5px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
}

.filters .filter.active {
  background: #25d366;
  color: #000;
}

.contact-list {
  flex: 1;
  overflow-y: auto;
}

.contact.user-item {
  display: flex;
  align-items: center;
  position: relative;
  padding: 12px 15px;
  cursor: pointer;
  border-bottom: 1px solid #2c3e50;
}

.contact:hover {
  background: #2a3942;
}

.contact.active {
  background: #2a3942;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #54656f;
  color: #fff;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  font-size: 18px;
}

.info {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.info .top {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.info .top strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.info .time {
  font-size: 12px;
  color: #aaa;
}

.info .bottom {
  font-size: 13px;
  color: #bbb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-window {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #0b141a;
}

.chat-header {
  padding: 15px;
  background: #202c33;
  font-weight: bold;
  font-size: 16px;
  border-bottom: 1px solid #2c3e50;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 8px;
  word-break: break-word;
}

.message.admin {
  align-self: flex-end;
  background: #005c4b;
  color: #fff;
}

.message.user {
  align-self: flex-start;
  background: #202c33;
  color: #ddd;
}

.meta {
  font-size: 11px;
  color: #ccc;
  margin-top: 4px;
  text-align: right;
}

/*.input-area {*/
/*  display: flex;*/
/*  padding: 10px;*/
/*  border-top: 1px solid #2c3e50;*/
/*  background: #202c33;*/
/*}*/

/*.input-area input {*/
/*  flex: 1;*/
/*  padding: 10px;*/
/*  border-radius: 6px;*/
/*  border: none;*/
/*  background: #2a3942;*/
/*  color: #fff;*/
/*}*/

/*.input-area button {*/
/*  margin-left: 10px;*/
/*  padding: 10px 20px;*/
/*  background: #25d366;*/
/*  color: #000;*/
/*  border: none;*/
/*  border-radius: 6px;*/
/*  cursor: pointer;*/
/*  font-weight: bold;*/
/*} */
.input-area {
  display: flex;
  align-items: center;
  padding: 10px;
  background: #1e1e1e;
  position: relative;
  border-top: 1px solid #333;
}

.input-area input[type="text"] {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 20px;
  background: #2e2e2e;
  color: #fff;
  margin: 0 10px;
}

.icon-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: #ccc;
  cursor: pointer;
  padding: 5px;
}

.attachment-wrapper {
  position: relative;
}

.attachment-menu {
  position: absolute;
  bottom: 40px;
  left: 0;
  background: #2e2e2e;
  border-radius: 8px;
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 8px;
}

.attachment-menu label {
  color: #fff;
  cursor: pointer;
  display: block;
}

.attachment-menu label:hover {
  text-decoration: underline;
}

.audio-recorder {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #2e2e2e;
  padding: 8px 12px;
  border-radius: 20px;
  flex: 1;
  justify-content: space-between;
}

.audio-recorder span {
  color: #fff;
  font-family: monospace;
  flex-grow: 1;
  text-align: center;
}


/* Container da conversa */
.contact {
  position: relative;
  z-index: 0; /* menor que o menu */
}

.contact:hover {
  background: #1f2a30;
  z-index: 1; /* para destacar no hover, mas ainda abaixo do menu */
}

/* Botão de 3 pontos */
.contact .dropdown {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(0%);
  z-index: 2; /* botão acima do fundo da .contact */
}

.contact .dropdown button {
  background: none;
  border: none;
  color: #aebac1;
  font-size: 18px;
  cursor: pointer;
  padding: 5px;
}

/* Dropdown menu */
.contact .dropdown-menu {
  position: absolute;
  top: 30px;
  right: 0;
  background: #233138;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  z-index: 9999; /* sempre acima de qualquer .contact */
  display: none;
  min-width: 180px;
  overflow: hidden;
}

/* Itens do dropdown */
.contact .dropdown-menu div {
  padding: 12px 16px;
  color: #e9edef;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.contact .dropdown-menu div:hover {
  background: #2a3942;
}

/* Mostrar menu */
.contact .dropdown-menu.visible {
  display: block;
}

/* Remover borda ao focar no botão */
.contact .dropdown button:focus {
  outline: none;
}

.sidebar,
.contact-list {
  overflow: visible !important;
}

.contact .top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.contact .badge {
  background-color: #25d366;
  color: white;
  padding: 2px 6px;
  font-size: 11px;
  border-radius: 12px;
  min-width: 18px;
  text-align: center;
  font-weight: bold;
  position: absolute;
  right: 10px;
    bottom: 10px;
}

.chat-filters {
  display: flex;
  gap: 8px;
  padding: 10px;
  justify-content: center;
  background-color: #202c33;
  border-bottom: 1px solid #2a3942;
}

.chat-filters button {
  background: #2a3942;
  color: #e9edef;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-filters button:hover {
  background: #3c4c55;
}

.chat-filters button.active {
  background: #005c4b;
  border-color: #00a884;
}

.message .status {
  font-size: 12px;
  margin-left: 5px;
  color: #aaa;
}

.message .status.read {
  color: #4fc3f7; /* Azul para lido */
}