/* ================== VARIABLES DE COLOR ================== */
:root {
  /* 🎨 Modo oscuro por defecto */
  --color-bg: #0f111a;
  --color-text: #e5e7eb;
  --color-accent: #3b82f6;
  --color-accent-dark: #2563eb;
  --color-danger: #ef4444;
  --color-danger-dark: #dc2626;
  --color-success: #22c55e;
  --color-warning: #ffcc00;
  --color-cyan: #00eaff;
  --color-green-bright: #00ff88;
  --color-border: rgba(255, 255, 255, 0.1);
  --color-overlay: rgba(255, 255, 255, 0.05);
  --color-muted: #838383;
  --color-terminal-bg: rgba(0, 0, 0, 0.8);
  --color-terminal-border: #0f0;
  --color-footer-bg: rgba(15, 17, 26, 0.8);
  --icon-color: #e5e7eb; /* color de iconos en modo oscuro */
}

/* 🎨 Tema claro */
:root.light {
  --color-bg: #f8fafc;
  --color-text: #111827;
  --color-accent: #2563eb;
  --color-accent-dark: #1e40af;
  --color-danger: #dc2626;
  --color-danger-dark: #b91c1c;
  --color-success: #16a34a;
  --color-warning: #d97706;
  --color-cyan: #0891b2;
  --color-green-bright: #10b981;
  --color-border: rgba(0, 0, 0, 0.1);
  --color-overlay: rgba(0, 0, 0, 0.05);
  --color-muted: #6b7280;
  --color-terminal-bg: rgba(243, 244, 246, 0.95);
  --color-terminal-border: #2563eb;
  --color-footer-bg: rgba(255, 255, 255, 0.8);
  --icon-color: #111827; /* color de iconos en modo oscuro */
}

/* ================== RESET BÁSICO ================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Inter", sans-serif;
  color: var(--color-muted);
}

i.bx {
  color: var(--icon-color);
  transition: color 0.3s ease; /* animación suave al cambiar tema */
}

#system-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top left, #0d0d0d, var(--color-bg));
  color: var(--color-text);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  font-family: "Courier New", monospace;
  padding: 10px;
  /* 🔥 margen interno para móviles */
}

/* --- Caja principal --- */
.overlay-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 255, 255, 0.2);
  padding: 30px 40px;
  border-radius: 16px;
  box-shadow: 0 0 50px rgba(0, 255, 255, 0.2);

  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  /* 🔥 nunca sobrepasa pantalla */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  text-align: center;
  animation: fadeIn 0.8s ease forwards;
  overflow: hidden;
  right: -10rem;
  top: 22rem;
}

/* --- Icono con animación --- */
.overlay-icon {
  font-size: 4rem;
  animation: spinBounce 2.5s infinite ease-in-out;
}

@keyframes spinBounce {
  0% {
    transform: rotate(0deg) scale(1);
  }

  25% {
    transform: rotate(15deg) scale(1.1);
  }

  50% {
    transform: rotate(-15deg) scale(1);
  }

  75% {
    transform: rotate(10deg) scale(1.05);
  }

  100% {
    transform: rotate(0deg) scale(1);
  }
}

/* --- Título --- */
.overlay-title {
  font-size: 2rem;
  letter-spacing: 1px;
  margin: 0;
}

/* --- Terminal estilo hacker --- */
.terminal {
  flex: 1;
  /* 🔥 se adapta sin empujar */
  width: 100%;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--color-terminal-border);
  border-radius: 8px;
  padding: 15px;
  font-size: 0.95rem;
  overflow-y: auto;
  /* 🔥 scroll interno */
  color: var(--color-terminal-border);
  text-align: left;
  box-shadow: inset 0 0 15px rgba(0, 255, 0, 0.3);
}

.terminal-line {
  display: block;
  white-space: pre;
  margin-bottom: 4px;
}

/* Colores estilo sintaxis */
.syntax-green {
  color: var(--color-green-bright);
}

.syntax-yellow {
  color: var(--color-warning);
}

.syntax-cyan {
  color: var(--color-cyan);
}

.syntax-red {
  color: #ff5555;
}

