@charset "UTF-8";
/* ----------------------------------------------------
   VISTA DEL PANEL DE CHAT - REDISEÑO MODULAR
   Compilado con Dart Sass a chat.css
   ---------------------------------------------------- */
/* ============================================================
   ESTRUCTURA DE MAQUETACIÓN GLOBAL DEL CHAT (3 COLUMNAS)
   ============================================================ */
.wb-chat-layout {
  display: flex;
  height: 100%;
}

/* COLUMNA 1: Lista Sidebar */
.chat-sidebar {
  width: 320px;
  background: #222736;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
}

/* COLUMNA 2: Conversación (Estilo WhatsApp) */
.chat-conversation {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #1a1e2e;
  background-image: url("https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png");
  background-size: contain;
  background-blend-mode: overlay;
  background-color: rgba(26, 30, 46, 0.95);
}

/* COLUMNA 3: Sidebar de Detalles (Minimal) */
.chat-details {
  width: 280px;
  background: #222736;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  display: none;
  flex-direction: column;
  overflow-y: auto;
}
@media (min-width: 769px) {
  .chat-details {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, border-left-color 0.3s ease;
  }
  .wb-chat-layout.details-collapsed .chat-details {
    width: 0 !important;
    min-width: 0 !important;
    opacity: 0 !important;
    border-left-color: transparent !important;
    pointer-events: none !important;
    overflow: hidden !important;
  }
}

/* Barras de Desplazamiento Personalizadas */
.area-scroll::-webkit-scrollbar {
  width: 6px;
}
.area-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.area-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}
.area-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ============================================================
   COMPONENTES INTERACTIVOS DEL CHAT
   ============================================================ */
/* Filtros y Buscador */
.chat-search-header {
  padding: 10px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  gap: 8px;
  align-items: center;
}
.chat-search-header .search-box {
  flex: 1;
  background: #2a3042;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px; /* Rectangular v7.5 */
  padding: 2px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
}
.chat-search-header .search-box i {
  color: #74788d;
  font-size: 14px;
}
.chat-search-header .search-box input {
  background: transparent;
  border: none;
  color: #a6b0cf;
  width: 100%;
  outline: none;
  font-size: 13px;
}

.btn-filter-slim {
  padding: 6px 10px;
  background: #556ee6;
  border: none;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
}

/* Pestañas de Conversación */
.chat-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.chat-tabs button {
  background: transparent;
  border: none;
  color: #74788d;
  font-size: 12px;
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 4px;
}
.chat-tabs button.active {
  background: rgba(85, 110, 230, 0.2);
  color: #556ee6;
}

/* Lista de Chats */
.chat-list {
  flex: 1;
  overflow-y: auto;
}

.chat-item {
  display: flex;
  padding: 12px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
  align-items: center;
  gap: 12px;
}
.chat-item:hover, .chat-item.active-chat {
  background: #2a3042;
}

