/* MasterAi toast + confirm modal */

.mai-toast-stack {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  max-width: min(24rem, calc(100vw - 2rem));
  pointer-events: none;
}

.mai-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: 0.875rem;
  border: 1px solid transparent;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15), 0 4px 6px -4px rgba(15, 23, 42, 0.08);
  font-size: 0.875rem;
  line-height: 1.4;
  font-weight: 500;
  background: #fff;
  color: #1e293b;
  opacity: 0;
  transform: translateX(1rem);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.mai-toast.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.mai-toast.is-leaving {
  opacity: 0;
  transform: translateX(0.75rem);
}

.mai-toast--success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.mai-toast--error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.mai-toast--info {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}

.mai-toast__icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.1rem;
}

.mai-toast__body {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.mai-toast__close {
  flex-shrink: 0;
  margin: -0.25rem -0.25rem -0.25rem 0;
  padding: 0.25rem;
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.55;
  cursor: pointer;
  border-radius: 0.375rem;
  line-height: 0;
}

.mai-toast__close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.06);
}

.mai-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 10100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.55);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.mai-confirm-overlay.is-visible {
  opacity: 1;
}

.mai-confirm-dialog {
  width: 100%;
  max-width: 26rem;
  background: #fff;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
  padding: 1.5rem;
  transform: translateY(0.5rem) scale(0.98);
  transition: transform 0.18s ease;
}

.mai-confirm-overlay.is-visible .mai-confirm-dialog {
  transform: translateY(0) scale(1);
}

.mai-confirm-dialog__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.mai-confirm-dialog__body {
  margin: 0.625rem 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #475569;
}

.mai-confirm-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.mai-confirm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.mai-confirm-btn--cancel {
  background: #fff;
  border-color: #e2e8f0;
  color: #334155;
}

.mai-confirm-btn--cancel:hover {
  background: #f8fafc;
}

.mai-confirm-btn--confirm {
  background: #58E88C;
  color: #0a0a0a;
}

.mai-confirm-btn--confirm:hover {
  background: #22c55e;
}

.mai-confirm-btn--danger {
  background: #dc2626;
  color: #fff;
}

.mai-confirm-btn--danger:hover {
  background: #b91c1c;
}

.mai-flash-banner {
  position: relative;
}

.mai-flash-banner__dismiss {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.5;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.375rem;
  line-height: 0;
}

.mai-flash-banner__dismiss:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.06);
}
