/* Linguette sezioni azienda — stesso stile pill di Medicina / portal-hub-tabs */

/* Hero + linguette: sticky sotto headbar su tutte le sezioni azienda */
.az-sezione-sticky-chrome,
.az-dettaglio-sticky-chrome,
.fs-hub-page .az-sezione-sticky-chrome {
  position: sticky;
  top: var(--tec-headbar-height, 58px);
  z-index: var(--tec-z-sticky-page, 20);
  margin: 0 0 12px;
  padding: 0 0 2px;
  background: linear-gradient(180deg, #eef6f8 0%, #f4f7f9 100%);
  box-shadow: 0 10px 18px -14px rgba(15, 23, 42, .28);
}
.tec-wrapper.tec-wrapper-azienda-context .az-sezione-sticky-chrome,
.tec-wrapper.tec-wrapper-azienda-context .az-dettaglio-sticky-chrome,
.tec-wrapper.tec-wrapper-azienda-context .fs-hub-page .az-sezione-sticky-chrome {
  top: var(--tec-headbar-azienda-height, var(--tec-headbar-height, 58px));
}
/* Hero dentro sticky-chrome: NON sticky e NON top:96px (altrimenti con
   position:relative lascia ~96px vuoti sopra — tipico bug Lavoratori). */
.az-sezione-sticky-chrome > .hero,
.az-sezione-sticky-chrome > section.hero,
.fs-hub-page .az-sezione-sticky-chrome > .hero,
.fs-hub-page .az-sezione-sticky-chrome > section.hero,
.tec-main-content .az-sezione-sticky-chrome > .hero,
.tec-main-content .az-sezione-sticky-chrome > section.hero,
.tec-main-content-stack .az-sezione-sticky-chrome > .hero,
.tec-main-content-stack .az-sezione-sticky-chrome > section.hero,
.tec-wrapper.tec-wrapper-azienda-context .tec-main-content .az-sezione-sticky-chrome > .hero,
.tec-wrapper.tec-wrapper-azienda-context .tec-main-content .az-sezione-sticky-chrome > section.hero,
.tec-wrapper.tec-wrapper-azienda-context .tec-main-content-stack .az-sezione-sticky-chrome > .hero,
.tec-wrapper.tec-wrapper-azienda-context .tec-main-content-stack .az-sezione-sticky-chrome > section.hero {
  position: relative !important;
  top: auto !important;
  margin-bottom: 14px;
  /* Non dare z-index al hero: nello sticky chrome sovrasterebbe le linguette */
  z-index: auto !important;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .06);
  backdrop-filter: none;
  overflow: hidden; /* card chiusa: le linguette stanno sotto, non dentro */
}
.az-sezione-sticky-chrome > .tec-az-tabs-wrap,
.az-dettaglio-sticky-chrome > .tec-az-tabs-wrap,
.fs-hub-page .az-sezione-sticky-chrome > .tec-az-tabs-wrap {
  position: relative;
  z-index: 2;
  margin: 0;
  /* Spazio ridotto per linguetta attiva compatta */
  padding-top: 6px;
  background: transparent;
  overflow: visible;
  clear: both;
}

