.verticalCollapse{
    height: 0 !important;
    overflow: hidden !important;
}

.horizontalCollapse{
    width: 0 !important;
    overflow: hidden !important;
}

.collapsablePanel{
    transition: .5s;
}

/* ----------------------
FORM CONTENT PANEL
------------------------------------------ */
.sipalPageContainerContent:has(.sipalFormContentElenco):has(.sipalPageContainerActionButtons){
    padding: 0;
}

.sipalPageContainerContent:has(.sipalFormContentElenco) .sipalPageContainerActionButtons{
    padding-bottom: var(--card-padding);
}

.sipalPageContainerContent:has(.sipalPageContainerActionButtons) .sipalFormContentElenco{
    padding: var(--card-padding);
}

.sipalFormContentElenco{ height: 100%; display: flex; justify-content: space-between; gap: var(--card-padding); }
.sipalFormContentElenco, .sipalFormContentGestione{ height: 100%; }

.sipalFormContentElencoRicerca{ width: calc(var(--width) - var(--card-padding)); height: 100%; overflow: hidden; display: flex; flex-direction: column; }
.sipalBaseFormSideContent{ padding: var(--card-padding); }
.sipalBaseFormSideContent .sipalFormContentElencoRicerca{ width: 100%; }

.formContentFiltriRicercaContainer{ padding: var(--card-padding); flex-grow: 1; overflow-x: hidden; }
.formContentFiltriRicercaButtonsContainer{container-type: inline-size; container-name: formContentFiltriRicercaButtonsContainer; padding: 0 var(--card-padding); border-top: inherit; min-height: 55px; max-height: 55px; background: var(--content-bgcolor); border-bottom-left-radius: inherit; border-bottom-right-radius: inherit; }
.formContentFiltriRicercaContainer .p-formgrid.p-grid{ margin-bottom: 0 !important; }
.formContentFiltriRicercaContainer:has(> .p-formgrid.p-grid){ padding-bottom: 0 !important; }

@container formContentFiltriRicercaButtonsContainer (max-width: 400px) {
    .formContentFiltriRicercaButtonsContainer .ui-button {
        min-width: 2.5rem;
        width: 2.5rem;
        height: 2.5rem;   
    }
    
    .formContentFiltriRicercaButtonsContainer .ui-button .ui-button-text {
        display: none;
    }    
}

.sipalFormContentElencoRisultati{ height: 100%; width: 200px; flex-grow: 1; display: flex; flex-direction: column; }
.sipalBaseFormSideContent .sipalFormContentElencoRisultati{ width: 100%; max-width: 100%; }

.sipalFormContentElencoRicerca .card{ max-height: calc(100% - 40px); padding: 0; overflow: hidden;}
.sipalFormContentElencoRisultati .card{ height: calc(100% - 40px); }

.sipalFormContentGestione{ height: 100%; }

.sipalPageContainerActionButtonsSection .sipalFormActionButtonsDivider{
    margin: 0 10px !important;
    height: 25px !important;
    padding: 0 !important;
}

.sipalPageContainerActionButtonsSection .sipalFormActionButtonsDivider:last-child{
    display: none;
}


/* ----------------------
FORM CONTENT ELENCO TABLE
------------------------------------------ */
.btnToggleSearchPanelIcon{ font-family: 'mgg-icons' !important; }
.btnToggleSearchPanelIcon:before{ content: "\ea42"; }

body .ui-datatable table.ui-datatable-auto,
body .ui-treetable table.ui-datatable-auto{ table-layout: auto !important; }

.sipalFormContentElencoRisultati .sipalFormContentDataSource table tr th:first-child, .sipalFormContentElencoRisultati .ui-datatable table tr th:last-child{ border-radius: 0 !important; }
.sipalFormContentElencoRisultati .sipalFormContentDataSource table thead tr{ position: -webkit-sticky; position: sticky; top: 0; z-index: 10; }

.sipalFormContentElencoRisultati .sipalFormContentDataSource table tr:has(.sipalFormTableActionColumn) td:nth-last-child(2),
.sipalFormContentElencoRisultati .sipalFormContentDataSource table tr:has(.sipalFormTableActionColumn) th:nth-last-child(2){ border-right-width: 0 !important; }

.sipalFormTableFixedColumn{ position: -webkit-sticky; position: sticky; background: var(--content-bgcolor); transition: background-color 0.2s cubic-bezier(0.64, 0.09, 0.08, 1) }

