:root {
  /* ============================================
     COLORES - Paleta Azul para Estudiantes
     ============================================ */
  
  /* Azul Principal (Vibrante, juvenil) */
  --color-primary-50: hsl(215, 100%, 96%);
  --color-primary-100: hsl(215, 95%, 92%);
  --color-primary-200: hsl(215, 92%, 84%);
  --color-primary-300: hsl(215, 90%, 72%);
  --color-primary-400: hsl(215, 88%, 62%);
  --color-primary-500: hsl(215, 85%, 52%);  /* Color principal */
  --color-primary-600: hsl(215, 80%, 45%);
  --color-primary-700: hsl(215, 75%, 38%);
  --color-primary-800: hsl(215, 70%, 30%);
  --color-primary-900: hsl(215, 65%, 22%);
  
  /* Azul Acento (Cyan vibrante para CTAs) */
  --color-accent-400: hsl(195, 95%, 55%);
  --color-accent-500: hsl(195, 92%, 48%);
  --color-accent-600: hsl(195, 88%, 42%);
  
  /* Colores Semánticos */
  --color-success: hsl(142, 76%, 42%);
  --color-warning: hsl(38, 92%, 55%);
  --color-error: hsl(0, 84%, 62%);
  --color-info: hsl(200, 85%, 52%);

  /* Paletas Vibrantes (Gráficos y Métricas) */
  /* Purple */
  --color-purple-50: hsl(270, 95%, 96%);
  --color-purple-100: hsl(270, 90%, 92%);
  --color-purple-500: hsl(270, 85%, 60%);
  --color-purple-600: hsl(270, 80%, 50%);
  --color-purple-900: hsl(270, 80%, 25%);

  /* Orange */
  --color-orange-50: hsl(25, 100%, 96%);
  --color-orange-100: hsl(25, 95%, 92%);
  --color-orange-500: hsl(25, 95%, 55%);
  --color-orange-600: hsl(25, 90%, 48%);
  
  /* Green (Vibrante) */
  --color-green-50: hsl(145, 90%, 96%);
  --color-green-100: hsl(145, 85%, 92%);
  --color-green-500: hsl(145, 80%, 45%);
  --color-green-600: hsl(145, 85%, 38%);
  
  /* Grises Neutros con Tinte Azulado (Modernos) */
  --color-gray-50: hsl(215, 30%, 98%);
  --color-gray-100: hsl(215, 25%, 96%);
  --color-gray-200: hsl(215, 20%, 92%);
  --color-gray-300: hsl(215, 15%, 85%);
  --color-gray-400: hsl(215, 12%, 65%);
  --color-gray-500: hsl(215, 10%, 50%);
  --color-gray-600: hsl(215, 12%, 40%);
  --color-gray-700: hsl(215, 14%, 30%);
  --color-gray-800: hsl(215, 16%, 20%);
  --color-gray-900: hsl(215, 18%, 12%);
  
  /* Backgrounds */
  --bg-app: var(--color-gray-50);
  --bg-app-gradient: linear-gradient(135deg, var(--color-primary-50) 0%, #ffffff 100%);
  
  /* ============================================
     ESPACIADO (Sistema 4px)
     ============================================ */
  --space-0: 0;
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  
  /* ============================================
     BORDER RADIUS (Modernos, 2026)
     ============================================ */
  --radius-sm: 0.5rem;    /* 8px - Inputs, tags */
  --radius-md: 0.75rem;   /* 12px - Botones, cards pequeñas */
  --radius-lg: 1rem;      /* 16px - Cards principales */
  --radius-xl: 1.5rem;    /* 24px - Modales, containers grandes */
  --radius-2xl: 2rem;     /* 32px - Hero sections */
  --radius-full: 9999px;  /* Circular - Avatares, pills */
  
  /* ============================================
     SOMBRAS (Triple capa, naturales)
     ============================================ */
  --shadow-xs: 
    0 1px 2px rgba(0, 0, 0, 0.04);
  
  --shadow-sm: 
    0 1px 2px rgba(0, 0, 0, 0.03),
    0 2px 4px rgba(0, 0, 0, 0.04);
  
  --shadow-md: 
    0 2px 4px rgba(0, 0, 0, 0.03),
    0 4px 8px rgba(0, 0, 0, 0.04),
    0 8px 16px rgba(0, 0, 0, 0.05);
  
  --shadow-lg: 
    0 4px 8px rgba(0, 0, 0, 0.03),
    0 8px 16px rgba(0, 0, 0, 0.04),
    0 16px 32px rgba(0, 0, 0, 0.06);
  
  --shadow-xl: 
    0 8px 16px rgba(0, 0, 0, 0.04),
    0 16px 32px rgba(0, 0, 0, 0.05),
    0 24px 48px rgba(0, 0, 0, 0.07);
  
  /* Sombras de color (para botones primarios) */
  --shadow-primary: 
    0 4px 12px hsla(215, 85%, 52%, 0.25),
    0 8px 24px hsla(215, 85%, 52%, 0.15);
  
  /* ============================================
     TRANSICIONES (Curvas Apple)
     ============================================ */
  --transition-fast: 150ms cubic-bezier(0.25, 0.1, 0.25, 1);
  --transition-base: 250ms cubic-bezier(0.25, 0.1, 0.25, 1);
  --transition-slow: 350ms cubic-bezier(0.25, 0.1, 0.25, 1);
  --transition-bounce: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
  
  /* ============================================
     TIPOGRAFÍA
     ============================================ */
  --font-sans: 'Kumbh Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  
  /* Tamaños Mobile First */
  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg: 1.125rem;    /* 18px */
  --text-xl: 1.25rem;     /* 20px */
  --text-2xl: 1.5rem;     /* 24px */
  --text-3xl: 1.875rem;   /* 30px */
  --text-4xl: 2.25rem;    /* 36px */
  
  /* Pesos */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  
  /* ============================================
     Z-INDEX (Capas organizadas)
     ============================================ */
  --z-base: 0;
  --z-dropdown: 10;
  --z-sticky: 20;
  --z-fixed: 30;
  --z-modal-backdrop: 40;
  --z-modal: 50;
  --z-popover: 60;
  --z-tooltip: 70;
}

/* Patching sidebar styles */

.sidebar-kreadu {
  background: linear-gradient(180deg, var(--color-primary-900) 0%, var(--color-primary-800) 100%);
  color: white;
  border-right: 1px solid rgba(255, 255, 255, 0.05); /* Subtle border */
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15); /* Depth */
  overflow: hidden;
}

