/* ===================================================================
   SIGE • SISTEMA INTEGRAL DE GESTIÓN ESCOLAR (EDICIÓN WHITE-LABEL)
   Sistema Visual Sophian Measurements • Paleta Navy & Royal Blue
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Playfair+Display:ital,wght@0,600;0,700;1,600&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Paleta Primaria Institucional Sophian Royal Blue & Navy */
  --vinotinto-base: #2563EB;
  --vinotinto-dark: #1D4ED8;
  --vinotinto-deeper: #0B1528;
  --vinotinto-vivid: #3B82F6;
  --vinotinto-light: #60A5FA;

  /* Vinotinto Pasteles Institucionales (Tonos con Cuerpo y Definición) */
  --vinotinto-pastel-50: #EFF6FF;
  --vinotinto-pastel-100: #DBEAFE;
  --vinotinto-pastel-200: #BFDBFE;
  --vinotinto-pastel-300: #93C5FD;
  --vinotinto-pastel-400: #60A5FA;

  /* Acentos de Prestigio: Dorado Champagne */
  --gold-accent: #C59B27;
  --gold-light: #F4E7C3;
  --gold-dark: #9A7718;

  /* Neutrales */
  --surface-pure: #FFFFFF;
  --bg-sand: #F3F5F9;
  --text-main: #0F172A;
  --text-muted: #475569;
  --border-subtle: rgba(130, 21, 43, 0.10);

  /* Curvas de Bézier Cinemáticas (Haptic Motion) */
  --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);

  /* Variables dinámicas para tipografía y botones estandarizados */
  --sige-font-family: 'General Sans', 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --btn-primary-bg: #2563EB;
  --btn-primary-hover: #1D4ED8;
  --btn-primary-text: #FFFFFF;
}

body {
  font-family: var(--sp-sans, var(--sige-font-family));
  color: var(--text-main);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  background-color: var(--bg-sand);
}

/* Soporte de color dinámico para botones primarios explícitos sin romper botones secundarios */
.btn-theme-action,
.btn-dynamic-accent,
.btn-plaza-dinamico,
.btn-primary {
  background-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border-color: var(--btn-primary-hover);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-theme-action:hover,
.btn-dynamic-accent:hover,
.btn-plaza-dinamico:hover,
.btn-primary:hover {
  background-color: var(--btn-primary-hover);
}

/* Tipografía Editorial y Monoespaciada */
.font-editorial,
.font-serif {
  font-family: 'Playfair Display', Georgia, serif;
}

.font-mono-code {
  font-family: var(--sp-mono, 'Azeret Mono', 'JetBrains Mono', monospace);
  font-variant-numeric: tabular-nums;
}

/* Paleta Vinotinto en Gradientes y Superficies */
.bg-vinotinto-gradient {
  background: linear-gradient(145deg, #4A0B1E 0%, #350614 60%, #20030B 100%);
}

.bg-vinotinto-mesh {
  background-color: #2D0510;
  background-image: 
    radial-gradient(at 0% 0%, rgba(120, 20, 50, 0.45) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(90, 14, 36, 0.6) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(60, 8, 22, 0.8) 0px, transparent 50%);
}

.bg-pastel-rose {
  background-color: var(--vinotinto-pastel-50);
}

/* Doble Bisel (Doppelrand / Nested Hardware Architecture) */
.double-bezel-wrapper {
  background: rgba(90, 14, 36, 0.04);
  border: 1px solid rgba(90, 14, 36, 0.08);
  border-radius: 2rem;
  padding: 0.5rem;
  box-shadow: 0 20px 40px -15px rgba(60, 8, 22, 0.07);
  transition: all 0.4s var(--ease-spring);
}

.double-bezel-wrapper:hover {
  border-color: rgba(90, 14, 36, 0.16);
  box-shadow: 0 25px 50px -12px rgba(60, 8, 22, 0.12);
  transform: translateY(-2px);
}

.double-bezel-core {
  background: var(--surface-pure);
  border-radius: calc(2rem - 0.5rem);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9);
}

/* Botones "Island" con icono anidado */
.btn-island {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.875rem;
  transition: all 0.3s var(--ease-spring);
}

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

.btn-island .icon-circle {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s var(--ease-spring);
}

.btn-island:hover .icon-circle {
  transform: translate(2px, -1px);
}

/* Floating Island Navbar */
.nav-island {
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(90, 14, 36, 0.09);
  box-shadow: 0 16px 32px -8px rgba(60, 8, 22, 0.08);
}

/* Badges y Microlabels */
.eyebrow-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Animación de escaneo láser para el lector QR (GPU composited) */
@keyframes laserSweep {
  0% { transform: translateY(0); opacity: 0.82; }
  50% { transform: translateY(210px); opacity: 1; }
  100% { transform: translateY(0); opacity: 0.82; }
}

.laser-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #E11D48, #FB7185, transparent);
  box-shadow: 0 0 12px #E11D48;
  will-change: transform, opacity;
  animation: laserSweep 2.2s ease-in-out infinite;
}

