/* Dialoge, Toasts, Hinweise, Badges und Animationen. Erzeugt von tools/css-consolidate.py aus app.css, app-modules.css, app-offers.css; ab jetzt von Hand gepflegt. */

.zt-dialog__overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
  background: rgba(0, 0, 0, .65);
}

.zt-dialog__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: min(90vh, 900px);
  overflow: hidden;
  background: var(--surface-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-s);
  box-shadow: var(--shadow-2);
}

.zt-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-5) var(--s-5) var(--s-3);
  border-bottom: 1px solid var(--line);
}

.zt-dialog__close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-2);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.zt-dialog__close:hover {
  background: var(--surface-3);
  color: var(--text);
}

.zt-dialog__close:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
}

.zt-dialog__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-l);
  font-weight: 700;
  line-height: var(--lh-head);
}

.zt-dialog__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: var(--s-4) var(--s-5);
  font-size: var(--fs-s);
  color: var(--text);
}

.zt-dialog__body p {
  margin-top: 0;
}

.zt-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--s-2);
  padding: var(--s-4) var(--s-5);
  background: var(--surface-1);
  border-top: 1px solid var(--line);
}

.zt-dialog__body .zt-dialog__actions {
  position: sticky;
  bottom: calc(-1 * var(--s-4));
  margin: var(--s-4) calc(-1 * var(--s-5)) calc(-1 * var(--s-4));
}

.zt-empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-s);
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-2);
  font-size: var(--fs-s);
}

.zt-error {
  border: 1px solid var(--accent-deep);
  border-left: 2px solid var(--accent-hover);
  border-radius: var(--r-s);
  background: var(--accent-soft);
  padding: .85rem 1rem;
  color: var(--text);
  font-size: var(--fs-s);
}

.zt-error p {
  margin: 0 0 .5rem;
}

.zt-error p:last-child {
  margin-bottom: 0;
}

.zt-spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: zt-app-spin .8s linear infinite;
}

@keyframes zt-app-spin {
to { transform: rotate(360deg); }
}

@keyframes zt-app-fade-in {
from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .zt-spinner {
    animation: none;
    border-top-color: var(--line-strong);
  }
}

.zt-badge {
  display: inline-block;
  padding: .2rem .5rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-s);
  background: var(--bg-deep);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: var(--tracking-label, .14em);
  text-transform: uppercase;
  color: var(--text-2);
  white-space: nowrap;
}

.zt-badge--role {
  color: var(--accent-hover);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.zt-badge--active {
  color: var(--ok);
  border-color: var(--ok);
  background: rgba(111, 156, 99, .12);
}

.zt-badge--muted,
.zt-badge--status-draft,
.zt-badge--status-inactive,
.zt-badge--status-new,
.zt-badge--status-pending {
  color: var(--text-3);
  border-color: var(--line-strong);
  background: var(--bg-deep);
}

.zt-badge--status-in_progress,
.zt-badge--status-in_review,
.zt-badge--status-processing {
  color: #7c93a8;
  border-color: #4a5a68;
  background: rgba(74, 90, 104, .14);
}

.zt-badge--status-quote_sent,
.zt-badge--status-reserved {
  color: var(--warn);
  border-color: var(--warn);
  background: rgba(212, 160, 58, .12);
}

.zt-badge--status-accepted,
.zt-badge--status-active,
.zt-badge--status-available,
.zt-badge--status-completed,
.zt-badge--status-paid,
.zt-badge--status-published,
.zt-badge--status-ready_for_pickup,
.zt-badge--status-shipped {
  color: var(--ok);
  border-color: var(--ok);
  background: rgba(111, 156, 99, .12);
}

.zt-badge--status-cancelled,
.zt-badge--status-declined,
.zt-badge--status-failed,
.zt-badge--status-refunded {
  color: var(--accent-hover);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.zt-badge--status-partially_refunded {
  color: var(--warn);
  border-color: var(--warn);
  background: rgba(212, 160, 58, .12);
}

.zt-badge--status-archived,
.zt-badge--status-sold {
  color: var(--text-3);
  border-color: var(--line-strong);
  background: var(--bg-deep);
}

.zt-info {
  border: 1px solid var(--line-strong);
  border-left: 2px solid var(--line-strong);
  border-radius: var(--r-s);
  background: var(--surface-1);
  padding: .75rem 1rem;
  font-size: 14px;
  color: var(--text-2);
}

.zt-warn {
  border: 1px solid var(--warn);
  border-left: 2px solid var(--warn);
  border-radius: var(--r-s);
  background: rgba(212, 160, 58, .1);
  padding: .75rem 1rem;
  font-size: 14px;
  color: var(--text);
}

.zt-app .zt-dialog__overlay {
  background: rgba(0, 0, 0, .7);
}

.zt-toast-stack {
  position: fixed;
  right: .75rem;
  bottom: .75rem;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  width: min(360px, calc(100vw - 1.5rem));
  pointer-events: none;
}

.zt-toast-stack[hidden] {
  display: none;
}

.zt-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .7rem .85rem;
  background: var(--surface-1);
  border: 1px solid var(--line-strong);
  border-left: 2px solid var(--text-3);
  border-radius: var(--r-s);
  box-shadow: var(--shadow-2);
  color: var(--text);
  font-size: 14px;
}

.zt-toast--info {
  border-left-color: var(--line-strong);
}

.zt-toast--success {
  border-left-color: var(--ok);
}

.zt-toast--error {
  border-left-color: var(--accent-hover);
}

.zt-toast button:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .zt-toast {
    transition: none !important;
    animation: none !important;
  }
}

@media (max-width: 719.98px) {
  .zt-dialog__overlay {
    align-items: flex-end;
  }

  .zt-dialog__panel {
    width: 100%;
    max-height: 92vh;
    border-radius: var(--r-l) var(--r-l) 0 0;
  }
}
