/* Shared admin overlay modal. Do not use Bootstrap .modal for new dialogs. */
.netsa-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow: auto;
  background: rgba(15, 35, 28, .48);
  text-align: left;
  scroll-behavior: smooth;
}
.netsa-modal[hidden] { display: none !important; }
.netsa-modal__shell {
  width: min(720px, 100%);
  margin: 0 auto;
  flex: 0 0 auto;
}
.netsa-modal__shell--wide { width: min(980px, 100%); }
.netsa-modal__shell--rich { width: min(1080px, 100%); }
.netsa-modal__panel {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(15, 35, 28, .28);
}
.netsa-modal__header,
.netsa-modal__footer {
  overflow: hidden;
}
.netsa-modal__header,
.modal-header,
.custom-modal .modal-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: #0F4D3C;
  color: #fff;
  border: 0;
  border-radius: 0;
}
.netsa-modal__header {
  border-radius: 10px 10px 0 0;
}
.netsa-modal__title,
.netsa-modal__header .modal-title,
.modal-header .modal-title,
.modal-header h4,
.modal-header h5 {
  margin: 0;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}
.netsa-modal__close,
.netsa-modal__header .close,
.modal-header .close,
.custom-modal .close {
  margin: 0;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: #fff;
  opacity: .92;
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
  text-shadow: none;
  cursor: pointer;
}
.netsa-modal__close:hover,
.modal-header .close:hover { color: #fff; opacity: 1; }
.netsa-modal__body,
#customerFormModal .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 16px 18px;
  background: #f6f8f7;
  scroll-behavior: smooth;
}
.netsa-modal__footer,
#customerFormModal .modal-footer {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  background: #fff;
  border-top: 1px solid #e5eeea;
  border-radius: 0 0 10px 10px;
}
.netsa-modal__rich { overflow-x: auto; }
.netsa-modal__rich table,
.modal-body table {
  width: max-content;
  min-width: 100%;
  max-width: none;
  border-collapse: collapse;
}
.netsa-modal__rich img,
.modal-body img { max-width: 100%; height: auto; }
.netsa-modal__meta {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0 0 16px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #e5eeea;
  border-radius: 8px;
  font-size: 13px;
}
.netsa-modal__meta dt { margin: 0; color: #6b7280; }
.netsa-modal__meta dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
body.netsa-modal-open,
body.customer-form-open { overflow: hidden; }

.netsa-modal__body,
.modal-body,
.netsa-modal {
  scrollbar-width: thin;
  scrollbar-color: #167a5c #e7f3ee;
}
.netsa-modal__body::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.netsa-modal::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.netsa-modal__body::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track,
.netsa-modal::-webkit-scrollbar-track {
  background: #e7f3ee;
  border-radius: 999px;
}
.netsa-modal__body::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.netsa-modal::-webkit-scrollbar-thumb {
  background: #167a5c;
  border-radius: 999px;
}
.netsa-modal__body::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover,
.netsa-modal::-webkit-scrollbar-thumb:hover {
  background: #0F4D3C;
}

/* Keep leftover Bootstrap dialogs inside the viewport and on-brand. */
.modal-content,
.custom-modal .modal-content {
  top: 0;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  box-shadow: 0 18px 48px rgba(15, 35, 28, .28);
}
.modal-body {
  max-height: calc(100vh - 190px);
  overflow: auto;
}
.modal-dialog {
  width: calc(100% - 32px);
  max-width: 720px;
  margin: 24px auto;
}
.modal-dialog.modal-sm { max-width: 360px; }
.modal-dialog.modal-lg { max-width: 980px; }
.modal-dialog.modal-xl,
.modal-dialog.modal-full,
#rv_media_modal .modal-dialog,
.media-modal > .modal-dialog {
  max-width: calc(100% - 32px);
}
