/* ------------------------------------------- */
/* ESTILOS UNIFICADOS PARA INPUTS CON ICONOS */
/* ------------------------------------------- */

/* Contenedor para posicionar el icono */
.input-icon-group {
    position: relative;
    width: 100%;
}

/* Estilo y posición del icono */
.input-icon-group .icon {
    position: absolute;
    top: 50%;
    left: 8px; /* Posición horizontal del icono */
    transform: translateY(-50%);
    color: #999; 
    font-size: 16px; 
    pointer-events: none; 
    z-index: 10;
}

/* Ajuste CLAVE: Empujar el texto de entrada hacia la derecha */
.input-icon-group .form-control {
    padding-left: 35px !important; 
}

:root {
  --app-vh: 1vh;
}

*, *::before, *::after {
  box-sizing: border-box;
}

/* Evita desbordes de textos largos (URLs, tokens, errores API) en toda la app. */
body,
.content-container,
.card,
.login-container .card,
.legal-container .card,
.landing-card,
.swal2-html-container,
p,
li,
td,
th,
span,
a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Espacio entre el icono y el texto del botón (para todos los botones primarios) */
.btn-primary .fas {
    margin-right: 8px; 
}

/* Estilo para el contenedor de SweetAlert2 */
.swal2-container {
  z-index: 2000; /* Un valor alto */
}

.swal2-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.4); /* Opacidad para el fondo */
  display: flex;
  align-items: center;
  justify-content: center;
}

