* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --fg: #1b1f23;
  --muted: #6a737d;
  --brand: #3a7afe;
  --brand-dark: #1742b6;
  --border: #dee1e7;
  --card-bg: #fff;
  --danger: #d7263d;
  --warning: #f6ad55;
  --success: #2f9e44;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg);
  color: var(--fg);
}

a {
  color: inherit;
  text-decoration: none;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}

.top-bar__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.top-bar__logo {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.brand-accent {
  display: inline-block;
  width: 10px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), #70a0ff);
}

.top-bar__nav {
  display: flex;
  gap: 1rem;
}

.top-bar__nav a {
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  font-weight: 500;
  color: var(--muted);
  transition: all 160ms ease;
}

.top-bar__nav a:hover {
  color: var(--fg);
  background-color: rgba(58, 122, 254, 0.08);
}

.top-bar__nav a.active {
  color: var(--fg);
  background-color: rgba(58, 122, 254, 0.14);
}

.top-bar__nav a.cta {
  background-color: var(--brand);
  color: #fff;
}

.top-bar__nav a.cta:hover,
.top-bar__nav a.cta.active {
  background-color: var(--brand-dark);
}

.page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.flash-container {
  max-width: 1400px;
  margin: 1.25rem auto 0;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.flash {
  border-radius: 10px;
  padding: 0.75rem 1.1rem;
  font-weight: 500;
  border: 1px solid transparent;
  background-color: rgba(58, 122, 254, 0.08);
  color: var(--brand-dark);
}

.flash--success {
  background-color: rgba(47, 158, 68, 0.12);
  border-color: rgba(47, 158, 68, 0.25);
  color: var(--success);
}

.flash--info {
  background-color: rgba(58, 122, 254, 0.12);
  border-color: rgba(58, 122, 254, 0.2);
}

.flash--warning {
  background-color: rgba(246, 173, 85, 0.18);
  border-color: rgba(246, 173, 85, 0.3);
  color: #b76b00;
}

.flash--error,
.flash--danger {
  background-color: rgba(215, 38, 61, 0.12);
  border-color: rgba(215, 38, 61, 0.28);
  color: var(--danger);
}

.section {
  margin-bottom: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.section--split {
  flex-direction: row;
}

.section--split > * {
  flex: 1;
}

.section__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.section__title {
  margin: 0;
  font-size: 1.75rem;
}

.section__subtitle {
  margin: 0.4rem 0 0;
  color: var(--muted);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.metric-card {
  padding: 1.25rem 1.5rem;
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.metric-card__label {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-card__value {
  font-size: 1.9rem;
}

.card {
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.04);
}

.card__title {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.table th,
.table td {
  padding: 0.9rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.table th {
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.table__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  white-space: nowrap;
  flex-wrap: wrap;
}

.inline-form {
  margin: 0;
}

.inline-form button {
  padding: 0;
}

.table__empty {
  text-align: center;
  color: var(--muted);
  font-style: italic;
}

.table__row-clickable {
  cursor: pointer;
  transition: background-color 120ms ease;
}

.table__row-clickable:hover {
  background-color: rgba(58, 122, 254, 0.06);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.85rem;
  line-height: 1;
  background-color: rgba(58, 122, 254, 0.12);
  color: var(--brand-dark);
}

.status--large {
  font-size: 1.4rem;
  padding: 0.45rem 1.1rem;
}

.status--completed {
  background-color: rgba(47, 158, 68, 0.12);
  color: var(--success);
}

.status--pass {
  background-color: rgba(47, 158, 68, 0.12);
  color: var(--success);
}

.status--in-progress {
  background-color: rgba(58, 122, 254, 0.12);
}

.status--failed {
  background-color: rgba(215, 38, 61, 0.12);
  color: var(--danger);
}

.status--fail {
  background-color: rgba(215, 38, 61, 0.12);
  color: var(--danger);
}

.status--tbd {
  background-color: rgba(246, 173, 85, 0.15);
  color: #b76b00;
}

.status--table {
  font-size: 0.85rem;
  padding: 0.25rem 0.65rem;
}

.step-list {
  margin: 0;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.link-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.button,
button,
input,
select,
textarea {
  font: inherit;
}

.button,
button.button,
.form-actions .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background-color: var(--brand);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  transition: all 160ms ease;
}

.button:hover,
button.button:hover {
  background-color: var(--brand-dark);
}

.button--secondary,
button.button--secondary {
  background-color: #fff;
  color: var(--fg);
  border-color: var(--border);
}

.button--secondary:hover,
button.button--secondary:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.button:disabled,
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.link {
  border: none;
  background: none;
  color: var(--brand);
  cursor: pointer;
  padding: 0;
}

.link--danger {
  color: var(--danger);
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pill-list__item {
  padding: 0.25rem 0.6rem;
  background-color: rgba(58, 122, 254, 0.12);
  border-radius: 999px;
  font-size: 0.85rem;
}

.form-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.form-vertical {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-row {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.form-row .form-field {
  flex: 1 1 240px;
}

.form-grid fieldset {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
}

.form-grid legend {
  font-weight: 600;
  padding: 0 0.4rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.form-field span {
  font-size: 0.9rem;
  color: var(--muted);
}

.form-field input,
.form-field select,
.form-field textarea {
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 0.5rem 0.75rem;
  transition: border 120ms ease;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--brand);
}

.form-error {
  color: var(--danger);
  font-size: 0.85rem;
}

.form-help {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 1rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* ── Profile bar ──────────────────────────────────────────────────────────── */

.profile-bar {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
}

.profile-bar__row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.profile-bar__label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 140px;
  font-size: 0.9rem;
}

.profile-bar__hint {
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--muted);
}

.profile-bar__select {
  flex: 1;
  min-width: 180px;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.profile-bar__input {
  flex: 1;
  min-width: 180px;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.profile-bar__divider {
  margin: 0.75rem 0;
  border: none;
  border-top: 1px solid var(--border);
}

.button--danger-outline,
button.button--danger-outline {
  background-color: #fff;
  color: var(--danger);
  border-color: var(--danger);
}

.button--danger-outline:hover,
button.button--danger-outline:hover {
  background-color: var(--danger);
  color: #fff;
}

/* ── End profile bar ──────────────────────────────────────────────────────── */

.run-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.75rem;
}

.run-card__aside {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  border-left: 1px solid var(--border);
}

.run-card__body h2 {
  margin-top: 0;
}

.expected-outcome {
  margin-top: 1.5rem;
  padding: 1rem;
  background-color: rgba(58, 122, 254, 0.08);
  border-radius: 8px;
  border-left: 3px solid var(--brand);
}

.expected-outcome strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--brand-dark);
}

.expected-outcome p {
  margin: 0;
  line-height: 1.6;
  white-space: pre-wrap;
}

.outcome-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.outcome-radio {
  position: relative;
  cursor: pointer;
}

.outcome-radio input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.outcome-radio input[type="radio"]:checked + span {
  opacity: 1;
  transform: scale(1.05);
  box-shadow: 0 0 0 2px var(--brand);
}

.outcome-radio input[type="radio"]:focus + span {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.outcome.pass {
  background-color: rgba(47, 158, 68, 0.1);
  color: var(--success);
}

.outcome.fail {
  background-color: rgba(215, 38, 61, 0.12);
  color: var(--danger);
}

.outcome.hold {
  background-color: rgba(246, 173, 85, 0.15);
  color: #b76b00;
}

.printer-callout {
  padding: 1rem;
  border-radius: 8px;
  background-color: rgba(58, 122, 254, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.printer-callout__title {
  margin: 0;
  font-weight: 600;
}

.printer-callout__subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.footer {
  display: flex;
  justify-content: space-between;
  padding: 1rem 2rem;
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--card-bg);
}

.footer__meta {
  font-style: italic;
}

.steps-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.step-item {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
}

.step-item__header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.step-item__order {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.step-item__title {
  margin: 0;
  flex: 1;
  min-width: 200px;
  font-size: 1.1rem;
}

.step-badge {
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
}

.step-badge--printer {
  background-color: rgba(58, 122, 254, 0.12);
  color: var(--brand-dark);
}

.step-item__body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.step-item__section {
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 6px;
}

.step-item__section strong {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.step-item__section p {
  margin: 0;
  line-height: 1.6;
  white-space: pre-wrap;
}

.step-item__actions {
  display: flex;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 960px) {
  .run-card {
    grid-template-columns: 1fr;
  }

  .run-card__aside {
    border-left: none;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
  }

  .section__header {
    flex-direction: column;
    align-items: stretch;
  }

  .top-bar {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }

  .top-bar__nav {
    width: 100%;
    flex-wrap: wrap;
  }
}

