/**
 * HelpAlong Staff Portal — structural control alignment.
 * v2.46.31
 *
 * Audit Trail keeps its v2.46.30 structural correction. The v2.46.31 layer
 * below extends the same page-owned approach to other Staff Portal sections:
 * only explicitly opted-in filter forms and section-scoped action rows are
 * aligned. No broad all-module button/grid override is used.
 */

/* Audit Trail filter bar: a deliberate desktop grid that fits the portal
 * content column beside the Staff Portal navigation rather than the viewport. */
body.hasp-staff-portal-page .hasp-audit-filters {
    display: grid !important;
    grid-template-columns:
        minmax(260px, 1.9fr)
        repeat(4, minmax(105px, .78fr))
        repeat(2, minmax(120px, .82fr))
        104px
        80px !important;
    gap: 10px;
    align-items: end !important;
}

body.hasp-staff-portal-page .hasp-audit-filters > * {
    min-width: 0;
    box-sizing: border-box;
}

/* Search and select/date controls share one consistent 40px control height. */
body.hasp-staff-portal-page .hasp-audit-filters > select,
body.hasp-staff-portal-page .hasp-audit-filters > label input,
body.hasp-staff-portal-page .hasp-audit-filters .hasp-audit-search input {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    height: 40px;
    margin: 0;
    box-sizing: border-box;
}

body.hasp-staff-portal-page .hasp-audit-filters > label:not(.hasp-audit-search) {
    display: grid;
    gap: 5px;
    align-self: end;
    margin: 0;
    line-height: 1.1;
}

body.hasp-staff-portal-page .hasp-audit-search {
    position: relative;
    align-self: end;
    margin: 0;
}

body.hasp-staff-portal-page .hasp-audit-search .dashicons {
    top: 50%;
    transform: translateY(-50%);
}

/* Apply and Reset are equal-height grid controls and remain on the same row. */
body.hasp-staff-portal-page .hasp-audit-filters > .hasp-btn {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    height: 40px;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: end;
    box-sizing: border-box;
    white-space: nowrap;
}

/* Result heading and export action stay vertically centred. */
body.hasp-staff-portal-page .hasp-audit-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

body.hasp-staff-portal-page .hasp-audit-toolbar > .hasp-btn {
    flex: 0 0 auto;
    margin: 0 0 0 auto;
    align-self: center;
}

/* Narrow desktop/tablet: deliberately use balanced rows rather than allowing
 * one trailing control to fall onto an accidental line by itself. */
@media (max-width: 1450px) and (min-width: 921px) {
    body.hasp-staff-portal-page .hasp-audit-filters {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
    body.hasp-staff-portal-page .hasp-audit-filters .hasp-audit-search {
        grid-column: span 2;
    }
    body.hasp-staff-portal-page .hasp-audit-filters > .hasp-btn {
        width: 100%;
    }
}

@media (max-width: 920px) and (min-width: 681px) {
    body.hasp-staff-portal-page .hasp-audit-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    body.hasp-staff-portal-page .hasp-audit-filters .hasp-audit-search {
        grid-column: 1 / -1;
    }
}

@media (max-width: 680px) {
    body.hasp-staff-portal-page .hasp-audit-filters {
        grid-template-columns: 1fr !important;
        align-items: stretch !important;
    }
    body.hasp-staff-portal-page .hasp-audit-filters > .hasp-btn {
        width: 100%;
    }
    body.hasp-staff-portal-page .hasp-audit-toolbar {
        align-items: stretch;
        flex-direction: column;
    }
    body.hasp-staff-portal-page .hasp-audit-toolbar > .hasp-btn {
        width: 100%;
        margin-left: 0;
        justify-content: center;
    }
}

/* ========================================================================== 
 * v2.46.31 — Section-scoped structural alignment
 * --------------------------------------------------------------------------
 * These rules are intentionally opt-in. Only forms carrying
 * .hasp-aligned-filter and explicit section body classes are affected.
 * This prevents a repeat of the v2.46.28 broad portal override.
 * ========================================================================== */
body.hasp-staff-portal-page .hasp-aligned-filter {
    --hasp-align-control-height: 40px;
    align-items: end;
}
body.hasp-staff-portal-page .hasp-aligned-filter > label {
    min-width: 0;
    margin: 0 !important;
    align-self: end;
}
body.hasp-staff-portal-page .hasp-aligned-filter > label > input:not([type="hidden"]),
body.hasp-staff-portal-page .hasp-aligned-filter > label > select,
body.hasp-staff-portal-page .hasp-aligned-filter > input[type="search"],
body.hasp-staff-portal-page .hasp-aligned-filter > input[type="date"],
body.hasp-staff-portal-page .hasp-aligned-filter > select,
body.hasp-staff-portal-page .hasp-aligned-filter > .hasp-btn,
body.hasp-staff-portal-page .hasp-aligned-filter .hasp-filter-actions > .hasp-btn {
    min-height: var(--hasp-align-control-height) !important;
    height: var(--hasp-align-control-height) !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    box-sizing: border-box;
}
body.hasp-staff-portal-page .hasp-aligned-filter > .hasp-btn,
body.hasp-staff-portal-page .hasp-aligned-filter .hasp-filter-actions > .hasp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}
body.hasp-staff-portal-page .hasp-filter-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
    margin: 0;
    align-self: end;
    white-space: nowrap;
}
body.hasp-staff-portal-page .hasp-filter-actions > .hasp-btn {
    width: auto !important;
    min-width: 82px;
    margin: 0 !important;
}
body.hasp-staff-portal-page .hasp-filter-actions > .hasp-btn--primary,
body.hasp-staff-portal-page .hasp-filter-actions > .hasp-btn--dark {
    min-width: 104px;
}

