@font-face {
  font-family: Lato;
  src: url("/assets/Lato-Regular.ttf");
}
@font-face {
  font-family: Lato;
  src: url("/assets/Lato-Black.ttf");
  font-weight: 900;
}
:root {
  --yellow: #ffc72c;
  --black: #090b0d;
  --muted: #646a70;
  --line: #dfe2e5;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f3f4f5;
  color: #171b1f;
  font-family: Lato, Arial, sans-serif;
  line-height: 1.5;
}
.masthead {
  background: var(--black);
  color: #fff;
  padding: 15px max(20px, calc((100vw - 1200px) / 2));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.brand {
  color: var(--yellow);
  display: flex;
  align-items: center;
  gap: 22px;
  text-decoration: none;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.04em;
}
.brand img {
  width: 155px;
  height: 60px;
  object-fit: contain;
}
.tag {
  display: block;
  font-size: 10px;
  color: #b5b9bc;
  letter-spacing: 0.12em;
  margin-top: 2px;
}
.test-banner {
  background: var(--yellow);
  color: #171b1f;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 8px;
}
nav {
  background: #fff;
  display: flex;
  gap: 8px;
  padding: 10px max(20px, calc((100vw - 1200px) / 2));
  overflow: auto;
  border-bottom: 1px solid var(--line);
}
nav:empty {
  display: none;
}
nav a {
  white-space: nowrap;
  text-decoration: none;
  color: #464b50;
  border-radius: 6px;
  padding: 9px 17px;
  font-size: 14px;
}
nav a.active {
  background: var(--black);
  color: var(--yellow);
}
main {
  max-width: 1200px;
  margin: 30px auto 70px;
  padding: 0 22px;
}
h1,
h2,
h3 {
  line-height: 1.15;
  font-weight: 900;
}
h1 {
  font-size: 36px;
  letter-spacing: -0.025em;
  margin: 8px 0 12px;
}
h2 {
  font-size: 23px;
  margin: 8px 0 20px;
}
h3 {
  font-size: 17px;
  margin: 0 0 15px;
}
.eyebrow {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #737a80;
}
.sub {
  color: var(--muted);
  max-width: 680px;
  margin: 0 0 28px;
}
.heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 25px;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 3px 10px #00000003;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.stat {
  background: #fff;
  border: 1px solid var(--line);
  padding: 20px;
  border-radius: 10px;
  border-top: 3px solid var(--yellow);
}
.stat strong {
  display: block;
  font-size: 34px;
  font-weight: 900;
}
.stat span {
  font-size: 12px;
  color: var(--muted);
}
.stat.alert {
  border-top-color: #ce4737;
}
.stat.alert strong {
  color: #ac3026;
}
.pill {
  display: inline-block;
  font-size: 11px;
  padding: 3px 8px;
  background: #edf0f2;
  border-radius: 20px;
  font-weight: 900;
}
.pill.danger {
  background: #ffe8e3;
  color: #a62a21;
}
.pill.good {
  background: #e6f4e7;
  color: #27662e;
}
.pill.yellow {
  background: #fff2bd;
  color: #655217;
}
a {
  color: #24546f;
}
button,
.btn {
  background: var(--yellow);
  color: var(--black);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 11px 17px;
  font:
    900 14px Lato,
    Arial;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}
