/*
======================= START OF LICENSE NOTICE =======================
Copyright (C) 2023 Alessandro Battistini. All Rights Reserved
NO WARRANTY. THE PRODUCT IS PROVIDED BY DEVELOPER "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DEVELOPER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE PRODUCT, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
======================== END OF LICENSE NOTICE ========================
This file is an integral part of the framework AB_WEBMAP, please do not edit, use, modify or change without permission of the developer
*/

table {
  font-size: 1em;
}

/* ==========================================================================
   Framework fix
   ========================================================================== */

/* roba di framework che manda a disoneste la formattazine e quindi va tolta */
.ab-table-dlg button {
  width: unset;
}
/* ---- ---- -- - -- -- - -- - -- - - - - -- */

/* ==========================================================================
   Layout container (Dialog / DataTables wrapper)
   Obiettivo: top + middle + bottom sempre visibili, scroll solo nel middle
   ========================================================================== */

.ab-table-container {
  width: 100%;
  position: absolute; /* come nel tuo originale */
  /* overflow hidden qui può tagliare dropdown/menu/paging: col flex è meglio non farlo */
  overflow: visible;
}

/* wrapper DataTables (DT2 usa dt-container) */
.ab-table-dlg .dt-container {
  padding-right: 10px;
  padding-left: 10px;
  padding-top: 10px;
  /* bottom non lo metto per avere il margine della riga sul resize */

  /* IMPORTANT: niente overflow hidden qui (tagliava il footer) */
  overflow: visible;
}

/* impilamento verticale */
.ab-table-container,
.ab-table-dlg .dt-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0; /* fondamentale con flex per permettere lo scroll interno */
}

/* ==========================================================================
   Top / Middle / Bottom (struttura interna)
   ========================================================================== */

.ab-table-dlg .ab-top {
  display: flex;
  justify-content: space-between;
  /* padding: 10px; */
}

.ab-table-dlg .ab-bottom {
  display: flex;
  justify-content: space-between;
  /* padding: 10px; */
  flex: 0 0 auto; /* footer sempre visibile */
}

.ab-table-dlg .dt-info {
  padding-top: 5px;
}

.ab-table-dlg .dt-paging {
  /* placeholder come nel tuo originale */
}

/* Middle: prende lo spazio restante e scrolla (X e Y) */
.ab-table-dlg .ab-middle {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0; /* fondamentale */
  overflow: auto; /* prima avevi overflow-x:auto: ora include anche Y */
}

/* ==========================================================================
   Table base
   ========================================================================== */

.ab-table {
  overflow: hidden; /* come nel tuo originale */
}

.ab-table.display tr {
  height: 24px;
}

