.crm-container .btn,
#bootstrap-theme .btn,
.crm-container button,
.crm-container .crm-button,
.crm-container [type="button"],
.crm-container [type="reset"],
.crm-container [type="submit"],
.crm-container .nav.nav-pills li.navitem a {
  white-space: nowrap;
  touch-action: manipulation;
  cursor: var(--crm-hover-clickable);
  background-image: none;
  border: var(--crm-btn-border);
  padding: var(--crm-btn-padding-block) var(--crm-btn-padding-inline);
  font-size: var(--crm-font-size);
  border-radius: var(--crm-btn-radius);
  user-select: none;
  margin: var(--crm-btn-margin);
  background: var(--crm-c-primary);
  color: var(--crm-c-primary-text);
  text-transform: var(--crm-btn-txt-transform);
  height: var(--crm-btn-height);
  display: inline-flex;
  max-width: fit-content;
  align-items: center;
  gap: var(--crm-btn-icon-spacing);
  width: auto;
  box-shadow: none;
  text-decoration: none;
}
.crm-container .btn:hover,
.crm-container .btn:focus,
#bootstrap-theme .btn:hover,
#bootstrap-theme .btn:focus,
.crm-container .crm-button:hover,
.crm-container .crm-button:focus,
[type="button"]:hover,
[type="reset"]:hover,
[type="submit"]:hover,
[type="button"]:focus,
[type="reset"]:focus,
[type="submit"]:focus {
  background: var(--crm-c-primary-hover);
  color: var(--crm-c-primary-hover-text);
  text-decoration: none;
}
.crm-container .nav.nav-pills li.navitem:not(.active) a {
  background-color: transparent;
  border-color: transparent;
  color: var(--crm-c-link);
}
.crm-container .nav.nav-pills li.navitem:not(.active) a:hover,
.crm-container .nav.nav-pills li.navitem:not(.active) a:focus {
  background-color: transparent;
  color: var(--crm-c-link-hover);
}
.crm-button:focus,
.crm-container .btn:focus,
#bootstrap-theme .btn:focus {
  outline: 5px auto -webkit-focus-ring-color;
  outline-offset: -2px;
}
.crm-button:active,
.crm-container .btn:active,
.crm-container .btn.active,
#bootstrap-theme .btn:active,
#bootstrap-theme .btn.active {
  box-shadow: inset 0 0 100px 100px rgba(255, 255, 255, 0.3);
}
.crm-button[disabled],
.crm-button.disabled,
.crm-container .btn.disabled,
.crm-container .btn[disabled],
#bootstrap-theme .btn.disabled,
#bootstrap-theme .btn[disabled],
#bootstrap-theme fieldset[disabled] .btn,
.crm-container button.disabled {
  cursor: not-allowed;
  filter: alpha(opacity=65);
  opacity: .65;
  pointer-events: none;
  box-shadow: none;
}
.crm-container button.disabled * {
  color: var(--crm-c-primary-text);
}
.crm-container .crm-button-type-cancel,
.crm-form-submit .cancel.crm-button,
.crm-container button.ui-button:has(.fa-times),
#bootstrap-theme button.btn-secondary-outline {
  background: var(--crm-c-secondary);
  color: var(--crm-c-secondary-text);
}
.crm-container a.button.delete-button,
.crm-container a.button.delete-button:link,
.crm-container a.button.delete,
.crm-container a.button.delete:link {
  background: var(--crm-btn-cancel-bg);
  color: var(--crm-btn-cancel-text);
}
.crm-container a.button.delete-button:hover,
.crm-container a.button.delete-button:focus,
.crm-container a.button.delete:hover {
  background: linear-gradient(to top,rgba(0, 0, 0, 0.125),rgba(0, 0, 0, 0.125)) var(--crm-btn-cancel-bg);
}
.crm-container .crm-button-type-cancel:hover,
.crm-container .crm-button-type-cancel:focus,
.crm-container button.ui-button:has(.fa-times):hover,
.crm-container button.ui-button:has(.fa-times):focus,
#bootstrap-theme button.btn-secondary-outline:hover,
#bootstrap-theme button.btn-secondary-outline:focus {
  background: var(--crm-c-secondary-hover);
  color: var(--crm-c-secondary-hover-text);
}

/* BS3 colour options */