/* Shared website-content list pages: SIL Vacancies, Service Areas, Services,
 * Resources, Testimonials, FAQs, Our Team and Job Opportunities. */
body.hasp-section-vacancies .hasp-content-toolbar,
body.hasp-section-locations .hasp-content-toolbar,
body.hasp-section-services .hasp-content-toolbar,
body.hasp-section-resources .hasp-content-toolbar,
body.hasp-section-testimonials .hasp-content-toolbar,
body.hasp-section-faqs .hasp-content-toolbar,
body.hasp-section-team .hasp-content-toolbar,
body.hasp-section-jobs .hasp-content-toolbar {
    --hasp-align-control-height: 40px;
    display: grid !important;
    grid-template-columns: minmax(260px, 1.7fr) minmax(145px, .72fr) minmax(165px, .82fr) minmax(190px, auto) !important;
    gap: 10px !important;
    align-items: end !important;
}
body.hasp-section-vacancies .hasp-content-filter-actions,
body.hasp-section-locations .hasp-content-filter-actions,
body.hasp-section-services .hasp-content-filter-actions,
body.hasp-section-resources .hasp-content-filter-actions,
body.hasp-section-testimonials .hasp-content-filter-actions,
body.hasp-section-faqs .hasp-content-filter-actions,
body.hasp-section-team .hasp-content-filter-actions,
body.hasp-section-jobs .hasp-content-filter-actions { justify-self: end; }

/* Website Enquiries: five filters plus one inseparable action group. */
body.hasp-section-enquiries .hasp-enq-toolbar {
    --hasp-align-control-height: 36px;
    display: grid !important;
    grid-template-columns: minmax(230px, 1.55fr) repeat(4, minmax(115px, .78fr)) minmax(190px, auto) !important;
    gap: 8px !important;
    align-items: end !important;
}
body.hasp-section-enquiries .hasp-enq-filter-actions { justify-self: end; }

/* Job Applications: keep Apply/Reset together instead of allowing Reset to
 * become an orphan grid item at intermediate portal widths. */
body.hasp-section-applications .hasp-app-toolbar {
    --hasp-align-control-height: 40px;
    display: grid !important;
    grid-template-columns: minmax(230px, 1.45fr) minmax(190px, 1fr) minmax(150px, .72fr) minmax(145px, .68fr) minmax(190px, auto) !important;
    gap: 10px !important;
    align-items: end !important;
}
body.hasp-section-applications .hasp-app-filter-actions { justify-self: end; }

