/* =============================================================
   INDICADORES INSTITUCIONALES – Estilos propios
   Complementa estilos.css sin modificarlo.
   ============================================================= */

/* ------------------------------------------------------------------
   Barra de filtros globales
   ------------------------------------------------------------------ */
.ind-filtros-globales {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.ind-filtro-grupo {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 160px;
}

.ind-filtro-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
}

.ind-select-filtro {
  appearance: none;
  -webkit-appearance: none;
  padding: 0.45rem 2rem 0.45rem 0.75rem;
  border: 1.5px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  color: #111827;
  background: #f9fafb url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 0.6rem center;
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.ind-select-filtro:hover:not(:disabled) {
  border-color: #007B3E;
}

.ind-select-filtro:focus {
  outline: none;
  border-color: #007B3E;
  box-shadow: 0 0 0 3px rgba(0,123,62,0.12);
}

.ind-select-filtro:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Botón reset */
.ind-btn-reset {
  align-self: flex-end;
  padding: 0.45rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1.5px solid #007B3E;
  color: #007B3E;
  background: transparent;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  white-space: nowrap;
}

.ind-btn-reset:hover:not(:disabled) {
  background: #007B3E;
  color: #ffffff;
}

.ind-btn-reset:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Estado de carga */
.ind-estado-carga {
  align-self: flex-end;
  font-size: 0.8rem;
  color: #6b7280;
  font-style: italic;
  padding-bottom: 0.45rem;
}

.ind-estado-carga.hidden { display: none; }

/* ------------------------------------------------------------------
   Tabs de la vista de indicadores
   Reutilizan .lineamiento-tab-btn de estilos.css;
   solo se añade el control de visibilidad de contenido.
   ------------------------------------------------------------------ */
.ind-tab-contenido {
  display: none;
}

.ind-tab-contenido.activo {
  display: block;
}

/* ------------------------------------------------------------------
   Botones de filtro rápido (Todos / Pregrado / Posgrado)
   ------------------------------------------------------------------ */
.ind-filtro-btn {
  padding: 0.35rem 1rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 2px solid #007B3E;
  color: #007B3E;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.ind-filtro-btn:hover {
  background: #ebf4f0;
}

.ind-filtro-btn.activo {
  background: #007B3E;
  color: #ffffff;
}

/* ------------------------------------------------------------------
   Canvas: contenedores con alturas controladas
   ------------------------------------------------------------------ */

/* Scroll exterior para el gráfico de programas (altura dinámica vía JS) */
.ind-canvas-scroll-outer {
  max-height: 440px;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 0.25rem;
}

/* Contenedor interno: altura establecida por JS según nº de barras */
.ind-canvas-wrap-tall {
  position: relative;
  min-height: 180px;
}

.ind-canvas-wrap-medium {
  position: relative;
  height: 300px;
}

/* ------------------------------------------------------------------
   Tarjeta de campus (acordeón)
   ------------------------------------------------------------------ */
.tarjeta-campus {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  transition: box-shadow 0.2s;
}

.tarjeta-campus:hover {
  box-shadow: 0 4px 12px rgba(0,75,43,0.15);
}

.tarjeta-campus-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  cursor: pointer;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  user-select: none;
}

.tarjeta-campus-header:hover {
  background: #f0fdf4;
}

.tarjeta-campus-nombre {
  font-size: 0.95rem;
  font-weight: 700;
  color: #00482B;
}

.tarjeta-campus-m2 {
  font-size: 0.78rem;
  color: #6b7280;
  margin-top: 0.1rem;
}

.tarjeta-campus-chevron {
  color: #007B3E;
  font-size: 0.85rem;
  transition: transform 0.25s;
}

.tarjeta-campus.abierta .tarjeta-campus-chevron {
  transform: rotate(180deg);
}

.tarjeta-campus-cuerpo {
  display: none;
  padding: 1rem 1.25rem;
}

.tarjeta-campus.abierta .tarjeta-campus-cuerpo {
  display: block;
}

/* ── Imagen de portada del campus ────────────────────────────── */
.tarjeta-campus-portada {
  /* Sangría negativa: la imagen va de borde a borde dentro del cuerpo */
  margin: -1rem -1.25rem 1rem;
  overflow: hidden;
  position: relative;
  /* Sin altura fija: la imagen dicta su propio alto para mostrarse completa */
  line-height: 0; /* elimina espacio inline debajo del <img> */
}

.tarjeta-campus-portada img {
  width: 100%;
  height: auto;          /* respeta el aspecto original de la imagen */
  display: block;
  transition: transform 0.55s ease;
}

/* Zoom suave al hacer hover sobre la tarjeta abierta */
.tarjeta-campus.abierta:hover .tarjeta-campus-portada img {
  transform: scale(1.03);
}

/* Grid de métricas dentro de la tarjeta */
.campus-metricas-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 1rem;
}

.campus-metrica-item {
  display: flex;
  flex-direction: column;
}

