/* Flash toasts — app-wide (dashboard, auth, and any other layout).
   #app-toasts is a persistent fixed container that Turbo never cache-strips, so
   it's always a valid turbo_stream target; individual toasts are
   data-turbo-temporary and auto-dismiss via the `toast` Stimulus controller.
   Uses --app-* theme vars where present, with fallbacks so it renders correctly
   on layouts that don't load the dashboard theme. */
.app-toasts {
  position: fixed;
  top: 1rem;
  inset-inline-end: 1rem;
  z-index: 1090;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(24rem, calc(100vw - 2rem));
  pointer-events: none;
}

.app-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.75rem 0.875rem;
  border-radius: 10px;
  background: var(--app-card-bg);
  border: 1px solid var(--app-border);
  border-inline-start: 3px solid var(--tblr-secondary);
  box-shadow: var(--app-shadow-toast);
  color: var(--app-text-primary);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.app-toast--leaving {
  opacity: 0;
  transform: translateY(-8px);
}

.app-toast--success { border-inline-start-color: var(--tblr-success); }
.app-toast--danger  { border-inline-start-color: var(--tblr-danger); }

.app-toast__icon {
  flex-shrink: 0;
  font-size: 1.15rem;
  line-height: 1.35;
}
.app-toast--success .app-toast__icon { color: var(--tblr-success); }
.app-toast--danger  .app-toast__icon { color: var(--tblr-danger); }

.app-toast__body { flex: 1 1 auto; min-width: 0; }
.app-toast__title { font-size: 0.875rem; font-weight: 500; }
.app-toast__sub {
  margin-top: 0.125rem;
  font-size: 0.8125rem;
  color: var(--app-text-secondary);
}

.app-toast__close {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: var(--app-text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  font-size: 1rem;
}
.app-toast__close:hover { color: var(--app-text-primary); }

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