/* Customer administration presentation only. Keep action order, visibility and handlers. */
.customer-page-content .customer-management-panel {
    clear: both;
    margin: 0 15px 32px;
}

.customer-page-content .customer-management-panel .customer-management-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
    gap: 12px;
    width: 100%;
    margin: 0;
    padding: 16px;
    border: 1px solid #dce7ee;
    border-radius: 16px;
    background: #f5f8fb;
}

.customer-page-content .customer-management-actions::before,
.customer-page-content .customer-management-actions::after {
    display: none;
}

/* IDs keep these local rules ahead of the legacy theme loaded later in the head. */
.customer-page-content :is(
    .customer-management-actions > .btn,
    .customer-offer-actions > .btn,
    #ContentPlaceHolderMain_GalleryEdit > .btn,
    .Collage .btn-delete-gallery,
    #ContentPlaceHolderMain_LinkButton8,
    #ContentPlaceHolderMain_IndirizzoEdit > .btn,
    #ContentPlaceHolderMain_ServiziEdit > .btn,
    #ContentPlaceHolderMain_CategorieEdit > .btn,
    .evento-box > a[id$="_HyperLink2"]
),
#modal-recapiti .customer-admin-inline-action > .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    float: none;
    min-width: var(--customer-admin-min-width, 44px);
    max-width: 100%;
    min-height: var(--customer-admin-min-height, 44px);
    height: auto;
    margin: var(--customer-admin-margin, 0);
    padding: var(--customer-admin-padding, 10px 16px);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    white-space: normal;
    vertical-align: middle;
    text-decoration: none;
}

.customer-page-content .customer-management-actions > .btn {
    width: 100%;
    --customer-admin-min-width: 0;
    --customer-admin-min-height: 48px;
}

.customer-page-content :is(.customer-management-actions, .customer-offer-actions,
    #ContentPlaceHolderMain_GalleryEdit, #ContentPlaceHolderMain_ServiziEdit,
    #ContentPlaceHolderMain_CategorieEdit) > .btn > .fa,
.customer-page-content #ContentPlaceHolderMain_LinkButton8 > .fa {
    flex: 0 0 auto;
    margin: 0;
}

.customer-page-content .customer-management-actions .portal-icon-label,
.customer-page-content #ContentPlaceHolderMain_ServiziEdit .portal-icon-label,
.customer-page-content #ContentPlaceHolderMain_LinkButton8 .portal-icon-label {
    min-width: 0;
    white-space: normal;
    text-align: center;
}

.customer-page-content .customer-offer-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
}

.customer-page-content .customer-offer-actions > .btn {
    flex: 0 0 44px;
    width: 44px;
    --customer-admin-padding: 10px;
}

.customer-page-content .customer-offer-status {
    /* Bootstrap pull-right is important; remove only this presentation float. */
    float: none !important;
    flex: 0 1 auto;
    min-width: 0;
    margin-left: auto;
    line-height: 1.5;
}

.customer-page-content .customer-offer-status > span {
    min-width: 0;
}

.customer-page-content #ContentPlaceHolderMain_GalleryEdit > .btn,
.customer-page-content #ContentPlaceHolderMain_CategorieEdit > .btn {
    position: static;
    inset: auto;
    width: 44px;
    padding: 10px;
}

.customer-page-content .Collage .btn-delete-gallery {
    width: 44px;
    height: 44px;
    top: 8px;
    right: 8px;
}

.customer-page-content #ContentPlaceHolderMain_LinkButton8 {
    --customer-admin-margin: 18px 0 0;
}

.customer-page-content #ContentPlaceHolderMain_ServiziEdit,
.customer-page-content #ContentPlaceHolderMain_CategorieEdit {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin: 0 0 16px;
    /* Override the old inline bottom padding on ServiziEdit. */
    padding: 0 !important;
}

.customer-page-content #ContentPlaceHolderMain_IndirizzoEdit > .btn {
    display: flex;
    width: fit-content;
    margin-left: auto;
}

.customer-page-content .evento-box > a[id$="_HyperLink2"] {
    width: 44px;
    --customer-admin-padding: 10px;
    --customer-admin-margin: 6px 0 6px 8px;
}

#modal-recapiti .customer-admin-inline-action {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin: 10px 0;
}

#modal-recapiti .customer-admin-inline-value {
    flex: 1 1 200px;
    min-width: 0;
    overflow-wrap: anywhere;
}

#modal-recapiti .customer-admin-inline-action > .btn {
    flex: 0 0 auto;
    margin-left: auto;
}

.customer-page-content .management-modal .modal-footer,
#ContentPlaceHolderMain_PanelModalsAdmin .management-modal .modal-footer,
#ContentPlaceHolderMain_PanelModals .management-modal .modal-footer {
    align-items: stretch;
    gap: 12px;
}

.customer-page-content .management-modal .modal-footer > .btn,
#ContentPlaceHolderMain_PanelModalsAdmin .management-modal .modal-footer > .btn,
#ContentPlaceHolderMain_PanelModals .management-modal .modal-footer > .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    margin: 0;
}

.customer-page-content .management-modal .modal-footer > .btn > .fa,
#ContentPlaceHolderMain_PanelModalsAdmin .management-modal .modal-footer > .btn > .fa,
#ContentPlaceHolderMain_PanelModals .management-modal .modal-footer > .btn > .fa {
    flex: 0 0 auto;
}

@media (max-width: 767px) {
    .customer-page-content .customer-management-panel .customer-management-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 12px;
    }
}

@media (max-width: 575px) {
    .customer-page-content .customer-management-panel .customer-management-actions {
        grid-template-columns: minmax(0, 1fr);
    }

    .customer-page-content .customer-offer-status:has(svg) {
        flex-basis: 100%;
        margin-left: 0;
    }

    .customer-page-content #ContentPlaceHolderMain_LinkButton8,
    .customer-page-content #ContentPlaceHolderMain_IndirizzoEdit > .btn,
    .customer-page-content #ContentPlaceHolderMain_ServiziEdit > .btn,
    #modal-recapiti .customer-admin-inline-action > .btn {
        width: 100%;
    }

    .customer-page-content .management-modal .modal-footer > .btn,
    #ContentPlaceHolderMain_PanelModalsAdmin .management-modal .modal-footer > .btn,
    #ContentPlaceHolderMain_PanelModals .management-modal .modal-footer > .btn {
        flex: 1 1 100%;
    }
}
