:root {
  /* Colores Primarios */
  --color-tierra-sagrada: #8C6E63;
  --color-sol-del-desierto: #FF8F00;
  --color-verde-mesquite: #689F38;
  --color-hierba-fresca: #7CB342;

  /* Nuevos Colores del Proyecto (Tema Azul/Amarillo) */
  --color-azul-profundo: #0D1B3D;
  --color-azul: #1565C0;
  --color-amarillo: #FFC107;
  --color-naranja: #F57C00;
  --color-verde: #2E7D32;
  --color-fondo-claro: #FFF9F0;

  /* Constantes de Diseño (Layout) */
  --header-height: 140px;
  --sidebar-width: 300px;

  /* Colores Secundarios */
  --color-cielo-yoreme: #4FC3F7;
  --color-ocre-ritual: #D4A574;
  --color-coral-ancestral: #F4511E;
  --color-purpura-ceremonia: #7B1FA2;
  --color-gris-ceniza: #636160;

  /* Colores Funcionales */
  --color-bg-body: #f8f9fa;
  --color-text-primary: #333333;
  --color-footer-bg: #2b1f1c;
  /* Tono oscuro derivado que coincide con la imagen */
  --color-footer-text: #e0e0e0;

  /* Tipografía */
  --font-content: 'Crimson Text', serif;
  --font-interface: 'Inter', sans-serif;

  /* Variables de Componentes (Tarjetas y Sombras) */
  --radius-card: 16px;
  --shadow-suave: 0 4px 20px rgba(0, 0, 0, 0.08);
  --color-card-borde: rgba(0, 0, 0, 0.05);
}

body {
  font-family: var(--font-content);
  background-color: var(--color-bg-body);
  color: var(--color-text-primary);
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
  font-family: var(--font-content);
  font-weight: 700;
  color: #3E2723;
  /* Marrón oscuro para los títulos */
}

/* Los elementos de interfaz usan Inter */
.nav-link,
.btn,
footer,
.sidebar-link,
small,
.dropdown-item {
  font-family: var(--font-interface);
}

/* Clases de Componentes Personalizados */
.bg-tierra {
  background-color: var(--color-tierra-sagrada) !important;
  color: white;
}

.bg-sol {
  background-color: var(--color-sol-del-desierto) !important;
  color: white;
}

.bg-verde {
  background-color: var(--color-verde-mesquite) !important;
  color: white;
}

.text-tierra {
  color: var(--color-tierra-sagrada) !important;
}

.text-sol {
  color: var(--color-sol-del-desierto) !important;
}

.text-verde {
  color: var(--color-verde-mesquite) !important;
}

/* Integración de Diseño (Layout) */
.layout-wrapper {
  margin-top: var(--header-height);
  display: flex;
}

@media (max-width: 991.98px) {
  :root {
    --header-height: 90px;
  }
}

@media (max-width: 575.98px) {
  :root {
    --header-height: 75px;
  }
}

header {
  background: linear-gradient(120deg, var(--color-azul-profundo), var(--color-azul), var(--color-amarillo), var(--color-naranja));
  color: #ffffff;
  padding: 1.5rem 1rem;
  height: var(--header-height);
  z-index: 1030;
  /* Índice predeterminado de Bootstrap para fixed-top */
}

.header-content {
  width: 100%;
  max-width: 1320px;
  padding: 0 2rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 100%;
}

.header-home-link {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  text-decoration: none;
  color: inherit;
  flex: 1;
}

.header-home-link:hover {
  color: inherit;
  opacity: 0.9;
}