.swal2-popup,
.swal2-title,
.swal2-html-container {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Estilo para el hover de las filas de la tabla en modo oscuro */
body.dark-theme tbody tr:hover {
  background-color: #9585e7;  /* Un color más oscuro y sutil para el hover */
  color: #ddd; /* Para asegurar que el texto siga siendo legible */
}

/* Estilos para el encabezado de la tabla en tema oscuro */
body.dark-theme th {
  background-color: #343641;  /* Un gris más oscuro para el fondo */
  color: #ddd;                /* Texto gris claro para mejor contraste */
  border-color: #555;         /* Borde un poco más oscuro */
}

body.dark-theme td {
border-color: #555;
}

.table-responsive {
  overflow-x: auto; /* Permite el desplazamiento horizontal si la tabla es demasiado ancha */
}

.table-responsive table {
  min-width: 100%; /* Asegura que la tabla ocupe al menos el 100% del ancho del contenedor */
  white-space: nowrap; /* Evita el ajuste de línea en las celdas */
}

th, td {
  padding: 12px 15px;
  text-align: left;
  border: 1px solid #ddd; /* Añade un borde a las celdas */
}

/* Color morado para SCAN en el logo */
.scan-purple {
  color: #441681;
  font-weight: bold;
}

.subtitle-gray {
  color: #888888;
  font-weight: 500;
}

th {
  background-color: #f0f0f0;
  font-weight: bold;
}

/* Estilos para el panel de administrador */
.content-container h1 {
  margin-bottom: 20px;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

/* Estilos para la tabla de números */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f0f0f0;
    font-weight: bold;
}

tbody tr:hover {
    background-color: #f5f5f5;
}

/* Estilo para el token */
.token {
    word-break: break-all; /* Divide las palabras en cualquier carácter si es necesario */
    white-space: normal;  /* Permite el ajuste de línea dentro del elemento */
    max-width: 200px;  /* Define el ancho máximo para el token,ajustalo a tu gusto */
}

.separator {
  border-bottom: 1px solid #ddd; /* Ajusta el color y grosor según necesites */
  margin: 10px 0; /* Ajusta el espacio arriba y abajo según necesites */
}

body.dark-theme .separator {
  border-bottom: 1px solid #fff; /* Ajusta el color para el tema oscuro */
}
/* Bottom Section */
.bottom-section{
margin-top: auto;
}

.bottom-section .logout{
display: flex;
align-items: center;
color: #333;
text-decoration: none;
padding: 10px 15px;
border-radius: 8px;
transition: background-color 0.3s ease, color 0.3s ease;
cursor: pointer;
}

.email-wrap {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Estilo para las URLs, ahora imitando a los inputs */
.url-wrap {
    display: flex; /* Nuevo: Permite alinear el icono y el texto */
    align-items: flex-start; /* Alinea los ítems al inicio (arriba) */
    
    /* Propiedades copiadas de los inputs para consistencia */
    width: 100%;
    padding: 8px;
    padding-left: 10px; /* Padding izquierdo reducido, ya que el icono no es "flotante" */
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box; 
    background-color: #fff;
    color: #1a1a2e;            
    
    /* Propiedades específicas para la URL */
    font-family: monospace;
    font-size: 0.9em;
    word-break: break-all;
    margin: 0;
    font-weight: normal; 
}

/* Estilo para el icono dentro del URL wrap */
.url-wrap .url-icon {
    color: #7c5dfa; /* O #999, si quieres que sea gris como los inputs */
    font-size: 1em;
    margin-right: 8px; /* Espacio entre el icono y la URL */
    min-width: 1em; /* Asegura que el icono tenga un espacio mínimo si la URL es muy larga */
}

/* El texto que envuelve la URL debe ocupar el espacio restante */
.url-wrap span {
    flex-grow: 1;
    word-break: break-all;
}

.webhook-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin: 10px 0 16px;
}

.webhook-meta-item {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
}

.webhook-meta-item strong {
  display: block;
  margin-bottom: 6px;
}

.webhook-meta-value {
  display: block;
  font-family: monospace;
  word-break: break-all;
  color: #1a1a2e;
}

.webhook-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

body.dark-theme .webhook-meta-item {
  border-color: #343641;
  background: #1f2545;
}

body.dark-theme .webhook-meta-value {
  color: #ddd;
}

.webhook-compact-wrap {
  margin-top: 6px;
}

.webhook-compact-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.webhook-compact-table th,
.webhook-compact-table td {
  border: 1px solid #ddd;
  padding: 12px;
  vertical-align: middle;
}

.webhook-compact-table th {
  background-color: #f0f0f0;
  font-weight: 700;
}

.webhook-compact-table .form-control {
  margin-bottom: 0;
}

.webhook-current-status {
  font-weight: 700;
}

.webhook-params-wrap {
  min-width: 260px;
}

.btn-webhook-save {
  white-space: nowrap;
}

.webhook-feedback {
  display: inline-block;
  font-weight: 600;
}

.webhook-feedback.is-idle {
  color: #6c757d;
}

.webhook-feedback.is-working {
  color: #0b5ed7;
}

.webhook-feedback.is-success {
  color: #198754;
}

.webhook-feedback.is-error {
  color: #dc3545;
}

.btn-calendar-manage {
  background: #6d5afc;
  border: 1px solid #6d5afc;
  color: #fff;
}

.btn-calendar-manage:hover {
  background: #5b4cea;
  border-color: #5b4cea;
}

.btn-calendar-disconnect {
  background: #e74c3c;
  border: 1px solid #e74c3c;
  color: #fff;
  font-weight: 700;
}

.btn-calendar-disconnect:hover {
  background: #c0392b;
  border-color: #c0392b;
  color: #fff;
}

.btn-calendar-disconnect i {
  color: inherit;
}

body.dark-theme .webhook-compact-table th,
body.dark-theme .webhook-compact-table td {
  border-color: #343641;
}

body.dark-theme .webhook-compact-table th {
  background-color: #343641;
  color: #ddd;
}

@media (max-width: 900px) {
  .webhook-compact-table,
  .webhook-compact-table thead,
  .webhook-compact-table tbody,
  .webhook-compact-table tr,
  .webhook-compact-table th,
  .webhook-compact-table td {
    display: block;
    width: 100%;
  }

  .webhook-compact-table thead {
    display: none;
  }

  .webhook-compact-table tr {
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
  }

  .webhook-compact-table td {
    border: 0;
    border-bottom: 1px solid #ddd;
  }

  .webhook-compact-table td:last-child {
    border-bottom: 0;
  }

  body.dark-theme .webhook-compact-table tr {
    border-color: #343641;
  }

  body.dark-theme .webhook-compact-table td {
    border-bottom-color: #343641;
  }
}

.webhook-mini-guide {
  margin-top: 12px;
  border: 1px dashed #bfc6d1;
  border-radius: 8px;
  padding: 12px;
  background: #fafbff;
}

.webhook-mini-guide h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.webhook-mini-guide p {
  margin: 0 0 8px;
}

.webhook-mini-guide ul {
  margin: 0 0 10px 18px;
  padding: 0;
}

.webhook-mini-guide-code {
  font-family: monospace;
  white-space: pre-line;
  border: 1px solid #d9dde6;
  border-radius: 6px;
  background: #fff;
  padding: 10px;
  margin-bottom: 8px;
}

.webhook-mini-guide-tip {
  font-size: 0.92rem;
  color: #4b5563;
}

body.dark-theme .webhook-mini-guide {
  border-color: #4a5163;
  background: #1f2545;
}

body.dark-theme .webhook-mini-guide-code {
  border-color: #4a5163;
  background: #11162f;
  color: #ddd;
}

body.dark-theme .webhook-mini-guide-tip {
  color: #c8cfdd;
}

body.dark-theme .btn-calendar-manage {
  background: #6d5afc;
  border-color: #6d5afc;
  color: #fff;
}

body.dark-theme .btn-calendar-disconnect {
  background: #e74c3c;
  border-color: #e74c3c;
  color: #fff;
}

body.dark-theme .btn-calendar-disconnect:hover {
  background: #c0392b;
  border-color: #c0392b;
  color: #fff;
}

.alert {
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 5px;
}

.alert-danger {
  background: #E74C3C;
  color: white;
}

.alert-success {
  background: #2ECC71;
  color: white;
}

.token {
  word-wrap: break-word; /* Para navegadores modernos */
  overflow-wrap: break-word; /* Similar a word-wrap, mejor compatibilidad */
}

/* Evita overflow de tokens largos en Mis Telefonos */
.phone-card .card-body {
  overflow: hidden;
}

.phone-card .card-text {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.phone-card .token-value {
  display: -webkit-box;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  -webkit-line-clamp: 2;
}

.phone-card .mt-3 {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.phone-card .mt-3 .btn {
  margin-right: 0 !important;
}

/* Importar la fuente Quicksand */
@font-face {
  font-family: 'Quicksand';
  src: url('../fonts/Quicksand-Bold.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

body.dark-theme .card {
  background-color: #1a1a2e;
  color: #ddd;
}

/* Estilos para la página Dashboard en tema oscuro */
body.dark-theme .content-container {
  background-color: #1f2545; /* Fondo azul oscuro */
  color: #ddd; /* Texto gris claro */
}

/* Estilos para la imagen del logo en el sidebar */
aside.sidebar header .logo img {
  max-width: 50px; /* Ancho máximo */
  height: auto; /* Ajuste automático de la altura para mantener la proporción */
  border-radius: 0; /* Mostrar solo la imagen sin redondear bordes */
}

/* Estilos para el contenedor del logo en el login */
.login-container .logo-container {
  text-align: center; /* Centrar el logo horizontalmente */
  margin-bottom: 20px; /* Agregar un espacio debajo del logo */
}

.login-container .logo-container a {
  display: inline-block;
  text-decoration: none;
  color: inherit;
}

/* Estilos para la imagen del logo en el login */
.login-container .logo-container img {
  max-width: 200px; /* Ancho máximo del logo */
  height: auto; /* Mantener la proporción original */
}

.content-container-dev {
  padding: 20px;
  width: 95%;
  margin: 10px auto;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.content-container label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  text-align: left; /* Alinea el texto a la izquierda, o al valor deseado */
}

.content-container .form-control {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  box-sizing: border-box; /* Para que el padding no aumente el ancho */
  font-size: 16px; /* Ajusta el tamaño de la fuente */
  margin-bottom: 5px; /* Reduce el espacio inferior */
}

/* Estilos para el contenedor del login */

.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1 0 auto;
  min-height: calc(var(--app-vh, 1vh) * 100); /* Altura real en móvil */
  background-color: #f4f6f8; /* Un color de fondo suave */
  background-image:
    radial-gradient(420px 420px at -90px calc(100% - 20px), transparent 57%, rgba(124, 93, 250, 0.10) 58%, rgba(124, 93, 250, 0.10) 70%, transparent 71%),
    radial-gradient(420px 420px at calc(100% + 90px) 20px, transparent 57%, rgba(124, 93, 250, 0.10) 58%, rgba(124, 93, 250, 0.10) 70%, transparent 71%);
  background-repeat: no-repeat;
  background-attachment: scroll;
  width: 100%; /* Establece el ancho al 100% */
  padding: 20px 12px calc(24px + env(safe-area-inset-bottom));
  box-sizing: border-box;
}

.legal-container {
  display: block;
  flex: 1 0 auto;
  width: 100%;
  min-height: calc(var(--app-vh, 1vh) * 100);
  background-color: #f4f6f8;
  background-image:
    radial-gradient(420px 420px at -90px calc(100% - 20px), transparent 57%, rgba(124, 93, 250, 0.10) 58%, rgba(124, 93, 250, 0.10) 70%, transparent 71%),
    radial-gradient(420px 420px at calc(100% + 90px) 20px, transparent 57%, rgba(124, 93, 250, 0.10) 58%, rgba(124, 93, 250, 0.10) 70%, transparent 71%);
  background-repeat: no-repeat;
  background-attachment: scroll;
  padding: 20px 12px calc(24px + env(safe-area-inset-bottom));
  box-sizing: border-box;
}

.legal-container .card {
  width: 100%;
  max-width: 900px;
  text-align: left;
  padding: 20px;
  margin: 0 auto 16px;
  border-radius: 8px;
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.legal-container .register-link {
  margin-top: 24px;
  margin-bottom: 6px;
}

.legal-container .logo-container {
  text-align: center;
  margin-bottom: 20px;
}

.legal-container .logo-container a {
  display: inline-block;
  text-decoration: none;
  color: inherit;
}

.legal-container .logo-container img {
  width: 200px;
  height: 191px;
  border-radius: 10px;
}

/* Estilos para la tarjeta del login */
.login-container .card {
  width: 100%;
  max-width: 400px; /* Ancho de la tarjeta */
  padding: 20px;
  border-radius: 10px; /* Bordes redondeados */
  background-color: #fff; /* Fondo blanco para la tarjeta */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Sombra suave */
}

.login-container .description {
  text-align: center;
  margin: 8px 0 14px;
  color: #4b5563;
  font-size: 0.73rem;
  line-height: 1.4;
}

/* Estilos para los elementos del formulario */
.login-container .form-group {
  margin-bottom: 15px;
}

.login-container label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.login-container .form-control {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  box-sizing: border-box; /* Para que el padding no aumente el ancho */
}

/* Estilos para el botón */

button {
  font-family: 'Quicksand', sans-serif;
  padding: 10px 20px;
  margin-top: 10px;
  padding: 8px;
  background: #7c5dfa; /* Morado */
  border: none;
  color: white;
  border-radius: 5px;
  cursor: pointer;
}

.login-container .btn-primary {
  background-color: #7c5dfa;
  border-color: #7c5dfa;
  color: white;
  padding: 10px 15px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  width: 100%; /* Para que el botón ocupe todo el ancho */
}

.login-container .btn-primary:hover {
  background-color: #9585e7;
  border-color: #9585e7;
}

.btn-google {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 4px 0 10px;
  padding: 11px 14px;
  border: 1px solid #d5d9e2;
  border-radius: 8px;
  background: #ffffff;
  color: #1f2937;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-google:hover {
  background: #f8f9fb;
  border-color: #c6ccda;
}

.btn-google:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(124, 93, 250, 0.22);
}

.btn-google-inline {
  width: auto;
}

.google-calendar-actions {
  align-items: center;
}

.google-calendar-actions .btn,
.google-calendar-actions .btn-google-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 0;
  line-height: 1;
}

.google-calendar-actions .btn-google-inline {
  padding-top: 10px;
  padding-bottom: 10px;
}

.google-calendar-status-message {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: #7a7f8c;
  font-size: 0.95rem;
  margin: 8px 0 16px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e2e6ef;
}

.auth-divider span {
  padding: 0 10px;
}

/* Estilos para el enlace de registro */
.login-container .register-link {
  margin-top: 15px;
  text-align: center;
}

.login-container .register-link.legal-links {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e6e6e6;
  font-size: 0.95rem;
}

/* Landing publica para homepage de verificacion OAuth */
.landing-page {
  min-height: calc(var(--app-vh, 1vh) * 100);
  padding: 24px 20px 18px;
  background-color: #f5f7fb;
  background-image:
    radial-gradient(300px 300px at -70px calc(100% - 20px), transparent 57%, rgba(124, 93, 250, 0.10) 58%, rgba(124, 93, 250, 0.10) 70%, transparent 71%),
    radial-gradient(300px 300px at calc(100% + 70px) 20px, transparent 57%, rgba(124, 93, 250, 0.10) 58%, rgba(124, 93, 250, 0.10) 70%, transparent 71%);
  display: flex;
  flex-direction: column;
}

.landing-header,
.landing-main,
.landing-footer {
  width: 100%;
  max-width: 1050px;
  margin: 0 auto;
}

.landing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.landing-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.landing-brand img {
  width: min(210px, 58vw);
  height: auto;
  display: block;
}

.landing-brand {
  text-decoration: none;
}

.landing-brand-tagline {
  margin: 8px 0 0;
  color: #888888;
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.25;
  text-align: center;
}

.login-container .logo-container .subtitle-gray,
.legal-container .logo-container .subtitle-gray,
.landing-brand-tagline {
  font-size: 1rem;
  line-height: 1.25;
}

.landing-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid #d9def0;
  background: #ffffff;
  color: #1f2937;
  text-decoration: none;
  font-weight: 700;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.landing-link-btn:hover,
.landing-link-btn:focus-visible,
.landing-link-btn:active,
.landing-link-btn.is-active {
  background: #7c5dfa;
  border-color: #7c5dfa;
  color: #ffffff;
}

.landing-link-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(124, 93, 250, 0.22);
}

.landing-link-btn-header {
  min-width: 150px;
  min-height: 46px;
  line-height: 1;
  white-space: nowrap;
}

.landing-header .landing-theme-toggle {
  margin-top: 0;
  padding: 0 8px;
  min-height: 46px;
  height: 46px;
  border: 1px solid #d9def0;
  border-radius: 8px;
  background: #ffffff;
}

.landing-header .landing-theme-toggle i {
  color: #1f2937;
}

.landing-main {
  flex: 1;
}

.landing-hero {
  background: #ffffff;
  border: 1px solid #e8eaf1;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(26, 32, 61, 0.07);
  padding: 26px;
  margin-bottom: 18px;
}

.landing-badge {
  display: inline-block;
  font-size: 0.83rem;
  font-weight: 700;
  color: #000000;
  opacity: 1;
  background: #efebff;
  border-radius: 999px;
  padding: 7px 12px;
  margin: 0 0 14px;
}

.landing-badge i {
  margin-right: 6px;
  font-size: 0.82rem;
}

.landing-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  color: #1b1d2e;
  line-height: 1.25;
}

.landing-hero > p:not(.landing-badge) {
  margin: 0;
  color: #4b5563;
  max-width: 100%;
  line-height: 1.5;
}

.landing-hero-actions {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 540px);
  justify-content: center;
  gap: 12px;
}

.landing-link-btn-hero {
  width: 100%;
}

.landing-flow {
  position: relative;
  background: #ffffff;
  border: 1px solid #e8eaf1;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(26, 32, 61, 0.06);
  padding: 20px 20px 18px;
  margin: 0 0 18px;
}

.landing-flow h2 {
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1b1d2e;
  font-size: clamp(1.08rem, 2vw, 1.3rem);
}

.landing-flow h2 i {
  color: #7c5dfa;
}