/* Website Pages. */
body.hasp-section-website_pages .hasp-pages-filters {
    --hasp-align-control-height: 42px;
    display: grid !important;
    grid-template-columns: minmax(320px, 1fr) minmax(190px, .42fr) minmax(180px, auto) !important;
    align-items: end !important;
    gap: 10px !important;
}
body.hasp-section-website_pages .hasp-pages-filter-actions { justify-self: end; }

/* SIL Management register. */
body.hasp-section-sil_management .hasp-sil-filters {
    --hasp-align-control-height: 40px;
    display: grid !important;
    grid-template-columns: minmax(280px, 1.65fr) minmax(200px, .65fr) minmax(190px, auto) !important;
    align-items: end !important;
    gap: 10px !important;
}
body.hasp-section-sil_management .hasp-sil-filter-actions { justify-self: end; }

/* Newsletter list and reports. */
body.hasp-section-newsletters .hasp-filterbar {
    --hasp-align-control-height: 40px;
    display: grid !important;
    grid-template-columns: minmax(300px, 1fr) auto !important;
    align-items: end !important;
    gap: 10px !important;
}
body.hasp-section-newsletter_reports .hasp-filterbar {
    --hasp-align-control-height: 40px;
    display: grid !important;
    grid-template-columns: minmax(300px, 1fr) minmax(190px, auto) !important;
    align-items: end !important;
    gap: 10px !important;
}
body.hasp-section-newsletter_reports .hasp-newsletter-report-filter-actions { justify-self: end; }

/* Newsletter Recipients has a deliberately dense toolbar; preserve its compact
 * height while keeping Apply/Reset together. */
body.hasp-section-newsletter_recipients .hasp-recipient-filterbar {
    --hasp-align-control-height: 36px;
    display: grid !important;
    grid-template-columns: minmax(245px, 1.45fr) repeat(3, minmax(128px, .68fr)) 78px minmax(188px, auto) !important;
    align-items: end !important;
    gap: 7px !important;
}
body.hasp-section-newsletter_recipients .hasp-recipient-filter-actions { justify-self: end; }
body.hasp-section-newsletter_recipients .hasp-recipient-bulkbar {
    align-items: end;
}

/* Staff Directory search. */
body.hasp-section-staff_directory .hasp-filterbar {
    --hasp-align-control-height: 40px;
    display: grid !important;
    grid-template-columns: minmax(300px, 1fr) auto !important;
    align-items: end !important;
    gap: 10px !important;
}

/* Social Media Marketing content-library toolbar. */
body.hasp-section-social_marketing .hasp-social-toolbar {
    --hasp-align-control-height: 42px;
    display: grid !important;
    grid-template-columns: minmax(270px, 1fr) minmax(210px, .55fr) minmax(180px, auto) !important;
    align-items: end !important;
    gap: 10px !important;
}
body.hasp-section-social_marketing .hasp-social-filter-actions { justify-self: end; }
body.hasp-section-social_marketing .hasp-social-editor-actions,
body.hasp-section-social_marketing .hasp-social-report-actions,
body.hasp-section-social_marketing .hasp-social-connection-actions {
    align-items: center;
}
body.hasp-section-social_marketing .hasp-social-report-actions form,
body.hasp-section-social_marketing .hasp-social-connection-actions form { margin: 0; }

/* Maintenance & Procurement: explicit grid per tab so an action button never
 * becomes a lone trailing item. */
body.hasp-section-maintenance .hasp-maint-filters {
    --hasp-align-control-height: 40px;
    align-items: end !important;
}
body.hasp-section-maintenance.hasp-tab-trash .hasp-maint-filters {
    grid-template-columns: minmax(220px, 1fr) auto !important;
}
body.hasp-section-maintenance.hasp-tab-requests .hasp-maint-filters--wide {
    grid-template-columns: repeat(3, minmax(150px, 1fr)) auto !important;
}
body.hasp-section-maintenance.hasp-tab-assets .hasp-maint-filters--wide,
body.hasp-section-maintenance.hasp-tab-reports .hasp-maint-filters--wide {
    grid-template-columns: repeat(4, minmax(145px, 1fr)) auto !important;
}
body.hasp-section-maintenance.hasp-tab-work_orders .hasp-maint-filters,
body.hasp-section-maintenance.hasp-tab-purchase_orders .hasp-maint-filters {
    grid-template-columns: minmax(170px, .72fr) minmax(240px, 1fr) auto !important;
}
body.hasp-section-maintenance .hasp-maint-filters > .hasp-btn { justify-self: end; }