/* --- 🔥 Adaptación para móviles --- */
@media (max-width: 600px) {
  .overlay-box {
    padding: 20px;
    gap: 15px;
    right: -9.35rem;
  }

  .overlay-icon {
    font-size: 3rem;
  }

  .overlay-title {
    font-size: 1.5rem;
  }

  .terminal {
    font-size: 0.8rem;
    padding: 10px;
    max-height: 50vh;
    /* 🔥 menos alto en móviles */
  }
}

/* --- Progreso --- */
.progress-bar {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  margin-top: 15px;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #00f260, #0575e6);
  animation: loadProgress 5s infinite;
}

@keyframes loadProgress {
  0% {
    width: 0%;
  }

  50% {
    width: 80%;
  }

  100% {
    width: 100%;
  }
}

.author-msg {
  margin-top: 15px;
  text-align: center;
  font-size: 0.95rem;
  opacity: 0.85;
  color: var(--color-muted);
  animation: fadeIn 1.5s ease;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

/* ================== HEADER USUARIO ================== */
#user-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 900px;
  background: rgba(255, 255, 255, 0.05);
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
}

.status {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--color-bg);
}

.status.red {
  background: var(--color-danger);
}

.status.green {
  background: var(--color-success);
}

#user-number {
  font-weight: 500;
  font-size: 14px;
}

/* ================== LOGIN ================== */
#login-container {
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.05);
  padding: 30px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  margin: auto;
}

#login-container h2 {
  margin-bottom: 20px;
  color: var(--color-accent);
  font-weight: 600;
}

#login-container input {
  width: 100%;
  padding: 12px;
  margin: 8px 0;
  border-radius: 8px;
  border: none;
  outline: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text);
}

#login-container input::placeholder {
  color: var(--color-muted);
}

#login-container #btnLogin {
  margin-top: 15px;
  padding: 12px 20px;
  width: 100%;
  border: none;
  border-radius: 10px;
  background: var(--color-accent-dark);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

#login-container #btnLogin:hover {
  transform: scale(1.05);
}

/* ================== FAB URL================== */
.url-fab-container {
  position: fixed;
  bottom: 78px;
  left: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  z-index: 1000;
}

.fab-urls {
  cursor: pointer;
}

.url-fab-options {
  display: none;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.url-fab-options a {
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s;
  text-decoration: none;
  background: white;
}

.url-fab-options a:hover {
  background: var(--color-accent-dark);
  color: white;
  transform: scale(1.05);
}

.url-fab-options.show {
  display: flex; /* Se abre cuando tiene la clase show */
}

/* ================== FAB ADMIN ================== */
.fab-container {
  position: fixed;
  bottom: 78px;
  right: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  z-index: 1000;
}

.fab {
  border-radius: 50%;
  color: white;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.3s;
}

.fab-options {
  display: none;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.fab-options button {
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s;
}

.fab-options button:hover {
  background: var(--color-accent-dark);
  transform: scale(1.05);
}

/* ================== QR CONTAINER ================== */
#qr-container {
  display: none;
  text-align: center;
  margin: 20px 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
}

#qr-container img {
  max-width: 300px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

#qr-container h2 {
  color: var(--color-accent);
  margin-bottom: 15px;
}

/* ================== FORMULARIO ENVÍO ================== */
#sendForm {
  display: none;
  width: 100%;
  max-width: 900px;
  margin-bottom: 90px;
}

#delay {
  max-width: 55px;
}

#clearStore {
  position: fixed;
  bottom: 42px;
  right: -2px;
  /* un pequeño margen desde el borde izquierdo */
  padding: 10px 18px;
  font-size: 15px;
  font-weight: bold;
  border: none;
  display: none;
  border-radius: 8px;
  background: none;
  /* rojo tipo "cerrar sesión" */
  color: white;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  z-index: 1000;
  /* que no quede tapado */
}

#clearStore:hover {
  transform: translateY(-2px);
}

#clearStore:active {
  transform: translateY(1px);
}

/* Contenedor del botón flotante */
#getContacts {
  display: none;
  /* tu JS controla cuando mostrarlo */
  position: fixed;
  bottom: 40px;
  left: -4px;
  padding: 12px 22px;
  font-size: 1rem;
  font-weight: 600;
  background: none;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  z-index: 999;
  animation: bounceIn 0.6s ease forwards;
}