/* Base styles for nav items in sidebar to Ensure high contrast */
.sidebar-kreadu .nav-item {
  color: rgba(226, 232, 240, 0.7); /* slate-200 with opacity */
  transition: all var(--transition-base);
}

.sidebar-kreadu .nav-item:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-kreadu .nav-item svg {
  color: rgba(148, 163, 184, 1); /* slate-400 */
}

.sidebar-kreadu .nav-item:hover svg {
  color: var(--color-primary-300);
}


/* ============================================
   LOADING SKELETONS
   ============================================ */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-gray-200) 0%,
    var(--color-gray-100) 50%,
    var(--color-gray-200) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

/* styles.css */

/* ------------------------------------- */
/* --- Reseteo Básico y Box Sizing --- */
/* ------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  /* ------------------------------------- */
  /* --- Estilos Globales (Body) --- */
  /* ------------------------------------- */
  html {
    font-size: 16px;
  }
  
  body {
    /* FUENTE ACTUALIZADA: Kumbh Sans */
    font-family: "Kumbh Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    line-height: 1.6;
    color: #444444;
    background-color: transparent; /* Antes #ffffff, se cambia para evitar barras en modales */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  
  /* ------------------------------------- */
  /* --- Tipografía (Cabeceras y Párrafos) --- */
  /* ------------------------------------- */
  h1, h2, h3, h4, h5, h6 {
    /* Kumbh Sans tiende a ser un poco más 'bold' por defecto,
       puedes ajustar el font-weight si lo ves necesario.
       Probamos con 600 o 700 según el peso importado. */
    font-weight: 600; /* Ajusta si importas diferentes pesos */
    margin-bottom: 0.75em;
    color: #333333;
    line-height: 1.3;
  }
  
  /* Ajusta los tamaños si Kumbh Sans se ve diferente a Plus Jakarta Sans */
  h1 { font-size: 2.25rem; }   /* ~36px */
  h2 { font-size: 1.875rem; }  /* ~30px */
  h3 { font-size: 1.5rem; }    /* ~24px */
  h4 { font-size: 1.25rem; }   /* ~20px */
  
  p {
    margin-bottom: 1em;
  }
  
  /* ------------------------------------- */
  /* --- Enlaces --- */
  /* ------------------------------------- */
  a {
    color: #3B82F6; /* Azul Kreadu */
    text-decoration: none;
    transition: color 0.2s ease-in-out;
  }
  
  /* Enlaces de Contenido: Comportamiento tradicional con underline */
  a:hover,
  a:focus {
    color: #2563EB; /* Azul más oscuro */
    text-decoration: underline;
  }

  /* UI controls: no underline override (nav items, buttons, segmented control) */
  .nav-item,
  .nav-item:hover,
  .nav-item:focus,
  .nav-item:active,
  .btn-primary,
  .btn-primary:hover,
  .btn-primary:focus,
  .btn-primary:active,
  .btn-secondary,
  .btn-secondary:hover,
  .btn-secondary:focus,
  .btn-secondary:active,
  .seg-btn,
  .seg-btn:hover,
  .seg-btn:focus,
  .seg-btn:active,
  .card-hover,
  .card-hover:hover,
  .card-hover:focus,
  .card-hover:active {
    text-decoration: none !important;
  }

  /* Override active nav item color to match admin banner (kreadu-primary-900) */
  .nav-item.active-nav-item {
    background-color: hsl(215, 65%, 22%) !important;
    color: white !important;
  }
  
  .nav-item.active-nav-item svg {
    color: white !important;
  }

  /* Asegurar que el focus en navegación sea accesible */
  .nav-item:focus-visible,
  .btn-primary:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.5);
    outline-offset: 2px;
  }
  
  /* ------------------------------------- */
  /* --- Botones (Estilo Base Primario) --- */
  /* ------------------------------------- */
  .button-primary,
  .btn-primary,
  input[type="submit"],
  input[type="button"],
  input[type="reset"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6em 1.2em;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    background-color: #3B82F6; /* Azul Kreadu */
    color: #ffffff;
    transition: all 0.2s ease-in-out;
  }

  button {
    font-family: inherit;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
  }
  
  .button-primary:hover,
  .btn-primary:hover,
  input[type="submit"]:hover,
  input[type="button"]:hover,
  input[type="reset"]:hover {
    background-color: #2563EB; /* Azul más oscuro */
    color: #ffffff;
  }

  /* --- Botón de Peligro (Delete/Danger) --- */
  .btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    color: #DC2626; /* red-600 */
    background-color: #FEF2F2; /* red-50 */
    border: 1px solid #FEE2E2; /* red-100 */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .btn-danger:hover {
    background-color: #DC2626;
    color: #ffffff;
    border-color: #DC2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
  }

  .btn-icon {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* ------------------------------------- */
  /* --- Control segmentado (toggles) --- */
  /* ------------------------------------- */
  /* Usage: <div class="seg"><a class="seg-btn is-active">A</a><a class="seg-btn">B</a></div> */
  .seg {
    display: inline-flex;
    border: 1px solid #e5e7eb;            /* gray-200 */
    border-radius: 0.5rem;
    overflow: hidden;
    font-size: 0.875rem;
    font-weight: 500;
  }

  .seg-btn {
    padding: 0.5rem 1rem;                 /* py-2 px-4 */
    color: #4b5563;                       /* gray-600 */
    background-color: #ffffff;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
  }

  .seg-btn + .seg-btn {
    border-left: 1px solid #e5e7eb;
  }

  .seg-btn:hover,
  .seg-btn:focus {
    color: #111827;                       /* gray-900 */
    background-color: #f9fafb;            /* gray-50 */
  }

  /* Active state — specificity (0,2,0) beats a:hover (0,1,1); text-decoration
     handled by the !important group above so no override needed here. */
  .seg-btn.is-active,
  .seg-btn.is-active:hover,
  .seg-btn.is-active:focus {
    background-color: hsl(215, 80%, 45%); /* kreadu-primary-600 */
    color: #ffffff;
  }

  .seg-btn:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.5);
    outline-offset: -2px;
  }

  /* ------------------------------------- */
  /* --- Contenedor Básico (Opcional) --- */
  /* ------------------------------------- */
  .container {
    width: 100%;
    max-width: 1140px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
  }
  
  /* --- Puedes añadir más estilos base aquí --- */

