/* --- Frontend: Estilo Flotante tipo Facebook --- */
.regalexia-floating-chat-wrapper {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 999999;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
}

.regalexia-chat-bubble {
  width: 60px;
  height: 60px;
  background-color: #0073aa;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
  margin-left: auto;
}

.regalexia-chat-bubble:hover {
  transform: scale(1.05);
}

.regalexia-chat-panel {
  display: none; /* Oculto por defecto */
  flex-direction: column;
  width: 340px;
  height: 480px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  margin-bottom: 15px;
  overflow: hidden;
  position: relative;
}

.regalexia-chat-panel.open {
  display: flex;
}

.regalexia-chat-header {
  background: #0073aa;
  color: #ffffff;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.regalexia-chat-header .close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.regalexia-chat-messages {
  flex-grow: 1;
  overflow-y: auto;
  padding: 15px;
  background: #f0f2f5; /* Color de fondo tipo Messenger */
  border: none;
  margin: 0;
  height: auto;
}

.msg {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
  max-width: 85%;
  clear: both;
}

.user-msg {
  background: #0084ff;
  color: white;
  float: right;
  border-bottom-right-radius: 4px;
}

.admin-msg {
  background: #e4e6eb;
  color: black;
  float: left;
  border-bottom-left-radius: 4px;
}

.regalexia-chat-login {
  padding: 20px;
  text-align: center;
}

.regalexia-chat-input-area {
  display: flex;
  padding: 10px;
  background: #ffffff;
  border-top: 1px solid #e4e6eb;
  align-items: center;
  gap: 8px;
}

.regalexia-chat-input-area textarea {
  flex-grow: 1;
  height: 40px;
  border: 1px solid #ccd0d4;
  border-radius: 20px;
  padding: 10px 15px;
  resize: none;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: none;
}

.regalexia-chat-input-area .send-btn {
  background: #0084ff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.regalexia-chat-input-area .send-btn:hover {
  background: #0073e6;
}

.regalexia-chat-footer-actions {
  background: #ffffff;
  padding: 5px 10px 10px;
  text-align: center;
}

.regalexia-chat-footer-actions button {
  background: none;
  border: none;
  color: #888;
  text-decoration: underline;
  font-size: 12px;
  cursor: pointer;
}