#bootstrap-theme .btn-secondary {
  background: var(--crm-c-secondary);
  color: var(--crm-c-secondary-text);
}
#bootstrap-theme .btn.btn-secondary:hover,
#bootstrap-theme .btn.btn-secondary:focus {
  background: linear-gradient(to top,rgba(0, 0, 0, 0.125),rgba(0, 0, 0, 0.125)) var(--crm-c-secondary); /* darkening fallback if hover state not set */
  background: var(--crm-c-secondary-hover);
  color: var(--crm-c-secondary-text);
}
#bootstrap-theme .btn-info {
  background: var(--crm-btn-info-bg);
  color: var(--crm-btn-info-text);
}
#bootstrap-theme .btn.btn-info:hover,
#bootstrap-theme .btn.btn-info:focus {
  background: linear-gradient(to top,rgba(0, 0, 0, 0.125),rgba(0, 0, 0, 0.125)) var(--crm-btn-info-bg);
  color: var(--crm-btn-info-text);
}
#bootstrap-theme .btn-warning {
  background: var(--crm-btn-warning-bg);
  color: var(--crm-btn-warning-text);
}
#bootstrap-theme .btn.btn-warning:hover,
#bootstrap-theme .btn.btn-warning:focus {
  background: linear-gradient(to top,rgba(0, 0, 0, 0.125),rgba(0, 0, 0, 0.125)) var(--crm-btn-warning-bg);
  color: var(--crm-btn-warning-text);
}
#bootstrap-theme .btn-success {
  background: var(--crm-btn-success-bg);
  color: var(--crm-btn-success-text);
}
#bootstrap-theme .btn.btn-success:hover,
#bootstrap-theme .btn.btn-success:focus {
  background: linear-gradient(to top,rgba(0, 0, 0, 0.125),rgba(0, 0, 0, 0.125)) var(--crm-btn-success-bg);
  color: var(--crm-btn-success-text);
}
#bootstrap-theme .btn-danger {
  background: var(--crm-btn-danger-bg);
  color: var(--crm-btn-danger-text);
}
#bootstrap-theme .btn.btn-danger:hover,
#bootstrap-theme .btn.btn-danger:focus {
  background: linear-gradient(to top,rgba(0, 0, 0, 0.125),rgba(0, 0, 0, 0.125)) var(--crm-btn-danger-bg);
  color: var(--crm-btn-danger-text);
}

/* BS3 size options */

#bootstrap-theme .btn-lg,
#bootstrap-theme .btn-group-lg > .btn {
  padding: var(--crm-m3) var(--crm-r);
  font-size: var(--crm-r1);
  line-height: 1.3;
  border-radius: calc(var(--crm-btn-radius) * 2);
}
#bootstrap-theme.btn-sm,
#bootstrap-theme .btn-group-sm > .btn {
  padding: var(--crm-s2) var(--crm-m1);
  font-size: var(--crm-m2);
  line-height: 1.5;
  border-radius: var(--crm-btn-radius);
  height: auto;
}
#bootstrap-theme .btn-xs,
#bootstrap-theme .btn-group-xs > .btn {
  padding: var(--crm-xs) var(--crm-s2);
  font-size: var(--crm-m2);
  border-radius: var(--crm-btn-radius);
  height: auto;
}
#bootstrap-theme .btn-block {
  display: block;
  width: 100%;
  max-width: 100%;
}
#bootstrap-theme .btn-block + .btn-block {
  margin-top: 5px;
}
#bootstrap-theme input[type="submit"].btn-block,
#bootstrap-theme input[type="reset"].btn-block,
#bootstrap-theme input[type="button"].btn-block {
  width: 100%;
}
.crm-submit-buttons {
  padding: var(--crm-s);
  display: inline-flex;
  align-items: center;
  gap: var(--crm-flex-gap);
}

/* Hover buttons (plain text, button shows on hover) */
.crm-container a.crm-hover-button {
  border-radius: var(--crm-btn-radius);
  color: var(--crm-c-link);
  cursor: var(--crm-hover-clickable);
  padding: var(--crm-btn-padding-block) var(--crm-btn-padding-inline);
  background-color: var(--crm-c-primary);
  color: var(--crm-c-primary-text);
}
.crm-container a.crm-hover-button.action-item,
.crm-container .crm-hover-button.btn-slide,
.crm-container .crm-submit-buttons .crm-hover-button {
  background-color: transparent;
  color: var(--crm-c-text);
  padding: var(--crm-btn-small-padding);
  margin: 0;
  cursor: var(--crm-hover-clickable);
  border-radius: var(--crm-btn-radius);
  display: inline;
  line-height: 1.5;
  white-space: nowrap;
}
.crm-container td a.crm-hover-button + .crm-hover-button:not(:last-of-type) {
  margin-inline: var(--crm-m);
}
.crm-container td:has(.btn-slide) a.crm-hover-button + .crm-hover-button {
  margin-inline: var(--crm-m);
}
.crm-container .crm-submit-buttons .crm-hover-button {
  padding: var(--crm-btn-padding-block) var(--crm-btn-padding-inline);
}
.crm-container .crm-hover-button.crm-clear-link,
.crm-container .crm-hover-button.crm-close-accordion {
  color: var(--crm-c-link);
  padding: 0;
  background: unset;
}
.crm-container .crm-hover-button:hover,
.crm-container a.crm-hover-button:hover,
.crm-container a.crm-hover-button:focus,
.crm-container a.crm-hover-button:active,
.crm-container .crm-submit-buttons .crm-hover-button:hover,
.crm-container .crm-submit-buttons .crm-hover-button:focus {
  background: var(--crm-c-secondary-hover);
  color: var(--crm-c-secondary-text);
  text-decoration: none;
}

