/*
 * action-align.css — right-align form action buttons across every admin page.
 *
 * Targets a form's ACTION ROW: a block that holds a primary/submit button and no
 * input fields, and pushes it to the right edge of its card/content. Search &
 * filter controls are left alone — the shared list panel lives outside <form>
 * (a [data-list-panel] div), and filter forms use the .crm-filter-* classes,
 * both excluded below. Uses :has() (Baseline 2023, all current browsers).
 */

/* An action row: a block whose direct child is a primary/submit/large/cancel
   button, with no field inputs inside — i.e. a button row, not an input row.
   All pseudo-classes below apply to the SAME element (no stray whitespace). */
.nk-content-body form:not(.crm-filter-form) :is(div, p, .form-group):has(> [type="submit"], > .btn-primary, > .btn-success, > .btn-danger, > .btn-lg):not(.input-group):not(.crm-filter-actions):not([data-list-panel]):not(:has(input:not([type="hidden"]):not([type="submit"]):not([type="button"]), select, textarea)) {
    text-align: right;
}

/* Same rows that lay their buttons out with flexbox. */
.nk-content-body form:not(.crm-filter-form) :is(div, p, .form-group).d-flex:has(> [type="submit"], > .btn-primary, > .btn-success, > .btn-danger, > .btn-lg):not(.crm-filter-actions):not([data-list-panel]):not(:has(input:not([type="hidden"]):not([type="submit"]):not([type="button"]), select, textarea)) {
    justify-content: flex-end;
}

/* A bare button placed directly inside the form with no wrapping row. */
.nk-content-body form:not(.crm-filter-form) > .btn {
    display: block;
    width: fit-content;
    margin-left: auto;
}
