@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@500;600;700;800&family=Inter:wght@400;500;600&display=swap');

:root {
  --ink: #1a1d1a;
  --paper: #f4f1ea;
  --card: #fff;
  --accent: #c8451f;
  --accentDk: #9e3517;
  --steel: #3d4a52;
  --line: #d9d4c8;
  --muted: #6b6357;
  --good: #2f7d4f;
  --goodDk: #245f3c;
  --warn: #b8860b;
  --err: #b3341a;
  --hazard: #b8860b;
  --brand: #F84E00;
  --office: #5f6b66;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

.qa-h { font-family: 'Archivo', sans-serif; letter-spacing: -.02em; }

button { font-family: inherit; border: none; cursor: pointer; transition: all .15s ease; }
button:active { transform: scale(.97); }
button:disabled { opacity: .5; cursor: default; transform: none; }

select, input, textarea {
  font-family: inherit;
  width: 100%;
  padding: 11px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 15px;
  background: var(--paper);
}
textarea { min-height: 70px; resize: vertical; }

.lbl {
  font-size: 12px; font-weight: 600; color: var(--muted);
  display: flex; align-items: center; gap: 6px; margin-bottom: 6px;
}

.pill {
  display: inline-block; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
}
.pill.steel { background: var(--steel); }
.pill.good { background: var(--good); }

.wrap { max-width: 560px; margin: 0 auto; padding: 16px; }
/* screen-size adaptation: phones get the tight 560px column; PC screens get a
   wider, roomier page (tiles/rows scale via the fluid grid + full-width rows) */
@media (min-width: 900px) {
  .wrap { max-width: 720px; }
  .hub-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 13px; }
  .job-row { padding: 15px 18px; }
}

.card {
  background: var(--card); border-radius: 12px; padding: 16px;
  border: 1px solid var(--line); margin-bottom: 14px;
}

