/**
 * @file
 * Styles for Bootstrap Barrio's tables.
 */
.form-type-select {
  /*display:none;*/
}
table .form-type-select {
  display:block;
}
table {
  border: 0;
  border-spacing: 0;
  font-size: .85em;
  margin: 0!important;
  padding: 0!important;
  width: 100%;
  border-top: 2px solid #0a417d!important;
  border-bottom: 2px solid #0a417d!important;
}
table table {
  font-size: 1em;
}
.table td, .table th {
  padding: 2px 2px;
  /* text-wrap: nowrap; */
  background: #fff;
  vertical-align:middle;
}
.table td.grigio {
  background:#eee;
  font-weight: bold;
}
tr {
  border-bottom: 1px solid #0a417d;
  padding: 0.1em 0.6em;
  background: #efefef;
  background: transparent;
}
thead > tr {
  background: #0a417d;
  border: none;
}
tr.odd {
  background: #fdfdfd;
}
table tr th {
  background: none;
  border: none!important;
}
table tr th,
table tr th a,
table tr th a:hover,
table tr th a:focus {
  color: #ffffff;
  font-weight: bold;
}
th > a {
  position: relative;
  display: block;
}
table tbody tr th {
  vertical-align: top;
}
tr td,
tr th {
  padding: .5rem;
  border-bottom: 1px solid #0a417d;
  border-left: none; /* LTR */
  border-right: none;
}

[dir="rtl"] tr td,
[dir="rtl"] tr th {
  text-align: right;
}
tr td input[type="number"] {
width:100%;
min-width: 50px;
}

/**
 * Responsive tables.
 */
@media screen and (max-width: 37.5em) { /* 600px */
  th.priority-low,
  td.priority-low,
  th.priority-medium,
  td.priority-medium {
    display: none;
  }
}
@media screen and (max-width: 60em) { /* 920px */
  th.priority-low,
  td.priority-low {
    display: none;
  }
}

.tablesort--desc {
   background-image: url(twistie-up.svg);
}
.tablesort--asc {
  background-image: url(twistie-down.svg);
}
.table-responsive {
  height: calc(100vh - 250px);
  overflow: auto;
}
.table-responsive thead th, 
.table-responsive tfoot th
{
  /* position: sticky; */
  /* top: 0; */
  /* z-index: 1; */
  background: #0a417d;
  color: #ffffff;
}
.table-responsive tbody th 
{ 
  position: sticky; left: 0; 
}
thead[role="none"],
tfoot[role="none"] {
  display: none
}
.dtfc-top-blocker {
  display:none!important;
}
.dtfc-bottom-blocker {
  display:none!important;
}
.table-responsive tfoot {
  display: none!important;
}

.dtfc-fixed-start {
  white-space: nowrap;
}



/* Contenitore con scroll sia orizzontale che verticale */
.table-container-fix {
  width: 100%;
  overflow: auto;    /* Attiva lo scroll in entrambe le direzioni */

}

.table-container-fix table {
  width: 100%; 
  border-spacing: 0;
}

.table-container-fix th, 
.table-container-fix td {
  white-space: nowrap;
  background-color: #ffffff;
}

/* 1. RIGA INTESTAZIONE FISSA IN ALTO */
.table-container-fix thead th {
  position: sticky;
  top: 0;
  z-index: 2; /* Sta sopra alle celle normali del corpo */
  font-weight: bold;
}

/* 2. PRIMA COLONNA FISSA A SINISTRA */
.table-container-fix th:first-child,
.table-container-fix td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
}

/* 3. ULTIMA COLONNA FISSA A DESTRA */
.table-container-fix th:last-child,
.table-container-fix td:last-child {
  position: sticky;
  right: 0;
  z-index: 1;
  width: 60px;  /* Larghezza fissa obbligatoria */
  min-width: 60px;
  max-width: 60px;  
}

/* 4. ANGOLI IN ALTO A SINISTRA E IN ALTO A DESTRA (Priorità massima) */
.table-container-fix thead th:first-child,
.table-container-fix thead th:last-child,
.table-container-fix thead th:nth-last-child(2) {
  z-index: 3; /* Deve restare sopra sia all'header che alle colonne fisse */
}

.table-container-fix th:nth-last-child(2),
.table-container-fix td:nth-last-child(2) {
  position: sticky;
  right: 60px; /* Deve corrispondere alla width dell'ultima colonna */
  z-index: 1;
}