/* Action links */

.crm-container .ui-widget-content .action-link .button {
  box-shadow: var(--crm-block-shadow) !important;
  margin: var(--crm-m) 0;
}

/* Modal buttons */

.crm-container.ui-dialog .ui-dialog-buttonset button {
  background: var(--crm-c-primary);
  color: var(--crm-c-primary-text);
}
.crm-container.ui-dialog .ui-dialog-buttonset button:hover,
.crm-container.ui-dialog .ui-dialog-buttonset button:focus {
  background: var(--crm-c-primary-hover);
}

/* BS3 button dropdowns */

#bootstrap-theme .btn-primary.dropdown-toggle {
  background: var(--crm-c-primary);
  color: var(--crm-c-primary-text);
}
#bootstrap-theme .btn-primary.dropdown-toggle:hover,
#bootstrap-theme .btn-primary.dropdown-toggle:focus {
  background: var(--crm-c-primary-hover);
}
#bootstrap-theme .btn-secondary.dropdown-toggle {
  background: var(--crm-c-secondary);
  color: var(--crm-c-secondary-text);
}
#bootstrap-theme .btn-secondary.dropdown-toggle:hover,
#bootstrap-theme .btn-secondary.dropdown-toggle:focus {
  background: var(--crm-c-secondary-hover);
}
.crm-container .crm-search-display button.dropdown-toggle:not(.btn-default):not(.btn-secondary),
#bootstrap-theme .crm-search-display th .btn-group .btn {
  background-color: var(--crm-c-background4);
  color: var(--crm-c-text);
}

/* BS3 Button groups and dropdowns  */

