/* Modales système (alert / confirm) — Propoose + admin dark */

.modal-sys.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000000;
  background: rgba(38, 51, 64, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  overflow-y: auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.modal-sys.modal-overlay.open {
  display: flex;
}
.modal-sys-box {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: auto;
  background: #fff;
  color: #263340;
  border-radius: 20px;
  box-shadow: 0 32px 80px rgba(38, 51, 64, 0.22);
  animation: modalSysIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}
.modal-sys--dark .modal-sys-box {
  background: #1a2530;
  color: #e2eaf0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.45);
  --accent: #e07a5f;
}
@keyframes modalSysIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.modal-sys-head {
  padding: 22px 52px 0 24px;
  font-family: 'DM Sans', sans-serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.modal-sys--dark .modal-sys-head {
  color: #fff;
}
.modal-sys-body {
  padding: 12px 24px 22px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.55;
  color: rgba(38, 51, 64, 0.82);
  white-space: pre-wrap;
  word-break: break-word;
}
.modal-sys--dark .modal-sys-body {
  color: rgba(226, 234, 240, 0.82);
}
.modal-sys-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  padding: 0 24px 22px;
}
.modal-sys-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 11px;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
}
.modal-sys-btn:active {
  transform: scale(0.98);
}
.modal-sys-btn:focus-visible {
  outline: 2px solid var(--accent, #e07a5f);
  outline-offset: 2px;
}
.modal-sys-btn--ghost {
  background: rgba(38, 51, 64, 0.06);
  color: #263340;
}
.modal-sys--dark .modal-sys-btn--ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #e2eaf0;
}
.modal-sys-btn--ghost:hover {
  background: rgba(38, 51, 64, 0.1);
}
.modal-sys--dark .modal-sys-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.12);
}
.modal-sys-btn--primary {
  background: var(--accent, #e07a5f);
  color: #fff;
}
.modal-sys-btn--primary:hover {
  filter: brightness(1.05);
}
.modal-sys-btn--danger {
  background: #dc3545;
  color: #fff;
}
.modal-sys-btn--danger:hover {
  filter: brightness(1.06);
}
.modal-sys-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(38, 51, 64, 0.12);
  background: rgba(246, 244, 241, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.modal-sys--dark .modal-sys-close {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(226, 234, 240, 0.85);
}
.modal-sys-close:hover {
  background: var(--cream, #ebe8e3);
}
.modal-sys--dark .modal-sys-close:hover {
  background: rgba(255, 255, 255, 0.1);
}
.modal-sys-close svg {
  width: 15px;
  height: 15px;
}

@media (max-width: 520px) {
  .modal-sys.modal-overlay {
    align-items: flex-end;
    padding-bottom: 0;
    padding-left: 0;
    padding-right: 0;
  }
  .modal-sys-box {
    max-width: none;
    border-radius: 22px 22px 0 0;
    animation: modalSysSheetIn 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  }
  @keyframes modalSysSheetIn {
    from {
      transform: translateY(100%);
      opacity: 0.92;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
  .modal-sys-actions {
    flex-direction: column-reverse;
    padding-bottom: max(22px, env(safe-area-inset-bottom));
  }
  .modal-sys-btn {
    width: 100%;
    justify-content: center;
  }
}