/* IT Consumables lives under the Maintenance section. */
body.hasp-section-maintenance.hasp-tab-it_consumables .hasp-itc-filters {
    --hasp-align-control-height: 40px;
    display: grid !important;
    grid-template-columns: minmax(240px, 1.35fr) minmax(165px, .7fr) minmax(220px, 1fr) auto !important;
    align-items: end !important;
    gap: 12px !important;
}
body.hasp-section-maintenance.hasp-tab-it_consumables .hasp-itc-filters > .hasp-btn { justify-self: end; }

/* Reimbursement and IT reporting forms place the form grid and submit action
 * on separate structural rows. Keep the submit action deliberately aligned to
 * the right edge rather than relying on inherited button width. */
body.hasp-section-reimbursements .hasp-report-filters,
body.hasp-section-maintenance.hasp-tab-it_consumables .hasp-report-filters {
    --hasp-align-control-height: 40px;
    display: grid !important;
    gap: 12px !important;
    align-items: end !important;
}
body.hasp-section-reimbursements .hasp-report-filters > .hasp-btn,
body.hasp-section-maintenance.hasp-tab-it_consumables .hasp-report-filters > .hasp-btn {
    width: auto !important;
    justify-self: end;
    min-width: 112px;
}
body.hasp-section-reimbursements .hasp-reimbursement-actions {
    align-items: center;
}
body.hasp-section-reimbursements .hasp-reimbursement-action-form { margin-bottom: 0; }

/* Team Recognition filters and action panels. */
body.hasp-section-team_recognition .hasp-recognition-filter-grid {
    grid-template-columns: minmax(280px, 1fr) minmax(170px, .55fr) minmax(220px, .7fr) auto !important;
    align-items: end !important;
    gap: 12px !important;
}
body.hasp-section-team_recognition .hasp-recognition-filter-grid label { margin: 0; min-width: 0; }
body.hasp-section-team_recognition .hasp-recognition-filter-grid input,
body.hasp-section-team_recognition .hasp-recognition-filter-grid select,
body.hasp-section-team_recognition .hasp-recognition-filter-grid > .hasp-btn {
    min-height: 40px;
    height: 40px;
    box-sizing: border-box;
}
body.hasp-section-team_recognition .hasp-recognition-filter-grid > .hasp-btn { justify-self: end; margin: 0; }
body.hasp-section-team_recognition .hasp-recognition-email-actions,
body.hasp-section-team_recognition .hasp-recognition-qr-actions { align-items: center; }

/* Enquiry lead-nurturing approval filters. */
body.hasp-section-enquiries .hasp-lead-nurture-filters {
    --hasp-align-control-height: 36px;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(150px, 1fr)) auto !important;
    align-items: end !important;
    gap: 8px !important;
}
body.hasp-section-enquiries .hasp-lead-nurture-filters > .hasp-btn { justify-self: end; }

/* Analytics / Search Demand: preserve their purpose-built nested grids but
 * align the final action rows and buttons to a single baseline. */
body.hasp-section-analytics .hasp-management-filter-actions,
body.hasp-section-analytics .hasp-demand-filter-actions,
body.hasp-section-analytics .hasp-analytics-oauth-actions,
body.hasp-section-analytics .hasp-demand-intro-actions {
    align-items: center;
}
body.hasp-section-analytics .hasp-management-filter-actions .hasp-btn,
body.hasp-section-analytics .hasp-demand-filter-actions .hasp-btn {
    min-height: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}
body.hasp-section-analytics .hasp-demand-filter-grid label,
body.hasp-section-analytics .hasp-management-filter-grid label { min-width: 0; }

