/* 
 * EPIS — Escuela Profesional de Ingeniería de Sistemas
 * Estilos Principales Rediseñados (Outfit & Inter + Glassmorphism Premium)
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --fuente-principal: 'Inter', sans-serif;
    --fuente-titulos: 'Outfit', sans-serif;
    
    /* Paleta de Colores Moderna - Modo Claro */
    --color-primario: #4f46e5; /* Indigo Premium */
    --color-primario-rgb: 79, 70, 229;
    --color-primario-oscuro: #4338ca;
    --color-secundario: #10b981; /* Emerald Green */
    --color-secundario-rgb: 16, 185, 129;
    --color-acento: #f59e0b; /* Amber */
    --color-fondo: #f8fafc; /* Slate Light */
    --color-superficie: #ffffff;
    
    --color-texto-primario: #0f172a; /* Slate 900 */
    --color-texto-secundario: #475569; /* Slate 600 */
    --color-texto-terciario: #94a3b8; /* Slate 400 */
    --color-borde: #e2e8f0; /* Slate 200 */
    
    /* Sidebar Tipo Isla (Flotante) */
    --sidebar-ancho: 280px;
    --sidebar-bg: #0f172a;
    --sidebar-texto: #94a3b8;
    --sidebar-texto-activo: #ffffff;
    --sidebar-bg-activo: rgba(79, 70, 229, 0.15);
    --sidebar-borde-activo: #4f46e5;
    
    /* Navbar */
    --navbar-alto: 75px;
    --navbar-bg: rgba(255, 255, 255, 0.8);
    
    /* Sombras y Bordes */
    --sombra-sutil: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -2px rgba(0, 0, 0, 0.02);
    --sombra-premium: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    --sombra-card-hover: 0 20px 25px -5px rgba(79, 70, 229, 0.12), 0 10px 10px -5px rgba(79, 70, 229, 0.04);
    --sombra-glow-primario: 0 0 25px rgba(79, 70, 229, 0.25);
    --radio-borde: 16px;
    --radio-borde-lg: 24px;
}

body {
    font-family: var(--fuente-principal);
    background-color: var(--color-fondo);
    color: var(--color-texto-primario);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6, .page-titulo {
    font-family: var(--fuente-titulos);
    font-weight: 700;
}

/* ─── Estructura Principal del Layout ──────────────────────────────── */

#contenedor-aplicacion {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

#contenido-principal {
    flex-grow: 1;
    margin-left: var(--sidebar-ancho);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cuerpo-pagina {
    padding: 2.25rem;
    flex-grow: 1;
}

/* ─── Sidebar Flotante Isla ────────────────────────────────────────── */

.barra-lateral {
    width: calc(var(--sidebar-ancho) - 20px);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-texto);
    position: fixed;
    top: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 1030;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    border-radius: var(--radio-borde);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-encabezado {
    height: var(--navbar-alto);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #ffffff;
}

.sidebar-logo span {
    font-family: var(--fuente-titulos);
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    flex-grow: 1;
    padding: 1.5rem 1rem;
    overflow-y: auto;
    list-style: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sidebar-seccion {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #475569;
    padding: 0.75rem 0.5rem 0.25rem 0.5rem;
    margin-top: 0.5rem;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.8rem 1.1rem;
    color: var(--sidebar-texto);
    text-decoration: none;
    border-radius: var(--radio-borde);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.sidebar-item a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 0;
    width: 3.5px;
    background-color: var(--sidebar-borde-activo);
    border-radius: 0 4px 4px 0;
    transition: height 0.2s ease;
}

.sidebar-item a:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.03);
}

.sidebar-item.activo a {
    color: var(--sidebar-texto-activo);
    background-color: var(--sidebar-bg-activo);
    font-weight: 600;
}

.sidebar-item.activo a::before {
    height: 60%;
}

.sidebar-item a i {
    font-size: 1.25rem;
}

.sidebar-pie {
    padding: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: 0 0 var(--radio-borde) var(--radio-borde);
}

/* ─── Navbar Superior ────────────────────────────────────────────── */