/* Hero: KPI affiancati che SI ADATTANO al titolo (come Figure Sicurezza), pulsanti sotto */
.fs-hub-page .hero-actions.hero-actions--stack {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 10px;
  flex: 0 1 auto;
  max-width: min(100%, 42rem);
  margin-left: auto;
}
.fs-hub-page .hero-actions--stack .hero-kpis {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: stretch;
  justify-content: flex-end;
  width: 100%;
}
.fs-hub-page .hero-actions--stack .hero-kpi {
  /* Come .fig-hero-kpi: cresce col testo, non schiaccia i titoli */
  flex: 1 1 auto;
  min-width: 4.5rem;
  width: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  line-height: 1.15;
}
.fs-hub-page .hero-actions--stack a.hero-kpi,
.fs-hub-page .hero-actions--stack button.hero-kpi {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  appearance: none;
  font: inherit;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.fs-hub-page .hero-actions--stack a.hero-kpi:hover,
.fs-hub-page .hero-actions--stack button.hero-kpi:hover {
  border-color: rgba(31, 163, 179, .55);
  background: #f0fafb;
}
.fs-hub-page .hero-actions--stack .hero-kpi.is-active,
.fs-hub-page .hero-actions--stack a.hero-kpi.is-active,
.fs-hub-page .hero-actions--stack button.hero-kpi.is-active {
  border-color: rgba(19, 113, 125, .55);
  background: rgba(31, 163, 179, .14);
  box-shadow: 0 0 0 2px rgba(31, 163, 179, .18);
}
.fs-hub-page .hero-actions--stack a.hero-kpi.is-active strong,
.fs-hub-page .hero-actions--stack a.hero-kpi.is-active .val,
.fs-hub-page .hero-actions--stack button.hero-kpi.is-active .val {
  color: var(--tec-primary-dark, #0f766e);
}
.fs-hub-page .hero-actions--stack .hero-kpi span,
.fs-hub-page .hero-actions--stack .hero-kpi .lbl {
  display: block;
  width: 100%;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--tec-muted, #64748b);
  margin-bottom: 2px;
  text-align: center;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  line-height: 1.2;
}
.fs-hub-page .hero-actions--stack .hero-kpi strong,
.fs-hub-page .hero-actions--stack .hero-kpi .val {
  display: block;
  width: 100%;
  font-size: 1.25rem;
  font-weight: 850;
  color: #0f172a;
  white-space: nowrap;
  text-align: center;
  line-height: 1.2;
  margin: 0;
}
.fs-hub-page .hero-actions--stack .hero-kpi.is-ok .lbl,
.fs-hub-page .hero-actions--stack .hero-kpi.is-ok .val,
.fs-hub-page .hero-actions--stack .hero-kpi.is-ok strong {
  color: #15803d;
}
.fs-hub-page .hero-actions--stack .hero-kpi.is-ok {
  border-color: #bbf7d0;
}
.fs-hub-page .hero-actions--stack .hero-kpi.is-warn .lbl,
.fs-hub-page .hero-actions--stack .hero-kpi.is-warn .val,
.fs-hub-page .hero-actions--stack .hero-kpi.is-warn strong {
  color: #b45309;
}
.fs-hub-page .hero-actions--stack .hero-kpi.is-warn {
  border-color: #fde68a;
}
.fs-hub-page .hero-actions--stack .hero-kpi.is-crit .lbl,
.fs-hub-page .hero-actions--stack .hero-kpi.is-crit .val,
.fs-hub-page .hero-actions--stack .hero-kpi.is-crit strong {
  color: #b91c1c;
}
.fs-hub-page .hero-actions--stack .hero-kpi.is-crit {
  border-color: #fecaca;
}
.fs-hub-page .hero-actions--stack .hero-kpi.is-muted {
  background: #f8fafc;
  color: #64748b;
}
.fs-hub-page .hero-actions--stack .hero-kpi.is-muted strong,
.fs-hub-page .hero-actions--stack .hero-kpi.is-muted .val {
  color: #64748b;
  font-size: 1.25rem;
}
.fs-hub-page .hero-actions--stack .hero-kpi.is-muted .lbl,
.fs-hub-page .hero-actions--stack .hero-kpi.is-muted span:not(.val) {
  font-size: 10px;
}
.fs-hub-page .hero-actions--stack .hero-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
.fs-hub-page .hero-actions--stack .hero-btns .btn {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 1200px) {
  .fs-hub-page .hero-actions.hero-actions--stack {
    margin-left: 0;
    max-width: 100%;
    flex: 1 1 100%;
  }
  .fs-hub-page .hero-actions--stack .hero-kpis,
  .fs-hub-page .hero-actions--stack .hero-btns {
    justify-content: flex-start;
  }
}

.tec-az-tabs-wrap {
  margin: 0 0 1rem;
}

.tec-az-tabs-wrap .tec-az-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0;
  margin: 0;
  padding: 0 0 0 2px;
  list-style: none;
  border-bottom: 1px solid var(--tec-border, #dbe3ea);
  background: transparent;
  isolation: isolate;
}

.tec-az-tabs-wrap .tec-az-tabs > li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tec-az-tabs-wrap .tec-az-tabs a.tec-az-tab,
.tec-az-tabs-wrap .tec-az-tabs button.tec-az-tab,
.fs-hub-page .tec-az-tabs-wrap .tec-az-tabs a.tec-az-tab,
.tec-dettaglio-preview .tec-az-tabs-wrap .tec-az-tabs a.tec-az-tab,
.tec-dettaglio-preview .tec-az-tabs-wrap .tec-az-tabs button.tec-az-tab {
  appearance: none;
  display: inline-flex;
  align-items: center;
  border: 1px solid #94a3b8;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #f8fafc 0%, #eef3f7 100%);
  padding: 5px 9px;
  margin-right: 3px;
  color: #1e293b !important;
  font-weight: 700;
  font-size: 11px;
  text-decoration: none !important;
  line-height: 1.15;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  box-shadow: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.tec-az-tabs-wrap .tec-az-tabs a.tec-az-tab:hover,
.tec-az-tabs-wrap .tec-az-tabs button.tec-az-tab:hover,
.fs-hub-page .tec-az-tabs-wrap .tec-az-tabs a.tec-az-tab:hover,
.tec-dettaglio-preview .tec-az-tabs-wrap .tec-az-tabs a.tec-az-tab:hover,
.tec-dettaglio-preview .tec-az-tabs-wrap .tec-az-tabs button.tec-az-tab:hover {
  background: #fff;
  border-color: var(--tec-primary-dark, #147988);
  color: var(--tec-primary-dark, #147988) !important;
}

.tec-az-tabs-wrap .tec-az-tabs a.tec-az-tab.is-active,
.tec-az-tabs-wrap .tec-az-tabs a.tec-az-tab.active,
.tec-az-tabs-wrap .tec-az-tabs button.tec-az-tab.is-active,
.tec-az-tabs-wrap .tec-az-tabs button.tec-az-tab.active,
.fs-hub-page .tec-az-tabs-wrap .tec-az-tabs a.tec-az-tab.is-active,
.tec-dettaglio-preview .tec-az-tabs-wrap .tec-az-tabs a.tec-az-tab.active,
.tec-dettaglio-preview .tec-az-tabs-wrap .tec-az-tabs button.tec-az-tab.active {
  background: linear-gradient(180deg, #ffffff 0%, #e8f7f9 100%);
  color: var(--tec-primary-dark, #147988) !important;
  border-color: var(--tec-primary-dark, #147988);
  border-width: 1px;
  border-bottom: 0;
  font-size: 11.5px;
  font-weight: 800;
  padding: 6px 10px;
  margin-right: 4px;
  z-index: 2;
  box-shadow: 0 1px 4px rgba(31, 163, 179, .12);
  transform: none;
}

.tec-az-tabs-wrap .tec-az-tabs a.tec-az-tab.is-active::after,
.tec-az-tabs-wrap .tec-az-tabs a.tec-az-tab.active::after,
.tec-az-tabs-wrap .tec-az-tabs button.tec-az-tab.is-active::after,
.tec-az-tabs-wrap .tec-az-tabs button.tec-az-tab.active::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--tec-primary, #1FA3B3);
}

.tec-az-tabs-wrap .tec-az-tabs-sep {
  width: 1px;
  align-self: stretch;
  margin: 6px 8px 0;
  background: #cbd5e1;
  list-style: none;
  flex: 0 0 auto;
  min-height: 1.6rem;
}

/* Secondari solo su Dettaglio (Figure / Comunicazioni) */
.tec-az-secondary-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.tec-az-secondary-tabs .tab-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  padding: 6px 12px;
  color: #475569;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
}

.tec-az-secondary-tabs .tab-btn:hover {
  border-color: var(--tec-primary-dark, #147988);
  color: var(--tec-primary-dark, #147988);
}

.tec-az-secondary-tabs .tab-btn.active {
  border-color: var(--tec-primary-dark, #147988);
  color: var(--tec-primary-dark, #147988);
  background: #f0fafa;
}

@media (max-width: 900px) {
  .tec-az-tabs-wrap .tec-az-tabs a.tec-az-tab,
  .tec-az-tabs-wrap .tec-az-tabs button.tec-az-tab {
    padding: 5px 8px;
    font-size: 11px;
    margin-right: 2px;
  }
  .tec-az-tabs-wrap .tec-az-tabs a.tec-az-tab.is-active,
  .tec-az-tabs-wrap .tec-az-tabs a.tec-az-tab.active,
  .tec-az-tabs-wrap .tec-az-tabs button.tec-az-tab.is-active,
  .tec-az-tabs-wrap .tec-az-tabs button.tec-az-tab.active {
    font-size: 11.5px;
    padding: 6px 9px;
  }
}