/* --- Frontend: Estilo Flotante tipo Facebook --- */
.regalexia-floating-chat-wrapper {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 999999;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.regalexia-chat-bubble {
  width: 60px;
  height: 60px;
  background-color: #0073aa;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
  margin-left: auto;
}
.regalexia-chat-bubble:hover {
  transform: scale(1.05);
}
.regalexia-chat-panel {
  display: none;
  flex-direction: column;
  width: 340px;
  height: 480px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  margin-bottom: 15px;
  overflow: hidden;
  position: relative;
}
.regalexia-chat-panel.open {
  display: flex;
}
.regalexia-chat-header {
  background: #0073aa;
  color: #ffffff;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.regalexia-chat-header .close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}
.regalexia-chat-messages {
  flex-grow: 1;
  overflow-y: auto;
  padding: 15px;
  background: #f0f2f5;
  border: none;
  margin: 0;
  height: auto;
}
.msg {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
  max-width: 85%;
  clear: both;
}
.user-msg {
  background: #0084ff;
  color: white;
  float: right;
  border-bottom-right-radius: 4px;
}
.admin-msg {
  background: #e4e6eb;
  color: black;
  float: left;
  border-bottom-left-radius: 4px;
}
.regalexia-chat-login {
  padding: 20px;
  text-align: center;
}
.regalexia-chat-input-area {
  display: flex;
  padding: 10px;
  background: #ffffff;
  border-top: 1px solid #e4e6eb;
  align-items: center;
  gap: 8px;
}
.regalexia-chat-input-area textarea {
  flex-grow: 1;
  height: 40px;
  border: 1px solid #ccd0d4;
  border-radius: 20px;
  padding: 10px 15px;
  resize: none;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: none;
}
.regalexia-chat-input-area .send-btn {
  background: #0084ff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}
.regalexia-chat-input-area .send-btn:hover {
  background: #0073e6;
}
.regalexia-chat-footer-actions {
  background: #ffffff;
  padding: 5px 10px 10px;
  text-align: center;
}
.regalexia-chat-footer-actions button {
  background: none;
  border: none;
  color: #888;
  text-decoration: underline;
  font-size: 12px;
  cursor: pointer;
}

/* --- Frontend: Dashboard Shortcode --- */
.regalexia-frontend-dashboard {
  display: flex;
  border: 1px solid #e4e6eb;
  border-radius: 12px;
  overflow: hidden;
  height: 600px;
  background: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.regalexia-dashboard-sidebar {
  width: 30%;
  min-width: 250px;
  border-right: 1px solid #e4e6eb;
  background: #f8f9fa;
  overflow-y: auto;
}
.dashboard-section-title {
  background: #e4e6eb;
  padding: 10px 15px;
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  color: #555;
  letter-spacing: 0.5px;
}
.regalexia-dashboard-item {
  padding: 15px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 14px;
}
.regalexia-dashboard-item:hover,
.regalexia-dashboard-item.active {
  background: #e9f5ff;
  border-left: 4px solid #0084ff;
}
.status-closed {
  color: #d9534f;
  font-size: 11px;
  font-weight: bold;
}
.status-open {
  color: #5cb85c;
  font-size: 11px;
  font-weight: bold;
}

.regalexia-dashboard-main {
  width: 70%;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
}
.dashboard-header-actions {
  padding: 12px 20px;
  background: #f8f9fa;
  border-bottom: 1px solid #e4e6eb;
  text-align: right;
}
.dashboard-btn-close {
  background: #fff;
  border: 1px solid #d9534f;
  color: #d9534f;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}
.dashboard-btn-close:hover {
  background: #d9534f;
  color: #fff;
}
.regalexia-dashboard-input-area {
  padding: 15px;
  border-top: 1px solid #e4e6eb;
  display: flex;
  gap: 10px;
  background: #fff;
}
.regalexia-dashboard-input-area textarea {
  flex-grow: 1;
  height: 50px;
  border: 1px solid #ccd0d4;
  border-radius: 6px;
  padding: 10px;
  resize: none;
  font-family: inherit;
}
.dashboard-btn-send {
  background: #0084ff;
  color: white;
  border: none;
  padding: 0 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: 0.2s;
}
.dashboard-btn-send:hover {
  background: #0073e6;
}

@media (max-width: 768px) {
  .regalexia-frontend-dashboard {
    flex-direction: column;
    height: auto;
    min-height: 80vh;
  }
  .regalexia-dashboard-sidebar {
    width: 100%;
    height: 30vh;
    border-right: none;
    border-bottom: 2px solid #ddd;
  }
  .regalexia-dashboard-main {
    width: 100%;
    height: 50vh;
  }
}

/* --- Frontend: Estilo Flotante tipo Facebook --- */
.regalexia-floating-chat-wrapper {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 999999;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.regalexia-chat-bubble {
  width: 60px;
  height: 60px;
  background-color: #0073aa;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
  margin-left: auto;
}
.regalexia-chat-bubble:hover {
  transform: scale(1.05);
}
.regalexia-chat-panel {
  display: none;
  flex-direction: column;
  width: 340px;
  height: 480px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  margin-bottom: 15px;
  overflow: hidden;
  position: relative;
}
.regalexia-chat-panel.open {
  display: flex;
}
.regalexia-chat-header {
  background: #0073aa;
  color: #ffffff;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.regalexia-chat-header .close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}
.regalexia-chat-messages {
  flex-grow: 1;
  overflow-y: auto;
  padding: 15px;
  background: #f0f2f5;
  border: none;
  margin: 0;
  height: auto;
}
.msg {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
  max-width: 85%;
  clear: both;
}
.user-msg {
  background: #0084ff;
  color: white;
  float: right;
  border-bottom-right-radius: 4px;
}
.admin-msg {
  background: #e4e6eb;
  color: black;
  float: left;
  border-bottom-left-radius: 4px;
}
.regalexia-chat-login {
  padding: 20px;
  text-align: center;
}
.regalexia-chat-input-area {
  display: flex;
  padding: 10px;
  background: #ffffff;
  border-top: 1px solid #e4e6eb;
  align-items: center;
  gap: 8px;
}
.regalexia-chat-input-area textarea {
  flex-grow: 1;
  height: 40px;
  border: 1px solid #ccd0d4;
  border-radius: 20px;
  padding: 10px 15px;
  resize: none;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: none;
}
.regalexia-chat-input-area .send-btn {
  background: #0084ff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}
.regalexia-chat-input-area .send-btn:hover {
  background: #0073e6;
}
.regalexia-chat-footer-actions {
  background: #ffffff;
  padding: 5px 10px 10px;
  text-align: center;
}
.regalexia-chat-footer-actions button {
  background: none;
  border: none;
  color: #888;
  text-decoration: underline;
  font-size: 12px;
  cursor: pointer;
}

/* --- Frontend: Dashboard Shortcode --- */
.regalexia-frontend-dashboard {
  display: flex;
  border: 1px solid #e4e6eb;
  border-radius: 12px;
  overflow: hidden;
  height: 600px;
  background: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.regalexia-dashboard-sidebar {
  width: 30%;
  min-width: 250px;
  border-right: 1px solid #e4e6eb;
  background: #f8f9fa;
  overflow-y: auto;
}
.dashboard-section-title {
  background: #e4e6eb;
  padding: 10px 15px;
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  color: #555;
  letter-spacing: 0.5px;
}
.regalexia-dashboard-item {
  padding: 15px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 14px;
  position: relative;
}
.regalexia-dashboard-item:hover,
.regalexia-dashboard-item.active {
  background: #e9f5ff;
  border-left: 4px solid #0084ff;
}
.status-closed {
  color: #d9534f;
  font-size: 11px;
  font-weight: bold;
}
.status-open {
  color: #5cb85c;
  font-size: 11px;
  font-weight: bold;
}
.regalexia-dashboard-main {
  width: 70%;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
}
.dashboard-header-actions {
  padding: 12px 20px;
  background: #f8f9fa;
  border-bottom: 1px solid #e4e6eb;
  text-align: right;
}
.dashboard-btn-close {
  background: #fff;
  border: 1px solid #d9534f;
  color: #d9534f;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}
.dashboard-btn-close:hover {
  background: #d9534f;
  color: #fff;
}
.regalexia-dashboard-input-area {
  padding: 15px;
  border-top: 1px solid #e4e6eb;
  display: flex;
  gap: 10px;
  background: #fff;
}
.regalexia-dashboard-input-area textarea {
  flex-grow: 1;
  height: 50px;
  border: 1px solid #ccd0d4;
  border-radius: 6px;
  padding: 10px;
  resize: none;
  font-family: inherit;
}
.dashboard-btn-send {
  background: #0084ff;
  color: white;
  border: none;
  padding: 0 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: 0.2s;
}
.dashboard-btn-send:hover {
  background: #0073e6;
}
@media (max-width: 768px) {
  .regalexia-frontend-dashboard {
    flex-direction: column;
    height: auto;
    min-height: 80vh;
  }
  .regalexia-dashboard-sidebar {
    width: 100%;
    height: 30vh;
    border-right: none;
    border-bottom: 2px solid #ddd;
  }
  .regalexia-dashboard-main {
    width: 100%;
    height: 50vh;
  }
}

/* --- Etiquetas y Utilidades --- */
.badge-buyer {
  background: #5cb85c;
  color: white;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
}
.badge-prospect {
  background: #f0ad4e;
  color: white;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
}

/* Estilo para mensajes NO leídos */
.unread-chat {
  font-weight: bold;
  background-color: #f4f8ff !important;
  border-left: 4px solid #d9534f !important;
}
.unread-chat strong {
  color: #000;
}
.regalexia-chat-item {
  position: relative;
  cursor: pointer;
  padding: 10px;
  border-bottom: 1px solid #eee;
}
.regalexia-chat-item:hover,
.regalexia-chat-item.active {
  background: #e9f5ff;
}

/* --- Frontend: Estilo Flotante tipo Facebook --- */
.regalexia-floating-chat-wrapper {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 999999;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.regalexia-chat-bubble {
  width: 60px;
  height: 60px;
  background-color: #0073aa;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
  margin-left: auto;
}
.regalexia-chat-bubble:hover {
  transform: scale(1.05);
}
.regalexia-chat-panel {
  display: none;
  flex-direction: column;
  width: 340px;
  height: 480px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  margin-bottom: 15px;
  overflow: hidden;
  position: relative;
}
.regalexia-chat-panel.open {
  display: flex;
}
.regalexia-chat-header {
  background: #0073aa;
  color: #ffffff;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.regalexia-chat-header .close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}
.regalexia-chat-messages {
  flex-grow: 1;
  overflow-y: auto;
  padding: 15px;
  background: #f0f2f5;
  border: none;
  margin: 0;
  height: auto;
}
.msg {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
  max-width: 85%;
  clear: both;
}
.user-msg {
  background: #0084ff;
  color: white;
  float: right;
  border-bottom-right-radius: 4px;
}
.admin-msg {
  background: #e4e6eb;
  color: black;
  float: left;
  border-bottom-left-radius: 4px;
}
.regalexia-chat-login {
  padding: 20px;
  text-align: center;
}
.regalexia-chat-input-area {
  display: flex;
  padding: 10px;
  background: #ffffff;
  border-top: 1px solid #e4e6eb;
  align-items: center;
  gap: 8px;
}
.regalexia-chat-input-area textarea {
  flex-grow: 1;
  height: 40px;
  border: 1px solid #ccd0d4;
  border-radius: 20px;
  padding: 10px 15px;
  resize: none;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: none;
}
.regalexia-chat-input-area .send-btn {
  background: #0084ff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}
.regalexia-chat-input-area .send-btn:hover {
  background: #0073e6;
}

/* Pie de página del chat flotante */
.regalexia-chat-footer-actions {
  background: #ffffff;
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #f0f2f5;
}
.regalexia-chat-footer-actions button,
.regalexia-chat-footer-actions a {
  background: none;
  border: none;
  color: #888;
  text-decoration: underline;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  margin: 0;
}
.regalexia-chat-footer-actions a:hover,
.regalexia-chat-footer-actions button:hover {
  color: #555;
}
.view-all-link {
  color: #0073aa !important;
  font-weight: 500;
}

/* --- Frontend: Dashboard Shortcode --- */
.regalexia-frontend-dashboard {
  display: flex;
  border: 1px solid #e4e6eb;
  border-radius: 12px;
  overflow: hidden;
  height: 600px;
  background: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.regalexia-dashboard-sidebar {
  width: 30%;
  min-width: 250px;
  border-right: 1px solid #e4e6eb;
  background: #f8f9fa;
  overflow-y: auto;
}
.dashboard-section-title {
  background: #e4e6eb;
  padding: 10px 15px;
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  color: #555;
  letter-spacing: 0.5px;
}
.regalexia-dashboard-item {
  padding: 15px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 14px;
  position: relative;
}
.regalexia-dashboard-item:hover,
.regalexia-dashboard-item.active {
  background: #e9f5ff;
  border-left: 4px solid #0084ff;
}
.status-closed {
  color: #d9534f;
  font-size: 11px;
  font-weight: bold;
}
.status-open {
  color: #5cb85c;
  font-size: 11px;
  font-weight: bold;
}
.regalexia-dashboard-main {
  width: 70%;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
}
.dashboard-header-actions {
  padding: 12px 20px;
  background: #f8f9fa;
  border-bottom: 1px solid #e4e6eb;
  text-align: right;
}
.dashboard-btn-close {
  background: #fff;
  border: 1px solid #d9534f;
  color: #d9534f;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}
.dashboard-btn-close:hover {
  background: #d9534f;
  color: #fff;
}
.regalexia-dashboard-input-area {
  padding: 15px;
  border-top: 1px solid #e4e6eb;
  display: flex;
  gap: 10px;
  background: #fff;
}
.regalexia-dashboard-input-area textarea {
  flex-grow: 1;
  height: 50px;
  border: 1px solid #ccd0d4;
  border-radius: 6px;
  padding: 10px;
  resize: none;
  font-family: inherit;
}
.dashboard-btn-send {
  background: #0084ff;
  color: white;
  border: none;
  padding: 0 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: 0.2s;
}
.dashboard-btn-send:hover {
  background: #0073e6;
}
@media (max-width: 768px) {
  .regalexia-frontend-dashboard {
    flex-direction: column;
    height: auto;
    min-height: 80vh;
  }
  .regalexia-dashboard-sidebar {
    width: 100%;
    height: 30vh;
    border-right: none;
    border-bottom: 2px solid #ddd;
  }
  .regalexia-dashboard-main {
    width: 100%;
    height: 50vh;
  }
}

/* --- Etiquetas y Utilidades --- */
.badge-buyer {
  background: #5cb85c;
  color: white;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
}
.badge-prospect {
  background: #f0ad4e;
  color: white;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
}

/* Estilo para mensajes NO leídos */
.unread-chat {
  font-weight: bold;
  background-color: #f4f8ff !important;
  border-left: 4px solid #d9534f !important;
}
.unread-chat strong {
  color: #000;
}
.regalexia-chat-item {
  position: relative;
  cursor: pointer;
  padding: 10px;
  border-bottom: 1px solid #eee;
}
.regalexia-chat-item:hover,
.regalexia-chat-item.active {
  background: #e9f5ff;
}
