
/* Page loader */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: var(--bs-primary);
    z-index: 99999;
    will-change: width;
}
#page-loader.is-loading {
    animation: page-loader-progress 2.5s cubic-bezier(0.1, 0.5, 0.5, 1) forwards;
}
@keyframes page-loader-progress {
    0%   { width: 0% }
    20%  { width: 35% }
    60%  { width: 65% }
    100% { width: 88% }
}
@media (prefers-reduced-motion: reduce) {
    #page-loader.is-loading {
        animation: none;
        width: 100%;
        opacity: 0.5;
    }
}

:root {
    --bs-primary: hsl(89 97% 29%);
    --bs-primary-rgb: 76, 146, 2;
    --bs-link-color: var(--bs-primary);
    --bs-link-hover-color: oklch(from var(--bs-primary) calc(l * 0.5) c h);
    --bs-link-color-rgb: 76, 146, 2;
    --bs-link-hover-color-rgb: 102, 10, 10;
}

.it-card {
    --bs-it-card-date-size: .7rem;
}

body {
    background-color: #f8f8f8;
    display: flex;
    flex-direction: column;
    /*min-height: 100vh;*/

    main {
        flex: 1;
    }
}

.it-header-slim-wrapper {
    height: auto !important;
}

.navbar-brand img {
    height: 40px;
}

.table-hover tbody tr:hover {
    background-color: #e8f4fd;
}

.badge-attivo {
    background-color: #008b5e;
}

.badge-scaduto {
    background-color: #d9364f;
}

.badge-annullato {
    background-color: #6c757d;
}

.sidebar {
    /*min-height: calc(100vh - 120px);*/
}

.documento-row td {
    vertical-align: middle;
}

footer {
    color: #fff;
    padding: 2rem 0;
    margin-top: 3rem;
}

.it-header-slim-wrapper .navbar-nav {
    --bs-color: #fff5 !important;
    --bs-nav-link-color: #fffA !important;
    --bs-navbar-hover-color: #fff !important;
    --bs-navbar-active-color: #fff !important;
}

.it-header-center-wrapper,
.it-header-navbar-wrapper {
    background-color: var(--bs-primary) !important;
}

.it-header-slim-wrapper .it-header-slim-wrapper-content a.dropdown-item {
    color: #000 !important;
}

body > footer, .it-header-slim-wrapper, .it-header-slim-wrapper .navbar {
    background-color: oklch(from var(--bs-primary) calc(l * 0.8) c h) !important;
}


.it-header-slim-wrapper-content .nav-item a {
    color: #fff !important;
}

header .nav-item:not(:last-child) {
    border-right: 1px solid #fff5;
}

.card.documento-card:after,
.sidebar .card:after {
    display: none
}

/* Campi filtro compilati — bordo primario + sfondo leggero.
   Solo text/search/number usano :not(:placeholder-shown) (affidabile).
   Date e select usano esclusivamente la classe .has-value via JS. */
.sidebar input[type="text"]:not(:placeholder-shown),
.sidebar input[type="search"]:not(:placeholder-shown),
.sidebar input[type="number"]:not(:placeholder-shown),
.sidebar .form-control.has-value {
    border-color: var(--bs-primary);
    border-width: 2px;
    background-color: oklch(from var(--bs-primary) l c h / 0.06);
}

/* Label colorata quando il campo corrispondente è compilato */
.sidebar .form-group:has(input[type="text"]:not(:placeholder-shown)) label,
.sidebar .form-group:has(input[type="search"]:not(:placeholder-shown)) label,
.sidebar .form-group:has(input[type="number"]:not(:placeholder-shown)) label,
.sidebar .form-group:has(.form-control.has-value) label {
    color: var(--bs-primary);
}

.categoria-check-label:hover {
    background-color: rgba(0, 0, 0, .05);
    border-radius: .25rem;
}

.categoria-check-label:has(input:checked) {
    background-color: oklch(from var(--bs-primary) l c h / 0.12);
    border-radius: .25rem;
}

.categoria-details > summary {
    user-select: none;
}

.categoria-details > summary::marker,
.categoria-details > summary::-webkit-details-marker {
    display: none;
    content: '';
}

.categoria-details > summary::after {
    content: '';
    display: inline-block;
    width: 1.9rem;
    height: 1.9rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' viewBox='0 0 24 24' %3E%3Cg%3E%3Cpath fill='hsl(210, 100%, 40%)' d='M12,10.3l4.8,4.8c0.3,0.3,0.8,0.3,1.1,0c0.3-0.3,0.3-0.8,0-1c0,0,0,0,0,0l-4.8-4.8c-0.6-0.6-1.5-0.6-2.1,0L6.2,14c-0.3,0.3-0.3,0.8,0,1c0,0,0,0,0,0c0.3,0.3,0.8,0.3,1.1,0L12,10.3z'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    transition: transform .2s ease;
    transform: rotate(-180deg);
    flex-shrink: 0;
}

.categoria-details[open] > summary::after {
    transform: rotate(0deg);
}

.form-group {
    margin-bottom: 2rem;
}

.maffei-list {
    .list-item {
        .it-right-zone {
            padding: 0 !important;

            .text {
                font-size: 1rem !important;
            }
        }
    }
}

.btn-group {
    .btn{
        padding:0;
        font-weight: normal;
    }
    .btn-check {
        &:checked + label {
            background-color: var(--bs-btn-color);
            color: #fff;
            padding-left:10px;
            &:before{
                content: '🗷';
                position: absolute;
                left:5px;
            }
        }
    }
}
