/* ========================================
   COMPACT PAGE HEADER - DINAMICO
   ======================================== */
.compact-page-header {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1) 0%, rgba(var(--secondary-rgb), 0.07) 50%, rgba(var(--primary-rgb), 0.1) 100%);
    border: 1.5px solid rgba(var(--primary-rgb), 0.22);
    border-radius: 16px;
    padding: 1rem 1.5rem 1.1rem;
    margin: 0 0 1.5rem;
    box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ---- Title bar ---- */
.cph-title {
    color: rgb(var(--primary-rgb));
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.25;
}

.cph-subtitle {
    color: rgb(var(--filterColor-rgb));
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0;
    line-height: 1.4;
    opacity: 0.85;
}



/* ---- Title bar (Contenitore necessario per l'allineamento) ---- */
.cph-title-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.cph-title-group {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.cph-title {
    color: rgb(var(--primary-rgb));
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.25;
}

/* Create button - Ora allineato a destra grazie al margin-left: auto */
.cph-btn-create {
    margin-left: auto;
    background: linear-gradient(135deg, rgb(var(--primary-rgb)) 0%, rgb(var(--secondary-rgb)) 100%);
    border-radius: 10px;
    padding: 0.5rem 1.1rem;
    color: var(--contrast-color);
    font-weight: 700;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: all 0.25s ease;
    box-shadow: 0 3px 10px rgba(var(--primary-rgb), 0.3);
    text-decoration: none;
}

    .cph-btn-create:hover {
        filter: brightness(1.1);
        box-shadow: 0 5px 15px rgba(var(--primary-rgb), 0.4);
        color: var(--contrast-color);
        text-decoration: none;
    }

/* ---- Filters bar & Fields ---- */
.cph-filters-bar {
    width: 100%;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(var(--primary-rgb), 0.15);
}

.cph-filter-fields {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
    width: 100%;
}

.compact-page-header .filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1 1 180px;
    min-width: 160px;
}
.compact-page-header .filter-field label {
    color: rgb(var(--filterColor-rgb));
    font-size: 0.75rem;
    font-weight: 600;
}

.compact-page-header .filter-field input,
.compact-page-header .filter-field select,
.compact-page-header .filter-field .form-control {
    border: 1.5px solid rgba(var(--primary-rgb), 0.2);
    border-radius: 8px;
    padding: 0.38rem 0.7rem;
    font-size: 0.85rem;
    background: rgba(var(--filterBackground-rgb), 1);
    color: rgb(var(--filterColor-rgb));
    height: 34px;
}

    .compact-page-header .filter-field input:focus {
        border-color: rgb(var(--primary-rgb));
        box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.1);
        outline: none;
    }

/* Filter action buttons */
.cph-btn-apply {
    background: linear-gradient(135deg, rgb(var(--primary-rgb)) 0%, rgb(var(--secondary-rgb)) 100%);
    border: none;
    border-radius: 8px;
    padding: 0.38rem 1rem;
    color: var(--contrast-color);
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 3px 10px rgba(var(--primary-rgb), 0.3);
    height: 34px;
}

    .cph-btn-apply:hover {
        filter: brightness(1.1);
        box-shadow: 0 5px 14px rgba(var(--primary-rgb), 0.4);
        color: var(--contrast-color);
    }