button.secondary,
.btn.secondary {
  background: #fff;
  border-color: #c9ced2;
  color: #333;
}
button.dark,
.btn.dark {
  background: var(--black);
  color: var(--yellow);
}
button.danger {
  background: #a72d23;
  color: #fff;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button.small,
.btn.small {
  padding: 6px 11px;
  font-size: 12px;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.quiet {
  font-size: 12px;
  color: var(--muted);
}
label {
  display: block;
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 16px;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  font:
    14px Lato,
    Arial;
  padding: 11px 12px;
  border: 1px solid #bcc3c9;
  border-radius: 6px;
  margin-top: 6px;
  background: white;
  color: #171b1f;
}
input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid #edbd3d;
  outline-offset: 2px;
}
input[type="checkbox"],
input[type="radio"] {
  width: 19px;
  height: 19px;
  display: inline-block;
  vertical-align: middle;
  margin: 0 7px 0 0;
  accent-color: #15191d;
}
.checklabel {
  font-weight: 400;
}
.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 20px;
}
textarea {
  min-height: 90px;
  resize: vertical;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
th {
  text-align: left;
  color: #6b7278;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: #f6f7f8;
  font-weight: 900;
}
td,
th {
  padding: 13px 10px;
  border-bottom: 1px solid #e8eaec;
}
td a {
  font-weight: 900;
  text-decoration: none;
}
tr:last-child td {
  border-bottom: 0;
}
.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  max-width: 950px;
  margin: 45px auto;
  gap: 45px;
  align-items: center;
}
.auth-art {
  background: var(--black);
  color: white;
  border-radius: 15px;
  padding: 40px 35px;
  min-height: 420px;
  position: relative;
  overflow: hidden;
}
.auth-art:after {
  content: "";
  position: absolute;
  right: -55px;
  bottom: -100px;
  width: 220px;
  height: 300px;
  background: var(--yellow);
  transform: rotate(28deg);
  opacity: 0.15;
}
.auth-art h1 {
  font-size: 43px;
}
.auth-art em {
  font-style: normal;
  color: var(--yellow);
}
.auth-art p {
  color: #b8bec2;
}
.auth-art .eyebrow {
  color: var(--yellow);
}
.auth-card {
  padding: 30px;
}
.auth-card input {
  padding: 13px;
}
.auth-card button {
  width: 100%;
}
.empty {
  padding: 24px 10px;
  color: var(--muted);
  font-size: 13px;
}
.warning {
  background: #fff4ce;
  border-left: 4px solid #efb721;
  border-radius: 4px;
  padding: 13px 16px;
  font-size: 13px;
  margin-bottom: 20px;
}
.error {
  background: #ffe8e3;
  border-left: 4px solid #ad3226;
  padding: 12px;
}
.success {
  background: #e7f4e9;
  border-left: 4px solid #2a7938;
  padding: 14px;
}
.list-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #e8eaec;
}
.list-row:last-child {
  border: 0;
}
.list-row p {
  margin: 3px 0;
}
.check-item {
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
}
.check-item .choices {
  display: flex;
  gap: 7px;
}
.choices label {
  margin: 0;
  padding: 9px 10px;
  border: 1px solid #ccd1d5;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}
.choices label:has(input:checked) {
  background: #fff0b0;
  border-color: #b58b13;
}
.check-title {
  font-size: 14px;
}
.check-title small {
  color: #7b8389;
}
.check-group {
  background: #13181c;
  color: #fff;
  padding: 10px 14px;
  font-size: 12px;
  margin-top: 16px;
}
.sig {
  width: 100%;
  height: 150px;
  display: block;
  border: 1px dashed #a4afb6;
  border-radius: 6px;
  background: #fff;
  touch-action: none;
}
.sig-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 14px 0 8px;
  font-size: 13px;
  font-weight: 900;
}
.signature-block {
  max-width: 520px;
}
.form-long {
  max-width: 900px;
  margin: auto;
}
.qr img {
  width: 200px;
  height: 200px;
}
.qr {
  text-align: center;
  word-break: break-all;
}
.timeline {
  max-height: 370px;
  overflow: auto;
}
.message {
  background: #f2f4f6;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 10px;
}
.message.admin {
  background: #fff5d1;
}
.message p {
  white-space: pre-wrap;
  margin: 4px 0;
}
.wide {
  grid-column: 1/-1;
}
footer {
  font-size: 11px;
  padding: 20px;
  text-align: center;
  color: #737a80;
  border-top: 1px solid #e3e6e8;
  background: #fff;
}
footer span {
  margin-left: 15px;
}
#notice {
  position: fixed;
  bottom: 20px;
  right: 20px;
  max-width: 500px;
  padding: 15px 22px;
  border-radius: 8px;
  color: white;
  background: #17232b;
  box-shadow: 0 5px 30px #0003;
  z-index: 20;
  display: none;
}
#notice.error {
  display: block;
  background: #9c2f25;
}
#notice.success {
  display: block;
  background: #255c38;
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 20px;
}
.profile-grid label {
  font-weight: 400;
  font-size: 12px;
}
.photo-preview {
  max-width: 150px;
}
.mobile-only {
  display: none;
}
@media (max-width: 760px) {
  .brand {
    font-size: 15px;
    gap: 10px;
  }
  .brand img {
    width: 95px;
    height: 45px;
  }
  .tag {
    font-size: 8px;
    max-width: 150px;
  }
  .masthead {
    padding: 12px 16px;
  }
  .masthead .quiet {
    display: none;
  }
  main {
    margin-top: 22px;
    padding: 0 15px;
  }
  h1 {
    font-size: 29px;
  }
  .heading {
    align-items: flex-start;
  }
  .grid,
  .auth-grid,
  .fields {
    grid-template-columns: 1fr;
  }
  .auth-grid {
    margin: 20px auto;
    gap: 18px;
  }
  .auth-art {
    min-height: 0;
    padding: 24px;
  }
  .auth-art h1 {
    font-size: 32px;
  }
  .auth-art p {
    margin-bottom: 0;
  }
  .auth-card {
    padding: 22px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .stat {
    padding: 15px;
  }
  .stat strong {
    font-size: 29px;
  }
  .card {
    padding: 18px;
  }
  .check-item {
    grid-template-columns: 1fr;
  }
  .check-item .choices {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  .choices label {
    text-align: center;
    padding: 13px 5px;
  }
  .check-title {
    font-size: 15px;
  }
  .profile-grid {
    grid-template-columns: 1fr;
  }
  nav {
    padding: 8px 10px;
  }
  nav a {
    padding: 8px 12px;
  }
  footer span {
    display: block;
    margin: 8px 0 0;
  }
  #notice {
    left: 15px;
    right: 15px;
    bottom: 15px;
  }
}
@media print {
  body {
    background: white;
  }
  .masthead,
  #nav,
  .test-banner,
  footer,
  .no-print {
    display: none;
  }
  main {
    margin: 0;
  }
  .card {
    border: 0;
    box-shadow: none;
  }
  .qr img {
    width: 300px;
    height: 300px;
  }
  .qr {
    font-size: 16px;
  }
  body.print-qr #app > * {
    display: none;
  }
  body.print-qr #app .qr {
    display: block;
  }
}
/* Acceptance-test refinements: readable touch targets, local form progress, no
   horizontal document overflow. Wide measurement tables scroll inside cards. */