.sipalFormContentElencoRisultati .sipalFormContentDataSource tr.ui-datatable-odd .sipalFormTableFixedColumn{ background: var(--datatable-background-actioncolumn-odd); }
.sipalFormContentElencoRisultati .sipalFormContentDataSource tr.ui-state-hover .sipalFormTableFixedColumn{ background: var(--datatable-background-hover-actioncolumn); }

.sipalFormContentElencoRisultati .sipalFormContentDataSource tr.ui-state-highlight .sipalFormTableFixedColumn{ background: var(--primary-lightest-color) !important; }

.sipalFormContentElencoRisultati .sipalFormContentDataSource table tr .sipalFormTableSelectionColumn{ left: 0;}
body .sipalFormContentElencoRisultati .sipalFormContentDataSource table tr .sipalFormTableActionColumn{ right: 0; border-left-width: 1px !important; }

.ui-datatable-has-vertical-scroll th.sipalFormTableActionColumn{ overflow: visible !important; right: 8px !important;}

@-moz-document url-prefix() {
    .ui-datatable-has-vertical-scroll th.sipalFormTableActionColumn{ overflow: visible !important; right: 0px !important;}
}

.ui-datatable-has-vertical-scroll .ui-datatable-scrollable-theadclone th.sipalFormTableActionColumn{ overflow: hidden !important; }

th.sipalFormTableActionColumn:after{ content: ''; width: 12px; height: 100%; background: var(--surface-a); position: absolute; top: 0; right: -11px; }

.ui-datatable-column-hide-selection .ui-chkbox,
.ui-datatable-column-hide-selection .ui-radiobutton{ display: none; }

@media(min-width: 998px){
    .sipalFormContentElencoRisultati .sipalFormContentDataSource.ui-datasource-espansione-dettaglio.ui-datasource-selezione-multipla .ui-expanded-row-content > td{
        padding-left: calc(80px + .75rem) !important;
    }
    
    .sipalFormContentElencoRisultati .sipalFormContentDataSource.ui-datasource-espansione-dettaglio:not(.ui-datasource-selezione-multipla) .ui-expanded-row-content > td{
        padding-left: calc(30px + .75rem) !important;
    }
}

.sipalBaseFormSideContent .sipalFormContentElencoRicerca > .card{ max-height: unset; flex-grow: 1; display: flex; flex-direction: column; justify-content: space-between; }
.sipalBaseFormSideContent .sipalFormContentElencoRicerca > .card .formContentFiltriRicercaContainer{ flex-grow: 1; }
.sipalBaseFormSideContent{
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--card-padding);
}

.sipalBaseFormSideContentRicerca{ max-height: 40%; }
.sipalBaseFormSideContentRisultati{ flex-grow: 1; overflow: auto; }

.sipalBaseFormContainerDettaglio{
    height: 100%;
}

.sipalBaseFormContainerDettaglioContent{
    flex-grow: 1;
    overflow-x: hidden;
    border-bottom: none;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.sipalPageContainerContent .sipalPageContainerActionButtons{
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.sipalPageContainerContent:not(:has(.sipalBaseFormContainerDettaglioContent)) .sipalPageContainerActionButtons{
    border-left: none;
    border-right: none;
    border-bottom: none;
    box-shadow: none !important;
    border-radius: 0;
}

.sipalFormContentElencoRicercaContainer{
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}



/* ----------------------
FORM CONTENT ELENCO PANEL TITLE
------------------------------------------ */
.sipalFormContentElencoContainerPanelTitle{ margin: 5px 13px; min-height: 28px; max-height: 28px; justify-content: space-between; }

.sipalFormContentElencoContainerPanelTitle,
.sipalFormContentElencoPanelTitle{ display: flex; align-items: center; overflow: hidden; gap: 8px; }

.sipalFormContentElencoPanelTitle .icon{ font-size: 24px; }
.sipalFormContentElencoPanelTitle .title{ font-size: 18px; font-weight: 500; line-height: 1; }





/* ----------------------
MOBILE SETTINGS
------------------------------------------ */
@media (max-width: 998px){
    .sipalFormContentElenco{ flex-wrap: wrap; overflow: hidden; }
    /*.btnFormToggleSearchPanel .ui-icon:before{ content: '\ea05';}*/
    .sipalFormContentElencoRicerca, .sipalFormContentElencoRisultati{ width: 100%; height: 100%; }

    .sipalFormContentElencoRicerca.horizontalCollapse{ display: none; }
    /*.sipalFormContentElencoRisultati{ display: none; }*/

    .sipalFormContentElencoRicercaContainer{
        height: 100%;
    }
}