/* Hover y efecto pulsar */
#getContacts:hover {
  transform: translateY(-3px) scale(1.05);
}

#getContacts:active {
  transform: translateY(0) scale(1);
}

/* Animación de aparición */
@keyframes bounceIn {
  0% {
    transform: translateY(100px) scale(0.5);
    opacity: 0;
  }

  60% {
    transform: translateY(-10px) scale(1.05);
    opacity: 1;
  }

  80% {
    transform: translateY(5px) scale(0.95);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

#sendForm h1 {
  color: var(--color-accent);
  margin-bottom: 20px;
  font-weight: 600;
  text-align: center;
}

#sendForm label {
  font-weight: 500;
  margin-bottom: 5px;
  display: block;
}

#sendForm input {
  width: 100%;
  padding: 12px;
  margin: 8px 0 16px;
  border-radius: 12px;
  border: none;
  outline: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text);
}

#sendForm textarea,
.message-box textarea {
  resize: none;
  width: 100%;
  /* ocupa todo el ancho de su contenedor */
  min-height: 120px;
  padding: 8px;
  box-sizing: border-box;
  /* incluye padding dentro del ancho */
  border-radius: 6px;
  color: var(--color-text);
  border: 1px solid var(--color-muted);
  background: none;
  font-size: 1rem;
}

#sendForm #btn_send_form {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid;
  background: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

#sendForm #btn_send_form:hover {
  transform: scale(1.05);
}

/* 🔴 Botón Cancelar */
.btn-cancel {
  background: linear-gradient(
    135deg,
    var(--color-danger),
    var(--color-danger-dark)
  );
  /* rojo intenso */
  color: var(--color-text);
  font-weight: 600;
  padding: 10px 18px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.3);
}

.btn-cancel:hover {
  background: linear-gradient(
    135deg,
    var(--color-danger-dark),
    var(--color-danger-dark)
  );
  box-shadow: 0 6px 14px rgba(220, 38, 38, 0.4);
  transform: scale(1.05);
}

.btn-cancel:active {
  transform: scale(0.97);
}

.btn-cancel:disabled {
  background: var(--color-muted);
  cursor: not-allowed;
  box-shadow: none;
}

/* ================== BARRA DE PROGRESO ================== */
#progress {
  width: 100%;
  max-width: 900px;
  height: 5px;
  border-radius: 12px;
  overflow: hidden;
  margin: 5px 0;
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  display: none;
}

#progress::-webkit-progress-bar {
  background: rgba(255, 255, 255, 0.1);
}

#progress::-webkit-progress-value {
  background: linear-gradient(
    135deg,
    var(--color-accent),
    var(--color-accent-dark)
  );
  transition: width 0.3s ease;
}

#progress::-moz-progress-bar {
  background: linear-gradient(
    135deg,
    var(--color-accent),
    var(--color-accent-dark)
  );
}

/* ================== TABLA RESULTADOS ================== */
table {
  width: 100%;
  max-width: 900px;
  border-collapse: collapse;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  display: none;
}

table thead {
  background: linear-gradient(
    135deg,
    var(--color-accent),
    var(--color-accent-dark)
  );
  color: white;
}

table th,
table td {
  padding: 12px 16px;
  text-align: left;
  font-size: 14px;
  color: var(--color-text);
}

table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.05);
}

table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.02);
}

/* ================== MODAL CREAR USUARIO ================== */
#create-user-modal,
#update-user-modal,
#bulk-user-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* más opaco para legibilidad */
  padding: 20px;
  /* ajusta si quieres menos espacio */
  border-radius: 16px;
  background: var(--color-bg);
  max-width: 400px;
  width: 70%;
  max-height: 80vh;
  flex-direction: column;
  border: 1px solid;
  /* ⚡ importante: limita la altura a la pantalla */
  overflow-y: auto;
  /* ⚡ permite scroll interno si es necesario */
  z-index: 9900;
}

#create-user-modal h3,
#update-user-modal h3,
#bulk-user-modal h3 {
  color: var(--color-accent);
  margin-bottom: 20px;
}

