/* Training-data review dashboard (/training). Builds on analysis.css for the
   band/card shell and shared tokens; everything here is the records table and
   the per-pad Validate modal. */

/* Data-dense table: give this page a wider canvas than the analysis cards. */
main.container {
  max-width: 1400px;
}

.training-card {
  padding: 18px 20px;
  overflow-x: auto;
}

/* ------------------------------------------------------------- records */
.training-row {
  display: grid;
  /* Each row is its own grid, so every track must resolve independent of its
     content or the header/body columns drift apart: minmax(0, 1fr) removes
     the content-size floor plain 1fr tracks have. */
  grid-template-columns:
    minmax(180px, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr)
    minmax(150px, 0.9fr);
  gap: 14px;
  align-items: start;
  padding: 14px 6px;
  border-bottom: 1px solid var(--line);
  min-width: 760px;
}

.training-row:last-child {
  border-bottom: none;
}

.training-row--head {
  padding: 8px 6px;
  border-bottom: 2px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.training-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
  word-break: break-all;
}

.training-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.training-date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}

.training-pad-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 0;
}

.training-pad-label {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.training-pad-value {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--navy);
  background: var(--teal-bg);
  padding: 1px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.training-pad-value.is-vision {
  background: #f0ebfa;
  color: #6d4bb6;
}

.training-pad-value.is-spintouch {
  background: #eef3ee;
  color: #2f6b3c;
}

.training-cell--actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.validated-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #2f6b3c;
  background: #eef3ee;
  border: 1px solid #d5e5d7;
  padding: 4px 10px;
  border-radius: 999px;
}

.validated-badge::before {
  content: "✓";
}

.validated-summary {
  font-size: 11px;
  color: var(--faint);
  text-align: right;
}

.validate-btn {
  border: none;
  background: var(--teal-ink);
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
}

.validate-btn:hover {
  background: #0b5f76;
}

.validate-btn--again {
  background: transparent;
  color: var(--teal-ink);
  border: 1px solid var(--teal-ink);
}

.validate-btn--again:hover {
  background: var(--teal-bg);
}

/* --------------------------------------------------------------- modal */
body.modal-open {
  overflow: hidden;
}

/* The display:flex below would otherwise beat the UA's [hidden] rule and
   show the modal on page load. */
.validate-overlay[hidden] {
  display: none;
}

.validate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 36, 51, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.validate-modal {
  background: var(--panel);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(20, 36, 51, 0.35);
  width: min(640px, 100%);
  max-height: min(85vh, 720px);
  overflow-y: auto;
  padding: 20px 22px;
}

.validate-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.validate-head h2 {
  margin: 0;
  font-size: 1.05rem;
  word-break: break-all;
}

.validate-close {
  border: none;
  background: transparent;
  color: var(--faint);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}

.validate-close:hover {
  color: var(--ink);
}

.validate-hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 8px 0 14px;
}

.validate-shortcuts {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.validate-shortcuts .pill-button,
.validate-actions .pill-button {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.validate-shortcuts .pill-button:hover,
.validate-actions .pill-button:hover {
  color: var(--ink);
  border-color: var(--faint);
}

.validate-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 0.8fr;
  gap: 10px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-2);
}

.validate-row--head {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  border-bottom: 2px solid var(--line);
}

.validate-pad-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}

.validate-option {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--navy);
  background: var(--teal-bg);
  border: 2px solid transparent;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
}

.validate-option--vision {
  background: #f0ebfa;
  color: #6d4bb6;
}

.validate-option:disabled {
  opacity: 0.4;
  cursor: default;
}

.validate-option:not(:disabled):hover {
  border-color: var(--faint);
}

.validate-option.is-selected {
  border-color: var(--teal-ink);
  box-shadow: 0 0 0 2px rgba(17, 163, 184, 0.2);
}

.validate-option--vision.is-selected {
  border-color: #6d4bb6;
  box-shadow: 0 0 0 2px rgba(109, 75, 182, 0.2);
}

.validate-spintouch {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.82rem;
  color: #2f6b3c;
  text-align: center;
}

.validate-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.validate-status {
  margin-right: auto;
  font-size: 0.8rem;
  color: var(--muted);
}

.validate-status.error {
  color: #b3261e;
}

.validate-save {
  border: none;
  background: var(--teal-ink);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 9px 20px;
  border-radius: 999px;
  cursor: pointer;
}

.validate-save:hover:not(:disabled) {
  background: #0b5f76;
}

.validate-save:disabled {
  opacity: 0.55;
  cursor: default;
}

@media (max-width: 720px) {
  .validate-row {
    grid-template-columns: 1fr 1fr;
  }

  .validate-row--head {
    display: none;
  }

  .validate-pad-label,
  .validate-spintouch {
    grid-column: span 2;
    text-align: left;
  }
}
