:root {
  /* Paleta moderna 2025 – modo claro */
  --primary: #4f46e5;
  --primary-light: #818cf8;
  --primary-dark: #4338ca;
  --secondary: #f9fafb;
  --accent: #f97316;
  --text: #111827;
  --text-light: #6b7280;
  --bg: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f3f4f6;
  --border: #e5e7eb;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 6px 16px rgba(0, 0, 0, 0.06);
  --radius: 16px;
  --transition: all 0.25s ease;
}

/* 🎯 TEMA 1: CYBERPUNK NEÓN */
.theme-neon-cyber {
  --primary: #00f5ff;
  --primary-light: #7df9ff;
  --primary-dark: #0096ff;
  --secondary: #0a0a0a;
  --accent: #ff0080;
  --text: #ffffff;
  --text-light: #b0b0b0;
  --bg: #000000;
  --bg-card: #111111;
  --bg-hover: #1a1a1a;
  --border: #333333;
  --gradient: linear-gradient(135deg, #00f5ff 0%, #ff0080 50%, #bf00ff 100%);
  --card-shadow: 0 8px 32px rgba(0, 245, 255, 0.3);
}

/* 🎯 TEMA 2: GLASS MORPHISM */
.theme-glass-morph {
  --primary: #3b82f6;
  --primary-light: #60a5fa;
  --primary-dark: #2563eb;
  --secondary: rgba(255, 255, 255, 0.1);
  --accent: #f59e0b;
  --text: #1e293b;
  --text-light: #64748b;
  --bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --bg-card: rgba(255, 255, 255, 0.15);
  --bg-hover: rgba(255, 255, 255, 0.25);
  --border: rgba(255, 255, 255, 0.2);
  --gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(20px);
}

/* 🎯 TEMA 3: DARK MATTER */
.theme-dark-matter {
  --primary: #fbbf24;
  --primary-light: #fcd34d;
  --primary-dark: #f59e0b;
  --secondary: #000000;
  --accent: #10b981;
  --text: #f8fafc;
  --text-light: #94a3b8;
  --bg: #000000;
  --bg-card: #111827;
  --bg-hover: #1f2937;
  --border: #374151;
  --gradient: linear-gradient(135deg, #fbbf24 0%, #10b981 100%);
  --card-shadow: 0 8px 32px rgba(251, 191, 36, 0.2);
}

/* 🎯 TEMA 4: SUNSET VIBES */
.theme-sunset-vibes {
  --primary: #f97316;
  --primary-light: #fb923c;
  --primary-dark: #ea580c;
  --secondary: #1e293b;
  --accent: #ec4899;
  --text: #ffffff;
  --text-light: #cbd5e1;
  --bg: linear-gradient(135deg, #f97316 0%, #ec4899 50%, #8b5cf6 100%);
  --bg-card: rgba(255, 255, 255, 0.1);
  --bg-hover: rgba(255, 255, 255, 0.2);
  --border: rgba(255, 255, 255, 0.3);
  --gradient: linear-gradient(135deg, #f97316 0%, #ec4899 100%);
  --card-shadow: 0 8px 32px rgba(249, 115, 22, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.6;
  transition: var(--transition);
  padding-top: 70px;
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(255, 255, 255, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 85% 30%, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
}

h1, h2, h3, h4, h5, h6 {
  font-family: inherit;
  font-weight: 600;
  margin-bottom: 0.75rem;
}



.theme-oscuro .header,
.theme-melocoton .header,
.theme-rosa .header,
.theme-verde .header,
.theme-lavanda .header {
  background: rgba(var(--bg-card-rgb), 0.95);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
  height: 100%;
  gap: 1rem;
  min-width: 0; /* ✅ NUEVO: Permite que se comprima */

}

/* ✅ LOGO COMPACTO */
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 1; /* ✅ CAMBIADO: De 0 a 1 para permitir compresión */
  min-width: 120px; /* ✅ REDUCIDO: De 200px a 120px */
  padding-right: 1rem;}

.logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  display: none;
}

.logo-icon:not(img) {
  background: var(--gradient);
  display: flex !important;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 0.85rem;
  box-shadow: var(--shadow);
}

.logo-icon[src]:not([src=""]) {
  display: block !important;
}

.logo-icon[src]:not([src=""]) ~ .logo-icon:not(img) {
  display: none !important;
}

/* ✅ NAVEGACIÓN MEJORADA - SCROLL HORIZONTAL */
.main-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  justify-content: center;
  padding: 0 1rem;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  max-width: calc(100% - 300px);
  
  /* 🔥 SCROLL SUAVE AGREGADO */
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.main-nav::-webkit-scrollbar {
  display: none;
}

/* 🔥 INDICADOR VISUAL DE SCROLL (OPCIONAL) */
.main-nav::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(90deg, transparent, var(--bg-card));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.main-nav.scrollable::after {
  opacity: 1;
}




.nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem; /* ✅ AUMENTADO: Más espacio interno */
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-light);
  font-weight: 500;
  font-size: 0.9rem; /* ✅ AUMENTADO: Mejor legibilidad */
  transition: var(--transition);
  position: relative;
  background: transparent;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: max-content;}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--primary);
  transform: translateY(-1px);
}

