/* =================================================================
 * talento-dashboard.css
 * Estilos dedicados del módulo Talento Humano (DataLab).
 *
 * Extiende los componentes compartidos definidos en
 * estudiantes-dashboard.css (.ed-*) con la identidad del módulo:
 * un acento turquesa→violeta (planta profesoral) y un layout
 * dual-column con filtros sticky.
 *
 * Tokens en datalab-tokens.css.
 * ================================================================= */

/* ─── Acentos del módulo ─────────────────────────────── */
:root {
  --th-accent:        #00b9a3;
  --th-accent-2:      #6f4cff;
  --th-accent-soft:   rgba(0, 185, 163, 0.10);
  --th-accent-ring:   rgba(0, 185, 163, 0.32);
  --th-gold:          #b5a160;
  --th-ink:           #0d2c26;
  --th-muted:         #5a7870;
  --th-line:          rgba(0, 89, 78, 0.12);
  --th-line-strong:   rgba(0, 89, 78, 0.22);
}

/* ─── Hero del módulo ────────────────────────────────── */
.ed-hero.th-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(140% 90% at 12% 18%, rgba(0, 185, 163, 0.18) 0%, rgba(0, 185, 163, 0) 60%),
    radial-gradient(120% 80% at 96% 14%, rgba(111, 76, 255, 0.16) 0%, rgba(111, 76, 255, 0) 55%),
    linear-gradient(135deg, #013d36 0%, #00594e 55%, #017463 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  color: #ffffff;
  padding: 28px clamp(20px, 3vw, 36px);
  box-shadow: 0 18px 44px rgba(0, 38, 31, 0.22);
}
.ed-hero.th-hero::before {
  content: "";
  position: absolute;
  inset: -1px -1px auto -1px;
  height: 4px;
  background: linear-gradient(90deg, var(--th-accent) 0%, var(--th-accent-2) 50%, var(--th-gold) 100%);
  border-radius: 22px 22px 0 0;
  opacity: 0.95;
}
.ed-hero.th-hero::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -60px;
  width: 220px; height: 220px;
  background:
    radial-gradient(closest-side, rgba(255, 255, 255, 0.08), transparent 70%);
  pointer-events: none;
}

