/* ===== ESTILOS PERSONALIZADOS DE SCROLLBAR ===== */
/* Webkit browsers (Chrome, Edge, Safari) */
::-webkit-scrollbar {
    width: 10px;           /* Ancho de la barra vertical */
    height: 10px;          /* Alto de la barra horizontal */
}

::-webkit-scrollbar-track {
    background: rgba(50, 50, 50, 0.5);  /* Fondo del track - semi-transparente */
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #dc143c 0%, #ff1744 100%);  /* Gradiente rojo vibrante */
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ff1744 0%, #ff5252 100%);  /* Gradiente más claro al hover */
}

::-webkit-scrollbar-thumb:active {
    background: linear-gradient(180deg, #c41c3b 0%, #dc143c 100%);  /* Gradiente más oscuro al click */
}

/* Firefox (scrollbar-color es más limitado pero funciona) */
* {
    scrollbar-color: #dc143c rgba(50, 50, 50, 0.5);
    scrollbar-width: thin;
}

/* Estilos generales */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Fuente un poco más moderna */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    overflow: hidden; /* Evita barras de desplazamiento si la animación excede el viewport */
    background-color: #222; /* Un gris oscuro de base */
    position: relative; /* Necesario para posicionar el fondo animado */
    color: white; /* Color de texto general para que contraste con el fondo oscuro */
}

/* Estado de procesamiento global */
body.procesando-global {
    cursor: wait !important;
}

body.procesando-global * {
    cursor: wait !important;
}

.bloqueado-global {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

.shape-container {
    position: fixed; /* O 'absolute' si 'body' es el contenedor relativo */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Detrás de todo el contenido */
}

.shape {
    position: absolute;
    list-style: none;
    display: block;
    /* Inicia en la parte de abajo de la pantalla */
    bottom: -150px; 
    /* Aplicamos la animación */
    animation: float 25s infinite linear;
}

/* Estilo base para las formas (cuadrados rojos) */
.shape {
    background-color: rgba(220, 20, 60, 0.15); /* Rojo carmesí semi-transparente */
    border: 1px solid rgba(220, 20, 60, 0.3);
}
/* Formas alternativas (círculos grises) */
.shape.c2 {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%; /* Esto los convierte en círculos */
}


/* Diferentes tamaños */
.shape.s1 { width: 80px; height: 80px; }
.shape.s2 { width: 120px; height: 120px; }
.shape.s3 { width: 40px; height: 40px; }
.shape.s4 { width: 150px; height: 150px; }
.shape.s5 { width: 60px; height: 60px; }


/* Posición inicial y retraso de animación para cada forma */
.shape:nth-child(1) { left: 10%; animation-delay: 0s; }
.shape:nth-child(2) { left: 20%; animation-delay: -5s; animation-duration: 20s; }
.shape:nth-child(3) { left: 25%; animation-delay: -3s; animation-duration: 30s; }
.shape:nth-child(4) { left: 40%; animation-delay: -7s; animation-duration: 18s; }
.shape:nth-child(5) { left: 50%; animation-delay: -8s; }
.shape:nth-child(6) { left: 65%; animation-delay: -4s; animation-duration: 22s; }
.shape:nth-child(7) { left: 75%; animation-delay: -6s; }
.shape:nth-child(8) { left: 80%; animation-delay: -2s; animation-duration: 35s; }
.shape:nth-child(9) { left: 90%; animation-delay: -9s; animation-duration: 15s; }
.shape:nth-child(10) { left: 5%; animation-delay: -1s; }

/* Contenedor del fondo animado */
.background-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a, #8b0000, #333333, #dc143c, #1a1a1a); /* Rojo, gris oscuro, y variaciones */
    background-size: 400% 400%; /* Tamaño grande para la animación */
    animation: gradientShift 15s ease infinite; /* Nombre de la animación, duración, tipo y repetición */
    z-index: -1; /* Envía el fondo detrás del contenido */
}

