/* ===== HSE Page — Dashboard NEXO ===== */
.hse-page {
  background: var(--bg-light);
  --dash-bg: var(--bg-light);
  --dash-card: #ffffff;
  --dash-border: #dce1e8;
  --dash-navy-dark: var(--navy-dark);
  --dash-navy: var(--navy);
  --dash-gray: var(--gray);
  --dash-silver: var(--silver);
  --dash-gold: var(--gold);
}

.navbar--solid { background: var(--navy-dark); }

/* Hero */
.hse-hero {
  margin-top: 64px;
  padding: 48px 0 40px;
  background: linear-gradient(120deg, var(--navy-dark) 0%, var(--navy) 50%, var(--hero-mid) 100%);
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.hse-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(var(--gold-rgb),0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hse-hero .container { position: relative; z-index: 1; }

.hse-hero__badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dash-gold);
  background: rgba(var(--gold-rgb), 0.12);
  border: 1px solid rgba(var(--gold-rgb), 0.35);
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.hse-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  margin-bottom: 12px;
  max-width: 680px;
}

.hse-hero p {
  font-size: 1rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.7;
  max-width: 780px;
}

/* Info — Servicios visuales + Indicadores */
.hse-offer {
  padding: 56px 0 48px;
  background: var(--bg-light);
}

.hse-indicators {
  padding: 56px 0 64px;
  background: linear-gradient(180deg, var(--dash-navy-dark) 0%, #152a42 100%);
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.hse-indicators::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -80px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(var(--gold-rgb), 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hse-section-head {
  margin-bottom: 36px;
  max-width: 720px;
}

.hse-section-head--center {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.hse-section-head__tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dash-navy);
  background: rgba(30, 58, 95, 0.08);
  border: 1px solid rgba(30, 58, 95, 0.15);
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 14px;
}

.hse-section-head__tag--gold {
  color: var(--dash-gold);
  background: rgba(var(--gold-rgb), 0.12);
  border-color: rgba(var(--gold-rgb), 0.35);
}

.hse-section-head h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--dash-navy-dark);
  margin-bottom: 12px;
  line-height: 1.2;
}

.hse-indicators .hse-section-head h2 { color: var(--white); }

.hse-section-head__lead {
  font-size: 0.95rem;
  color: var(--gray);
  line-height: 1.7;
}

.hse-indicators .hse-section-head__lead { color: var(--dash-silver); }

/* Service cards — estilo index */
.hse-svc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.hse-svc-card {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(13, 27, 42, 0.1);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  background: var(--dash-navy-dark);
}

.hse-svc-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 48px rgba(13, 27, 42, 0.16);
}

.hse-svc-card__img {
  height: 160px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--dash-navy);
}

.hse-svc-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.hse-svc-card:hover .hse-svc-card__img img { transform: scale(1.08); }

.hse-svc-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--dash-navy-dark);
  padding: 22px 22px 26px;
  position: relative;
}

.hse-svc-card__icon {
  width: 44px;
  height: 44px;
  background: var(--dash-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -44px;
  margin-bottom: 14px;
  color: var(--dash-navy-dark);
  box-shadow: 0 4px 12px rgba(var(--gold-rgb), 0.35);
}

.hse-svc-card__icon svg { width: 22px; height: 22px; }

.hse-svc-card__tag {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dash-silver);
  margin-bottom: 4px;
}

.hse-svc-card__body h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dash-gold);
  margin-bottom: 8px;
}

.hse-svc-card__body p {
  font-size: 0.82rem;
  color: var(--dash-silver);
  line-height: 1.55;
}

/* Indicator cards */
.hse-ind-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  position: relative;
  z-index: 1;
}

.hse-ind-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 22px;
  transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
  border-top: 3px solid var(--dash-gold);
}

.hse-ind-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(var(--gold-rgb), 0.3);
}

.hse-ind-card--gold { border-top-color: var(--dash-gold); }
.hse-ind-card--navy { border-top-color: var(--dash-navy); }
.hse-ind-card--gray { border-top-color: var(--dash-gray); }
.hse-ind-card--silver { border-top-color: var(--dash-silver); }

.hse-ind-card--wide {
  grid-column: span 3;
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.hse-ind-card__icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: rgba(var(--gold-rgb), 0.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dash-gold);
  margin-bottom: 12px;
}

