html {
  /* Base tipografica più compatta su 24"/FHD (senza zoom: spezza l’altezza viewport). */
  font-size: 13px;
  position: relative;
  min-height: 100%;
}

/* Tablet: densità ridotta su shell, tabelle, form, bottoni */
@media (min-width: 768px) and (max-width: 1199.98px) {
  .tec-main-content {
    padding: 0 0.85rem 1rem;
  }

  .tec-footer {
    padding: 0.5rem 0.85rem;
    font-size: 0.8rem;
  }

  .tec-sidebar .tec-nav-link,
  .tec-sidebar a.tec-nav-link {
    font-size: calc(0.82rem + 1px);
    padding: 0.4rem 0.75rem;
  }

  .tec-headbar-username {
    font-size: 0.8rem;
  }

  .tec-headbar-logout,
  .tec-headbar-back {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
  }

  .tec-headbar-top .tec-azienda-bar-in-headbar .tec-azienda-bar-label {
    font-size: 0.82rem;
  }

  .tec-headbar-top .tec-azienda-bar-in-headbar .tec-azienda-bar-item.tec-azienda-bar-pill {
    font-size: 0.72rem;
    padding: 0.2rem 0.5rem;
  }

  .tec-main-content .btn:not(.btn-lg) {
    font-size: 0.8rem;
  }

  .tec-main-content .btn-sm {
    font-size: 0.72rem;
    padding: 0.2rem 0.5rem;
  }

  .tec-main-content .form-control,
  .tec-main-content .form-select {
    font-size: 0.85rem;
  }

  .tec-main-content .form-control-sm,
  .tec-main-content .form-select-sm {
    font-size: 0.78rem;
    min-height: calc(1.5em + 0.45rem + 2px);
    padding: 0.2rem 0.5rem;
  }

  .tec-main-content .table:not(.tec-table-plain) > :not(caption) > * > * {
    padding: 0.35rem 0.45rem;
    font-size: 0.8rem;
  }

  .tec-main-content .data-table th,
  .tec-main-content .data-table td,
  .tec-main-content .table-sortable th,
  .tec-main-content .table-sortable td {
    font-size: 0.78rem;
    padding: 0.3rem 0.4rem;
  }

  .tec-main-content h1,
  .tec-main-content .h1 {
    font-size: 1.45rem;
  }

  .tec-main-content h2,
  .tec-main-content .h2 {
    font-size: 1.25rem;
  }

  .tec-main-content h3,
  .tec-main-content .h3 {
    font-size: 1.1rem;
  }

  .tec-main .card-body {
    padding: 0.85rem;
  }

  .tec-main .card-header {
    padding: 0.5rem 0.85rem;
    font-size: 0.9rem;
  }

  .tec-pagination,
  .table-toolbar.tec-pagination {
    font-size: 0.78rem;
    gap: 0.35rem;
  }
}


* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--tec-content-bg);
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem #fff, 0 0 0 0.25rem #1FA3B3;
}

/* ========== Palette ERP-Tecsial ========== */
:root {
  /* Palette Area Clienti / Formazione Soft UI — più satura, meno “spenta” */
  --tec-sidebar-bg: #0E7A96;
  --tec-sidebar-bg-dark: #0A5A70;
  --tec-sidebar-hover: #1290B0;
  --tec-sidebar-active: #00A3C9;
  --tec-sidebar-text: #E8F4F8;

  --tec-topbar-bg: #FFFFFF;
  --tec-topbar-border: #E5E7EB;
  --tec-topbar-text: #5A5E5F;

  --tec-content-bg: #F7F9FA;
  --tec-card-bg: #FFFFFF;
  --tec-card-border: #E6E8EB;

  --tec-table-header-bg: #1FA3B3;
  --tec-table-header-bg-hover: #189aad;
  /* Modal: modalità grigia (neutra). Teal resta sulle tabelle. */
  --tec-modal-header-bg: #eef1f4;
  --tec-modal-header-fg: #16202a;
  --tec-modal-header-border: #d9e2ea;

  --tec-modulo-sicurezza: #1FA3B3;
  --tec-modulo-formazione: #2563EB;
  --tec-modulo-medicina: #22C55E;
  --tec-modulo-attrezzature: #F59E0B;
  --tec-modulo-sopralluoghi: #8B5CF6;

  --tec-sidebar-width: 220px;
  --tec-sidebar-collapsed-width: 64px;
  --tec-headbar-height: 50px;
  --tec-headbar-toolbar-height: 44px;

  /* Stacking: contenuto pagina << shell << modali */
  --tec-z-content: 1;
  --tec-z-sticky-page: 20;
  --tec-z-headbar: 1100;
  --tec-z-drawer-backdrop: 1200;
  --tec-z-drawer: 1300;
  --tec-z-modal: 1400;
}

/* =========================================================
   LAYOUT AREA LOGGATA
   ========================================================= */
.tec-wrapper {
  display: flex;
  min-height: 100vh;
  padding-top: var(--tec-headbar-offset, var(--tec-headbar-height));
  background: var(--tec-content-bg);
}

.tec-wrapper.tec-wrapper-headbar-toolbar {
  padding-top: calc(var(--tec-headbar-height) + var(--tec-headbar-toolbar-height));
}

.tec-main {
  flex: 1;
  min-width: 0;
  min-height: calc(100vh - var(--tec-headbar-height));
  margin-left: var(--tec-sidebar-width);
  display: flex;
  flex-direction: column;
  background: var(--tec-content-bg);
  transition: margin-left 0.2s ease;
}

.tec-main-content {
  flex: 1;
  padding: 0 1.1rem 1.1rem;
}

.tec-footer {
  padding: 0.75rem 1.5rem;
  background: var(--tec-card-bg);
  border-top: 1px solid var(--tec-card-border);
  font-size: 0.85rem;
  color: var(--tec-topbar-text);
}

@media (min-width: 992px) {
  body.tec-sidebar-collapsed .tec-main,
  .tec-wrapper.tec-sidebar-collapsed .tec-main {
    margin-left: var(--tec-sidebar-collapsed-width);
  }
}

@media (max-width: 991.98px) {
  .tec-wrapper,
  .tec-wrapper.tec-wrapper-headbar-toolbar {
    padding-top: var(--tec-headbar-height);
  }

  .tec-wrapper.tec-wrapper-azienda-context,
  .tec-wrapper.tec-wrapper-azienda-context.tec-wrapper-headbar-toolbar {
    padding-top: var(--tec-headbar-azienda-height, var(--tec-headbar-height));
  }

  .tec-main {
    margin-left: 0;
  }

  .tec-main-content {
    padding: 0 1rem 1rem;
  }
}

/* Smartphone: densità contenuti + anti-overflow */
@media (max-width: 767.98px) {
  .tec-main-content {
    padding: 0 0.65rem 0.9rem;
    overflow-x: clip;
  }

  .tec-footer {
    padding: 0.45rem 0.65rem;
    font-size: 0.75rem;
  }

  .tec-main-content .btn:not(.btn-lg) {
    font-size: 0.8rem;
  }

  .tec-main-content .btn-sm {
    font-size: 0.72rem;
    padding: 0.28rem 0.55rem;
    min-height: 34px;
  }

  .tec-main-content .form-control,
  .tec-main-content .form-select {
    font-size: 16px; /* evita zoom iOS su focus */
    min-height: 42px;
  }

  .tec-main-content .form-control-sm,
  .tec-main-content .form-select-sm {
    font-size: 16px;
    min-height: 38px;
    padding: 0.3rem 0.55rem;
  }

  .tec-main-content .table:not(.tec-table-plain) > :not(caption) > * > * {
    padding: 0.32rem 0.4rem;
    font-size: 0.78rem;
  }

  .tec-main-content .data-table th,
  .tec-main-content .data-table td,
  .tec-main-content .table-sortable th,
  .tec-main-content .table-sortable td {
    font-size: 0.75rem;
    padding: 0.28rem 0.35rem;
  }

  .tec-main-content h1,
  .tec-main-content .h1 {
    font-size: 1.35rem;
  }

  .tec-main-content h2,
  .tec-main-content .h2 {
    font-size: 1.15rem;
  }

  .tec-main-content h3,
  .tec-main-content .h3 {
    font-size: 1.05rem;
  }

  .tec-main .card-body {
    padding: 0.75rem;
  }

  .tec-main .card-header {
    padding: 0.45rem 0.75rem;
    font-size: 0.88rem;
  }

  .tec-pagination,
  .table-toolbar.tec-pagination {
    font-size: 0.75rem;
    gap: 0.3rem;
  }

  .table-wrap {
    -webkit-overflow-scrolling: touch;
  }
}