.chat-avatar img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.chat-preview {
  flex: 1;
  min-width: 0;
}
.chat-preview h4 {
  margin: 0;
  font-size: 14px;
  color: #eff2f7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-preview p {
  margin: 4px 0 0;
  font-size: 13px;
  color: #74788d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}
.chat-meta .time {
  font-size: 11px;
  color: #74788d;
}

.unread-count {
  background: #06d755;
  color: #000;
  font-size: 11px;
  font-weight: bold;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 5px;
}

/* Cabecera del Chat Activo */
.chat-header {
  background: #222736;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.contact-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.contact-info img {
  width: 35px;
  height: 35px;
  border-radius: 50%;
}
.contact-info h3, .contact-info h3 span, .contact-info h4 {
  margin: 0;
  font-size: 15px;
  color: #ffffff !important;
  font-weight: 600;
}
.contact-info p {
  margin: 2px 0 0;
  font-size: 12px;
  color: #a6b0cf !important;
}

.btn-resolver {
  background: #008069 !important;
  border: none;
  border-radius: 4px;
  color: #fff;
  padding: 4px 12px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

/* Zona de Burbujas de Mensajes */
.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.msg {
  display: flex;
  width: 100%;
}
.msg.in {
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
}
.msg.in .bubble {
  background: #2a3042;
  color: #eff2f7;
  border-top-left-radius: 0;
}
.msg.out {
  flex-direction: row-reverse;
  justify-content: flex-start;
  align-items: center;
}
.msg.out .bubble {
  background: #005c4b;
  color: #fff;
  border-top-right-radius: 0;
}

.bubble {
  max-width: 75%;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  position: relative;
  line-height: 1.4;
}
.bubble .time {
  font-size: 10px;
  opacity: 0.6;
  margin-left: 10px;
  float: right;
  margin-top: 4px;
}

/* Estilo para mensajes de sistema o en espera de descifrado */
.msg-system-wait .bubble {
  background: rgba(255, 193, 7, 0.1) !important;
  border: 1px dashed rgba(255, 193, 7, 0.3) !important;
  color: #ffc107 !important;
  font-style: italic;
  font-size: 11px;
}

/* Sidebar de Detalles */
.details-section {
  padding: 15px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.details-section h4 {
  margin: 0;
  font-size: 11px;
  color: #74788d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  justify-content: space-between;
  cursor: pointer;
}

.accordion-content.open {
  display: block !important;
}

.tags-container {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 10px;
  padding: 3px 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.05);
}

#btn-chat-add-tag {
  padding: 3px 8px !important;
  font-size: 10px !important;
  border-radius: 4px !important;
  background: #556ee6;
  border: none;
  color: #fff;
  cursor: pointer;
}

/* Area de Entrada (Chat Input Area) */
.chat-input-area {
  background: #222736;
  padding: 8px 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.chat-input-area input[type=text] {
  flex: 1;
  background: #2a3042;
  border: none;
  border-radius: 4px;
  padding: 8px 15px;
  color: #eff2f7;
  outline: none;
  font-size: 13px;
}

.icon-btn {
  background: transparent !important;
  border: none;
  color: #a6b0cf;
  font-size: 22px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
}
.icon-btn:hover {
  color: #fff;
  transform: scale(1.1);
}

#btn-send-catalog-product {
  color: #34c38f !important;
}

#btn-chat-send {
  background: #008069 !important;
  color: #fff !important;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 18px;
  margin-left: 5px;
}

/* Dropdowns, Context Menus & Date Picker */
.btn-chat-context {
  color: #a6b0cf !important;
  opacity: 0.7 !important;
  transition: all 0.2s;
  font-size: 14px;
  cursor: pointer;
}
.btn-chat-context:hover {
  opacity: 1 !important;
  color: #fff !important;
}

#chatFilterDropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 40px;
  width: 320px; /* Ancho aumentado para evitar desbordamiento v7.5 */
  background: #2a3042 !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
  z-index: 1000;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  box-sizing: border-box; /* Crucial para evitar desbordamiento */
}

.dark-select.rounded-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 12px;
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: all 0.2s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2374788d' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: calc(100% - 12px) center;
}
.dark-select.rounded-select:focus {
  border-color: #556ee6;
  background-color: rgba(255, 255, 255, 0.08);
}
.dark-select.rounded-select option {
  background: #2a3042;
  color: #fff;
}

.filter-search-container .search-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}
.filter-search-container .search-box:focus-within {
  border-color: var(--wb-accent-blue);
  background: rgba(255, 255, 255, 0.08);
}
.filter-search-container .search-box input {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 13px;
  width: 100%;
  outline: none;
}
.filter-search-container .search-box i {
  color: #74788d;
  font-size: 12px;
}

.filter-date-grid {
  display: flex; /* Cambiado a flex para control total v7.6 */
  gap: 10px;
  justify-content: space-between;
}

.date-field {
  flex: 1;
  min-width: 0;
}
.date-field label {
  display: block;
  font-size: 10px;
  color: #74788d;
  margin-bottom: 4px;
  padding-left: 5px;
}

.date-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.date-input-wrapper input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 10px;
  color: #fff;
  font-size: 11px;
  width: 100%;
  cursor: pointer;
  transition: all 0.2s;
}
.date-input-wrapper input:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}
.date-input-wrapper i {
  position: absolute;
  right: 10px;
  color: var(--wb-accent-blue);
  font-size: 12px;
  pointer-events: none;
}

.mb-15 {
  margin-bottom: 15px;
}

.mb-10 {
  margin-bottom: 10px;
}

.w-100 {
  width: 100%;
}

/* Estilos para el calendario Flatpickr (personalización oscura) */
.flatpickr-calendar {
  background: #2a3042 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
}

.flatpickr-day.selected {
  background: var(--wb-accent-blue) !important;
  border-color: var(--wb-accent-blue) !important;
}

.flatpickr-months .flatpickr-month {
  background: #2a3042 !important;
  color: #fff !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
  background: #2a3042 !important;
}