.ab-table.display td {
  padding: 3px 5px;
  white-space: nowrap;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

/* celle comando */
.ab-table.display td.ab-edit-row,
.ab-table.display td.ab-delete-row {
  width: 16px;
  background: transparent;
  padding: 0px;
}

.ab-table.display th.ab-edit-row,
.ab-table.display th.ab-delete-row,
.ab-table.display th.ab-select-row {
  width: 16px;
}

/* intestazioni + footer header */
.ab-table thead th,
.ab-table tfoot th {
  text-align: center !important;
  padding-top: 0px !important;
  padding-bottom: 0px !important;
}

/* colResizable */
.ab-table.ab-colResizable {
  table-layout: fixed;
  /* width: 100%; */
}

.ab-table.ab-colResizable th {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   DataTables UI elements
   ========================================================================== */

.ab-table-dlg .dataTables_length,
.ab-table-dlg .select-info {
  display: none;
}

/* DT1 (vecchio) filter */
.ab-table-container .dataTables_filter input {
  background: white !important;
  border: 1px solid #aaa;
  border-radius: 3px;
}

.ab-table-container .dataTables_filter label {
  float: right;
}

/* DT2 (nuovo) search: equivalente al filter */
.ab-table-container .dt-search input.dt-input {
  background: white !important;
  border: 1px solid #aaa;
  border-radius: 3px;
}

/* freccina / down arrow */
.ab-table-dlg .dt-down-arrow {
  display: none;
}

/* ==========================================================================
   Toolbar / Menu pulsanti
   ========================================================================== */

.ab-table-menu {
  justify-content: left;
  align-items: center;
  /* position: absolute; */
  top: 21px;
  left: 10px;
  z-index: 9000;
  flex-wrap: nowrap;
}

/* .ab-table-dlg .ab-table-menu button.dt-button {
  height: 24px;
} */

.ab-table-dlg .ab-table-menu button.dt-button{
    padding: 0px;
    padding-left: 2px;
    padding-right: 2px;
    /* height: 28px; */
    border: 0px;
}

.ab-table-dlg .ab-table-menu .dt-button-down-arrow {
  display: none;
}

.ab-table-menu button span {
  height: 28px;
}

.ab-table-dlg .ab-table-menu .ab-button-export {
  width: 42px;
}

.ab-table-dlg .ab-table-menu .ab-button-remove-filter {
  display: none;
}

.ab-table-dlg .ab-table-menu button.toggle-on {
  border-style: inset;
  border-width: 5px;
  border-radius: 5px;
  filter: brightness(0.9);
}

.ab-table-menu .f7-icons{
  vertical-align: unset;
}

/* ==========================================================================
   Wait spinner
   ========================================================================== */

.ab-table-dlg .wait-image {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9000;
  width: 50px;
  height: 50px;
}

/* ==========================================================================
   Icons / Rows states
   ========================================================================== */

.ab-table.display td .f7-icons {
  font-size: 15px;
}

.ab-table.display tr.ab-deleted td {
  position: relative;
}

.ab-table.display tr.ab-inserted td {
  border-bottom: 1px solid blue;
  border-top: 1px solid blue;
}

.ab-table.display tr.ab-inserted td:first-child,
.ab-table.display tr.ab-inserted td:last-child {
  border-left: 1px solid blue;
  border-right: 1px solid blue;
}

.ab-table.display tr.ab-inserted {
  border: 1px solid blue;
}

.ab-table.display tr td.ab-field-changed {
  border: 1px solid;
  border-color: blue;
  border-radius: 4px;
}

.ab-table.display tr td.click-cell {
  /* il link class sballa la cella */
  display: table-cell;
  text-decoration: underline;
}

.ab-table.display tr.ab-deleted td:before {
  content: " ";
  position: absolute;
  bottom: 50%;
  left: 0;
  border-bottom: 2px solid #111;
  width: 100%;
}

.ab-table.display tr.ab-deleted td.ab-delete-row:before {
  border-bottom: none;
}

.ab-table.display tr.ab-selected {
  background-color: gray;
  color: white;
}

/* ==========================================================================
   Settings popup
   ========================================================================== */

.ab-table-settings .popup-close {
  position: absolute;
  top: 0px;
  right: 0px;
}

.ab-table-settings .ab_footer {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 100%;
}

.ab-table-settings .ab_footer .row {
  padding: 10px;
}

/* ==========================================================================
   Footer filters (tfoot)
   ========================================================================== */

.ab-table tfoot tr.ab-footFilters th input {
  background: white;
  text-align: left;
}

/* ==========================================================================
   Coded data marker
   ========================================================================== */

.ab-table-dlg .ab-coded-data {
  position: relative;
  padding-left: 5px; /* Per non far sovrapporre la C al contenuto */
  text-align: left;
}

.ab-table-dlg .ab-coded-data:before {
  content: "C";
  position: absolute;
  top: -5px;
  left: 0px;
  font-weight: bold;
  font-size: xx-small;
  color: lightgray;
}

/* ==========================================================================
   Button collection
   ========================================================================== */

.dt-button-collection [role="menu"] {
  max-height: 200px;
  overflow: auto;
}

/* ==========================================================================
   Foot filters menu (popup)
   ========================================================================== */

.ab-footFilters-menu .ab-popup-menu-row {
  text-align: center;
  background: #f8f8f8;
}

.ab-footFilters-menu .ab-popup-menu-row.ui-state-active {
  font-weight: bold;
  background: rgba(0, 0, 0, 0.65);
  background-blend-mode: darken;
}



/* ==========================================================================
   Misc
   ========================================================================== */

.ab-iterating {
  cursor: progress;
}

.ab-field {
  text-align: left;
  justify-content: flex-start;
}
