/* CFS Assure: Centre for Surgery brand (ink #20272d, navy #0d2c4d, mist #eef2f4, line #c1cddb) */
:root {
  --ink: #20272d; --navy: #0d2c4d; --mist: #eef2f4; --line: #c1cddb; --line2: #dae2ea; --muted: #5d5d58;
  --white: #fff;
  --red: #9b1c1c; --red-bg: #fbe4e4; --amber: #7a4b00; --amber-bg: #fdf1dc; --green: #1e5a35; --green-bg: #e3f1e8;
  --blue: #0d2c4d; --blue-bg: #e1e9f3; --grey: #4a4a46; --grey-bg: #ecebe7;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--mist); color: var(--ink); font: 16px/1.5 Jost, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--navy); }
a:hover { color: var(--ink); }
h1, h2 { font-family: "Crimson Text", Georgia, serif; font-weight: 600; color: var(--navy); }
h1 { font-size: 34px; line-height: 1.15; margin: 0 0 4px; }
h2 { font-size: 22px; margin: 0 0 12px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 9; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid #4d7cc4; outline-offset: 2px; }

/* header */
.top { background: var(--white); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1240px; margin: 0 auto; padding: 10px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand img { display: block; height: 40px; width: auto; }
.brand-sep { width: 1px; height: 30px; background: var(--line); }
.brand-app { font-size: 14px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--navy); }
.nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.nav a { padding: 10px 12px; border-radius: 6px; text-decoration: none; color: var(--ink); min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.nav a:hover { background: var(--mist); }
.nav a.on { background: var(--mist); color: var(--navy); font-weight: 600; }
.count { background: var(--navy); color: #fff; border-radius: 999px; font-size: 12px; padding: 1px 7px; font-weight: 600; }
.me { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.me form { margin: 0; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 28px 24px; }
.foot { color: var(--muted); font-size: 13px; padding-top: 0; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.actions, .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.top { align-items: flex-start; }
.crumb { margin: 0 0 8px; font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.lede { font-size: 17px; color: var(--muted); max-width: 640px; }
.pre { white-space: pre-wrap; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* buttons */
.btn, .btn-quiet, button.link { font: inherit; cursor: pointer; }
.btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--navy); background: var(--navy); color: #fff; font-weight: 500; text-decoration: none; }
.btn:hover { background: #163f6a; color: #fff; }
.btn-quiet { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--navy); text-decoration: none; }
.btn-quiet:hover { border-color: var(--navy); }
button.link { background: none; border: 0; color: var(--navy); text-decoration: underline; padding: 0; min-height: 0; }

/* cards and layout */
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; margin-bottom: 20px; }
.card.flush { padding: 0; overflow: hidden; }
.pad { padding: 18px 22px 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 20px; align-items: start; }
.grid2.wide-left { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
@media (max-width: 960px) { .grid2.wide-left { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .grid2 { grid-template-columns: 1fr; } .wrap { padding: 20px 14px; } h1 { font-size: 28px; } }
.scroll { overflow-x: auto; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; text-decoration: none; color: var(--muted); font-size: 14px; display: flex; flex-direction: column; }
a.tile:hover { border-color: var(--navy); }
.tile .n { font-size: 32px; font-weight: 600; color: var(--ink); line-height: 1.1; }
.t-red { color: var(--red) !important; } .t-amber { color: var(--amber) !important; } .t-green { color: var(--green) !important; }

/* tables */
table.t { width: 100%; border-collapse: collapse; font-size: 15px; }
.t th, .t td { padding: 11px 14px; border-top: 1px solid var(--line2); text-align: left; vertical-align: top; }
.t thead th { border-top: 0; color: var(--muted); font-weight: 500; font-size: 13px; }
.card:not(.flush) .t th:first-child, .card:not(.flush) .t td:first-child { padding-left: 0; }
.card.flush .t th:first-child, .card.flush .t td:first-child { padding-left: 22px; }
.card.flush .t th:last-child, .card.flush .t td:last-child { padding-right: 22px; }
tr.off td { color: var(--muted); }
.bar { display: inline-block; width: 120px; height: 8px; background: var(--line2); border-radius: 4px; overflow: hidden; vertical-align: middle; }
.bar span { display: block; height: 100%; background: var(--green); }

/* status */
.chip { display: inline-block; white-space: nowrap; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; line-height: 1.4; margin: 1px 0; }
.s-expired, .s-missing { background: var(--red-bg); color: var(--red); }
.s-grace, .s-due { background: var(--amber-bg); color: var(--amber); }
.s-pending { background: var(--blue-bg); color: var(--blue); }
.s-ok { background: var(--green-bg); color: var(--green); }
.s-na { background: var(--grey-bg); color: var(--grey); }
.rag { display: inline-block; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 6px; }
.rag-red { background: var(--red-bg); color: var(--red); } .rag-amber { background: var(--amber-bg); color: var(--amber); } .rag-green { background: var(--green-bg); color: var(--green); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; }
.dot-red { background: var(--red); } .dot-amber { background: #c98a1b; } .dot-green { background: var(--green); }
.crit { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--red); font-weight: 600; }
.tag { font-size: 12px; background: var(--mist); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; color: var(--muted); }
.summary { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.counts { display: flex; flex-wrap: wrap; gap: 6px; }
.legend { margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 6px; }

/* lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 12px 0; border-top: 1px solid var(--line2); }
.list li:first-child { border-top: 0; padding-top: 0; }
.list.tight li { padding: 9px 0; }
.issues { margin-top: 4px; }
.plain { margin: 0; padding-left: 18px; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 14px; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; }

/* forms */
input, select, textarea { font: inherit; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; background: #fff; min-height: 44px; width: 100%; }
textarea { min-height: 0; }
input[type=checkbox] { width: auto; min-height: 0; margin: 0 6px 0 0; }
input[type=file] { padding: 8px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--ink); }
label.check { flex-direction: row; align-items: center; gap: 0; font-size: 15px; margin: 6px 0; }
label.block, fieldset.block { margin: 0 0 14px; }
fieldset { border: 1px solid var(--line2); border-radius: 8px; padding: 10px 14px; }
legend { font-size: 14px; padding: 0 4px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 14px; }
.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 14px; }
.form .row { margin-top: 6px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.filters label { min-width: 180px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.inline-form label { min-width: 170px; }
form.inline { display: inline; }
details.inline { display: inline-block; position: relative; }
details.inline summary { cursor: pointer; color: var(--navy); text-decoration: underline; list-style: none; display: inline; }
details.inline summary::-webkit-details-marker { display: none; }
.pop { position: absolute; right: 0; z-index: 5; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; width: 280px; box-shadow: 0 8px 24px rgba(32,39,45,.12); display: flex; flex-direction: column; gap: 8px; text-align: left; white-space: normal; }
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; background: var(--green-bg); color: var(--green); border: 1px solid #b9dcc7; }
.flash.bad { background: var(--red-bg); color: var(--red); border-color: #efc1c1; }

/* login */
.login { max-width: 520px; margin: 20px auto; }
.login .panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; margin-top: 16px; }
.login h2 { font-size: 20px; margin-bottom: 4px; }

/* review */
.review-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.review .row.top { gap: 24px; }
.review h2 { font-size: 20px; margin: 0; }

/* matrix */
.matrix { max-height: 75vh; overflow: auto; }
.mx { font-size: 12px; }
.mx th, .mx td { padding: 6px 8px; border: 1px solid var(--line2); }
.mx thead th { vertical-align: bottom; background: #fff; position: sticky; top: 0; z-index: 2; }
.mx .vert { writing-mode: vertical-rl; transform: rotate(180deg); white-space: normal; max-height: 200px; line-height: 1.25; display: inline-block; color: var(--ink); font-size: 12px; }
.mx th.sticky { position: sticky; left: 0; background: #fff; z-index: 1; white-space: nowrap; font-size: 14px; }
.mx thead th.sticky { z-index: 3; }
.mx td.cell { text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mx td.s-blank { background: #f6f7f8; }

/* training */
.courses { list-style: none; margin: 0; padding: 0; }
.course-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line2); }
.course-row:first-child { border-top: 0; }
.steps-list { padding-left: 22px; } .steps-list li { margin: 6px 0; } .steps-list li.done a { color: var(--green); }
.tick { color: var(--green); font-weight: 600; }
.progress { height: 6px; background: var(--line2); border-radius: 999px; overflow: hidden; margin-bottom: 6px; }
.progress span { display: block; height: 100%; background: var(--navy); }
.lesson { max-width: 820px; font-size: 17px; line-height: 1.65; }
.lesson h3 { font-size: 18px; margin: 22px 0 6px; color: var(--navy); }
.lesson ul, .lesson ol { padding-left: 22px; } .lesson li { margin: 6px 0; }
.lesson.preview { font-size: 15px; }
.callout { background: var(--blue-bg); border-left: 4px solid var(--navy); padding: 12px 16px; border-radius: 6px; margin: 14px 0; }
.callout.warn { background: var(--amber-bg); border-left-color: var(--amber); }
mark.todo { background: var(--amber-bg); color: var(--amber); padding: 1px 6px; border-radius: 4px; font-weight: 600; }
.local { font-weight: 600; }
.check, .test { max-width: 820px; }
fieldset { border: 0; margin: 0 0 18px; padding: 0; }
legend { font-weight: 600; margin-bottom: 8px; }
.q { padding: 14px 0; border-top: 1px solid var(--line2); } .q:first-of-type { border-top: 0; }
.qn { color: var(--muted); }
.opt { display: flex; flex-direction: row; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin: 6px 0; cursor: pointer; min-height: 44px; font-size: 16px; }
.opt input[type=radio], .opt input[type=checkbox] { width: 18px; height: 18px; min-height: 0; padding: 0; margin: 3px 0 0; flex: none; accent-color: var(--navy); }
.opt:has(input:checked) { border-color: var(--navy); background: var(--blue-bg); }
.opt.right { border-color: var(--green); background: var(--green-bg); }
.opt.wrong { border-color: var(--red); background: var(--red-bg); }
.result.pass { border-left: 6px solid var(--green); } .result.fail { border-left: 6px solid var(--amber); }
.rating label { display: inline-flex; flex-direction: row; gap: 4px; align-items: center; font-size: 15px; }
.rating input { width: 18px; height: 18px; min-height: 0; padding: 0; }
.people-pick { columns: 2 320px; }
.people-pick .opt { break-inside: avoid; }
.cert { max-width: 820px; }

/* register and governance */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 210px; padding-top: 10px; overflow-x: auto; }
.mbar { display: flex; flex-direction: column; align-items: center; min-width: 38px; }
.stack-bar { width: 26px; display: flex; flex-direction: column-reverse; border-radius: 4px 4px 0 0; overflow: hidden; background: var(--line2); min-height: 2px; }
.seg { display: block; min-height: 2px; }
i.seg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; }
.seg-incident { background: #9b1c1c; } .seg-near_miss { background: #d08b00; } .seg-complaint { background: #0d2c4d; }
.seg-concern { background: #6c8ebf; } .seg-compliment { background: #1e5a35; }
.bar-n { font-size: 12px; font-weight: 600; } .bar-l { font-size: 11px; color: var(--muted); }
.legend span { margin-right: 12px; }
.pre { white-space: pre-wrap; }
.check { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.check input { width: auto; min-height: 0; }
table.audit td:nth-child(2), table.audit td:nth-child(3), table.audit td:nth-child(4) { text-align: center; width: 56px; }
table.audit input[type=radio] { width: 18px; height: 18px; min-height: 0; }
.report { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 28px 32px; }
.report h2 { margin-top: 24px; }
@media print {
  .top, .foot, .noprint, .skip { display: none !important; }
  body { background: #fff; } .wrap { padding: 0; max-width: none; } .report { border: 0; padding: 0; }
  .t { font-size: 11px; } h1 { font-size: 24px; } h2 { font-size: 16px; }
}