#create-user-modal input,
#create-user-modal select,
#update-user-modal input,
#update-user-modal select,
#bulk-user-modal input {
  width: 100%;
  padding: 12px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text);
  border: 1px solid var(--color-accent-dark);
  font-weight: bolder;
  font-size: 15px;
}

#create-user-modal button,
#update-user-modal button,
#bulk-user-modal button {
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(
    135deg,
    var(--color-accent),
    var(--color-accent-dark)
  );
  color: white;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s;
}

#create-user-modal button:hover,
#update-user-modal button:hover,
#bulk-user-modal button:hover {
  transform: scale(1.05);
}

/* Fondo oscurecido del modal */
.modal-delete-session,
.modal-recharge-credits {
  display: none;
  /* mostrar con JS */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Contenedor principal */
.modal-delete-session__content,
.modal-recharge-credits__content {
  background: var(--color-bg);
  padding: 30px 25px;
  border-radius: 10px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  animation: modalFadeIn 0.3s ease-in-out;
}

/* Título */
.modal-delete-session__title,
.modal-recharge-credits__title {
  margin-bottom: 20px;
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text);
  text-align: center;
}

/* Input */
.modal-delete-session__input,
.modal-recharge-credits__input {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid var(--color-muted);
  border-radius: 6px;
  margin-bottom: 25px;
  box-sizing: border-box;
}

/* Acciones (botones) */
.modal-delete-session__actions,
.modal-recharge-credits__actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

/* Botones base */
.modal-delete-session__btn,
.modal-recharge-credits__btn {
  flex: 1;
  padding: 10px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}

/* Botón rojo (eliminar) */
.modal-delete-session__btn--danger,
.modal-recharge-credits__btn--primary {
  background-color: var(--color-danger);
  color: var(--color-text);
}

.modal-delete-session__btn--danger:hover {
  background-color: var(--color-danger-dark);
}

/* Botón gris (cancelar) */
.modal-delete-session__btn--secondary,
.modal-recharge-credits__btn--secondary {
  background-color: var(--color-muted);
  color: var(--color-text);
}

.modal-delete-session__btn--secondary:hover,
.modal-recharge-credits__btn--secondary:hover {
  background-color: var(--color-muted);
}

/* Animación */
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================== ALERT BOX ================== */
.alert-box {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(30, 41, 59, 0.95);
  color: var(--color-text);
  padding: 15px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: none;
  align-items: center;
  gap: 15px;
  min-width: 250px;
  max-width: 350px;
  font-weight: 700;
  animation: slideIn 0.3s ease forwards;
}

.alert-box button {
  border: none;
  background: transparent;
  color: var(--color-text);
  font-size: 16px;
  cursor: pointer;
}

@keyframes slideIn {
  0% {
    opacity: 0;
    transform: translateX(100%);
  }

  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOut {
  0% {
    opacity: 1;
    transform: translateX(0);
  }

  100% {
    opacity: 0;
    transform: translateX(100%);
  }
}

.alert-success {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid green;
}

.alert-error {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid red;
}

.alert-info {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid;
}

/* ================== FOOTER ================== */
#developer-footer {
  width: 100%;
  text-align: center;
  padding: 12px 0;
  font-size: 14px;
  color: var(--color-accent);
  font-weight: 500;
  position: fixed;
  bottom: 0;
  left: 0;
  backdrop-filter: blur(6px);
  z-index: 1000;
  transition: all 0.3s ease;
}

#developer-footer:hover {
  color: var(--color-accent);
  transform: scale(1.02);
}

/* ================== INPUT PASSWORD CONTAINER ================== */
.password-container {
  position: relative;
  width: 100%;
}

.password-container input {
  padding: 10px 40px 10px 10px;
  border-radius: 8px;
  border: 1px solid var(--color-muted);
  font-size: 16px;
  transition: border 0.3s;
}

.password-container input:focus {
  outline: none;
}

.toggle-password {
  width: 10px !important;
  height: 10px;
  top: 16px;
  right: 20px;
  position: absolute;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  transition: transform 0.2s;
}

/* ================== MENSAJES ================== */