/* Definición de la animación de los colores */
@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        /* Se mueve 120vh (más allá del alto de la pantalla) hacia arriba */
        transform: translateY(-120vh) rotate(720deg);
        opacity: 0;
    }
}

/* Estilos para el contenido principal (para que quede encima del fondo) */
.content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh; /* Ocupa toda la altura */
    text-align: center;
    position: relative; /* Asegura que esté por encima del fondo */
    z-index: 1;
}

.main-title {
    font-size: 3.5em; /* Un poco más grande */
    margin-bottom: 30px;
    color: white;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
}

#openModalBtn {
    padding: 15px 30px;
    font-size: 18px;
    cursor: pointer;
    background-color: #dc143c; /* Rojo que contraste con los tonos oscuros */
    color: white;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s ease; /* Transición suave al pasar el ratón */
}

#openModalBtn:hover {
    background-color: #8b0000; /* Rojo más oscuro al pasar el ratón */
}

/* El fondo del modal (la superposición oscura) */
.modal {
    display: none; /* Oculto por defecto */
    position: fixed; 
    z-index: 10; /* Asegura que el modal esté por encima de todo */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7); /* Fondo más oscuro para el modal */
    justify-content: center;
    align-items: center;
}

/* El contenido del modal (la caja blanca) */
.modal-content {
    background-color: #2c2c2c; /* Fondo gris oscuro para el modal */
    color: white; /* Texto blanco en el modal */
    margin: auto;
    padding: 30px; /* Un poco más de padding */
    border: 1px solid #444;
    width: 95%;
    max-width: 420px;
    transition: max-width 0.3s;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5); /* Sombra más pronunciada */
    overflow-y: auto;
    max-height: 90vh;
}

/* Personalizar scrollbar vertical en modal-content */
.modal-content::-webkit-scrollbar {
    width: 12px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(30, 30, 30, 0.5);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #dc143c 0%, #ff1744 50%, #dc143c 100%);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(220, 20, 60, 0.2);
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ff1744 0%, #ff5252 50%, #ff1744 100%);
    box-shadow: 0 0 15px rgba(220, 20, 60, 0.5);
}

/* Forzar que el modal no haga scroll horizontal global (lo hará la tabla-scroll) */
.modal-content {
    overflow-x: hidden; /* override de reglas previas */
}

.modal-content h2 {
    color: #dc143c; /* Título del formulario en rojo */
    margin-bottom: 20px;
}

/* El botón de cerrar (la 'x') */
.closeBtn {
    color: #bbb;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 32px;
    font-weight: bold;
}

.closeBtn:hover,
.closeBtn:focus {
    color: white;
    text-decoration: none;
    cursor: pointer;
}

/* Estilos para el formulario dentro del modal */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}
.form-group input[type="password"],
.form-group input[type="text"] {
    width: 95%;
    padding: 12px;
    border: 1px solid #555;
    border-radius: 6px;
    background-color: #3a3a3a;
    color: white;
}

.form-group input[type="text"]::placeholder,
.form-group input[type="password"]::placeholder {
    color: #aaa;
}

.form-group p {
    margin-bottom: 10px;
}

.form-group input[type="radio"] {
    margin-right: 8px;
}

/* Aviso de advertencia para Código Netflix */
.aviso-advertencia {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 152, 0, 0.1) 100%);
    border: 2px solid #ffc107;
    border-left: 5px solid #ffc107;
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 20px;
    color: #ffd700;
    font-size: 14px;
    line-height: 1.5;
    animation: slideInDown 0.3s ease;
}