.hse-ind-card--wide .hse-ind-card__icon { margin-bottom: 0; }

.hse-ind-card__icon svg { width: 20px; height: 20px; }

.hse-ind-card h3 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
}

.hse-ind-card p {
  font-size: 0.8rem;
  color: var(--dash-silver);
  line-height: 1.55;
}

.hse-ind-cta {
  margin-top: 40px;
  text-align: center;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.hse-ind-cta span {
  font-size: 0.75rem;
  color: rgba(191, 197, 204, 0.7);
}

/* Dashboard shell */
.hse-dashboard { padding: 48px 0 56px; background: var(--bg-light); }

.hse-dashboard-intro {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 28px;
}

.hse-dashboard-intro h2 {
  font-size: clamp(1.3rem, 2.5vw, 1.75rem);
  font-weight: 800;
  color: var(--dash-navy-dark);
  margin-bottom: 8px;
}

.hse-dashboard-intro p {
  font-size: 0.88rem;
  color: var(--gray);
  line-height: 1.6;
}

.hse-dashboard__shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  max-width: 1440px;
  margin: 0 auto;
  width: 96%;
  gap: 0;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(13, 27, 42, 0.1);
  border: 1px solid var(--dash-border);
}

/* Sidebar — identidad NEXO */
.hse-sidebar {
  background: var(--dash-navy-dark);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-right: none;
}

.hse-sidebar__brand strong {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--dash-gold);
}

.hse-sidebar__brand span {
  font-size: 0.68rem;
  color: var(--dash-silver);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hse-sidebar__filter label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  color: var(--dash-silver);
}

.hse-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(191, 197, 204, 0.25);
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

.hse-select option {
  background: var(--dash-navy-dark);
  color: var(--white);
}

.hse-select--inline { width: auto; min-width: 130px; }

.hse-main .hse-select {
  background: var(--dash-card);
  color: var(--dash-navy-dark);
  border-color: var(--dash-border);
}

.hse-main .hse-select option {
  background: var(--dash-card);
  color: var(--dash-navy-dark);
}

.hse-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.hse-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--dash-silver);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.hse-nav-btn::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dash-gray);
  flex-shrink: 0;
}

.hse-nav-btn[data-view="general"]::before { background: var(--dash-gold); }
.hse-nav-btn[data-view="detalle"]::before { background: var(--dash-navy); border: 1px solid var(--dash-silver); }
.hse-nav-btn[data-view="accidentes"]::before { background: var(--dash-gray); }
.hse-nav-btn[data-view="unidad"]::before { background: var(--dash-silver); }

.hse-nav-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
}

.hse-nav-btn.is-active {
  background: rgba(var(--gold-rgb), 0.12);
  color: var(--dash-gold);
  font-weight: 700;
  border-left-color: var(--dash-gold);
}

/* Main area */
.hse-main {
  background: var(--dash-bg);
  padding: 24px;
  overflow-x: auto;
}

.hse-view { display: none; animation: fadeIn 0.35s ease; }
.hse-view.is-active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.hse-view-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--dash-gold);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* KPI strip */
.hse-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.hse-kpi {
  background: var(--dash-card);
  border-radius: 14px;
  padding: 18px 20px;
  border: 1px solid var(--dash-border);
  position: relative;
  overflow: hidden;
}

.hse-kpi::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.hse-kpi--green::before { background: var(--dash-gold); }
.hse-kpi--blue::before { background: var(--dash-navy); }
.hse-kpi--orange::before { background: var(--dash-gray); }
.hse-kpi--purple::before { background: var(--dash-silver); }

.hse-kpi__label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray);
  margin-bottom: 6px;
}

.hse-kpi__value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--dash-navy-dark);
  line-height: 1;
}

.hse-kpi__sub {
  font-size: 0.72rem;
  color: var(--gray);
  margin-top: 6px;
}

.hse-kpi__trend {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 8px;
}

.hse-kpi__trend--up { background: rgba(var(--gold-rgb), 0.18); color: var(--gold-text); }
.hse-kpi__trend--down { background: rgba(107, 114, 128, 0.15); color: var(--dash-gray); }

