/* Shared overlay, modal and Dialog component styles. */
.overlay-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--overlay-backdrop);
}

.modal-panel {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: var(--border-line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-modal);
}

.modal-header {
  min-height: 58px;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0 22px;
  border-bottom: var(--border-line);
}

.modal-header h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 18px;
}

.modal-close {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.modal-body {
  min-height: 0;
  overflow: auto;
  padding: 22px;
}

.modal-footer {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: var(--border-line);
  background: var(--panel-soft);
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: var(--dialog-backdrop);
  backdrop-filter: blur(2px);
}

.dialog-panel {
  width: min(560px, 100%);
  max-height: min(760px, calc(100vh - 3rem));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg, 18px);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-strong);
}

.dialog-header {
  flex: 0 0 auto;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 14px 18px;
  border-bottom: var(--border-line);
  background: var(--panel);
}

.dialog-title {
  margin: 0;
  color: var(--text-strong);
  font-size: 1.05rem;
}

.dialog-close {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
}

.dialog-close:hover,
.dialog-close:focus-visible {
  background: var(--hover-tint-soft);
  color: var(--text-strong);
  outline: none;
}

.dialog-close:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 20px;
  color: var(--text);
}

.dialog-footer {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 12px 18px;
  border-top: var(--border-line);
  background: var(--panel);
}

.confirm-dialog {
  width: min(460px, calc(100vw - 40px));
}

.confirm-dialog > .dialog-header,
.confirm-dialog > .dialog-footer {
  background: var(--panel);
}

.confirm-dialog p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.admin-dialog {
  width: min(680px, calc(100vw - 40px));
}

.admin-dialog-wide {
  width: min(1040px, calc(100vw - 40px));
}

.admin-dialog > .dialog-header {
  padding: 16px 18px;
  border-bottom: var(--border-line);
  background: var(--panel);
}

.admin-dialog > .dialog-footer {
  flex: 0 0 auto;
  padding: 12px 18px;
  border-top: var(--border-line);
  background: var(--panel);
  box-shadow: var(--shadow-footer);
}