.aviso-advertencia strong {
    color: #fff;
    font-weight: 600;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estilo general para CUALQUIER botón dentro del modal */
.modal-content .btn {
    background-color: #dc143c;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    text-decoration: none; /* Para que se vea bien si es un link */
    display: inline-block; /* Asegura el padding correcto */
    transition: background-color 0.3s ease;
}

.modal-content .btn:hover {
    background-color: #8b0000;
}

/* Estilos para el modal de resultados */
.result-modal {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 20px;
    background-color: #2c2c2c;
    color: white;
    border-radius: 5px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.result-modal .btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #dc143c;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 10px;
}

.result-modal .btn:hover {
    background-color: #8b0000;
}

#codigoResultado {
  text-align: center;

  font-size: 1.2em;

  /* Hace la letra un poco más gruesa para que resalte */
  font-weight: bold;

  /* Añade espacio vertical para que no se pegue a otros elementos */
  margin: 15px 0;

  /* Altura mínima para evitar que el formulario "salte" cuando aparece el texto */
  min-height: 20px; 
}

.spinner {
  border: 6px solid #f3f3f3;
  border-top: 6px solid #dc143c;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  animation: spin 1s linear infinite;
  display: inline-block;
  margin: auto;
}

@keyframes spin {
  0% { transform: rotate(0deg);}
  100% { transform: rotate(360deg);}
}


/* --- ESTILOS PARA LA TABLA DE RESULTADOS Y BOTONES --- */

/* 1. Integra la tabla con el fondo oscuro del modal */
.modal-content .tabla-cuenta {
    width: 100%;                  /* La tabla ocupa todo el ancho disponible */
    margin: 20px 0;               /* Espacio vertical arriba y abajo */
    background: transparent;          /* Sin fondo blanco, usa el del modal */
    border: 1px solid #444;       /* Un borde sutil que coincide con el modal */
    box-shadow: none;                 /* Quitamos la sombra que no se necesita */
    border-collapse: separate;        /* Permite usar border-radius */
    border-spacing: 0;
    margin-left: auto;
    margin-right: auto;
    min-width: 600px; /* O el ancho mínimo que prefieras */
    max-width: 100%;
    width: auto;
    display: table;
}

/* 2. Estilo para las celdas de la tabla */
.modal-content .tabla-cuenta th,
.modal-content .tabla-cuenta td {
    padding: 12px 15px;
    border-bottom: 1px solid #444; /* Borde más oscuro */
    text-align: left;                 /* Alinea el texto a la izquierda para mejor lectura */
    word-wrap: break-word;           /* Permite que el texto se envuelva en celular */
    overflow-wrap: break-word;       /* Alternativa más moderna */
}

/* 3. Estilo específico para la cabecera (Plataforma, Correo, etc.) */
.modal-content .tabla-cuenta th {
    background: #dc143c;              /* Mantenemos el fondo rojo */
    color: white;                     /* Texto blanco */
    font-weight: bold;
    width: 110px;                     /* Ancho fijo para la primera columna */
    white-space: nowrap;              /* Evita que los headers se envuelvan */
}

/* 4. Estilo específico para las celdas de datos */
.modal-content .tabla-cuenta td {
    color: #ddd;                      /* Un color de texto más suave que el blanco puro */
    font-weight: 500;
}

/* 5. Quita el borde de la última fila para un acabado limpio */
.modal-content .tabla-cuenta tr:last-child th,
.modal-content .tabla-cuenta tr:last-child td {
    border-bottom: none;
}

/* 6. Contenedor para los botones de Copiar */
#codigoResultado .btn {
    margin: 10px 5px 0 5px; /* Espacio alrededor de cada botón */
}

/* 7. Mensaje de "Copiado" */
.copiado-msg {
    margin-top: 15px;
    padding: 8px;
    background-color: #28a745; /* Verde de éxito */
    color: white;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 900px) {
    .modal-renovaciones .modal-content {
        max-width: 99vw;
        padding: 6px;
    }
    .modal-renovaciones .tabla-cuenta {
        min-width: 400px;
        font-size: 13px;
    }
}

/* --- Estilo para la etiqueta de Reposición --- */

.tag-reposición {
    background-color: #ff9800; /* el color de preferencia */
    color: #1e1e1e;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: bold;
    text-transform: uppercase;
}


/* --- Estilos para los diferentes estados de cuenta --- */

/* Estilo base para todos los estados */
.estado-tag {
    font-weight: bold;
    padding: 3px 7px;
    border-radius: 4px;
    color: white;
}