.nav-item.active {
  color: var(--primary);
  background: var(--bg-hover);
  font-weight: 600;
  box-shadow: var(--shadow);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--gradient);
  border-radius: 2px;
}

/* ✅ ACCIONES DE HEADER OPTIMIZADAS */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem; /* ✅ REDUCIDO: De 1rem a 0.75rem */
  flex-shrink: 0;
  min-width: 180px; /* ✅ NUEVO: Ancho mínimo fijo */
  justify-content: flex-end;}

.user-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.user-menu:hover {
  background: var(--bg-hover);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 500;
  box-shadow: var(--shadow);
  flex-shrink: 0;
}

/* ✅ SELECTOR DE TEMAS COMPACTO */
.theme-selector {
  position: relative;
  margin-right: 0;
  flex-shrink: 0;
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--gradient);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: var(--transition);
  box-shadow: var(--shadow);
  flex-shrink: 0;
}

.theme-toggle:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.theme-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  z-index: 101;
  margin-top: 8px;
  backdrop-filter: blur(20px);
}

.theme-dropdown.show {
  display: block;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 0.8rem;
}

.theme-option:last-child {
  border-bottom: none;
}

.theme-option:hover {
  background: var(--bg-hover);
  transform: translateX(5px);
}

.theme-preview {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid var(--border);
  transition: var(--transition);
  flex-shrink: 0;
}

.theme-option:hover .theme-preview {
  transform: scale(1.1);
}

/* ✅ INTERRUPTOR MODO NOCHE COMPACTO */
.dark-mode-toggle {
  margin-right: 0;
  flex-shrink: 0;
}

.dark-mode-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--gradient);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  transition: var(--transition);
  box-shadow: var(--shadow);
  flex-shrink: 0;
}

.dark-mode-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Main Content */
.main-content {
  padding: 2.5rem;
  max-width: 1400px;
  margin: 0 auto;
  transition: var(--transition);
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.6rem;
  background: var(--gradient);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  box-shadow: var(--shadow);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2rem;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.card:hover {
  box-shadow: var(--card-shadow);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

/* Dashboard */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.75rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--card-shadow);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  margin: 0.4rem 0;
  line-height: 1.2;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  color: var(--text-light);
  font-size: 0.875rem;
  font-weight: 500;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  background: var(--gradient);
  color: white;
  box-shadow: var(--shadow);
}

/* Tables */
.table-container {
  overflow-x: auto;
  margin-bottom: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 1.1rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 600;
  color: var(--text-light);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-hover);
}

tbody tr {
  transition: var(--transition);
}

tbody tr:hover {
  background: var(--bg-hover);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow);
}