.logos {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.logos img {
  height: 70px;
  width: auto;
  object-fit: contain;
}

.header-text {
  flex: 1;
  min-width: 260px;
}

.header-text h1 {
  margin: 0 0 0.25rem;
  font-family: var(--font-content);
  font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  line-height: 1.2;
  color: #ffffff;
}

.header-text p {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.95;
}

@media (max-width: 991.98px) {
  .header-content {
    gap: 1rem;
    padding: 0 1rem;
  }

  .logos img {
    height: 50px;
  }

  .header-text h1 {
    font-size: 1.4rem;
  }

  .header-text p {
    font-size: 0.8rem;
  }

}

@media (max-width: 575.98px) {
  .logos img:not(.app-logo) {
    display: none;
    /* Ocultar logos institucionales en móvil muy pequeño para espacio */
  }

  .header-text h1 {
    font-size: 1.1rem;
  }

  .header-text p {
    display: none;
    /* Ocultar subtítulo en móvil muy pequeño */
  }

  .header-actions {
    gap: 0.5rem;
  }

  .btn-login {
    width: 35px;
    height: 35px;
  }
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background-color: rgba(0, 0, 0, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  margin-bottom: 0.4rem;
}

@media (max-width: 991.98px) {
  .tag {
    display: none;
  }
}

.tag span.icon-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #ffffff;
}

/* Acciones del Encabezado y Botón de Inicio de Sesión */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

.btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  text-decoration: none;
  transition: background-color 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.btn-login:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

/* Personalización de la Barra Lateral (Sidebar) */
.sidebar {
  background-color: white;
  border-right: 1px solid #dee2e6;
  overflow-y: auto;
  padding: 1rem;
}

/* Comportamiento específico para pantallas Grandes (Escritorio) */
@media (min-width: 992px) {
  .sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    flex-shrink: 0;
    height: calc(100vh - var(--header-height));
    position: sticky;
    top: var(--header-height);
    align-self: flex-start;
    left: 0;
    z-index: 100;
    display: flex !important;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .sidebar.collapsed {
    transform: translateX(-100%);
    margin-left: calc(-1px * var(--sidebar-width));
    min-width: 0;
    width: 0;
    padding: 0;
    border: none;
  }
}

/* Botón Flotante tipo Edge Handler */
.edge-handle {
  position: fixed;
  left: var(--sidebar-width);
  top: 50%;
  transform: translateY(-50%);
  z-index: 1060;
  width: 24px;
  height: 60px;
  background: var(--color-azul-profundo);
  color: white;
  border: none;
  border-radius: 0 12px 12px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
}

.edge-handle:hover {
  background-color: var(--color-azul);
  width: 28px;
}

.edge-handle i {
  transition: transform 0.4s;
  font-size: 1.2rem;
}

.sidebar-collapsed .edge-handle {
  left: 0;
}

.sidebar-collapsed .edge-handle i {
  transform: rotate(180deg);
}

@media (max-width: 991.98px) {
  .edge-handle {
    display: none;
    /* En móvil usamos el botón del header ya existente o podemos unificar */
  }
}

.sidebar-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: var(--color-text-primary);
  text-decoration: none;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  transition: background-color 0.2s;
  font-weight: 500;
}

.sidebar-link:hover,
.sidebar-link.active {
  background-color: #f0f0f0;
  /* Hover neutro */
}

/* Colores específicos de la Barra Lateral basados en el diseño */
.nav-group-title {
  font-family: var(--font-content);
  font-size: 1.1rem;
  color: var(--color-tierra-sagrada);
  margin-bottom: 1rem;
  margin-top: 1.5rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.5rem;
}


.btn-sidebar-category {
  width: 100%;
  text-align: left;
  margin-bottom: 0.75rem;
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 15px;
  border-radius: 8px;
  font-weight: 600;
  transition: transform 0.2s, background-color 0.2s;
}

.btn-sidebar-category:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  color: #000;
}

.btn-sidebar-category i.bi-chevron-down {
  transition: transform 0.3s ease;
}

.btn-sidebar-category[aria-expanded="true"] i.bi-chevron-down {
  transform: rotate(180deg);
}

.btn-sidebar-category i {
  margin-right: 10px;
}

.cat-lengua {
  background-color: var(--color-coral-ancestral);
}

.cat-conceptos {
  background-color: var(--color-sol-del-desierto);
}

.cat-naturaleza {
  background-color: var(--color-verde-mesquite);
}

.cat-cuerpo {
  background-color: var(--color-cielo-yoreme);
}

.cat-cultura {
  background-color: var(--color-ocre-ritual);
}

.cat-literatura {
  background-color: var(--color-purpura-ceremonia);
}

.cat-diccionario {
  background-color: var(--color-gris-ceniza);
}

/* Área de Contenido Principal */
.content-column {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--header-height));
}

.main-content-wrapper {
  padding: 2rem;
  flex-grow: 1;
}

/* Wrapper de contenido responsivo: full-width en móvil, centrado en escritorio */
.content-wrapper {
  width: 100%;
  padding: 1rem 0.75rem;
  box-sizing: border-box;
}

@media (min-width: 992px) {
  .content-wrapper {
    max-width: 1320px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
  }
}

