/* ============================================================
   Toast-Stack – zentrale Notifications (js/toast.js)
   ============================================================ */
.toast-stack {
  position: fixed;
  bottom:   1rem;
  right:    1rem;
  z-index:  1090;            /* über Bootstrap-Modal (1055), unter Tooltip (1080+) */
  display:  flex;
  flex-direction: column;
  gap: .5rem;
  max-width: 380px;
  width:     min(380px, calc(100vw - 2rem));
  pointer-events: none;
}
.toast-stack > .toast-item { pointer-events: auto; }

.toast-item {
  display:  flex;
  align-items: flex-start;
  gap: .65rem;
  background: var(--bs-body-bg, #fff);
  color:      var(--bs-body-color, #212529);
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-left: 4px solid var(--bs-secondary, #6c757d);
  border-radius: .375rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
  padding: .7rem .85rem;
  font-size: .875rem;
  line-height: 1.4;
  animation: toast-slide-in .25s ease-out;
}
.toast-item.dismissing {
  animation: toast-slide-out .2s ease-in forwards;
}
.toast-item .toast-icon  { flex: 0 0 auto; font-size: 1.1rem; line-height: 1.3; }
.toast-item .toast-body  { flex: 1 1 auto; min-width: 0; }
.toast-item .toast-title {
  font-weight: 600;
  font-size:   .9rem;
  margin-bottom: .15rem;
}
.toast-item .toast-message {
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.toast-item .toast-action {
  flex: 0 0 auto;
  padding: 0 .25rem;
  font-size: .8rem;
  text-decoration: underline;
}
.toast-item .toast-close {
  flex: 0 0 auto;
  margin-top: .15rem;
  font-size: .75rem;
  opacity: .55;
}
.toast-item .toast-close:hover { opacity: 1; }

/* ── Status-Varianten (Border-Akzent + Icon-Farbe) ─────── */
.toast-item.toast-success { border-left-color: var(--bs-success, #198754); }
.toast-item.toast-success .toast-icon { color: var(--bs-success, #198754); }
.toast-item.toast-info    { border-left-color: var(--bs-info,    #0dcaf0); }
.toast-item.toast-info    .toast-icon { color: var(--bs-info,    #0dcaf0); }
.toast-item.toast-warning { border-left-color: var(--bs-warning, #ffc107); }
.toast-item.toast-warning .toast-icon { color: var(--bs-warning, #ffc107); }
.toast-item.toast-error   { border-left-color: var(--bs-danger,  #dc3545); }
.toast-item.toast-error   .toast-icon { color: var(--bs-danger,  #dc3545); }

/* ── Dark-Mode ─────────────────────────────────────────── */
[data-theme="dark"] .toast-item,
[data-bs-theme="dark"] .toast-item {
  background:   #1f2429;
  color:        #e9ecef;
  border-color: rgba(255, 255, 255, .12);
  box-shadow:   0 4px 14px rgba(0, 0, 0, .55);
}
[data-theme="dark"] .toast-item .toast-close,
[data-bs-theme="dark"] .toast-item .toast-close {
  filter: invert(1) grayscale(100%) brightness(1.4);
}

/* ── Mobile ────────────────────────────────────────────── */
@media (max-width: 575.98px) {
  .toast-stack {
    left:  1rem;
    right: 1rem;
    bottom: 1rem;
    max-width: none;
    width:    auto;
  }
}

/* ── Animationen ───────────────────────────────────────── */
@keyframes toast-slide-in {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes toast-slide-out {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(110%); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .toast-item,
  .toast-item.dismissing { animation: none; }
}