.ed-hero.th-hero .ed-hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
  gap: clamp(20px, 4vw, 40px);
  align-items: center;
}
.ed-hero.th-hero .ed-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}
.ed-hero.th-hero .ed-hero-title {
  font-family: var(--dl-font-display);
  font-size: clamp(1.65rem, 2.6vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.015em;
  margin: 10px 0 8px;
  color: #ffffff;
}
.ed-hero.th-hero .ed-hero-desc {
  max-width: 640px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.96rem;
  margin: 0 0 14px;
  line-height: 1.55;
}
.ed-hero.th-hero .ed-active-filters .ed-filter-badge {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

/* ─── KPIs ───────────────────────────────────────────── */
.ed-hero.th-hero .ed-kpi-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.ed-hero.th-hero .ed-kpi {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform var(--dl-transition-fast), background var(--dl-transition-fast);
  overflow: hidden;
}
.ed-hero.th-hero .ed-kpi:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.16);
}
.ed-hero.th-hero .ed-kpi::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: var(--th-accent);
  opacity: 0.85;
}
.ed-hero.th-hero .ed-kpi-icon {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 1.15rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.ed-hero.th-hero .ed-kpi-value {
  font-family: var(--dl-font-display);
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
  color: #ffffff;
  letter-spacing: -0.01em;
}
.ed-hero.th-hero .ed-kpi-label {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.78);
  margin-top: 4px;
  font-weight: 600;
}
.ed-kpi.th-kpi--profesores::after     { background: linear-gradient(90deg, #00b9a3, #6dd5c7); }
.ed-kpi.th-kpi--tiempocompleto::after { background: linear-gradient(90deg, #6f4cff, #b89bff); }
.ed-kpi.th-kpi--doctorado::after      { background: linear-gradient(90deg, #b5a160, #e9d893); }
.ed-kpi.th-kpi--profesores     .ed-kpi-icon { background: rgba(0, 185, 163, 0.22); }
.ed-kpi.th-kpi--tiempocompleto .ed-kpi-icon { background: rgba(111, 76, 255, 0.22); }
.ed-kpi.th-kpi--doctorado      .ed-kpi-icon { background: rgba(181, 161, 96, 0.22); }

@media (max-width: 992px) {
  .ed-hero.th-hero .ed-hero-inner { grid-template-columns: 1fr; }
  .ed-hero.th-hero .ed-kpi-group  { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .ed-hero.th-hero .ed-kpi-group  { grid-template-columns: 1fr; }
}

/* ─── Tabs (Profesores / Administrativo / Apoyo) ────── */
.ed-tabs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  background: #ffffff;
  border: 1px solid var(--th-line);
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(0, 38, 31, 0.05);
}
.ed-tabs-bar .chip-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--th-muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--dl-transition-fast), color var(--dl-transition-fast), border-color var(--dl-transition-fast), box-shadow var(--dl-transition-fast);
}
.ed-tabs-bar .chip-tab:hover:not(:disabled) {
  background: rgba(0, 185, 163, 0.08);
  color: var(--th-ink);
}
.ed-tabs-bar .chip-tab.active {
  background: linear-gradient(135deg, #00b9a3 0%, #00897a 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(0, 185, 163, 0.32);
}
.ed-tabs-bar .chip-tab i { font-size: 0.95rem; }

.ed-tabs-bar .chip-tab.th-coming-soon {
  background: rgba(0, 89, 78, 0.04);
  color: rgba(13, 44, 38, 0.45);
  cursor: not-allowed;
  border: 1px dashed var(--th-line-strong);
}
.ed-tabs-bar .chip-tab.th-coming-soon:disabled { opacity: 1; }

.th-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(181, 161, 96, 0.18);
  color: #8b7434;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

/* ─── Layout dual-column ─────────────────────────────── */
.th-tab-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}
.th-charts-col  { min-width: 0; }
.th-filters-col { min-width: 0; }

@media (max-width: 1199px) {
  .th-tab-layout { grid-template-columns: 1fr; }
}

/* Sticky panel de filtros en desktop */
@media (min-width: 1200px) {
  .th-filters-col {
    position: sticky;
    top: 84px;          /* deja respirar al header sticky (64px + 20) */
  }
}

/* ─── Filter card ────────────────────────────────────── */
.card.th-filter-card {
  background: #ffffff;
  border: 1px solid var(--th-line);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(0, 38, 31, 0.06);
  overflow: hidden;
}
.card.th-filter-card > .card-body {
  position: relative;
  padding: 1.25rem 1.25rem 1.1rem;
}
.card.th-filter-card > .card-body::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--th-accent) 0%, var(--th-accent-2) 100%);
  opacity: 0.95;
}

.card.th-filter-card .ed-sidebar-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 6px;
}
.card.th-filter-card .ed-sidebar-kicker-icon {
  width: 32px; height: 32px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--th-accent) 0%, var(--th-accent-2) 100%);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(111, 76, 255, 0.28);
  font-size: 0.92rem;
}
.card.th-filter-card .ed-sidebar-kicker h6 {
  margin: 0;
  font-family: var(--dl-font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--th-ink);
  letter-spacing: -0.01em;
}
.card.th-filter-card .ed-sidebar-desc {
  margin: 0 0 0.6rem;
  font-size: 0.82rem;
  color: var(--th-muted);
  line-height: 1.45;
}

.card.th-filter-card .ed-filter-section {
  padding: 0.85rem 0;
  border-top: 1px solid var(--th-line);
}
.card.th-filter-card .ed-filter-section:first-of-type { border-top: 0; }

.card.th-filter-card .ed-filter-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--th-ink);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}
.card.th-filter-card .ed-filter-label i { color: var(--th-accent); }

.card.th-filter-card .form-select,
.card.th-filter-card .form-select-sm {
  border-radius: 10px;
  border: 1px solid var(--th-line-strong);
  background-color: #ffffff;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  color: var(--th-ink);
  font-weight: 500;
  font-size: 0.86rem;
  transition: border-color var(--dl-transition-fast), box-shadow var(--dl-transition-fast);
}
.card.th-filter-card .form-select:focus {
  border-color: var(--th-accent);
  box-shadow: 0 0 0 3px var(--th-accent-ring);
  outline: 0;
}

.card.th-filter-card .ed-slider-label {
  font-size: 0.8rem;
  color: var(--th-muted);
  margin-top: 8px;
}
.card.th-filter-card .ed-slider-label strong { color: var(--th-ink); }

/* Botón "Limpiar filtros" — override del style inline */
.card.th-filter-card #btnLimpiarFiltrosTH {
  background: var(--th-accent-soft) !important;
  color: #00594e !important;
  border: 1px solid var(--th-accent-ring) !important;
  border-radius: 10px !important;
  padding: 0.55rem 0.75rem;
  font-size: 0.86rem;
  transition: background var(--dl-transition-fast), border-color var(--dl-transition-fast), transform var(--dl-transition-fast);
}
.card.th-filter-card #btnLimpiarFiltrosTH:hover {
  background: rgba(0, 185, 163, 0.18) !important;
  border-color: var(--th-accent) !important;
  transform: translateY(-1px);
}