/* Filters */
.hse-filters {
  background: var(--dash-card);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  border: 1px solid var(--dash-border);
}

.hse-filters--row { justify-content: flex-start; }
.hse-filters--center { flex-direction: column; align-items: stretch; }

.hse-filters__label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--dash-navy-dark);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  min-width: 50px;
}

.hse-filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hse-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}

.hse-pills--scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 4px;
}

.hse-pills--units { margin-top: 10px; }

.hse-pill {
  padding: 8px 16px;
  border: 1px solid var(--dash-border);
  border-radius: 20px;
  background: var(--dash-card);
  color: var(--gray);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.hse-pill:hover {
  border-color: var(--dash-gold);
  color: var(--dash-navy-dark);
  background: rgba(var(--gold-rgb), 0.08);
}

.hse-pill.is-active {
  background: var(--dash-gold);
  color: var(--dash-navy-dark);
  border-color: var(--dash-gold);
  font-weight: 700;
}

/* Chart cards — brochure NEXO */
.dash-card {
  background: var(--dash-card);
  border-radius: 16px;
  border: 1px solid var(--dash-border);
  margin-bottom: 18px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(13, 27, 42, 0.04);
}

.dash-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--dash-border);
}

.dash-card__head--teal { border-left: 4px solid var(--dash-gold); }
.dash-card__head--blue { border-left: 4px solid var(--dash-navy); }
.dash-card__head--orange { border-left: 4px solid var(--dash-gray); }
.dash-card__head--purple { border-left: 4px solid var(--dash-silver); }
.dash-card__head--gold { border-left: 4px solid var(--dash-gold); }

.dash-card__head h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dash-navy-dark);
  margin-bottom: 4px;
}

.dash-card__desc {
  font-size: 0.78rem;
  color: var(--gray);
  line-height: 1.4;
}

.unit-label {
  font-weight: 700;
  color: var(--dash-navy);
}

.dash-card__badge {
  flex-shrink: 0;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--dash-navy-dark);
  background: rgba(var(--gold-rgb), 0.12);
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(var(--gold-rgb), 0.35);
}

.dash-card__body {
  padding: 16px 20px 20px;
}

.hse-chart-wrap {
  position: relative;
  height: 300px;
  width: 100%;
}

.hse-chart-wrap--tall { height: 400px; }
.hse-chart-wrap--wide { height: 340px; }
.hse-chart-wrap--sm { height: 260px; }

.hse-charts-stack { display: flex; flex-direction: column; gap: 0; }

.hse-charts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.hse-charts-grid .dash-card { margin-bottom: 0; }

.hse-charts-grid .dash-card__head { padding: 14px 16px; }
.hse-charts-grid .dash-card__head h3 { font-size: 0.82rem; }
.hse-charts-grid .dash-card__desc { font-size: 0.7rem; }

/* Legacy class mapping */
.hse-chart-card { display: contents; }

.hse-footer {
  background: var(--dash-navy-dark);
  color: var(--dash-silver);
  padding: 32px 0;
  text-align: center;
}

.hse-footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.hse-footer p { font-size: 0.8rem; }

@media (max-width: 1100px) {
  .hse-kpis { grid-template-columns: repeat(2, 1fr); }
  .hse-charts-grid { grid-template-columns: repeat(2, 1fr); }
  .hse-svc-grid { grid-template-columns: repeat(2, 1fr); }
  .hse-ind-grid { grid-template-columns: repeat(2, 1fr); }
  .hse-ind-card--wide { grid-column: span 2; }
}

@media (max-width: 900px) {
  .hse-dashboard__shell { grid-template-columns: 1fr; }
  .hse-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid rgba(191, 197, 204, 0.2);
  }
  .hse-sidebar__nav {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
  }
  .hse-nav-btn { flex: 1; min-width: 130px; }
  .hse-svc-grid { grid-template-columns: 1fr; }
  .hse-ind-grid { grid-template-columns: 1fr; }
  .hse-ind-card--wide { grid-column: span 1; flex-direction: column; }
}

@media (max-width: 600px) {
  .hse-kpis { grid-template-columns: 1fr; }
  .hse-charts-grid { grid-template-columns: 1fr; }
  .hse-chart-wrap--tall { height: 320px; }
}