/* =========================================================
   SIDEBAR
   ========================================================= */
.tec-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1020; /* desktop: sotto modali Bootstrap (~1055); mobile alza a --tec-z-drawer */
  width: var(--tec-sidebar-width);
  min-width: var(--tec-sidebar-width);
  height: 100vh;
  height: 100dvh;

  display: flex;
  flex-direction: column;

  color: var(--tec-sidebar-text);
  background: linear-gradient(180deg, var(--tec-sidebar-bg) 0%, var(--tec-sidebar-bg-dark) 100%);
  box-shadow: 8px 0 24px rgba(15, 23, 42, 0.18);
  overflow-x: hidden;
  overflow-y: auto;

  transition: transform 0.2s ease, width 0.2s ease, min-width 0.2s ease;
}

.tec-sidebar-brand {
  flex-shrink: 0;
  min-height: 52px;
  padding: 0.45rem 0.65rem 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.tec-sidebar-brand-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  padding: 0.35rem 0.25rem;
  background: transparent;
  border-radius: 0;
  line-height: 1;
  text-decoration: none;
  box-shadow: none;
  color: #fff;
  transition: opacity 0.15s ease;
}

.tec-sidebar-brand-link:hover {
  text-decoration: none;
  color: #fff;
  opacity: 0.92;
  box-shadow: none;
  transform: none;
}

.tec-sidebar-logo {
  display: block;
  width: 100%;
  max-width: 10.5rem;
  max-height: none;
  height: auto;
  object-fit: contain;
}

.tec-sidebar-logo-verbale {
  max-height: 50px;
}

.tec-sidebar-top {
  flex-shrink: 0;
  padding: 0.4rem 0.55rem 0.3rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.tec-sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0.25rem 0.45rem;
  color: var(--tec-topbar-text);
  background: transparent;
  border: 1px solid var(--tec-topbar-border);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.tec-sidebar .tec-sidebar-toggle {
  width: 100%;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
}

.tec-sidebar .tec-sidebar-toggle:hover,
.tec-headbar .tec-sidebar-toggle:hover {
  color: #ffffff;
  background: var(--tec-sidebar-hover);
  border-color: rgba(255, 255, 255, 0.40);
}

.tec-sidebar-hamburger-icon {
  display: block;
  width: 22px;
  height: 2px;
  position: relative;
  background: currentColor;
  box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}

.tec-sidebar-nav {
  flex: 1;
  min-height: 0;
  padding: 0.3rem 0.45rem 0.6rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.26) transparent;
}

.tec-sidebar-link {
  position: relative;
  min-height: 34px;
  margin: 0.05rem 0;
  padding: 0.35rem 0.55rem;

  display: flex;
  align-items: center;
  gap: 0.5rem;

  color: rgba(255, 255, 255, 0.84);
  text-decoration: none;
  white-space: nowrap;
  border-left: 0;
  border-radius: 10px;

  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.tec-sidebar-link:hover {
  color: #ffffff;
  background: var(--tec-sidebar-hover);
  transform: translateX(2px);
}

.tec-sidebar-link.active,
a.tec-sidebar-link[href].active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--tec-sidebar-active) 0%, var(--tec-sidebar-bg) 100%);
  box-shadow: 0 10px 22px rgba(31, 163, 179, 0.25);
}

.tec-sidebar-link.active::before,
a.tec-sidebar-link[href].active::before {
  content: "";
  position: absolute;
  left: -0.45rem;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 999px;
  background: #ffffff;
}

.tec-sidebar-icon {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  font-size: 0.85rem;
  line-height: 1;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.09);
  opacity: 1;
}

.tec-sidebar-link.active .tec-sidebar-icon {
  background: rgba(255, 255, 255, 0.18);
}

.tec-sidebar-label {
  min-width: 0;
  overflow: hidden;
  font-size: calc(0.82rem + 1px);
  font-weight: 650;
  text-overflow: ellipsis;
}

.tec-sidebar-group {
  margin: 0.05rem 0;
}

.tec-sidebar-group-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.tec-sidebar-chevron {
  margin-left: auto;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  opacity: 0.75;
  transition: transform 0.15s ease;
}

.tec-sidebar-group.is-open .tec-sidebar-chevron {
  transform: rotate(45deg);
}

.tec-sidebar-submenu {
  display: none;
  padding: 0.1rem 0 0.2rem 0.35rem;
  margin-left: 0.55rem;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.tec-sidebar-group.is-open .tec-sidebar-submenu {
  display: block;
}

.tec-sidebar-sublink {
  min-height: 28px;
  padding: 0.28rem 0.5rem 0.28rem 0.65rem;
  margin: 0.04rem 0;
  font-size: calc(0.78rem + 1px);
}

.tec-sidebar-sublink .tec-sidebar-label {
  font-weight: 600;
}

.tec-sidebar-group.is-active > .tec-sidebar-group-toggle {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

/* Desktop: sidebar collassata */
@media (min-width: 992px) {
  .tec-sidebar.tec-sidebar-collapsed {
    width: var(--tec-sidebar-collapsed-width);
    min-width: var(--tec-sidebar-collapsed-width);
  }

  .tec-sidebar.tec-sidebar-collapsed .tec-sidebar-brand {
    padding: 0.7rem 0.4rem;
  }

  .tec-sidebar.tec-sidebar-collapsed .tec-sidebar-brand-link {
    min-height: 0;
    padding: 0.15rem 0;
    border-radius: 0;
    justify-content: center;
  }

  .tec-sidebar.tec-sidebar-collapsed .tec-sidebar-logo,
  .tec-sidebar.tec-sidebar-collapsed .tec-sidebar-logo-verbale {
    max-width: 46px;
  }

  .tec-sidebar.tec-sidebar-collapsed .tec-sidebar-top {
    padding-left: 0.55rem;
    padding-right: 0.55rem;
  }

  .tec-sidebar.tec-sidebar-collapsed .tec-sidebar-link {
    justify-content: center;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
  }

  .tec-sidebar.tec-sidebar-collapsed .tec-sidebar-link:hover {
    transform: none;
  }

  .tec-sidebar.tec-sidebar-collapsed .tec-sidebar-label {
    display: none;
  }

  .tec-sidebar.tec-sidebar-collapsed .tec-sidebar-link.active::before,
  .tec-sidebar.tec-sidebar-collapsed a.tec-sidebar-link[href].active::before {
    left: -0.45rem;
  }
}

/* Mobile: sidebar off-canvas + overlay webapp */
@media (max-width: 991.98px) {
  .tec-sidebar {
    top: 0;
    left: 0;
    bottom: 0;
    width: min(var(--tec-sidebar-width), 86vw);
    min-width: 0;
    max-width: 320px;
    height: 100vh;
    height: 100dvh;
    transform: translateX(-105%);
    z-index: var(--tec-z-drawer);
    transition: transform 0.22s ease;
    box-shadow: none;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .tec-sidebar.tec-sidebar-open {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.4);
  }

  .tec-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--tec-z-drawer-backdrop);
    background: rgba(15, 23, 42, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .tec-sidebar-backdrop:not([hidden]) {
    opacity: 1;
    pointer-events: auto;
  }

  body.tec-sidebar-drawer-open {
    overflow: hidden;
    touch-action: none;
  }

  body.tec-sidebar-drawer-open .tec-main {
    pointer-events: none;
    user-select: none;
  }

  body.tec-sidebar-drawer-open .tec-chat-tab-global,
  body.tec-sidebar-drawer-open .tec-chat-tab-wrapper {
    visibility: hidden;
    pointer-events: none;
  }

  .tec-headbar {
    padding-top: env(safe-area-inset-top, 0px);
  }

  .tec-headbar .tec-sidebar-toggle {
    flex-shrink: 0;
    min-width: 42px;
    height: 42px;
    border-radius: 10px;
    color: var(--tec-topbar-text);
    background: #fff;
    border-color: var(--tec-topbar-border);
    position: relative;
    z-index: 1;
  }

  .tec-headbar .tec-sidebar-toggle:hover,
  .tec-headbar .tec-sidebar-toggle[aria-expanded="true"] {
    color: #fff;
    background: var(--tec-sidebar-active);
    border-color: var(--tec-sidebar-active);
  }

  /* Catch-all: nessun sticky di pagina sopra il drawer */
  .tec-main .hero,
  .tec-main section.hero,
  .tec-main .hero--sticky,
  .tec-main .st-intestazione,
  .tec-main .fs-art37-flash-alerts,
  .tec-main .sticky-actions.is-fixed {
    z-index: var(--tec-z-sticky-page, 20) !important;
  }

    .tec-main .hero.hero--sticky,
    .tec-main section.hero.hero--sticky,
    .tec-main .hero.lav-hero-sticky,
    .tec-main .hero.ns-hero-session-sticky,
    .tec-main .st-intestazione {
        position: relative !important;
        top: auto !important;
    }
}

@media (min-width: 992px) {
  .tec-sidebar-backdrop {
    display: none !important;
  }
}


/* =========================================================
   HEADBAR / UPPERBAR
   ========================================================= */
.tec-headbar {
  position: fixed;
  top: 0;
  left: var(--tec-sidebar-width);
  right: 0;
  z-index: var(--tec-z-headbar);

  min-height: 0;
  height: auto;

  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;

  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--tec-topbar-border);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.045);

  transition: left 0.2s ease;
}

