/* Modal styles */
.modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(20, 24, 40, 0.75) !important; /* even darker overlay */
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 2147483647 !important; /* max z-index to guarantee on top */
  transition: background 0.2s;
  animation: modal-fade-in 0.18s;
  pointer-events: all !important;
}

@keyframes modal-fade-in {
  from { background: rgba(20,24,40,0); }
  to { background: rgba(20,24,40,0.65); }
}
.modal {
  background: var(--surface, #fff);
  border-radius: var(--border-radius) !important;
  box-shadow: 0 4px 32px rgba(30,40,90,0.28);
  padding: 2em 2.5em;
  min-width: 320px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  position: relative;
  animation: modal-pop-in 0.18s cubic-bezier(.4,0,.2,1);
}

@keyframes modal-pop-in {
  from { transform: scale(0.97) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-header {
  font-size: 1.2em;
  font-weight: 600;
  margin-bottom: 1em;
  /* Color is set inline for type-based modals */
}
.modal-footer {
  text-align: right;
  margin-top: 1.5em;
}

/* Optional: add icons or color borders for modal types if desired */
.modal-header.success {
  background: var(--success-color);
  color: #fff;
}
.modal-header.warning {
  background: var(--warning-color);
  color: #fff;
}
.modal-header.error {
  background: var(--danger-color);
  color: #fff;
}
.modal-header.info {
  background: var(--primary-color);
  color: #fff;
}