/* ─── Section header del tab ─────────────────────────── */
.ed-section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: #ffffff;
  border: 1px solid var(--th-line);
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0, 38, 31, 0.04);
}
.ed-section-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 1.15rem;
  color: #ffffff;
  flex: 0 0 auto;
  box-shadow: 0 6px 14px rgba(111, 76, 255, 0.28);
}
.ed-section-icon.is-purple {
  background: linear-gradient(135deg, #6f4cff 0%, #00b9a3 100%);
}
.ed-section-title {
  font-family: var(--dl-font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--th-ink);
  line-height: 1.2;
}
.ed-section-sub {
  font-size: 0.84rem;
  color: var(--th-muted);
  margin-top: 2px;
}

/* ─── Chart cards (override fino) ────────────────────── */
.card.ed-chart-card {
  border: 1px solid var(--th-line);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(0, 38, 31, 0.05);
  transition: transform var(--dl-transition-fast), box-shadow var(--dl-transition-fast), border-color var(--dl-transition-fast);
}
.card.ed-chart-card:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 185, 163, 0.30);
  box-shadow: 0 14px 28px rgba(0, 38, 31, 0.09);
}
.card.ed-chart-card .card-body { padding: 1rem 1.1rem 0.85rem; }

.ed-chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0.45rem;
}
.ed-chart-header-left { min-width: 0; }
.ed-chart-kicker {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--th-accent);
  margin-bottom: 2px;
}
.ed-chart-title {
  font-family: var(--dl-font-display);
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--th-ink);
  margin: 0;
  letter-spacing: -0.01em;
}

.ed-btn-export {
  display: inline-grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: rgba(25, 195, 125, 0.10);
  border: 1px solid rgba(25, 195, 125, 0.28);
  color: #117a4d;
  cursor: pointer;
  transition: background var(--dl-transition-fast), transform var(--dl-transition-fast), box-shadow var(--dl-transition-fast);
}
.ed-btn-export:hover {
  background: rgba(25, 195, 125, 0.18);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(25, 195, 125, 0.22);
}

/* ─── Image card del módulo ──────────────────────────── */
.card.ed-image-card {
  border: 1px solid var(--th-line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0, 38, 31, 0.08);
}
.img-modulo-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.img-modulo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dl-transition);
}
.card.ed-image-card:hover .img-modulo { transform: scale(1.04); }
.img-modulo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 38, 31, 0) 50%, rgba(0, 38, 31, 0.78) 100%);
  display: flex; align-items: flex-end;
  padding: 14px;
}
.img-modulo-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  font-family: var(--dl-font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.img-modulo-title i { color: var(--th-accent); }

/* ─── noUiSlider tema talento ────────────────────────── */
#sliderTHProfesores.noUi-target {
  background: rgba(0, 89, 78, 0.10);
  border: 0;
  box-shadow: none;
  height: 6px;
  border-radius: 999px;
}
#sliderTHProfesores .noUi-connect {
  background: linear-gradient(90deg, var(--th-accent) 0%, var(--th-accent-2) 100%);
  box-shadow: 0 2px 6px rgba(0, 185, 163, 0.32);
}
#sliderTHProfesores .noUi-handle {
  width: 22px !important;
  height: 22px !important;
  top: -8px !important;
  right: -11px !important;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--th-accent);
  box-shadow: 0 4px 10px rgba(0, 89, 78, 0.18);
  cursor: grab;
}
#sliderTHProfesores .noUi-handle::before,
#sliderTHProfesores .noUi-handle::after { display: none; }
#sliderTHProfesores .noUi-tooltip {
  background: var(--th-ink);
  color: #ffffff;
  border: 0;
  border-radius: 6px;
  font-size: 0.72rem;
  padding: 3px 7px;
  bottom: 130%;
}

/* ─── Filter badges del hero ─────────────────────────── */
.ed-filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

/* ─── Chips dinámicos (resumen de filtros activos) ───── */
#chipsFiltrosTH .ed-filter-chip,
.ed-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.30);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 600;
}
.ed-filter-chip button {
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.7rem;
  cursor: pointer;
  padding: 0 0 0 4px;
  line-height: 1;
}
.ed-filter-chip button:hover { color: #ffffff; }

/* ─── Toast ──────────────────────────────────────────── */
#toastContainer .toast {
  border-radius: 12px;
  box-shadow: 0 14px 32px rgba(0, 38, 31, 0.18);
  border: 1px solid var(--th-line);
}
