/* RPM Occupational Health Portal */
@font-face { font-family: Montserrat; font-weight: 400; font-display: swap; src: url(fonts/montserrat-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: Montserrat; font-weight: 500; font-display: swap; src: url(fonts/montserrat-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: Montserrat; font-weight: 600; font-display: swap; src: url(fonts/montserrat-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: Montserrat; font-weight: 700; font-display: swap; src: url(fonts/montserrat-latin-700-normal.woff2) format('woff2'); }

:root {
  --bg: #f2f4f8; --surface: #fff; --ink: #13233a; --ink2: #44546b; --muted: #627089; --line: #e0e5ee; --line2: #eef1f6;
  --blue: #24518f; --blue-d: #1b3f72; --navy: #063b66; --navy2: #044c84; --red: #ec1e25; --tint: #eaf0f8;
  --good: #1a7a50; --good-bg: #e6f4ed; --warn: #9a5c00; --warn-bg: #fdf1dc; --bad: #c9302c; --bad-bg: #fbe9e8; --info-bg: #e8eff9;
  --r: 12px; --r-sm: 8px; --shadow: 0 1px 2px rgba(19, 35, 58, .06), 0 6px 20px -12px rgba(19, 35, 58, .18);
  --side: 248px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14px/1.5 Montserrat, "Segoe UI", system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
body.has-modal { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 600; }
h3 { font-size: 13px; font-weight: 600; margin-top: 18px; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.dash { color: var(--muted); }
.sub { color: var(--ink2); font-size: 13px; }
.sub.pad { margin: 4px 0 12px; }
.hintp, .cnote { color: var(--muted); font-size: 12.5px; margin-top: 8px; }
.lead { color: var(--ink2); margin-bottom: 14px; }
.lbl { display: block; color: var(--muted); font-size: 12px; }

/* ---------- loading: the five stations pulse in turn ---------- */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 18px; color: var(--muted); }
.pageload { display: grid; place-items: center; min-height: 40vh; }
.boot-line { display: flex; align-items: center; gap: 0; }
.boot-line i { width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid var(--blue); background: var(--surface); position: relative; margin-right: 34px; animation: stn 1.5s infinite; }
.boot-line i:last-child { margin-right: 0; }
.boot-line i:not(:last-child)::after { content: ""; position: absolute; left: 100%; top: 50%; width: 34px; height: 3px; margin: -1.5px 0 0 2.5px; background: var(--line); }
.boot-line i:nth-child(2) { animation-delay: .15s; } .boot-line i:nth-child(3) { animation-delay: .3s; } .boot-line i:nth-child(4) { animation-delay: .45s; } .boot-line i:nth-child(5) { animation-delay: .6s; }
@keyframes stn { 0%, 60%, 100% { background: var(--surface); } 30% { background: var(--blue); } }

/* ---------- the line: registration → certificate ---------- */
.line { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); }
.line li { position: relative; text-align: center; padding-top: 26px; font-size: 12px; color: var(--muted); font-weight: 500; }
.line li i { position: absolute; top: 4px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--surface); border: 3px solid #c6cfdc; z-index: 1; }
.line li::before { content: ""; position: absolute; top: 9.5px; left: -50%; width: 100%; height: 3px; background: #d5dce7; }
.line li:first-child::before { display: none; }
.line li.done { color: var(--ink2); } .line li.done i { background: var(--blue); border-color: var(--blue); } .line li.done::before, .line li.now::before { background: var(--blue); }
.line li.now { color: var(--ink); font-weight: 700; } .line li.now i { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(36, 81, 143, .16); background: var(--red); border-width: 3px; }
.line-off li i, .line-off li::before { opacity: .5; }
.line-counts li { padding-top: 0; padding-bottom: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.line-counts li b { font-size: 28px; font-weight: 700; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.line-counts li i { position: relative; top: auto; left: auto; margin: 0; background: var(--blue); border-color: var(--blue); }
.line-counts li::before { top: auto; bottom: 29.5px; background: var(--blue); }
.line-counts li span { font-size: 12.5px; color: var(--ink2); }

/* ---------- sign-in ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, 1fr); }
.auth-art { background: var(--navy2); color: #fff; display: flex; align-items: flex-end; padding: 56px; position: relative; overflow: hidden; }
.auth-art::before { content: ""; position: absolute; inset: 0; background: radial-gradient(900px 500px at 15% 0%, rgba(255, 255, 255, .12), transparent 60%), linear-gradient(160deg, #0a5a9c 0%, #044c84 45%, #063b66 100%); }
.auth-art-in { position: relative; max-width: 520px; }
.auth-art h1 { font-size: 40px; line-height: 1.12; letter-spacing: -.02em; }
.auth-art p { margin: 16px 0 44px; font-size: 16px; color: rgba(255, 255, 255, .86); max-width: 44ch; }
.auth-art .line li { color: rgba(255, 255, 255, .6); } .auth-art .line li.done, .auth-art .line li.now { color: #fff; }
.auth-art .line li i { background: var(--navy2); border-color: rgba(255, 255, 255, .45); } .auth-art .line li::before { background: rgba(255, 255, 255, .28); }
.auth-art .line li.done i { background: #fff; border-color: #fff; } .auth-art .line li.done::before, .auth-art .line li.now::before { background: #fff; }
.auth-art .line li.now i { border-color: #fff; background: var(--red); box-shadow: 0 0 0 5px rgba(255, 255, 255, .18); }
.auth-panel { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px 24px; background: var(--surface); }
.auth-card { width: 100%; max-width: 380px; }
.auth-logo { width: 220px; max-width: 70%; display: block; margin-bottom: 40px; }
.auth-card h2 { font-size: 22px; font-weight: 700; margin-bottom: 18px; }
.auth-note { margin-top: 36px; color: var(--muted); font-size: 12px; max-width: 380px; text-align: left; width: 100%; }
.link { background: none; border: 0; color: var(--blue); cursor: pointer; padding: 10px 0; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- shell ---------- */
#app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
#side { background: var(--navy); color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 18px 14px 14px; z-index: 30; }
.brand { background: #fff; border-radius: 10px; padding: 12px 14px; }
.brand img { display: block; width: 100%; height: auto; }
.product { font-size: 12.5px; font-weight: 600; color: rgba(255, 255, 255, .78); padding: 14px 6px 18px; }
#nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
#nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 8px; color: rgba(255, 255, 255, .86); text-decoration: none; font-weight: 500; font-size: 14px; position: relative; }
#nav a:hover { background: rgba(255, 255, 255, .09); color: #fff; }
#nav a.on { background: #fff; color: var(--navy); font-weight: 600; }
#nav a.on::before { content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--red); }
.badge { font-style: normal; font-size: 11px; font-weight: 700; min-width: 20px; padding: 1px 6px; border-radius: 10px; background: var(--red); color: #fff; text-align: center; }
.side-foot { position: relative; border-top: 1px solid rgba(255, 255, 255, .14); padding-top: 12px; margin-top: 12px; }
.userbtn { width: 100%; display: flex; align-items: center; gap: 10px; background: none; border: 0; color: #fff; cursor: pointer; padding: 6px; border-radius: 8px; text-align: left; }
.userbtn:hover { background: rgba(255, 255, 255, .09); }
.avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .16); display: grid; place-items: center; font-weight: 700; font-size: 12.5px; }
.uinfo { min-width: 0; display: flex; flex-direction: column; } .uinfo b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .uinfo small { font-size: 11.5px; color: rgba(255, 255, 255, .7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usermenu { position: absolute; bottom: 100%; left: 0; right: 0; background: #fff; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); padding: 6px; margin-bottom: 6px; }
.usermenu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 9px 10px; border-radius: 6px; color: var(--ink); cursor: pointer; font-weight: 500; }
.usermenu button:hover, .usermenu button:focus-visible { background: var(--tint); }
.ver { font-size: 11px; color: rgba(255, 255, 255, .74); padding: 8px 6px 0; }
#content { min-width: 0; display: flex; flex-direction: column; }
#topbar { display: none; }
#main { padding: 32px 36px 64px; max-width: 1320px; width: 100%; outline: none; }

/* ---------- page pieces ---------- */
.phead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.phead .sub { margin-top: 4px; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card > h2:first-child { margin-bottom: 14px; }
.chead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; }
.grid2 > .card { margin-bottom: 16px; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; } .cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.back { display: inline-block; margin-bottom: 14px; font-weight: 500; font-size: 13px; text-decoration: none; padding: 4px 0; }
.back::before { content: "‹"; margin-right: 6px; font-size: 16px; }
.back:hover { text-decoration: underline; }
.barline { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 14px; } .barline.top { margin-top: 28px; }
.rowacts { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.rowacts.sticky { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 18px 0 8px; margin-top: 0; }
.stack { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: var(--r-sm); border: 1px solid transparent; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn.primary { background: var(--blue); color: #fff; } .btn.primary:hover { background: var(--blue-d); }
.btn.ghost { background: var(--surface); border-color: #cfd7e3; color: var(--ink); } .btn.ghost:hover { background: var(--tint); border-color: #b9c5d6; }
.btn.danger { color: var(--bad); } .btn.primary.danger, .btn.danger:not(.ghost) { background: var(--bad); color: #fff; }
.btn.link { background: none; border: 0; color: var(--blue); padding: 4px 0; min-height: 0; text-decoration: underline; text-underline-offset: 3px; }
.btn.sm { min-height: 32px; padding: 4px 11px; font-size: 13px; }
.btn.block { width: 100%; margin-top: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-color: #fff transparent #fff transparent; animation: spin .7s linear infinite; }
.btn.ghost.loading::after, .btn.link.loading::after { border-color: var(--blue) transparent var(--blue) transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

/* fields */
.fld { display: block; margin-bottom: 14px; } .fld > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; } .fld small { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }
.fld.narrow { max-width: 320px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], input:not([type]), select, textarea { width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid #cfd7e3; border-radius: var(--r-sm); background: #fff; }
textarea { resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
input:disabled { background: var(--line2); color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; cursor: pointer; } .check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--blue); flex: none; }
.ferr { color: var(--bad); background: var(--bad-bg); border-radius: var(--r-sm); padding: 9px 12px; font-size: 13px; margin-bottom: 12px; font-weight: 500; }
.ticks { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px 14px 8px; margin: 0 0 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; } .ticks legend { font-size: 13px; font-weight: 600; padding: 0 6px; } .ticks .check { margin: 6px 0; font-size: 13px; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.fl { display: flex; flex-direction: column; gap: 4px; min-width: 132px; flex: 0 1 168px; } .fl.grow { flex: 1 1 260px; }
.fl span { font-size: 12px; color: var(--ink2); font-weight: 500; } .fl select, .fl input { min-height: 38px; padding: 6px 10px; font-size: 13px; }
.seg { display: inline-flex; background: var(--line2); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; } .seg.pad { margin-bottom: 14px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--ink2); cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(19, 35, 58, .12); }
.segs { display: flex; gap: 10px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs > * { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; font-weight: 500; color: var(--ink2); cursor: pointer; text-decoration: none; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; margin-bottom: -1px; }
.tabs > *:hover { color: var(--ink); } .tabs > .on { color: var(--ink); font-weight: 600; border-bottom-color: var(--red); }
.tabs em { font-style: normal; font-size: 11.5px; font-weight: 600; background: var(--line2); border-radius: 10px; padding: 1px 8px; color: var(--ink2); }
.bulk { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--r-sm); background: var(--surface); border: 1px dashed #cfd7e3; margin-bottom: 12px; font-size: 13px; }
.bulk.on { background: var(--info-bg); border: 1px solid #b9cdea; } .bulk .hint { color: var(--muted); } .bulk.on .hint { display: none; }

/* tables */
.twrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; box-shadow: var(--shadow); }
.twrap.short { max-height: 340px; overflow-y: auto; margin: 14px 0 0; box-shadow: none; }
.card .twrap { box-shadow: none; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
.t th { text-align: left; font-weight: 600; font-size: 12px; color: var(--ink2); padding: 11px 14px; background: #f8f9fc; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
.t td { padding: 11px 14px; border-bottom: 1px solid var(--line2); vertical-align: top; }
.t tbody tr:last-child td { border-bottom: 0; } .t tbody tr:hover { background: #fafbfd; }
.t td small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 1px; } .t td small.pre { margin: 0; }
.t .ck { width: 38px; padding-right: 0; } .t .ck input { width: 17px; height: 17px; accent-color: var(--blue); }
.rowlink { font-weight: 600; color: var(--ink); text-decoration: none; display: inline-block; min-width: 120px; } .t td small { white-space: nowrap; } .t td[data-l="Company"] { min-width: 150px; } .t td small.wrapok { white-space: normal; } .t td[data-l="Date"], .t td[data-l="Appointment"], .t td[data-l="Next due"], .t td[data-l="Employee ID"] { white-space: nowrap; } .rowlink:hover { color: var(--blue); text-decoration: underline; }
.racts { white-space: nowrap; text-align: right; } .racts .btn { margin-left: 6px; }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 12px; color: var(--ink2); font-size: 13px; } .pager span { margin-right: 6px; font-variant-numeric: tabular-nums; }
.code { display: inline-block; font-size: 12px; font-variant-numeric: tabular-nums; background: var(--line2); border-radius: 5px; padding: 1px 7px; margin: 1px 0; }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 20px; white-space: nowrap; background: var(--line2); color: var(--ink2); }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.st-reg { background: #eef1f6; color: #55647c; } .st-sch { background: var(--info-bg); color: #24518f; } .st-exa { background: #e6eefb; color: #1b3f72; }
.st-rev { background: var(--warn-bg); color: var(--warn); } .st-rep { background: var(--bad-bg); color: var(--bad); } .st-cer { background: var(--good-bg); color: var(--good); } .st-can { background: #eceef1; color: #5c6778; }
.oc-fit { background: var(--good-bg); color: var(--good); } .oc-res { background: var(--warn-bg); color: var(--warn); } .oc-unf { background: var(--bad-bg); color: var(--bad); }
.res-normal { background: var(--good-bg); color: var(--good); } .res-abnormal { background: var(--bad-bg); color: var(--bad); } .res-not_done, .res-na { background: var(--line2); color: var(--ink2); }

/* callouts and empties */
.callout { border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 14px; font-size: 13.5px; background: var(--info-bg); color: #1b3f72; }
.callout.warn { background: var(--warn-bg); color: #7a4a00; } .callout.bad { background: var(--bad-bg); color: #8f211e; } .callout.good { background: var(--good-bg); color: #14623f; }
.callout a { color: inherit; font-weight: 600; }
.empty { text-align: center; padding: 56px 20px; background: var(--surface); border: 1px dashed #cfd7e3; border-radius: var(--r); color: var(--ink2); }
.empty h2 { font-size: 17px; margin-bottom: 6px; color: var(--ink); } .empty .btn { margin-top: 16px; } .empty.sm { padding: 28px 16px; border: 0; background: none; }

/* dashboard */
.linecard { padding: 22px 22px 24px; } .linecard h2 { margin-bottom: 20px; }
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: inherit; min-width: 0; }
a.tile:hover { border-color: #b9c5d6; }
.tile b { font-size: 28px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: -.01em; } .tile span { font-size: 13px; font-weight: 600; } .tile small { font-size: 12px; color: var(--muted); }
.chartbox { position: relative; height: 260px; } .chartbox.sm { height: 180px; width: 180px; flex: none; } .chartbox.tall { height: 300px; }
.donut { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; justify-content: center; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 180px; }
.legend li { display: grid; grid-template-columns: 12px 1fr auto 42px; gap: 10px; align-items: center; font-size: 13px; } .legend i { width: 12px; height: 12px; border-radius: 3px; } .legend b { font-variant-numeric: tabular-nums; } .legend em { font-style: normal; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.legend.row { flex-direction: row; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; } .legend.row li { display: flex; gap: 8px; }

/* upload */
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 44px 20px; border: 2px dashed #b9c5d6; border-radius: var(--r); background: #f8fafd; cursor: pointer; transition: background .12s, border-color .12s; }
.drop:hover, .drop.over { border-color: var(--blue); background: var(--tint); } .drop b { font-size: 15px; } .drop span { color: var(--muted); font-size: 13px; }
.drop.sm { padding: 22px 16px; } .drop.busy { opacity: .7; pointer-events: none; }
.checksum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.checksum div { border-radius: var(--r-sm); background: var(--line2); padding: 14px 16px; } .checksum b { display: block; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; } .checksum span { font-size: 13px; color: var(--ink2); }
.checksum .good { background: var(--good-bg); color: #14623f; } .checksum .bad { background: var(--warn-bg); color: #7a4a00; } .checksum .good span, .checksum .bad span { color: inherit; }
.prog { height: 8px; border-radius: 4px; background: var(--line2); overflow: hidden; } .prog i { display: block; height: 100%; width: 0; background: var(--blue); transition: width .2s; }

/* examination page */
.examhead { padding: 22px 24px 20px; } .eh-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.examhead .sub { display: flex; gap: 6px 16px; flex-wrap: wrap; margin-top: 6px; } .examhead .sub span:empty { display: none; }
.examgrid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.dl { margin: 0; display: grid; gap: 10px; } .dl div { display: grid; grid-template-columns: 124px 1fr; gap: 10px; font-size: 13px; } .dl dt { color: var(--muted); } .dl dd { margin: 0; font-weight: 500; word-break: break-word; }
.decision { border-left: 5px solid var(--good); } .decision.oc-res { border-left-color: #c27a00; } .decision.oc-unf { border-left-color: var(--bad); } .decision.oc-fit, .decision.oc-res, .decision.oc-unf { background: var(--surface); color: var(--ink); }
.dec-top { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; } .dec-big { display: block; font-size: 26px; line-height: 1.2; }
.decision.oc-fit .dec-big { color: var(--good); } .decision.oc-res .dec-big { color: var(--warn); } .decision.oc-unf .dec-big { color: var(--bad); }
.dec-row { margin-bottom: 12px; } .dec-row p { margin-top: 2px; } .decision .dl { grid-template-columns: 1fr 1fr; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line2); } .decision .dl div { grid-template-columns: 1fr; gap: 0; }
.files { list-style: none; margin: 0; padding: 0; } .files li { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--line2); } .files li:last-child { border-bottom: 0; padding-bottom: 0; } .files li:first-child { padding-top: 0; }
.files b { display: block; word-break: break-word; } .files span { color: var(--muted); font-size: 12px; }
.tests td:first-child { min-width: 220px; } .tests td small { white-space: normal; } .entry td[data-l="Value"] input { min-width: 90px; } .entry td[data-l="Remarks"] { width: 34%; } .entry td[data-l="Remarks"] input { min-width: 170px; } .entry select { min-width: 132px; } .entry td { vertical-align: middle; } .entry input, .entry select { min-height: 36px; padding: 5px 9px; font-size: 13px; }
details { margin-top: 18px; border-top: 1px solid var(--line2); padding-top: 14px; } summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--blue); margin-bottom: 12px; } details .btn { margin-top: 10px; }
.choices { border: 0; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; } .choices legend { font-size: 13px; font-weight: 600; margin-bottom: 8px; padding: 0; }
.choice { position: relative; border: 2px solid var(--line); border-radius: var(--r-sm); padding: 14px 12px; cursor: pointer; font-weight: 600; text-align: center; background: var(--surface); color: var(--ink); }
.choice input { position: absolute; opacity: 0; } .choice:has(input:checked).oc-fit { border-color: var(--good); background: var(--good-bg); color: var(--good); } .choice:has(input:checked).oc-res { border-color: #c27a00; background: var(--warn-bg); color: var(--warn); } .choice:has(input:checked).oc-unf { border-color: var(--bad); background: var(--bad-bg); color: var(--bad); }
.choice:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; } .quick input { width: auto; flex: 0 1 180px; }
.hist { list-style: none; margin: 0; padding: 0; } .hist li { position: relative; padding: 0 0 14px 20px; font-size: 13px; } .hist li::before { content: ""; position: absolute; left: 3px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); } .hist li::after { content: ""; position: absolute; left: 6.5px; top: 16px; bottom: 0; width: 1px; background: var(--line); } .hist li:last-child::after { display: none; }
.hist b { display: block; font-weight: 600; } .hist span { color: var(--muted); font-size: 12px; } .hist em { display: block; font-style: normal; color: var(--ink2); font-size: 12.5px; margin-top: 2px; }
.sigs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } .sigbox h3 { margin: 0 0 8px; } .sigprev { height: 170px; border: 1px dashed #cfd7e3; border-radius: var(--r-sm); display: grid; place-items: center; background: repeating-conic-gradient(#f6f7fa 0 25%, #fff 0 50%) 0 0/18px 18px; color: var(--muted); margin-bottom: 10px; } .sigprev img { max-width: 90%; max-height: 150px; }
.set { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; } .set-h h2 { margin-bottom: 4px; }

/* boxes */
.mwrap { position: fixed; inset: 0; background: rgba(13, 27, 46, .5); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100; }
.mbox { background: var(--surface); border-radius: 14px; width: 100%; max-width: 520px; max-height: calc(100dvh - 40px); display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(13, 27, 46, .35); }
.mbox.wide { max-width: 760px; } .mbox.viewer { max-width: 1040px; height: calc(100dvh - 40px); }
.mhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex: none; } .mhead h2 { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mclose { flex: none; background: var(--line2); border: 0; border-radius: 7px; padding: 6px 12px; font-weight: 600; font-size: 13px; cursor: pointer; } .mclose:hover { background: #e0e5ee; }
.mbody { padding: 20px; overflow-y: auto; flex: 1 1 auto; min-height: 0; } .merr { margin: 0 20px 12px; flex: none; }
.mfoot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line); flex: none; }
.viewer .mbody { padding: 0; display: flex; } .vframe { border: 0; width: 100%; height: 100%; flex: 1; } .vimg { max-width: 100%; margin: auto; display: block; }

/* toasts */
#toast-root { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; max-width: min(420px, calc(100vw - 40px)); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; font-weight: 500; font-size: 13.5px; box-shadow: 0 10px 30px rgba(13, 27, 46, .3); border-left: 5px solid var(--good); animation: tin .2s ease-out; }
.toast.err { border-left-color: var(--red); } .toast.warn { border-left-color: #f0b429; } .toast.out { opacity: 0; transition: opacity .3s; }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }

/* ---------- smaller screens ---------- */
@media (max-width: 1180px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid2 { grid-template-columns: 1fr; } .examgrid { grid-template-columns: 1fr; } .set { grid-template-columns: 1fr; gap: 10px; } }
@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; }
  #side { position: fixed; left: 0; top: 0; width: 272px; transform: translateX(-100%); transition: transform .2s; }
  body.side-open #side { transform: none; }
  #scrim { position: fixed; inset: 0; background: rgba(13, 27, 46, .5); z-index: 20; }
  #topbar { display: flex; align-items: center; gap: 12px; background: var(--navy); color: #fff; padding: 10px 16px; position: sticky; top: 0; z-index: 10; font-weight: 600; }
  #menubtn { background: none; border: 0; width: 40px; height: 40px; display: grid; place-content: center; gap: 5px; cursor: pointer; } #menubtn span { display: block; width: 20px; height: 2px; background: #fff; border-radius: 2px; }
  #main { padding: 20px 16px 56px; }
  .auth { grid-template-columns: 1fr; } .auth-art { padding: 32px 24px; min-height: 0; } .auth-art h1 { font-size: 28px; } .auth-art p { margin-bottom: 24px; font-size: 14px; } .auth-art .line { display: none; }
  .cols2, .cols3, .sigs, .ticks, .choices { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  h1 { font-size: 20px; } .tiles { grid-template-columns: 1fr 1fr; } .checksum { grid-template-columns: 1fr; }
  .line li span { font-size: 10.5px; } .line-counts li b { font-size: 20px; }
  /* tables become stacked cards so nothing needs sideways scrolling */
  table.t thead { position: absolute; left: -9999px; }
  table.t, table.t tbody, table.t tr, table.t td { display: block; width: 100%; }
  table.t tr { padding: 10px 14px; border-bottom: 1px solid var(--line); } table.t td { padding: 3px 0 3px 118px; border: 0; position: relative; min-height: 24px; width: auto; white-space: normal !important; }
  table.t td::before { content: attr(data-l); position: absolute; left: 0; top: 4px; width: 110px; color: var(--muted); font-size: 12px; } table.t td.ck, table.t td.racts { padding-left: 0; text-align: left; } table.t td.ck::before, table.t td.racts::before { display: none; } .racts .btn { margin: 6px 6px 0 0; }
  .t td small, .rowlink { white-space: normal; } .t td small.pre { display: inline; margin-right: 6px; } .entry td[data-l="Remarks"] { width: auto; }
  .fl { flex: 1 1 calc(50% - 10px); min-width: 0; } .fl.grow { flex-basis: 100%; } .mwrap { padding: 0; align-items: flex-end; } .mbox, .mbox.wide { max-width: none; border-radius: 14px 14px 0 0; max-height: 94dvh; } .mbox.viewer { height: 94dvh; }
  .dl div { grid-template-columns: 108px 1fr; } .decision .dl { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { #side, #topbar, .acts, .filters, .rowacts, .bulk, .pager, #toast-root { display: none !important; } #app { display: block; } #main { padding: 0; } .card, .twrap { box-shadow: none; } }

/* report-based certificate: statement, signature and stamp beside the outcome */
.dec-say { font-size: 14.5px; line-height: 1.55; margin: 0 0 14px; max-width: 70ch; } .dec-say b { font-weight: 700; }
.decision.oc-fit .dec-say b { color: var(--good); } .decision.oc-res .dec-say b { color: var(--warn); } .decision.oc-unf .dec-say b { color: var(--bad); }
.dec-sign { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line2); }
.dec-sig { display: flex; flex-direction: column; } .dec-sig img { max-width: 190px; max-height: 64px; object-fit: contain; object-position: left bottom; margin-bottom: 4px; } .dec-sig b { font-size: 13.5px; } .dec-sig span { font-size: 12px; color: var(--muted); }
.dec-stamp { width: 92px; height: 92px; object-fit: contain; }
.plist { margin: 0; padding-left: 18px; font-size: 13px; display: grid; gap: 6px; } .plist small { display: block; color: var(--muted); font-size: 11.5px; }

/* ---------- 01.10: sign-in, filters on phones, tick list, inline correction ---------- */
.auth-kicker { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .72); margin-bottom: 14px; }
.auth-points { list-style: none; margin: 0 0 40px; padding: 0; display: grid; gap: 14px; }
.auth-points li { display: flex; align-items: center; gap: 12px; font-size: 14.5px; color: rgba(255, 255, 255, .92); }
.auth-points svg { width: 22px; height: 22px; flex: none; color: #fff; background: rgba(255, 255, 255, .14); border-radius: 8px; padding: 5px; box-sizing: content-box; }
.auth-card .lead { font-size: 13.5px; margin-bottom: 16px; }
.pw-wrap { position: relative; } .pw-wrap input { padding-right: 64px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: var(--line2); border: 0; border-radius: 6px; padding: 5px 9px; font-size: 12px; font-weight: 600; color: var(--ink2); cursor: pointer; } .pw-eye:hover { background: #e0e5ee; }
.check.sm { font-size: 13px; margin: 2px 0 12px; } .check.sm input { width: 16px; height: 16px; }
.ftoggle { display: none; margin-bottom: 10px; }
.ticklist { list-style: none; margin: 0 0 6px; padding: 0; border: 1px solid var(--line); border-radius: var(--r-sm); }
.ticklist li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line2); font-size: 13px; }
.ticklist li:last-child { border-bottom: 0; } .ticklist li.done { background: #f3faf6; } .ticklist li.na { background: #fcfaf3; } .ticklist li.off { color: var(--muted); }
.ticklist .tnote { font-size: 12px; color: var(--muted); } .ticklist .tname { font-weight: 500; }
.tctl { display: inline-flex; background: var(--line2); border-radius: 8px; padding: 3px; gap: 2px; }
.tbtn { position: relative; } .tbtn input { position: absolute; opacity: 0; width: 1px; height: 1px; } .tbtn span { display: inline-block; padding: 5px 11px; border-radius: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink2); cursor: pointer; }
.tbtn input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(19, 35, 58, .14); } .tbtn input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 1px; }
li.done .tbtn input:checked + span { color: var(--good); } li.na .tbtn input:checked + span { color: var(--warn); }
.tnote-in { grid-column: 1 / -1; min-height: 34px !important; padding: 5px 10px !important; font-size: 13px; }
.prop { display: block; color: var(--ink2); font-size: 12.5px; margin-bottom: 8px; } .prop b { color: var(--ink); }
small.muted { color: var(--muted); font-weight: 400; }
.fixwrap { max-height: 420px; } .fix td { padding: 6px 6px; vertical-align: middle; } .fix input, .fix select { min-height: 34px; padding: 4px 8px; font-size: 12.5px; min-width: 120px; } .fix td.fixwhy { min-width: 220px; font-size: 12px; color: var(--bad); }
.types td { vertical-align: middle; } .types [data-tn] { min-width: 240px; } .types input[type=text], .types input:not([type]), .types select { min-height: 36px; padding: 5px 9px; font-size: 13px; } .types input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--blue); }
.rowacts.left { justify-content: flex-start; margin-top: 10px; margin-bottom: 14px; }
@media (max-width: 680px) {
  .ftoggle { display: inline-flex; }
  .filters:not(.open) > *:not(.grow):not([data-fclear]) { display: none; }
  .ticklist li { grid-template-columns: 1fr; } .tctl { justify-self: start; }
  .fix td { padding-left: 118px; }
}
