/* ========================================
   COMPACT PAGE HEADER TAG HELPER
   Intestazione compatta con filtri integrati
   ======================================== */

.compact-page-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.07) 50%, rgba(102, 126, 234, 0.1) 100%);
    border: 1.5px solid rgba(102, 126, 234, 0.22);
    border-radius: 16px;
    padding: 1rem 1.5rem 1.1rem;
    margin: 0 0 1.5rem;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ---- Title bar (title + subtitle + create button) ---- */

.cph-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.cph-title-group {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
    min-width: 0;
}

.cph-title {
    color: #667eea;
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.25;
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cph-subtitle {
    color: #64748b;
    font-size: 0.82rem;
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.1px;
}

/* Create button */
.cph-btn-create {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    padding: 0.5rem 1.1rem;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.875rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: all 0.25s ease;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
}

    .cph-btn-create:hover {
        background: linear-gradient(135deg, #5a67d8 0%, #6b3f99 100%);
        color: #ffffff;
        transform: translateY(-1px);
        box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
        text-decoration: none;
    }

    .cph-btn-create:active {
        transform: translateY(0);
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
    }

    .cph-btn-create i {
        font-size: 0.85rem;
        transition: transform 0.25s ease;
    }

    .cph-btn-create:hover i {
        transform: rotate(90deg);
    }

/* ---- Filters bar ---- */

.cph-filters-bar {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(102, 126, 234, 0.15);
}

.cph-filter-fields {
    display: flex;
    align-items: flex-end;
    gap: 0.65rem;
    flex: 1;
    flex-wrap: wrap;
    min-width: 0;
}

/* Each filter field inside compact-page-header */
.compact-page-header .filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 140px;
    flex: 1 1 140px;
}

    .compact-page-header .filter-field label {
        color: #4f46e5;
        font-size: 0.75rem;
        font-weight: 600;
        margin: 0;
        letter-spacing: 0.2px;
    }

    .compact-page-header .filter-field input,
    .compact-page-header .filter-field select,
    .compact-page-header .filter-field .form-control,
    .compact-page-header .filter-field .form-select {
        border: 1.5px solid rgba(99, 102, 241, 0.2);
        border-radius: 8px;
        padding: 0.38rem 0.7rem;
        font-size: 0.85rem;
        background: rgba(255, 255, 255, 0.95);
        color: #1e293b;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
        height: 34px;
    }

        .compact-page-header .filter-field input:focus,
        .compact-page-header .filter-field select:focus,
        .compact-page-header .filter-field .form-control:focus,
        .compact-page-header .filter-field .form-select:focus {
            border-color: #6366f1;
            box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
            outline: none;
            background: #ffffff;
        }

        .compact-page-header .filter-field input::placeholder {
            color: #94a3b8;
            font-style: italic;
            font-size: 0.82rem;
        }

/* Filter action buttons */
.cph-filter-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.cph-btn-apply {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    border-radius: 8px;
    padding: 0.38rem 1rem;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.25s ease;
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.3);
    cursor: pointer;
    white-space: nowrap;
    height: 34px;
}

    .cph-btn-apply:hover {
        background: linear-gradient(135deg, #5558e3 0%, #7c3aed 100%);
        transform: translateY(-1px);
        box-shadow: 0 5px 14px rgba(99, 102, 241, 0.4);
        color: #ffffff;
    }

    .cph-btn-apply:active {
        transform: translateY(0);
        box-shadow: 0 2px 6px rgba(99, 102, 241, 0.25);
    }

    .cph-btn-apply i {
        font-size: 0.8rem;
    }

.cph-btn-reset {
    background: rgba(99, 102, 241, 0.07);
    border: 1.5px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    padding: 0.38rem 0.85rem;
    color: #4f46e5;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.25s ease;
    white-space: nowrap;
    height: 34px;
}

    .cph-btn-reset:hover {
        background: rgba(99, 102, 241, 0.13);
        border-color: rgba(99, 102, 241, 0.35);
        color: #4338ca;
        transform: translateY(-1px);
        text-decoration: none;
    }

    .cph-btn-reset:active {
        transform: translateY(0);
    }

    .cph-btn-reset i {
        font-size: 0.8rem;
    }

/* ---- Responsive ---- */

@media (max-width: 768px) {
    .compact-page-header {
        padding: 0.85rem 1rem 0.95rem;
    }

    .cph-title {
        font-size: 1.15rem;
        white-space: normal;
    }

    .cph-filter-fields {
        flex-direction: column;
    }

    .compact-page-header .filter-field {
        flex: 1 1 100%;
        min-width: 0;
    }

    .cph-filter-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 576px) {
    .cph-btn-create span,
    .cph-btn-apply span,
    .cph-btn-reset span {
        display: none;
    }

    .cph-btn-create,
    .cph-btn-apply,
    .cph-btn-reset {
        padding: 0.38rem 0.65rem;
    }
}
