
/* ==================== CHAT CLIENTES PWA ==================== */

.pwa-chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #f9fafb;
}

.pwa-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: white;
  border-bottom: 1px solid #e5e7eb;
}

.pwa-chat-header h2 {
  margin: 0;
  font-size: 18px;
}

.estado-select-pwa {
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  background: white;
}

.pwa-chat-search {
  padding: 10px 15px;
  background: white;
}

.pwa-chat-search input {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  font-size: 14px;
}

.pwa-chat-list {
  flex: 1;
  overflow-y: auto;
}

.pwa-chat-item {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  background: white;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
}

.pwa-chat-item:active {
  background: #f3f4f6;
}

.pwa-chat-item.unread {
  background: #eff6ff;
}

.pwa-chat-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 18px;
  margin-right: 12px;
}

.pwa-chat-info {
  flex: 1;
  min-width: 0;
}

.pwa-chat-name {
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pwa-chat-preview {
  font-size: 13px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-chat-time {
  font-size: 12px;
  color: #9ca3af;
}

.pwa-badge {
  background: #ef4444;
  color: white;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
}

.pwa-empty {
  text-align: center;
  padding: 40px;
  color: #9ca3af;
}

/* Chat View */
.pwa-chat-view {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #f9fafb;
}

.pwa-chat-view-header {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  background: white;
  border-bottom: 1px solid #e5e7eb;
  gap: 12px;
}

.btn-back {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 5px;
}

.pwa-chat-view-info {
  flex: 1;
}

.pwa-chat-view-name {
  font-weight: 600;
  font-size: 16px;
}

.pwa-chat-view-email {
  font-size: 12px;
  color: #6b7280;
}

.pwa-chat-actions button {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
}

.pwa-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
}

.pwa-msg {
  margin-bottom: 12px;
  max-width: 80%;
}

.pwa-msg-mine {
  margin-left: auto;
}

.pwa-msg-other {
  margin-right: auto;
}

.pwa-msg-bubble {
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
}

.pwa-msg-mine .pwa-msg-bubble {
  background: #3b82f6;
  color: white;
  border-bottom-right-radius: 4px;
}

.pwa-msg-other .pwa-msg-bubble {
  background: white;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
}

.pwa-msg-nota .pwa-msg-bubble {
  background: #fef3c7;
  border-left: 3px solid #f59e0b;
  font-style: italic;
}

.pwa-msg-time {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 4px;
  text-align: right;
}

.pwa-msg-other .pwa-msg-time {
  text-align: left;
}

.pwa-chat-img {
  max-width: 200px;
  border-radius: 12px;
  cursor: pointer;
}

/* Input Area */
.pwa-chat-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  background: white;
  border-top: 1px solid #e5e7eb;
}

.pwa-chat-input input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  font-size: 14px;
}

.pwa-chat-input .btn-icon {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
}

.pwa-chat-input .btn-send {
  background: #3b82f6;
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
}

/* Respuestas Rápidas */
.pwa-respuestas-rapidas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 15px;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
}

.pwa-resp-btn {
  padding: 6px 12px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 15px;
  font-size: 12px;
  cursor: pointer;
}

.pwa-resp-btn:active {
  background: #3b82f6;
  color: white;
}

/* Modal */
.pwa-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
}

.pwa-actions-menu {
  background: white;
  width: 100%;
  padding: 20px;
  border-radius: 20px 20px 0 0;
}

.pwa-actions-menu button {
  display: block;
  width: 100%;
  padding: 15px;
  border: none;
  background: none;
  font-size: 16px;
  text-align: left;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
}

.pwa-actions-menu button:last-child {
  border-bottom: none;
  color: #6b7280;
  text-align: center;
}

.pwa-modal-content {
  background: white;
  width: 90%;
  max-width: 400px;
  padding: 25px;
  border-radius: 16px;
  margin-bottom: 20%;
}

.pwa-modal-content h3 {
  margin: 0 0 15px 0;
}

.pwa-modal-content p {
  margin: 8px 0;
  font-size: 14px;
}

.pwa-modal-content textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  resize: none;
  font-family: inherit;
}

.pwa-modal-btns {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  justify-content: flex-end;
}

.pwa-modal-btns button {
  padding: 10px 20px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: white;
  cursor: pointer;
}

.pwa-modal-btns .btn-primary,
.pwa-modal-content .btn-primary {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 15px;
}

/* Etiquetas PWA */
.pwa-etiquetas-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 15px 0;
}

.pwa-etiqueta-btn {
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  background: white;
  font-size: 13px;
  cursor: pointer;
}

.pwa-etiqueta-btn.active {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

/* Agentes Lista PWA */
.pwa-agentes-lista {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 15px 0;
  max-height: 250px;
  overflow-y: auto;
}

.pwa-agente-item {
  padding: 12px 15px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
}

.pwa-agente-item:active,
.pwa-agente-item.selected {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

.pwa-modal-content textarea {
  width: 100%;
  margin: 10px 0;
}