/* Contenedor de mensajes */
#messages-container {
  display: flex;
  flex-wrap: wrap;
  /* permite que los message-box bajen en varias filas */
  gap: 12px;
  /* espacio entre elementos en móvil */
  padding-bottom: 25px;
}

/* Media query para pantallas muy grandes */
@media (min-width: 1200px) {
  #placeholders {
    position: absolute;
    top: 40px;
    right: 0px;
  }
}

#dynamic-messages {
  position: relative;
}

/* 🔹 Fondo oscuro */
.preview-modal {
  display: none; /* oculto por defecto */
  position: fixed;
  max-height: 100%;
  z-index: 9999;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
}

/* 🔹 Caja del preview */
.preview-content {
  background: var(--color-bg);
  padding: 20px;
  border-radius: 12px;
  max-width: 420px;
  max-height: 90vh;
  width: 90%;
  overflow: scroll;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  animation: popupIn 0.3s ease;
  position: relative;
}

/* Botón cerrar */
.close-preview {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 22px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
}

.preview-content h3 {
  text-align: center;
}
/* 🔹 Simulación de WhatsApp */
.whatsapp-preview {
  background: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  line-height: 1.5;
  font-family: system-ui, sans-serif;
  white-space: pre-wrap;
}

.whatsapp-preview b {
  font-weight: bold;
}

.whatsapp-preview i {
  font-style: italic;
}

.whatsapp-preview .dynamic-value {
  color: #075e54;
  font-weight: bold;
}

/* Animación */
@keyframes popupIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.preview-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 12px;
  gap: 15px;
}

.preview-controls button {
  background: none;
  color: var(--color-text);
  border: 1px solid var(--color-text);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
}

.preview-controls button:hover {
  background: none;
}

#preview-counter {
  font-weight: bold;
}

/* Animación de entrada */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -45%) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Valores dinámicos */
.dynamic-value {
  color: var(--color-success);
  /* verde suave */
  font-weight: 600;
  text-decoration: underline dotted var(--color-accent);
  /* azul suave */
  padding: 0 2px;
  border-radius: 3px;
  background: rgba(59, 130, 246, 0.08);
  /* azul clarito de fondo */
  transition: background 0.2s ease, color 0.2s ease;
}

.dynamic-value:hover {
  background: rgba(16, 185, 129, 0.15);
  /* verde agua al hover */
  color: #0f766e;
  /* verde más oscuro */
}

#placeholders {
  position: absolute;
  top: -38px;
  right: 0px;
}

#placeholders-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

#placeholders-list li {
  background: none !important;
  color: var(--color-text);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  user-select: none;
  border: 1px solid;
}

#placeholders-list li:hover {
  transform: scale(1.05);
}

#placeholders-list li:active {
  transform: scale(0.95);
}

.btn-download {
  margin-top: 10px;
  padding: 8px 15px;
  background: var(--color-accent-dark);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  margin-bottom: 20px;
}

.btn-download:hover {
  background: var(--color-accent-dark);
}

.btn-upload-img,
.btn-upload-contacts {
  display: inline-block;
  background: none;
  color: var(--color-text);
  border: 1px solid;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  max-width: 145px;
}

.btn-upload-img:hover,
.btn-upload-contacts:hover {
  transform: scale(1.05);
  background: none;
}

.file-name {
  margin-left: 10px;
  font-size: 14px;
  color: var(--color-text);
  /* gris clarito */
  font-style: italic;
}

/* =========================================
   🎨 Estilos de Etiquetas + Slider
   ========================================= */

/* Botón flotante */
#labels-toggle {
  position: fixed;
  top: 26px;
  left: 10px;
  background: none;
  color: white;
  border: none;
  padding: 12px;
  cursor: pointer;
  z-index: 1000;
  width: auto;
  border-radius: 6px;
  display: block;
  /* visible en todos los tamaños */
  text-align: center;
  font-weight: bold;
}

#labels-toggle:hover {
  transform: scale(1.05);
}

/* Slider lateral */
.labels-slider {
  position: fixed;
  top: 0;
  left: -280px;
  /* oculto por defecto */
  width: 260px;
  height: 100%;
  background: var(--color-bg);
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
  transition: left 0.3s ease, opacity 0.3s ease;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
}

