.erp-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  background: rgba(15, 23, 42, .48);
  backdrop-filter: blur(1px);
}

.erp-dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  color: #172033;
  background: #fff;
  border: 1px solid #b8c6d8;
  border-radius: 12px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, .28);
}

.erp-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 12px 0 18px;
  color: #fff;
  background: #16627b;
  cursor: move;
  touch-action: none;
  user-select: none;
}
.erp-dialog--success .erp-dialog__header { background: #18794e; }
.erp-dialog--warning .erp-dialog__header { background: #9a6700; }
.erp-dialog--error .erp-dialog__header,
.erp-dialog__button--danger { background: #b42318; }
.erp-dialog__title { margin: 0; font-size: 17px; line-height: 1.3; }
.erp-dialog__close { border: 0; padding: 2px 8px; color: inherit; background: transparent; font: 28px/1 sans-serif; cursor: pointer; }
.erp-dialog__body { min-height: 80px; max-height: min(62vh, 520px); padding: 20px; overflow: auto; overscroll-behavior: contain; }
.erp-dialog__message { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.erp-dialog__input { box-sizing: border-box; width: 100%; margin-top: 14px; padding: 10px 12px; border: 1px solid #9aabc0; border-radius: 7px; font: inherit; resize: vertical; }
.erp-dialog__input[aria-invalid="true"] { border-color: #b42318; box-shadow: 0 0 0 2px rgba(180, 35, 24, .15); }
.erp-dialog__details { margin-top: 14px; }
.erp-dialog__details pre { max-height: 180px; overflow: auto; white-space: pre-wrap; }
.erp-dialog__footer { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 18px; border-top: 1px solid #d7dee8; background: #f7f9fc; }
.erp-dialog__button { min-width: 84px; min-height: 38px; padding: 8px 16px; border: 1px solid transparent; border-radius: 7px; font: inherit; font-weight: 650; cursor: pointer; }
.erp-dialog__button:disabled { opacity: .55; cursor: default; }
.erp-dialog__button--secondary { color: #233044; border-color: #aab7c7; background: #fff; }
.erp-dialog__button--primary { color: #fff; background: #147d9a; }
.erp-dialog--dragging { box-shadow: 0 28px 70px rgba(15, 23, 42, .36); }
.erp-enhanced-native-dialog { max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); overflow: auto; }
.erp-native-dialog__handle { cursor: move; touch-action: none; user-select: none; }

@media (max-width: 560px) {
  .erp-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .erp-dialog__body { padding: 16px; }
  .erp-dialog__footer { padding: 10px 12px; }
}

@media (prefers-reduced-motion: no-preference) {
  .erp-dialog { animation: erp-dialog-enter .12s ease-out; }
  @keyframes erp-dialog-enter { from { opacity: 0; } to { opacity: 1; } }
}
