
@media (max-width: 767px) {
  .csrespt-table {
    width: 100%;
  }
  
  .csrespt-filter-toggle {
    display: none;
  }
  
  .csrespt-table.csrespt-active,
  .csrespt-table.csrespt-active thead,
  .csrespt-table.csrespt-active tbody,
  .csrespt-table.csrespt-active th,
  .csrespt-table.csrespt-active td,
  .csrespt-table.csrespt-active tr {
    display: block;
  }
  
  .csrespt-table.csrespt-active thead tr:not(.csrespt-filter-row),
  .csrespt-table.csrespt-active .csrespt-fallback-header {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  
  
  .csrespt-filter-toggle:not([hidden]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
  
    width: 100%;
    min-height: 48px;
    padding: 0 16px;
    margin: 0 0 14px;
  
    border: 1px solid #d7dde6;
    border-radius: 12px;
  
    background: linear-gradient(
      to bottom,
      #ffffff,
      #f8fafc
    );
  
    color: #121826;
  
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.2px;
  
    cursor: pointer;
  
    box-shadow:
      0 2px 6px rgba(15, 23, 42, 0.06),
      0 1px 2px rgba(15, 23, 42, 0.04);
  
    transition:
      background 0.2s ease,
      border-color 0.2s ease,
      transform 0.15s ease,
      box-shadow 0.2s ease;
  }
  
  /* ICONA + TESTO */
  .csrespt-filter-toggle::before {
    content: "Mostra Filtri";
    color: #121826;
  }
  
  /* HOVER */
  .csrespt-filter-toggle:hover {
    background: #f1f5f9;
    border-color: #c5d0dd;
  
    box-shadow:
      0 4px 10px rgba(15, 23, 42, 0.08),
      0 2px 4px rgba(15, 23, 42, 0.05);
  }
  
  /* CLICK */
  .csrespt-filter-toggle:active {
    transform: scale(0.98);
  }
  
  /* FOCUS ACCESSIBILITÀ */
  .csrespt-filter-toggle:focus-visible {
    outline: none;
    border-color: #246fc4;
  
    box-shadow:
      0 0 0 4px rgba(36, 111, 196, 0.15);
  }
  
  /* STATO APERTO */
  .csrespt-filter-toggle[aria-expanded="true"] {
    background: #eef5ff;
    border-color: #bfd4f3;
    color: #0f3d75;
  }
  
  /* TESTO STATO APERTO */
  .csrespt-filter-toggle[aria-expanded="true"]::before {
    content: "Nascondi Filtri";
  }
  
  .csrespt-table.csrespt-active .csrespt-filter-row {
    display: none;
    border: 1px dashed #c8d1dc;
    border-top: 4px solid #d9534f;
    border-radius: 8px;
    background: #f8fafc;
    padding: 14px;
    margin: 0 0 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  }
  
  .csrespt-table.csrespt-active .csrespt-filter-row {
    display: none !important;
  }
  
  .csrespt-table.csrespt-active.csrespt-filters-open .csrespt-filter-row {
    display: block !important;
  }
  
  .csrespt-table.csrespt-active .csrespt-data-row {
    border: 1px solid #d7dde6;
    border-top: 4px solid #d9534f;
    border-radius: 8px;
    background: #ffffff;
    padding: 14px;
    margin: 0 0 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  }
  
  .csrespt-table.csrespt-active .csrespt-data-row > td {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: start;
    width: 100% !important;
    min-width: 0;
    max-width: 100%;
    padding: 10px 0;
    border: 0;
    border-bottom: 1px solid #eef2f7;
    text-align: left !important;
    overflow-wrap: anywhere;
    box-sizing: border-box;
  }
  
  .csrespt-table.csrespt-active .csrespt-data-row > td > *,
  .csrespt-table.csrespt-active .csrespt-data-row > td * {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  
  .csrespt-table.csrespt-active .csrespt-data-row > td:first-child {
    padding-top: 0;
  }
  
  .csrespt-table.csrespt-active .csrespt-data-row > td:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }
  
  .csrespt-table.csrespt-active .csrespt-data-row > td::before {
    content: attr(data-label);
    display: block;
    width: 100%;
    color: #246fc4;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.35;
    text-align: left;
    overflow-wrap: anywhere;
  }
  
  .csrespt-table.csrespt-active select,
  .csrespt-table.csrespt-active input,
  .csrespt-table.csrespt-active textarea,
  .csrespt-table.csrespt-active .form-control {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 42px !important;
    font-size: 1rem !important;
    box-sizing: border-box !important;
  }
  
  .csrespt-table.csrespt-active .csrespt-control-cell,
  .csrespt-table.csrespt-active .csrespt-filter-cell {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
  
  .csrespt-table.csrespt-active .csrespt-control-cell select.form-control,
  .csrespt-table.csrespt-active .csrespt-control-cell select,
  .csrespt-table.csrespt-active .csrespt-filter-cell select,
  .csrespt-table.csrespt-active .csrespt-filter-cell input,
  .csrespt-table.csrespt-active .csrespt-filter-cell textarea,
  .csrespt-table.csrespt-active .csrespt-filter-cell .form-control {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 42px !important;
    padding: 8px 10px;
    line-height: 1.35;
    box-sizing: border-box !important;
  }
  
  .csrespt-table.csrespt-active .dropdown-menu {
    max-width: min(280px, calc(100vw - 32px));
    white-space: normal;
  }
  
  .csrespt-table.csrespt-active br {
    display: block;
  }
  
  .csrespt-table.csrespt-active .csrespt-actions-cell {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
    width: 100% !important;
    min-width: 0;
    max-width: 100% !important;
    box-sizing: border-box;
  }
  
  .csrespt-table.csrespt-active .csrespt-actions-cell::before {
    flex: 0 0 100%;
  }
  
  .csrespt-table.csrespt-active .csrespt-actions-cell a {
    display: inline-flex;
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    max-width: none;
    text-decoration: none;
  }
  
  .csrespt-table.csrespt-active .csrespt-actions-cell button,
  .csrespt-table.csrespt-active .csrespt-actions-cell .btn,
  .csrespt-table.csrespt-active .csrespt-actions-cell .btn-link,
  .csrespt-table.csrespt-active .csrespt-actions-cell .dropdown-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 42px;
    min-width: 42px;
    max-width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 8px !important;
    border-radius: 4px;
    flex: 0 0 auto;
    margin-left: 0 !important;
    box-sizing: border-box;
    line-height: 1;
    text-decoration: none;
  }
  
  .csrespt-table.csrespt-active .csrespt-actions-cell .btn-link {
    border: 1px solid #d7dde6;
  }
  
  .csrespt-table.csrespt-active .csrespt-actions-cell button i,
  .csrespt-table.csrespt-active .csrespt-actions-cell .btn i,
  .csrespt-table.csrespt-active .csrespt-actions-cell .btn-link i {
    color: inherit;
    font-size: 1.5rem;
    line-height: 1;
  }
  
  .csrespt-table.csrespt-active .csrespt-actions-cell .btn-group {
    display: inline-flex !important;
    align-items: center;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    flex: 0 0 auto;
    margin: 0 !important;
  }
  
  .csrespt-table.csrespt-active .csrespt-filter-row td,
  .csrespt-table.csrespt-active .csrespt-filter-row th {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px 0;
    border: 0;
    text-align: left !important;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  
  .csrespt-table.csrespt-active .csrespt-filter-row td::before,
  .csrespt-table.csrespt-active .csrespt-filter-row th::before {
    content: attr(data-label);
    display: block;
    width: 100%;
    color: #246fc4;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.35;
    text-align: left;
  }
  
  .csrespt-table.csrespt-active .csrespt-filter-row::before {
    content: "";
    display: block;
    width: 100%;
    margin: 0 0 8px;
    color: #121826;
    font-size: 1rem;
    font-weight: 700;
  }
  
  .csrespt-table.csrespt-active
  .csrespt-actions-cell
  .csrespt-reset-filters-btn {
    width: auto !important;
    max-width: none !important;
    min-width: 140px;
    padding: 8px 14px !important;
  }
  
  
  .csrespt-table.csrespt-active .csrespt-data-row td * {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  
  /* th vuoto nell'header */
  .csrespt-table thead th:empty,
  .csrespt-table .csrespt-fallback-header th:empty {
    display: none;
  }
  
  /* celle dati/filtro corrispondenti a colonne senza header */
  .csrespt-table .csrespt-hidden-col {
    display: none !important;
  }
  
  /* in modalità card il ::before non deve comparire */
  .csrespt-table.csrespt-active .csrespt-hidden-col::before {
    display: none !important;
  }
  
  .csrespt-table thead .csrespt-hidden-col {
    display: none !important;
  }
  
  table.table:not(.csrespt-ready) {
    visibility: hidden !important;
  }

  /* Toolbar DataTables - uniforme e compatto */
  .dataTables_length,
  .dataTables_filter {
    font-size: 0.9rem;
    margin: 0;
    padding: 8px 0;
  }
  
  .dataTables_length label,
  .dataTables_filter label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: normal;
    margin: 0;
  }
  
  .dataTables_length select,
  .dataTables_filter input {
    font-size: 0.9rem !important;
    height: 32px;
    padding: 4px 8px !important;
    line-height: 1.4;
    vertical-align: middle;
  }
  
  .dataTables_length select.form-control,
  .dataTables_filter input.form-control {
    display: inline-block;
    width: 100% !important;
    min-width: 100px;
  }
  
  .dataTables_length label > *,
  .dataTables_filter label > * {
    vertical-align: middle;
  }
  
  /* Nasconde i numeri dalla paginazione e lascia solo previous e next */
  .dataTables_paginate .paginate_button:not(.previous):not(.next) {
    display: none;
  }

/*
  td.csrespt-actions-cell>p>button[data-toggle="collapse"],
  td.csrespt-actions-cell>div.collapse.in>button[data-toggle="collapse"] {
      border: unset !important;
      align-items: left !important;
      justify-content: left !important;
      padding: unset !important;
      min-width: 100% !important;
  }

  td.csrespt-actions-cell>p>button[data-toggle="collapse"]>i,
  td.csrespt-actions-cell>div.collapse.in>button[data-toggle="collapse"]>i {
      font-size: large !important;
  }

  td.csrespt-actions-cell>p>.btn>i:after {
      margin-left: 5px !important;
      content: "Mostra tutto" !important;
      font-size: 9pt !important;
      font-family: "Inter" !important;
  }

  td.csrespt-actions-cell>div.collapse.in>button[data-toggle="collapse"]>i:after {
      margin-left: 5px !important;
      content: "Nascondi" !important;
      font-size: 9pt !important;
      font-family: "Inter" !important;
  }
*/

  td.csrespt-actions-cell button[data-toggle="collapse"] {
    border: 0 !important;
    background: transparent !important;
    padding: 0 !important;

    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;

    font-family: "Inter";
    transition: opacity .2s ease-in-out;
  }

  td.csrespt-actions-cell button[data-toggle="collapse"] > i {
      font-size: 16px;
      transition: opacity .2s ease-in-out;
  }

  td.csrespt-actions-cell button[data-toggle="collapse"] > i::after {
      margin-left: 6px;
      font-size: 9pt;
      vertical-align: middle;
  }

  /* deve escludere le select! */
  .bootstrap-select > .btn.dropdown-toggle {
      max-width: 100% !important;
      width: 100% !important;
      line-height: unset !important;
  }
  
  /* niente bordo in visualizzazione card e niente scorrimento (table-responsive) */
  .csrespt-table, .box-body.table-responsive {
      border: none !important;
      overflow-x: hidden !important;
  }

}

/* Logica Card Scrollabile */

/* LA CARD DIVENTA UN CONTENITORE SCROLL */
/* .csrespt-table.csrespt-active .csrespt-data-row {
  display: block;
  max-height: 280px;        
  overflow-y: auto;          
  overflow-x: hidden;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid #d7dde6;
  border-top: 4px solid #d9534f;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);

  scrollbar-width: thin;
  scrollbar-color: rgba(120,130,140,0.4) transparent;
}

.csrespt-table.csrespt-active .csrespt-data-row > td {
  display: block;
  width: 100% !important;
  padding: 10px 0;
  border-bottom: 1px solid #eef2f7;
}

.csrespt-table.csrespt-active .csrespt-data-row > td:last-child {
  border-bottom: 0;
}


.csrespt-table.csrespt-active .csrespt-data-row::-webkit-scrollbar {
  width: 6px;
}

.csrespt-table.csrespt-active .csrespt-data-row::-webkit-scrollbar-track {
  background: transparent;
}

.csrespt-table.csrespt-active .csrespt-data-row::-webkit-scrollbar-thumb {
  background-color: rgba(120, 130, 140, 0.4);
  border-radius: 10px;
}

.csrespt-table.csrespt-active .csrespt-data-row::-webkit-scrollbar-thumb:hover {
  background-color: rgba(120, 130, 140, 0.7);
}


 */