.status-active { 
  background: linear-gradient(135deg, #10b981, #34d399); 
  color: white; 
}
.status-pending { 
  background: linear-gradient(135deg, #f59e0b, #fbbf24); 
  color: white; 
}
.status-inactive { 
  background: linear-gradient(135deg, #6b7280, #9ca3af); 
  color: white; 
}

.action-buttons {
  display: flex;
  gap: 0.6rem;
}

.action-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-hover);
  color: var(--text);
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.action-btn:hover {
  background: var(--gradient);
  color: white;
  transform: scale(1.1);
  box-shadow: var(--shadow);
}

/* Forms */
.form-group {
  margin-bottom: 1.75rem;
}

.form-label {
  display: block;
  margin-bottom: 0.6rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.form-control {
  width: 100%;
  padding: 0.85rem 1.1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* Toast Notifications */
/* Toast reducidos - MÁS PEQUEÑOS Y MÁS RÁPIDOS */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 350px;
}

.toast {
    background: white;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid;
    animation: slideInRight 0.3s ease;
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateX(0);
    font-size: 13px;
    max-width: 320px;
    min-height: auto;
}

/* Toast TAMAÑO REDUCIDO */
.toast-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.toast-message {
    font-size: 12px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

/* Colores reducidos */
.toast-success {
    border-left-color: #10b981;
}

.toast-error {
    border-left-color: #ef4444;
}

.toast-warning {
    border-left-color: #f59e0b;
}

.toast-info {
    border-left-color: #3b82f6;
}

/* Animación más rápida */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Clase para ocultar - TIEMPO REDUCIDO */
.toast.hide {
    animation: fadeOut 0.2s ease forwards;
}

/* Modales */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
  backdrop-filter: blur(8px);
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 800px;
  width: 92%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
  border: 1px solid var(--border);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.75rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--gradient);
  color: white;
  border-radius: var(--radius) var(--radius) 0 0;
}

.modal-title {
  font-size: 1.375rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: white;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--bg-hover);
  transform: scale(1.1);
}

.modal-body {
  padding: 2rem;
  overflow-y: auto;
  max-height: 60vh;
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Iconos */
.icon-home::before { content: "🏠"; }
.icon-user-graduate::before { content: "🎓"; }
.icon-users::before { content: "👥"; }
.icon-money-bill::before { content: "💰"; }
.icon-chalkboard-teacher::before { content: "👨‍🏫"; }
.icon-tags::before { content: "🏷️"; }
.icon-cog::before { content: "⚙️"; }
.icon-palette::before { content: "🎨"; }
.icon-plus::before { content: "➕"; }
.icon-check-circle::before { content: "✅"; }
.icon-clock::before { content: "⏰"; }
.icon-exclamation-circle::before { content: "⚠️"; }
.icon-upload::before { content: "📤"; }
.icon-school::before { content: "🏫"; }
.icon-edit::before { content: "✏️"; }
.icon-trash::before { content: "🗑️"; }
.icon-print::before { content: "🖨️"; }
.icon-certificate::before { content: "🏆"; }  /* ← AÑADE ESTA LÍNEA AQUÍ */

/* ✅ RESPONSIVE MEJORADO SOLO PARA EL HEADER */
@media (max-width: 1200px) {
  .header-container {
    padding: 0 0.75rem;
  }
  
  .nav-item {
    padding: 0.5rem 0.6rem;
    font-size: 0.8rem;
    gap: 0.4rem;
  }
}



@media (max-width: 1024px) {
  .main-nav {
    gap: 0.25rem;
    max-width: calc(100% - 250px);
  }
  
  .nav-item {
    padding: 0.5rem 0.7rem;
    font-size: 0.82rem;
  }
  
  /* 🔥 OCULTAR TEXTO EN ITEMS - SOLO ICONOS */
  .nav-item span {
    display: none;
  }
  
  .nav-item::before {
    margin-right: 0;
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  .main-nav {
    max-width: calc(100% - 200px);
    gap: 0.1rem;
  }
  
  .logo {
    min-width: 80px;
  }
  
  .header-actions {
    min-width: 140px;
    gap: 0.25rem;
  }
  
  /* 🔥 OCULTAR ELEMENTOS NO ESENCIALES */
  .theme-toggle span,
  .user-name {
    display: none;
  }
  
  .main-content {
    padding: 1.5rem;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .page-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
  
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  
  .modal {
    width: 95%;
    max-width: 500px;
  }
}






@media (max-width: 480px) {
  .header-container {
    padding: 0 0.25rem;
  }
  
  .logo-text {
    font-size: 0.9rem;
  }
  
  .main-nav {
    justify-content: flex-start;
  }
  
  .nav-item {
    padding: 0.35rem 0.4rem;
    font-size: 0.7rem;
  }
  
  .header-actions {
    gap: 0.25rem;
  }
  
  .theme-toggle,
  .dark-mode-btn,
  .user-avatar {
    width: 32px;
    height: 32px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 360px) {
  .logo-text {
    display: none;
  }
  
  .logo-icon:not(img) {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
  }
  
  .nav-item span {
    display: none;
  }
  
  .nav-item {
    padding: 0.4rem;
    border-radius: 8px;
  }
}



/* ✅ PREVENIR DESBORDAMIENTO HORIZONTAL */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* Asegurar que inputs respeten el tema */
input,
select,
textarea {
  color: var(--text);
  background: var(--bg-card);
  border-color: var(--border);
}

/* ✅ TEMAS PASTEL */
.theme-azul-pastel {
  --primary: #93c5fd;
  --primary-light: #bfdbfe;
  --primary-dark: #60a5fa;
  --secondary: #f0f9ff;
  --accent: #fdba74;
  --text: #1e293b;
  --text-light: #64748b;
  --bg: #ffffff;
  --bg-card: #f8fafc;
  --bg-hover: #e2e8f0;
  --border: #cbd5e1;
  --gradient: linear-gradient(135deg, #93c5fd 0%, #bfdbfe 100%);
  --card-shadow: 0 8px 25px rgba(147, 197, 253, 0.15);
}

.theme-verde-pastel {
  --primary: #86efac;
  --primary-light: #bbf7d0;
  --primary-dark: #4ade80;
  --secondary: #f0fdf4;
  --accent: #fdba74;
  --text: #1e293b;
  --text-light: #64748b;
  --bg: #ffffff;
  --bg-card: #f8fafc;
  --bg-hover: #e2e8f0;
  --border: #cbd5e1;
  --gradient: linear-gradient(135deg, #86efac 0%, #bbf7d0 100%);
  --card-shadow: 0 8px 25px rgba(134, 239, 172, 0.15);
}

.theme-rosa-pastel {
  --primary: #f9a8d4;
  --primary-light: #fbcfe8;
  --primary-dark: #f472b6;
  --secondary: #fdf2f8;
  --accent: #fdba74;
  --text: #1e293b;
  --text-light: #64748b;
  --bg: #ffffff;
  --bg-card: #f8fafc;
  --bg-hover: #e2e8f0;
  --border: #cbd5e1;
  --gradient: linear-gradient(135deg, #f9a8d4 0%, #fbcfe8 100%);
  --card-shadow: 0 8px 25px rgba(249, 168, 212, 0.15);
}

.theme-lila-pastel {
  --primary: #d8b4fe;
  --primary-light: #e9d5ff;
  --primary-dark: #c084fc;
  --secondary: #faf5ff;
  --accent: #fdba74;
  --text: #1e293b;
  --text-light: #64748b;
  --bg: #ffffff;
  --bg-card: #f8fafc;
  --bg-hover: #e2e8f0;
  --border: #cbd5e1;
  --gradient: linear-gradient(135deg, #d8b4fe 0%, #e9d5ff 100%);
  --card-shadow: 0 8px 25px rgba(216, 180, 254, 0.15);
}

/* ✅ ESTILOS PARA LA GRILLA DE TEMAS EN CONFIGURACIÓN */
.themes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.theme-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-card);
}

.theme-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--card-shadow);
}

.theme-preview-card {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  border: 3px solid var(--border);
}

.theme-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.theme-card.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* ✅ TEMA NOCHE/NARANJA MODERNO */
.theme-noche-naranja {
  --primary: #ea580c;
  --primary-light: #fdba74;
  --primary-dark: #c2410c;
  --secondary: #1e293b;
  --accent: #fbbf24;
  --text: #f1f5f9;
  --text-light: #94a3b8;
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-hover: #334155;
  --border: #475569;
  --gradient: linear-gradient(135deg, #ea580c 0%, #fdba74 100%);
  --card-shadow: 0 8px 25px rgba(234, 88, 12, 0.2);
}

/* 🎯 TEMA CLARO MEJORADO - CON CONTRASTE */
.theme-claro {
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --primary-dark: #1d4ed8;
  --secondary: #f8fafc;
  --accent: #f59e0b;
  --text: #1e293b;
  --text-light: #64748b;
  --bg: #f1f5f9;
  --bg-card: #ffffff;
  --bg-hover: #e2e8f0;
  --border: #e2e8f0;
  --gradient: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --border-radius: 12px;
}

/* 🎯 ESTILOS PARA TARJETAS EN TEMA CLARO */
.theme-claro .card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(10px);
}

/* 🎯 MEJORAR VISIBILIDAD DE ICONOS EN TEMA CLARO */
.theme-claro .hi-outline {
  color: var(--text);
  opacity: 0.8;
}

.theme-claro .hi-outline:hover {
  opacity: 1;
  color: var(--primary);
}

/* En tu archivo CSS principal */
.page {
    display: none;
}

.page.active {
    display: block;
}
/* CSS temporal para admin */
#admin.page {
    display: block !important;
    width: 100% !important;
    margin-left: 0 !important;
    padding: 20px !important;
}

#admin .card {
    width: 100% !important;
    margin: 0 !important;
}

/* ✅ CORRECCIÓN DEFINITIVA - SUPERPOSICIÓN */
.header {
  z-index: 999 !important; /* 🔥 HEADER DEBE SER MENOR QUE DROPDOWNS */
}
.theme-dropdown,
.user-menu-dropdown {
  z-index: 1000; /* 🔥 DROPDOWNS MAYOR QUE HEADER */
}

.modal-overlay {
  z-index: 1001; /* 🔥 MODALES MAYOR QUE TODO */
}

.modal {
  z-index: 1002;
}
/* Para asegurar contraste en ambos temas */
.header .page-title,
.logo-container .page-title,
.branding .page-title {
    color: inherit !important;
    background: none !important;
    -webkit-text-fill-color: currentColor !important;
    text-shadow: 0 1px 0 rgba(0,0,0,0.1);
}
/* Estilo para el nombre del centro en el header */
.center-name {
    color: var(--text-primary, #1a1a1a) !important;
    background: none !important;
    -webkit-text-fill-color: initial !important;
    background-clip: initial !important;
}

/* ================================ */
/* ESTILOS PARA MENÚ DE CERTIFICADOS */
/* ================================ */

#certificadosMenu {
    position: absolute;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    padding: 8px;
    min-width: 200px;
    border: 1px solid var(--border);
    animation: menuFadeIn 0.2s ease;
}

@keyframes menuFadeIn {
    from { 
        opacity: 0; 
        transform: translateY(-10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.menu-header {
    padding: 8px 12px;
    color: var(--text-light);
    font-weight: 500;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    width: 100%;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text);
    border-radius: 8px;
    transition: var(--transition);
}

.menu-item:hover {
    background: var(--bg-hover);
    color: var(--text-accent);
}

.menu-item i {
    width: 18px;
    text-align: center;
    color: var(--accent);
    font-size: 0.875rem;
}

/* Cerrar menú al hacer clic fuera */
.menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    background: transparent;
}


/* =========================================== */
/* CORRECCIÓN PARA TEMA NOCHE-NARANJA - FORMULARIOS */
/* =========================================== */

.theme-noche-naranja select,
.theme-noche-naranja input[type="text"],
.theme-noche-naranja input[type="date"],
.theme-noche-naranja input[type="email"],
.theme-noche-naranja input[type="tel"],
.theme-noche-naranja input[type="password"],
.theme-noche-naranja textarea {
    color: #000000 !important;
    background-color: #ffffff !important;
    border: 1px solid #d1d5db !important;
}

/* Específico para dropdowns */
.theme-noche-naranja select option {
    color: #000000 !important;
    background-color: #ffffff !important;
}

/* Dropdown de maestros en ausencias - ESPECIAL */
.theme-noche-naranja #selectMaestroAsistencia {
    color: #000000 !important;
    background-color: #ffffff !important;
    border: 2px solid #10b981 !important;
    font-weight: 500 !important;
}

.theme-noche-naranja #selectMaestroAsistencia option {
    color: #000000 !important;
    background-color: #ffffff !important;
    padding: 8px !important;
}

/* Cuando el dropdown está abierto */
.theme-noche-naranja #selectMaestroAsistencia:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
}
/*****************************************************************
/* ====================== */
/* SUBMENÚ DE ASISTENCIA  */
/* ====================== */

.nav-item.with-submenu {
    position: relative;
}

.nav-item.with-submenu .nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
}

