/**
 * SALCFITECMA - Sistema de Administración del Laboratorio de Cómputo FITECMA
 * Sistema de Estilos Premium EXQUISITOS v3.0 (Full Width Header + Footer Completo)
 * Autor: Dr. Daniel Olegario León Ruiz
 * Fecha: 13 de Octubre de 2025
 * Cambios: Header full-width + estilos completos del footer + layout definitivo
 */

/* ========================================
   IMPORTAR FUENTE POPPINS
======================================== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* ========================================
   VARIABLES CSS - PALETA INSTITUCIONAL
======================================== */
:root {
  /* Colores Primarios */
  --primary: #1E3F8B;
  --primary-light: #4682B4;
  --primary-dark: #0F2557;
  
  /* Colores Secundarios */
  --gold: #C5A572;
  --yellow: #FFD700;
  
  /* Estados */
  --success: #228B22;
  --success-dark: #006B3F;
  --danger: #B22234;
  --danger-light: #FF0000;
  --warning: #FFA500;
  --info: #17A2B8;
  
  /* Neutros */
  --brown: #8B4513;
  --gray: #808080;
  --gray-light: #E5E5E5;
  --gray-dark: #333333;
  --white: #FFFFFF;
  --black: #000000;
  
  /* Gradientes Institucionales */
  --gradient-primary: linear-gradient(135deg, #0F2557 0%, #1E3F8B 50%, #4682B4 100%);
  --gradient-gold: linear-gradient(135deg, #8B4513 0%, #C5A572 50%, #FFD700 100%);
  --gradient-success: linear-gradient(135deg, #006B3F 0%, #228B22 50%, #32CD32 100%);
  
  /* NUEVO: Gradiente de fondo GRISES CLAROS SUTILES */
  --gradient-background: linear-gradient(135deg, #F5F5F5 0%, #E8E8E8 25%, #F0F0F0 50%, #FAFAFA 75%, #ECECEC 100%);
  
  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.25);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  --glass-glow: 0 0 20px rgba(70, 130, 180, 0.4);
  
  /* Sombras con PROFUNDIDAD */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15), 0 10px 10px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.25), 0 10px 20px rgba(0, 0, 0, 0.15);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
  
  /* Transiciones SUAVES */
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Espaciado */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  
  /* Bordes */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;
}

/* ========================================
   RESET Y BASE (CORREGIDO)
======================================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-weight: 400;
  line-height: 1.6;
  color: var(--gray-dark);
  background: var(--gradient-background);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Patrón de fondo decorativo SUTIL */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(200, 200, 200, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(180, 180, 180, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* ========================================
   TIPOGRAFÍA - 100% POPPINS
======================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', sans-serif !important;
  font-weight: 700;
  line-height: 1.2;
  color: var(--primary-dark);
  margin-bottom: var(--spacing-md);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h1 {
  font-size: 2.5rem;
  letter-spacing: -0.02em;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: 2rem;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.5rem;
}

h4 { 
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: var(--spacing-sm);
}

h5 { 
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: var(--spacing-sm);
}

h6 { 
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: var(--spacing-sm);
}

p, span, div, label, input, textarea, select, button, a {
  font-family: 'Poppins', sans-serif !important;
}

p {
  margin-bottom: var(--spacing-md);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition-fast);
  position: relative;
}

a:hover {
  color: var(--primary-light);
}

a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background: var(--gradient-primary);
  transition: var(--transition-normal);
}

a:hover::after {
  width: 100%;
}

/* ========================================
   CONTENEDOR PRINCIPAL
======================================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
  position: relative;
  z-index: 1;
}

.container-fluid {
  width: 100%;
  padding: 0 var(--spacing-lg);
  position: relative;
  z-index: 1;
}

/* ========================================
   GLASSMORPHISM EXQUISITO
======================================== */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: 
    var(--glass-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 0 40px rgba(70, 130, 180, 0.2);
  padding: var(--spacing-xl);
  transition: var(--transition-slow);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transition: var(--transition-slow);
}

.glass-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 
    0 25px 50px rgba(31, 38, 135, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 0 60px rgba(70, 130, 180, 0.4);
  border-color: rgba(255, 255, 255, 0.4);
}

.glass-card:hover::before {
  left: 100%;
}

.glass-card-white {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(30px) saturate(200%);
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-xl);
  box-shadow: 
    var(--shadow-xl),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  padding: var(--spacing-xl);
  transition: var(--transition-slow);
}

