:root {
  --green: #138a05;
  --green-dark: #0b5e13;
  --ink: #17221a;
  --muted: #637267;
  --line: #dce5dd;
  --bg: #f3f7f1;
  --panel: #fff;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; color: var(--ink); background: var(--bg); }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 14px 28px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 16px; color: var(--green-dark); text-decoration: none; font-weight: 700; }
.brand img { width: 220px; max-width: 52vw; }
.topbar nav a { color: var(--green-dark); font-weight: 700; text-decoration: none; }
.topbar nav { display: flex; gap: 14px; flex-wrap: wrap; }
main { width: min(1180px, calc(100% - 32px)); margin: 28px auto 60px; }
.heading { margin-bottom: 22px; }
.heading p { margin: 0; color: var(--green-dark); text-transform: uppercase; font-size: 12px; font-weight: 700; }
h1 { margin: 6px 0 0; font-size: 30px; line-height: 1.15; }
h2 { margin-top: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 22px; margin-bottom: 18px; }
.success { max-width: 680px; margin: 48px auto; }
.login { max-width: 460px; margin: 48px auto; }
.error { color: #9e2d26; font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid #cfd9d1; border-radius: 6px; padding: 10px; min-height: 42px; font: inherit; color: var(--ink); background: #fff; }
textarea { min-height: 92px; resize: vertical; }
input[readonly] { background: #f2f5f1; }
.header-text { display: grid; gap: 7px; margin: 16px 0; }
.header-text h3 { margin: 8px 0 0; color: var(--green-dark); font-size: 16px; }
.header-text p { margin: 0; line-height: 1.5; }
.question { border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin: 14px 0; background: #fbfdfb; }
.question legend { padding: 0 6px; font-weight: 700; line-height: 1.4; }
.options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.options label { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); font-weight: 400; }
.options input { width: 17px; min-height: 17px; }
.notes { margin-top: 12px; }
.primary, .button { display: inline-block; border: 0; border-radius: 6px; padding: 11px 15px; background: var(--green); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.button.secondary { background: #e9f3e7; color: var(--green-dark); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.qr-grid { display: grid; grid-template-columns: repeat(3, minmax(160px, 1fr)); gap: 12px; min-width: 620px; }
.qr-card { display: grid; gap: 8px; align-content: start; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfdfb; }
.qr-card img { width: 118px; height: 118px; background: #fff; border: 1px solid var(--line); }
.qr-card strong { color: var(--green-dark); }
.qr-card code { display: block; max-width: 220px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 6px; overflow-wrap: anywhere; font-size: 11px; }
.qr-card a { color: var(--green-dark); font-weight: 700; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.metrics article { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
.metrics span, .metrics small { display: block; color: var(--muted); }
.metrics strong { display: block; margin: 6px 0; font-size: 28px; }
.status { display: inline-block; padding: 5px 8px; border-radius: 999px; font-weight: 700; font-size: 12px; }
.status.ok { background: #dff1da; color: #17651c; }
.status.fail { background: #ffe0dc; color: #9e2d26; }
.report-logo { width: 150px; height: auto; }
.print-report { max-width: 920px; margin: 0 auto; }
.print-note { color: var(--muted); }
@media print {
  .topbar { display: none; }
  body { background: #fff; }
  main { width: auto; margin: 0; }
  .panel { border: 0; }
}
@media (max-width: 860px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .grid, .options, .metrics, .qr-grid { grid-template-columns: 1fr; min-width: 0; }
}