/* Interview Bookings and administrative action rows. */
body.hasp-section-interview_bookings .hasp-interview-actions,
body.hasp-section-interview_bookings .hasp-interview-template-actions,
body.hasp-section-roles .hasp-section-actions,
body.hasp-section-settings .hasp-settings-save,
body.hasp-section-m365_integration .hasp-form-actions,
body.hasp-section-staff_directory .hasp-form-actions,
body.hasp-section-staff_documents .hasp-document-actions,
body.hasp-section-newsletter_settings .hasp-email-template-panel__actions,
body.hasp-section-newsletters .hasp-publish-actions,
body.hasp-section-newsletters .hasp-newsletter-actions-row {
    align-items: center;
}
body.hasp-section-interview_bookings .hasp-interview-actions form,
body.hasp-section-staff_documents .hasp-document-actions form,
body.hasp-section-newsletters .hasp-newsletter-actions-row form { margin: 0; }

/* Intermediate portal widths: use deliberate balanced rows. */
@media (max-width: 1260px) and (min-width: 781px) {
    body.hasp-section-enquiries .hasp-enq-toolbar {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
    body.hasp-section-enquiries .hasp-enq-toolbar > label:first-of-type { grid-column: span 2; }
    body.hasp-section-enquiries .hasp-enq-filter-actions { grid-column: 1 / -1; justify-self: end; }

    body.hasp-section-applications .hasp-app-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    body.hasp-section-applications .hasp-app-filter-actions { grid-column: 1 / -1; justify-self: end; }

    body.hasp-section-newsletter_recipients .hasp-recipient-filterbar {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
    body.hasp-section-newsletter_recipients .hasp-recipient-filterbar > label:first-of-type { grid-column: span 2; }
    body.hasp-section-newsletter_recipients .hasp-recipient-filter-actions { grid-column: 1 / -1; justify-self: end; }

    body.hasp-section-maintenance.hasp-tab-assets .hasp-maint-filters--wide,
    body.hasp-section-maintenance.hasp-tab-reports .hasp-maint-filters--wide {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    body.hasp-section-maintenance.hasp-tab-assets .hasp-maint-filters--wide > .hasp-btn,
    body.hasp-section-maintenance.hasp-tab-reports .hasp-maint-filters--wide > .hasp-btn {
        grid-column: 1 / -1;
        justify-self: end;
    }

    body.hasp-section-team_recognition .hasp-recognition-filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
    body.hasp-section-team_recognition .hasp-recognition-filter-grid > .hasp-btn {
        grid-column: 1 / -1;
        justify-self: end;
    }
}

@media (max-width: 980px) and (min-width: 781px) {
    body.hasp-section-vacancies .hasp-content-toolbar,
    body.hasp-section-locations .hasp-content-toolbar,
    body.hasp-section-services .hasp-content-toolbar,
    body.hasp-section-resources .hasp-content-toolbar,
    body.hasp-section-testimonials .hasp-content-toolbar,
    body.hasp-section-faqs .hasp-content-toolbar,
    body.hasp-section-team .hasp-content-toolbar,
    body.hasp-section-jobs .hasp-content-toolbar,
    body.hasp-section-website_pages .hasp-pages-filters,
    body.hasp-section-sil_management .hasp-sil-filters,
    body.hasp-section-social_marketing .hasp-social-toolbar,
    body.hasp-section-maintenance.hasp-tab-requests .hasp-maint-filters--wide,
    body.hasp-section-maintenance.hasp-tab-it_consumables .hasp-itc-filters,
    body.hasp-section-enquiries .hasp-lead-nurture-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    body.hasp-section-vacancies .hasp-content-filter-actions,
    body.hasp-section-locations .hasp-content-filter-actions,
    body.hasp-section-services .hasp-content-filter-actions,
    body.hasp-section-resources .hasp-content-filter-actions,
    body.hasp-section-testimonials .hasp-content-filter-actions,
    body.hasp-section-faqs .hasp-content-filter-actions,
    body.hasp-section-team .hasp-content-filter-actions,
    body.hasp-section-jobs .hasp-content-filter-actions,
    body.hasp-section-website_pages .hasp-pages-filter-actions,
    body.hasp-section-sil_management .hasp-sil-filter-actions,
    body.hasp-section-social_marketing .hasp-social-filter-actions,
    body.hasp-section-enquiries .hasp-lead-nurture-filters > .hasp-btn,
    body.hasp-section-maintenance.hasp-tab-requests .hasp-maint-filters--wide > .hasp-btn,
    body.hasp-section-maintenance.hasp-tab-it_consumables .hasp-itc-filters > .hasp-btn {
        grid-column: 1 / -1;
        justify-self: end;
    }
}

/* Mobile: one field per row, but paired Apply/Reset actions remain together. */
@media (max-width: 780px) {
    body.hasp-staff-portal-page .hasp-aligned-filter,
    body.hasp-section-vacancies .hasp-content-toolbar,
    body.hasp-section-locations .hasp-content-toolbar,
    body.hasp-section-services .hasp-content-toolbar,
    body.hasp-section-resources .hasp-content-toolbar,
    body.hasp-section-testimonials .hasp-content-toolbar,
    body.hasp-section-faqs .hasp-content-toolbar,
    body.hasp-section-team .hasp-content-toolbar,
    body.hasp-section-jobs .hasp-content-toolbar,
    body.hasp-section-enquiries .hasp-enq-toolbar,
    body.hasp-section-applications .hasp-app-toolbar,
    body.hasp-section-website_pages .hasp-pages-filters,
    body.hasp-section-sil_management .hasp-sil-filters,
    body.hasp-section-newsletter_reports .hasp-filterbar,
    body.hasp-section-newsletter_recipients .hasp-recipient-filterbar,
    body.hasp-section-social_marketing .hasp-social-toolbar,
    body.hasp-section-maintenance .hasp-maint-filters,
    body.hasp-section-maintenance.hasp-tab-it_consumables .hasp-itc-filters,
    body.hasp-section-enquiries .hasp-lead-nurture-filters {
        grid-template-columns: 1fr !important;
        align-items: stretch !important;
    }
    body.hasp-staff-portal-page .hasp-filter-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        grid-column: 1 / -1 !important;
        justify-self: stretch !important;
    }
    body.hasp-staff-portal-page .hasp-filter-actions > .hasp-btn {
        width: 100% !important;
        min-width: 0;
    }
    body.hasp-staff-portal-page .hasp-aligned-filter > .hasp-btn {
        width: 100% !important;
        justify-self: stretch !important;
    }
    body.hasp-section-team_recognition .hasp-recognition-filter-grid {
        grid-template-columns: 1fr !important;
    }
    body.hasp-section-team_recognition .hasp-recognition-filter-grid > .hasp-btn,
    body.hasp-section-reimbursements .hasp-report-filters > .hasp-btn,
    body.hasp-section-maintenance.hasp-tab-it_consumables .hasp-report-filters > .hasp-btn {
        width: 100% !important;
        justify-self: stretch;
    }
}

/* Page-owned action rows: align neighbouring buttons/forms without changing
 * the component's display model or workflow. This is deliberately scoped by
 * section so compact controls (for example Interview Bookings table actions)
 * keep their module-specific sizing. */
body.hasp-section-dashboard .hasp-top-actions,
body.hasp-section-dashboard .hasp-dash-hero-actions,
body.hasp-section-vacancies .hasp-content-hero-actions,
body.hasp-section-vacancies .hasp-content-card-actions,
body.hasp-section-vacancies .hasp-editor-actions,
body.hasp-section-locations .hasp-content-hero-actions,
body.hasp-section-locations .hasp-content-card-actions,
body.hasp-section-locations .hasp-editor-actions,
body.hasp-section-services .hasp-content-hero-actions,
body.hasp-section-services .hasp-content-card-actions,
body.hasp-section-services .hasp-editor-actions,
body.hasp-section-resources .hasp-content-hero-actions,
body.hasp-section-resources .hasp-content-card-actions,
body.hasp-section-resources .hasp-editor-actions,
body.hasp-section-testimonials .hasp-content-hero-actions,
body.hasp-section-testimonials .hasp-content-card-actions,
body.hasp-section-testimonials .hasp-editor-actions,
body.hasp-section-faqs .hasp-content-hero-actions,
body.hasp-section-faqs .hasp-content-card-actions,
body.hasp-section-faqs .hasp-editor-actions,
body.hasp-section-team .hasp-content-hero-actions,
body.hasp-section-team .hasp-content-card-actions,
body.hasp-section-team .hasp-editor-actions,
body.hasp-section-jobs .hasp-content-hero-actions,
body.hasp-section-jobs .hasp-content-card-actions,
body.hasp-section-jobs .hasp-editor-actions,
body.hasp-section-enquiries .hasp-enq-hero-actions,
body.hasp-section-enquiries .hasp-enq-profile-actions,
body.hasp-section-enquiries .hasp-enq-savebar,
body.hasp-section-applications .hasp-app-hero-actions,
body.hasp-section-applications .hasp-app-profile-actions,
body.hasp-section-applications .hasp-app-savebar,
body.hasp-section-website_pages .hasp-pages-actions,
body.hasp-section-website_pages .hasp-pages-editor-actions,
body.hasp-section-sil_management .hasp-sil-head-actions,
body.hasp-section-sil_management .hasp-sil-card-actions,
body.hasp-section-sil_management .hasp-sil-savebar,
body.hasp-section-staff_directory .hasp-section-actions,
body.hasp-section-staff_directory .hasp-form-actions,
body.hasp-section-staff_documents .hasp-document-actions,
body.hasp-section-m365_integration .hasp-form-actions,
body.hasp-section-newsletters .hasp-builder-hero-actions,
body.hasp-section-newsletters .hasp-publish-actions,
body.hasp-section-newsletters .hasp-newsletter-actions-row,
body.hasp-section-newsletter_templates .hasp-content-card-actions,
body.hasp-section-newsletter_templates .hasp-card-utility-actions,
body.hasp-section-newsletter_sections .hasp-content-card-actions,
body.hasp-section-newsletter_sections .hasp-card-utility-actions,
body.hasp-section-newsletter_recipients .hasp-recipient-form-actions,
body.hasp-section-newsletter_recipients .hasp-recipient-form-buttons,
body.hasp-section-newsletter_settings .hasp-email-template-panel__actions,
body.hasp-section-newsletter_settings .hasp-email-template-savebar,
body.hasp-section-roles .hasp-role-save,
body.hasp-section-settings .hasp-settings-save,
body.hasp-section-analytics .hasp-analytics-hero-actions,
body.hasp-section-analytics .hasp-settings-save,
body.hasp-section-social_marketing .hasp-social-editor-actions,
body.hasp-section-social_marketing .hasp-social-campaign-actions,
body.hasp-section-social_marketing .hasp-social-report-actions,
body.hasp-section-social_marketing .hasp-social-settings-save,
body.hasp-section-social_marketing .hasp-social-connection-actions,
body.hasp-section-maintenance .hasp-maint-head-actions,
body.hasp-section-maintenance .hasp-maint-form-actions,
body.hasp-section-maintenance .hasp-maint-toolbar,
body.hasp-section-maintenance .hasp-itc-actions,
body.hasp-section-reimbursements .hasp-reimbursement-actions,
body.hasp-section-team_recognition .hasp-recognition-email-actions,
body.hasp-section-team_recognition .hasp-recognition-qr-actions,
body.hasp-section-interview_bookings .hasp-interview-actions,
body.hasp-section-interview_bookings .hasp-interview-template-actions {
    align-items: center;
}

body.hasp-section-vacancies .hasp-content-card-actions form,
body.hasp-section-locations .hasp-content-card-actions form,
body.hasp-section-services .hasp-content-card-actions form,
body.hasp-section-resources .hasp-content-card-actions form,
body.hasp-section-testimonials .hasp-content-card-actions form,
body.hasp-section-faqs .hasp-content-card-actions form,
body.hasp-section-team .hasp-content-card-actions form,
body.hasp-section-jobs .hasp-content-card-actions form,
body.hasp-section-enquiries .hasp-enq-profile-actions form,
body.hasp-section-applications .hasp-app-profile-actions form,
body.hasp-section-website_pages .hasp-pages-actions form,
body.hasp-section-sil_management .hasp-sil-head-actions form,
body.hasp-section-sil_management .hasp-sil-card-actions form,
body.hasp-section-staff_directory .hasp-section-actions form,
body.hasp-section-staff_directory .hasp-form-actions form,
body.hasp-section-staff_documents .hasp-document-actions form,
body.hasp-section-newsletters .hasp-newsletter-actions-row form,
body.hasp-section-newsletter_templates .hasp-content-card-actions form,
body.hasp-section-newsletter_templates .hasp-card-utility-actions form,
body.hasp-section-newsletter_sections .hasp-content-card-actions form,
body.hasp-section-newsletter_sections .hasp-card-utility-actions form,
body.hasp-section-newsletter_recipients .hasp-recipient-form-buttons form,
body.hasp-section-social_marketing .hasp-social-report-actions form,
body.hasp-section-social_marketing .hasp-social-connection-actions form,
body.hasp-section-maintenance .hasp-maint-head-actions form,
body.hasp-section-maintenance .hasp-maint-toolbar form,
body.hasp-section-reimbursements .hasp-reimbursement-actions form,
body.hasp-section-team_recognition .hasp-recognition-email-actions form,
body.hasp-section-team_recognition .hasp-recognition-qr-actions form,
body.hasp-section-interview_bookings .hasp-interview-actions form {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Analytics demand matrix uses the same structural paired-action pattern as
 * other filter bars. */
body.hasp-section-analytics .hasp-demand-matrix-controls {
    --hasp-align-control-height: 40px;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(210px, 1fr)) minmax(190px, auto) !important;
    align-items: end !important;
    gap: 10px !important;
}
body.hasp-section-analytics .hasp-demand-matrix-controls > label {
    min-width: 0;
    margin: 0 !important;
}
body.hasp-section-analytics .hasp-demand-matrix-actions { justify-self: end; }

/* Reporting filter panels: keep the four report fields in one owned grid and
 * the Apply action on the same baseline at desktop widths. */
body.hasp-section-reimbursements .hasp-report-filters,
body.hasp-section-maintenance.hasp-tab-it_consumables .hasp-report-filters {
    grid-template-columns: minmax(0, 1fr) auto !important;
}
body.hasp-section-reimbursements .hasp-report-filters > .hasp-form-grid,
body.hasp-section-maintenance.hasp-tab-it_consumables .hasp-report-filters > .hasp-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(130px, 1fr)) !important;
    gap: 10px !important;
    align-items: end;
}
body.hasp-section-reimbursements .hasp-report-filters > .hasp-form-grid > label,
body.hasp-section-maintenance.hasp-tab-it_consumables .hasp-report-filters > .hasp-form-grid > label {
    min-width: 0;
    margin: 0 !important;
}
body.hasp-section-reimbursements .hasp-report-filters > .hasp-form-grid input,
body.hasp-section-reimbursements .hasp-report-filters > .hasp-form-grid select,
body.hasp-section-maintenance.hasp-tab-it_consumables .hasp-report-filters > .hasp-form-grid input,
body.hasp-section-maintenance.hasp-tab-it_consumables .hasp-report-filters > .hasp-form-grid select {
    min-height: 40px;
    height: 40px;
    box-sizing: border-box;
}