/* Verde para Funcionando */
.estado-funcionando {
    background-color: #28a745;
}

/* Rojo para vencidas */
.estado-vencida {
    background-color: #dc3545;
}

/* Rojo para En soporte */
.estado-en-soporte {
    background-color: #dc3545;
}

/* Morado para En cola */
.estado-en-cola {
    background-color: #6f42c1;
}

/* Resaltar fila completa en rojo para cuentas vencidas */
.fila-vencida {
    background-color: rgba(220, 53, 69, 0.15) !important;
}

.fila-vencida td {
    color: #fff !important;
    border-color: rgba(220, 53, 69, 0.3) !important;
}

/* Widget de soporte */
.widget-soporte {
    margin-top: 20px;
    margin-bottom: 16px;
    padding: 16px 18px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
}

.widget-soporte-sin-reportar {
    border-color: rgba(255, 193, 7, 0.4);
    background-color: rgba(255, 193, 7, 0.1);
}

.widget-soporte-reportada {
    border-color: rgba(40, 167, 69, 0.4);
    background-color: rgba(40, 167, 69, 0.1);
}

.soporte-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.soporte-label {
    font-weight: 600;
    color: #ccc;
    font-size: 14px;
}

.soporte-valor {
    color: #fff;
    font-size: 13px;
}

.btn-soporte {
    padding: 8px 16px;
    font-size: 13px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-soporte-sin-reportar {
    background-color: #ffc107;
    color: #000;
}

.btn-soporte-sin-reportar:hover {
    background-color: #ffb300;
    box-shadow: 0 2px 6px rgba(255, 193, 7, 0.3);
}

.btn-soporte-reportada {
    background-color: #28a745;
    color: #fff;
    cursor: default;
    opacity: 0.7;
}

.codigo-inicio-box {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #222;
    border: 2px solid #dc143c;
    border-radius: 8px;
    padding: 14px 18px;
    margin: 18px auto 0 auto;
    font-size: 1.25em;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(220,20,60,0.08);
    max-width: 340px;
}

.codigo-inicio-box span.codigo-inicio-valor {
    background: #fff;
    color: #dc143c;
    font-weight: bold;
    font-size: 1.3em;
    padding: 6px 18px;
    border-radius: 6px;
    margin: 0 12px;
    letter-spacing: 2px;
    box-shadow: 0 1px 4px rgba(220,20,60,0.08);
}

.btn-copiar {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 0 0 8px;
    display: flex;
    align-items: center;
    transition: transform 0.2s;
}

.btn-copiar svg {
    vertical-align: middle;
    transition: fill 0.2s;
}

.btn-copiar.copiado svg rect {
    fill: #28a745;
    stroke: #28a745;
}

.btn-copiar:active {
    transform: scale(1.1);
}

.btn-renov {
    background: #dc143c;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 7px 16px;
    cursor: pointer;
    font-size: 15px;
    margin: 0 2px;
    transition: background 0.2s;
}
.btn-renov:hover { background: #8b0000; }

.botones-principales {
    display: flex;
    gap: 18px;
    justify-content: center;
    margin-bottom: 10px;
}

.botones-principales button {
    padding: 15px 30px;
    font-size: 18px;
    cursor: pointer;
    background-color: #dc143c;
    color: white;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.botones-principales button:hover {
    background-color: #8b0000;
}

/* Modal de soporte: tamaño fijo y responsive */
.modal-content {
    max-width: 420px;
    width: 95vw;
    transition: max-width 0.3s;
}

/* Modal de renovaciones: normal por defecto, grande solo con resultados */
.modal-renovaciones .modal-content {
    max-width: 420px;
    width: 95vw;
    transition: max-width 0.3s;
}

.modal-renovaciones .modal-content.modal-grande {
    max-width: 1200px;
    width: 98vw;
}

/* Mejorar scrollbar en modales de renovaciones */
.modal-renovaciones .modal-content::-webkit-scrollbar {
    width: 12px;
}

.modal-renovaciones .modal-content::-webkit-scrollbar-track {
    background: rgba(30, 30, 30, 0.5);
}

.modal-renovaciones .modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #dc143c 0%, #ff1744 50%, #dc143c 100%);
    border-radius: 10px;
}

.modal-renovaciones .modal-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ff1744 0%, #ff5252 50%, #ff1744 100%);
    box-shadow: 0 0 12px rgba(220, 20, 60, 0.5);
}

/* Responsive para móviles */
@media (max-width: 700px) {
    .modal-content,
    .modal-renovaciones .modal-content,
    .modal-renovaciones .modal-content.modal-grande {
        max-width: 99vw;
        width: 99vw;
        padding: 6px;
    }
    .modal-renovaciones .tabla-cuenta {
        min-width: 400px;
        font-size: 13px;
    }
}

/* Solo para el formulario de renovaciones: ancho fijo y centrado */
#renovacionesModal .modal-content form {
    max-width: 340px;
    margin: 0 auto 18px auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#renovacionesModal .modal-content form .form-group {
    width: 100%;
}