.flatpickr-weekday {
  color: #74788d !important;
}

.context-dropdown, #chat-tags-dropdown {
  display: none;
  position: absolute;
  background: #2a3042;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  z-index: 1000;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  min-width: 160px;
}

.context-dropdown a, .chat-tag-dropdown-item {
  padding: 8px 12px;
  display: block;
  color: #a6b0cf;
  text-decoration: none;
  font-size: 13px;
}
.context-dropdown a:hover, .chat-tag-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

/* ============================================================
   ESTILOS MULTIMEDIA Y PREVISUALIZADORES v7.8
   ============================================================ */
/* Stickers */
.sticker-msg {
  margin-bottom: 10px;
}

.sticker-bubble {
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  position: relative;
  display: flex;
  flex-direction: column;
}
.sticker-bubble img {
  max-width: 160px;
  height: auto;
  border-radius: 12px;
  display: block;
}
.sticker-bubble .time {
  position: absolute;
  bottom: 5px;
  right: 5px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 2px 8px;
  border-radius: 10px;
  color: #fff;
  font-size: 10px;
  font-weight: 500;
}

/* Reproductor de Audio */
.audio-player-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  min-width: 240px;
}

audio {
  height: 36px;
  width: 100%;
}

/* Contenedores Multimedia */
.media-container {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 5px;
  max-width: 256px; /* Reducción de 20% (320px -> 256px) v7.3 */
  max-height: 256px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.1);
}
.media-container img {
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
  max-height: 400px;
  background: rgba(0, 0, 0, 0.5);
  transition: transform 0.2s;
  cursor: zoom-in;
}
.media-container:hover img {
  transform: scale(1.02);
}

/* Mensajes sin burbuja (Imágenes y Stickers solo con sombra suave) */
.msg.no-bubble > .bubble {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  position: relative;
  max-width: 300px;
}
.msg.no-bubble.in > .bubble {
  margin-left: 0;
}
.msg.no-bubble.out > .bubble {
  margin-right: 0;
}

/* Previsualización Limpia de Imágenes v7.9 */
.media-bubble-clean {
  max-width: 280px !important; /* Tamaño contenido como en la segunda imagen */
  max-height: 400px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}
.media-bubble-clean img {
  width: 100%;
  height: auto;
  object-fit: contain;
  max-height: 400px;
  background: rgba(0, 0, 0, 0.5);
}
.media-bubble-clean:hover img {
  transform: scale(1.02);
}

.media-overlay-clean {
  opacity: 0;
  transition: opacity 0.2s;
}
.media-bubble-clean:hover .media-overlay-clean {
  opacity: 1;
}

/* Documentos */
.msg-file:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}

/* Image Modal (Popup del Visor de Imágenes) */
.wbc-image-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}
.wbc-image-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.wbc-image-modal-overlay.active .wbc-image-modal-content {
  transform: scale(1);
}

.wbc-image-modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  transform: scale(0.8);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.wbc-image-modal-content img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  border: 3px solid rgba(255, 255, 255, 0.1);
}

.wbc-modal-close {
  position: absolute;
  top: -45px;
  right: -45px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 24px;
  transition: all 0.2s;
}
.wbc-modal-close:hover {
  background: #f46a6a;
  transform: rotate(90deg);
}

/* ============================================================
   WBC_NoteTracker — Flotante de seguimiento de nota
   ============================================================ */
#wbc-note-tracker {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  background: #1a1d2e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 18px 22px;
  min-width: 320px;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  color: #fff;
  animation: wbc-tracker-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes wbc-tracker-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes wbc-tracker-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
}
@keyframes wbc-spin {
  to {
    transform: rotate(360deg);
  }
}
.wbc-tracker-close {
  position: absolute;
  top: 10px;
  right: 14px;
  cursor: pointer;
  opacity: 0.5;
  font-size: 18px;
  transition: opacity 0.2s;
}
.wbc-tracker-close:hover {
  opacity: 1;
}

.wbc-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s;
}
.wbc-step:last-child {
  border-bottom: none;
}

.wbc-step-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.08);
}
.wbc-step-icon.pending {
  color: #64748b;
}
.wbc-step-icon.active {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  animation: wbc-spin 1s linear infinite;
}
.wbc-step-icon.done {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  animation: none;
}
.wbc-step-icon.error {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.wbc-step-text {
  flex: 1;
}

.wbc-step-label {
  font-size: 13px;
  font-weight: 600;
}

.wbc-step-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 2px;
}

