/* Shared toast + confirm + prompt — dealer dashboard & Admin only */
#tu-toast-root {
  position: fixed;
  z-index: 10050;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
  left: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  right: auto;
  max-width: min(380px, calc(100vw - 32px));
}
@media (max-width: 768px) {
  #tu-toast-root {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: max(16px, env(safe-area-inset-bottom));
    width: min(380px, calc(100vw - 32px));
  }
}

.tu-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #1f2937;
  color: #fff;
  font: 500 0.9rem/1.35 -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.tu-toast.is-in {
  opacity: 1;
  transform: translateY(0);
}
.tu-toast.is-out {
  opacity: 0;
  transform: translateY(8px);
}
.tu-toast--error {
  background: #7f1d1d;
  border-left: 3px solid #fca5a5;
}
.tu-toast--info {
  background: #1e3a5f;
  border-left: 3px solid #93c5fd;
}
.tu-toast__body {
  flex: 1;
  min-width: 0;
}
.tu-toast__action {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: #93c5fd;
  font: 600 0.85rem/1 -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  cursor: pointer;
  padding: 2px 4px;
  text-decoration: underline;
}
.tu-toast--error .tu-toast__action { color: #fecaca; }
.tu-toast__dismiss {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.tu-toast__dismiss:hover { color: #fff; }

#tu-dialog-root {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
}
#tu-dialog-root.is-open { display: flex; }
.tu-dialog {
  width: 100%;
  max-width: 400px;
  background: #fff;
  color: #16191d;
  border-radius: 12px;
  padding: 20px 20px 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
  text-align: left;
}
.tu-dialog h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 600;
}
.tu-dialog__body {
  margin: 0 0 18px;
  color: #5d6570;
  font-size: 0.95rem;
  line-height: 1.45;
}
.tu-dialog__fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 0 18px;
}
.tu-dialog__field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #5d6570;
  margin-bottom: 4px;
}
.tu-dialog__field input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid #e3e6ea;
  border-radius: 8px;
  font-size: 0.95rem;
}
.tu-dialog__actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.tu-dialog__btn {
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: 1px solid #e3e6ea;
  background: #fff;
  color: #16191d;
  font: 600 0.9rem/1.2 -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  cursor: pointer;
}
.tu-dialog__btn:hover { background: #f4f6f8; }
.tu-dialog__btn--primary {
  background: #0056b3;
  border-color: #0056b3;
  color: #fff;
}
.tu-dialog__btn--primary:hover { background: #004494; }
.tu-dialog__btn--danger {
  background: #b42318;
  border-color: #b42318;
  color: #fff;
}
.tu-dialog__btn--danger:hover { background: #912018; }

[data-theme="dark"] .tu-dialog {
  background: #1f2937;
  color: #f3f4f6;
}
[data-theme="dark"] .tu-dialog__body { color: #9ca3af; }
[data-theme="dark"] .tu-dialog__field input {
  background: #111827;
  border-color: #374151;
  color: #f3f4f6;
}
[data-theme="dark"] .tu-dialog__btn {
  background: #111827;
  border-color: #374151;
  color: #f3f4f6;
}