.glass-card-white:hover {
  transform: translateY(-6px);
  box-shadow: 
    var(--shadow-2xl),
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 0 50px rgba(255, 255, 255, 0.3);
}

/* ========================================
   BOTONES EXQUISITOS CON EFECTOS 3D
======================================== */
.btn {
  font-family: 'Poppins', sans-serif !important;
  font-weight: 700;
  padding: 0.875rem 2rem;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: var(--transition-normal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.875rem;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--white);
  box-shadow: 
    0 10px 20px rgba(30, 63, 139, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 
    0 15px 30px rgba(30, 63, 139, 0.6),
    0 0 30px rgba(70, 130, 180, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-primary:active {
  transform: translateY(-2px) scale(1.02);
}

.btn-secondary {
  background: var(--gradient-gold);
  color: var(--white);
  box-shadow: 
    0 10px 20px rgba(197, 165, 114, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 
    0 15px 30px rgba(197, 165, 114, 0.6),
    0 0 30px rgba(255, 215, 0, 0.5);
}

.btn-success {
  background: var(--gradient-success);
  color: var(--white);
  box-shadow: 
    0 10px 20px rgba(34, 139, 34, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-success:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 
    0 15px 30px rgba(34, 139, 34, 0.6),
    0 0 30px rgba(34, 139, 34, 0.5);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, var(--danger-light) 100%);
  color: var(--white);
  box-shadow: 
    0 10px 20px rgba(178, 34, 52, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-danger:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 
    0 15px 30px rgba(178, 34, 52, 0.6),
    0 0 30px rgba(255, 0, 0, 0.5);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  color: var(--primary);
  border: 2px solid var(--primary);
  box-shadow: inset 0 0 0 rgba(30, 63, 139, 0);
  transition: var(--transition-normal);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
  box-shadow: 
    inset 0 0 20px rgba(30, 63, 139, 0.5),
    0 0 30px rgba(70, 130, 180, 0.6);
  transform: translateY(-4px) scale(1.05);
}

.btn-sm {
  padding: 0.625rem 1.25rem;
  font-size: 0.75rem;
}

.btn-lg {
  padding: 1.125rem 2.5rem;
  font-size: 1rem;
}

/* ========================================
   FORMULARIOS EXQUISITOS
======================================== */
.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-label {
  font-family: 'Poppins', sans-serif !important;
  font-weight: 700;
  color: var(--primary-dark);
  display: block;
  margin-bottom: var(--spacing-sm);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.form-control {
  font-family: 'Poppins', sans-serif !important;
  width: 100%;
  padding: 0.875rem 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-lg);
  font-size: 1rem;
  
  /* FIX: Se quita 'transform' y 'backdrop-filter' de la animación */
  transition: border-color var(--transition-normal), background var(--transition-normal), box-shadow var(--transition-normal);
  
  /* FIX: Se quita 'backdrop-filter' y se hace el fondo opaco */
  background: #FFFFFF; 
  /* backdrop-filter: blur(10px); <-- ELIMINADO */
  
  box-shadow: 
    var(--shadow-sm),
    inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  
  /* FIX: Fondo opaco también en focus */
  background: #FFFFFF; 
  
  /* FIX: Sombra simplificada y sin 'transform' */
  box-shadow: 
    0 0 0 4px rgba(30, 63, 139, 0.15),
    inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.form-control::placeholder {
  color: var(--gray);
  opacity: 0.6;
  font-style: italic;
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%231E3F8B' d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.25rem center;
  padding-right: 3rem;
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

/* ========================================
   TABLAS EXQUISITAS
======================================== */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.table thead {
  background: var(--gradient-primary);
  color: var(--white);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.table thead th {
  font-family: 'Poppins', sans-serif !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.875rem;
  padding: 1.25rem 1.5rem;
  text-align: left;
  border: none;
}

.table tbody td {
  font-family: 'Poppins', sans-serif !important;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: var(--transition-fast);
}

.table tbody tr {
  transition: var(--transition-normal);
}

.table tbody tr:hover {
  background: rgba(30, 63, 139, 0.08);
  transform: scale(1.01);
  box-shadow: 0 4px 12px rgba(30, 63, 139, 0.15);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* ========================================
   BADGES EXQUISITAS
======================================== */
.badge {
  font-family: 'Poppins', sans-serif !important;
  font-weight: 700;
  display: inline-block;
  padding: 0.375rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: var(--transition-normal);
  cursor: default;
}

.badge:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.badge-primary {
  background: var(--gradient-primary);
  color: var(--white);
}

.badge-success {
  background: var(--gradient-success);
  color: var(--white);
}

.badge-danger {
  background: linear-gradient(135deg, var(--danger) 0%, var(--danger-light) 100%);
  color: var(--white);
}

.badge-warning {
  background: linear-gradient(135deg, #FF8C00 0%, var(--warning) 100%);
  color: var(--white);
}

.badge-info {
  background: linear-gradient(135deg, #117A8B 0%, var(--info) 100%);
  color: var(--white);
}

/* ========================================
   ALERTAS EXQUISITAS
======================================== */
.alert {
  padding: 1.25rem 1.75rem;
  border-radius: var(--radius-lg);
  margin-bottom: var(--spacing-lg);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  border-left: 5px solid;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-lg);
  transition: var(--transition-normal);
  animation: slideInLeft 0.5s ease;
}

.alert:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-xl);
}

.alert-success {
  background: rgba(34, 139, 34, 0.12);
  border-color: var(--success);
  color: var(--success-dark);
}

.alert-danger {
  background: rgba(178, 34, 52, 0.12);
  border-color: var(--danger);
  color: var(--danger);
}

.alert-warning {
  background: rgba(255, 165, 0, 0.12);
  border-color: var(--warning);
  color: #CC8400;
}

.alert-info {
  background: rgba(23, 162, 184, 0.12);
  border-color: var(--info);
  color: #117A8B;
}

/* ========================================
   MODALES EXQUISITOS
======================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.4s ease;
}

.modal {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  box-shadow: 
    var(--shadow-2xl),
    0 0 60px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.4s ease;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.modal-header {
  padding: var(--spacing-xl);
  border-bottom: 2px solid rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--gradient-primary);
  color: var(--white);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-title {
  font-family: 'Poppins', sans-serif !important;
  font-size: 1.5rem;
  color: var(--white);
  margin: 0;
}

.modal-body {
  padding: var(--spacing-xl);
}

.modal-footer {
  padding: var(--spacing-xl);
  border-top: 2px solid rgba(0, 0, 0, 0.08);
  display: flex;
  gap: var(--spacing-md);
  justify-content: flex-end;
}

/* ========================================
   UTILIDADES
======================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--gray); }
.bg-primary { background: var(--primary); }
.bg-success { background: var(--success); }
.bg-danger { background: var(--danger); }
.bg-white { background: var(--white); }
.d-flex { display: flex; }
.d-block { display: block; }
.d-none { display: none; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }
.p-sm { padding: var(--spacing-sm); }
.p-md { padding: var(--spacing-md); }
.p-lg { padding: var(--spacing-lg); }
.p-xl { padding: var(--spacing-xl); }

/* ========================================
   ANIMACIONES EXQUISITAS
======================================== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes gradientShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.animate-fade-in { animation: fadeIn 0.6s ease; }
.animate-slide-up { animation: slideUp 0.6s ease; }
.animate-slide-down { animation: slideDown 0.6s ease; }
.animate-float { animation: float 3s ease-in-out infinite; }

/* ========================================
   RESPONSIVE - MOBILE FIRST
======================================== */

/* Móviles pequeños - Portrait (hasta 480px) */
@media (max-width: 480px) {
  html { font-size: 13px; }
  body { padding: 0; }
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  .container, .container-fluid { padding: 0 var(--spacing-sm); }
  .btn { width: 100%; }
  .table { display: block; overflow-x: auto; }
  .table thead { display: none; }
  .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tbody tr { margin-bottom: var(--spacing-lg); border: 1px solid var(--gray-light); }
  .table tbody td { text-align: right; position: relative; padding-left: 50%; }
  .table tbody td::before { content: attr(data-label); position: absolute; left: 0; width: 45%; font-weight: 600; text-align: left; }
  .modal-footer { flex-direction: column; }
}

/* Móviles grandes y tablets pequeñas - Portrait (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
  html { font-size: 14px; }
  h1 { font-size: 2rem; }
}

/* Tablets y Desktop pequeño (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  html { font-size: 15px; }
}

/* Preferencias de movimiento reducido (accesibilidad) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Alto contraste (accesibilidad) */
@media (prefers-contrast: high) {
  :root {
    --primary: #0A1E4A;
    --primary-light: #2B5A9E;
    --gray-light: #CCCCCC;
  }
  .btn { border: 2px solid currentColor; }
}

/* ========================================
   ESTRUCTURA PRINCIPAL (LAYOUT) - DEFINITIVA v3.0
======================================== */

/* El sidebar es un elemento fijo e independiente */
.sidebar-container {
  width: 280px;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  z-index: 999;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* HEADER FULL WIDTH - Ocupa todo el ancho de la pantalla */
.header-container.header-full-width {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 998;
  padding: 1rem 2rem;
  margin-left: 0;
}

/* Estilos específicos del header (Glassmorphism) */
.header-glass {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 1.5rem;
  box-shadow: var(--shadow-xl);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition-normal);
}

.header-logo-section { 
  display: flex; 
  align-items: center; 
  gap: 1.5rem; 
}

.header-logo-holder { 
  width: 60px; 
  height: 60px; 
}

.header-logo { 
  width: 100%; 
  height: 100%; 
  object-fit: contain; 
}

.header-title { 
  font-size: 1.5rem; 
  margin: 0; 
}

.header-subtitle { 
  font-size: 0.75rem; 
  color: var(--gray); 
  margin: 0; 
}

.header-user-section { 
  display: flex; 
  align-items: center; 
  gap: 1rem; 
  position: relative; 
}

.header-avatar-holder { 
  width: 60px; 
  height: 60px; 
  border-radius: 50%; 
  cursor: pointer; 
  transition: var(--transition-normal);
}

.header-avatar-holder:hover {
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(30, 63, 139, 0.4);
}

.header-avatar { 
  width: 100%; 
  height: 100%; 
  border-radius: 50%; 
  object-fit: cover; 
}

.header-user-info { 
  display: flex; 
  flex-direction: column; 
  align-items: flex-end; 
}

.header-user-name { 
  font-weight: 700; 
  font-size: 1rem; 
  margin: 0; 
}

.header-user-role { 
  font-size: 0.75rem; 
  color: var(--gray); 
  margin: 0; 
}

.header-user-dropdown { 
  position: absolute; 
  top: 100%; 
  right: 0; 
  margin-top: 1rem; 
  background: rgba(255, 255, 255, 0.98); 
  backdrop-filter: blur(20px); 
  border-radius: 1rem; 
  box-shadow: var(--shadow-xl); 
  border: 1px solid rgba(255, 255, 255, 0.3); 
  min-width: 200px; 
  display: none; 
  animation: slideDown 0.3s ease; 
  z-index: 1100; 
}

.header-user-dropdown.active { 
  display: block; 
}

.header-dropdown-item { 
  display: flex; 
  align-items: center; 
  gap: 0.75rem; 
  padding: 1rem 1.25rem; 
  color: var(--primary-dark); 
  text-decoration: none; 
  transition: all 0.3s ease; 
}

.header-dropdown-item:hover { 
  background: rgba(30, 63, 139, 0.08); 
}

/* Contenedor para main y footer - CON margen del sidebar */
.content-wrapper {
  margin-left: 280px;
  transition: margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: calc(100% - 280px);
}

/* El main-content es el área principal y flexible */
.main-content {
  flex-grow: 1;
  padding: 1rem 2rem;
  box-sizing: border-box;
  width: 100%;
}

/* ========================================
   FOOTER EXQUISITO - ESTILOS COMPLETOS
======================================== */

/* Contenedor principal del footer */
.footer-container {
  width: 100%;
  padding: 2rem 2rem 1rem 2rem;
  margin-top: auto;
}

/* Glassmorphism del footer */
.footer-glass {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 1.5rem;
  box-shadow: var(--shadow-xl);
  padding: 2rem;
  transition: var(--transition-normal);
}

.footer-glass:hover {
  box-shadow: 
    var(--shadow-2xl),
    0 0 40px rgba(70, 130, 180, 0.3);
}

/* Grid del contenido del footer */
.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

/* Secciones individuales */
.footer-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-title {
  font-family: 'Poppins', sans-serif !important;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-text {
  font-family: 'Poppins', sans-serif !important;
  font-size: 0.875rem;
  color: var(--gray-dark);
  line-height: 1.6;
  margin: 0;
}

/* Enlaces del footer */
.footer-link {
  font-family: 'Poppins', sans-serif !important;
  font-size: 0.875rem;
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  width: fit-content;
}

.footer-link:hover {
  color: var(--primary-light);
  transform: translateX(4px);
}

.footer-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background: var(--gradient-primary);
  transition: var(--transition-normal);
}

.footer-link:hover::after {
  width: 100%;
}

/* Divisor decorativo */
.footer-divider {
  height: 2px;
  background: linear-gradient(
    to right, 
    transparent, 
    rgba(30, 63, 139, 0.3) 20%, 
    rgba(30, 63, 139, 0.3) 80%, 
    transparent
  );
  margin: 1rem 0;
}

/* Sección inferior del footer */
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-copyright {
  font-family: 'Poppins', sans-serif !important;
  font-size: 0.75rem;
  color: var(--gray);
  margin: 0.25rem 0;
}

/* Badges del footer */
.footer-badges {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.footer-version {
  font-family: 'Poppins', sans-serif !important;
  font-weight: 700;
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  background: var(--gradient-primary);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(30, 63, 139, 0.3);
  transition: var(--transition-normal);
}

.footer-version:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(30, 63, 139, 0.5);
}

/* ========================================
   RESPONSIVE LAYOUT
======================================== */
@media (max-width: 768px) {
  .sidebar-container {
    transform: translateX(-100%);
    z-index: 1001;
  }
  
  .sidebar-container.active {
    transform: translateX(0);
  }
  
  /* Header full width en móvil */
  .header-container.header-full-width {
    padding: 1rem;
  }
  
  .header-user-info {
    display: none;
  }
  
  .header-glass {
    padding: 1rem;
  }
  
  /* Content wrapper sin margen en móvil */
  .content-wrapper {
    margin-left: 0;
    width: 100%;
  }

  .header-container,
  .main-content,
  .footer-container {
    padding: 1rem;
  }
  
  /* Footer responsive */
  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-glass {
    padding: 1.5rem;
  }
}

/* Tablets */
@media (min-width: 769px) and (max-width: 1024px) {
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =========================================
   ESTILOS PARA ALERTAS DE NOTIFICACIÓN
   ========================================= */

.alert {
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 5px solid;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.5s ease-out;
}

.alert-success {
    background-color: #e9f7ef;
    border-color: #4caf50;
    color: #2e7d32;
}

.alert-danger {
    background-color: #fdecea;
    border-color: #f44336;
    color: #c62828;
}

.alert-info {
    background-color: #e3f2fd;
    border-color: #2196f3;
    color: #1565c0;
}

.alert i {
    font-size: 1.2rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   ESTILOS PARA MATRIZ DE PERMISOS
   ========================================= */

.permission-module-group {
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    background-color: #f8f9fa;
}

.permission-module-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-top: 0;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-light);
}

.permission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.permission-item .checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: background-color 0.2s ease-in-out;
}

.permission-item .checkbox-label:hover {
    background-color: #e9ecef;
}

/* ========================================
   FIX: ELIMINAR OUTLINE DE FOCO EN BOTONES
======================================== */
.btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(70, 130, 180, 0.4); /* Efecto de "glow" sutil al enfocar */
}