/* Responsive adjustments */
@media (max-width: 768px) {
  h1 {
    font-size: 1.75rem;
  }

  .container {
    padding-left: 10px;
    padding-right: 10px;
  }

  .button-primary {
    width: 100%;
    padding: 1em;
    font-size: 1rem;
  }

  /* Improve glass-light opacity on mobile for better contrast */
  .glass-light {
    background: hsla(0, 0%, 100%, 0.95); /* More opaque on mobile */
  }
}

.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(180deg, #0a192f 0%, #0d2545 100%);
  padding: 1rem;
}

.login-card {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 2.5rem;
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.login-title {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  color: #1e3a8a; /* Azul oscuro Kreadu */
}

.login-subtitle {
  font-size: 1rem;
  color: #6b7280; /* Gris medio */
  margin-bottom: 2rem;
}

.login-form {
  text-align: left;
}

.login-form p {
  margin-bottom: 1rem;
}

.login-form input[type="text"],
.login-form input[type="password"] {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.login-footer {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: #6b7280;
}
  /* ------------------------------------- */
  /* --- Buscador (Búsqueda Inteligente) --- */
  /* ------------------------------------- */
  .search-wrapper {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .search-field {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    font-size: 0.95rem;
    color: #1e293b;
    background-color: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 9999px; /* Totalmente redondeado como en la referencia */
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  }

  .search-field::placeholder {
    color: #94a3b8;
    font-weight: 400;
  }

  .search-field:hover {
    border-color: #3b82f6; /* Azul Kreadu */
    background-color: #f8fafc;
  }

  .search-field:focus {
    outline: none;
    border-color: #3b82f6;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
  }

  .search-icon-wrapper {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    padding-left: 1rem;
    display: flex;
    align-items: center;
    pointer-events: none;
    color: #94a3b8;
    transition: color 0.2s ease-in-out;
  }

  .search-field:focus + .search-icon-wrapper,
  .search-wrapper:focus-within .search-icon-wrapper {
    color: #3b82f6;
  }

/* ------------------------------------- */
/* --- Rich Content (teacher-authored)  --- */
/* Mobile-first. Wraps output of the rich_text template filter. */
/* ------------------------------------- */
.rich-content {
    line-height: 1.6;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.rich-content p {
    margin-bottom: 0.5rem;
}
.rich-content p:last-child {
    margin-bottom: 0;
}
/* Sensible max font-size so docente-authored sizes stay readable on mobile */
.rich-content span[style*="font-size"] {
    line-height: 1.4;
}

/* ------------------------------------- */
/* --- Print Styles (Backup) --- */
/* ------------------------------------- */
@media print {
    @page {
        margin: 1cm;
        size: auto;
    }

    body {
        background-color: white !important;
        color: black !important;
        margin: 0 !important; /* Reset body margin */
    }
    
    /* Force background graphics if possible */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Safety for util classes if Tailwind is stripped */
    .print\:hidden {
        display: none !important;
    }
    .print\:block {
        display: block !important;
    }
    
    /* Clean up shadows */
    .shadow, .shadow-md, .shadow-lg, .shadow-xl {
        box-shadow: none !important;
    }

    /* Simplify borders */
    .border {
        border-color: #e5e7eb !important; /* gray-200 */
    }
    
    /* Layout */
    .container {
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Table optimizations */
    tr {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    /* Hide links URLs */
    a[href]:after {
        content: none !important;
    }
}