#renovacionesModal .modal-content form input[type="password"] {
    width: 100%;
    box-sizing: border-box;
}

#renovacionesModal .modal-content form .btn {
    width: 100%;
    margin-top: 10px;
    align-self: center;
}

#tablaRenovaciones {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60px; /* Espacio mínimo para evitar saltos */
    width: 100%;
}


/* Botones renovación según acción */
.btn-renov-registrar {
    background:#28a745;
}
.btn-renov-registrar:hover {
    background:#1e7e34;
}
.btn-renov-cancelar {
    background:#dc143c;
}
.btn-renov-cancelar:hover {
    background:#8b0000;
}

/* Colores por proximidad de vencimiento (más notorios) */
.tr-venc-urgente {
    background: rgba(220,20,60,0.35);
    outline: 2px solid #dc143c;
}
.tr-venc-alerta {
    background: rgba(255,193,7,0.45);
    outline: 2px solid #ffc107;
}
.tr-venc-urgente td, .tr-venc-alerta td {
    transition: background .3s, outline .3s;
}


/* Stock */
#stockContainer {
    width: 100%;
    max-width: 720px;
    margin: 8px auto 0;
}
.stock-title {
    margin: 6px 0 4px;
    text-align: center;
    font-size: 1.4em;
    color: #fff;
}
.stock-disponible-table {
    width: 100%;
    border: 1px solid #444;
    border-collapse: collapse;
    background: rgba(0,0,0,0.25);
}
.stock-disponible-table th,
.stock-disponible-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #444;
    text-align: center;
    font-size: 14px;
}
.stock-disponible-table th {
    background: #dc143c;
    color: #fff;
}
.stock-disponible-table tr:last-child td {
    border-bottom: none;
}
.txt-agotado {
    color: #dc143c;
    font-weight: bold;
}
.fila-agotado {
    background: rgba(220,20,60,0.15);
}
.stock-error {
    background:#dc143c;
    color:#fff;
    padding:8px 12px;
    border-radius:6px;
    text-align:center;
    max-width:300px;
    margin:10px auto;
    font-weight:600;
}

/* Estilos para el toggle de contraseña */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.password-wrapper input {
    padding-right: 44px;
}
.toggle-pass {
    position: absolute;
    right: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s;
}
.toggle-pass:hover {
    transform: scale(1.08);
}
.toggle-pass.active svg circle {
    fill: #28a745;
}
.toggle-pass.active svg path {
    stroke: #28a745;
}

/* Wrapper scroll para tablas grandes (renovaciones y soporte) */
.tabla-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px;
    margin-bottom: 15px;
    border-radius: 8px;
    background: rgba(50, 50, 50, 0.3);
    transition: background 0.3s ease;
}

.tabla-scroll:hover {
    background: rgba(50, 50, 50, 0.5);
}

.tabla-scroll table {
    min-width: 760px; /* ancho mínimo para que no colapse en móvil */
}

