/* ---------- Validation Report ---------- */
#validation-report {
  margin-top: 1.25rem;
  border: 1px solid var(--clr-error-border);
  border-radius: var(--radius);
  background: var(--clr-error-bg);
  padding: 1rem 1.25rem;
}

#validation-report.validation-warning-report {
  border-color: var(--clr-warning-border);
  background: var(--clr-warning-bg);
}

#validation-report.validation-warning-report h3 {
  color: var(--clr-warning-text);
}

#validation-report h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--clr-error-text);
  margin-bottom: 0.35rem;
}

.report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-download-errors {
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  background: var(--clr-error-text);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
}
.btn-download-errors:hover {
  filter: brightness(0.92);
}

#validation-report-summary {
  margin-bottom: 0.75rem;
}

#validation-table-wrap {
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
}

#validation-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  background: var(--clr-elevated);
}

#validation-table th,
#validation-table td {
  text-align: left;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--clr-border);
}

#validation-table th {
  background: var(--clr-surface-alt);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--clr-muted);
  position: sticky;
  top: 0;
}

.validation-group-row td {
  background: color-mix(in srgb, var(--clr-surface-alt), transparent 20%);
  border-bottom: 1px solid var(--clr-border);
}

.validation-group-row.warning td {
  background: color-mix(in srgb, var(--clr-warning-bg), var(--clr-surface) 35%);
}

.validation-group-row.error td {
  background: color-mix(in srgb, var(--clr-error-bg), var(--clr-surface) 35%);
}

.validation-group-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0;
  font: inherit;
}

.validation-group-meta {
  color: var(--clr-muted);
  font-size: 0.78rem;
}

.validation-detail-row.warning td {
  background: color-mix(in srgb, var(--clr-warning-bg), transparent 70%);
}

.validation-value {
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 0.8rem;
  color: var(--clr-error-text);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Toast Notifications ---------- */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 420px;
}

.toast {
  background: var(--clr-elevated);
  color: var(--clr-text);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--clr-shadow);
  animation: toast-in 0.3s ease;
}

.toast-error {
  background: var(--clr-error-bg);
  border: 1px solid var(--clr-error-border);
  color: var(--clr-error-text);
}

.toast-success {
  background: var(--clr-success-bg);
  border: 1px solid var(--clr-success-border);
  color: var(--clr-success-text);
}

.toast-warning {
  background: var(--clr-warning-bg);
  border: 1px solid var(--clr-warning-border);
  color: var(--clr-warning-text);
}

/* Toasts that carry an action lay their message and button on one row (#3438).
   Plain toasts are unaffected: without a .toast-undo the flex row holds a single
   child and looks exactly as before. */
.toast:has(.toast-undo) {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* Takes its colour from the toast it sits in, so it reads correctly on the
   success, warning and error grounds rather than needing one rule each. */
.toast-undo {
  flex: none;
  border: 1px solid currentColor;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  cursor: pointer;
}

.toast-undo:hover {
  background: var(--clr-hover-soft);
}

.toast-undo:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.toast-fade {
  opacity: 0;
  transition: opacity 0.4s ease;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

