.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 41, 66, 0.48);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
  animation: modalFadeIn 0.18s ease;
}

.modal-box {
  width: 100%;
  max-width: 540px;
  max-height: 88vh;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: 0 22px 48px rgba(15, 41, 66, 0.22);
  padding: 1.3rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  animation: modalSlideUp 0.2s ease;
}

.modal-box.is-narrow {
  max-width: 420px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--navy-900);
  line-height: 1.35;
}

.icon-close-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-page);
  color: var(--navy-900);
  font-size: 0.95rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.icon-close-btn:hover {
  background: var(--bg-soft);
  color: var(--blue-600);
}

.modal-body {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-right: 2px;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border-subtle);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-body);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.55rem 0.78rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-page);
  color: var(--navy-900);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  outline: none;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.form-textarea {
  min-height: 105px;
  resize: vertical;
  line-height: 1.5;
  font-weight: 500;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--blue-600);
  background: var(--bg-white);
}

.form-feedback {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
}

.form-feedback.is-error {
  background: var(--danger-bg);
  color: var(--danger-ink);
}

.form-feedback.is-success {
  background: var(--success-bg);
  color: var(--success-ink);
}

.btn-danger {
  background: #DC2626;
  color: #FFFFFF;
}

.btn-danger:hover {
  background: #B91C1C;
}

.btn-warning {
  background: #D97706;
  color: #FFFFFF;
}

.btn-warning:hover {
  background: #B45309;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}