.landing-flow-track {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 74px;
  border-top: 1px solid #d5ddf1;
}

.landing-flow-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.landing-flow-step {
  text-align: center;
  opacity: 0;
  transform: translateY(14px);
  animation: landingFlowStepIn 760ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.landing-flow-step:nth-child(1) { animation-delay: 120ms; }
.landing-flow-step:nth-child(2) { animation-delay: 260ms; }
.landing-flow-step:nth-child(3) { animation-delay: 400ms; }
.landing-flow-step:nth-child(4) { animation-delay: 540ms; }

.landing-flow-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 10px;
  border-radius: 14px;
  border: 1px solid #d4dcf0;
  background: #f2f5ff;
  display: grid;
  place-items: center;
  color: #4f35ad;
  font-size: 1.1rem;
  opacity: 0;
  transform: scale(0.92);
  animation: landingFlowIconPop 700ms cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.landing-flow-step:nth-child(1) .landing-flow-icon { animation-delay: 240ms; }
.landing-flow-step:nth-child(2) .landing-flow-icon { animation-delay: 380ms; }
.landing-flow-step:nth-child(3) .landing-flow-icon { animation-delay: 520ms; }
.landing-flow-step:nth-child(4) .landing-flow-icon { animation-delay: 660ms; }

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

@keyframes landingFlowIconPop {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }
  65% {
    opacity: 1;
    transform: scale(1.04);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-flow-step,
  .landing-flow-icon {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

.landing-flow-kicker {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.75rem;
  font-weight: 800;
  color: #3f4a66;
}

.landing-flow-step h3 {
  margin: 0 0 8px;
  color: #1f2937;
  font-size: 1.02rem;
}

.landing-flow-step p {
  margin: 0;
  color: #4b5563;
  line-height: 1.42;
  font-size: 0.95rem;
}

.landing-purpose {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.landing-card {
  background: #fff;
  border: 1px solid #e8eaf1;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 8px 20px rgba(26, 32, 61, 0.06);
}

.landing-card h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #dbe3f3;
  color: #1b1d2e;
  font-size: 1.08rem;
}

.landing-card h2 i {
  color: #7c5dfa;
  font-size: 0.92rem;
}

.landing-card p,
.landing-card li {
  color: #4b5563;
  line-height: 1.45;
}

.landing-card ul {
  margin: 0;
  padding-left: 18px;
}

.landing-footer {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid #e0e5f2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  font-size: 0.92rem;
}

.landing-footer a {
  color: #3c2f89;
  text-decoration: none;
  font-weight: 700;
}

.landing-footer span {
  color: #9aa0af;
}

body.dark-theme .landing-page {
  background-color: #1a1a2e;
  background-image:
    radial-gradient(300px 300px at -70px calc(100% - 20px), transparent 57%, rgba(124, 93, 250, 0.16) 58%, rgba(124, 93, 250, 0.16) 70%, transparent 71%),
    radial-gradient(300px 300px at calc(100% + 70px) 20px, transparent 57%, rgba(124, 93, 250, 0.16) 58%, rgba(124, 93, 250, 0.16) 70%, transparent 71%);
}

body.dark-theme .landing-hero,
body.dark-theme .landing-flow,
body.dark-theme .landing-card,
body.dark-theme .landing-theme-toggle {
  background: #1f2545;
  border-color: #434a68;
}

body.dark-theme .landing-hero h1,
body.dark-theme .landing-flow h2,
body.dark-theme .landing-flow-step h3,
body.dark-theme .landing-card h2 {
  color: #f2f4ff;
}

body.dark-theme .landing-flow-track {
  border-top-color: #48527a;
}

body.dark-theme .landing-flow-icon {
  border-color: #4e5882;
  background: #2a3159;
  color: #b8a9ff;
}

body.dark-theme .landing-flow-kicker {
  color: #aeb9df;
}

body.dark-theme .landing-flow-step p {
  color: #c8cde5;
}

body.dark-theme .landing-card h2 {
  border-bottom-color: #3d4567;
}

body.dark-theme .landing-card h2 i {
  color: #9f8bff;
}

body.dark-theme .landing-hero > p:not(.landing-badge),
body.dark-theme .landing-card p,
body.dark-theme .landing-card li {
  color: #c8cde5;
}

body.dark-theme .landing-link-btn {
  background: #1f2545;
  border-color: #56608c;
  color: #f2f4ff;
}

body.dark-theme .landing-badge {
  color: #000000;
  background: #eef0ff;
}

body.dark-theme .landing-link-btn:hover,
body.dark-theme .landing-link-btn:focus-visible,
body.dark-theme .landing-link-btn:active,
body.dark-theme .landing-link-btn.is-active {
  background: #7c5dfa;
  border-color: #7c5dfa;
  color: #ffffff;
}

body.dark-theme .landing-theme-toggle i,
body.dark-theme .landing-footer a {
  color: #f2f4ff;
}

body.dark-theme .landing-brand-tagline {
  color: #aeb6d2;
}

body.dark-theme .landing-footer {
  border-top-color: #3d4567;
}

body.dark-theme .landing-footer span {
  color: #aeb6d2;
}

body.dark-theme .login-container,
body.dark-theme .legal-container {
  background-color: #161a35;
  background-image:
    radial-gradient(420px 420px at -90px calc(100% - 20px), transparent 57%, rgba(124, 93, 250, 0.16) 58%, rgba(124, 93, 250, 0.16) 70%, transparent 71%),
    radial-gradient(420px 420px at calc(100% + 90px) 20px, transparent 57%, rgba(124, 93, 250, 0.16) 58%, rgba(124, 93, 250, 0.16) 70%, transparent 71%);
}

body.dark-theme .login-container .description,
body.dark-theme .login-container label,
body.dark-theme .legal-container .register-link a {
  color: #e7ebff;
}

body.dark-theme .auth-divider {
  color: #c6cee9;
}

body.dark-theme .auth-divider::before,
body.dark-theme .auth-divider::after {
  border-bottom-color: #4b547b;
}

@media (max-width: 1024px) {
  .landing-header-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: min(220px, 100%);
  }

  .landing-header .landing-theme-toggle,
  .landing-link-btn-header {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .content-area {
    background-image:
      radial-gradient(300px 300px at -70px calc(100% - 20px), transparent 57%, rgba(124, 93, 250, 0.10) 58%, rgba(124, 93, 250, 0.10) 70%, transparent 71%),
      radial-gradient(300px 300px at calc(100% + 70px) 20px, transparent 57%, rgba(124, 93, 250, 0.10) 58%, rgba(124, 93, 250, 0.10) 70%, transparent 71%);
    background-attachment: scroll;
  }

  #content-placeholder {
    padding: 12px 12px 12px;
  }

  #content-placeholder > .content-container {
    margin: 0 auto 12px;
  }

  .login-container {
    padding: 16px 12px calc(20px + env(safe-area-inset-bottom));
    align-items: flex-start;
    background-image:
      radial-gradient(300px 300px at -70px calc(100% - 20px), transparent 57%, rgba(124, 93, 250, 0.10) 58%, rgba(124, 93, 250, 0.10) 70%, transparent 71%),
      radial-gradient(300px 300px at calc(100% + 70px) 20px, transparent 57%, rgba(124, 93, 250, 0.10) 58%, rgba(124, 93, 250, 0.10) 70%, transparent 71%);
    background-attachment: scroll;
  }

  .login-container .card {
    width: 100%;
    max-width: 420px;
    margin: 0 auto 12px;
  }

  .legal-container {
    padding: 12px 12px calc(20px + env(safe-area-inset-bottom));
    background-image:
      radial-gradient(300px 300px at -70px calc(100% - 20px), transparent 57%, rgba(124, 93, 250, 0.10) 58%, rgba(124, 93, 250, 0.10) 70%, transparent 71%),
      radial-gradient(300px 300px at calc(100% + 70px) 20px, transparent 57%, rgba(124, 93, 250, 0.10) 58%, rgba(124, 93, 250, 0.10) 70%, transparent 71%);
    background-attachment: scroll;
  }

  .legal-container .card {
    width: 100%;
    padding: 16px;
    margin: 0 auto 12px;
  }

  .legal-container .logo-container img {
    width: min(200px, 72vw);
    height: auto;
  }

  .login-container .register-link.legal-links {
    font-size: 0.9rem;
  }

  .landing-page {
    padding: 14px 12px 14px;
  }

  .landing-header {
    margin-bottom: 12px;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
  }

  .landing-brand {
    min-width: 0;
    flex: 1 1 auto;
  }

  .landing-brand img {
    width: min(170px, 44vw);
    max-width: 100%;
  }

.landing-header-actions {
  width: clamp(160px, 38vw, 188px);
  max-width: 188px;
}

  .landing-hero {
    padding: 16px;
    margin-bottom: 12px;
  }

  .landing-purpose {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .landing-flow {
    padding: 16px;
    margin-bottom: 12px;
  }

  .landing-flow h2 {
    margin-bottom: 12px;
  }

  .landing-flow-track {
    display: none;
  }

  .landing-flow-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .landing-flow-step {
    text-align: left;
    padding: 12px;
    border: 1px solid #dbe3f3;
    border-radius: 10px;
    background: #f9faff;
  }

  .landing-flow-icon {
    margin: 0 0 8px;
  }

  body.dark-theme .landing-flow-step {
    border-color: #454f76;
    background: #232b4f;
  }

  .landing-link-btn-hero {
    width: 100%;
  }

  .landing-header-actions .landing-link-btn-header,
  .landing-header .landing-theme-toggle {
    width: 100%;
    min-height: 44px;
    height: 44px;
    padding: 0 10px;
    border-radius: 10px;
    box-sizing: border-box;
  }

  .landing-link-btn-header {
    justify-content: center;
  }

  .landing-hero-actions {
    grid-template-columns: 1fr;
  }

  .landing-header .landing-theme-toggle {
    flex-shrink: 0;
    justify-content: center;
    gap: 8px;
    font-size: 1rem;
    margin-top: 0;
  }

  .landing-header .landing-theme-toggle .switch {
    width: 30px;
    min-width: 30px;
    height: 18px;
    --switch-travel: 12px;
  }

  .landing-card {
    padding: 15px;
  }

  .landing-footer {
    gap: 6px;
    font-size: 0.88rem;
  }
}

/* ------------------------------------------- */
/* ESTILOS DE AUTOMATIZACIÓN POR UID          */
/* ------------------------------------------- */

.automation-card {
  overflow: hidden;
}

.automation-table .form-control {
  min-width: 180px;
}

.automation-table {
  min-width: 720px;
}

.automation-table .automation-mode {
  min-width: 112px;
  width: 112px;
}

.automation-table .automation-assistant {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.automation-provider-keys-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  min-width: 0;
}

.automation-feedback {
  font-size: 0.9rem;
  font-weight: 600;
}

.automation-feedback.loading {
  color: #6c757d;
}

.automation-feedback.success {
  color: #2e7d32;
}

.automation-feedback.warning {
  color: #b26a00;
}

.automation-feedback.error {
  color: #c62828;
}

.automation-ai-panel {
  margin-top: 16px;
  border-top: 1px solid #ddd;
  padding-top: 14px;
}

.automation-ai-panel h3 {
  margin-bottom: 12px;
  font-size: 1.05rem;
}

.automation-ai-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.automation-ai-item {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px;
  background-color: #fafafa;
}

.automation-ai-item label {
  font-size: 0.82rem;
  color: #666;
  margin-bottom: 4px;
  display: block;
}

.automation-ai-item div {
  font-weight: 600;
  word-break: break-word;
}

.automation-ai-item-full {
  grid-column: 1 / -1;
}

.automation-secret-toggle {
  cursor: pointer;
}

.automation-temp-editor {
  display: flex;
  gap: 8px;
  align-items: center;
}

.automation-temp-editor .form-control {
  max-width: 140px;
  margin-bottom: 0;
}

.automation-temp-editor .btn {
  margin-top: 0;
  white-space: nowrap;
}

#ai-panel-max-tokens,
#ai-panel-prompt,
#ai-panel-temperature {
  margin-bottom: 0;
}

#ai-panel-save-settings {
  margin-top: 0;
}