/* Automated Notifications list rows contain paired Edit/Delete actions. Keep
 * them on a shared baseline without changing notification behaviour. */
body.hasp-section-automated_notifications .hasp-notification-row > div:last-child {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
body.hasp-section-automated_notifications .hasp-notification-row > div:last-child .hasp-btn {
    margin: 0;
}

@media (max-width: 980px) and (min-width: 781px) {
    body.hasp-section-analytics .hasp-demand-matrix-controls {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    body.hasp-section-analytics .hasp-demand-matrix-actions {
        grid-column: 1 / -1;
        justify-self: end;
    }
    body.hasp-section-reimbursements .hasp-report-filters > .hasp-form-grid,
    body.hasp-section-maintenance.hasp-tab-it_consumables .hasp-report-filters > .hasp-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 780px) {
    body.hasp-section-analytics .hasp-demand-matrix-controls,
    body.hasp-section-reimbursements .hasp-report-filters,
    body.hasp-section-maintenance.hasp-tab-it_consumables .hasp-report-filters {
        grid-template-columns: 1fr !important;
    }
    body.hasp-section-analytics .hasp-demand-matrix-actions {
        grid-column: 1 / -1;
        justify-self: stretch;
    }
    body.hasp-section-reimbursements .hasp-report-filters > .hasp-form-grid,
    body.hasp-section-maintenance.hasp-tab-it_consumables .hasp-report-filters > .hasp-form-grid {
        grid-template-columns: 1fr !important;
    }
}