.barra-navegacion {
    height: var(--navbar-alto);
    background-color: var(--navbar-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2.25rem;
    box-shadow: var(--sombra-sutil);
    border-bottom: 1px solid var(--color-borde);
    position: sticky;
    top: 0;
    z-index: 1020;
    backdrop-filter: blur(12px);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.navbar-toggle-btn {
    background: none;
    border: none;
    color: var(--color-texto-primario);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.navbar-toggle-btn:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.navbar-derecha {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* ─── Dropdowns & Badges ──────────────────────────────────────────── */

.nav-icon-btn {
    background: none;
    border: none;
    color: var(--color-texto-secundario);
    font-size: 1.35rem;
    position: relative;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-icon-btn:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--color-texto-primario);
    transform: scale(1.05);
}

.badge-notificaciones {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: #ef4444; /* Neon Red */
    border: 2px solid var(--color-superficie);
}

.dropdown-usuario-menu {
    border: 1px solid var(--color-borde);
    border-radius: var(--radio-borde);
    box-shadow: var(--sombra-premium);
    padding: 0.5rem;
    width: 250px;
    animation: scaleIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.dropdown-usuario-cabecera {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-borde);
    margin-bottom: 0.5rem;
}

.dropdown-usuario-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primario) 0%, #818cf8 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
}

/* ─── Tarjetas Premium (Glassmorphism sutil) ────────────────────────── */

.tarjeta-premium {
    background-color: var(--color-superficie);
    border: 1px solid var(--color-borde);
    border-radius: var(--radio-borde);
    box-shadow: var(--sombra-premium);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.tarjeta-premium:hover {
    transform: translateY(-4px);
    box-shadow: var(--sombra-card-hover);
}

.tarjeta-encabezado {
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid var(--color-borde);
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tarjeta-titulo {
    font-family: var(--fuente-titulos);
    font-weight: 700;
    font-size: 1.25rem;
    margin: 0;
    color: var(--color-texto-primario);
}

.tarjeta-cuerpo {
    padding: 1.75rem;
}

/* Tarjetas de Estadísticas */
.tarjeta-estado-wrapper {
    position: relative;
    overflow: hidden;
}

.tarjeta-estado-linea-decorativa {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 5px;
}

/* ─── Botones e Inputs Premium ─────────────────────────────────────── */

.btn {
    border-radius: 10px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    font-size: 0.88rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primario {
    background: linear-gradient(135deg, var(--color-primario) 0%, #6366f1 100%);
    border: none;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
}

.btn-primario:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.35);
    color: #ffffff;
}

.btn-outline-success {
    border-color: var(--color-secundario);
    color: var(--color-secundario);
}

.btn-outline-success:hover {
    background-color: var(--color-secundario);
    border-color: var(--color-secundario);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.form-control, .form-select {
    border-radius: 10px;
    padding: 0.65rem 1rem;
    border: 1px solid var(--color-borde);
    font-size: 0.9rem;
    background-color: var(--color-superficie);
    color: var(--color-texto-primario);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--color-primario);
    box-shadow: var(--sombra-glow-primario);
    background-color: var(--color-superficie);
    color: var(--color-texto-primario);
}

/* ─── Tablas Personalizadas (DataTables) ────────────────────────────── */

.dataTables_wrapper {
    padding: 0;
}

.table-custom {
    width: 100% !important;
    border-collapse: separate;
    border-spacing: 0 6px;
    margin-top: 1rem !important;
}

.table-custom th {
    background-color: rgba(var(--color-primario-rgb), 0.05);
    color: var(--color-texto-secundario);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 1.1rem 1.25rem;
    border: none;
    border-radius: 8px;
}

.table-custom td {
    padding: 1.1rem 1.25rem;
    background-color: var(--color-superficie);
    border-top: 1px solid var(--color-borde);
    border-bottom: 1px solid var(--color-borde);
    font-size: 0.88rem;
    color: var(--color-texto-primario);
    vertical-align: middle;
    transition: background-color 0.2s;
}

.table-custom td:first-child {
    border-left: 1px solid var(--color-borde);
    border-radius: 12px 0 0 12px;
}

.table-custom td:last-child {
    border-right: 1px solid var(--color-borde);
    border-radius: 0 12px 12px 0;
}

.table-custom tr:hover td {
    background-color: rgba(var(--color-primario-rgb), 0.02) !important;
}

/* Paginar DataTable en español */
.page-link {
    border-radius: 8px;
    margin: 0 3px;
    font-weight: 600;
    border: 1px solid var(--color-borde);
    color: var(--color-texto-secundario);
    transition: all 0.2s;
}

.page-item.active .page-link {
    background-color: var(--color-primario);
    border-color: var(--color-primario);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
}

/* ─── Pie de Página (Footer) ──────────────────────────────────────── */

.pie-pagina {
    background-color: var(--color-superficie);
    border-top: 1px solid var(--color-borde);
    padding: 1.5rem 2.25rem;
    text-align: center;
    color: var(--color-texto-terciario);
    font-size: 0.85rem;
    margin-top: auto;
}