.labels-slider.open {
  left: 0;
  opacity: 1;
  pointer-events: auto;
}

/* Contenedor general del slider */
.labels-slider p {
  font-size: 0.95rem;
  color: var(--color-text);
  /* color base del texto */
  margin: 0.5rem 0;
  display: flex;
  justify-content: space-between;
  /* coloca texto y span a los extremos */
  align-items: center;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  background-color: var(--color-bg);
  /* ligero fondo para separar del slider */
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Clases para los spans dentro de los p */
.labels-slider p span {
  font-weight: 600;
  color: var(--color-accent);
  /* azul destacado */
  min-width: 40px;
  text-align: right;
}

/* Opcional: si quieres que los p cambien ligeramente al pasar el mouse */
.labels-slider p:hover {
  background: var(--color-border);
}

/* Header dentro del slider */
.labels-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: var(--color-bg);
  color: var(--color-text);
  font-weight: bold;
}

#labels-close {
  border: none;
  background: none;
  cursor: pointer;
}

/* Contenedor de la lista */
.labels-list {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--color-bg);
  /* scroll fluido en iOS */
}

/* Cada etiqueta dentro del slider */
.label-item {
  display: block;
  padding: 8px;
  margin: 5px 0;
  background: var(--color-overlay);
  color: var(--color-text);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.label-item:hover {
  background: var(--color-border);
  transform: translateX(3px);
}

/*togle para cambiar de manual a archivo*/

.toggle-switch {
  position: relative;
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle-switch input {
  display: none;
}

.slider {
  position: relative;
  width: 50px;
  height: 26px;
  background: var(--color-accent-dark);
  border-radius: 26px;
  transition: background 0.3s;
}

.slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
}

input:checked + .slider {
  background: var(--color-accent);
}

input:checked + .slider::before {
  transform: translateX(24px);
}

.label-text {
  display: flex;
  gap: 5px;
  font-size: 14px;
}

.manual-label {
  display: none;
}

input:checked ~ .label-text .file-label {
  display: none;
}

input:checked ~ .label-text .manual-label {
  display: inline;
}

/* Textarea elegante */
#manual-contacts {
  width: 100%;
  min-height: 100px;
  max-height: 180px; /* límite para que no crezca infinito */
  resize: vertical; /* permitir redimensionar solo en vertical si quiere */
  overflow-y: auto; /* scroll interno */
  border: 1px solid var(--color-muted);
  border-radius: 8px;
  padding: 10px;
  font-family: monospace;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: border 0.3s;
}

#manual-contacts:focus {
  outline: none;
  border: 1px solid var(--color-accent);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

/* Contenedor de la vista previa */
#contacts-preview-container {
  margin-top: 12px;
  background: none;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 10px;
  max-height: 200px; /* evita que ocupe toda la pantalla */
  overflow: hidden; /* no dejar que se desborde */
  margin-bottom: 12px;
}

/* Grid de contactos */
#contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 6px;
  font-size: 13px;
  color: var(--color-text);
}

/* Cada número en una "pill" */
#contacts-grid div {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  padding: 5px 8px;
  border-radius: 6px;
  color: var(--color-muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Contador extra */
#contacts-counter {
  margin-top: 8px;
  font-size: 13px;
  font-weight: bold;
  color: var(--color-muted);
  text-align: right;
}

/*TOOLKTIK FLOTANTE PARA DATOS*/
.custom-tooltip {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  display: none;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  background: var(--color-bg);
  color: var(--color-text);
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid;
  font-size: 13px;
  max-width: 320px;
  box-shadow: 0 6px 20px rgba(2, 6, 23, 0.35);
  white-space: pre-wrap;
  line-height: 1.2;
}

/* variantes por tipo */
.custom-tooltip.info {
  background: var(--color-bg);
}
.custom-tooltip.success {
  background: rgba(6, 160, 0, 0.9);
}
.custom-tooltip.error {
  background: rgba(200, 40, 40, 0.95);
}
#copy-prompt-block {
  margin-top: 10px;
  display: flex;
  gap: 10px;
}
#copy-prompt-btn,
#open-preview-btn {
  background: none;
  color: var(--color-text);
  padding: 10px 15px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  border: 1px solid;
}
#copy-prompt-btn:hover,
#open-preview-btn:hover {
  transform: scale(1.05);
}

