.order-edit-dialog {
  width: min(720px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  color: #0f172a;
  background: #fff;
  box-shadow: 0 24px 70px rgb(15 23 42 / 28%);
}

.order-edit-dialog::backdrop {
  background: rgb(15 23 42 / 58%);
  backdrop-filter: blur(3px);
}

.order-edit-card {
  display: grid;
  gap: 18px;
  max-height: calc(100dvh - 24px);
  padding: 24px;
  overflow-y: auto;
}

.order-edit-header,
.order-edit-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.order-edit-header h2,
.order-edit-header p {
  margin: 0;
}

.order-edit-header p {
  margin-bottom: 4px;
  color: #0f766e;
  font-size: 14px;
  font-weight: 800;
}

.order-edit-close {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  color: #475569;
  background: #fff;
  font: inherit;
  font-size: 24px;
  cursor: pointer;
}

.order-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.order-edit-field {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  color: #334155;
  font-weight: 800;
}

.order-edit-field.wide {
  grid-column: 1 / -1;
}

.order-edit-field :where(input, select, textarea) {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  color: #0f172a;
  background: #fff;
  font: inherit;
  font-size: 16px;
}

.order-edit-field textarea {
  min-height: 92px;
  resize: vertical;
}

.order-edit-field input:disabled {
  color: #64748b;
  background: #f1f5f9;
  cursor: not-allowed;
}

.order-edit-field small,
.order-edit-schedule-help {
  color: #64748b;
  font-size: 14px;
  font-weight: 600;
}

.order-edit-schedule {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 16px;
  border: 1px solid #ccfbf1;
  border-radius: 16px;
  background: #f0fdfa;
}

.order-edit-schedule legend {
  padding-inline: 8px;
  color: #115e59;
  font-weight: 900;
}

.order-edit-schedule-help {
  grid-column: 1 / -1;
  margin: 0;
}

.order-edit-message {
  margin: 0;
  padding: 11px 13px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
}

.order-edit-message.error {
  border: 1px solid #fecaca;
  color: #991b1b;
  background: #fef2f2;
}

.order-edit-message.success {
  border: 1px solid #86efac;
  color: #166534;
  background: #f0fdf4;
}

.order-edit-actions {
  justify-content: flex-end;
}

.order-edit-primary,
.order-edit-secondary {
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 12px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.order-edit-primary {
  border: 1px solid #0f766e;
  color: #fff;
  background: #0f766e;
}

.order-edit-primary:disabled {
  opacity: .65;
  cursor: wait;
}

.order-edit-secondary {
  border: 1px solid #cbd5e1;
  color: #334155;
  background: #fff;
}

.order-edit-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-inline-start: 8px;
  border: 2px solid currentColor;
  border-inline-end-color: transparent;
  border-radius: 50%;
  vertical-align: middle;
  animation: order-edit-spin .7s linear infinite;
}

@keyframes order-edit-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 620px) {
  .order-edit-card {
    padding: 18px;
  }

  .order-edit-grid,
  .order-edit-schedule {
    grid-template-columns: 1fr;
  }

  .order-edit-field.wide,
  .order-edit-schedule-help {
    grid-column: auto;
  }

  .order-edit-actions > * {
    min-width: 0;
    flex: 1 1 0;
  }
}