.card,
.grid > *,
.list-row > *,
fieldset {
  min-width: 0;
}
.list-row strong,
.list-row a,
fieldset legend {
  overflow-wrap: anywhere;
}
.check-progress {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff9e6;
  border: 1px solid #e3cd7b;
  border-radius: 6px;
  padding: 11px 13px;
  margin: 8px 0 14px;
  font-size: 13px;
  font-weight: 900;
}
.choices label:has(input:checked[value="OK"]),
.choices label:has(input:checked[value="Pass"]) {
  background: #e9f5ec;
  border-color: #4b8b5a;
}
.choices label:has(input:checked[value="Defect"]),
.choices label:has(input:checked[value="Fail"]) {
  background: #ffe9e3;
  border-color: #b94734;
}
.choices label:has(input:checked[value="NA"]) {
  background: #edf0f3;
  border-color: #73808b;
}
.choices label:has(input:disabled) {
  background: #f5f6f7;
  color: #979ea4;
  border-color: #e2e5e8;
}
@media (max-width: 760px) {
  input,
  select,
  textarea {
    font-size: 16px;
  }
  button,
  .btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .heading {
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
  }
  .heading > div {
    min-width: 0;
    flex: 1 1 220px;
  }
  .heading .sub {
    margin-bottom: 0;
  }
  .heading > .btn {
    padding: 10px 13px;
  }
  .form-long .heading {
    margin-bottom: 20px;
  }
  .list-row {
    flex-wrap: wrap;
  }
  .list-row > div:first-child {
    flex: 1 1 190px;
  }
}
.qr {
  word-break: normal;
  overflow-wrap: anywhere;
}
#notice {
  padding-right: 52px;
}
#notice button {
  position: absolute;
  right: 3px;
  top: 3px;
  background: transparent;
  color: #fff;
  font:
    24px Arial,
    sans-serif;
  min-height: 40px;
  width: 40px;
  padding: 0;
}