.nav-item.with-submenu .nav-link:hover {
    background: var(--bg-hover);
}

.submenu-arrow {
    margin-left: 8px;
    font-size: 12px;
    transition: transform 0.3s;
}

.nav-item.with-submenu.active .submenu-arrow {
    transform: rotate(180deg);
}

/* SUBMENÚ CONTENIDO */
.submenu {
    display: none !important; /* AÑADIR !important */
    position: absolute;
    left: 0;
    top: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    min-width: 220px;
    z-index: 1000;
    margin-top: 5px;
    /* AÑADIR estas 3 líneas: */
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

.submenu.show {
    display: block;
}

.submenu-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-light);
    transition: all 0.2s;
}

.submenu-item:last-child {
    border-bottom: none;
}

.submenu-item:hover {
    background: var(--bg-hover);
    padding-left: 20px;
}

.submenu-item i {
    margin-right: 10px;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.submenu-item.active {
    background: var(--primary-color);
    color: white;
}

.submenu-item.active i {
    color: white;
}

.submenu.show {
    display: block !important;
}


/* ============================================ */
/* ESTILOS PARA PÁGINA DE INFORMES DE ASISTENCIA */
/* ============================================ */
/*
:root {
    --primary: #4e73df;
    --success: #1cc88a;
    --warning: #f6c23e;
    --danger: #e74a3b;
    --info: #36b9cc;
    --orange: #ff9800;
} 

.bg-orange {
    background-color: var(--orange) !important;
}

/* Contenedor principal de informes */
.container-informe {
    background: linear-gradient(180deg, #f8f9fc 0%, #e3e6f0 100%);
    min-height: calc(100vh - 60px);
    font-family: 'Segoe UI', 'Roboto', sans-serif;
}

/* Tarjetas de informe */
.card-informe {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    margin-bottom: 1.5rem;
    transition: transform 0.3s;
}

.card-informe:hover {
    transform: translateY(-5px);
}

.card-header-informe {
    background: linear-gradient(135deg, var(--primary) 0%, #224abe 100%);
    color: white;
    border-radius: 1rem 1rem 0 0 !important;
    padding: 1.25rem 1.5rem;
    border-bottom: none;
}

/* Tarjetas de estadísticas */
.stat-card-informe {
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    color: white;
    margin-bottom: 1.5rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.stat-total { 
    background: linear-gradient(135deg, var(--primary) 0%, #224abe 100%); 
}
.stat-presente { 
    background: linear-gradient(135deg, var(--success) 0%, #13855c 100%); 
}
.stat-ausente { 
    background: linear-gradient(135deg, var(--danger) 0%, #be2617 100%); 
}
.stat-tarde { 
    background: linear-gradient(135deg, var(--warning) 0%, #dda20a 100%); 
}

/* Botones de informe */
.btn-informe {
    background: linear-gradient(135deg, var(--primary) 0%, #224abe 100%);
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-informe:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(78, 115, 223, 0.3);
    color: white;
}

/* Tablas de informe */
.table-informes {
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid #e3e6f0;
}

.table-informes thead {
    background: linear-gradient(135deg, var(--primary) 0%, #224abe 100%);
    color: white;
}

/* Badges de estado */
.badge-estado {
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.85rem;
}

.estado-excelente { background-color: var(--success); color: white; }
.estado-bueno { background-color: var(--info); color: white; }
.estado-regular { background-color: var(--warning); color: white; }
.estado-mejorable { background-color: var(--orange); color: white; }
.estado-critico { background-color: var(--danger); color: white; }

/* Loader */
.loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Progress bar delgada */
.progress-thin {
    height: 8px;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .card-informe {
        border-radius: 0.5rem;
    }
    
    .stat-card-informe {
        padding: 1rem;
    }
}

/* ============================================ */
/* HISTORIAL DE REGISTROS - ESTILO COHERENTE */
/* ============================================ */

/* Tarjeta de historial */
.card-historial {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-top: 2rem;
    transition: var(--transition);
}

.card-historial:hover {
    box-shadow: var(--card-shadow);
}

/* Cabecera de historial */
.card-historial-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-historial-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-historial-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 300;
    margin-top: 5px;
}

/* Tabla de historial moderna */
.tabla-historial {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
}

.tabla-historial thead {
    background: var(--bg-hover);
}

.tabla-historial th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
}

.tabla-historial tbody tr {
    transition: var(--transition);
    border-bottom: 1px solid var(--border-light, rgba(0,0,0,0.05));
}

.tabla-historial tbody tr:last-child {
    border-bottom: none;
}

.tabla-historial tbody tr:hover {
    background: var(--bg-hover);
}

.tabla-historial td {
    padding: 1rem 1.25rem;
    vertical-align: middle;
    color: var(--text);
}

/* Celdas específicas */
.celda-fecha {
    min-width: 140px;
}

.fecha-principal {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

.fecha-secundaria {
    font-size: 0.8rem;
    color: var(--text-light);
    display: block;
    margin-top: 2px;
}

.celda-maestro {
    min-width: 200px;
}

.nombre-maestro {
    font-weight: 600;
    color: var(--text);
}

.id-maestro {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Badges de conteo */
.badge-contador {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
}

.badge-total {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
}

.badge-presentes {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: white;
}

.badge-ausentes {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    color: white;
}

.badge-tardes {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    color: white;
}

/* Botón de acción */
.btn-ver-detalles {
    background: rgba(var(--primary-rgb, 79, 70, 229), 0.1);
    color: var(--primary);
    border: 1px solid rgba(var(--primary-rgb, 79, 70, 229), 0.3);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-ver-detalles:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Pie de tabla */
.tabla-historial-pie {
    background: var(--bg-hover);
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Estado vacío */
.historial-vacio {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-light);
}

.historial-vacio-icono {
    font-size: 3rem;
    color: var(--border);
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 1024px) {
    .tabla-historial-container {
        overflow-x: auto;
    }
    
    .tabla-historial {
        min-width: 800px;
    }
}

@media (max-width: 768px) {
    .card-historial-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .celda-fecha, .celda-maestro {
        min-width: auto;
    }
}
/* ============================================ */
/* ESTILOS PREMIUM SEGUROS - SOLO CSS */
/* ============================================ */

/* 1. CONTENEDOR PRINCIPAL - Usa clases existentes */
#ausencias .card,
#ausencias .container,
#ausencias .main-content {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
}

/* 2. SELECT DE MAESTRO - Estiliza el select existente */
#selectMaestroAsistencia {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 500;
    color: #1e293b;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    width: 100%;
    max-width: 400px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234f46e5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    appearance: none;
    padding-right: 40px;
}

#selectMaestroAsistencia:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    outline: none;
}

/* 3. INPUT DE FECHA - Estiliza el input existente */
#fechaClase {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 500;
    color: #1e293b;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    width: 100%;
    max-width: 250px;
}

#fechaClase:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    outline: none;
}

/* 4. BOTÓN CARGAR ALUMNOS - Estiliza botones con texto específico */
button:contains("Cargar alumnos"),
button:contains("CARGAR ALUMNOS"),
button[onclick*="cargarAlumnosMaestro"] {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

button:contains("Cargar alumnos"):hover,
button:contains("CARGAR ALUMNOS"):hover,
button[onclick*="cargarAlumnosMaestro"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

/* 5. TARJETAS DE ALUMNOS - Usa clases existentes */
.alumno-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border-left: 4px solid #4f46e5;
}

.alumno-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border-left-color: #7c3aed;
}

/* 6. BOTONES DE ASISTENCIA - Usa clases existentes */
.asistencia-buttons button {
    border: 2px solid;
    border-radius: 10px;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    min-width: 100px;
}

/* Presente */
button[onclick*="'presente'"],
button:contains("Presente"),
button:contains("PRESENTE") {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981 !important;
    color: #10b981;
}

button[onclick*="'presente']:hover,
button:contains("Presente"):hover,
button:contains("PRESENTE"):hover {
    background: #10b981;
    color: white;
}

/* Ausente */
button[onclick*="'ausente'"],
button:contains("Ausente"),
button:contains("AUSENTE") {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444 !important;
    color: #ef4444;
}

button[onclick*="'ausente']:hover,
button:contains("Ausente"):hover,
button:contains("AUSENTE"):hover {
    background: #ef4444;
    color: white;
}

/* Tarde */
button[onclick*="'tarde'"],
button:contains("Tarde"),
button:contains("TARDE") {
    background: rgba(245, 158, 11, 0.1);
    border-color: #f59e0b !important;
    color: #f59e0b;
}

button[onclick*="'tarde']:hover,
button:contains("Tarde"):hover,
button:contains("TARDE"):hover {
    background: #f59e0b;
    color: white;
}

/* 7. BOTONES DE ACCIÓN PRINCIPAL */
button[onclick*="guardarRegistroCompleto"],
button:contains("Guardar"),
button:contains("GUARDAR") {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
    margin: 10px;
}

button[onclick*="guardarRegistroCompleto"]:hover,
button:contains("Guardar"):hover,
button:contains("GUARDAR"):hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

button[onclick*="imprimirFormulario"],
button:contains("Imprimir"),
button:contains("INFORME") {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    margin: 10px;
}

button[onclick*="imprimirFormulario"]:hover,
button:contains("Imprimir"):hover,
button:contains("INFORME"):hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

/* 8. MEJORAS TIPOGRÁFICAS */
#ausencias h1,
#ausencias h2,
#ausencias h3,
#ausencias h4,
#ausencias h5 {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#ausencias strong {
    color: #1e293b;
    font-weight: 700;
}

#ausencias small {
    color: #64748b;
    font-size: 13px;
}

/* 9. ESTADÍSTICAS VISUALES (nuevo elemento) */
.stats-container-premium {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 24px 0;
    padding: 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.stat-box-premium {
    text-align: center;
    padding: 16px;
    border-radius: 12px;
    background: #f8fafc;
}

.stat-box-premium.total {
    border-top: 4px solid #4f46e5;
}

.stat-box-premium.presente {
    border-top: 4px solid #10b981;
}

.stat-box-premium.ausente {
    border-top: 4px solid #ef4444;
}

.stat-box-premium.tarde {
    border-top: 4px solid #f59e0b;
}

.stat-value-premium {
    font-size: 32px;
    font-weight: 800;
    display: block;
    margin-bottom: 4px;
}

.stat-label-premium {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* 10. RESPONSIVE */
@media (max-width: 768px) {
    .stats-container-premium {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .alumno-item {
        padding: 16px;
    }
    
    .asistencia-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .asistencia-buttons button {
        width: 100%;
    }
}

/* 11. ANIMACIONES SUTILES */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alumno-item {
    animation: fadeInUp 0.4s ease-out;
}

/* 12. ESTADO ACTIVO PARA BOTONES */
.asistencia-buttons button[style*="background-color: #10b981"],
.asistencia-buttons button[style*="background-color: #ef4444"],
.asistencia-buttons button[style*="background-color: #f59e0b"] {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-weight: 700;
}

/* ============================================ */
/* ESTILOS PARA HISTORIAL MENSUAL */
/* ============================================ */

/* Contenedor principal */
.card-historial.mensual {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-top: 2rem;
    transition: all 0.3s ease;
}

.card-historial.mensual:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Cabecera mejorada */
.card-historial.mensual .card-historial-header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-historial.mensual .card-historial-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-historial.mensual .card-historial-subtitle {
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: 400;
    margin-top: 5px;
    color: rgba(255, 255, 255, 0.85);
}

/* Badge de estadísticas en header */
.header-stats .stat-badge {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 8px 16px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.stat-badge .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
    color: white;
}

.stat-badge .stat-label {
    font-size: 0.75rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Estadísticas generales */
.stats-overview {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.stat-card-mini {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    border-top: 4px solid;
}

.stat-card-mini:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-mini-value {
    font-size: 1.75rem;
    font-weight: 800;
    display: block;
    margin-bottom: 4px;
}

.stat-mini-label {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tabla específica para historial mensual */
.tabla-historial.mensual {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.tabla-historial.mensual thead {
    background: #f1f5f9;
}

.tabla-historial.mensual th {
    padding: 1.1rem 1rem;
    font-weight: 700;
    color: #475569;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
    text-align: left;
}

.tabla-historial.mensual th.text-center {
    text-align: center;
}

.tabla-historial.mensual tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s ease;
}

.tabla-historial.mensual tbody tr:hover {
    background: #f8fafc;
    transform: scale(1.002);
}

.tabla-historial.mensual td {
    padding: 1.1rem 1rem;
    vertical-align: middle;
    color: #334155;
    font-size: 0.9rem;
}

.tabla-historial.mensual td.text-center {
    text-align: center;
}

/* Avatar de alumno */
.avatar-sm {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-title {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Progress bar delgada */
.progress-thin {
    height: 8px;
    border-radius: 4px;
    background: #e2e8f0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* Badges de estado mejorados */
.badge-estado {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    min-width: 90px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.estado-excelente {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: white;
}

.estado-bueno {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    color: white;
}

.estado-regular {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    color: white;
}

.estado-mejorable {
    background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
    color: white;
}

.estado-critico {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    color: white;
}

/* Pie de tabla */
.tabla-historial-pie {
    background: #f8fafc;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e2e8f0;
    font-size: 0.85rem;
    color: #64748b;
}

/* Estado vacío */
.historial-vacio {
    text-align: center;
    padding: 4rem 2rem;
    color: #94a3b8;
}

.historial-vacio-icono {
    font-size: 4rem;
    color: #e2e8f0;
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.historial-vacio h4 {
    color: #64748b;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 992px) {
    .card-historial.mensual .card-historial-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1.25rem;
    }
    
    .header-stats {
        width: 100%;
    }
    
    .header-stats .stat-badge {
        width: 100%;
        max-width: 200px;
    }
}

@media (max-width: 768px) {
    .stats-overview .row {
        gap: 1rem;
    }
    
    .tabla-historial.mensual {
        display: block;
        overflow-x: auto;
    }
    
    .tabla-historial.mensual th,
    .tabla-historial.mensual td {
        padding: 0.85rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .badge-estado {
        min-width: 70px;
        padding: 5px 10px;
        font-size: 0.7rem;
    }
}

@media (max-width: 576px) {
    .tabla-historial.mensual {
        min-width: 700px;
    }
    
    .stat-card-mini {
        padding: 0.75rem;
    }
    
    .stat-mini-value {
        font-size: 1.5rem;
    }
    
    .historial-vacio {
        padding: 3rem 1rem;
    }
}