/* ============================================================
   MAQUETACIÓN MÓVIL CHAT — ARQUITECTURA FLEXBOX (v9.0)
   Basado en mejores prácticas iOS Safari/Chrome 2025:
   - Flex column layout (no position:absolute)
   - env(safe-area-inset-bottom) para home indicator
   - -webkit-overflow-scrolling: touch para scroll nativo
   ============================================================ */
@media (max-width: 768px) {
  /* CONTENEDOR PRINCIPAL DEL CHAT */
  .wb-chat-layout {
    position: relative !important;
    overflow: hidden !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .wb-chat-layout.conversation-open {
    height: 100% !important;
  }
  .wb-chat-layout.conversation-open .chat-sidebar {
    display: none !important;
  }
  .wb-chat-layout.conversation-open .chat-conversation {
    display: flex !important;
    animation: wbcSlideInChat 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  .wb-chat-layout.details-open .chat-details {
    right: 0 !important;
  }
  /* COLUMNA 1: LISTA DE CHATS (Sidebar) */
  .chat-sidebar {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    flex-shrink: 0 !important;
  }
  /* COLUMNA 2: CONVERSACIÓN */
  .chat-conversation {
    display: none !important;
    flex-direction: column !important;
    width: 100% !important;
    height: 100% !important;
    background: #1a1e2e !important;
  }
  @keyframes wbcSlideInChat {
    from {
      transform: translateX(30%);
      opacity: 0.8;
    }
    to {
      transform: translateX(0);
      opacity: 1;
    }
  }
  /* BOTÓN VOLVER */
  .chat-mobile-back-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    color: var(--wb-text-light) !important;
    font-size: 18px !important;
    padding: 5px 12px 5px 0 !important;
    margin-right: 4px !important;
    cursor: pointer !important;
    transition: color 0.2s;
    flex-shrink: 0 !important;
  }
  .chat-mobile-back-btn:hover {
    color: var(--wb-accent-blue) !important;
  }
  /* CABECERA DEL CHAT (flex: 0 0 auto) */
  .chat-header {
    padding: 8px 12px !important;
    min-height: 52px !important;
    max-height: 56px !important;
    box-sizing: border-box !important;
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    overflow: hidden !important;
  }
  .contact-info {
    cursor: pointer !important;
    min-width: 0 !important;
    flex: 1 1 0% !important;
    overflow: hidden !important;
  }
  .contact-info > div {
    min-width: 0 !important;
    overflow: hidden !important;
  }
  .contact-info img {
    width: 32px !important;
    height: 32px !important;
    flex-shrink: 0 !important;
  }
  .contact-info h3,
  .contact-info h3 span {
    font-size: 13px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important;
    max-width: 100% !important;
  }
  .contact-info p {
    font-size: 11px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important;
    max-width: 100% !important;
  }
  .chat-actions {
    gap: 2px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
  }
  .chat-actions .btn-filter-slim {
    padding: 4px 6px !important;
    font-size: 11px !important;
  }
  .btn-resolver {
    padding: 4px 6px !important;
    font-size: 9px !important;
    white-space: nowrap !important;
  }
  /* ZONA DE MENSAJES (flex: 1 — espacio libre) */
  .chat-messages {
    padding: 12px 10px !important;
    gap: 10px !important;
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    min-height: 0 !important;
  }
  .bubble {
    max-width: 85% !important;
    font-size: 14px !important;
    padding: 8px 10px !important;
  }
  .audio-player-wrapper {
    min-width: 180px !important;
  }
  /* BARRA DE INPUT (flex: 0 0 auto — siempre abajo) */
  .chat-input-area {
    padding: 8px 10px !important;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    gap: 6px !important;
    box-sizing: border-box !important;
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: #222736 !important;
  }
  .chat-input-area input[type=text] {
    padding: 8px 12px !important;
    font-size: 16px !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }
  .chat-search-header .search-box input {
    font-size: 16px !important;
  }
  .icon-btn {
    font-size: 18px !important;
    padding: 4px !important;
    flex-shrink: 0 !important;
  }
  #btn-chat-send {
    width: 34px !important;
    height: 34px !important;
    font-size: 16px !important;
    margin-left: 2px !important;
    flex-shrink: 0 !important;
  }
  /* PANEL DE DETALLES (Drawer lateral) */
  .chat-details {
    position: fixed !important;
    top: 56px !important;
    right: -285px !important;
    bottom: 0 !important;
    width: 280px !important;
    height: auto !important;
    z-index: 100002 !important;
    display: flex !important;
    flex-direction: column !important;
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    border-left: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: rgba(34, 39, 54, 0.98) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5) !important;
  }
  #wb-chat-details-mobile-header {
    display: block !important;
    background: rgba(0, 0, 0, 0.15) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    padding: 15px 20px !important;
  }
  /* PREVISUALIZACIÓN DE ARCHIVOS */
  #wb-file-preview-container {
    flex: 0 0 auto !important;
  }
  /* MULTIMEDIA RESPONSIVE */
  .media-bubble-clean {
    max-width: 220px !important;
  }
  .media-container {
    max-width: 200px !important;
    max-height: 200px !important;
  }
  /* TRACKERS Y PANELES FLOTANTES */
  #wbc-note-tracker {
    right: 10px !important;
    left: 10px !important;
    min-width: auto !important;
    max-width: none !important;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
  }
  #wbc-floating-upload-panel {
    right: 10px !important;
    left: 10px !important;
    min-width: auto !important;
    max-width: none !important;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* ============================================================
   ESTILOS PREMIUM: REACCIONES Y RESPUESTAS (OPTIMIZACIÓN CHAT)
   ============================================================ */