.automation-ai-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.automation-bot-tester {
  background: linear-gradient(180deg, #f7f9ff 0%, #f1f4ff 100%);
}

.automation-bot-tester-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.automation-bot-tester-head h4 {
  margin: 0;
  font-size: 1rem;
}

.automation-bot-tester-head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

#bot-test-conversation-select {
  min-width: 250px;
  margin-bottom: 0;
}

.automation-bot-tester-meta {
  font-size: 0.8rem;
  color: #637094;
  margin-bottom: 8px;
  font-weight: 600;
}

.automation-bot-tester-messages {
  height: 360px;
  overflow-y: auto;
  border: 1px solid #ced6ea;
  border-radius: 12px;
  padding: 12px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.automation-bot-placeholder {
  margin: auto;
  text-align: center;
  color: #7a86a5;
  max-width: 460px;
}

.automation-bot-msg {
  max-width: min(78%, 620px);
  border-radius: 12px;
  padding: 8px 10px;
  line-height: 1.4;
  word-wrap: break-word;
  white-space: pre-wrap;
  font-size: 0.92rem;
}

.automation-bot-msg.user {
  align-self: flex-end;
  background: #2e3560;
  color: #f8f9ff;
}

.automation-bot-msg.assistant {
  align-self: flex-start;
  background: #eceffd;
  color: #1b2443;
}

.automation-bot-msg-meta {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  opacity: 0.72;
}

.automation-bot-attachment-preview {
  margin-top: 8px;
  border: 1px dashed #aeb8d6;
  border-radius: 10px;
  padding: 8px;
  background: #f8f9ff;
  color: #2c355a;
  font-size: 0.84rem;
}

.automation-bot-tester-composer {
  margin-top: 8px;
  display: grid;
  grid-template-columns: auto auto auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

#bot-test-input {
  margin-bottom: 0;
}

.automation-bot-emoji-panel {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

body.dark-theme .automation-feedback.loading {
  color: #bbb;
}

body.dark-theme .automation-feedback.success {
  color: #66bb6a;
}

body.dark-theme .automation-feedback.warning {
  color: #ffca6f;
}

body.dark-theme .automation-feedback.error {
  color: #ef5350;
}

body.dark-theme .automation-ai-panel {
  border-top-color: #444;
}

body.dark-theme .automation-ai-item {
  background-color: #161a32;
  border-color: #434a68;
}

body.dark-theme .automation-ai-item label {
  color: #9fa8c7;
}

.swal2-popup.bot-tester-modal-popup {
  background: #f4f6f8;
  border: 1px solid #dddddd;
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.16);
}

.swal2-title.bot-tester-modal-title {
  color: #333;
}

.swal2-html-container.bot-tester-modal-html {
  margin: 0.5rem 0 0;
}

.swal2-popup.bot-tester-modal-popup .swal2-close {
  color: #666;
}

.swal2-popup.bot-tester-modal-popup .swal2-close:hover {
  color: #333;
  background: rgba(0, 0, 0, 0.08);
}

body.dark-theme .swal2-popup.bot-tester-modal-popup {
  background: linear-gradient(180deg, #1a1f42 0%, #141a37 100%);
  border: 1px solid #545fc2;
  box-shadow: 0 22px 60px rgba(5, 7, 21, 0.62);
}

body.dark-theme .swal2-title.bot-tester-modal-title {
  color: #dfe5ff;
}

body.dark-theme .swal2-popup.bot-tester-modal-popup .swal2-close {
  color: #aeb8ff;
}

body.dark-theme .swal2-popup.bot-tester-modal-popup .swal2-close:hover {
  color: #e6e9ff;
  background: rgba(154, 167, 255, 0.16);
}

body.dark-theme .automation-bot-tester {
  background: linear-gradient(180deg, #121833 0%, #0f152c 100%);
}

body.dark-theme .automation-bot-tester-meta {
  color: #9fb0db;
}

body.dark-theme .automation-bot-tester-messages {
  background: #0b1122;
  border-color: #374164;
}

body.dark-theme .automation-bot-placeholder {
  color: #a7b4d8;
}

body.dark-theme .automation-bot-msg.user {
  background: #2a3761;
  color: #f3f6ff;
}

body.dark-theme .automation-bot-msg.assistant {
  background: #1b2445;
  color: #dfe8ff;
}

body.dark-theme .automation-bot-attachment-preview {
  background: #101933;
  border-color: #3a466d;
  color: #d4defd;
}

@media (max-width: 768px) {
  .automation-card {
    overflow: visible;
  }

  .automation-table {
    min-width: 640px;
  }

  .automation-table .form-control {
    min-width: 0;
    width: 100%;
  }

  .automation-table .automation-mode {
    min-width: 124px;
    width: 124px;
  }

  .automation-provider-keys-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .automation-ai-grid {
    grid-template-columns: 1fr;
  }

  .automation-temp-editor {
    flex-direction: column;
    align-items: stretch;
  }

  .automation-temp-editor .form-control {
    max-width: 100%;
  }

  .automation-bot-tester-head-actions {
    width: 100%;
  }

  #bot-test-conversation-select {
    min-width: 0;
    width: 100%;
  }

  .automation-bot-tester-composer {
    grid-template-columns: repeat(3, auto);
  }

  #bot-test-input {
    grid-column: 1 / -1;
  }

  #bot-test-send-btn {
    grid-column: 1 / -1;
  }
}

.card {
  margin-bottom: 20px; /* Espacio inferior entre tarjetas */
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background-color: #f9f9f9;
}

.dashboard-summary {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
}

.dashboard-summary .card {
  width: 300px; /* Ajusta el ancho según necesites */
  text-align: center;
}

.dashboard-widgets {
  display: flex;
  justify-content: space-around;
  margin-top: 20px;
}

.dashboard-widgets .widget {
  background-color: #f0f0f0;
  padding: 15px;
  border-radius: 8px;
  text-align: center;
}

.dashboard-widgets .widget h2 {
  margin-bottom: 5px;
}

.dashboard-v2-wrap {
  display: grid;
  gap: 16px;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
  min-width: 0;
}

.dashboard-kpi-card {
  border-radius: 12px;
  border: 1px solid #dde2ee;
  background: #ffffff;
  padding: 14px 16px;
  box-shadow: 0 8px 20px rgba(20, 28, 55, 0.06);
  min-width: 0;
}

.dashboard-kpi-card .kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #0f254a;
  font-weight: 700;
}

.dashboard-kpi-card .kpi-head span {
  flex: 1;
  min-width: 0;
  line-height: 1.2;
}

.dashboard-kpi-card .kpi-head i {
  color: #7c5dfa;
}

.dashboard-kpi-card .kpi-value {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
  line-height: 1;
  color: #1b2743;
}

.dashboard-kpi-card .kpi-meta {
  display: block;
  margin-top: 6px;
  color: #7783a2;
}

.kpi-distribution {
  min-height: 212px;
}

.kpi-donut-layout {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 10px;
  align-items: center;
}

