/* Prestax P3 · avisos semánticos + overlay global de operación */

/* Elimina definitivamente el fondo naranja del toast heredado. */
.toast.toast--hosted,
.toast.toast--center,
#expToast {
  background: #1f2937 !important;
  color: #ffffff !important;
}

/* P17.8 · Los avisos nunca deben emborronar ni ocultar la aplicación.
   El CSS heredado colocaba #toastBackdrop por encima de #expToast, de modo
   que solo se veía una pantalla borrosa y se perdía el mensaje de error. */
#toastBackdrop {
  display: none !important;
  opacity: 0 !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

body.toast-blur > *,
body.pcp-toast-blur-on > * {
  filter: none !important;
}

#expToast {
  z-index: 2147483647 !important;
}

/* P17.10 · Confirmaciones breves correctas con el verde de Prestax. */
#expToast[data-kind="ok"] {
  height: 2rem;
  background: rgba(21, 132, 63, 0.95) !important;
  color: #ffffff !important;
  width: 18rem;
  font-size: 1rem;
  align-content: center;
  border: 1rem solid #fff;
}

.pcp-feedback-toast-host {
  position: fixed;
  inset: auto 18px 18px auto;
  z-index: 2147485200;
  display: grid;
  justify-items: end;
  pointer-events: none;
}

.pcp-feedback-toast {
  width: min(420px, calc(100vw - 32px));
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 14px;
  padding: 13px 16px;
  color: #ffffff;
  font:
    700 0.95rem/1.45 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  text-align: left;
  box-shadow: 0 18px 45px rgb(0 0 0 / 32%);
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.pcp-feedback-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.pcp-feedback-toast--success {
  background: #14532d;
}

.pcp-feedback-toast--info {
  background: #1e3a5f;
}

#pcp-global-busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147485400;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(3 12 18 / 76%);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  cursor: wait;
}

#pcp-global-busy-overlay[hidden] {
  display: none !important;
}

#pcp-global-busy-overlay .pcp-global-busy__card {
  width: min(370px, 100%);
  box-sizing: border-box;
  border: 1px solid rgb(166 142 246 / 72%);
  border-radius: 18px;
  padding: 24px 20px;
  background: #111827;
  color: #ffffff;
  text-align: center;
  box-shadow: 0 22px 60px rgb(0 0 0 / 45%);
}

#pcp-global-busy-overlay .pcp-global-busy__spinner {
  width: 44px;
  height: 44px;
  box-sizing: border-box;
  margin: 0 auto 14px;
  border: 4px solid rgb(255 255 255 / 24%);
  border-top-color: #a68ef6;
  border-radius: 50%;
  animation: pcpGlobalBusySpin 0.72s linear infinite;
}

#pcp-global-busy-overlay .pcp-global-busy__text,
#pcp-global-busy-overlay .pcp-global-busy__hint {
  display: block;
}

#pcp-global-busy-overlay .pcp-global-busy__text {
  font-size: 1.08rem;
  line-height: 1.35;
}

#pcp-global-busy-overlay .pcp-global-busy__hint {
  margin-top: 7px;
  color: rgb(255 255 255 / 72%);
  font-size: 0.82rem;
  line-height: 1.45;
}

@keyframes pcpGlobalBusySpin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 768px) {
  .pcp-feedback-toast-host {
    inset: auto 16px 18px 16px;
    justify-items: center;
  }

  .pcp-feedback-toast {
    width: 100%;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pcp-feedback-toast {
    transition: none;
  }

  #pcp-global-busy-overlay .pcp-global-busy__spinner {
    animation: none;
  }
}


/* P17.190.1 · OFF9.1 · confirmación persistente de justificante preparado.
   Selector deliberadamente específico: app.css define .btn con background y
   box-shadow !important; este estado semántico debe prevalecer incluso disabled. */
#expensesModal .exp-receipt-btnrow
  button.btn[data-prestax-receipt-action="prepare-offline"][data-prestax-offline-prepared="true"] {
  background: linear-gradient(180deg, #238653, #14532d) !important;
  color: #ffffff !important;
  border: 1px solid #4ade80 !important;
  box-shadow:
    0 0 0 1px rgb(74 222 128 / 20%),
    0 8px 20px rgb(20 83 45 / 32%) !important;
  opacity: 1 !important;
  filter: none !important;
  cursor: default !important;
}

#expensesModal .exp-receipt-btnrow
  button.btn[data-prestax-receipt-action="prepare-offline"][data-prestax-offline-prepared="true"]:disabled {
  -webkit-text-fill-color: #ffffff !important;
}
