

/* ===========================================================
   2) LISTE / TABELLE (generale) - CONSOLIDATED FIX
   =========================================================== */

.table-responsive {
    overflow-x: auto !important;
    overflow-y: visible !important;
    max-height: none !important;
    height: auto !important;
    width: 100% !important;
    margin: 0 !important;
    position: relative !important;
    z-index: 1;
    border: none !important;
}

.entitylist table,
.entity-grid table {
    table-layout: auto !important;
    width: 100% !important;
    border-collapse: collapse !important; /* Merges borders to remove white gaps */
    border: none !important;
    background-color: #ffffff !important;
}

/* 1️⃣ REMOVE STRIPES: Force all rows and cells to white background */
.entitylist table tr, 
.entity-grid table tr,
.entitylist table tr.alternate,
.entitylist table td,
.entity-grid table td {
    background-color: #ffffff !important;
    background: #ffffff !important;
    border-bottom: 1px solid #f0f0f0 !important; /* Very light subtle line */
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
}

/* 2️⃣ BOLD HEADERS */
.entitylist th,
.entitylist th a,
.entity-grid th,
.entity-grid th a,
.view-grid thead tr th {
    font-family: 'Roboto', sans-serif !important; 
    font-weight: 500 !important; 
    color: #fb7514 !important;   
    text-transform: none !important;
    white-space: nowrap !important;
    background-color: #ffffff !important;
    vertical-align: middle !important;
}

/* 3️⃣ LAYOUT FIXES */
.entitylist,
.entity-grid {
    width: 100% !important;
    margin: 0 !important;
}

.entitylist th,
.entitylist td,
.entity-grid th,
.entity-grid td {
    white-space: nowrap !important;
    overflow: visible !important;
}

/* Ensure the sort icons don't affect alignment */
.entitylist th .sort-icon,
.entity-grid th .sort-icon {
    font-weight: bold !important;
    color: #fb7514 !important;
}


/* ===========================================================
   4) DROPDOWN: sempre sopra
   =========================================================== */

.entitylist tr:focus-within,
.entity-grid tr:focus-within,
.entitylist td:focus-within,
.entity-grid td:focus-within {
    position: relative !important;
    z-index: 9990 !important;
}

.entitylist .dropdown-menu,
.entity-grid .dropdown-menu {
    z-index: 10002 !important;
    position: absolute !important;
    right: 0 !important;
    left: auto !important;
    transform: none !important;
    white-space: nowrap !important;
}

/* ===========================================================
   5) Z-INDEX GLOBALI
   =========================================================== */

.select2-dropdown,
.lookupdropdown,
.entity-grid-dropdown,
.navbar-nav .dropdown-menu {
    z-index: 10050 !important;
}

.datepicker,
.ui-datepicker,
.bootstrap-datetimepicker-widget {
    z-index: 10050 !important;
}

.datepicker-dropdown,
.ui-datepicker,
.bootstrap-datetimepicker-widget.dropdown-menu {
    right: 0 !important;
    left: auto !important;
    transform: none !important;
}

/* ===========================================================
   6) FIX LISTE DENTRO FORM (SUBGRID)
   =========================================================== */

/* 1️⃣ Spostiamo lo scroll sul contenitore esterno */
.entity-form .entity-grid.subgrid {
    overflow-x: auto !important;
    overflow-y: visible !important;
    position: relative !important;
    width: 100% !important;
}

/* 2️⃣ Il view-grid NON deve più clippare */
.entity-form .entity-grid.subgrid .view-grid.table-responsive {
    overflow: visible !important;
    position: relative !important;
}

/* 3️⃣ La tabella deve potersi espandere */
.entity-form .entity-grid.subgrid table {
    width: max-content !important;
    min-width: 100% !important;
}

/* 4️⃣ Dropdown sempre sopra nella subgrid */
.entity-form .entity-grid.subgrid .dropdown-menu {
    z-index: 30000 !important;
    position: absolute !important;
}

/* ===========================================================
   7) FORM SPACING
   =========================================================== */

.entity-form .control,
.form-control {
    margin-bottom: 10px;
}

button,
.btn,
.input-group {
    z-index: auto !important;
    position: static !important;
}

/* ===========================================================
   MODAL
   =========================================================== */

.modal-dialog {
  width: 92vw !important;
  max-width: 92vw !important;
  margin: 2vh auto !important;
}

.modal-content {
  height: 92vh !important;
  max-height: 92vh !important;
}

.modal-body {
  max-height: calc(92vh - 120px) !important;
  overflow-y: auto !important;
  padding: 20px !important;
}

.modal .table-responsive {
  overflow-x: auto !important;
  overflow-y: visible !important;
}

