/* Color only: explicit action roles. Keep dimensions, visibility and event handlers in their modules.
 * Important rules in this named layer take priority over legacy injected module colors.
 * No text-based classification or runtime DOM rewriting. */
@layer st-button-colors {
  /* secondary */
  :is(button, input[type="submit"], input[type="button"], a):where(
    .secondary,
    .st-button-secondary,
    [data-st-button="secondary"],
    .admin-secondary-button,
    .admin-secondary-action,
    .client-onboarding-cancel,
    .support-access-cancel,
    .animal-detail-pdf,
    .animal-detail-nav,
    [data-tag-cancel],
    [data-edit-cancel],
    .animal-photo-btn:not(.primary),
    [data-photo-action="primary"],
    .animal-status-filter,
    .activity-detail-reschedule,
    .activity-milk-toggle,
    .activity-material-remove,
    .bank-cancel,
    .bank-add-bank,
    #bank-use-new-bank,
    .candidate-review-btn,
    .lot-alert-action,
    .lot-detail-plan-weighing,
    .st-alert-open-activity,
    .full-btn,
    .econ-support-btn,
    .econ-doc-btn,
    .econ-doc-preview-back,
    .econ-op-cancel,
    .econ-sale-simulator-add,
    .econ-payment-cancel,
    .econ-collection-cancel,
    .econ-livestock-sale-cancel,
    .econ-partner-cancel,
    .econ-livestock-selected-toggle,
    .econ-livestock-sale-toolbtn,
    #econ-milk-save-customer,
    .settings-param-cancel,
    .users-action,
    .profile-account-btn,
    .profile-email-toggle,
    .help-back,
    .help-go,
    .text-link,
    .row-action,
    .support-open-btn:not([type="submit"]),
    .product-detail-action,
    .catalog-link,
    .product-edit-component-remove,
    .price-load-more,
    .st-purchase-partner-cancel,
    .st-sim-close-action,
    .st-sim-toggle,
    #st-sim-select,
    .reproduction-event-cancel,
    .reproduction-exposure-close-btn:not([data-close-exposure]),
    .postpartum-cancel,
    .animal-exit-cancel,
    .logout-btn,
    .logout-link,
    #support-end-session,
    .icon-btn,
    .icon-button,
    .menu,
    .st-select-button,
    .st-date-button,
    .st-date-title,
    [data-range-prev],
    [data-range-next],
    [data-date-prev],
    [data-date-next],
    #calendar-today,
    #calendar-prev,
    #calendar-next,
    .diagnosis-plan-link,
    [data-open],
    .attention-filter-note>button,
    .animal-exit-draft-row>button,
    .st-attention-popup-action,
    .ma-detail-link,
    .milk-alert-view,
    #milk-alert-change-cutoff,
    .milk-month-button,
    #milk-month-prev-year,
    #milk-month-next-year,
    .milk-month-current,
    [data-econ-return-management],
    [data-lot-menu],
    [role="menuitem"]
  ) {
    --st-button-role: secondary;
    background: #ffffff !important;
    border-color: #d8e1db !important;
    color: #245c49 !important;
  }
  :is(button, input[type="submit"], input[type="button"], a):where(
    .secondary,
    .st-button-secondary,
    [data-st-button="secondary"],
    .admin-secondary-button,
    .admin-secondary-action,
    .client-onboarding-cancel,
    .support-access-cancel,
    .animal-detail-pdf,
    .animal-detail-nav,
    [data-tag-cancel],
    [data-edit-cancel],
    .animal-photo-btn:not(.primary),
    [data-photo-action="primary"],
    .animal-status-filter,
    .activity-detail-reschedule,
    .activity-milk-toggle,
    .activity-material-remove,
    .bank-cancel,
    .bank-add-bank,
    #bank-use-new-bank,
    .candidate-review-btn,
    .lot-alert-action,
    .lot-detail-plan-weighing,
    .st-alert-open-activity,
    .full-btn,
    .econ-support-btn,
    .econ-doc-btn,
    .econ-doc-preview-back,
    .econ-op-cancel,
    .econ-sale-simulator-add,
    .econ-payment-cancel,
    .econ-collection-cancel,
    .econ-livestock-sale-cancel,
    .econ-partner-cancel,
    .econ-livestock-selected-toggle,
    .econ-livestock-sale-toolbtn,
    #econ-milk-save-customer,
    .settings-param-cancel,
    .users-action,
    .profile-account-btn,
    .profile-email-toggle,
    .help-back,
    .help-go,
    .text-link,
    .row-action,
    .support-open-btn:not([type="submit"]),
    .product-detail-action,
    .catalog-link,
    .product-edit-component-remove,
    .price-load-more,
    .st-purchase-partner-cancel,
    .st-sim-close-action,
    .st-sim-toggle,
    #st-sim-select,
    .reproduction-event-cancel,
    .reproduction-exposure-close-btn:not([data-close-exposure]),
    .postpartum-cancel,
    .animal-exit-cancel,
    .logout-btn,
    .logout-link,
    #support-end-session,
    .icon-btn,
    .icon-button,
    .menu,
    .st-select-button,
    .st-date-button,
    .st-date-title,
    [data-range-prev],
    [data-range-next],
    [data-date-prev],
    [data-date-next],
    #calendar-today,
    #calendar-prev,
    #calendar-next,
    .diagnosis-plan-link,
    [data-open],
    .attention-filter-note>button,
    .animal-exit-draft-row>button,
    .st-attention-popup-action,
    .ma-detail-link,
    .milk-alert-view,
    #milk-alert-change-cutoff,
    .milk-month-button,
    #milk-month-prev-year,
    #milk-month-next-year,
    .milk-month-current,
    [data-econ-return-management],
    [data-lot-menu],
    [role="menuitem"]
  ):hover:not(:disabled):not([aria-disabled="true"]) {
    background: #f1f5f2 !important;
  }
  /* primary */
  :is(button, input[type="submit"], input[type="button"], a):where(
    .primary,
    .st-button-primary,
    [data-st-button="primary"],
    [type="submit"],
    .entry-button,
    .admin-login-button,
    .admin-primary-action,
    .client-onboarding-save,
    .support-access-confirm,
    .support-open-btn[type="submit"],
    .calendar-day-picker-new,
    .activity-execute-btn,
    .activity-material-add,
    .health-application-add,
    [data-health-treatment-execute],
    .bank-settings-add,
    .bank-save,
    .bank-adjust,
    .econ-op-add:not(.econ-sale-simulator-add),
    .econ-op-save,
    .econ-payment-save,
    .econ-collection-save,
    .econ-payable-action,
    .econ-receivable-action,
    .econ-livestock-sale-save,
    .econ-partner-save,
    .settings-manage-users-btn,
    .settings-param-edit,
    .milk-event-continue,
    .users-resend-btn,
    .product-pane-action:not(.product-presentation-remove),
    .product-variant-add,
    .new-product-link,
    .mini-action,
    .st-purchase-partner-save,
    .st-purchase-supplier-add,
    .econ-livestock-buyer-add,
    .animal-reproduction-add,
    .reproduction-event-save,
    .reproduction-birth-save,
    .reproduction-birth-complete-btn,
    .postpartum-action,
    .postpartum-save,
    .pregnancy-action,
    #inventory-adjustment-add,
    #catalog-purchase-product,
    [data-purchase-product],
    [data-create-stage],
    #bank-add-bank,
    #bank-use-new-bank,
    #st-sim-apply,
    #econ-milk-save-customer,
    #help-send-question,
    #help-send-current,
    #lot-weigh-pause,
    [data-lot-register-weighing],
    [data-photo-pick],
    .econ-position-detail-btn,
    .postpartum-treatment-bridge>button
  ) {
    --st-button-role: primary;
    background: #b7cd58 !important;
    border-color: #b7cd58 !important;
    color: #173f32 !important;
  }
  :is(button, input[type="submit"], input[type="button"], a):where(
    .primary,
    .st-button-primary,
    [data-st-button="primary"],
    [type="submit"],
    .entry-button,
    .admin-login-button,
    .admin-primary-action,
    .client-onboarding-save,
    .support-access-confirm,
    .support-open-btn[type="submit"],
    .calendar-day-picker-new,
    .activity-execute-btn,
    .activity-material-add,
    .health-application-add,
    [data-health-treatment-execute],
    .bank-settings-add,
    .bank-save,
    .bank-adjust,
    .econ-op-add:not(.econ-sale-simulator-add),
    .econ-op-save,
    .econ-payment-save,
    .econ-collection-save,
    .econ-payable-action,
    .econ-receivable-action,
    .econ-livestock-sale-save,
    .econ-partner-save,
    .settings-manage-users-btn,
    .settings-param-edit,
    .milk-event-continue,
    .users-resend-btn,
    .product-pane-action:not(.product-presentation-remove),
    .product-variant-add,
    .new-product-link,
    .mini-action,
    .st-purchase-partner-save,
    .st-purchase-supplier-add,
    .econ-livestock-buyer-add,
    .animal-reproduction-add,
    .reproduction-event-save,
    .reproduction-birth-save,
    .reproduction-birth-complete-btn,
    .postpartum-action,
    .postpartum-save,
    .pregnancy-action,
    #inventory-adjustment-add,
    #catalog-purchase-product,
    [data-purchase-product],
    [data-create-stage],
    #bank-add-bank,
    #bank-use-new-bank,
    #st-sim-apply,
    #econ-milk-save-customer,
    #help-send-question,
    #help-send-current,
    #lot-weigh-pause,
    [data-lot-register-weighing],
    [data-photo-pick],
    .econ-position-detail-btn,
    .postpartum-treatment-bridge>button
  ):hover:not(:disabled):not([aria-disabled="true"]) {
    background: #c4d775 !important;
  }
  /* secondary-exception */
  :is(button, input[type="submit"], input[type="button"], a):where(
    #report-active-animals,
    #animal-template-download,
    #lot-weigh-template,
    #settings-manage-users,
    #settings-open-prices,
    #users-view-pro,
    #management-analysis-refresh,
    .section-import-btn,
    .product-detail-action,
    .catalog-link,
    .text-btn,
    .auth-link-button
  ) {
    --st-button-role: secondary;
    background: #ffffff !important;
    border-color: #d8e1db !important;
    color: #245c49 !important;
  }
  :is(button, input[type="submit"], input[type="button"], a):where(
    #report-active-animals,
    #animal-template-download,
    #lot-weigh-template,
    #settings-manage-users,
    #settings-open-prices,
    #users-view-pro,
    #management-analysis-refresh,
    .section-import-btn,
    .product-detail-action,
    .catalog-link,
    .text-btn,
    .auth-link-button
  ):hover:not(:disabled):not([aria-disabled="true"]) {
    background: #f1f5f2 !important;
  }
  /* warning */
  :is(button, input[type="submit"], input[type="button"], a):where(
    .st-button-warning,
    [data-st-button="warning"],
    .lot-danger,
    .animal-exit-btn,
    .animal-exit-confirm,
    [data-close-exposure]
  ) {
    --st-button-role: warning;
    background: #fff3df !important;
    border-color: #d9b479 !important;
    color: #854b16 !important;
  }
  :is(button, input[type="submit"], input[type="button"], a):where(
    .st-button-warning,
    [data-st-button="warning"],
    .lot-danger,
    .animal-exit-btn,
    .animal-exit-confirm,
    [data-close-exposure]
  ):hover:not(:disabled):not([aria-disabled="true"]) {
    background: #ffe8bf !important;
  }
  /* danger */
  :is(button, input[type="submit"], input[type="button"], a):where(
    .danger,
    .st-button-danger,
    [data-st-button="danger"],
    .users-danger,
    .activity-detail-delete,
    .lot-delete-btn,
    .product-presentation-remove,
    [data-remove-presentation],
    [data-photo-action="delete"]
  ) {
    --st-button-role: danger;
    background: #fff2ef !important;
    border-color: #dba59b !important;
    color: #a13225 !important;
  }
  :is(button, input[type="submit"], input[type="button"], a):where(
    .danger,
    .st-button-danger,
    [data-st-button="danger"],
    .users-danger,
    .activity-detail-delete,
    .lot-delete-btn,
    .product-presentation-remove,
    [data-remove-presentation],
    [data-photo-action="delete"]
  ):hover:not(:disabled):not([aria-disabled="true"]) {
    background: #ffe4df !important;
  }
  /* danger-confirm */
  :is(button, input[type="submit"], input[type="button"], a):where(
    .confirm-delete,
    .st-button-danger-confirm,
    [data-st-button="danger-confirm"],
    .users-confirm-accept,
    .presentation-delete-mode #product-subedit-save
  ) {
    --st-button-role: danger-confirm;
    background: #b43b2e !important;
    border-color: #b43b2e !important;
    color: #ffffff !important;
  }
  :is(button, input[type="submit"], input[type="button"], a):where(
    .confirm-delete,
    .st-button-danger-confirm,
    [data-st-button="danger-confirm"],
    .users-confirm-accept,
    .presentation-delete-mode #product-subedit-save
  ):hover:not(:disabled):not([aria-disabled="true"]) {
    background: #9c3025 !important;
  }
  /* selection */
  :is(button, input[type="submit"], input[type="button"], a):where(
    .animal-tab,
    .product-tab,
    .product-detail-tab,
    .terneros-tab,
    .reproduction-tab,
    .econ4-tab,
    .pregnancy-filter,
    .catalog-filter,
    .client-filter,
    .plan-filter,
    .lot-weigh-mode,
    .st-select-option,
    [data-calendar-view],
    [data-management-tab],
    [data-bull-source],
    [data-month-value],
    [data-date-choice],
    .st-date-day,
    [data-date-value]
  ) {
    --st-button-role: selection;
    background: #f5f8f5 !important;
    border-color: #c7d3c9 !important;
    color: #405049 !important;
  }
  :is(button, input[type="submit"], input[type="button"], a):where(
    .animal-tab,
    .product-tab,
    .product-detail-tab,
    .terneros-tab,
    .reproduction-tab,
    .econ4-tab,
    .pregnancy-filter,
    .catalog-filter,
    .client-filter,
    .plan-filter,
    .lot-weigh-mode,
    .st-select-option,
    [data-calendar-view],
    [data-management-tab],
    [data-bull-source],
    [data-month-value],
    [data-date-choice],
    .st-date-day,
    [data-date-value]
  ):hover:not(:disabled):not([aria-disabled="true"]) {
    background: #e9f0eb !important;
  }
  /* selection-active */
  :is(button, input[type="submit"], input[type="button"], a):where(
    .animal-tab.active,
    .product-tab.active,
    .product-detail-tab.active,
    .terneros-tab.active,
    .reproduction-tab.active,
    .econ4-tab.active,
    .pregnancy-filter.active,
    .catalog-filter.active,
    .client-filter.active,
    .plan-filter.active,
    .lot-weigh-mode.active,
    .st-select-option.selected,
    [data-calendar-view].active,
    [data-management-tab].active,
    [data-bull-source][aria-pressed="true"],
    [data-month-value].active,
    [data-date-choice].selected,
    .st-date-day.selected
  ) {
    --st-button-role: selection-active;
    background: #173f32 !important;
    border-color: #173f32 !important;
    color: #ffffff !important;
  }
  :is(button, input[type="submit"], input[type="button"], a):where(
    .animal-tab.active,
    .product-tab.active,
    .product-detail-tab.active,
    .terneros-tab.active,
    .reproduction-tab.active,
    .econ4-tab.active,
    .pregnancy-filter.active,
    .catalog-filter.active,
    .client-filter.active,
    .plan-filter.active,
    .lot-weigh-mode.active,
    .st-select-option.selected,
    [data-calendar-view].active,
    [data-management-tab].active,
    [data-bull-source][aria-pressed="true"],
    [data-month-value].active,
    [data-date-choice].selected,
    .st-date-day.selected
  ):hover:not(:disabled):not([aria-disabled="true"]) {
    background: #245c49 !important;
  }
  /* sidebar */
  :is(button, input[type="submit"], input[type="button"], a):where(
    .nav-item,
    .admin-nav-item
  ) {
    --st-button-role: sidebar;
    background: transparent !important;
    border-color: transparent !important;
    color: #bdd0c8 !important;
  }
  :is(button, input[type="submit"], input[type="button"], a):where(
    .nav-item,
    .admin-nav-item
  ):hover:not(:disabled):not([aria-disabled="true"]) {
    background: rgba(255,255,255,.11) !important;
  }
  /* sidebar-active */
  :is(button, input[type="submit"], input[type="button"], a):where(
    .nav-item.active,
    .admin-nav-item.active
  ) {
    --st-button-role: sidebar-active;
    background: #245c49 !important;
    border-color: #245c49 !important;
    color: #ffffff !important;
  }
  :is(button, input[type="submit"], input[type="button"], a):where(
    .nav-item.active,
    .admin-nav-item.active
  ):hover:not(:disabled):not([aria-disabled="true"]) {
    background: #2c6953 !important;
  }
  /* icon */
  :is(button, input[type="submit"], input[type="button"], a):where(
    .close,
    [aria-label="Cerrar"],
    .animal-close,
    .lot-close,
    .lot-edit-close,
    .lot-weigh-close,
    .lot-dose-close,
    .activity-detail-close,
    .execution-close,
    .transition-close,
    .reproduction-heat-picker-close,
    .reproduction-event-close,
    .reproduction-bull-close,
    .reproduction-birth-close,
    .postpartum-close,
    .repro-protocol-close,
    .animal-detail-close,
    .animal-exit-close,
    .product-detail-close,
    .product-edit-close,
    .product-subedit-close,
    .variant-edit-close,
    .catalog-insumo-close,
    .inventory-close,
    .inventory-supplier-close,
    .inventory-move-close,
    .econ-op-close,
    .econ-payable-close,
    .econ-receivable-close,
    .econ-payment-close,
    .econ-collection-close,
    .econ-position-modal-close,
    .econ-movement-close,
    .econ-partner-close,
    .bank-modal-close,
    .valuation-close,
    .help-close,
    .st-attention-center-close,
    .st-attention-popup-close,
    .st-weighing-plan-close,
    .st-purchase-partner-close,
    .st-sim-close,
    .candidate-plan-close,
    .ma-policy-close,
    .terneros-transition-v2-close,
    .dialog-close,
    .client-onboarding-close,
    .support-access-dialog-close,
    .animal-search-clear,
    .health-application-close,
    .calendar-day-picker-close,
    .users-help,
    .st-weighing-plan-remove,
    .econ-sale-doc-remove,
    .st-purchase-doc-remove,
    .health-treatment-remove,
    #cancel-new-product,
    .product-edit-component-remove,
    [data-photo-cancel]:not(.animal-photo-btn),
    [aria-label="Eliminar componente"]
  ) {
    --st-button-role: icon;
    background: transparent !important;
    border-color: transparent !important;
    color: #245c49 !important;
  }
  :is(button, input[type="submit"], input[type="button"], a):where(
    .close,
    [aria-label="Cerrar"],
    .animal-close,
    .lot-close,
    .lot-edit-close,
    .lot-weigh-close,
    .lot-dose-close,
    .activity-detail-close,
    .execution-close,
    .transition-close,
    .reproduction-heat-picker-close,
    .reproduction-event-close,
    .reproduction-bull-close,
    .reproduction-birth-close,
    .postpartum-close,
    .repro-protocol-close,
    .animal-detail-close,
    .animal-exit-close,
    .product-detail-close,
    .product-edit-close,
    .product-subedit-close,
    .variant-edit-close,
    .catalog-insumo-close,
    .inventory-close,
    .inventory-supplier-close,
    .inventory-move-close,
    .econ-op-close,
    .econ-payable-close,
    .econ-receivable-close,
    .econ-payment-close,
    .econ-collection-close,
    .econ-position-modal-close,
    .econ-movement-close,
    .econ-partner-close,
    .bank-modal-close,
    .valuation-close,
    .help-close,
    .st-attention-center-close,
    .st-attention-popup-close,
    .st-weighing-plan-close,
    .st-purchase-partner-close,
    .st-sim-close,
    .candidate-plan-close,
    .ma-policy-close,
    .terneros-transition-v2-close,
    .dialog-close,
    .client-onboarding-close,
    .support-access-dialog-close,
    .animal-search-clear,
    .health-application-close,
    .calendar-day-picker-close,
    .users-help,
    .st-weighing-plan-remove,
    .econ-sale-doc-remove,
    .st-purchase-doc-remove,
    .health-treatment-remove,
    #cancel-new-product,
    .product-edit-component-remove,
    [data-photo-cancel]:not(.animal-photo-btn),
    [aria-label="Eliminar componente"]
  ):hover:not(:disabled):not([aria-disabled="true"]) {
    background: #f1f5f2 !important;
  }
  /* Disabled controls remain visibly unavailable; never change their disabled/hidden state. */
  /* Connection status keeps its state colors even when it has no action to perform. */
  :is(button, input[type="submit"], input[type="button"]):is(:disabled, [aria-disabled="true"]):not(.offline-status-badge) {
    --st-button-role: disabled;
    background: #edf0ed !important;
    border-color: #dce2dd !important;
    color: #7b857f !important;
  }
}