#bootstrap-theme td.text-right:has(.btn + .btn),
.crm-container .crm-buttons {
  display: flex;
  gap: var(--crm-s);
  flex-wrap: wrap;
}
#bootstrap-theme td.text-right:has(.btn + .btn) {
  justify-content: end;
}
.crm-container a.button + a.button {
  margin-left: var(--crm-flex-gap);
}
.crm-actions-ribbon #actions {
  padding: 0;
  margin: 0 0 var(--crm-padding-reg);
  display: flex;
  gap: var(--crm-flex-gap);
  align-items: center;
}
#bootstrap-theme .btn-group,
#bootstrap-theme .btn-group-vertical {
  position: relative;
  display: inline-block;
  vertical-align: middle;
}
#bootstrap-theme > .btn-group.pull-right {
  margin-block: var(--crm-padding-reg);
  margin-left: var(--crm-flex-gap);
}
#bootstrap-theme .btn-group > .btn,
#bootstrap-theme .btn-group-vertical > .btn {
  position: relative;
  float: left;
}
#bootstrap-theme .btn-group > .btn:hover,
#bootstrap-theme .btn-group > .btn:focus,
#bootstrap-theme .btn-group > .btn:active,
#bootstrap-theme .btn-group > .btn.active,
#bootstrap-theme .btn-group-vertical > .btn:hover,
#bootstrap-theme .btn-group-vertical > .btn:focus,
#bootstrap-theme .btn-group-vertical > .btn:active,
#bootstrap-theme .btn-group-vertical > .btn.active {
  z-index: 2;
}
#bootstrap-theme .btn-group .btn + .btn,
#bootstrap-theme .btn-group .btn + .btn-group,
#bootstrap-theme .btn-group .btn-group + .btn,
#bootstrap-theme .btn-group .btn-group + .btn-group {
  margin-left: -1px;
}
#bootstrap-theme .btn-toolbar {
  margin-left: -5px;
}
#bootstrap-theme .btn-toolbar:before,
#bootstrap-theme .btn-toolbar:after {
  display: table;
  content: " ";
}
#bootstrap-theme .btn-toolbar:after {
  clear: both;
}
#bootstrap-theme .btn-toolbar .btn,
#bootstrap-theme .btn-toolbar .btn-group,
#bootstrap-theme .btn-toolbar .input-group {
  float: left;
}
#bootstrap-theme .btn-toolbar > .btn,
#bootstrap-theme .btn-toolbar > .btn-group,
#bootstrap-theme .btn-toolbar > .input-group {
  margin-left: 5px;
}
#bootstrap-theme .btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
  border-radius: 0;
}
#bootstrap-theme .btn-group > .btn:first-child {
  margin-left: 0;
}
#bootstrap-theme .btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
#bootstrap-theme .btn-group > .btn:last-child:not(:first-child),
#bootstrap-theme .btn-group > .dropdown-toggle:not(:first-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
#bootstrap-theme .btn-group > .btn-group {
  float: left;
}
#bootstrap-theme .btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {
  border-radius: 0;
}
#bootstrap-theme .btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child,
#bootstrap-theme .btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
#bootstrap-theme .btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
#bootstrap-theme .btn-group .dropdown-toggle:active,
#bootstrap-theme .btn-group.open .dropdown-toggle {
  outline: 0;
}
#bootstrap-theme .btn-group > .btn + .dropdown-toggle {
  padding-right: 8px;
  padding-left: 8px;
}
#bootstrap-theme .btn-group > .btn-lg + .dropdown-toggle,
#bootstrap-theme .btn-group-lg.btn-group > .btn + .dropdown-toggle,
#bootstrap-theme .btn-group-lg > .btn-group > .btn + .dropdown-toggle {
  padding-right: 12px;
  padding-left: 12px;
}
#bootstrap-theme .btn-group.open .dropdown-toggle {
  box-shadow: var(--crm-popup-shadow);
}
#bootstrap-theme .btn-group.open .dropdown-toggle.btn-link {
  box-shadow: none;
}
#bootstrap-theme .btn-lg .caret,
#bootstrap-theme .btn-group-lg > .btn .caret {
  border-width: 5px 5px 0;
  border-bottom-width: 0;
}
#bootstrap-theme .dropup .btn-lg .caret,
#bootstrap-theme .dropup .btn-group-lg > .btn .caret {
  border-width: 0 5px 5px;
}
#bootstrap-theme .btn-group-vertical > .btn,
#bootstrap-theme .btn-group-vertical > .btn-group,
#bootstrap-theme .btn-group-vertical > .btn-group > .btn {
  display: block;
  float: none;
  width: 100%;
  max-width: 100%;
}
#bootstrap-theme .btn-group-vertical > .btn-group:before,
#bootstrap-theme .btn-group-vertical > .btn-group:after {
  display: table;
  content: " ";
}
#bootstrap-theme .btn-group-vertical > .btn-group:after {
  clear: both;
}
#bootstrap-theme .btn-group-vertical > .btn-group > .btn {
  float: none;
}
#bootstrap-theme .btn-group-vertical > .btn + .btn,
#bootstrap-theme .btn-group-vertical > .btn + .btn-group,
#bootstrap-theme .btn-group-vertical > .btn-group + .btn,
#bootstrap-theme .btn-group-vertical > .btn-group + .btn-group {
  margin-top: -1px;
  margin-left: 0;
}
#bootstrap-theme .btn-group-vertical > .btn:not(:first-child):not(:last-child) {
  border-radius: 0;
}
#bootstrap-theme .btn-group-vertical > .btn:first-child:not(:last-child) {
  border-top-left-radius: var(--crm-btn-radius);
  border-top-right-radius: var(--crm-btn-radius);
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}
#bootstrap-theme .btn-group-vertical > .btn:last-child:not(:first-child) {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: var(--crm-btn-radius);
  border-bottom-left-radius: var(--crm-btn-radius);
}
#bootstrap-theme .btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {
  border-radius: 0;
}
#bootstrap-theme .btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child,
#bootstrap-theme .btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle {
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}
#bootstrap-theme .btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
#bootstrap-theme .btn-group-justified {
  display: table;
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
}
#bootstrap-theme .btn-group-justified > .btn,
#bootstrap-theme .btn-group-justified > .btn-group {
  display: table-cell;
  float: none;
  width: 1%;
}
#bootstrap-theme .btn-group-justified > .btn-group .btn {
  width: 100%;
}
#bootstrap-theme .btn-group-justified > .btn-group .dropdown-menu {
  left: auto;
}
#bootstrap-theme .btn-group .btn + .btn.dropdown-toggle {
  border-left: 1px solid var(--crm-c-page-background);
}

/* Icons (for ease, include .button & .ui-button icons) */

