/* ERP Button Runtime: single button language */
body.app-shell:not(.app-shell--default) .erp-btn {
  --erp-btn-height: 34px;
  --erp-btn-pad-x: 12px;
  --erp-btn-radius: 6px;
  --erp-btn-font-size: 0.82rem;
  --erp-btn-border: var(--erp-line);
  --erp-btn-bg: var(--erp-surface);
  --erp-btn-fg: var(--erp-text);
  --erp-btn-hover-bg: #f1f5f9;
  --erp-btn-hover-border: #b8cff8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--erp-btn-height);
  padding: 0 var(--erp-btn-pad-x);
  border: 1px solid var(--erp-btn-border);
  border-radius: var(--erp-btn-radius);
  background: var(--erp-btn-bg);
  color: var(--erp-btn-fg);
  font-size: var(--erp-btn-font-size);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  box-shadow: none;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}

body.app-shell:not(.app-shell--default) .btn {
  min-height: 34px;
  border-radius: 10px !important;
  font-weight: 600;
  letter-spacing: 0.01em;
}

body.app-shell:not(.app-shell--default) .erp-btn:hover,
body.app-shell:not(.app-shell--default) .erp-btn:focus {
  background: var(--erp-btn-hover-bg);
  border-color: var(--erp-btn-hover-border);
  color: var(--erp-btn-fg);
  text-decoration: none;
}

body.app-shell:not(.app-shell--default) .erp-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--erp-primary) 70%, #ffffff 30%);
  outline-offset: 1px;
}

body.app-shell:not(.app-shell--default) .erp-btn__icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.92;
}

body.app-shell:not(.app-shell--default) .erp-btn__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.app-shell:not(.app-shell--default) .erp-btn--sm {
  --erp-btn-height: 30px;
  --erp-btn-pad-x: 10px;
  --erp-btn-font-size: 0.77rem;
}

body.app-shell:not(.app-shell--default) .btn-sm {
  min-height: 30px;
  padding-top: 0.28rem;
  padding-bottom: 0.28rem;
}

body.app-shell:not(.app-shell--default) .erp-btn--md {
  --erp-btn-height: 34px;
}

body.app-shell:not(.app-shell--default) .erp-btn--lg {
  --erp-btn-height: 38px;
  --erp-btn-pad-x: 14px;
  --erp-btn-font-size: 0.88rem;
}

body.app-shell:not(.app-shell--default) .erp-btn--primary {
  --erp-btn-bg: var(--erp-primary);
  --erp-btn-border: var(--erp-primary);
  --erp-btn-fg: #ffffff;
  --erp-btn-hover-bg: var(--erp-primary-hover);
  --erp-btn-hover-border: var(--erp-primary-hover);
}

body.app-shell:not(.app-shell--default) .erp-btn--secondary {
  --erp-btn-bg: var(--erp-surface);
  --erp-btn-border: var(--erp-line);
  --erp-btn-fg: #334155;
}

body.app-shell:not(.app-shell--default) .erp-btn--danger {
  --erp-btn-bg: #b42318;
  --erp-btn-border: #b42318;
  --erp-btn-fg: #ffffff;
  --erp-btn-hover-bg: #941d13;
  --erp-btn-hover-border: #941d13;
}

body.app-shell:not(.app-shell--default) .erp-btn--success {
  --erp-btn-bg: var(--erp-success);
  --erp-btn-border: var(--erp-success);
  --erp-btn-fg: #ffffff;
  --erp-btn-hover-bg: #15803d;
  --erp-btn-hover-border: #15803d;
}

body.app-shell:not(.app-shell--default) .erp-btn--ghost {
  --erp-btn-bg: transparent;
  --erp-btn-border: transparent;
  --erp-btn-fg: #334155;
  --erp-btn-hover-bg: rgba(15, 23, 42, 0.06);
  --erp-btn-hover-border: transparent;
}
/* Toolbar and grid-action separation */
body.app-shell:not(.app-shell--default) .erp-btn--toolbar {
  --erp-btn-height: var(--shell-grid-toolbar-button-min-height, 32px);
  --erp-btn-pad-x: 10px;
  --erp-btn-font-size: var(--shell-grid-toolbar-button-font-size, 0.78rem);
  --erp-btn-radius: var(--erp-radius-sm);
}

body.app-shell:not(.app-shell--default) .erp-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
/* Standard loading/disabled/busy states */
body.app-shell:not(.app-shell--default) .erp-btn.is-disabled,
body.app-shell:not(.app-shell--default) .erp-btn[disabled],
body.app-shell:not(.app-shell--default) .erp-btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

body.app-shell:not(.app-shell--default) .erp-btn.is-loading,
body.app-shell:not(.app-shell--default) .erp-btn.is-busy {
  pointer-events: none;
}

body.app-shell:not(.app-shell--default) .erp-btn__spinner {
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  opacity: 0.75;
  animation: erp-btn-spin .7s linear infinite;
}

@keyframes erp-btn-spin {
  to {
    transform: rotate(360deg);
  }
}

body.app-shell:not(.app-shell--default) .erp-modal-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  position: relative;
}

body.app-shell:not(.app-shell--default) .erp-modal-close::before,
body.app-shell:not(.app-shell--default) .erp-modal-close::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 6px;
  width: 2px;
  height: 16px;
  background: currentColor;
}

body.app-shell:not(.app-shell--default) .erp-modal-close::before { transform: rotate(45deg); }
body.app-shell:not(.app-shell--default) .erp-modal-close::after { transform: rotate(-45deg); }

body.app-shell:not(.app-shell--default) .erp-modal-close:hover {
  background: rgba(15, 23, 42, 0.06);
  color: #334155;
}