/* Pastillas de Reacción */
.reaction-pill {
  position: absolute;
  bottom: -10px;
  background: #2a3042;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 1px 6px;
  font-size: 13px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  cursor: default;
  user-select: none;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease-in-out;
}
.reaction-pill:hover {
  transform: scale(1.2);
}

/* Contenedor de Acciones de Mensaje (Hover) */
.msg {
  position: relative;
}
.msg-actions-wrapper {
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20;
  margin: 0 8px;
  flex-shrink: 0;
}
.msg:hover .msg-actions-wrapper {
  display: flex;
}
.btn-reply-msg {
  background: #2e3548;
  border: 1px solid rgba(255,255,255,0.1);
  color: #a6b0cf;
  cursor: pointer;
  padding: 0;
  font-size: 12px;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.btn-reply-msg:hover {
  background: #3b4258;
  color: #727cf5;
  transform: scale(1.1);
}

/* Cita/Respuesta en la Burbuja de Mensaje */
.quoted-bubble {
  border-left: 4px solid #727cf5 !important;
  background: rgba(255, 255, 255, 0.05) !important;
  padding: 6px 10px !important;
  border-radius: 4px !important;
  margin-bottom: 6px !important;
  font-size: 11px !important;
  cursor: pointer;
  user-select: none;
}
.quoted-sender {
  font-weight: 700 !important;
  color: #727cf5 !important;
  margin-bottom: 2px !important;
}
.quoted-text {
  opacity: 0.8 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100% !important;
}

/* Barra de Previsualización de Respuesta sobre el Input */
.reply-preview-bar {
  display: none;
  align-items: center;
  background: #2a3042;
  border: 1px solid rgba(255,255,255,0.08);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 8px 16px;
  position: relative;
  width: calc(100% - 30px);
  margin: 0 auto;
  gap: 12px;
  box-shadow: 0 -2px 6px rgba(0,0,0,0.15);
  animation: slideUpReply 0.2s ease-out;
}
.reply-preview-border {
  width: 4px;
  background: #727cf5;
  height: 80%;
  border-radius: 2px;
  align-self: center;
}
.reply-preview-content {
  flex: 1;
  min-width: 0;
}
.reply-preview-sender {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #727cf5;
  margin-bottom: 2px;
}
.reply-preview-text {
  font-size: 11px;
  color: #a6b0cf;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-close-reply-preview {
  background: transparent;
  border: none;
  color: #74788d;
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}
.btn-close-reply-preview:hover {
  color: #f46a6a;
}

@keyframes slideUpReply {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Animación de Resaltado del Mensaje Objetivo */
.quoted-bubble {
  cursor: pointer;
}
.msg-highlight {
  animation: messageFlash 2s ease;
}

@keyframes messageFlash {
  0% { background: transparent; }
  20% { background: rgba(114, 124, 245, 0.25); border-radius: 8px; }
  100% { background: transparent; }
}

/* Divisor de fecha en el chat (Estilo WhatsApp Web) */
.chat-date-divider {
  display: flex;
  justify-content: center;
  margin: 15px 0;
  width: 100%;
  clear: both;
}
.chat-date-divider span {
  background: #182229;
  color: #8696a0;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
  font-weight: 500;
  user-select: none;
}