.crm-container .crm-button i.crm-i,
.crm-container a.button i.crm-i,
.crm-container button i.crm-i,
.crm-container a.button:visited i.crm-i,
.crm-container input.form-submit i.crm-i,
.crm-container input[type="button"] i.crm-i,
.crm-container input[type="submit"] i.crm-i,
.crm-container input.form-submit-inline i.crm-i,
.crm-container .ui-dialog-buttonset .ui-button .ui-icon,
.crm-container .btn i.crm-i,
#bootstrap-theme .btn i.crm-i {
  background-color: var(--crm-btn-icon-bg);
  border-radius: var(--crm-btn-radius) 0 0 var(--crm-btn-radius);
  border-right: var(--crm-btn-icon-border);
  line-height: inherit;
  opacity: 1;
  text-shadow: none;
  padding: var(--crm-btn-padding-block) var(--crm-btn-icon-spacing) var(--crm-btn-padding-block) var(--crm-btn-padding-inline);
  height: 100%;
  min-width: var(--crm-btn-height);
  display: flex;
  align-items: center;
  justify-content: center;
}
.crm-container a.button i.crm-i,
.crm-container .crm-button:not(.btn) i.crm-i {
  display: flex;
  align-items: center;
}
#bootstrap-theme .btn:has(i.crm-i),
#bootstrap-theme .btn-group > .btn + .dropdown-toggle:has(i.crm-i),
.crm-container button.ui-button:has(.ui-button-icon) {
  padding: var(--crm-btn-icon-padding) var(--crm-btn-padding-inline) var(--crm-btn-icon-padding) 0;
}
.crm-container a.button:has(i.crm-i),
.crm-container button:has(i.crm-i),
.crm-button:has(i.crm-i),
.crm-button > input[type="button"]:has(i.crm-i),
.crm-button > input[type="submit"]:has(i.crm-i),
.form-inline .btn-success.pull-right:has(i.crm-i) /* Api4exp */ {
  padding: var(--crm-btn-icon-padding) var(--crm-btn-padding-inline) var(--crm-btn-icon-padding) 0;
  width: fit-content;
  justify-content: center;
  align-items: center;
}
.crm-button > input[type="button"]:has(i.crm-i),
.crm-button > input[type="submit"]:has(i.crm-i) {
  padding: var(--crm-btn-icon-padding) 0;
}
#bootstrap-theme .form-inline .btn-group button:has(i.crm-i),
.crm-search-admin-main-tabs li .btn.btn-secondary.dropdown-toggle,
#bootstrap-theme .form-inline .btn-group button i.crm-i,
.form-inline .btn-success.pull-right i.crm-i,
.crm-search-admin-main-tabs li .btn.btn-secondary.dropdown-toggle i.crm-i {
  display: flex;
  justify-content: center;
  align-items: center;
}
.crm-container .ui-button-icon-space {
  display: none;
}
#bootstrap-theme .btn-group-xs button .caret,
#bootstrap-theme .btn-group button.btn-xs .caret {
  margin: 0 8px 0 0;
}
/* #bootstrap-theme .btn-group-xs button:has(.crm-i) .caret,
#bootstrap-theme .btn-group button.btn-xs:has(.crm-i) .caret {
  margin: 0;
} */
.crm-container .button span i.crm-i {
  margin-right: var(--crm-btn-icon-spacing);
}

/* Small buttons with icons */
#bootstrap-theme .btn-sm:has(i.crm-i),
#bootstrap-theme .btn-group-sm > .btn:has(i.crm-i) {
  padding: 0 var(--crm-m1) 0 0;
}
#bootstrap-theme .btn-sm i.crm-i,
#bootstrap-theme .btn-group-sm > .btn i.crm-i {
  min-width: fit-content;
  height: auto;
  padding: var(--crm-s2) var(--crm-btn-icon-spacing) var(--crm-s2) var(--crm-m1);
}
#bootstrap-theme .btn-group-xs button:has(i.crm-i) {
  padding: 0 var(--crm-s2) 0 0;
}
#bootstrap-theme .btn-xs:has(i.crm-i),
#bootstrap-theme .btn-group > .btn-xs + .dropdown-toggle:has(i.crm-i),
#bootstrap-theme .btn-group-xs > .btn + .dropdown-toggle:has(i.crm-i),
.crm-container button.dropdown-toggle.btn-xs:has(i.crm-i) {
  padding: var(--crm-btn-icon-padding) var(--crm-m) var(--crm-btn-icon-padding) 0
}
#bootstrap-theme .btn-xs i.crm-i,
#bootstrap-theme .btn-group-xs > .btn i.crm-i {
  width: auto;
  padding: var(--crm-btn-small-padding);
  min-width: 1rem;
  height: 1.5rem;
}