.campus-metrica-label {
  font-size: 0.68rem;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.campus-metrica-valor {
  font-size: 1.05rem;
  font-weight: 700;
  color: #111827;
}

/* ------------------------------------------------------------------
   Tarjeta métrica con acento turquesa (infraestructura)
   Variante de .tarjeta-metrica de estilos.css
   ------------------------------------------------------------------ */
.tm-infraestructura {
  border-top: 4px solid #00A99D;
}

.tm-infraestructura .tarjeta-metrica-icono {
  background: #e0f7f6;
  color: #007B78;
}

.tm-infraestructura .tarjeta-metrica-valor {
  color: #007B78;
}

/* ------------------------------------------------------------------
   Barra de filtros por tab (reemplaza la barra global)
   ------------------------------------------------------------------ */
.ind-filtros-tab {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 0.9rem 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

/* ------------------------------------------------------------------
   Tarjetas KPI – nuevo diseño con gradiente institucional
   ------------------------------------------------------------------ */
.kpi-ind-card {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  padding: 1.5rem 1.75rem 1.25rem;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.kpi-ind-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.24);
}

/* Acento inferior */
.kpi-ind-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, rgba(255,255,255,0.45), rgba(255,255,255,0.08));
}

/* Icono marca de agua */
.kpi-ind-card__watermark {
  position: absolute;
  right: -0.5rem;
  bottom: -1rem;
  font-size: 7.5rem;
  opacity: 0.07;
  pointer-events: none;
  line-height: 1;
}

/* Fila superior: etiqueta + badge */
.kpi-ind-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.kpi-ind-card__etiqueta {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.82;
  line-height: 1.3;
}

.kpi-ind-card__badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  white-space: nowrap;
  flex-shrink: 0;
}

.kpi-ind-card__badge--anio {
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  padding: 0.28rem 0.78rem;
  min-width: 3.3rem;
  text-align: center;
  background: rgba(255,255,255,0.28);
  border-color: rgba(255,255,255,0.42);
}

/* Número principal */
.kpi-ind-card__numero {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 0.5rem;
}

/* Pie de tarjeta */
.kpi-ind-card__pie {
  font-size: 0.72rem;
  opacity: 0.7;
  margin-top: 0.25rem;
}

/* Variantes de color */
.kpi-ind-card--verde {
  background: linear-gradient(135deg, #00482B 0%, #007B3E 100%);
}

.kpi-ind-card--teal {
  background: linear-gradient(135deg, #004d4a 0%, #00A99D 100%);
}

/* ------------------------------------------------------------------
   Cita de fuente de datos
   ------------------------------------------------------------------ */
.fuente-datos {
  font-size: 0.72rem;
  color: #9ca3af;
  font-style: italic;
}

.ind-resumen-filtros {
  position: relative;
  background: linear-gradient(135deg, #f3fbf7 0%, #e8f6ef 100%);
  border: 1px solid #cfe8da;
  border-radius: 0.95rem;
  padding: 1rem 1.25rem 1.05rem;
  text-align: center;
  box-shadow: 0 3px 12px rgba(0, 72, 43, 0.1);
}

.ind-resumen-filtros::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 0.95rem 0.95rem 0 0;
  background: linear-gradient(90deg, #007B3E 0%, #00A99D 100%);
}

.ind-resumen-filtros__titulo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #3f5d4b;
  margin-bottom: 0.35rem;
}

.ind-resumen-filtros__titulo i {
  color: #007B3E;
}

.ind-resumen-filtros__texto {
  margin: 0;
  font-size: 1.14rem;
  line-height: 1.42;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #0f5132;
}

@media (max-width: 768px) {
  .ind-resumen-filtros {
    padding: 0.9rem 0.9rem 0.95rem;
  }

  .ind-resumen-filtros__texto {
    font-size: 0.98rem;
  }
}

/* ------------------------------------------------------------------
   Custom dropdowns – reemplazan <select> nativos en vistaIndicadores
   Patrón visual: mismo estilo que .selector-programas de vistaInicio
   ------------------------------------------------------------------ */
.ind-dropdown {
  position: relative;
  display: inline-block;
  min-width: 150px;
  width: 100%;
}

.ind-dropdown-btn {
  width: 100%;
  background: #f9fafb;
  color: #111827;
  border: 1.5px solid #d1d5db;
  border-radius: 0.5rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  transition: border-color 0.18s, box-shadow 0.18s;
  font-family: inherit;
}

.ind-dropdown-btn:hover {
  border-color: #007B3E;
  box-shadow: 0 0 0 3px rgba(0, 123, 62, 0.1);
}

.ind-dropdown.abierto .ind-dropdown-btn {
  border-color: #007B3E;
  box-shadow: 0 0 0 3px rgba(0, 123, 62, 0.15);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.ind-dropdown-texto {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ind-dropdown-flecha {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  fill: #6b7280;
  transition: transform 0.2s ease;
}

.ind-dropdown.abierto .ind-dropdown-flecha {
  transform: rotate(180deg);
  fill: #007B3E;
}

.ind-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1.5px solid #007B3E;
  border-top: none;
  border-bottom-left-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  z-index: 200;
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #007B3E #f1f1f1;
}

.ind-dropdown.abierto .ind-dropdown-menu {
  display: block;
}

.ind-dropdown-opcion {
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
  color: #374151;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.12s;
}

.ind-dropdown-opcion:hover {
  background: #f0faf4;
  color: #007B3E;
}

.ind-dropdown-opcion.activa {
  background: #e6f4ec;
  color: #007B3E;
  font-weight: 600;
}

/* Estado deshabilitado */
.ind-dropdown.disabled .ind-dropdown-btn {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Scrollbar webkit */
.ind-dropdown-menu::-webkit-scrollbar {
  width: 5px;
}
.ind-dropdown-menu::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}
.ind-dropdown-menu::-webkit-scrollbar-thumb {
  background: #007B3E;
  border-radius: 4px;
}