@keyframes pop {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.pop { animation: pop .25s ease both; }

/* App header */
.topbar {
  background: var(--brand, #F84E00); color: #fff;
  padding: 15px 18px; position: sticky; top: 0; z-index: 10;
}
.topbar .qa-h { font-size: 20px; font-weight: 800; line-height: 1; }
.topbar .sub { font-size: 11px; color: rgba(255,255,255,.82); margin-top: 3px; }

/* ── Colour-coded buttons ─────────────────────────────── */
.btn-primary {
  width: 100%; padding: 18px; border-radius: 12px; background: var(--accent);
  color: #fff; font-weight: 700; font-size: 16px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 4px 14px rgba(200, 69, 31, .3);
}
.btn-good {
  width: 100%; padding: 16px; border-radius: 12px; background: var(--good);
  color: #fff; font-weight: 700; font-size: 16px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 14px rgba(47, 125, 79, .28);
}
.btn-steel {
  width: 100%; padding: 15px; border-radius: 12px; background: var(--steel);
  color: #fff; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-ghost { background: none; color: var(--muted); padding: 12px; font-weight: 600; }
.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }

/* ── Wizard step indicator ────────────────────────────── */
.steps { display: flex; gap: 6px; margin-bottom: 16px; }
.steps .seg { flex: 1; height: 6px; border-radius: 6px; background: var(--line); }
.steps .seg.on { background: var(--accent); }
.steps .seg.done { background: var(--good); }
.step-h {
  font-family: 'Archivo', sans-serif; font-size: 22px; font-weight: 800;
  margin-bottom: 4px;
}
.step-sub { font-size: 13px; color: var(--muted); margin-bottom: 16px; }

/* ── Induction content sections ───────────────────────── */
.sec { margin-bottom: 18px; }
.sec h3 {
  font-family: 'Archivo', sans-serif; font-size: 16px; font-weight: 700;
  color: var(--accentDk); margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.sec ul { margin: 0 0 0 18px; }
.sec li { font-size: 14px; line-height: 1.55; margin-bottom: 5px; }
.sec p { font-size: 14px; line-height: 1.55; margin-bottom: 8px; }

/* ── Risk acknowledgement cards ───────────────────────── */
.risk {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px; border-radius: 10px; border: 1.5px solid var(--line);
  background: var(--card); margin-bottom: 10px; cursor: pointer;
  transition: all .12s ease;
}
.risk:hover { border-color: var(--hazard); }
.risk.checked { border-color: var(--good); background: #f1f8f3; }
.risk input { width: 22px; height: 22px; flex-shrink: 0; margin-top: 1px; accent-color: var(--good); }
.risk .rk-body { flex: 1; }
.risk .rk-title { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 7px; }
.risk .rk-desc { font-size: 12.5px; color: var(--muted); line-height: 1.45; margin-top: 3px; }
.risk .haz {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  color: #fff; background: var(--hazard); padding: 1px 6px; border-radius: 4px;
}
.risk .haz.permit { background: var(--err); }

/* Declaration */
.declare {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 15px; border-radius: 10px; border: 2px solid var(--accent);
  background: #fff6ec; cursor: pointer;
}
.declare input { width: 24px; height: 24px; flex-shrink: 0; accent-color: var(--accent); }
.declare .dc-text { font-size: 13.5px; line-height: 1.5; }

/* Parameter summary banner */
.params { background: var(--ink); color: var(--paper); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.params .pr { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 13px; }
.params .pr .k { color: #9b958a; }
.params .pr .v { font-weight: 600; text-align: right; }

.cert-no { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; }

.muted-note { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.5; margin-top: 10px; }
.empty { text-align: center; padding: 30px 20px; color: var(--muted); font-size: 14px; border: 1.5px dashed var(--line); border-radius: 12px; }
.errbox { background: #fbe9e6; color: var(--err); border: 1px solid #e7b7af; border-radius: 8px; padding: 10px 12px; font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.okbox { background: #eaf5ee; color: var(--goodDk); border: 1px solid #b7ddc3; border-radius: 8px; padding: 10px 12px; font-size: 13px; font-weight: 600; margin-bottom: 12px; }

/* Big success tick */
.success-tick {
  width: 84px; height: 84px; border-radius: 50%; background: var(--good); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 46px;
  margin: 0 auto 16px; box-shadow: 0 6px 20px rgba(47,125,79,.35);
}

/* Toast */
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13px; opacity: 0; transition: opacity .2s; z-index: 50; }
.toast.show { opacity: 1; }

/* ── SWMS-specific ─────────────────────────────────────────── */
.warnbox { background: #fff4e5; border: 1px solid var(--warn); color: #7a4b00; border-radius: 8px; padding: 10px 12px; font-size: 13.5px; }
.sw-card { }
.sw-job { font-size: 17px; font-weight: 700; color: var(--ink); }
.sw-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.sw-meta { font-size: 12px; color: var(--muted); margin-top: 6px; }
.sw-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.sw-sec { padding: 0; overflow: hidden; }
.sw-sec-h { width: 100%; text-align: left; background: var(--ink); color: #fff; border: 0; padding: 12px 14px; font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; cursor: pointer; position: relative; }
.sw-cop { display: block; font-size: 11px; font-weight: 400; color: #b9c0b9; margin-top: 2px; flex-basis: 100%; }
.sw-caret { margin-left: auto; transition: transform .15s; }
.sw-sec.open .sw-caret { transform: rotate(180deg); }
.sw-sec-body { display: none; padding: 4px 12px 10px; }
.sw-sec.open .sw-sec-body { display: block; }
.sw-item { border-bottom: 1px solid var(--line); padding: 10px 0; }
.sw-item:last-child { border-bottom: 0; }
.sw-step { font-weight: 700; font-size: 13.5px; color: var(--ink); margin-bottom: 5px; }
.haz { font-size: 13.5px; color: var(--ink); margin: 3px 0; }
.ctl { font-size: 13.5px; color: var(--ink); margin: 3px 0; }
.haz .k { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #fff; background: var(--hazard); padding: 1px 7px; border-radius: 4px; margin-right: 6px; }
.ctl .k { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #fff; background: var(--good); padding: 1px 7px; border-radius: 4px; margin-right: 6px; }
.sw-risk { font-size: 12px; color: var(--muted); margin-top: 5px; }
.sw-sign .declare { margin-bottom: 12px; }
.pill.warn { background: #fff4e5; color: #7a4b00; }

/* ── Jobs board ────────────────────────────────────────────── */
.sw-todo { border-left: 5px solid var(--warn); }
.sw-card.sw-todo { padding-left: 11px; }
.reg-tbl th, .reg-tbl td { text-align:center; padding:7px 6px; font-size:13px; }
.reg-tbl th:first-child, .reg-tbl td:first-child { text-align:left; }

/* ── Hub-style launcher home (big-button tiles) ───────────────── */
.hub-sec { margin-bottom: 20px; }
.hub-h {
  font-family: 'Archivo', sans-serif; font-size: 15px; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: .05em;
  margin: 4px 2px 10px;
}
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 11px; }
.hub-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 8px; text-decoration: none; background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 8px 12px;
  min-height: 104px; text-align: center; width: 100%;
}
.hub-tile:active { transform: scale(.97); }
.hub-ico {
  width: 46px; height: 46px; border-radius: 12px; background: #fff1ea; color: var(--brand);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-size: 20px; font-weight: 800;
}
.hub-ico svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.hub-tile.office .hub-ico { background: #eef1ef; color: var(--office); }
.hub-lbl { font-size: 12.5px; font-weight: 700; line-height: 1.2; }
/* jobs: full-width stacked rows (like the buttons inside a job) — side-by-side
   tiles didn't fit phone screens well */
.job-stack { display: flex; flex-direction: column; gap: 10px; }
.job-row {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  background: var(--card); color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 14px; padding: 13px 14px;
}
.job-row:active { transform: scale(.98); }
.job-row-tx { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.job-row .hub-lbl { font-size: 16px; }
.job-chev { color: var(--muted); font-size: 24px; font-weight: 700; line-height: 1; }
.job-ico { border-radius: 12px; }
.job-todo { border-color: #f0c98a; }
.job-todo .job-ico { background: #fff4e5; color: #a85b00; }
.job-ok { border-color: #b7ddc3; }
.job-ok .job-ico { background: #eaf5ee; color: var(--good); }
/* signed on to another job today — neutral grey, nothing owed here */
.job-away { border-color: var(--line); }
.job-away .job-ico { background: #f2f0ea; color: #8a8478; }
.job-status { font-size: 12px; font-weight: 700; }
.job-todo .job-status { color: #a85b00; }
.job-ok .job-status { color: var(--good); }
.job-away .job-status { color: var(--muted); font-weight: 600; }
.hub-away {
  margin: 0 0 12px; padding: 10px 14px; font-size: 13.5px; line-height: 1.5;
  color: var(--muted); background: #f2f0ea; border: 1.5px solid var(--line); border-radius: 14px;
}
.hub-empty { text-align: center; padding: 22px 16px; color: var(--muted); font-size: 13.5px; line-height: 1.5; border: 1.5px dashed var(--line); border-radius: 14px; }
.hub-login { text-align: center; padding: 20px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; font-size: 14px; color: var(--ink); }
.hub-login .btn-primary { max-width: 220px; margin-left: auto; margin-right: auto; }
.hub-foot { text-align: center; margin-top: 8px; }
.linkbtn { background: none; color: var(--muted); font-weight: 600; font-size: 14px; padding: 8px 10px; }

/* ── Auditor tools: email row + full-document view ───────────── */
.aud-row { display: flex; gap: 9px; margin-top: 12px; }
.aud-btn {
  flex: 1; min-width: 0; border: 0; border-radius: 11px; padding: 13px 8px;
  color: #fff; font-weight: 700; font-size: 13.5px; text-align: center;
}
.aud-btn:active { transform: scale(.98); }
.aud-steel { background: var(--steel); box-shadow: 0 3px 10px rgba(60,72,66,.22); }
.aud-accent { background: var(--accent); box-shadow: 0 3px 10px rgba(200,69,31,.25); }
.email-row { display: flex; gap: 8px; margin-top: 10px; }
.email-row input { flex: 1; min-width: 0; padding: 11px 12px; font-size: 15px; border: 1.5px solid var(--line); border-radius: 9px; }
.email-row .btn-primary { flex: 0 0 auto; width: auto; padding: 11px 18px; }
.docview { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.dv-band { background: var(--ink); color: #fff; padding: 14px 16px; }
.dv-title { font-family: 'Archivo', sans-serif; font-size: 17px; font-weight: 800; letter-spacing: .02em; }
.dv-org { font-size: 11px; color: #d9d2c6; margin-top: 3px; }
.dv-info { background: var(--paper); border-bottom: 2px solid var(--accent); padding: 10px 16px 12px; font-size: 13.5px; }
.dv-info > div { margin-top: 6px; }
.dv-k { display: inline-block; min-width: 118px; color: var(--muted); font-weight: 700; font-size: 12px; vertical-align: top; }
.dv-sec { padding: 0 0 6px; }
.dv-sec-h { background: var(--ink); color: #fff; padding: 9px 16px; font-size: 14px; font-weight: 700; margin-top: 14px; display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.dv-cop { font-weight: 400; font-size: 11px; color: #d9d2c6; text-align: right; }
.dv-item { padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.dv-item:nth-child(odd) { background: #faf6ef; }
.dv-step { font-weight: 800; margin-bottom: 4px; }
.dv-row { display: flex; gap: 8px; margin-top: 4px; }
.dv-row > div { flex: 1; min-width: 0; white-space: normal; }
.dv-risk { font-weight: 800; }
.dv-risk-low { color: var(--good); }
.dv-risk-medium { color: #8a6d1a; }
.dv-risk-high { color: #b5321b; }
.dv-foot { padding: 12px 16px 16px; font-size: 11.5px; color: var(--muted); }
.dv-hrgrid { display: grid; grid-template-columns: 1fr; }
@media (min-width: 700px) { .dv-hrgrid { grid-template-columns: 1fr 1fr; } }
.dv-hr { padding: 7px 16px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--muted); display: flex; gap: 9px; align-items: flex-start; }
.dv-hr.on { color: var(--ink); font-weight: 700; background: #fff4e5; }
.dv-muted { color: var(--muted); }
/* drawn checkbox (never a font glyph — those render empty on many phones) */
.hr-box {
  flex: 0 0 auto; display: inline-block; width: 17px; height: 17px; margin-top: 1px;
  border: 1.5px solid #8a857b; border-radius: 4px; background: #fff;
  text-align: center; line-height: 16px; font-size: 11px; font-weight: 800; color: #fff;
}
.hr-box.on { background: var(--accent); border-color: var(--accent); }
.hr-list { padding: 0; }
.hr-list .dv-hr { padding: 8px 14px; }
@media print {
  .topbar, .noprint, .toast { display: none !important; }
  body { background: #fff; }
  .wrap { max-width: none; padding: 0; }
  .docview { border: none; border-radius: 0; }
  .dv-band, .dv-sec-h { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Job pack big buttons */
.hub-jobhead { margin-bottom: 14px; }
.hub-jobname { font-family: 'Archivo', sans-serif; font-size: 23px; font-weight: 800; margin-top: 4px; }
.hub-jobsub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.hub-lbl2 { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 16px 2px 8px; }
.hub-stack { display: flex; flex-direction: column; }
.bigbtn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  width: 100%; text-decoration: none; text-align: left;
  padding: 16px 16px; border-radius: 14px; margin-bottom: 10px;
  border: 0; color: #fff;
}
.bigbtn:active { transform: scale(.98); }
.bigbtn-l { font-size: 17px; font-weight: 800; }
.bigbtn-s { font-size: 12.5px; font-weight: 600; opacity: .92; }
.bb-accent { background: var(--accent); box-shadow: 0 4px 14px rgba(200,69,31,.28); }
.bb-green  { background: var(--good);  box-shadow: 0 4px 14px rgba(47,125,79,.24); }
.bb-amber  { background: #d98200;      box-shadow: 0 4px 14px rgba(217,130,0,.24); }
.bb-steel  { background: var(--steel); }
.bb-grey   { background: #7d857f; }
