/* Override locali al tema AdminLTE 4 del gestionale. Tenuto separato dal CSS
   vendored per non toccare i file di release ufficiali. */

body {
    font-size: 0.85rem;
}

.brand-link {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
}

.brand-image {
    max-height: 2rem;
    width: auto;
}

/* Select2 dentro un modal Bootstrap 5: il modal ha z-index 1055, il dropdown
   di Select2 solo 1051, quindi il menu aprirebbe dietro al pannello. */
.modal .select2-container--open .select2-dropdown,
.modal-content .select2-dropdown {
    z-index: 1075;
}

/* Riepiloghi della dashboard: link "vai a" dei small-box */
.small-box .small-box-footer {
    text-decoration: none;
}

/* ---- DataTables 2 dentro le card AdminLTE ---- */
.dt-container { font-size: 0.85rem; }
.dt-container .dt-length select { width: auto; display: inline-block; padding-right: 1.8rem; }
.dt-container .dt-search input { width: auto; display: inline-block; margin-left: .5rem; }
.dt-container .pagination { --bs-pagination-font-size: .8rem; --bs-pagination-padding-x: .6rem; --bs-pagination-padding-y: .25rem; margin-bottom: 0; }
.dt-container .dt-layout-row { margin: .5rem 0; }
table.dataTable thead th { white-space: nowrap; }
table.dataTable .text-nowrap-cell { white-space: nowrap; }
.dt-container .dt-length select,
.dt-container .dt-search input { font-size: .85rem !important; padding-top: .25rem !important; padding-bottom: .25rem !important; height: auto !important; }
.dt-container .dt-length select { padding-right: 1.75rem !important; }
/* DataTables allinea a destra le colonne che riconosce come numeriche: nelle nostre tabelle si sceglie con le classi text-* */
table.dataTable th.dt-type-numeric, table.dataTable td.dt-type-numeric, table.dataTable th.dt-type-date, table.dataTable td.dt-type-date { text-align: left; }
table.dataTable th.text-end, table.dataTable td.text-end { text-align: right; }
table.dataTable th.text-center, table.dataTable td.text-center { text-align: center; }
table.dataTable th.dt-type-numeric.text-end, table.dataTable td.dt-type-numeric.text-end, table.dataTable th.dt-type-date.text-end, table.dataTable td.dt-type-date.text-end { text-align: right; }

/* DataTables 2 imposta border-collapse:separate: lascia spiragli bianchi tra le celle striped */
table.dataTable.table { border-collapse: collapse !important; border-spacing: 0 !important; }

/* ---- Autocompletamento (jQuery UI) con look Bootstrap 5 / AdminLTE, anche in dark mode ---- */
.ui-autocomplete {
    z-index: 2100 !important; /* sopra modal (1055) e toast */
    max-height: 18rem;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 10rem;
    padding: .25rem 0;
    font-family: var(--bs-body-font-family);
    font-size: .875rem;
    color: var(--bs-body-color);
    background-color: var(--bs-body-bg);
    border: var(--bs-border-width) solid var(--bs-border-color-translucent);
    border-radius: var(--bs-border-radius);
    box-shadow: var(--bs-box-shadow);
}
.ui-autocomplete .ui-menu-item { margin: 0; }
.ui-autocomplete .ui-menu-item-wrapper {
    display: block;
    padding: .4rem 1rem;
    border: 0 !important;
    margin: 0 !important;
    color: var(--bs-body-color);
    background: transparent;
    font-weight: 400;
    white-space: normal;
}
.ui-autocomplete .ui-menu-item-wrapper.ui-state-active,
.ui-autocomplete .ui-menu-item-wrapper.ui-state-focus,
.ui-autocomplete .ui-menu-item-wrapper:hover {
    color: #fff;
    background-color: var(--bs-primary);
    border: 0;
    margin: 0;
}
.ui-autocomplete mark { background-color: rgba(var(--bs-warning-rgb), .45); color: inherit; border-radius: .15rem; }
.ui-autocomplete .ui-state-active mark { background-color: rgba(255,255,255,.3); }
.ui-autocomplete img { max-height: 2rem; margin-right: .5rem; border-radius: .25rem; }
/* messaggio di servizio di jQuery UI (testo per screen reader): non deve occupare spazio */
.ui-helper-hidden-accessible { position: absolute !important; clip: rect(0 0 0 0); width: 1px; height: 1px; overflow: hidden; }
/* spinner mentre la ricerca e' in corso */
.ui-autocomplete-input.ui-autocomplete-loading {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 3a9 9 0 1 1-9 9' opacity='.9'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='.8s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .6rem center;
    background-size: 1rem;
}