#variations-counter {
  margin-top: 10px;
  font-weight: bold;
  color: var(--color-muted);
}

.info-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #007bff;
  margin-left: 8px;
}

.info-btn:hover {
  color: #0056b3;
}

/* === Modal Ver Usuarios === */
.modal-view-users {
  display: none; /* oculto por defecto */
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
}

.modal-content-view-users {
  background: #fff;
  width: 80%;
  max-width: 900px;
  margin: 5% auto;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-title-view-users {
  font-size: 22px;
  margin-bottom: 15px;
  text-align: center;
}

.input-user-search {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.users-container-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 15px;
  max-height: 400px;
  overflow-y: auto;
}

.btn-close-view-users {
  margin-top: 20px;
  display: block;
  width: 100%;
  padding: 12px;
  background: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
}

.btn-close-view-users:hover {
  background: #c0392b;
}

#retry-qr-btn {
  margin-top: 10px;
  background: none;
  border: 1px solid;
  border-radius: 12px;
  cursor: pointer;
}

/* 🔹 Contenedor grid dentro del modal */
.modal-view-users .users-container-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
  padding: 10px;
}

/* 🔹 Tarjeta de usuario */
.view-users-card {
  background: #1e1e1e;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 1rem;
  color: #f1f1f1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.view-users-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* 🔹 Header */
.view-users-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

/* Avatar */
.view-users-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 1.1rem;
  margin-right: 0.8rem;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

/* Info */
.view-users-info {
  flex: 1;
}

.view-users-info h3 {
  margin: 0;
  font-size: 0.65rem;
  font-weight: 600;
}

.view-users-email {
  font-size: 0.55rem;
  color: #aaa;
}

/* Rol */
.view-users-role {
  font-size: 0.8rem;
  padding: 3px 8px;
  border-radius: 8px;
  color: #111;
  font-weight: 600;
  text-transform: capitalize;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

/* 🔹 Meta info */
.view-users-meta {
  background: #141414;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.8rem;
}

.view-users-meta div {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #ddd;
}

/* 🔹 Botón eliminar */
.view-users-actions {
  text-align: right;
}

.view-users-btn-delete {
  background: #e74c3c;
  border: none;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease;
}

.view-users-btn-delete:hover {
  background: #c0392b;
}

/* 🔹 Mensaje si no hay usuarios */
.view-users-no-users-msg {
  text-align: center;
  color: #aaa;
  font-size: 1rem;
  padding: 2rem 0;
}

/*=================================*/
/*======MODAL SYSTEM STATUS========*/
/*=================================*/

/* 🔹 Modal general */
.modal-view-system-status {
  position: fixed;
  z-index: 9999;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
  justify-content: center;
  align-items: center;
}

/* 🔹 Contenedor del contenido */
.modal-content-view-system-status {
  background: #fff;
  padding: 20px 25px;
  border-radius: 12px;
  width: 90%;
  max-width: 750px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.3s ease-in-out;
}

/* Título */
.modal-title-view-system-status {
  font-size: 1.4rem;
  font-weight: bold;
  margin-bottom: 15px;
  text-align: center;
  color: #222;
}

/* 🔹 Contenedor principal */
.system-status-container {
  display: grid;
  gap: 15px;
  margin-bottom: 20px;
}

/* Tarjetas */
.status-card,
.stats-card,
.limits-card {
  background: #f9fafc;
  padding: 15px;
  border-radius: 10px;
  border: 1px solid #e3e6eb;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.status-card p,
.stats-card p,
.limits-card p {
  margin: 5px 0;
  font-size: 0.95rem;
  color: #333;
}

.status-card strong,
.stats-card strong,
.limits-card strong {
  color: #000;
}

/* Botones */
.btn-update-system-status,
.btn-close-modal {
  display: inline-block;
  padding: 10px 18px;
  margin: 5px;
  font-size: 0.95rem;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-update-system-status {
  background: #2563eb;
  color: #fff;
}

.btn-update-system-status:hover {
  background: #1d4ed8;
}

.btn-close-modal {
  background: #ef4444;
  color: #fff;
}

.btn-close-modal:hover {
  background: #dc2626;
}

/* Animación suave */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.admin-status-container {
  background: #121212;
  padding: 1.2rem;
  border-radius: 10px;
  color: #eee;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.4);
  margin-top: 1rem;
}

.admin-status-title {
  font-size: 1rem;
  font-weight: 600;
  color: #00ffa2;
  margin-bottom: 0.8rem;
}

/* --- Tarjetas resumen --- */
.admin-summary {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}
.admin-card {
  flex: 1;
  background: #1e1e1e;
  border-radius: 8px;
  padding: 0.8rem;
  text-align: center;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}
.admin-card h5 {
  font-size: 0.8rem;
  color: #aaa;
  margin-bottom: 0.4rem;
}
.admin-card .highlight {
  font-size: 1.4rem;
  color: #00ff99;
  font-weight: 700;
}

/* --- Usuarios conectados --- */
.admin-section h5 {
  font-size: 0.9rem;
  color: #00ffaa;
  margin: 0.8rem 0 0.5rem;
}
.admin-users-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.user-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  border-bottom: 1px solid #222;
  padding: 4px 0;
}
.user-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.user-dot.online {
  background: #00ff88;
}

/* --- Tabla procesos --- */
.admin-table-wrapper {
  overflow-x: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.admin-table th,
.admin-table td {
  border-bottom: 1px solid #333;
  padding: 6px 8px;
  text-align: left;
}
.admin-table th {
  color: #0fffcf;
  text-transform: uppercase;
  font-size: 0.7rem;
}
.progress-bar {
  background: #333;
  height: 6px;
  border-radius: 4px;
  overflow: hidden;
  display: inline-block;
  width: 60px;
  margin-right: 4px;
}
.progress {
  background: linear-gradient(90deg, #00ff88, #00ffaa);
  height: 100%;
}
.status-badge {
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 600;
  text-transform: capitalize;
  font-size: 0.7rem;
}
.status-badge.running {
  background: #007bff;
  color: #fff;
}
.status-badge.done {
  background: #00c853;
  color: #fff;
}
.status-badge.error {
  background: #e74c3c;
  color: #fff;
}

/* --- Mensajes vacíos --- */
.no-users,
.no-process {
  font-size: 0.85rem;
  color: #999;
  margin-top: 0.5rem;
}

/* Fondo semitransparente con desenfoque */
.upgrade-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 9998;
  animation: fadeIn 0.3s ease;
}

/* Contenedor principal del popup */
.upgrade-popup-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: linear-gradient(145deg, #1b1b1b, #232323);
  color: #fff;
  border-radius: 18px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.4);
  z-index: 9999;
  padding: 2rem 2.2rem;
  width: 90%;
  max-width: 400px;
  text-align: center;
  opacity: 0;
  animation: popupShow 0.3s ease forwards;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Título con efecto brillante */
.upgrade-popup-content h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  color: #facc15;
  text-shadow: 0 0 8px rgba(250, 204, 21, 0.4);
}

/* Texto principal */
.upgrade-popup-content p {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  color: #e5e5e5;
}

/* Botones */
.upgrade-popup-actions {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.upgrade-popup-actions button {
  font-size: 0.95rem;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  font-weight: 600;
}

/* Botón principal (comprar créditos) */
#btn-buy-credits {
  background: linear-gradient(90deg, #22c55e, #16a34a);
  color: white;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

#btn-buy-credits:hover {
  background: linear-gradient(90deg, #16a34a, #15803d);
  transform: translateY(-1px);
}

/* Botón cerrar */
#btn-close-upgrade {
  background: rgba(255, 255, 255, 0.1);
  color: #ddd;
}

#btn-close-upgrade:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Animaciones */
@keyframes popupShow {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Adaptativo móvil */
@media (max-width: 480px) {
  .upgrade-popup-content {
    padding: 1.6rem;
  }

  .upgrade-popup-content h3 {
    font-size: 1.2rem;
  }

  .upgrade-popup-actions button {
    font-size: 0.9rem;
  }
}

