/* Global toast/confirm style based on the Admin Dashboard design. */
.toast-container {
  position: fixed;
  top: 88px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

@media (max-width: 640px) {
  .toast-container {
    top: 84px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}

.toast {
  pointer-events: auto;
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  overflow: hidden;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 18px;
  padding: 14px 38px 14px 14px;
  box-shadow: 0 24px 50px -18px rgba(15,23,42,.24), 0 6px 16px -8px rgba(15,23,42,.16);
  animation: toast-in .55s cubic-bezier(.2,.9,.3,1.15) forwards;
}

html.dark .toast {
  background: rgba(17,24,39,.94);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 24px 50px -16px rgba(0,0,0,.6), 0 6px 16px -4px rgba(0,0,0,.3);
}

.toast.leaving { animation: toast-out .32s cubic-bezier(.5,0,.7,0) forwards; }

@keyframes toast-in {
  0% { transform: translateX(120%) scale(.95); opacity: 0; }
  60% { transform: translateX(-6px) scale(1.02); opacity: 1; }
  80% { transform: translateX(2px) scale(1); }
  100% { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes toast-out {
  to { transform: translateX(120%) scale(.95); opacity: 0; }
}

.toast-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 17px;
  animation: toast-icon-pop .6s cubic-bezier(.2,.8,.3,1.4) .1s both;
}

@keyframes toast-icon-pop {
  0% { transform: scale(0) rotate(-30deg); }
  60% { transform: scale(1.25) rotate(8deg); }
  100% { transform: scale(1) rotate(0); }
}

.toast-success .toast-icon { background: rgba(5,190,138,.15); color: #05be8a; }
.toast-info .toast-icon { background: rgba(60,140,243,.15); color: #3c8cf3; }
.toast-warning .toast-icon { background: rgba(255,167,38,.18); color: #d97706; }
.toast-error .toast-icon { background: rgba(239,83,80,.15); color: #ef5350; }

.toast-body { flex: 1; min-width: 0; padding-top: 2px; }
.toast-title { font-size: 14px; font-weight: 600; color: #111827; line-height: 1.3; }
html.dark .toast-title { color: #f1f5f9; }
.toast-message { font-size: 12.5px; color: #6b7280; line-height: 1.45; margin-top: 3px; }
html.dark .toast-message { color: rgba(255,255,255,.6); }

.toast-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}

.toast-close:hover {
  background: rgba(108,117,125,.12);
  color: #4b5563;
  transform: rotate(90deg);
}

html.dark .toast-close:hover { background: rgba(255,255,255,.08); color: #fff; }

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform-origin: left;
  animation: toast-progress var(--toast-duration, 5000ms) linear forwards;
  border-radius: 0 3px 0 0;
  opacity: .55;
}

@keyframes toast-progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

.toast-success .toast-progress { background: #05be8a; }
.toast-info .toast-progress { background: #3c8cf3; }
.toast-warning .toast-progress { background: #ffa726; }
.toast-error .toast-progress { background: #ef5350; }

.toast::before {
  content: '';
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
}

.toast-success::before { background: #05be8a; }
.toast-info::before { background: #3c8cf3; }
.toast-warning::before { background: #ffa726; }
.toast-error::before { background: #ef5350; }

.epic-confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15,23,42,.42);
  backdrop-filter: blur(10px);
}

.epic-confirm-backdrop.show { display: flex; }

.epic-confirm-panel {
  width: min(430px, 100%);
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 22px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 40px 90px -30px rgba(15,23,42,.55);
  padding: 20px;
  animation: confirm-in .28s cubic-bezier(.2,.9,.3,1.1);
}

html.dark .epic-confirm-panel {
  background: rgba(17,24,39,.96);
  border-color: rgba(255,255,255,.08);
}

@keyframes confirm-in {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.epic-confirm-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,167,38,.18);
  color: #d97706;
  font-size: 20px;
}