/* Personalizar scrollbar dentro de tabla-scroll */
.tabla-scroll::-webkit-scrollbar {
    height: 12px;
}

.tabla-scroll::-webkit-scrollbar-track {
    background: rgba(30, 30, 30, 0.6);
    border-radius: 10px;
}

.tabla-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #dc143c 0%, #ff1744 50%, #dc143c 100%);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(220, 20, 60, 0.3);
}

.tabla-scroll::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #ff1744 0%, #ff5252 50%, #ff1744 100%);
    box-shadow: 0 0 15px rgba(220, 20, 60, 0.6);
}

/* Mejorar visualización en pantallas pequeñas */
@media (max-width: 768px) {
    .tabla-scroll {
        margin: 15px -15px 15px -15px; /* Extiende el scroll hasta los bordes */
        padding: 0 15px 12px 15px;
    }
    
    .tabla-scroll table {
        min-width: 500px;
    }
}

/* Cuando hay tabla, desactivar centrado rígido del spinner */
#tablaRenovaciones.has-table {
    display: block;
    align-items: initial;
    justify-content: initial;
    min-height: 0;
}

/* --- TOAST (avisos arriba derecha con barra regresiva) --- */
#toastContainer {
    position: fixed;
    top: 18px;
    right: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    min-width: 240px;
    max-width: 320px;
    background: linear-gradient(135deg,#2b2b2b,#1d1d1d);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    font-size: 14px;
    padding: 12px 16px 16px;
    border-radius: 10px;
    box-shadow: 0 6px 18px -4px rgba(0,0,0,0.55);
    position: relative;
    overflow: hidden;
    font-weight: 500;
    line-height: 1.3;
    opacity: 0;
    transform: translateY(-8px) scale(.96);
    animation: toastIn .35s ease forwards;
    pointer-events: auto;
}