/* Notificación Flotante con pulso */
@keyframes pulseToast {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.toast-pulse {
  animation: pulseToast 3s ease-in-out infinite;
}

/* Impresión */
@media print {
  body { background: #FFFFFF !important; }
  .no-print { display: none !important; }
  .print-only { display: block !important; }
}

/* ===================================================================
   VARIABLES DE PALETAS DINÁMICAS (Tailwind RGB Triplet Integration)
   Por defecto: Borgoña Suave & Rosa Pastel
   =================================================================== */
:root {
  --plaza-50: 239 246 255;
  --plaza-100: 219 234 254;
  --plaza-200: 191 219 254;
  --plaza-300: 147 197 253;
  --plaza-400: 96 165 250;
  --plaza-500: 59 130 246;
  --plaza-600: 37 99 235;
  --plaza-700: 29 78 216;
  --plaza-800: 30 64 175;
  --plaza-900: 30 58 138;
  --plaza-950: 11 21 40;
  --theme-body-bg: #FFFFFF;
}

/* Transiciones suaves al alternar paletas */
body, #main-header, aside, .theme-transition {
  transition: background-color 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              color 0.2s ease;
}

/* ===================================================================
   CABECERA LUMINOSA / CLARA (Modo Pastel por Defecto)
   =================================================================== */
#main-header[data-header-mode="light"] {
  background-color: rgba(255, 255, 255, 0.96) !important;
  color: #1c1917 !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.05) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

#main-header[data-header-mode="light"] .header-brand-title {
  color: #1c1917 !important;
}

#main-header[data-header-mode="light"] .header-brand-sub {
  color: #78716c !important;
}

#main-header[data-header-mode="light"] .header-badge-ver {
  background-color: rgba(var(--plaza-500) / 0.12) !important;
  color: rgb(var(--plaza-700)) !important;
  border-color: rgba(var(--plaza-500) / 0.25) !important;
}

#main-header[data-header-mode="light"] .header-widget-bcv {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: #1e293b !important;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.03) !important;
}

#main-header[data-header-mode="light"] .header-widget-bcv button {
  color: #64748b !important;
}

#main-header[data-header-mode="light"] .header-widget-bcv button:hover {
  color: #0f172a !important;
  background-color: #e2e8f0 !important;
}

#main-header[data-header-mode="light"] .header-widget-openwa {
  background-color: #ecfdf5 !important;
  border-color: #a7f3d0 !important;
  color: #065f46 !important;
}

#main-header[data-header-mode="light"] .header-btn-portal {
  background-color: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: #334155 !important;
}

#main-header[data-header-mode="light"] .header-btn-portal:hover {
  background-color: #ffffff !important;
  color: rgb(var(--plaza-800)) !important;
  border-color: rgb(var(--plaza-300)) !important;
}

#main-header[data-header-mode="light"] .header-btn-theme {
  background-color: rgba(var(--plaza-500) / 0.1) !important;
  border-color: rgba(var(--plaza-500) / 0.25) !important;
  color: rgb(var(--plaza-800)) !important;
}

#main-header[data-header-mode="light"] .header-btn-theme:hover {
  background-color: rgba(var(--plaza-500) / 0.18) !important;
}

#main-header[data-header-mode="light"] .header-user-wrap {
  border-left-color: #e2e8f0 !important;
}

#main-header[data-header-mode="light"] .header-user-avatar {
  background-color: rgb(var(--plaza-100)) !important;
  color: rgb(var(--plaza-800)) !important;
  border-color: rgb(var(--plaza-300)) !important;
}

#main-header[data-header-mode="light"] .header-user-name {
  color: #1e293b !important;
}

#main-header[data-header-mode="light"] .header-user-role {
  color: rgb(var(--plaza-700)) !important;
}

/* ===================================================================
   CABECERA SÓLIDA / DE COLOR (Modo Clásico)
   =================================================================== */
#main-header[data-header-mode="solid"] {
  background-color: rgb(var(--plaza-800)) !important;
  color: #ffffff !important;
  border-bottom: 1px solid rgb(var(--plaza-900)) !important;
  box-shadow: 0 4px 15px -2px rgba(0, 0, 0, 0.2) !important;
}

#main-header[data-header-mode="solid"] .header-btn-theme {
  background-color: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
}

#main-header[data-header-mode="solid"] .header-btn-theme:hover {
  background-color: rgba(255, 255, 255, 0.22) !important;
}

/* ===================================================================
   COBERTURA COMPLETA DE BACKDROP EN MODALES (Z-INDEX UNIVERSAL)
   Garantiza que cualquier modal oscurezca el 100% de la pantalla,
   cubriendo tanto la barra superior (header) como el menú lateral (sidebar).
   =================================================================== */
@media (min-width: 768px) {
  #sidebar-menu {
    position: static !important;
    z-index: 10 !important;
  }
}

[id^="modal-"],
div[id*="modal-"],
.modal-overlay,
.swal2-container {
  z-index: 1050 !important;
}

@media (prefers-reduced-motion: reduce) {
  .laser-line,
  .toast-pulse {
    animation: none !important;
  }
  body,
  #main-header,
  aside,
  .theme-transition,
  .btn-theme-action,
  .btn-dynamic-accent,
  .btn-plaza-dinamico,
  .btn-primary {
    transition-duration: 0.01ms !important;
  }
}


