﻿#modal-root:empty { display: none; }
#modal-root:not(:empty) {
  position: fixed;
  inset: 0;
  z-index: 1000;
}
.modal-open { overflow: hidden; }
.modal-backdrop {
  min-height: 100%;
  display: grid;
  place-items: start center;
  overflow: auto;
  padding: 6vh 22px;
  background: rgba(16, 26, 43, .62);
}
.modal-panel {
  width: min(820px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(16, 26, 43, .28);
  padding: 22px;
}
.modal-panel > .section-heading {
  flex: 0 0 auto;
}
.modal-form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}
.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}
.modal-panel .errors,
.modal-panel .message,
.modal-panel .error-summary {
  max-width: 100%;
}
.modal-panel a {
  overflow-wrap: anywhere;
}
.modal-panel:focus { outline: 3px solid rgba(31, 102, 209, .34); outline-offset: 3px; }
.modal-panel [data-modal-close] { flex: 0 0 auto; }
.compact-form-modal {
  width: min(1120px, 100%);
}
.compact-form-modal .form-section {
  margin-bottom: 12px;
  padding: 12px;
}
.compact-form-modal .textarea {
  min-height: 3.5rem;
}
.modal-action-footer {
  background: linear-gradient(180deg, rgba(255,255,255,.72), var(--panel) 28%);
  border-top: 1px solid var(--line);
  flex: 0 0 auto;
  margin: 0 -22px -22px;
  padding: 12px 22px;
  position: relative;
  z-index: 2;
}
.service-record-form-modal .form-section {
  gap: 10px;
  padding: 10px;
}
.service-record-form-modal .form-section h2 {
  font-size: 1.05rem;
}
.customer-form-modal .form-section {
  margin-bottom: 10px;
  padding: 10px;
}
