/* Footer de modales: Salir junto a Guardar, texto siempre visible */

html body .modal .modal-footer {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 0.5rem !important;
  background: #fff !important;
  border-top: 1px solid #e2e8f0 !important;
  padding: 0.75rem 1rem !important;
}

html body .modal .modal-footer .pull-left,
html body .modal .modal-footer .float-left,
html body .modal .modal-footer .float-start,
html body .modal .modal-footer .ms-btn-salir {
  float: none !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
}

html body .modal .modal-footer .btn,
html body .modal .modal-footer button.btn,
html body .modal .modal-footer a.btn,
html body .modal .ms-estado-popup-cancel {
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
  padding: 0 16px !important;
  font-size: 13px !important;
  font-weight: 650 !important;
  line-height: 1.2 !important;
  border-radius: 10px !important;
  border: 0 !important;
  box-shadow: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.35rem !important;
  box-sizing: border-box !important;
  float: none !important;
  min-width: 110px !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/*
 * Salir / Cancelar / Cerrar — rojo + texto blanco
 */
html body .modal .modal-footer .btn-default,
html body .modal .modal-footer .btn-secondary,
html body .modal .modal-footer .ms-btn-salir,
html body .modal .modal-footer button.btn-default,
html body .modal .modal-footer button.btn-secondary,
html body .modal button.ms-btn-salir,
html body .modal button.btn-default[data-dismiss="modal"],
html body .modal button.btn-default[data-bs-dismiss="modal"],
html body .modal button.btn-secondary[data-dismiss="modal"],
html body .modal button.btn-secondary[data-bs-dismiss="modal"],
html body .modal button.btn-app[data-dismiss="modal"],
html body .modal button.btn-app[data-bs-dismiss="modal"],
html body .modal .ms-estado-popup-cancel,
html body .swal2-container button.swal2-cancel {
  background: #dc2626 !important;
  background-color: #dc2626 !important;
  background-image: none !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  text-shadow: none !important;
}

html body .modal .modal-footer .btn-default:hover,
html body .modal .modal-footer .btn-secondary:hover,
html body .modal .modal-footer .ms-btn-salir:hover,
html body .modal button.btn-default[data-dismiss="modal"]:hover,
html body .modal button.btn-default[data-bs-dismiss="modal"]:hover,
html body .modal .ms-estado-popup-cancel:hover,
html body .swal2-container button.swal2-cancel:hover {
  background: #b91c1c !important;
  background-color: #b91c1c !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html body .modal .modal-footer .btn-default *,
html body .modal .modal-footer .btn-secondary *,
html body .modal .modal-footer .ms-btn-salir *,
html body .modal button.ms-btn-salir *,
html body .modal button.btn-default[data-dismiss="modal"] *,
html body .modal button.btn-default[data-bs-dismiss="modal"] *,
html body .modal .ms-estado-popup-cancel *,
html body .swal2-container button.swal2-cancel * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* Guardar / acción principal */
html body .modal .modal-footer .btn-primary,
html body .modal .modal-footer button.btn-primary {
  background: #2563eb !important;
  background-color: #2563eb !important;
  background-image: none !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html body .modal .modal-footer .btn-primary:hover,
html body .modal .modal-footer button.btn-primary:hover {
  background: #1d4ed8 !important;
  background-color: #1d4ed8 !important;
}

html body .modal .modal-footer .btn-primary *,
html body .modal .modal-footer button.btn-primary * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html body .modal .modal-footer .btn-success,
html body .modal .modal-footer button.btn-success {
  background: #16a34a !important;
  background-color: #16a34a !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html body .modal .modal-footer .btn-success * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html body .modal .modal-footer .btn-warning,
html body .modal .modal-footer button.btn-warning {
  background: #d97706 !important;
  background-color: #d97706 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html body .modal .modal-footer .btn-warning * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html body .modal .modal-footer .btn-danger,
html body .modal .modal-footer button.btn-danger {
  background: #dc2626 !important;
  background-color: #dc2626 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html body .modal .modal-footer .btn-danger * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* Editar orden: Salir custom (sin .btn) + Guardar */
html body #modalEditarOrden .modal-footer {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 0.5rem !important;
  flex-shrink: 0 !important;
  background: #fff !important;
  border-top: 1px solid #e2e8f0 !important;
  padding: 0.75rem 0.9rem !important;
  z-index: 2;
}

html body #modalEditarOrden .ms-btn-salir-orden {
  appearance: none !important;
  -webkit-appearance: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  height: 40px !important;
  min-width: 110px !important;
  padding: 0 18px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: #dc2626 !important;
  background-color: #dc2626 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  opacity: 1 !important;
  visibility: visible !important;
  cursor: pointer !important;
}

html body #modalEditarOrden .modal-footer .btnEditarOrden,
html body #modalEditarOrden .modal-footer .btn-primary {
  margin: 0 !important;
  background: #2563eb !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

html body #modalEditarOrden .modal-footer .btnEditarOrden *,
html body #modalEditarOrden .modal-footer .btn-primary * {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