/* Estilos de Pie de Página (Footer) Globales */
footer {
  background-color: var(--color-azul-profundo);
  color: #f5f5f5;
  padding: 2rem 1rem 1.25rem;
  font-size: 0.85rem;
  width: 100%;
  position: relative;
  z-index: 100;
}

.footer-content {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
}

.footer-address {
  opacity: 0.9;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  opacity: 0.85;
}

.visit-counter {
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.text-justify {
  text-align: justify;
}

.footer-link {
  color: var(--color-footer-text);
  text-decoration: none;
  display: block;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--color-sol-del-desierto);
}

.social-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--color-verde-mesquite);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  text-decoration: none;
}

.social-icon-btn:hover {
  background-color: #558b2f;
  color: white;
}

.copyright-bar {
  background-color: rgba(255, 255, 255, 0.1);
  /* Franja transparente en la parte inferior */
  color: #ccc;
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
  border-radius: 4px;
  /* ¿Redondeo ligero como se ve en la imagen? en realidad parece una barra completa */
}

@media (max-width: 991.98px) {
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    height: 100vh !important;
    z-index: 1050 !important;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    display: none !important;
    /* Bootstrap offcanvas se encarga de mostrarlo */
  }

  .sidebar.show,
  .sidebar.showing {
    display: flex !important;
    transform: translateX(0);
  }

  /* =========================================
   Estilos de Componentes (Tarjetas, etc.)
   ========================================= */
  .card {
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
  }

  .main-content-wrapper {
    margin-left: 0;
  }
}


.card-hover-effect {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover-effect:hover {
  transform: translateY(-5px);
  box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15) !important;
}

/* Estilos Específicos de Página - Movidos desde las plantillas */
.bg-rojo {
  background-color: var(--color-coral-ancestral) !important;
  color: white;
}