.toast.success { border-color:#28a745; }
.toast.success .toast-progress { background: linear-gradient(90deg,#2ecc71,#27ae60); }
.toast.error { border-color:#dc143c; }
.toast.error .toast-progress { background: linear-gradient(90deg,#ff4d5d,#dc143c); }
.toast.info { border-color:#1e88e5; }
.toast.info .toast-progress { background: linear-gradient(90deg,#42a5f5,#1e88e5); }

.toast.hide {
    animation: toastOut .38s ease forwards;
}

.toast-close {
    position: absolute;
    top: 4px;
    right: 6px;
    background: transparent;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 4px;
    transition: color .2s;
}
.toast-close:hover { color:#fff; }

.toast-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 4px;
    width: 100%;
    transform-origin: right center;
    animation: toastBar var(--toast-duration,4s) linear forwards;
    filter: brightness(1.05);
}

@keyframes toastBar {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

@keyframes toastIn {
    to { opacity:1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
    to { opacity:0; transform: translateY(-10px) scale(.9); }
}

/* (opcional) vibración ligera para error */
.toast.error { animation: toastIn .35s ease forwards, toastPulse 2.2s ease 0.4s infinite; }
@keyframes toastPulse {
    0%,100% { box-shadow:0 6px 18px -4px rgba(0,0,0,0.55); }
    50% { box-shadow:0 6px 22px -2px rgba(220,20,60,0.35); }
}

.footer-brand {
    position: fixed;
    bottom: 10px;
    left: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #e2e2e2;
    background: rgba(0,0,0,0.35);
    padding: 6px 12px 6px 8px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    backdrop-filter: blur(6px);
    z-index: 120;
    box-shadow: 0 4px 14px -4px rgba(0,0,0,0.55);
}

.footer-brand:hover {
    background: rgba(0,0,0,0.5);
}

.footer-logo {
    height: 32px;
    width: auto;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

@media (max-width:600px){
    .footer-brand {
        font-size: 11px;
        padding: 5px 10px 5px 7px;
        gap: 6px;
    }
    .footer-logo {
        height: 26px;
    }
}

.botones-principales a.btn-comprar {
    padding: 15px 30px;
    font-size: 18px;
    cursor: pointer;
    background-color: #dc143c;
    color: #fff;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color .3s ease;
}
.botones-principales a.btn-comprar:hover {
    background-color: #8b0000;
}

/* Wrapper scroll para STOCK (similar a renovaciones) */
.stock-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
}
.stock-scroll table {
    min-width: 640px; /* fuerza scroll en pantallas angostas */
}

/* Botones responsive */
.botones-principales {
    flex-wrap: wrap;
}
.botones-principales button,
.botones-principales a.btn-comprar {
    flex: 1 1 auto;
    min-width: 140px;
}

/* Móvil: botones más compactos y ocupan toda la fila de 2 en 2 */
@media (max-width: 600px) {
    body {
        overflow-y: auto; /* permitir scroll en móvil */
    }
    .content {
        height: auto;
        padding-top: 40px;
        padding-bottom: 90px;
    }
    .main-title {
        font-size: 2.1em;
        margin-bottom: 18px;
    }
    .botones-principales {
        gap: 12px;
        justify-content: center;
    }
    .botones-principales button,
    .botones-principales a.btn-comprar {
        font-size: 16px;
        padding: 12px 18px;
        flex: 1 1 45%;
    }
}

/* Opcional: muy pantallas pequeñas */
@media (max-width: 400px) {
    .botones-principales button,
    .botones-principales a.btn-comprar {
        flex: 1 1 100%;
    }
}

/* Oculta el footer fijo cuando un modal está abierto */
.modal-open .footer-brand {
    display: none;
}

/* Footer dentro del modal (estilo adaptado) */
.footer-in-modal {
    position: static;
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #e2e2e2;
    background: rgba(0,0,0,0.25);
    padding: 6px 10px 6px 8px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
}
.footer-in-modal .footer-logo {
    height: 22px;
}




.radio-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.radio-chips .chip {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 999px;
    padding: 6px 10px;
    color: #ddd;
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all .2s;
}
.radio-chips .chip input {
    appearance: none;
    width: 10px; height: 10px;
    border-radius: 50%;
    border: 2px solid #dc143c;
    position: relative;
}
.radio-chips .chip input:checked {
    background: #dc143c;
}
.radio-chips .chip:hover {
    background: rgba(255,255,255,0.12);
}

/* Select y date bonitos */
.nice-select, .nice-date {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    background: #3a3a3a;
    color: #fff;
    border: 1px solid #555;
    outline: none;
}
.nice-select:focus, .nice-date:focus {
    border-color: #dc143c;
    box-shadow: 0 0 0 2px rgba(220,20,60,0.25);
}

/* Modal compras grande (igual renovaciones) */
.modal-renovaciones .modal-content.modal-grande {
    max-width: 1200px;
    width: 98vw;
}
@media (max-width: 900px) {
    .modal-renovaciones .tabla-cuenta { min-width: 400px; font-size: 13px; }
}

/* Barra de orden para compras */
.compras-toolbar {
  margin-top: 10px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

.th-sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.th-sortable .sort-indicator {
  font-size: 12px;
  margin-left: 6px;
  opacity: 0.8;
}

/* Formulario centrado y con ancho fijo en COMPRAS (igual a Renovaciones) */
#comprasModal .modal-content form {
    max-width: 340px;
    margin: 0 auto 18px auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
#comprasModal .modal-content form .form-group {
    width: 100%;
}
/* Inputs 100% y sin “crecer” al agrandar el modal */
#comprasModal .modal-content form input[type="password"],
#comprasModal .modal-content form input[type="text"],
#comprasModal .modal-content form input[type="date"],
#comprasModal .modal-content form select {
    width: 100%;
    box-sizing: border-box;
}

/* Contenedor de resultados de COMPRAS: centrado y con scroll cuando hay tabla */
#tablaCompras {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60px;
    width: 100%;
}
#tablaCompras.has-table {
    display: block;
    align-items: initial;
    justify-content: initial;
    min-height: 0;
}


.stock-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 10px 0 8px;
}
.btn-refresh-stock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.06);
  color: #fff;
  cursor: pointer;
  transition: background .2s, transform .1s, border-color .2s;
}
.btn-refresh-stock:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.35);
}
.btn-refresh-stock:disabled {
  opacity: .6;
  cursor: default;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-refresh-stock.spinning { animation: spin .9s linear infinite; }



/* --- AYUDA / ACCORDION (Soporte) --- */
.ayuda-accordion {
  margin: 18px auto 6px;
  max-width: 640px;
  width:100%;
}
.ayuda-toggle {
  width:100%;
  background:linear-gradient(135deg,#3a3a3a,#2a2a2a);
  border:1px solid #444;
  color:#fff;
  padding:12px 16px;
  font-size:15px;
  font-weight:600;
  border-radius:8px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  transition:background .25s,border-color .25s;
}
.ayuda-toggle:hover { background:#454545; }
.ayuda-toggle .chevron {
  font-size:14px;
  transition:transform .3s;
}
.ayuda-toggle.open .chevron { transform:rotate(180deg); }

.ayuda-panel {
  max-height:0;
  overflow:hidden;
  transition:max-height .35s ease;
}
.ayuda-panel.open { max-height:420px; }

.ayuda-opciones {
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin:14px 2px 4px;
}
.ayuda-btn {
  background:#dc143c;
  border:1px solid #dc143c;
  color:#fff;
  padding:8px 14px;
  border-radius:6px;
  cursor:pointer;
  font-size:14px;
  font-weight:600;
  transition:background .25s,transform .1s;
}
.ayuda-btn:hover { background:#8b0000; }
.ayuda-btn[disabled] {
  opacity:.35;
  cursor:not-allowed;
  background:#555;
  border-color:#666;
}

.vincular-form {
  margin-top:10px;
  background:rgba(255,255,255,0.04);
  border:1px solid #444;
  padding:14px 16px 18px;
  border-radius:10px;
  position:relative;
}
.vincular-form label {
  font-weight:600;
  display:block;
  margin-bottom:6px;
  font-size:14px;
}
.codigo-input-wrap {
  display:flex;
  gap:10px;
  align-items:center;
  margin-bottom:8px;
}
#codigoTv {
  flex:1;
  background:#2f2f2f;
  border:1px solid #555;
  border-radius:6px;
  padding:10px 14px;
  color:#fff;
  font-size:16px;
  letter-spacing:2px;
  font-weight:600;
  text-align:center;
}
#codigoTv:focus {
  outline:none;
  border-color:#dc143c;
  box-shadow:0 0 0 2px rgba(220,20,60,.25);
}
.vincular-btn {
  min-width:120px;
  background:#1e88e5 !important;
  border:none;
  opacity:.55;
  cursor:not-allowed;
}
.vincular-btn.activa {
  opacity:1;
  cursor:pointer;
}
.vincular-btn.activa:hover { background:#1565c0 !important; }
.mini-hint {
  font-size:11.5px;
  opacity:.75;
  margin-bottom:4px;
  text-align:left;
}
.vincular-resultado {
  margin-top:10px;
  font-size:14px;
  font-weight:600;
  text-align:center;
}
.vincular-resultado.ok {
  color:#28a745;
}
.vincular-resultado.err {
  color:#dc3545;
}


/* Opcional: estilo específico para límite (reusa vincular-form) */
.limite-form { background:rgba(0,0,0,0.35); }
.limite-form .btn { background:#ff9800; }
.limite-form .btn:hover { background:#e57f00; }

/* Aviso soporte cuando no es plataforma Netflix */
.soporte-aviso {
  margin:18px auto 8px;
  max-width:640px;
  padding:12px 16px;
  background:rgba(255,255,255,0.07);
  border:1px solid #444;
  border-radius:8px;
  font-size:14px;
  font-weight:600;
  text-align:center;
  color:#ddd;
  backdrop-filter:blur(2px);
}