.tec-headbar-top {
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0 1rem;

  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tec-headbar:not(.tec-headbar-with-toolbar) {
  justify-content: center;
}

.tec-headbar-with-toolbar {
  border-bottom: none;
}

.tec-headbar-toolbar-row {
  width: 100%;
  min-width: 0;
  min-height: var(--tec-headbar-toolbar-height);
  padding: 0.4rem 1rem;

  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.35rem;

  background: #ffffff;
  border-top: 1px solid var(--tec-topbar-border);
  border-bottom: 1px solid var(--tec-topbar-border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.tec-headbar-toolbar-row .content-header {
  margin-bottom: 0 !important;
}

.tec-headbar-back {
  flex-shrink: 0;
  padding: 0.42rem 0.72rem;
  color: var(--tec-topbar-text);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  background: #ffffff;
  border-color: var(--tec-topbar-border);
  border-radius: 12px;
}

.tec-headbar-back:hover {
  color: var(--tec-sidebar-active);
  background: rgba(31, 163, 179, 0.08);
  border-color: var(--tec-sidebar-active);
}

.tec-headbar-right {
  flex-shrink: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tec-headbar-username {
  max-width: 180px;
  overflow: hidden;
  color: var(--tec-topbar-text);
  font-size: 0.9rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tec-headbar-logout {
  padding: 0.44rem 0.78rem;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 800;
  background: #111827;
  border: 1px solid #111827;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.tec-headbar-logout:hover {
  background: #263244;
  border-color: #263244;
  transform: translateY(-1px);
}

.tec-headbar-notifiche {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: var(--tec-topbar-text);
  background: #ffffff;
  border: 1px solid var(--tec-topbar-border);
  border-radius: 13px;
}

.tec-headbar-notifiche:hover {
  color: var(--tec-sidebar-active);
  border-color: rgba(31, 163, 179, 0.35);
  background: rgba(31, 163, 179, 0.06);
}

.tec-notifiche-icon {
  font-size: 1.18rem;
  line-height: 1;
}

/* Headbar in contesto azienda */
.tec-headbar-top .tec-azienda-bar-in-headbar {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  height: auto;
  margin: 0;
  padding: 0.35rem 0.75rem;

  display: flex;
  align-items: center;
  gap: 0.5rem;

  background: transparent;
  border: 0;
  border-left: 1px solid var(--tec-topbar-border);
  border-radius: 0;
  box-shadow: none;
}

.tec-headbar-top .tec-azienda-bar-in-headbar .tec-azienda-bar-back {
  align-self: center;
  flex-shrink: 0;
  margin-right: 0.25rem;
}

.tec-headbar-top .tec-azienda-bar-in-headbar .tec-azienda-bar-title {
  min-width: 220px;
  max-width: min(430px, 38vw);
  margin-right: 0.45rem;
  padding-right: 0.75rem;

  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 0.5rem;

  border-right: 1px solid var(--tec-topbar-border);
}

.tec-headbar-top .tec-azienda-bar-in-headbar .tec-azienda-bar-label {
  color: var(--tec-topbar-text);
  font-size: 0.94rem;
}

.tec-headbar-top .tec-azienda-bar-in-headbar .tec-azienda-bar-nav {
  flex: 1;
  min-width: 0;
  padding: 0.15rem 0;

  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.35rem;

  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.tec-headbar-top .tec-azienda-bar-in-headbar .tec-azienda-bar-item.tec-azienda-bar-pill {
  flex: 0 0 auto;
  height: auto;
  padding: 0.42rem 0.95rem;

  color: #475569;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;

  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: none !important;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);

  transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.tec-headbar-top .tec-azienda-bar-in-headbar .tec-azienda-bar-item.tec-azienda-bar-pill:hover {
  color: #0f766e;
  background: linear-gradient(180deg, #eef6f7 0%, #e2eef0 100%);
  box-shadow: 0 2px 8px rgba(31, 163, 179, 0.18);
  transform: translateY(-1px);
}

.tec-headbar-top .tec-azienda-bar-in-headbar .tec-azienda-bar-item.tec-azienda-bar-pill.tec-azienda-bar-item-active {
  color: #ffffff !important;
  background: linear-gradient(135deg, #1FA3B3 0%, #1590a0 55%, #127f8e 100%);
  box-shadow: 0 2px 10px rgba(31, 163, 179, 0.45);
}

.tec-headbar-top .tec-azienda-bar-in-headbar .tec-azienda-bar-pill-disabled {
  padding: 0.42rem 0.95rem;
  display: inline-flex;
  align-items: center;
  color: #94a3b8;
  font-size: 0.8125rem;
  font-weight: 700;
  background: #f1f5f9;
  border-radius: 999px;
  cursor: not-allowed;
  user-select: none;
}

/* Vecchia barra azienda eventualmente usata sotto header */
.tec-azienda-bar {
  min-height: 44px;
  flex-shrink: 0;
  padding: 0 1rem;

  display: flex;
  align-items: stretch;

  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.tec-azienda-bar-title {
  min-width: 200px;
  margin-right: 0.5rem;
  padding-right: 1rem;

  display: flex;
  align-items: center;

  border-right: 1px solid #e2e8f0;
}

.tec-azienda-bar-label {
  color: #c2410c;
  font-size: 1rem;
}

.tec-azienda-bar-modifica {
  margin-left: auto;
  color: #64748b;
  font-size: 0.8rem;
  text-decoration: none;
}

.tec-azienda-bar-modifica:hover {
  color: #1e3a5f;
}

.tec-azienda-bar-nav {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0;
  overflow-x: auto;
}

.tec-azienda-bar-item {
  height: 100%;
  padding: 0 0.75rem;

  display: inline-flex;
  align-items: center;
  gap: 0.25rem;

  color: #475569;
  font-size: 0.9rem;
  white-space: nowrap;
  text-decoration: none;
  border-left: 1px solid #e2e8f0;
}

.tec-azienda-bar-item:hover {
  color: #1e3a5f;
  background: #f8fafc;
}

.tec-azienda-bar-vline {
  width: 3px;
  height: 1rem;
  border-radius: 1px;
}

.tec-azienda-bar-vline-red { background: #dc2626; }
.tec-azienda-bar-vline-blue { background: #2563eb; }
.tec-azienda-bar-vline-green { background: #16a34a; }

.tec-azienda-bar-arrow {
  color: #94a3b8;
  font-size: 0.65rem;
}

/* Collasso desktop: headbar allineata alla sidebar stretta */
@media (min-width: 992px) {
  body.tec-sidebar-collapsed .tec-headbar {
    left: var(--tec-sidebar-collapsed-width);
  }
}

/* Mobile */
@media (max-width: 991.98px) {
  .tec-headbar {
    left: 0;
  }

  .tec-headbar-top {
    padding: 0 0.75rem;
  }

  .tec-headbar-top .tec-azienda-bar-in-headbar {
    border-left: 0;
    padding-left: 0;
  }

  .tec-headbar-top .tec-azienda-bar-in-headbar .tec-azienda-bar-title {
    min-width: 180px;
    max-width: 55vw;
  }

  .tec-headbar-username {
    display: none;
  }
}

@media (max-width: 575.98px) {
  .tec-headbar-back {
    display: none;
  }

  .tec-headbar-top .tec-azienda-bar-in-headbar .tec-azienda-bar-title {
    min-width: 0;
    max-width: none;
    flex: 1 1 auto;
  }

  .tec-headbar-top .tec-azienda-bar-in-headbar .tec-azienda-bar-label {
    font-size: 0.72rem;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: calc(100vw - 9rem);
  }

  .tec-headbar-right {
    gap: 0.35rem;
  }

  .tec-headbar-logout {
    padding: 0.35rem 0.55rem;
    font-size: 0.75rem;
  }

  .tec-chat-tab-label,
  .tec-chat-tab-arrow {
    display: none;
  }

  .tec-chat-tab {
    padding: 0.65rem 0.4rem 0.65rem 0.55rem;
    font-size: 0.7rem;
  }

  .tec-chat-tab-icon {
    font-size: 1.15rem;
  }
}


/* Ancora tab Medicina → sezione sotto head fissa */
#blocco-medicina {
  scroll-margin-top: 5.5rem;
}

/* Card e bordi area contenuti */
.tec-main .card {
  background: var(--tec-card-bg);
  border-color: var(--tec-card-border);
}


/* ========== UI unificata: modali, tab, tabelle (coerenza su tutto il portale) ========== */

/* Modali sopra shell (headbar/drawer); default Bootstrap 1055 sarebbe sotto --tec-z-headbar.
   Stacking annidato: site.js alza z-index inline su .modal.show / .modal-backdrop in ordine di apertura. */
.modal-backdrop {
  z-index: calc(var(--tec-z-modal) - 10);
}
.modal {
  z-index: var(--tec-z-modal);
}

/* Modali Bootstrap: intestazione grigia (modalità neutra), footer soft */
.modal-content {
  border-radius: 0.5rem;
  border: 1px solid var(--tec-card-border);
  box-shadow: 0 0.5rem 1.5rem rgba(15, 23, 42, 0.12);
}
.modal-header {
  background: var(--tec-modal-header-bg);
  color: var(--tec-modal-header-fg);
  border-bottom: 1px solid var(--tec-modal-header-border);
  padding: 0.65rem 1rem;
}
.modal-header .modal-title {
  color: var(--tec-modal-header-fg);
  font-weight: 600;
}
.modal-header .btn-close {
  filter: none;
  opacity: 0.7;
}
.modal-header .btn-close:hover {
  opacity: 1;
}
.modal-footer {
  background: var(--tec-content-bg);
  border-top: 1px solid var(--tec-card-border);
  padding: 0.5rem 1rem;
}

/* Opt-in: header teal (solo se serve esplicitamente, es. alcune maschere operative) */
.modal-header.tec-modal-header-teal,
.modal .modal-header.tec-modal-header-teal {
  background: var(--tec-table-header-bg);
  color: #fff;
  border-bottom: none;
}
.modal-header.tec-modal-header-teal .modal-title {
  color: #fff;
}
.modal-header.tec-modal-header-teal .btn-close {
  filter: invert(1) grayscale(100%);
  opacity: 0.92;
}

/* Modal standard Tecsial: titolo maschera (header grigio) + trascinabile + ridimensionabile.
   Abilitato di default da tecsial-modal-float.js (opt-out: data-tec-float="0"). */
.modal.tec-float-modal.tec-float-open,
.modal.tec-float-modal.show {
  overflow: visible !important;
}
.modal.tec-float-modal .modal-dialog.tec-float-dialog {
  position: fixed !important;
  margin: 0 !important;
  max-width: none !important;
  transform: none !important;
  transition: none !important;
}
.modal.tec-float-modal .modal-content {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  max-height: none !important;
  overflow: hidden;
  pointer-events: auto;
}
.modal.tec-float-modal .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto !important;
}
/* Modal compatte (conferme / avvisi): altezza = contenuto, niente corpo “gonfiato” */
.modal.tec-float-modal:not(.tec-float-tall) .modal-content {
  height: 100%;
}
.modal.tec-float-modal:not(.tec-float-tall) .modal-body {
  flex: 0 1 auto;
  overflow: visible !important;
}
.modal.tec-float-modal .modal-header.tec-float-drag {
  cursor: grab;
  user-select: none;
  touch-action: none;
}
body.tec-float-active .modal.tec-float-modal .modal-header.tec-float-drag {
  cursor: grabbing;
}
.modal.tec-float-modal .modal-header.tec-float-drag .btn-close {
  cursor: pointer;
}
.modal.tec-float-modal .tec-float-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 22px;
  height: 22px;
  cursor: nwse-resize;
  z-index: 20;
  touch-action: none;
  pointer-events: auto;
  background:
    linear-gradient(135deg, transparent 0 40%, #64748b 40% 48%, transparent 48% 58%, #64748b 58% 66%, transparent 66% 76%, #64748b 76% 84%, transparent 84%);
  opacity: .9;
}
.modal.tec-float-modal .tec-float-resize:hover {
  opacity: 1;
}
.modal.tec-float-modal .tec-float-fs-btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 1.75rem;
  height: auto;
  min-height: 1.75rem;
  margin: 0 0.35rem 0 0;
  padding: 0.2rem 0.55rem;
  border: 1px solid rgba(100, 116, 139, 0.55);
  border-radius: 0.35rem;
  background: #fff;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  cursor: pointer;
  line-height: 1.1;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  z-index: 5;
}
.modal.tec-float-modal .tec-float-fs-btn:hover {
  background: #f1f5f9;
  border-color: #64748b;
}
.modal.tec-float-modal .tec-float-fs-btn .tec-float-fs-icon {
  display: block;
  width: 0.7rem;
  height: 0.7rem;
  border: 1.5px solid currentColor;
  border-radius: 1px;
  box-sizing: border-box;
  flex: 0 0 auto;
}
.modal.tec-float-modal .tec-float-fs-btn.is-fs .tec-float-fs-icon {
  width: 0.55rem;
  height: 0.55rem;
  box-shadow: 2px -2px 0 -0.5px currentColor;
}
.modal.tec-float-modal .tec-float-fs-btn .tec-float-fs-label {
  display: inline;
}
.modal.tec-float-modal.tec-float-fs .tec-float-resize {
  display: none;
}
.modal.tec-float-modal .modal-header.tec-float-drag .btn-close {
  margin-left: 0;
}
#gutOperativoModal .gut-op-modal-header,
#gutSopralluogoModal .modal-header,
#salOperativoModal .sal-op-modal-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
#gutOperativoModal .tec-float-fs-btn,
#gutSopralluogoModal .tec-float-fs-btn,
#salOperativoModal .tec-float-fs-btn {
  flex: 0 0 auto;
}
body.tec-float-active {
  user-select: none !important;
  cursor: grabbing;
}
body.tec-float-active iframe {
  pointer-events: none;
}

/* Tab pagina: striscia grigia, tab attivo bianco + accento turchese (es. Formazione Art.37, Assunzioni, Home) */
.tec-main-content .nav.nav-tabs:not(.tec-template-tabs-nav):not(.tec-azienda-dettaglio-nav) {
  background: #f1f5f9;
  border-bottom: 1px solid var(--tec-card-border);
  padding: 0.35rem 0.5rem 0;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.tec-main-content .nav.nav-tabs:not(.tec-template-tabs-nav):not(.tec-azienda-dettaglio-nav) .nav-link {
  margin-bottom: -1px;
  color: #334155;
  border-radius: 0.375rem 0.375rem 0 0;
  border: 1px solid transparent;
  padding: 0.5rem 0.85rem;
}
.tec-main-content .nav.nav-tabs:not(.tec-template-tabs-nav):not(.tec-azienda-dettaglio-nav) .nav-link:hover {
  border-color: #e2e8f0 #e2e8f0 transparent;
  background: rgba(255, 255, 255, 0.85);
}
.tec-main-content .nav.nav-tabs:not(.tec-template-tabs-nav):not(.tec-azienda-dettaglio-nav) .nav-link.active {
  color: var(--tec-table-header-bg);
  font-weight: 600;
  background: #fff;
  border-color: var(--tec-card-border) var(--tec-card-border) #fff;
}

/* Tab dentro modali: niente striscia full-bleed sul contenuto */
.modal .nav.nav-tabs {
  background: transparent !important;
  padding: 0 !important;
  margin-bottom: 0.75rem !important;
  border-bottom: 1px solid var(--tec-card-border) !important;
}
.modal .nav.nav-tabs .nav-link {
  color: var(--tec-topbar-text) !important;
}
.modal .nav.nav-tabs .nav-link.active {
  color: var(--tec-table-header-bg) !important;
  font-weight: 600;
  background: #fff !important;
}

/* Tabelle dati: intestazione turchese (override anche thead.table-light). Usare class="tec-table-plain" sulla table per tabella compatta / eccezioni. */
.tec-main-content .table:not(.tec-table-plain) > thead > tr > th,
.tec-main-content .table:not(.tec-table-plain) > thead > tr > td {
  background-color: var(--tec-table-header-bg) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  font-weight: 600;
  vertical-align: middle;
}
.tec-main-content .table:not(.tec-table-plain) thead th a,
.tec-main-content .table:not(.tec-table-plain) thead th a:hover {
  color: #fff !important;
}
.tec-main-content .table:not(.tec-table-plain) > tbody > tr:nth-of-type(even) > * {
  background-color: #eef2f7 !important;
}
.tec-main-content .table:not(.tec-table-plain) > tbody > tr:hover > * {
  background-color: #e2e8f0 !important;
}

.tec-footer {
  padding: 0.75rem 1.5rem;
  background: var(--tec-card-bg);
  border-top: 1px solid var(--tec-card-border);
  font-size: 0.85rem;
  color: var(--tec-topbar-text);
}

/* Card e bordi area contenuti */
.tec-main .card {
  background: var(--tec-card-bg);
  border-color: var(--tec-card-border);
}

/* Dettaglio Azienda: tab senza “scatola” nera / doppia cornice (prima: border su tab-content + card.border) */
.tec-azienda-dettaglio-wrap .tec-azienda-tab-panels {
  border: none;
  background: transparent;
  padding: 0.75rem 0 0;
}
.tec-azienda-dettaglio-wrap .nav-tabs.tec-azienda-dettaglio-nav {
  border-bottom: 1px solid var(--tec-card-border);
  gap: 0;
}
.tec-azienda-dettaglio-wrap .nav-tabs.tec-azienda-dettaglio-nav .nav-link {
  margin-bottom: -1px;
  color: var(--tec-topbar-text);
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 0.35rem 0.35rem 0 0;
  padding: 0.5rem 1rem;
}
.tec-azienda-dettaglio-wrap .nav-tabs.tec-azienda-dettaglio-nav .nav-link:hover {
  color: #0d6efd;
  border-color: var(--tec-card-border);
  border-bottom-color: transparent;
  background: rgba(255, 255, 255, 0.85);
}
.tec-azienda-dettaglio-wrap .nav-tabs.tec-azienda-dettaglio-nav .nav-link.active {
  color: #0d6efd;
  font-weight: 600;
  background: var(--tec-card-bg);
  border-color: var(--tec-card-border);
  border-bottom-color: var(--tec-card-bg);
}
.tec-azienda-dettaglio-wrap .nav-tabs.tec-azienda-dettaglio-nav .nav-link:focus-visible {
  box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.25);
}
.tec-azienda-dettaglio-wrap .card.border {
  border-color: var(--tec-card-border) !important;
  border-width: 1px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

/* Colori modulo (accenti per card/header: .tec-modulo-sicurezza, .tec-modulo-formazione, ecc.) */
.tec-modulo-sicurezza { --tec-modulo: var(--tec-modulo-sicurezza); }
.tec-modulo-formazione { --tec-modulo: var(--tec-modulo-formazione); }
.tec-modulo-medicina   { --tec-modulo: var(--tec-modulo-medicina); }
.tec-modulo-attrezzature { --tec-modulo: var(--tec-modulo-attrezzature); }
.tec-modulo-sopralluoghi { --tec-modulo: var(--tec-modulo-sopralluoghi); }
.tec-modulo-sicurezza.border-primary,
.tec-modulo-formazione .card.border-primary,
.tec-modulo-medicina .card.border-success { border-color: var(--tec-modulo) !important; }
.card.tec-modulo-sicurezza .card-header,
.card.tec-modulo-formazione .card-header { border-bottom-color: var(--tec-card-border); }
.card.tec-modulo-sicurezza .card-header { border-left: 3px solid var(--tec-modulo-sicurezza); }
.card.tec-modulo-formazione .card-header { border-left: 3px solid var(--tec-modulo-formazione); }
.card.tec-modulo-medicina .card-header   { border-left: 3px solid var(--tec-modulo-medicina); }
.card.tec-modulo-attrezzature .card-header { border-left: 3px solid var(--tec-modulo-attrezzature); }
.card.tec-modulo-sopralluoghi .card-header { border-left: 3px solid var(--tec-modulo-sopralluoghi); }

/* Indicatore stato azienda: verde=attiva, arancione=sospesa, rosso=chiusa */
.tec-stato-azienda {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 500;
}
.tec-stato-azienda::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tec-stato-azienda.tec-stato-verde::before { background: #198754; }
.tec-stato-azienda.tec-stato-arancione::before { background: #fd7e14; }
.tec-stato-azienda.tec-stato-rosso::before { background: #dc3545; }
.tec-stato-azienda.tec-stato-verde { color: #198754; }
.tec-stato-azienda.tec-stato-arancione { color: #b45309; }
.tec-stato-azienda.tec-stato-rosso { color: #dc3545; }

/* Nome ragione sociale colorato per stato (senza pallino, stessi colori del badge) */
.tec-stato-nome-ragsoc.tec-stato-verde { color: #198754; }
.tec-stato-nome-ragsoc.tec-stato-arancione { color: #b45309; }
.tec-stato-nome-ragsoc.tec-stato-rosso { color: #dc3545; }

/* ========== Pulsanti calendari (stesso colore degli eventi) ========== */
.btn-cal-art37 { color: #007a3f; border-color: #00954F; background-color: transparent; }
.btn-cal-art37:hover { color: #fff; background-color: #00954F; border-color: #007a3f; }
.btn-cal-hub { color: #4a1d68; border-color: #64288F; background-color: transparent; }
.btn-cal-hub:hover { color: #fff; background-color: #64288F; border-color: #4a1d68; }
.btn-cal-sicurezza { color: #d67d00; border-color: #FE940D; background-color: transparent; }
.btn-cal-sicurezza:hover { color: #000; background-color: #FE940D; border-color: #d67d00; }
.btn-cal-attrezzature { color: #cc0f0f; border-color: #FF1313; background-color: transparent; }
.btn-cal-attrezzature:hover { color: #fff; background-color: #FF1313; border-color: #cc0f0f; }
/* Varianti piene per pulsante principale */
.btn-cal-art37.btn-cal-fill { background-color: #00954F; border-color: #007a3f; color: #fff; }
.btn-cal-art37.btn-cal-fill:hover { background-color: #007a3f; border-color: #005c32; color: #fff; }
.btn-cal-hub.btn-cal-fill { background-color: #64288F; border-color: #4a1d68; color: #fff; }
.btn-cal-hub.btn-cal-fill:hover { background-color: #4a1d68; border-color: #3a1550; color: #fff; }
.btn-cal-sicurezza.btn-cal-fill { background-color: #FE940D; border-color: #d67d00; color: #000; }
.btn-cal-sicurezza.btn-cal-fill:hover { background-color: #e88300; border-color: #c26f00; color: #000; }
.btn-cal-attrezzature.btn-cal-fill { background-color: #FF1313; border-color: #cc0f0f; color: #fff; }
.btn-cal-attrezzature.btn-cal-fill:hover { background-color: #e01010; border-color: #aa0c0c; color: #fff; }

/* ========== Chat Messaggi ========== */
.tec-chat-container {
  background: var(--tec-card-bg);
  border: 1px solid var(--tec-card-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
  min-height: 400px;
}
.tec-chat-header {
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, var(--tec-modulo-sicurezza) 0%, #158a99 100%);
  color: #fff;
  flex-shrink: 0;
}
.tec-chat-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
}
.tec-chat-subtitle {
  font-size: 0.85rem;
  opacity: 0.9;
  margin-top: 0.2rem;
}
.tec-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.tec-chat-msg {
  display: flex;
  max-width: 85%;
}
.tec-chat-msg-mine {
  align-self: flex-end;
}
.tec-chat-msg-theirs {
  align-self: flex-start;
}
.tec-chat-bubble {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}
.tec-chat-msg-mine .tec-chat-bubble {
  flex-direction: row-reverse;
}
.tec-chat-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: var(--tec-modulo-sicurezza);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
}
.tec-chat-msg-theirs .tec-chat-avatar {
  background: #6b7280;
}
.tec-chat-body {
  background: #f0f4f8;
  padding: 0.6rem 1rem;
  border-radius: 12px;
  border-top-left-radius: 4px;
  max-width: 420px;
}
.tec-chat-msg-mine .tec-chat-body {
  background: var(--tec-modulo-sicurezza);
  color: #fff;
  border-top-left-radius: 12px;
  border-top-right-radius: 4px;
}
.tec-chat-subject {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}
.tec-chat-msg-mine .tec-chat-subject { color: rgba(255,255,255,0.95); }
.tec-chat-text {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
}
.tec-chat-meta {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.tec-chat-msg-mine .tec-chat-meta { opacity: 0.9; }
.tec-chat-sender { font-weight: 500; }
.tec-chat-time { color: inherit; opacity: 0.8; }
.tec-chat-msg-unread .tec-chat-body {
  border-left: 3px solid #f59e0b;
}
.tec-chat-input {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--tec-card-border);
  background: var(--tec-content-bg);
  flex-shrink: 0;
}
.tec-chat-textarea {
  resize: none;
  border-radius: 10px;
}
.tec-chat-send {
  flex-shrink: 0;
  padding: 0.5rem 1.25rem;
}

/* Lista conversazioni (Index) */
.tec-chat-list-container {
  background: var(--tec-card-bg);
  border: 1px solid var(--tec-card-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.tec-chat-list {
  max-height: calc(100vh - 220px);
  overflow-y: auto;
}
.tec-chat-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--tec-card-border);
  transition: background 0.15s;
}
.tec-chat-item:hover {
  background: var(--tec-content-bg);
}
.tec-chat-item:last-child { border-bottom: none; }
.tec-chat-item-unread {
  background: rgba(245, 158, 11, 0.08);
}
.tec-chat-item-unread:hover {
  background: rgba(245, 158, 11, 0.12);
}
.tec-chat-item-avatar {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
  background: var(--tec-modulo-sicurezza);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.1rem;
}
.tec-chat-item-body {
  flex: 1;
  min-width: 0;
}
.tec-chat-item-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.tec-chat-item-title {
  font-weight: 600;
  color: #1f2937;
}
.tec-chat-item-time {
  font-size: 0.8rem;
  color: #6b7280;
  flex-shrink: 0;
}
.tec-chat-item-preview {
  font-size: 0.9rem;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tec-chat-item-badge {
  font-size: 0.7rem;
  margin-top: 0.25rem;
  display: inline-block;
}
.tec-chat-empty { padding: 2rem 1rem; }
.tec-chat-item-active { background: rgba(31, 163, 179, 0.12) !important; }

/* Layout lista + tendina chat */
.tec-chat-layout {
  position: relative;
  display: flex;
  gap: 0;
  min-height: calc(100vh - 180px);
}
.tec-chat-layout .tec-chat-list-container {
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

/* Linguetta chat: su Messaggi (wrapper) e globale (Layout) */
.tec-chat-tab-wrapper,
.tec-chat-tab-global {
  position: fixed;
  top: var(--tec-chat-tab-top, 50%);
  right: 0;
  transform: translateY(-50%);
  z-index: calc(var(--tec-z-headbar) - 50);
}
.tec-chat-tab {
  padding: 1rem 0.5rem 1rem 0.8rem;
  background: linear-gradient(135deg, var(--tec-modulo-sicurezza) 0%, #158a99 100%);
  color: #fff;
  border: none;
  border-radius: 12px 0 0 12px;
  box-shadow: -2px 0 12px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.8rem;
  transition: right 0.2s, padding 0.2s;
}
.tec-chat-tab { cursor: grab; }
.tec-chat-tab:active { cursor: grabbing; }
.tec-chat-tab:hover {
  padding-right: 0.6rem;
}
.tec-chat-tab-icon { font-size: 1.3rem; position: relative; }
.tec-chat-tab-badge {
  position: absolute;
  top: 0.15rem;
  right: 0.05rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.15rem;
  text-align: center;
  box-shadow: 0 0 0 2px rgba(21, 138, 153, 0.95);
  z-index: 2;
}
.tec-chat-tab {
  position: relative;
}
.tec-chat-tab.has-unread {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
  box-shadow: -2px 0 16px rgba(234, 88, 12, 0.55), 0 0 0 2px rgba(251, 146, 60, 0.45);
  animation: tec-chat-tab-pulse 1.6s ease-in-out infinite;
}
@keyframes tec-chat-tab-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.12); }
}
.tec-chat-tab-label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0.08em;
}
.tec-chat-tab-arrow {
  font-size: 0.7rem;
  opacity: 0.9;
}
.tec-chat-tab-hidden {
  opacity: 0;
  pointer-events: none;
}

/* Menu a tendina della linguetta */
.tec-chat-tab-menu {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 0.5rem;
  min-width: 260px;
  max-width: 320px;
  max-height: 70vh;
  background: var(--tec-card-bg);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
}
.tec-chat-tab-menu-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.tec-chat-tab-menu-new {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  color: var(--tec-modulo-sicurezza);
  font-weight: 600;
  text-decoration: none;
  background: rgba(31, 163, 179, 0.08);
  border-bottom: 1px solid var(--tec-card-border);
  transition: background 0.15s;
}
.tec-chat-tab-menu-new:hover {
  background: rgba(31, 163, 179, 0.15);
  color: #158a99;
}
.tec-chat-tab-menu-chat {
  text-decoration: none;
  color: inherit;
}
.tec-chat-tab-menu-icon { font-size: 1.1rem; }
.tec-chat-tab-menu-divider { height: 1px; background: var(--tec-card-border); }
.tec-chat-tab-menu-list {
  max-height: 50vh;
  overflow-y: auto;
  padding: 0.25rem 0;
}
.tec-chat-tab-menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.6rem 1rem;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  font-size: 0.9rem;
  color: inherit;
  transition: background 0.15s;
}
.tec-chat-tab-menu-item:hover {
  background: var(--tec-content-bg);
}
.tec-chat-tab-menu-item.unread { background: rgba(245, 158, 11, 0.08); }
.tec-chat-tab-menu-avatar {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  background: var(--tec-modulo-sicurezza);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}
.tec-chat-tab-menu-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tec-chat-tab-menu-empty { font-size: 0.85rem; }

/* Tendina chat a destra */
.tec-chat-drawer {
  position: fixed;
  top: 48px;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 100%;
  background: var(--tec-card-bg);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: calc(var(--tec-z-headbar) - 20);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.tec-chat-drawer-open {
  transform: translateX(0);
}
.tec-chat-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1039;
}
.tec-chat-drawer-open .tec-chat-drawer-backdrop {
  display: block;
}
/* Backdrop dietro il contenuto: altrimenti blocca textarea e pulsanti */
.tec-chat-drawer .tec-chat-drawer-backdrop { z-index: 0; }
.tec-chat-drawer-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: #9ca3af;
}
.tec-chat-drawer-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  position: relative;
  z-index: 1;
  background: var(--tec-card-bg);
}
.tec-chat-drawer-header {
  flex-shrink: 0;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, var(--tec-modulo-sicurezza) 0%, #158a99 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.tec-chat-drawer-contact {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.tec-chat-drawer-avatar {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}
.tec-chat-drawer-subject {
  font-size: 0.85rem;
  opacity: 0.9;
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tec-chat-drawer-close {
  color: #fff !important;
  opacity: 0.9;
  padding: 0.35rem;
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
}
.tec-chat-drawer-close:hover {
  opacity: 1;
}
.tec-chat-drawer-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.tec-chat-drawer-messages .tec-chat-msg { max-width: 95%; }
.tec-chat-drawer-messages .tec-chat-body { max-width: 320px; }
.tec-chat-drawer-input {
  flex-shrink: 0;
  padding: 1rem;
  border-top: 1px solid var(--tec-card-border);
  background: var(--tec-content-bg);
}

@media (max-width: 991.98px) {
  .tec-chat-drawer {
    width: 100%;
  }
}

/* Tabelle compatte Comunicazioni (Avviso, Sollecito, Conferma) */
.tec-tabella-compatta .table,
.tec-tabella-compatta .table th,
.tec-tabella-compatta .table td {
  font-size: 0.8rem;
}
.tec-tabella-compatta .card-header {
  font-size: 0.85rem;
}

/* ========== Layout tabelle sito: intestazione turchese Tecsial / testo bianco ========== */
.table-tecsial {
  font-size: 0.95rem;
  background: #fff;
  color: #000;
}
.table-tecsial thead th {
  background: var(--tec-table-header-bg) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  font-weight: 600;
}
.table-tecsial thead th a,
.table-tecsial thead th a:hover {
  color: #fff !important;
}
.table-tecsial thead.sticky-top th {
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}
/* Sfondo bianco righe dispari; righe pari: zebra sotto (stesso schema ovunque) */
.table-tecsial tbody td {
  color: #000 !important;
}
.table-tecsial tbody tr:nth-child(odd) td {
  background: #fff !important;
}
.table-tecsial tbody tr:hover td {
  background: #e2e8f0 !important;
}
.table-tecsial:not(.tec-table-plain) tbody tr:nth-child(even) td {
  background: #eef2f7 !important;
}
.table-tecsial th,
.table-tecsial td {
  padding: 0.5rem 0.75rem;
}
/* Intestazioni ordinabili */
.table-tecsial.table-sortable thead th[data-sort] {
  cursor: pointer;
  user-select: none;
}
.table-tecsial.table-sortable thead th[data-sort]:hover {
  background: var(--tec-table-header-bg-hover) !important;
}
.table-tecsial.table-sortable thead th[data-sort-dir="asc"]::after,
.table-tecsial.table-sortable thead th[data-sort-dir="desc"]::after {
  content: none;
}
.table-tecsial.table-sortable thead th[data-sort-dir="asc"] .tec-th-controls > .tec-th-label::after,
.table-sortable thead th[data-sort-dir="asc"] .tec-th-controls > .tec-th-label::after {
  content: " ▲";
  opacity: 0.9;
  margin-left: 4px;
}
.table-tecsial.table-sortable thead th[data-sort-dir="desc"] .tec-th-controls > .tec-th-label::after,
.table-sortable thead th[data-sort-dir="desc"] .tec-th-controls > .tec-th-label::after {
  content: " ▼";
  opacity: 0.9;
  margin-left: 4px;
}

/* Formazione Art. 37 — celle griglia I/G/S/A: la tabella forza color:#000 !important sui td */
.table-tecsial tbody td .tec-f37-grid-cell .tec-f37-mod-h {
  color: #6a1b9a !important;
}
.table-tecsial tbody td .tec-f37-grid-cell .tec-f37-mod-v {
  color: #ef6c00 !important;
}
.table-tecsial tbody td .tec-f37-grid-cell .tec-f37-mod-e {
  color: #039be5 !important;
}
.table-tecsial tbody td .tec-f37-grid-cell .tec-f37-mod-p {
  color: #2e7d32 !important;
}
.table-tecsial tbody td .tec-f37-grid-cell .tec-f37-mod-a {
  color: #00695c !important;
}
.table-tecsial tbody td .tec-f37-grid-cell .tec-f37-grid-date {
  color: #222 !important;
}
.table-tecsial tbody td .tec-f37-grid-cell .tec-f37-grid-date-noatt {
  color: #dc3545 !important;
}
.table-tecsial tbody td .tec-f37-grid-cell a.tec-f37-grid-date-noatt {
  color: #dc3545 !important;
}
.table-tecsial tbody td .tec-f37-grid-cell .tec-f37-grid-date-scaduto,
.table-tecsial tbody td .tec-f37-grid-cell a.tec-f37-grid-date-scaduto {
  color: #dc3545 !important;
  text-decoration: line-through !important;
}
.table-tecsial tbody td .tec-f37-grid-cell-scaduto {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  background: #fff5f5;
  border: 1px solid #f5c2c7;
}
.table-tecsial tbody td .tec-f37-grid-scaduto-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.4;
  color: #fff;
  background: #dc3545;
  vertical-align: middle;
  text-decoration: none !important;
}
.table-tecsial tbody td:has(.tec-f37-grid-col-aperto) {
  background-color: #fff5f5 !important;
}
.table-tecsial tbody td .tec-f37-grid-cell-aperto {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  background: #fff5f5;
  border: 1px solid #f5c2c7;
}

/* Indicatori anagrafica in tabella: minorenne / nascita estera */
img.tec-indicatore-anagrafica,
.minorenne-icon,
.nascita-non-italia-icon {
  width: 20px;
  height: 20px;
  vertical-align: -0.2em;
  object-fit: contain;
  flex-shrink: 0;
}

.minorenne-icon-wrap {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  vertical-align: middle;
}

/* Intestazione turchese (stesso schema .table-tecsial) per thead senza classe table-tecsial sulla table */
.table thead.thead-tecsial th {
  background: var(--tec-table-header-bg) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  font-weight: 600;
}

/* Report provvigioni Statistiche: griglia dettaglio scrollabile */
.prov-dettaglio-wrap {
  max-height: 480px;
}

/* Formazione Art.37 lavoratori: dropup Mansione sopra il pulsante; sopra la card tabella */
.tec-f37-lavoratori-filtri {
  position: relative;
  z-index: 25;
}
.tec-f37-lavoratori-filtri .tec-f37-mansione-dropdown-menu {
  z-index: 1040 !important;
}

/* Scheda lavoratore: resoconto inglobato nella card profilo (colonna sinistra) */
.tec-scheda-resoconto-sidebar {
  font-size: 0.8125rem;
}
.tec-scheda-resoconto-titolo {
  letter-spacing: 0.04em;
}
.tec-scheda-resoconto-sidebar .table {
  font-size: 0.75rem;
}
.tec-scheda-resoconto-sidebar .table th,
.tec-scheda-resoconto-sidebar .table td {
  padding: 0.3rem 0.35rem;
  vertical-align: middle;
}
.tec-scheda-resoconto-note-i {
  cursor: help;
  font-weight: 700;
  user-select: none;
}

/* Pulsante guida «?» — stile unico portale (Assunzioni, Convocazioni, modali, …) */
.tec-help-btn,
.tec-assunzioni-help-btn,
.tec-pb-help-btn,
.tec-pf-help-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  border: 1px solid var(--tec-border, #e5e7eb);
  border-radius: 50%;
  background: #fff;
  color: var(--tec-primary-dark, #0c8ca5);
  font-size: .95rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .06);
  transition: .15s ease;
  vertical-align: middle;
}

.tec-help-btn:hover,
.tec-help-btn:focus,
.tec-assunzioni-help-btn:hover,
.tec-assunzioni-help-btn:focus,
.tec-pb-help-btn:hover,
.tec-pb-help-btn:focus,
.tec-pf-help-btn:hover,
.tec-pf-help-btn:focus {
  background: var(--tec-primary-soft, #e8f7f9);
  border-color: rgba(31, 163, 179, .45);
  outline: none;
}

.tec-panel-title-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.popover.tec-help-popover,
.popover.tec-assunzioni-help-popover {
  max-width: min(440px, calc(100vw - 2rem));
  border-radius: 14px;
  border-color: var(--tec-border, #e5e7eb);
  box-shadow: 0 12px 32px rgba(15, 23, 42, .12);
}

.popover.tec-help-popover .popover-header,
.popover.tec-assunzioni-help-popover .popover-header {
  background: var(--tec-primary-soft, #e8f7f9);
  color: var(--tec-primary-dark, #0c8ca5);
  font-weight: 700;
  border-bottom: 1px solid var(--tec-border, #e5e7eb);
}

.popover.tec-help-popover .popover-body,
.popover.tec-assunzioni-help-popover .popover-body {
  padding: 12px 14px;
  font-size: .86rem;
  line-height: 1.45;
  color: #344054;
}

.tec-help-list,
.tec-assunzioni-help-list {
  padding-left: 1.15rem;
  margin-bottom: 0;
  font-size: .86rem;
  line-height: 1.45;
  color: #344054;
}

.tec-help-list li + li,
.tec-assunzioni-help-list li + li {
  margin-top: 8px;
}

/* Tab Art. 37 scheda: badge “altro ente” (A) */
.tec-art37-ee-a {
  background-color: #00695c !important;
  color: #fff !important;
  font-weight: 800;
}

/* Home e calendari: larghezza piena come le pagine hub (full-bleed in .tec-main-content) */
.tec-main-content > .tec-calendario-docenze,
.tec-main-content > .tec-calendario-agenda,
.tec-main-content > .tec-calendario-attrezzature,
.tec-main-content > .tec-calendario-hub,
.tec-main-content > .tec-calendario-sicurezza,
.tec-main-content > .tec-calendario-presenze,
.tec-main-content > .tec-assunzioni,
.tec-main-content > .fs-assunzioni-page {
  margin: -1.5rem -1.5rem 0;
  padding: 1.25rem 1.5rem 1.75rem;
  width: calc(100% + 3rem);
  max-width: none;
  box-sizing: border-box;
}

@media (max-width: 991.98px) {
  .tec-main-content > .tec-calendario-docenze,
  .tec-main-content > .tec-calendario-attrezzature,
  .tec-main-content > .tec-calendario-hub,
  .tec-main-content > .tec-calendario-sicurezza,
  .tec-main-content > .tec-calendario-presenze,
  .tec-main-content > .tec-assunzioni,
  .tec-main-content > .fs-assunzioni-page {
    margin: -1rem -1rem 0;
    padding: 1rem 1rem 1.5rem;
    width: calc(100% + 2rem);
  }
}

.tec-home,
.tec-calendario-docenze,
.tec-calendario-agenda,
.tec-calendario-attrezzature,
.tec-calendario-hub,
.tec-calendario-sicurezza,
.tec-calendario-presenze,
.tec-assunzioni,
.fs-assunzioni-page {
  max-width: none;
  width: 100%;
  box-sizing: border-box;
}
.tec-home-hero {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--tec-card-border);
}
.tec-home-section-label {
  letter-spacing: 0.04em;
}

.tec-cal-legend-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  vertical-align: -2px;
  margin-right: 0.35rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

/* Gestione template HTML: tab radice + albero annidato */
.tec-template-tabs-nav {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.tec-template-tabs-nav .nav-link {
  border-bottom: 1px solid transparent;
}
.tec-template-tabs-nav .nav-link.active {
  font-weight: 600;
}
.tec-template-subtabs-wrap {
  margin-left: 0;
}
.tec-template-subtabs-wrap .tec-template-subtabs-wrap {
  margin-left: 0.25rem;
  padding-left: 0.5rem;
  border-left: 2px solid rgba(15, 139, 134, 0.25);
}
.tec-template-tree-folder > .tec-template-tree-summary {
  cursor: pointer;
  list-style: none;
  padding: 0.35rem 0.25rem;
  border-radius: 4px;
}
.tec-template-tree-folder > .tec-template-tree-summary:hover {
  background: rgba(0, 0, 0, 0.04);
}
.tec-template-tree-folder > .tec-template-tree-summary::-webkit-details-marker {
  display: none;
}
.tec-template-tree-folder > .tec-template-tree-summary::before {
  content: "▸";
  display: inline-block;
  width: 1em;
  margin-right: 0.25rem;
  transition: transform 0.12s ease;
  color: var(--tec-muted, #6c757d);
}
.tec-template-tree-folder[open] > .tec-template-tree-summary::before {
  transform: rotate(90deg);
}
.tec-template-tree-children {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem;
  padding-top: 0.35rem;
}
.tec-template-tree-children > .tec-template-tree-folder {
  flex: 1 1 220px;
  min-width: 180px;
  max-width: 100%;
}
.tec-template-tree-children > .tec-template-tree-file {
  flex: 1 1 100%;
  min-width: 0;
}

/* Modifica template HTML: iframe designMode (modalità grafica) */
.tec-wysiwyg-frame {
  min-height: min(72vh, 900px);
  background: #fff;
}
.tec-wysiwyg-toolbar .tec-wysiwyg-color-input {
  width: 1.5rem;
  height: 1.15rem;
  padding: 0;
  border: 0;
  cursor: pointer;
  vertical-align: middle;
}

/* Convocazioni iscritti: scroll orizzontale/verticale, intestazione fissa, colonna checkbox ancorata */
.conv-iscritti-grid-wrap {
  overflow: auto;
  max-height: min(68vh, calc(100vh - 12rem));
  width: 100%;
  position: relative;
  -webkit-overflow-scrolling: touch;
}
.conv-iscritti-grid-wrap table.conv-iscritti-grid-table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
  min-width: 0;
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
}
/* Con layout flex della pagina dedicata: evita che il wrapper impedisca lo shrink */
.conv-iscritti-grid-wrap.table-responsive {
  min-height: 0;
}
.conv-iscritti-grid-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background-color: var(--bs-light, #e9ecef);
  box-shadow: inset 0 -1px 0 var(--bs-border-color, #dee2e6);
  white-space: nowrap;
  vertical-align: middle;
}
.conv-iscritti-grid-wrap thead th.conv-iscritti-col-sticky {
  left: 0;
  z-index: 5;
  box-shadow: 1px 0 0 var(--bs-border-color, #dee2e6), inset 0 -1px 0 var(--bs-border-color, #dee2e6);
}
.conv-iscritti-grid-wrap tbody td.conv-iscritti-col-sticky,
.conv-sicurezza-page .table-wrap tbody td.conv-iscritti-col-sticky {
  position: sticky;
  left: 0;
  z-index: 1;
  background-color: var(--bs-body-bg, #fff);
}
.conv-iscritti-grid-wrap table.table-striped > tbody > tr:nth-of-type(odd) > td.conv-iscritti-col-sticky {
  background-color: var(--bs-table-striped-bg, rgba(0, 0, 0, 0.05));
}
.conv-iscritti-grid-wrap thead th.conv-isc-th-sortable,
.conv-sicurezza-page .table-wrap thead th.conv-isc-th-sortable {
  cursor: pointer;
  user-select: none;
}
.conv-iscritti-grid-wrap thead th.conv-isc-th-sortable:hover,
.conv-sicurezza-page .table-wrap thead th.conv-isc-th-sortable:hover {
  background-color: #dde2e6;
}
.conv-iscritti-grid-wrap thead th.conv-isc-th-sortable[data-sort-active="asc"]::after,
.conv-sicurezza-page .table-wrap thead th.conv-isc-th-sortable[data-sort-active="asc"]::after {
  content: " \25B2";
  font-size: 0.65em;
  opacity: 0.85;
}
.conv-iscritti-grid-wrap thead th.conv-isc-th-sortable[data-sort-active="desc"]::after,
.conv-sicurezza-page .table-wrap thead th.conv-isc-th-sortable[data-sort-active="desc"]::after {
  content: " \25BC";
  font-size: 0.65em;
  opacity: 0.85;
}

/* Layout hub convocazioni: tutte le colonne visibili, scroll orizzontale nel .table-wrap */
.conv-sicurezza-page .table-wrap .conv-iscritti-grid-table .hide-lg,
.conv-sicurezza-page .table-wrap .conv-iscritti-grid-table .hide-md,
.conv-sicurezza-page .table-wrap .conv-iscritti-grid-table .hide-sm {
  display: table-cell !important;
}

/* Colonne nascoste su viewport piccoli (solo sezioni legacy con .conv-iscritti-grid-wrap, non pagina Convocazioni) */
@media (max-width: 991.98px) {
  .conv-iscritti-grid-wrap .conv-iscritti-grid-table .hide-lg {
    display: none !important;
  }
}
@media (max-width: 767.98px) {
  .conv-iscritti-grid-wrap .conv-iscritti-grid-table .hide-md {
    display: none !important;
  }
}
@media (max-width: 575.98px) {
  .conv-iscritti-grid-wrap .conv-iscritti-grid-table .hide-sm {
    display: none !important;
  }
}

/* Celle compatte, testo a capo (sovrascrive nowrap dell’intestazione dove serve) */
.conv-iscritti-grid-wrap table.conv-iscritti-grid-table th,
.conv-iscritti-grid-wrap table.conv-iscritti-grid-table td {
  padding: 0.35rem 0.5rem;
  font-size: 0.8125rem;
  vertical-align: middle;
  white-space: normal;
  word-break: break-word;
}
/* =========================================================
   SIMULA UTENZA — headbar unica gialla (niente banner doppio)
   ========================================================= */
body.tec-simula-attiva {
  --tec-page-hero-top: var(--tec-headbar-height, 50px);
}

body.tec-simula-attiva .tec-headbar,
.tec-headbar.tec-headbar-simula {
  background: #fff3cd;
  border-bottom: 2px solid #c65d00;
  color: #664d03;
}

body.tec-simula-attiva .tec-headbar-username,
.tec-headbar.tec-headbar-simula .tec-headbar-username {
  color: #664d03;
}

.tec-headbar-simula-msg {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.5rem;
  font-size: 0.875rem;
  color: #664d03;
  min-width: 0;
  flex: 1 1 auto;
  margin: 0 0.5rem;
}

.tec-simula-exit-btn {
  white-space: nowrap;
  font-weight: 600;
}

body.tec-simula-attiva .tec-headbar-simula-exit .tec-simula-exit-btn {
  background: #c65d00;
  color: #fff;
  border-color: #a34d00;
}

body.tec-simula-attiva .tec-headbar-simula-exit .tec-simula-exit-btn:hover {
  background: #a34d00;
  color: #fff;
}