.section-header-red {
  background: linear-gradient(135deg, var(--color-coral-ancestral) 0%, #D84315 100%);
}

.topic-link {
  color: var(--color-cielo-yoreme);
  font-weight: 500;
  transition: transform 0.2s;
}

.topic-link:hover {
  color: var(--color-cielo-yoreme);
  transform: translateX(5px);
  text-decoration: none;
}

.section-header-orange {
  background: linear-gradient(135deg, var(--color-sol-del-desierto) 0%, #FF6F00 100%);
}

.pulse-animation {
  animation: pulse 0.5s;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

.section-header-brown {
  background: linear-gradient(135deg, var(--color-tierra-sagrada) 0%, #5D4037 100%);
}

.bg-azul {
  background-color: var(--color-cielo-yoreme) !important;
  color: white;
  /* ¿O texto oscuro si es azul claro? styles.css indica blanco para los demás */
}

.section-header-blue {
  background: linear-gradient(135deg, var(--color-cielo-yoreme) 0%, #039BE5 100%);
}

.bg-ocre {
  background-color: var(--color-ocre-ritual) !important;
  color: white;
}

.section-header-ocre {
  background: linear-gradient(135deg, var(--color-ocre-ritual) 0%, #8D6E63 100%);
}

.bg-purpura {
  background-color: var(--color-purpura-ceremonia) !important;
  color: white;
}

.section-header-purple {
  background: linear-gradient(135deg, var(--color-purpura-ceremonia) 0%, #4A148C 100%);
}

.text-purpura {
  color: var(--color-purpura-ceremonia) !important;
}

.text-ocre {
  color: var(--color-ocre-ritual) !important;
}


.section-header-green {
  background: linear-gradient(135deg, var(--color-hierba-fresca) 0%, #33691E 100%);
}

/* =========================================
   Estilos SVG Interactivo (Cuerpo Humano)
   ========================================= */
.body-part {
  fill: #B3E5FC;
  transition: fill 0.3s, transform 0.2s;
  cursor: pointer;
}

.body-part:hover {
  fill: #039BE5;
  transform: scale(1.02);
  transform-origin: center;
}

.body-part.active {
  fill: #0277BD;
}

.label-text {
  font-family: sans-serif;
  font-size: 14px;
  fill: #555;
  pointer-events: none;
}

/* =========================================
   Estilos Diccionario
   ========================================= */
.section-header-gray {
  background: linear-gradient(135deg, #78909C 0%, #455A64 100%);
  color: white;
}

.alphabet-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dee2e6;
  background-color: white;
  color: #455A64;
  font-weight: 600;
  transition: all 0.2s;
  font-family: var(--font-interface);
}

.alphabet-btn:hover {
  background-color: #ECEFF1;
  color: #37474F;
  border-color: #CFD8DC;
}

.alphabet-btn.active {
  background-color: #78909C;
  color: white;
  border-color: #78909C;
}

.search-input-wrapper {
  position: relative;
}

.search-input-wrapper i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #90A4AE;
}

.form-control-lg {
  padding-left: 45px;
  font-size: 1.1rem;
}

/* =========================================
   Vista Compacta del Diccionario
   ========================================= */
.compact-view .dictionary-card {
  margin-bottom: 0.5rem !important;
  border-radius: 8px !important;
}

.compact-view .dictionary-card .card-body {
  padding: 0.75rem 1.25rem !important;
}

.compact-view .word-term {
  font-size: 1.1rem;
  margin-bottom: 0 !important;
  display: inline-block;
  margin-right: 10px;
}

.compact-view .word-trans {
  font-size: 1rem;
  margin-bottom: 0 !important;
  display: inline-block;
  margin-right: 10px;
}

.compact-view .word-content {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.compact-view .word-tags .badge {
  padding: 0.35em 0.65em !important;
  font-size: 0.75em !important;
}

.compact-view .play-audio-btn {
  width: 36px !important;
  height: 36px !important;
  font-size: 1rem !important;
}



/* =========================================
   Estilos Momentos del Día
   ========================================= */

.intro-card {
  background-color: var(--color-sol-del-desierto);
  color: white;
  border-radius: 12px;
}

.phase-header {
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
  font-family: var(--font-interface);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.moment-card {
  background: white;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  transition: box-shadow 0.2s;
}

.moment-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.moment-info {
  flex: 1;
}

.moment-mayo {
  font-family: var(--font-content);
  font-weight: 700;
  font-size: 1.1rem;
  color: #2c2c2c;
  margin-bottom: 0.2rem;
}

.moment-time-madrugada {
  color: #3E2723;
  font-weight: 600;
  font-size: 0.9rem;
  font-family: var(--font-interface);
}

.moment-time-manana {
  color: var(--color-naranja);
  font-weight: 600;
  font-size: 0.9rem;
  font-family: var(--font-interface);
}

.moment-time-tarde {
  color: #E64A19;
  font-weight: 600;
  font-size: 0.9rem;
  font-family: var(--font-interface);
}

.moment-time-noche {
  color: var(--color-purpura-ceremonia);
  font-weight: 600;
  font-size: 0.9rem;
  font-family: var(--font-interface);
}

.audio-btn-green {
  width: 40px;
  height: 40px;
  background-color: var(--color-hierba-fresca);
  color: white;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 1.5rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.audio-btn-green:hover {
  background-color: var(--color-verde-mesquite);
}

.moment-desc {
  flex: 1.5;
  font-family: var(--font-interface);
  font-size: 0.95rem;
  color: #555;
  padding-left: 1.5rem;
  border-left: 1px solid #eee;
}

.sidebar-card-gradient {
  background: linear-gradient(135deg, #8D6E63 0%, #3E2723 100%);
  color: white;
  border-radius: 8px;
  text-align: center;
  padding: 2rem;
}

.sidebar-info-card {
  border-radius: 8px;
  padding: 1.5rem;
  color: white;
  margin-bottom: 1.5rem;
}

.bg-info-orange {
  background-color: var(--color-sol-del-desierto);
}

.bg-info-green {
  background-color: var(--color-hierba-fresca);
}

.bg-info-purple {
  background-color: #8E24AA;
}

.cycle-bar {
  height: 24px;
  border-radius: 12px;
  background: linear-gradient(90deg, #3E2723 0%, #FFB74D 25%, #FF9800 50%, #E64A19 75%, #4A148C 100%);
  position: relative;
  margin: 2rem 0;
}

.cycle-dot {
  width: 16px;
  height: 16px;
  border: 2px solid white;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}



/* =========================================
   Estilos Hero Carousel
   ========================================= */
.hero-carousel {
  position: relative;
  overflow: hidden;
}

.hero-carousel .carousel-item {
  height: 500px;
  /* Altura fija para el banner */
  background-color: #333;
}

.hero-carousel .carousel-item img {
  object-fit: cover;
  height: 100%;
  width: 100%;
}

/* Overlay oscuro para legibilidad del texto */
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(62, 39, 35, 0.4) 0%, rgba(62, 39, 35, 0.7) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-title {
  font-family: var(--font-content);
  font-size: 3.5rem;
  font-weight: 700;
  color: #fff;
}

.hero-subtitle {
  font-family: var(--font-interface);
  font-size: 1.5rem;
  color: var(--color-sol-del-desierto);
  font-weight: 600;
}

.hero-btn-primary {
  background-color: #fff;
  color: var(--color-tierra-sagrada);
  border: none;
  font-weight: 600;
  padding: 0.75rem 2rem;
  border-radius: 50px;
  transition: all 0.3s;
}

.hero-btn-primary:hover {
  background-color: #f0f0f0;
  transform: translateY(-2px);
  color: var(--color-tierra-sagrada);
}

.hero-btn-outline {
  background-color: transparent;
  color: #fff;
  border: 2px solid #fff;
  font-weight: 600;
  padding: 0.75rem 2rem;
  border-radius: 50px;
  transition: all 0.3s;
}

.hero-btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  color: #fff;
}



/* =========================================
   Estilos Tarjetas Home (Explora Nuestras Secciones)
   ========================================= */
.home-section-card {
  transition: transform 0.3s, box-shadow 0.3s;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.home-section-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.icon-box-shape {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 1.75rem;
  color: white;
}

/* =========================================
   Estilos Específicos de Investigación y Contacto
   ========================================= */

body.page-investigacion main,
body.page-investigacion-full main,
body.page-contacto main {
  flex: 1;
  padding: 2rem 1rem 2.5rem;
  margin-top: var(--header-height);
  /* Fix: Evitar solapamiento con header fijo */
}

/* Forzar tipografía de interfaz para textos y subtítulos en estas páginas */
body.page-investigacion-full p,
body.page-investigacion-full .lead,
body.page-investigacion-full li,
body.page-investigacion-full .small,
body.page-contacto p,
body.page-contacto .lead,
body.page-contacto li,
body.page-contacto .small {
  font-family: var(--font-interface);
}

/* Layout antiguo (Grid 2 columnas) - Se mantiene por compatibilidad si se usa la clase .page-investigacion */
body.page-investigacion .container {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.5fr);
  gap: 2rem;
}

/* Layout Nuevo (Centrado) para Investigación Refactorizada */
body.page-investigacion-full .container {
  /* max-width: 1000px;  <-- REMOVED to allow full grid width */
  max-width: 1400px;
  /* Optional: cap slightly larger than default 1320px if desired, or just let bootstrap handle it. set to 1400 for wide feel */
}

@media (max-width: 800px) {
  body.page-investigacion .container {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Tarjetas Estilo Investigación */
.investigacion-card {
  background-color: #ffffff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-suave);
  padding: 1.75rem 1.5rem;
  border: 1px solid var(--color-card-borde);
}

.investigacion-card+.investigacion-card {
  margin-top: 1.25rem;
}

.card-title {
  font-family: var(--font-content);
  font-weight: 700;
  color: var(--color-naranja);
  margin: 0.3rem 0 0.6rem;
  font-size: 1.5rem;
  text-align: justify;
}

.card-subtitle {
  font-size: 0.95rem;
  color: #555555;
  margin: 0 0 1rem;
  font-family: var(--font-interface);
}

.intro-preservacion {
  background: linear-gradient(120deg, rgba(255, 193, 7, 0.1), rgba(21, 101, 192, 0.05));
  border-left: 4px solid var(--color-amarillo);
  padding: 0.9rem 1rem;
  border-radius: 12px;
  font-size: 0.95rem;
  margin-bottom: 1.1rem;
  font-family: var(--font-interface);
}

.intro-preservacion strong {
  color: var(--color-azul-profundo);
}

.section-title {
  font-family: var(--font-content);
  font-weight: 700;
  font-size: 1.2rem;
  margin: 0 0 0.8rem;
  color: var(--color-verde);
  text-align: justify;
}

.students-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-family: var(--font-interface);
}

.students-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid #eeeeee;
  font-size: 0.95rem;
}

.students-list li:last-child {
  border-bottom: none;
}

.students-list span.programa {
  font-weight: 600;
  color: var(--color-naranja);
}

.cta-section {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px dashed #e0e0e0;
}

.cta-section p {
  margin: 0 0 0.9rem;
  font-size: 0.95rem;
  color: #555555;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.7rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background-image: linear-gradient(135deg, var(--color-amarillo), var(--color-naranja));
  color: #ffffff;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(245, 124, 0, 0.3);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.cta-button span.icon-arrow {
  font-size: 1.1rem;
  line-height: 1;
}

.cta-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(245, 124, 0, 0.32);
  filter: brightness(1.04);
}

.cta-button:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px rgba(245, 124, 0, 0.25);
}

.contact-card {
  background-color: #ffffff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-suave);
  padding: 1.5rem 1.4rem;
  border: 1px solid var(--color-card-borde);
  border-top: 4px solid var(--color-azul);
}

.contact-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.contact-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--color-azul), var(--color-amarillo));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.contact-title {
  margin: 0;
  font-weight: 600;
  font-size: 1rem;
  text-align: justify;
}

.contact-body {
  font-size: 0.93rem;
  font-family: var(--font-interface);
}

.contact-body p {
  margin: 0 0 0.5rem;
}

.contact-body a {
  color: var(--color-azul);
  text-decoration: none;
  font-weight: 500;
}

.contact-body a:hover {
  text-decoration: underline;
}

/* =========================================
   Estilos Personalizados para Alertas (Swal2)
   ========================================= */
.alert-popup-custom {
  border-radius: var(--radius-card) !important;
  border: 1px solid rgba(212, 165, 116, 0.2) !important;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1) !important;
  padding: 2.5rem 2rem !important;
}

.alert-title-custom {
  font-family: var(--font-content) !important;
  font-weight: 700 !important;
  font-size: 1.85rem !important;
  margin-bottom: 0.5rem !important;
  color: var(--color-azul-profundo) !important;
}

.swal2-html-container {
  font-family: var(--font-interface) !important;
  font-size: 1.05rem !important;
  line-height: 1.6 !important;
  color: #5d4037 !important;
}

.alert-btn-custom {
  font-family: var(--font-interface) !important;
  font-weight: 600 !important;
  padding: 0.8rem 2.5rem !important;
  border-radius: 999px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  box-shadow: 0 4px 12px rgba(21, 101, 192, 0.25) !important;
  margin-top: 1rem !important;
}

/* =========================================
   Botón Volver Arriba (Exclusivo Index)
   ========================================= */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background-color: var(--color-azul-profundo);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
  transform: translateY(20px);
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background-color: var(--color-azul);
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  color: white;
}

@media (max-width: 768px) {
  .back-to-top {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 45px;
    height: 45px;
  }
}

/* =========================================
   Página de Login (Diseño Premium)
   ========================================= */
.login-wrapper {
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
  background: linear-gradient(135deg, var(--color-bg-body) 0%, #e0e0e0 100%);
  position: relative;
  overflow: hidden;
  padding: 3rem 1rem;
}

/* Fondo decorativo abstracto */
.login-wrapper::before {
  content: '';
  position: absolute;
  top: -10%;
  right: -10%;
  width: 50%;
  height: 50%;
  background: radial-gradient(circle, rgba(255, 143, 0, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
  z-index: 0;
  border-radius: 50%;
}

.login-wrapper::after {
  content: '';
  position: absolute;
  bottom: -10%;
  left: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(21, 101, 192, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
  z-index: 0;
  border-radius: 50%;
}

.login-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease;
}

.login-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.15);
}

.login-icon i {
  background: -webkit-linear-gradient(45deg, var(--color-tierra-sagrada), var(--color-sol-del-desierto));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Ajustes de inputs flotantes */
.form-floating>.form-control {
  border: 1px solid #e0e0e0;
  background-color: rgba(255, 255, 255, 0.8);
}

.form-floating>.form-control:focus {
  border-color: var(--color-azul);
  box-shadow: 0 0 0 0.25rem rgba(21, 101, 192, 0.15);
  background-color: #fff;
}

.form-floating>label {
  padding-left: 1.25rem;
  color: #757575;
}

.form-check-input:checked {
  background-color: var(--color-azul);
  border-color: var(--color-azul);
}

.login-title {
  font-family: var(--font-content);
  color: var(--color-azul-profundo);
}

.login-card .form-control,
.login-card label,
.login-card .btn,
.login-card .small,
.login-card .form-text {
  font-family: var(--font-interface);
}

/* =========================================
   Panel de Administración
   ========================================= */

/* Layout General */
.admin-layout {
  display: flex;
  min-height: 100vh;
  background-color: #f3f4f6;
  font-family: var(--font-interface);
}

/* Sidebar */
.admin-sidebar {
  width: 280px;
  background-color: var(--color-azul-profundo);
  /* Azul del Footer por orden del usuario */
  color: white;
  flex-shrink: 0;
  min-height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
}

.admin-sidebar hr {
  border-top-color: rgba(255, 255, 255, 0.15);
  opacity: 1;
}

.admin-sidebar .nav-link {
  color: rgba(255, 255, 255, 0.8) !important;
  font-weight: 500;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.25rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
}

.admin-sidebar .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white !important;
  transform: translateX(4px);
}

.admin-sidebar .nav-link.active {
  background-color: var(--color-verde);
  /* Color de acento para item activo */
  color: white !important;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
}

.admin-sidebar .dropdown-toggle {
  padding: 0.5rem;
  border-radius: 8px;
  transition: background-color 0.2s;
}

.admin-sidebar .dropdown-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.admin-sidebar .dropdown-menu-dark {
  background-color: #1a2642;
  /* Un poco más claro que el azul profundo */
  border-color: rgba(255, 255, 255, 0.1);
}

/* Main Content */
.admin-main {
  flex-grow: 1;
  padding: 2rem;
  overflow-y: auto;
  max-width: 100%;
  /* Asegura que no desborde */
}

.admin-header {
  background-color: var(--color-azul-profundo);
  color: white;
  padding: 1.5rem 2rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  /* Ensure flex behavior */
  justify-content: space-between;
  align-items: center;
}

.admin-title {
  font-family: var(--font-content);
  color: white !important;
  font-weight: 700;
  margin-bottom: 0.25rem;
  font-size: 2rem;
}

.admin-header p {
  color: rgba(255, 255, 255, 0.8) !important;
  margin-bottom: 0;
}

/* Tarjetas de Dashboard - Optimizadas */
.stat-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.03);
  height: 100%;
  display: flex;
  align-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-right: 1.25rem;
  flex-shrink: 0;
  color: white;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-azul-profundo);
  line-height: 1.2;
}

.stat-label {
  color: #6c757d;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Acciones Rápidas (Estilo Dashboard) */
.quick-action-card {
  background-color: var(--color-verde);
  color: white;
  border-radius: 12px;
  padding: 2rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  transition: transform 0.2s;
}

.quick-action-card:hover {
  transform: translateY(-3px);
  background-color: #266b2a;
}

/* Tabla de Dashboard */
.card-header-admin {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: white;
  border-radius: 12px 12px 0 0;
}

.card-header-title {
  font-weight: 700;
  color: #344767;
  font-family: var(--font-interface);
  /* Preferencia admin */
  margin: 0;
  font-size: 1.25rem;
}

.admin-table-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: #8898aa;
  letter-spacing: 0.5px;
  background-color: #f8f9fa;
  border-bottom: 1px solid #e9ecef !important;
  padding: 1rem 1.5rem;
  text-align: left;
}

.admin-table td {
  padding: 1rem 1.5rem;
  vertical-align: middle;
  border-bottom: 1px solid #f0f0f0;
  color: #4b5563;
  font-size: 0.95rem;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.action-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-left: 0.25rem;
  transition: opacity 0.2s;
  border: none;
  font-size: 1rem;
}

.action-btn:hover {
  opacity: 0.9;
  color: white;
}

.btn-edit {
  background-color: var(--color-cielo-yoreme);
}

.btn-delete {
  background-color: var(--color-coral-ancestral);
}

/* Responsividad Admin */
@media (max-width: 768px) {
  .admin-layout {
    flex-direction: column;
  }

  .admin-sidebar {
    width: 100%;
    min-height: auto;
    position: relative;
    padding: 1rem;
  }
}

/* Botón Volver Arriba */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  /* bottom: 2rem; - ya está arriba */
  right: 2rem;
  /* Cambiado a derecha */
  display: flex;
  /* Siempre flex, controlamos visibilidad con opacidad */
  z-index: 1050;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background-color: var(--color-azul-profundo);
  color: white;
  border: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  /* Transición suave para opacidad y transformación */
  transition: opacity 0.6s ease, transform 0.6s ease, background-color 0.3s, bottom 0.1s;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  /* No clickable cuando está oculto */
  transform: translateY(20px);
  /* Estado inicial un poco más abajo */
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  /* Sube suavemente a su posición */
}

.back-to-top:hover {
  transform: translateY(-5px);
  /* Pequeño levante al hover */
  background-color: var(--color-azul);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}