.cph-btn-reset {
    background: rgba(var(--primary-rgb), 0.07);
    border: 1.5px solid rgba(var(--primary-rgb), 0.2);
    border-radius: 8px;
    padding: 0.38rem 0.85rem;
    color: rgb(var(--primary-rgb)); /* ========================================
   COMPACT PAGE HEADER - DINAMICO
   ======================================== */

    .compact-page-header {
        background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1) 0%, rgba(var(--secondary-rgb), 0.07) 50%, rgba(var(--primary-rgb), 0.1) 100%);
        border: 1.5px solid rgba(var(--primary-rgb), 0.22);
        border-radius: 16px;
        padding: 1rem 1.5rem 1.1rem;
        margin: 0 0 1.5rem;
        box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.1);
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
    /* ---- Title bar ---- */
    .cph-title-bar {
        display: flex;
        align-items: center;
        gap: 1rem;
        width: 100%;
    }

    .cph-title-group {
        display: flex;
        flex-direction: column;
        gap: 0.15rem;
    }

    .cph-title {
        color: rgb(var(--primary-rgb));
        font-size: 1.35rem;
        font-weight: 700;
        margin: 0;
        line-height: 1.25;
    }
    /* Create button */
    .cph-btn-create {
        margin-left: auto;
        background: linear-gradient(135deg, rgb(var(--primary-rgb)) 0%, rgb(var(--secondary-rgb)) 100%);
        border-radius: 10px;
        padding: 0.5rem 1.1rem;
        color: var(--contrast-color);
        font-weight: 700;
        font-size: 0.875rem;
        display: inline-flex;
        align-items: center;
        gap: 0.45rem;
        transition: all 0.25s ease;
        box-shadow: 0 3px 10px rgba(var(--primary-rgb), 0.3);
        text-decoration: none;
    }

        .cph-btn-create:hover {
            filter: brightness(1.1);
            box-shadow: 0 5px 15px rgba(var(--primary-rgb), 0.4);
            color: var(--contrast-color);
            text-decoration: none;
        }
    /* ---- Filters bar ---- */
    .cph-filters-bar {
        width: 100%;
        display: flex;
        flex-direction: row;
        align-items: flex-end;
        gap: 0.75rem;
        flex-wrap: wrap;
        padding-top: 0.5rem;
        border-top: 1px solid rgba(var(--primary-rgb), 0.15);
    }
    /* ---- Filter Fields (Disposizione in riga) ---- */
    .compact-page-header .filter-field {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        flex: 1 1 180px;
        min-width: 160px;
    }

        .compact-page-header .filter-field label {
            color: rgb(var(--filterColor-rgb));
            font-size: 0.75rem;
            font-weight: 600;
        }

        .compact-page-header .filter-field input,
        .compact-page-header .filter-field select,
        .compact-page-header .filter-field .form-control {
            border: 1.5px solid rgba(var(--primary-rgb), 0.2);
            border-radius: 8px;
            padding: 0.38rem 0.7rem;
            font-size: 0.85rem;
            background: rgba(var(--filterBackground-rgb), 1);
            color: rgb(var(--filterColor-rgb));
            height: 34px;
            width: 100%;
        }

            .compact-page-header .filter-field input:focus,
            .compact-page-header .filter-field select:focus {
                border-color: rgb(var(--primary-rgb));
                box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.1);
                outline: none;
            }
    /* ---- Filter action buttons ---- */
    .cph-btn-apply {
        background: linear-gradient(135deg, rgb(var(--primary-rgb)) 0%, rgb(var(--secondary-rgb)) 100%);
        border: none;
        border-radius: 8px;
        padding: 0.38rem 1rem;
        color: var(--contrast-color);
        font-weight: 700;
        font-size: 0.85rem;
        box-shadow: 0 3px 10px rgba(var(--primary-rgb), 0.3);
        height: 34px;
        cursor: pointer;
    }

        .cph-btn-apply:hover {
            filter: brightness(1.1);
            box-shadow: 0 5px 14px rgba(var(--primary-rgb), 0.4);
            color: var(--contrast-color);
        }

    .cph-btn-reset {
        background: rgba(var(--primary-rgb), 0.07);
        border: 1.5px solid rgba(var(--primary-rgb), 0.2);
        border-radius: 8px;
        padding: 0.38rem 0.85rem;
        color: rgb(var(--primary-rgb));
        font-weight: 600;
        font-size: 0.85rem;
        height: 34px;
        cursor: pointer;
    }

        .cph-btn-reset:hover {
            background: rgba(var(--primary-rgb), 0.13);
            border-color: rgba(var(--primary-rgb), 0.35);
            color: rgb(var(--primary-rgb));
        }