/* Action tracks use the same intrinsic sizing as row-number-more.css. */
@layer alfares-table-actions {
  table:has(> :is(thead, tbody, tfoot) > tr > :is(th, td):is([data-table-action-cell], [data-column-key="actions"], [data-col="actions"],
    [data-unit-price-column="actions"], .my-document-line-table .col-action,
    .unit-col-actions, .unit-col-delete, .items-units-detail-table .col-delete,
    .units-col-action, .locations-col-action, .branches-col-action, .categories-col-action,
    .activities-col-action, .sources-col-action, .cost-centers-col-action, .sellers-col-action,
    .price-col-action, [data-price-level-table] [data-column-key="action"], .units-row-action, .locations-row-action, .branches-row-action,
    .categories-row-action, .activities-row-action, .sources-row-action, .cost-centers-row-action,
    .sellers-row-action, .price-row-action)),
  table:has(> tbody > tr > td > :is(.erp-detail-row-actions, .voucher-line-delete-stack, .opr-unit-menu-anchor,
    .unit-actions-head, .hrp-finance-actions, .hrp-table-action,
    .account-sessions__row-action, .myauth-table-action, .config-license-payment-complete-action,
    [data-recipe-remove])),
  table:has(> tbody > tr > td > form > .hrp-table-action) {
    table-layout: auto !important;
  }

  :is(th, td):is([data-table-action-cell], [data-column-key="actions"], [data-col="actions"],
    [data-unit-price-column="actions"], .my-document-line-table .col-action,
    .unit-col-actions, .unit-col-delete, .items-units-detail-table .col-delete,
    .units-col-action, .locations-col-action, .branches-col-action, .categories-col-action,
    .activities-col-action, .sources-col-action, .cost-centers-col-action, .sellers-col-action,
    .price-col-action, [data-price-level-table] [data-column-key="action"], .units-row-action, .locations-row-action, .branches-row-action,
    .categories-row-action, .activities-row-action, .sources-row-action, .cost-centers-row-action,
    .sellers-row-action, .price-row-action),
  td:has(> :is(.erp-detail-row-actions, .voucher-line-delete-stack, .opr-unit-menu-anchor,
    .unit-actions-head, .hrp-finance-actions, .hrp-table-action,
    .account-sessions__row-action, .myauth-table-action, .config-license-payment-complete-action,
    [data-recipe-remove])),
  td:has(> form > .hrp-table-action) {
    width: 1% !important;
    inline-size: 1% !important;
    min-width: 0 !important;
    min-inline-size: 0 !important;
    max-width: none !important;
    max-inline-size: none !important;
    padding-inline: 4px !important;
    white-space: nowrap !important;
    text-align: center !important;
  }

  :is(th, td) > :is(.erp-detail-row-actions, .voucher-line-delete-stack,
    .opr-unit-menu-anchor, .unit-actions-head, .hrp-finance-actions):not([hidden]):not([aria-hidden="true"]) {
    display: inline-flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    width: max-content !important;
    inline-size: max-content !important;
    min-width: max-content !important;
    min-inline-size: max-content !important;
    max-width: none !important;
    max-inline-size: none !important;
    white-space: nowrap !important;
  }

  :is(th, td) > :is(.erp-detail-row-actions, .voucher-line-delete-stack,
    .opr-unit-menu-anchor, .unit-actions-head, .hrp-finance-actions) > :is(button, a, input, form) {
    flex: 0 0 auto !important;
  }

}

/* Keep normal flow below hidden classes and inline display rules. */
[data-price-level-table] td[data-column-key="action"] > .price-row-open:not([hidden]):not([aria-hidden="true"]) {
  display: inline-grid;
  vertical-align: middle;
}
