:root {
  --col1-w: 100px;
  --col2-w: 110px;
  --col3-w: 150px;
  --header-h: 48px;
}

.table-container {
  overflow: auto;
  max-height: 550px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  padding-top: 0px !important;
}
/* Modifica l'altezza per schermi Desktop (sopra i 1024px) */
@media (min-width: 1024px) {
  .table-container {
    max-height: 800px; /* Imposta l'altezza che preferisci */
  }
}

table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  background: white;
}

th,
td {
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid #f1f5f9;
  white-space: normal;
  background: white; /* Assicura che nulla sia trasparente */
  text-align: center;
}
th {
  padding: 14px 10px;
}
td {
  padding: 14px 10px;
}

/* --- RIGHE STICKY (Orizzontali) --- */
#header-row-1 th {
  position: sticky;
  top: 0;
  z-index: 3;
  font-size: 20px;
}

#header-row-2 th {
  position: sticky;
  top: var(--header-h);
  z-index: 3;
  min-width: 100px;
  max-width: 101px;
}

/* --- COLONNE STICKY (Verticali) --- */
/* Applichiamo lo sticky solo alle celle con classe specifica per evitare conflitti con i colspan */
.sticky-c1 {
  position: sticky !important;
  left: 0;
  z-index: 2;
  min-width: var(--col1-w);
  max-width: var(--col1-w);
}

.sticky-c2 {
  position: sticky !important;
  left: var(--col1-w);
  z-index: 2;
  min-width: var(--col2-w);
  max-width: var(--col2-w);
  border-right: 2px solid #cbd5e1 !important;
}

.sticky-c3 {
  position: sticky !important;
  left: calc(var(--col1-w) + var(--col2-w));
  z-index: 2;
  min-width: var(--col3-w);
  max-width: var(--col3-w);
  border-right: 2px solid #cbd5e1 !important;
}

.br_sticky {
  border-right: 2px solid #cbd5e1 !important;
}

/* --- ANGOLO IN ALTO A SINISTRA (Intersezione) --- */
/* Le celle che sono sia riga sticky che colonna sticky devono avere z-index massimo */
thead tr th.sticky-c1,
thead tr th.sticky-c2,
thead tr th.sticky-c3 {
  z-index: 4 !important;
  background: #f1f5f9 !important;
}

/* Header styling */
th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: 1.175rem;
}

/* Hover */
tbody tr:hover td {
  background-color: #f8fafc;
}
tbody tr:hover td.sticky-c1,
tbody tr:hover td.sticky-c2,
tbody tr:hover td.sticky-c3 {
  background-color: #f1f5f9;
}

/* Shadow on horizontal scroll (simulata) */
.sticky-c3::after {
  content: "";
  position: absolute;
  top: 0;
  right: -5px;
  bottom: 0;
  width: 5px;
  pointer-events: none;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.05), transparent);
}
.page_content a {
  font-size: 1.175rem;
}