.kpi-donut {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: conic-gradient(var(--donut-slices, #D9E0EF 0 100%));
  padding: 9px;
  position: relative;
}

.kpi-donut-center {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px #e3e8f3;
}

.kpi-donut-center strong {
  font-size: 1rem;
  line-height: 1;
  color: #27365b;
}

.kpi-donut-center small {
  margin-top: 4px;
  color: #7a86a3;
  font-size: 0.72rem;
}

.kpi-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.legend-item {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 6px;
  color: #5f6b88;
  font-size: 0.73rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-item strong {
  color: #2b3a61;
}

.legend-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-insights-grid,
.dashboard-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(300px, 1fr));
  gap: 14px;
  min-width: 0;
}

.dashboard-panel {
  background: #ffffff;
  border: 1px solid #dde2ee;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 8px 20px rgba(20, 28, 55, 0.06);
  min-width: 0;
}

.dashboard-panel .panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.dashboard-panel .panel-head h3 {
  margin: 0;
  font-size: 1.05rem;
  color: #1b2743;
}

.dashboard-panel .panel-head span {
  font-size: 0.78rem;
  color: #7b86a4;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed #e5eaf3;
  color: #5f6b88;
}

.metric-row.total {
  border-bottom: 0;
  color: #2f3f66;
  font-weight: 700;
}

.metric-row strong {
  color: #1f2d4f;
}

.dashboard-insights-grid .metric-row:last-child {
  border-bottom: 0;
}

.line-chart-wrap {
  padding-top: 8px;
}

.line-chart-wrap svg {
  width: 100%;
  height: 190px;
  display: block;
  border-radius: 8px;
  background: repeating-linear-gradient(
    to top,
    rgba(124, 93, 250, 0.08),
    rgba(124, 93, 250, 0.08) 1px,
    transparent 1px,
    transparent 32px
  );
}

.line-chart-axis {
  stroke: #dbe3f3;
  stroke-width: 0.6;
}

.line-chart-path {
  fill: none;
  stroke: #6936a1;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-chart-point {
  fill: #ffffff;
  stroke: #6936a1;
  stroke-width: 0.9;
}

.line-chart-labels {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.line-chart-labels.cols-7 {
  grid-template-columns: repeat(7, minmax(26px, 1fr));
}

.line-chart-labels.cols-12 {
  grid-template-columns: repeat(12, minmax(16px, 1fr));
}

.line-chart-labels small {
  text-align: center;
  font-size: 0.72rem;
  color: #7a86a3;
  font-weight: 700;
}

.mini-bar-chart {
  height: 190px;
  display: grid;
  grid-template-columns: repeat(7, minmax(26px, 1fr));
  align-items: stretch;
  gap: 8px;
  padding-top: 10px;
}

.mini-bar-chart.monthly {
  grid-template-columns: repeat(12, minmax(18px, 1fr));
  background: repeating-linear-gradient(
    to top,
    rgba(90, 108, 148, 0.12),
    rgba(90, 108, 148, 0.12) 1px,
    transparent 1px,
    transparent 36px
  );
}

.monthly-chart-with-scale {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 8px;
  align-items: stretch;
}

.monthly-scale {
  position: relative;
  height: 172px;
}

.monthly-scale span {
  position: absolute;
  right: 0;
  transform: translateY(50%);
  font-size: 0.66rem;
  color: #7a86a3;
  font-weight: 700;
}

.monthly-scale .s100 { bottom: 100%; transform: translateY(100%); }
.monthly-scale .s75 { bottom: 75%; }
.monthly-scale .s50 { bottom: 50%; }
.monthly-scale .s25 { bottom: 25%; }
.monthly-scale .s0 { bottom: 0; transform: translateY(0); }

.monthly-scale::before {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #d9e1f0;
}

.monthly-bars-wrap {
  padding-top: 8px;
}

.monthly-bars-wrap .mini-bar-chart.monthly {
  height: 172px;
  align-items: end;
  padding-top: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #dbe3f3;
}

.mini-bar-col.monthly-col {
  justify-content: flex-end;
  gap: 0;
}

.monthly-months {
  margin-top: 8px;
}

.mini-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-height: 100%;
  height: 100%;
}

.mini-bar {
  width: 100%;
  min-height: 0;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #8d75ff 0%, #5f45d9 100%);
  box-shadow: 0 6px 12px rgba(98, 77, 214, 0.24);
}

.mini-bar.has-value {
  min-height: 8px;
}

.mini-bar.is-zero {
  height: 2px !important;
  min-height: 2px;
  background: #d9e0ef;
  box-shadow: none;
}

.mini-bar-col small {
  font-size: 0.72rem;
  color: #7a86a3;
  font-weight: 700;
}

.licenses-panel .license-card {
  margin-bottom: 12px;
}

.licenses-panel .license-card:last-child {
  margin-bottom: 0;
}

.dashboard-section-divider {
  margin: 10px 0 0;
  border-top: 1px solid #dbe3f3;
  height: 1px;
}

.licenses-panel-separated {
  margin-top: 12px;
}

.licenses-title {
  margin: 0 0 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #dbe3f3;
  font-size: 2rem;
  color: #0f254a;
  display: flex;
  align-items: center;
  gap: 10px;
}

.licenses-title i {
  color: #2b3550;
}

@media (max-width: 1200px) {
  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 900px) {
  .dashboard-kpi-grid,
  .dashboard-insights-grid,
  .dashboard-charts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .dashboard-kpi-card,
  .dashboard-panel {
    padding: 12px;
  }

  .dashboard-kpi-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .dashboard-insights-grid,
  .dashboard-charts-grid {
    gap: 12px;
  }

  .line-chart-labels.cols-12 {
    gap: 4px;
    grid-template-columns: repeat(12, minmax(12px, 1fr));
  }

  .line-chart-labels small {
    font-size: 0.64rem;
  }

  .kpi-donut-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .kpi-donut-legend {
    width: 100%;
  }

  .monthly-chart-with-scale {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .monthly-scale {
    display: none;
  }

  .mini-bar-chart.monthly {
    grid-template-columns: repeat(12, minmax(12px, 1fr));
    gap: 4px;
  }
}

body.dark-theme .dashboard-kpi-card,
body.dark-theme .dashboard-panel {
  background: #1a1a2e;
  border-color: #343641;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

body.dark-theme .dashboard-kpi-card .kpi-head,
body.dark-theme .dashboard-kpi-card .kpi-meta,
body.dark-theme .dashboard-panel .panel-head span,
body.dark-theme .metric-row,
body.dark-theme .line-chart-labels small,
body.dark-theme .kpi-donut-center small,
body.dark-theme .legend-item,
body.dark-theme .mini-bar-col small {
  color: #9da9c9;
}

body.dark-theme .dashboard-kpi-card .kpi-value,
body.dark-theme .dashboard-panel .panel-head h3,
body.dark-theme .metric-row strong,
body.dark-theme .metric-row.total,
body.dark-theme .kpi-donut-center strong,
body.dark-theme .legend-item strong {
  color: #eef2ff;
}

body.dark-theme .metric-row {
  border-bottom-color: #343641;
}

body.dark-theme .kpi-donut-center {
  background: #1a1a2e;
  box-shadow: inset 0 0 0 1px #343641;
}

body.dark-theme .line-chart-axis {
  stroke: #3a456d;
}

body.dark-theme .monthly-scale span {
  color: #9da9c9;
}

body.dark-theme .monthly-scale::before {
  background: #3a456d;
}

body.dark-theme .mini-bar-chart.monthly {
  background: repeating-linear-gradient(
    to top,
    rgba(157, 169, 201, 0.16),
    rgba(157, 169, 201, 0.16) 1px,
    transparent 1px,
    transparent 36px
  );
}

body.dark-theme .dashboard-section-divider {
  border-top-color: #3a456d;
}

body.dark-theme .licenses-title {
  border-bottom-color: #3a456d;
  color: #eef2ff;
}

body.dark-theme .licenses-title i {
  color: #c9d3f3;
}

body.dark-theme .monthly-bars-wrap .mini-bar-chart.monthly {
  border-bottom-color: #3a456d;
}

body.dark-theme .line-chart-wrap svg {
  background: repeating-linear-gradient(
    to top,
    rgba(105, 54, 161, 0.18),
    rgba(105, 54, 161, 0.18) 1px,
    transparent 1px,
    transparent 32px
  );
}

body.dark-theme .line-chart-point {
  fill: #1a1a2e;
}

body.dark-theme .mini-bar {
  background: linear-gradient(180deg, #9f8bff 0%, #7256e0 100%);
}

body {
  font-family: 'Quicksand', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f4f6f8;
  color: #333;
  display: flex;
  min-height: 100vh; /* Cambia height a min-height */
  flex-direction: column; /* Añade esto */
}

body.public-page {
  display: flex;
  flex-direction: column;
  min-height: calc(var(--app-vh, 1vh) * 100);
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
}

body.app-shell {
  overflow: hidden;
  height: calc(var(--app-vh, 1vh) * 100);
  min-height: calc(var(--app-vh, 1vh) * 100);
  overscroll-behavior: none;
}
/*Main container*/
html, body {
  height: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.container {
  display: flex;
  height: calc(var(--app-vh, 1vh) * 100);
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.content-area {
  display: flex; /* Activar Flexbox */
  flex-direction: column; /* Alinear contenido verticalmente */
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  position: relative;
  background-image:
    radial-gradient(420px 420px at -90px calc(100% - 20px), transparent 57%, rgba(124, 93, 250, 0.10) 58%, rgba(124, 93, 250, 0.10) 70%, transparent 71%),
    radial-gradient(420px 420px at calc(100% + 90px) 20px, transparent 57%, rgba(124, 93, 250, 0.10) 58%, rgba(124, 93, 250, 0.10) 70%, transparent 71%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Sidebar Styling */
aside.sidebar {
  background-color: #fff;
  width: 250px;
  min-width: 250px;
  padding: 20px 20px 28px;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  transition: width 0.3s ease; /* Transition for expanding/collapsing */
}
/* Header */
aside.sidebar header {
  display: flex;
  align-items: center;
  margin-bottom: 30px;
  justify-content: space-between;
}

.logo {
  background-color: transparent;
  color: inherit;
  width: auto;
  height: auto;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  font-size: 1.2em;
  font-weight: bold;
}

.codinglab {
  margin-left: 10px;
  font-size: 0.9em;
}

.codinglab p:last-child{
  font-size: 0.7em;
  color: #7c7c7c;
}
/*Toggle buttons*/
aside.sidebar header .toggle-btn {
  border: none;
  background: none;
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform 0.3s ease-in-out;
}

/* Estilos para el botón de toggle del sidebar */
aside.sidebar header .toggle-btn {
  color: #333; /* Color por defecto (tema claro) */
}

body.dark-theme aside.sidebar header .toggle-btn {
  color: #ddd; /* Color para el tema oscuro */
}

aside.sidebar.collapsed header .toggle-btn{
  transform: rotate(180deg);
}


/* Navigation Styling */
nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

nav ul li {
  margin-bottom: 10px;
}

nav ul li a{
  display: flex;
  align-items: center;
  color: #333;
  text-decoration: none;
  padding: 10px 15px;
  border-radius: 8px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

nav ul li a.active,
nav ul li a:hover {
  background-color: #7c5dfa;
  color: white;
}
nav ul li a i {
  margin-right: 10px;
  font-size: 1.2rem;
}

nav ul li a span{
  flex: 1; /* Take up available space */
}

/* Bottom Section */
.bottom-section{
  margin-top: auto;
  padding-bottom: 16px;
}

.bottom-section .logout{
  display: flex;
  align-items: center;
  color: #333;
  text-decoration: none;
  padding: 10px 15px;
  border-radius: 8px;
  transition: background-color 0.3s ease, color 0.3s ease;
  cursor: pointer;
}

.bottom-section .logout a {
  color: inherit;
  text-decoration: none;
}

.bottom-section .logout:hover{
  background-color: #7c5dfa;
  color: #fff;
}
.bottom-section .logout i{
  margin-right: 10px;
  font-size: 1.2rem;
}

/* Theme toggle switch */
.theme-toggle{
  display: flex;
  align-items: center;
  margin-top: 15px;
  font-size: 1.2rem;
  gap: 5px;
  padding: 0px 5px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 20px; /*  Mantén este valor fijo, o aúmentalo un poco si es necesario */
  height: 20px;
  min-width: 30px; /* Añade también un ancho mínimo */
  --switch-travel: 14px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 1px;
  bottom: 3px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #7c5dfa;
}

input:focus + .slider {
  box-shadow: 0 0 1px #7c5dfa;
}

/* recorrido de la bolita */
input:checked + .slider:before {
  -webkit-transform: translateX(var(--switch-travel));
  -ms-transform: translateX(var(--switch-travel));
  transform: translateX(var(--switch-travel));
}

/* Collapsed state */
aside.sidebar.collapsed {
  width: 80px;
  min-width: 80px;
  padding: 20px 10px 28px;
}

aside.sidebar.collapsed .codinglab,
aside.sidebar.collapsed .search-container input,
aside.sidebar.collapsed nav ul li a span,
aside.sidebar.collapsed .bottom-section .logout a
{
  display: none;
}

aside.sidebar.collapsed nav ul li {
  margin-bottom: 15px;
}

aside.sidebar.collapsed nav ul li a {
  display: flex;
  justify-content: center;
  padding: 15px 0;
}

aside.sidebar.collapsed .theme-toggle {
  justify-content: center;
  gap: 4px;
  padding: 0;
}

aside.sidebar.collapsed .theme-toggle i {
  font-size: 1rem;
}

aside.sidebar.collapsed .switch {
  min-width: 26px;
  width: 26px;
  height: 18px;
  --switch-travel: 10px;
}

aside.sidebar.collapsed .bottom-section .logout {
  justify-content: center;
  padding: 10px 0;
}

aside.sidebar.collapsed .bottom-section .logout i {
  margin-right: 0;
}
/* Dark theme */
body.dark-theme {
  background-color: #1a1a2e;
  color: #ddd;
}

body.dark-theme aside.sidebar {
  background-color: #1f2545;
  box-shadow: 2px 0 5px rgba(255, 255, 255, 0.1);
}

body.dark-theme aside.sidebar header,
body.dark-theme aside.sidebar .search-container,
body.dark-theme aside.sidebar nav ul li a{
  color: #ddd;
}


body.dark-theme .search-container {
  background-color: #343641;
}
body.dark-theme .search-container input {
  color: #ddd;
}

body.dark-theme nav ul li a.active,
body.dark-theme nav ul li a:hover {
  background-color: #9585e7;
  color: #ffffff;
}

body.dark-theme .bottom-section .logout{
  color: #ddd;
}

body.dark-theme .bottom-section .logout:hover{
  background-color: #9585e7;
  color: #fff;
}

body.dark-theme .slider {
  background-color: #343641;
}
body.dark-theme input:checked + .slider {
  background-color: #9585e7;
}

#content-placeholder {
  width: 100%;
  padding: 16px 20px 16px;
  box-sizing: border-box;
}

#content-placeholder > .content-container {
  margin: 0 auto 16px;
}

/* Content Styling */
/* Common styles for all content areas */
.content-container {
  padding: 20px;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.content-container.content-container-spaced {
  margin: 0 auto 16px;
}

.content-container.content-container-spaced .card {
  border: 1px solid #ddd;
  border-radius: 8px;
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

body.dark-theme .content-container.content-container-spaced .card {
  border-color: #343641;
  background-color: #1a1a2e;
}

body.dark-theme .btn-google {
  background: #1f2545;
  border-color: #3b4161;
  color: #e5e7eb;
}

body.dark-theme .btn-google:hover {
  background: #2a3158;
  border-color: #555d83;
}

body.dark-theme .auth-divider {
  color: #c8cfdd;
}

body.dark-theme .auth-divider::before,
body.dark-theme .auth-divider::after {
  border-bottom-color: #4a5163;
}
/*Specific styles for content areas*/

.content-container h1 {
  margin-bottom: 20px;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

/*Revenue*/
.revenue-chart{
  margin-bottom: 20px;
}
.revenue-summary ul {
  list-style-type: none;
  padding-left: 0;
}
.revenue-summary ul li{
  margin-bottom: 8px;
}
.revenue-details table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.revenue-details th,
.revenue-details td {
  padding: 8px;
  border: 1px solid #ddd;
  text-align: left;
}

.revenue-details th {
  background-color: #f0f0f0;
}

/*Notification*/
.notification-list .notification{
  padding: 15px;
  border-bottom: 1px solid #f0f0f0;
}
.notification-list .notification p{
  margin: 0;
}
.notification-list .notification p small{
  color: #888;
}
/*Analytics*/
.analytics-metrics {
  display: flex;
  justify-content: space-around;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 20px;
}

.analytics-metrics .metric {
  text-align: center;
}
.analytics-metrics .metric h2{
  margin: 0;
}
.analytics-metrics .metric p{
  font-size: 2rem;
  font-weight: bold;
  margin-top: 5px;
}
.analytics-charts{
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 20px;
}
.analytics-charts img{
  max-width: 100%;
  height: auto;
}
/*Likes*/
.likes-list .like-item{
  padding: 15px;
  border-bottom: 1px solid #f0f0f0;
}
.likes-list .like-item p{
  margin: 0;
}
.likes-list .like-item p small{
  color: #888;
}
/*Wallets*/
.wallet-list .wallet-item{
  padding: 15px;
  border-bottom: 1px solid #f0f0f0;
}
.wallet-list .wallet-item h2{
  margin: 0;
}
.wallet-list .wallet-item p{
  margin: 5px 0 0 0;
  font-size: 1.1rem;
}

/* --- Estilos REVISADOS para el Cuadro del Código QR --- */

/* --- BLOQUE: Monitor de Conexión (integrado) --- */
.monitor-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 10px;
}
.status-card{
  border-radius: 10px;
  padding: 18px;
  background-color: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #e5e7eb);
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}
.status-card h2{ font-size: 0.95rem; color: var(--text-secondary, #6b7280); margin-bottom:6px; font-weight:600; }
.status-card .phone-number{ font-size:1.4rem; font-weight:700; margin-bottom:12px; color:var(--text-primary,#111827); }
.status-display{ display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:8px; font-weight:700; }
.status-dot{ width:10px; height:10px; border-radius:50%; }
.status-conectado{ background: rgba(40,167,69,0.08); color:#28a745; }
.status-conectado .status-dot{ background:#28a745; animation: pulse-green 1.8s infinite; }
.status-desconectado{ background: rgba(220,53,69,0.08); color:#dc3545; }
.status-desconectado .status-dot{ background:#dc3545; animation:none; }
.status-inicializando{ background: rgba(255,193,7,0.08); color:#d97706; }
.status-inicializando .status-dot{ background:#d97706; animation: pulse-yellow 1.8s infinite; }
.status-error{ background: rgba(108,117,125,0.06); color:#6c757d; }
.last-checked{ margin-top:10px; font-size:0.85rem; color:var(--text-secondary,#6b7280); }
@keyframes pulse-green{0%{box-shadow:0 0 0 0 rgba(40,167,69,0.6);}70%{box-shadow:0 0 0 10px rgba(40,167,69,0);}100%{box-shadow:0 0 0 0 rgba(40,167,69,0);}}
@keyframes pulse-yellow{0%{box-shadow:0 0 0 0 rgba(217,119,6,0.6);}70%{box-shadow:0 0 0 10px rgba(217,119,6,0);}100%{box-shadow:0 0 0 0 rgba(217,119,6,0);}}
/* --- FIN BLOQUE Monitor --- */

/* Estilos BASE (Radio y transición - aplicables a ambos) */
.qr-code-display {
  border-radius: 5px;
  transition: background-color 0.3s ease, border 0.3s ease, color 0.3s ease;
  /* Clases Bootstrap como text-center, my-3, p-2 se mantienen en el HTML */
}

/* --- TEMA CLARO (Default) --- */
/* Selector un poco más específico (asume que está dentro de .card dentro de .content-container) */
/* Si no está en .card, puedes quitar esa parte del selector */
div.content-container div.card div.qr-code-display {
border: 2px dashed #7c5dfa;      /* Borde COMPLETO claro */
background-color: #9585e7;   /* Fondo claro */
color: #ffffff;               /* Texto blanco por defecto para este contenedor */
}
/* Si no está en .card, usa esta regla también o en lugar de la de arriba */
div.content-container div.qr-code-display {
border: 2px dashed #7c5dfa;
background-color: #9585e7;
color: #ffffff;
}

/* Estilos específicos para texto en tema claro DENTRO del QR display */
.qr-code-display .qr-title {
  color: #ffffff !important; /* Forzar blanco si es necesario */
}
.qr-code-display .qr-subtitle {
  color: rgba(255, 255, 255, 0.85) !important; /* Forzar blanco tenue */
}

/* --- TEMA OSCURO --- */
/* Selector un poco más específico */
body.dark-theme div.content-container div.card div.qr-code-display {
border: 2px dashed #1f2545;      /* Borde COMPLETO oscuro */
background-color: #1a1a2e;   /* Fondo oscuro */
color: #dddddd;              /* Texto claro por defecto para este contenedor */
}
/* Si no está en .card, usa esta regla también o en lugar de la de arriba */
body.dark-theme div.content-container div.qr-code-display {
border: 2px dashed #1f2545;
background-color: #1a1a2e;
color: #dddddd;
}

/* Estilos específicos para texto en tema oscuro DENTRO del QR display */
body.dark-theme .qr-code-display .qr-title {
  color: #dddddd !important; /* Forzar texto claro */
}
body.dark-theme .qr-code-display .qr-subtitle {
   color: #8a93a2 !important; /* Forzar color muted oscuro */
   /* Si text-muted ya tiene !important en el tema oscuro, quítalo de aquí */
}

@media (max-width: 768px) {
  body.app-shell {
    height: calc(var(--app-vh, 1vh) * 100);
    min-height: calc(var(--app-vh, 1vh) * 100);
    overflow: hidden;
  }

  .container {
    height: calc(var(--app-vh, 1vh) * 100);
    overflow: hidden;
  }

  .content-area {
    background-attachment: scroll;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  aside.sidebar,
  aside.sidebar.collapsed {
    width: 72px;
    min-width: 72px;
    padding: 14px 8px calc(18px + env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  aside.sidebar header {
    justify-content: center;
    margin-bottom: 20px;
  }

  aside.sidebar header .toggle-btn {
    display: none;
  }

  aside.sidebar .codinglab,
  aside.sidebar nav ul li a span,
  aside.sidebar .bottom-section .logout a {
    display: none;
  }

  aside.sidebar nav ul li {
    margin-bottom: 12px;
  }

  aside.sidebar nav ul li a,
  aside.sidebar.collapsed nav ul li a {
    justify-content: center;
    padding: 12px 0;
  }

  aside.sidebar nav ul li a i,
  aside.sidebar.collapsed nav ul li a i {
    margin-right: 0;
    font-size: 1.5rem;
  }

  .theme-toggle {
    justify-content: center;
    gap: 4px;
    padding: 0;
    font-size: 1.05rem;
  }

  .theme-toggle .switch {
    min-width: 26px;
    width: 26px;
    height: 18px;
    --switch-travel: 10px;
  }

  .bottom-section {
    padding-bottom: 10px;
  }

  .bottom-section .logout {
    justify-content: center;
    padding: 10px 0;
  }

  .bottom-section .logout i {
    margin-right: 0;
    font-size: 1.4rem;
  }

  #content-placeholder {
    padding: 12px 10px calc(20px + env(safe-area-inset-bottom));
  }

  #content-placeholder > .content-container {
    margin: 0 auto 12px;
  }

  .content-container h1 {
    font-size: 2rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .monitor-grid {
    grid-template-columns: 1fr;
  }
}

/* Estilo de la imagen (puede ir aquí o mantenerse inline) */
.qr-code-display .qr-image {
  max-width: 180px;
  height: auto;
  display: block;
  margin: 5px auto;
}

/* Modal de horarios: compacto, legible y responsive */
.schedule-modal-popup {
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 0;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
}

.schedule-modal-html {
  text-align: left;
  overflow-x: hidden;
}

.schedule-modal-body {
  text-align: left;
}

.schedule-field-label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin: 0 0 6px;
}

.schedule-field {
  margin-bottom: 10px;
}

.schedule-top-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 170px 170px;
  gap: 10px;
  margin-bottom: 10px;
  width: 100%;
  max-width: 100%;
}

.schedule-top-slot input {
  text-align: center;
}

.schedule-top-slot {
  justify-self: end;
  width: 180px;
}

.schedule-days-container {
  max-height: 48vh;
  overflow-y: auto;
  padding-right: 4px;
}

.schedule-day-row {
  display: grid;
  grid-template-columns: 95px 90px minmax(145px, 1fr) minmax(145px, 1fr);
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.schedule-time-control {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 50px;
  gap: 2px;
  align-items: stretch;
}

.schedule-time-control.is-24h {
  grid-template-columns: minmax(110px, 1fr) 50px;
}

.schedule-time-input-shell {
  min-width: 0;
}

.schedule-time-12-wrap {
  display: grid;
  grid-template-columns: 1fr 10px 1fr;
  gap: 0;
  align-items: center;
}

.schedule-time-24-wrap {
  display: grid;
  grid-template-columns: 1fr 10px 1fr;
  gap: 0;
  align-items: center;
}

.schedule-time-12-wrap .schedule-time-hour12,
.schedule-time-12-wrap .schedule-time-minute12 {
  height: 30px;
  border: 1px solid #d6dce7;
  border-radius: 0;
  padding: 0 6px;
  box-shadow: none;
}

.schedule-time-24-wrap .schedule-time-hour24,
.schedule-time-24-wrap .schedule-time-minute24 {
  height: 30px;
  border: 1px solid #d6dce7;
  border-radius: 0;
  padding: 0 6px;
  box-shadow: none;
}

.schedule-time-12-wrap .schedule-time-12-sep {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #5b6478;
  font-weight: 600;
}

.schedule-time-meridiem-shell {
  min-width: 50px;
}

.schedule-time-meridiem-shell.is-blank {
  opacity: 0;
  pointer-events: none;
}

.schedule-time-meridiem-shell.is-disabled {
  opacity: 0.65;
}

.schedule-time-meridiem-shell .schedule-time-meridiem-select {
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  height: 30px;
  padding: 0 2px;
  border-radius: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: #2f3f53;
  background: #fff;
  border: 1px solid #bfc7d5;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  text-align: center;
  text-align-last: center;
  line-height: 1;
}

.schedule-day-row input,
.schedule-day-row select:not(.schedule-time-meridiem-select) {
  width: 100%;
  min-width: 0;
  border-radius: 0;
  border: 1px solid #d6dce7;
  box-shadow: none;
}

.schedule-top-grid .form-control,
#schedule-uid,
#schedule-timezone,
#schedule-time-format,
#schedule-slot {
  border-radius: 0;
  border: 1px solid #d6dce7;
  box-shadow: none;
}

.schedule-time-meridiem-shell .schedule-time-meridiem-select {
  border: 1px solid #d6dce7;
}

.schedule-day-label {
  font-size: 0.95rem;
}

.schedule-active-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-loading {
  margin: 8px 0;
  color: #666;
  font-size: 0.9rem;
}

.schedule-last-update {
  margin-top: 8px;
  text-align: right;
  font-size: 0.78rem;
  color: #8a8f9b;
}

.swal2-popup.schedule-modal-popup .swal2-actions {
  gap: 10px;
}

.swal2-popup.schedule-modal-popup .swal2-confirm,
.swal2-popup.schedule-modal-popup .swal2-cancel {
  border-radius: 12px;
  font-weight: 600;
  padding: 10px 18px;
  border: 1px solid transparent;
}

.swal2-popup.schedule-modal-popup .swal2-confirm {
  background: #7c5dfa;
  border-color: #7c5dfa;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(124, 93, 250, 0.25);
}

.swal2-popup.schedule-modal-popup .swal2-confirm:hover {
  background: #6b4fe0;
  border-color: #6b4fe0;
}

.swal2-popup.schedule-modal-popup .swal2-cancel {
  background: #eef0f5;
  border-color: #d8dce6;
  color: #4b5563;
}

.swal2-popup.schedule-modal-popup .swal2-cancel:hover {
  background: #e5e7eb;
}

.agenda-modal-popup {
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
}

.swal2-popup.agenda-modal-popup .swal2-actions {
  gap: 10px;
}

.swal2-popup.agenda-modal-popup .swal2-cancel {
  border-radius: 8px;
  font-weight: 600;
  padding: 10px 18px;
  border: 1px solid #d8dce6;
  background: #eef0f5;
  color: #4b5563;
}

.swal2-popup.agenda-modal-popup .swal2-cancel:hover {
  background: #e5e7eb;
}

.agenda-modal-html {
  text-align: left;
  overflow: hidden;
}

.agenda-modal-wrap {
  text-align: left;
}

.agenda-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.agenda-inline-loader {
  display: none;
  align-items: center;
  gap: 6px;
  color: #5b6478;
  font-size: 0.82rem;
  font-weight: 600;
}

.agenda-inline-loader.is-active {
  display: inline-flex;
}

.agenda-inline-loader .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(34, 197, 94, 0.28);
  border-top-color: #22c55e;
  animation: agenda-spin 0.8s linear infinite;
}

@keyframes agenda-spin {
  to {
    transform: rotate(360deg);
  }
}

.agenda-week-label {
  margin-left: auto;
  font-weight: 700;
  color: #27304a;
}

.agenda-week-shell {
  border: 1px solid #dbe0ea;
  border-radius: 10px;
  overflow: hidden;
}

.agenda-week-header {
  display: grid;
  grid-template-columns: 74px repeat(7, var(--agenda-day-width, 150px));
  background: #eef2fb;
  border-bottom: 1px solid #dbe0ea;
  position: sticky;
  top: 0;
  z-index: 3;
}

.agenda-time-head {
  padding: 8px 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #5b6478;
  border-right: 1px solid #dbe0ea;
}

.agenda-day-head {
  padding: 8px 8px;
  border-right: 1px solid #dbe0ea;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.agenda-day-head span {
  font-size: 0.75rem;
  color: #5b6478;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.agenda-day-head strong {
  font-size: 0.9rem;
  color: #1f2937;
}

.agenda-week-scroll {
  max-height: 62vh;
  overflow: auto;
}

.agenda-week-body {
  display: grid;
  grid-template-columns: 74px calc(var(--agenda-day-width, 150px) * 7);
}

.agenda-time-axis {
  border-right: 1px solid #dbe0ea;
  position: relative;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 65px,
    #eef2f8 65px,
    #eef2f8 66px
  );
}

.agenda-time-label {
  height: 66px;
  padding: 2px 6px;
  font-size: 0.74rem;
  color: #6b7280;
}

.agenda-days-grid {
  display: grid;
  grid-template-columns: repeat(7, var(--agenda-day-width, 150px));
}

.agenda-day-track {
  position: relative;
  border-right: 1px solid #e4e9f2;
}

.agenda-track-lines {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 65px,
    #eef2f8 65px,
    #eef2f8 66px
  );
  pointer-events: none;
}

.agenda-events-layer {
  position: absolute;
  inset: 0;
}

.agenda-event-card {
  position: absolute;
  left: 6px;
  right: 6px;
  background: #7c5dfa;
  color: #fff;
  border-radius: 8px;
  padding: 1px 8px;
  overflow: hidden;
  box-shadow: 0 8px 16px rgba(76, 58, 168, 0.34);
  cursor: pointer;
}

.agenda-event-card h4 {
  margin: 0 0 1px;
  font-size: 0.8rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agenda-event-card p {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.95;
}

@media (max-width: 768px) {
  .swal2-popup.schedule-modal-popup {
    width: min(96vw, 520px) !important;
    padding: 16px 12px 14px;
  }

  .swal2-popup.schedule-modal-popup .swal2-html-container {
    margin: 0.6em 0 0;
  }

  .schedule-top-grid {
    grid-template-columns: 1fr;
    max-width: 100%;
    gap: 8px;
  }

  .schedule-day-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
    border: 1px solid #ececf2;
    border-radius: 8px;
    overflow: hidden;
  }

  .schedule-day-row > * {
    min-width: 0;
  }

  .schedule-day-label {
    grid-column: auto;
    margin-bottom: 0;
  }

  .schedule-active-label {
    grid-column: auto;
    justify-content: space-between;
  }

  .schedule-time-control {
    grid-template-columns: minmax(0, 1fr) 46px;
    width: 100%;
  }

  .schedule-time-input-shell {
    width: 100%;
  }

  .schedule-time-12-wrap,
  .schedule-time-24-wrap {
    grid-template-columns: minmax(0, 1fr) 8px minmax(0, 1fr);
  }

  .schedule-time-12-wrap .schedule-time-hour12,
  .schedule-time-12-wrap .schedule-time-minute12,
  .schedule-time-24-wrap .schedule-time-hour24,
  .schedule-time-24-wrap .schedule-time-minute24 {
    height: 34px;
    font-size: 16px;
    padding: 0 5px;
  }

  .schedule-time-meridiem-shell .schedule-time-meridiem-select {
    width: 46px;
    min-width: 46px;
    max-width: 46px;
    height: 34px;
    font-size: 0.7rem;
  }

  .schedule-day-row input,
  .schedule-day-row select {
    font-size: 16px;
  }

  .schedule-days-container {
    max-height: 44vh;
  }

  .schedule-last-update {
    text-align: left;
    font-size: 0.74rem;
    word-break: break-word;
  }

  .swal2-popup.schedule-modal-popup .swal2-actions {
    display: flex;
    gap: 8px;
    width: 100%;
  }

  .swal2-popup.schedule-modal-popup .swal2-confirm,
  .swal2-popup.schedule-modal-popup .swal2-cancel {
    flex: 1 1 0;
    margin: 0 !important;
    min-width: 0;
  }
}

body.dark-theme .swal2-popup.schedule-modal-popup {
  background: #1f2545;
  color: #e5e7eb;
  border: 1px solid #343b63;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

body.dark-theme .swal2-popup.schedule-modal-popup .swal2-title {
  color: #f3f4f6;
}

body.dark-theme .swal2-popup.schedule-modal-popup .schedule-field-label,
body.dark-theme .swal2-popup.schedule-modal-popup .schedule-day-label,
body.dark-theme .swal2-popup.schedule-modal-popup .schedule-active-label,
body.dark-theme .swal2-popup.schedule-modal-popup .schedule-loading {
  color: #d1d5db;
}

body.dark-theme .swal2-popup.schedule-modal-popup .schedule-time-meridiem-select {
  color: #e5e7eb;
  background: #1b2344;
  border-color: #4a5483;
}

body.dark-theme .swal2-popup.schedule-modal-popup .schedule-time-meridiem {
  color: #e5e7eb;
  background: #2b3358;
}

body.dark-theme .swal2-popup.schedule-modal-popup .schedule-last-update {
  color: #9ca3af;
}

body.dark-theme .swal2-popup.schedule-modal-popup .form-control,
body.dark-theme .swal2-popup.schedule-modal-popup input,
body.dark-theme .swal2-popup.schedule-modal-popup select {
  background-color: #171d3a;
  color: #e5e7eb;
  border: 1px solid #454e7c;
}

body.dark-theme .swal2-popup.schedule-modal-popup .form-control:disabled,
body.dark-theme .swal2-popup.schedule-modal-popup input:disabled,
body.dark-theme .swal2-popup.schedule-modal-popup select:disabled {
  background-color: #1b2142;
  color: #9ca3af;
  border-color: #2f355a;
}

body.dark-theme .swal2-popup.schedule-modal-popup .schedule-day-row {
  border-color: #343b63;
}

body.dark-theme .swal2-popup.schedule-modal-popup .swal2-confirm {
  background: #7c5dfa;
  border-color: #7c5dfa;
}

body.dark-theme .swal2-popup.schedule-modal-popup .swal2-confirm:hover {
  background: #8f75ff;
  border-color: #8f75ff;
}

body.dark-theme .swal2-popup.schedule-modal-popup .swal2-cancel {
  background: #2a3158;
  border-color: #3b4472;
  color: #d1d5db;
}

body.dark-theme .swal2-popup.schedule-modal-popup .swal2-cancel:hover {
  background: #333d69;
}

body.dark-theme .agenda-modal-popup {
  background: #1f2545;
  color: #e5e7eb;
  border: 1px solid #343b63;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

body.dark-theme .swal2-popup.agenda-modal-popup .swal2-cancel {
  background: #2a3158;
  border-color: #3b4472;
  color: #d1d5db;
}

body.dark-theme .swal2-popup.agenda-modal-popup .swal2-cancel:hover {
  background: #333d69;
}

body.dark-theme .agenda-week-label,
body.dark-theme .agenda-day-head strong {
  color: #eef2ff;
}

body.dark-theme .agenda-inline-loader,
body.dark-theme .agenda-day-head span,
body.dark-theme .agenda-time-head,
body.dark-theme .agenda-time-label {
  color: #b8c0dd;
}

body.dark-theme .agenda-week-shell,
body.dark-theme .agenda-week-header,
body.dark-theme .agenda-time-head,
body.dark-theme .agenda-time-axis,
body.dark-theme .agenda-day-head,
body.dark-theme .agenda-day-track {
  border-color: #343b63;
}

body.dark-theme .agenda-week-header {
  background: #171d3a;
}

body.dark-theme .agenda-track-lines {
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 65px,
    #2a335f 65px,
    #2a335f 66px
  );
}

body.dark-theme .agenda-time-axis {
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 65px,
    #2a335f 65px,
    #2a335f 66px
  );
}

@media (max-width: 768px) {
  .agenda-week-label {
    margin-left: 0;
    width: 100%;
  }

  .agenda-inline-loader {
    order: 4;
  }

  .agenda-week-scroll {
    max-height: 58vh;
  }
}

.dev-mt-shell .card {
  margin-bottom: 20px;
}

.mt-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.mt-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.mt-tenant-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.mt-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #ddd;
  border-radius: 16px;
  padding: 6px 10px;
  background: #fafafa;
  font-size: 13px;
}

.mt-health {
  margin-top: 14px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #ddd;
  background: #f6f6f6;
  display: inline-block;
}

.mt-health.is-up {
  color: #0b6b3a;
  border-color: #b8e5cb;
  background: #e9f8ef;
}

.mt-health.is-down {
  color: #8f1f2d;
  border-color: #f0c3cb;
  background: #fcecef;
}

.mt-qr-wrap {
  margin-top: 14px;
  padding: 12px;
  border: 1px dashed #c9c9c9;
  border-radius: 8px;
  background: #fcfcfc;
}

.mt-qr-image {
  max-width: 260px;
  width: 100%;
  height: auto;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
}

.mt-response-box {
  margin-top: 12px;
}

.mt-logs-output {
  margin: 0;
  max-height: 340px;
  overflow: auto;
  background: #101217;
  color: #d7e4ff;
  border-radius: 8px;
  padding: 12px;
  font-family: Consolas, Monaco, monospace;
  font-size: 12px;
}

.btn.btn-secondary {
  background-color: #3f4a5a;
  color: #fff;
}

.btn.btn-secondary:hover {
  background-color: #334050;
}

.btn.btn-success {
  background-color: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

.connect-btn:disabled,
.btn.btn-success:disabled {
  background-color: #16a34a;
  border-color: #16a34a;
  color: #fff;
  opacity: 1;
}

.btn.btn-success:hover {
  background-color: #15803d;
  border-color: #15803d;
}

.btn.btn-success:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.25);
}

.btn.btn-danger {
  background-color: #e74c3c;
  border-color: #e74c3c;
  color: #fff;
}

.btn.btn-danger:hover {
  background-color: #c0392b;
  border-color: #c0392b;
}

.btn.btn-danger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.25);
}

body.dark-theme .mt-pill {
  border-color: #485067;
  background: #2a2f44;
  color: #dfe5ff;
}

body.dark-theme .mt-qr-wrap {
  border-color: #485067;
  background: #252b3f;
}

body.dark-theme .mt-health {
  border-color: #4c5770;
  background: #2b3147;
  color: #e1e6ff;
}