/* --- Configuración General del Sistema --- */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #0b0f19;
    color: #f8fafc;
}

/* --- Contenedor Dominante (Gradiente Premium de Cyber-Seguridad) --- */
.dominante {
    min-height: 100vh;
    width: 100%;
    background: radial-gradient(circle at 50% 0%, #1e2640 0%, #0b0f19 75%);
    display: block;
    transition: background-color 0.3s ease;
}

/* --- Barra de Navegación Estilo Dashboard Moderno --- */
.barra {
    background-color: rgba(11, 15, 25, 0.65);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.boto {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

/* Botones Interactivos del Menú (Acentos Inteligentes) */
.papy {
    background: rgba(255, 255, 255, 0.03);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.3px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.papy:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
    color: #60a5fa;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

/* Botón Cerrar Sesión Destacado */
.logout-btn {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    color: #ffffff;
    border: none;
    padding: 10px 22px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    margin-left: auto;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
    transition: all 0.2s ease;
}

.logout-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
    filter: brightness(1.1);
}

/* --- Área de las Vistas --- */
.vistas {
    padding: 50px 24px;
    transition: background-color 0.3s ease;
}

/* --- Tarjeta de Cristal Líquido (Main Card Modificada a Dark Premium) --- */
.main-card {
    background: rgba(22, 30, 49, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 45px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    max-width: 1050px;
    margin: 0 auto;
    color: #f1f5f9;
}

/* Tipografía y Títulos de la Marca */
.brand-header {
    text-align: center;
    margin-bottom: 30px;
}

.brand-header h1 {
    font-size: 3rem;
    background: linear-gradient(135deg, #ffffff 30%, #93c5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0 0 10px 0;
    font-weight: 800;
    letter-spacing: -1px;
}

.subtitle {
    font-size: 1.15rem;
    color: #94a3b8;
    margin: 0;
    font-weight: 400;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Caja de Estado Metrificada */
.stats-box {
    display: flex;
    justify-content: center;
    margin: 25px 0;
}

.stats-box span {
    background-color: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.25);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.05);
}

.divider {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1) 50%, transparent);
    margin: 40px 0;
}

.main-card h2 {
    font-size: 1.5rem;
    color: #38bdf8; /* Azul cyan tecnológico */
    margin-bottom: 14px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.intro-text {
    color: #cbd5e1;
    line-height: 1.7;
    margin-bottom: 30px;
    font-size: 1.05rem;
}

.intro-text u {
    text-decoration: none;
    border-bottom: 1px dashed #38bdf8;
    color: #e2e8f0;
}

/* --- Grid del CRUD Estilo Módulos Cyberpunk --- */
.crud-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.crud-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 24px;
    text-align: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.crud-card:hover {
    transform: translateY(-5px);
    background: rgba(30, 41, 59, 0.8);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

/* Efectos de Iluminación de los Módulos Operacionales */
.crud-card:has(.create):hover { border-color: rgba(16, 185, 129, 0.4); box-shadow: 0 0 20px rgba(16, 185, 129, 0.1); }
.crud-card:has(.read):hover { border-color: rgba(59, 130, 246, 0.4); box-shadow: 0 0 20px rgba(59, 130, 246, 0.1); }
.crud-card:has(.update):hover { border-color: rgba(245, 158, 11, 0.4); box-shadow: 0 0 20px rgba(245, 158, 11, 0.1); }
.crud-card:has(.delete):hover { border-color: rgba(239, 68, 68, 0.4); box-shadow: 0 0 20px rgba(239, 68, 68, 0.1); }

.icon-placeholder {
    width: 52px;
    height: 52px;
    line-height: 52px;
    border-radius: 12px;
    font-size: 1.4rem;
    margin: 0 auto 16px auto;
}

.icon-placeholder.create { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.icon-placeholder.read { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.icon-placeholder.update { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.icon-placeholder.delete { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.crud-card h3 {
    font-size: 1.15rem;
    color: #ffffff;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.crud-card p {
    font-size: 0.9rem;
    color: #94a3b8;
    line-height: 1.6;
    margin: 0;
}

/* --- Sistema de Luces de Semáforos Corporativos (Neon Glow) --- */
.semaphore-guide {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.semaphore-item {
    display: flex;
    align-items: center;
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 16px 20px;
    gap: 20px;
    transition: background 0.2s ease;
}

.semaphore-item:hover {
    background: rgba(30, 41, 59, 0.6);
}

.semaphore-item .light {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    flex-shrink: 0;
}

.semaphore-item .desc {
    font-size: 0.98rem;
    color: #cbd5e1;
    line-height: 1.5;
}

.semaphore-item .desc strong {
    color: #ffffff;
}

/* Filtros de Frecuencia de Brillo LED */
.status-green .light {
    background-color: #10b981;
    box-shadow: 0 0 14px #10b981, inset 0 2px 4px rgba(255,255,255,0.4);
}
.status-yellow .light {
    background-color: #f59e0b;
    box-shadow: 0 0 14px #f59e0b, inset 0 2px 4px rgba(255,255,255,0.4);
}
.status-red .light {
    background-color: #ef4444;
    box-shadow: 0 0 14px #ef4444, inset 0 2px 4px rgba(255,255,255,0.4);
}
.status-white .light {
    background-color: #ffffff;
    border: 1px solid #94a3b8;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}
/* --- Afinaciones de Contraste para el Modo Oscuro --- */
.main-card p, .intro-text {
    color: #94a3b8 !important; /* Gris claro para que la lectura sea ultra cómoda */
}

.intro-text strong, .desc strong {
    color: #ffffff !important; /* Resaltados importantes en blanco puro */
}

/* Estilo interactivo de neón para los 5 ejes analíticos */
.intro-text u {
    text-decoration: none;
    border-bottom: 1px dashed #38bdf8;
    color: #38bdf8;
    padding: 0 2px;
}

/* Separadores sutiles que no saturen la vista */
.divider {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1) 50%, transparent);
    margin: 35px 0;
}

/* ==========================================================================
   ESTILOS EXCLUSIVOS PARA LA INTERFAZ DE LOGIN (CON OJOS VECTORIALES SVG)
   ========================================================================== */

/* Fondo envolvente alineado con el ecosistema cibernético */
.login-body {
    background: radial-gradient(circle at 50% 30%, #1e2640 0%, #0b0f19 80%) !important;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

/* Tarjeta contenedora con efecto de cristal (Glassmorphism) */
.login-container {
    background: rgba(22, 30, 49, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 50px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    text-align: center;
}

/* Identidad corporativa de la parte superior */
.login-header h1 {
    font-size: 2.2rem;
    background: linear-gradient(135deg, #ffffff 40%, #93c5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0 0 6px 0;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.login-header p {
    color: #60a5fa !important;
    font-size: 0.88rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 35px 0;
}

.login-container h2 {
    font-size: 1.3rem;
    color: #ffffff;
    margin: 0 0 24px 0;
    font-weight: 600;
    text-align: left;
}

/* Espaciado de los campos de captura */
.input-group {
    margin-bottom: 18px;
    width: 100%;
}

/* Cajas de texto estilizadas e interactivas */
.input-field {
    width: 100%;
    box-sizing: border-box;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 14px 16px;
    color: #ffffff;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.25s ease;
}

.input-field:focus {
    outline: none;
    border-color: #3b82f6;
    background: rgba(15, 23, 42, 0.9);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Marcadores de posición claros */
.input-field::placeholder {
    color: #64748b;
}

/* Botón de ingreso premium con gradiente azul */
.login-button {
    width: 100%;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff;
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(59, 130, 246, 0.5);
    filter: brightness(1.1);
}

.login-button:active {
    transform: translateY(1px);
}

/* Contenedor relativo para posicionar el ojo SVG de forma absoluta */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* Espacio a la derecha para evitar que la contraseña tape al icono */
.password-wrapper .input-field {
    padding-right: 48px;
}

/* Botón interactivo para el SVG */
.toggle-password-btn {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    width: 20px;
    height: 20px;
    color: #64748b; /* Gris discreto por defecto */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, transform 0.15s ease;
}

/* El SVG interno hereda las propiedades del botón */
.toggle-password-btn svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Hover: Se ilumina en blanco brillante */
.toggle-password-btn:hover {
    color: #ffffff;
    transform: scale(1.1);
}

/* Estado activo: Cuando se está viendo la contraseña, se ilumina en azul celeste */
.toggle-password-btn.active {
    color: #38bdf8;
}


/* ==========================================================================
   MODAL DE ALERTA PERSONALIZADO (CIBERESTÉTICA)
   ========================================================================== */

/* Capa oscura translúcida de fondo */
.alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 7, 13, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Forzar visualización cuando se activa la clase .show */
.alert-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* Tarjeta del diálogo de alerta */
.alert-modal {
    background: #161e31;
    border: 1px solid rgba(239, 68, 68, 0.2); /* Sutil contorno rojizo de advertencia */
    border-radius: 16px;
    padding: 35px 30px;
    width: 90%;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

/* Animación de brinco al aparecer */
.alert-overlay.show .alert-modal {
    transform: scale(1);
}

/* Icono X de error superior */
.alert-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.alert-modal h3 {
    color: #ffffff;
    font-size: 1.25rem;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.alert-modal p {
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 25px 0;
}

/* Botón de confirmación alineado al color de cierre de sesión */
.alert-btn {
    background: #e15554;
    color: #ffffff;
    border: none;
    padding: 11px 32px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(225, 85, 84, 0.2);
    transition: all 0.2s ease;
}

.alert-btn:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 16px rgba(225, 85, 84, 0.4);
}

.alert-btn:active {
    transform: scale(0.98);
}


