/* Property Operations Management — base styles */
:root {
  --ink: #1f2933; --muted: #6b7785; --line: #e1e5ea; --bg: #f5f7fa; --card: #fff;
  --brand: #1e3a5f; --brand-2: #2f5d8a; --ok: #1f7a4d; --ok-bg: #e6f4ec;
  --err: #a8261f; --err-bg: #fdecea; --warn: #9a6200; --warn-bg: #fff4dc; --radius: 8px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand-2); }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 0 0 12px; }
code { background: #eef1f4; padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.muted, .hint { color: var(--muted); }
.hint { font-size: 13px; margin: 6px 0 12px; }

.topbar { display: flex; align-items: center; gap: 24px; background: var(--brand); color: #fff; padding: 0 20px; height: 54px; }
.topbar a { color: #dbe6f2; text-decoration: none; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; color: #fff !important; white-space: nowrap; }
.brand-mark { background: #fff; color: var(--brand); font-weight: 700; font-size: 12px; border-radius: 6px; padding: 3px 6px; }
.topbar nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.topbar nav a { padding: 6px 12px; border-radius: 6px; white-space: nowrap; }
.topbar nav a.on, .topbar nav a:hover { background: rgba(255,255,255,.14); color: #fff; }
.who { display: flex; gap: 12px; align-items: center; font-size: 14px; white-space: nowrap; }
.role { background: rgba(255,255,255,.15); border-radius: 10px; padding: 1px 8px; font-size: 12px; }

.sys-notice { background: var(--warn-bg); color: var(--warn); border-bottom: 1px solid #f1d9a6; padding: 10px 20px; text-align: center; font-weight: 600; }
.wrap { max-width: 1200px; margin: 24px auto; padding: 0 16px; }
.narrow { max-width: 420px; margin: 8vh auto; padding: 0 16px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.card.auth h1 { text-align: center; font-size: 20px; }
.narrow-card { max-width: 460px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.cols .card { margin: 0; }
.span-all { grid-column: 1 / -1; }

label { display: block; font-size: 13px; font-weight: 600; color: #3e4c59; margin-bottom: 12px; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid #cbd2d9; border-radius: 6px; font: inherit; font-weight: 400; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9cc1e6; border-color: var(--brand-2); }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
label.check input { width: auto; margin: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: -4px 0 8px 24px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.form-grid .span2 { grid-column: 1 / -1; }
.actions { display: flex; gap: 8px; }
form.inline { display: inline-flex; gap: 8px; align-items: flex-end; margin: 0; }
form.inline label { margin: 0; }
details summary { cursor: pointer; margin-bottom: 8px; }

.btn { display: inline-block; padding: 8px 14px; border-radius: 6px; border: 1px solid #cbd2d9; background: #fff; color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; text-decoration: none; }
.btn:hover { background: #f0f3f6; }
.btn.primary { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn.primary:hover { background: var(--brand); }
.btn.danger { color: var(--err); border-color: #e7b3ae; }
.btn.sm { padding: 3px 8px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; word-break: break-word; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.err { background: var(--err-bg); color: var(--err); }

.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.page-head h1 { margin: 0; }
.filters { display: flex; gap: 8px; margin-bottom: 12px; }
.filters input { max-width: 340px; margin: 0; }
.filters select { width: auto; margin: 0; }

table.grid { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: 14px; }
.grid th { text-align: left; background: #f0f3f6; color: #52606d; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.grid th, .grid td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.grid tr:last-child td { border-bottom: 0; }
.grid .num { text-align: right; }
.grid.compact td, .grid.compact th { padding: 6px 10px; }
.grid tr.dim td { opacity: .55; }
.grid select { width: auto; margin: 0; padding: 4px 6px; }
.row-actions { white-space: nowrap; text-align: right; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; background: #e4e7eb; color: #52606d; text-transform: capitalize; }
.b-active, .b-completed, .b-resolved { background: var(--ok-bg); color: var(--ok); }
.b-inactive, .b-archived, .b-cancelled, .b-closed { background: #eceff1; color: #7b8794; }
.b-urgent, .b-critical, .b-high { background: var(--err-bg); color: var(--err); }
.b-open, .b-investigating, .b-in_progress, .b-on_hold { background: var(--warn-bg); color: var(--warn); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.tile .n { font-size: 30px; font-weight: 700; color: var(--brand); }
.tile .l { color: var(--muted); font-size: 13px; }
.tile.warn .n { color: var(--err); }

.detail dl { display: grid; grid-template-columns: 140px 1fr; gap: 6px 16px; margin: 0; }
.detail dt { color: var(--muted); font-size: 13px; }
.detail dd { margin: 0; }
.notes { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }

.mfa-grid { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
.qr svg { width: 220px; height: 220px; }
.key { letter-spacing: .08em; }

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 8px; }
  .who { width: 100%; }
  .mfa-grid { grid-template-columns: 1fr; }
  .grid { display: block; overflow-x: auto; }
}

/* ===== v0.2 — inspections, reports, compliance ===== */
.small { font-size: 12px; }
h3 { font-size: 14px; margin: 14px 0 8px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 4px 12px; margin: 0 0 8px; }
.kv dt { color: var(--muted); font-size: 13px; } .kv dd { margin: 0; }
ul.plain { list-style: none; padding: 0; margin: 0 0 12px; } ul.plain li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.filters.wrap, form.inline.wrap { flex-wrap: wrap; }
.filters select { max-width: 200px; }
.w-num { width: 90px; display: inline-block; margin: 0; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; background: #e8eef6; color: var(--brand-2); vertical-align: middle; margin-left: 4px; }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.late { color: var(--err); font-weight: 600; }
.grid tr.hl td { background: #fffbe8; }
.tiles.mini { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.tiles.mini .tile { padding: 10px 14px; } .tiles.mini .n { font-size: 22px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.btn.k-roof { border-color: #b9cde3; } .btn.k-weekly { border-color: #c9dfc9; } .btn.k-comprehensive { border-color: #e0d3b8; }
fieldset { border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px 0; margin: 0 0 12px; }
legend { font-size: 13px; font-weight: 600; color: #3e4c59; padding: 0 4px; }
.sticky-save { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0; border-top: 1px solid var(--line); }
.lookup-row { margin-bottom: 6px; } .lookup-row input { margin: 0; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid #cbd2d9; border-top-color: var(--brand-2); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* results */
.res { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 600; background: #e4e7eb; color: #52606d; }
.res.r-ok, .res.r-info { background: var(--ok-bg); color: var(--ok); }
.res.r-monitor { background: var(--warn-bg); color: var(--warn); }
.res.r-deficient { background: var(--err-bg); color: var(--err); }
.res.r-critical { background: var(--err); color: #fff; }
.res.r-na { background: #eceff1; color: #7b8794; }
.b-overdue, .b-never, .b-failed, .b-declined, .b-medium { background: var(--err-bg); color: var(--err); }
.b-due_soon, .b-draft, .b-queued, .b-running, .b-awaiting_approval, .b-pending, .b-under_renovation { background: var(--warn-bg); color: var(--warn); }
.b-ok, .b-done, .b-primary, .b-confirmed { background: var(--ok-bg); color: var(--ok); }
.b-backup, .b-rejected, .b-normal, .b-low, .b-info { background: #eceff1; color: #52606d; }
.d-removed, .d-duplicate, .d-not_qualified { background: #eceff1; color: #7b8794; }
.d-reworded, .d-moved, .d-added { background: #e8eef6; color: var(--brand-2); }
.d-tenant { background: #efe8f6; color: #5b3a8a; } .d-clarify { background: var(--warn-bg); color: var(--warn); } .d-keep { background: var(--ok-bg); color: var(--ok); }

/* start card */
.tpl-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tpl-opt { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; cursor: pointer; font-weight: 400; margin: 0; }
.tpl-opt input { width: auto; margin: 0; } .tpl-opt .tpl-name { font-weight: 600; font-size: 15px; color: var(--ink); }
.tpl-opt:has(input:checked) { border-color: var(--brand-2); background: #eef4fb; box-shadow: 0 0 0 1px var(--brand-2); }
#siteSel { margin-top: 6px; }

/* runner */
.insp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.insp-head h1 { margin: 2px 0; }
.save-state { font-size: 13px; color: var(--ok); white-space: nowrap; padding-top: 4px; }
.save-state.busy { color: var(--muted); } .save-state.err { color: var(--err); font-weight: 600; }
.progress { height: 6px; background: #e4e7eb; border-radius: 3px; margin: 12px 0 16px; overflow: hidden; }
.progress .bar { height: 100%; background: var(--brand-2); transition: width .3s; }
.runner { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }
.sec-nav { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; max-height: calc(100vh - 24px); overflow-y: auto; }
.sec-nav a { display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 6px; text-decoration: none; color: var(--ink); font-size: 14px; border-left: 3px solid transparent; }
.sec-nav a .c { color: var(--muted); font-size: 12px; white-space: nowrap; }
.sec-nav a.cur { background: #eef4fb; font-weight: 600; }
.sec-nav a.r-ok, .sec-nav a.r-info, .sec-nav a.r-na { border-left-color: var(--ok); }
.sec-nav a.r-monitor { border-left-color: #e0a100; } .sec-nav a.r-deficient, .sec-nav a.r-critical { border-left-color: var(--err); }
.sec-nav .review-link { margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0 0 6px 6px; color: var(--brand-2); }
.sec { display: none; } .sec.on { display: block; }
.q { background: var(--card); border: 1px solid var(--line); border-left: 4px solid #d5dbe1; border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.q.r-ok, .q.r-info, .q.r-na { border-left-color: var(--ok); } .q.r-monitor { border-left-color: #e0a100; }
.q.r-deficient { border-left-color: var(--err); } .q.r-critical { border-left-color: var(--err); background: #fff8f7; }
.q-text { font-weight: 500; margin-bottom: 8px; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { min-height: 40px; min-width: 64px; padding: 6px 14px; border: 1px solid #cbd2d9; border-radius: 20px; background: #fff; font: inherit; font-size: 14px; cursor: pointer; }
.opt.on.o-ok, .opt.on.o-info { background: var(--ok); border-color: var(--ok); color: #fff; }
.opt.on.o-monitor { background: #e0a100; border-color: #e0a100; color: #fff; }
.opt.on.o-deficient { background: var(--err); border-color: var(--err); color: #fff; }
.opt.on.o-critical { background: #7a120c; border-color: #7a120c; color: #fff; }
.opt.on.o-na { background: #7b8794; border-color: #7b8794; color: #fff; }
.q .ans { max-width: 280px; }
.q-extra textarea { margin-top: 8px; }
.q-tools { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.photo-btn, .q-tools label.btn { font-weight: 500; margin: 0; }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.thumbs:empty { display: none; }
.thumb { position: relative; margin: 0; width: 84px; height: 84px; border-radius: 6px; overflow: hidden; background: #eef1f4; display: flex; align-items: center; justify-content: center; font-size: 12px; text-align: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.doc { width: auto; min-width: 120px; padding: 0 22px 0 8px; } .thumb.doc a { word-break: break-all; }
.thumb.err { background: var(--err-bg); color: var(--err); padding: 4px; } .thumb.loading { color: var(--muted); }
.thumb .x { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; line-height: 1; }
.sec-foot { background: #f8fafc; border: 1px dashed #cbd2d9; border-radius: var(--radius); padding: 12px 14px; margin: 14px 0; }
.pager { display: flex; justify-content: space-between; gap: 8px; margin: 16px 0 30px; }

/* report */
.report { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 28px; }
.rep-head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; border-bottom: 2px solid var(--brand); padding-bottom: 14px; margin-bottom: 16px; }
.rep-head h1 { margin: 4px 0 6px; }
.rep-meta { display: grid; grid-template-columns: auto auto; gap: 3px 14px; margin: 0; font-size: 14px; }
.rep-meta dt { color: var(--muted); } .rep-meta dd { margin: 0; }
.rep-sec { margin-top: 22px; } .rep-sec h2 { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.rep-block { break-inside: avoid; margin-bottom: 14px; }
.answers td.qtext { width: 75%; } .answers td.ans { text-align: right; white-space: nowrap; }
.rthumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.rthumb img { width: 110px; height: 82px; object-fit: cover; border-radius: 4px; display: block; }
.rthumb.sm img { width: 64px; height: 48px; } .rthumb.sm { float: left; margin: 0 10px 4px 0; }
.rdoc { font-size: 13px; }
.sec-comment { font-size: 14px; background: #f8fafc; padding: 8px 10px; border-radius: 6px; }
.watch li { margin-bottom: 4px; }
.ai-box { background: #f7f9fc; border: 1px solid #dde6f1; border-radius: var(--radius); padding: 14px 18px; }
.ai-box h2 { border: 0; }
.ai-summary { display: flex; gap: 16px; align-items: flex-start; }
.score { min-width: 76px; height: 76px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; background: var(--err); }
.score span { font-size: 26px; font-weight: 700; line-height: 1; } .score small { font-size: 10px; opacity: .9; }
.score.s1 { background: #d9822b; } .score.s2 { background: #c7a400; } .score.s3, .score.s4 { background: var(--ok); }
.findings td { vertical-align: top; } .verdict { white-space: nowrap; }
.rep-foot { margin-top: 24px; color: var(--muted); font-size: 12px; text-align: center; }
.timeline { list-style: none; padding: 0; margin: 0; } .timeline li { border-left: 2px solid var(--line); padding: 4px 0 10px 12px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-bottom: 12px; }
.gallery a { position: relative; display: block; border-radius: 6px; overflow: hidden; background: #eef1f4; aspect-ratio: 4 / 3; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery span { position: absolute; left: 0; right: 0; bottom: 0; font-size: 11px; color: #fff; background: rgba(0,0,0,.5); padding: 2px 6px; }

/* checklist review */
.tpl-q textarea { min-height: 36px; padding: 6px 8px; }
.tpl-q tr.off td { opacity: .55; } .tpl-q tr.off textarea { text-decoration: line-through; }
body.hide-off .tpl-q tr.off { display: none; }
.opt-mini { display: inline-block; font-size: 11px; padding: 0 6px; margin: 1px; border-radius: 8px; border: 1px solid #d5dbe1; }
.opt-mini.o-ok, .opt-mini.o-info { border-color: #9fd1b5; } .opt-mini.o-monitor { border-color: #f0cf7a; }
.opt-mini.o-deficient, .opt-mini.o-critical { border-color: #eba7a2; }

@media (max-width: 860px) {
  .runner { grid-template-columns: 1fr; }
  .sec-nav { position: sticky; top: 0; z-index: 5; flex-direction: row; overflow-x: auto; max-height: none; border-radius: 0; margin: 0 -16px; padding: 6px 10px; }
  .sec-nav a { flex-direction: column; gap: 0; min-width: 110px; border-left: 0; border-bottom: 3px solid transparent; font-size: 13px; }
  .sec-nav a.r-ok, .sec-nav a.r-info, .sec-nav a.r-na { border-bottom-color: var(--ok); }
  .sec-nav a.r-monitor { border-bottom-color: #e0a100; } .sec-nav a.r-deficient, .sec-nav a.r-critical { border-bottom-color: var(--err); }
  .sec-nav .review-link { margin: 0; border-top: 0; }
  .insp-head { flex-direction: column; }
  .report { padding: 14px; }
  .opt { flex: 1 1 auto; }
}

@media print {
  .topbar, .foot, .no-print, .flash, .sys-notice { display: none !important; }
  body { background: #fff; font-size: 12px; }
  .wrap { margin: 0; max-width: none; padding: 0; }
  .report { border: 0; padding: 0; }
  .grid { border: 0; } .grid th, .grid td { padding: 4px 6px; }
  .tile { border: 1px solid #ccc; }
  a { color: inherit; text-decoration: none; }
  .rthumb img { width: 90px; height: 68px; }
  .rep-sec { break-inside: auto; }
}

/* fixes */
[hidden] { display: none !important; }
.topbar nav a { padding: 6px 9px; font-size: 14px; }
.topbar { gap: 16px; }
@media (max-width: 1280px) { .brand .brand-full { display: none; } }
@media (min-width: 1281px) { .brand .brand-short { display: none; } }
.res.r-info { background: #e8eef6; color: var(--brand-2); }
.opt.on.o-info { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.q.r-info { border-left-color: var(--brand-2); }

/* roles */
.checklist { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 24px; }
.checklist li { padding: 5px 0; break-inside: avoid; }
.checklist .tick { display: inline-block; width: 18px; height: 18px; border: 1.5px solid #cbd2d9; border-radius: 4px; text-align: center; line-height: 15px; font-size: 12px; margin-right: 8px; vertical-align: -3px; }
.checklist li.done { color: var(--muted); } .checklist li.done .tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.card.setup { border-color: #b9cde3; background: #f7faff; }
.due-chips .badge { margin: 1px 2px 1px 0; }
.roles-ref td:not(:first-child), .roles-ref th:not(:first-child) { text-align: center; }
.b-disabled { background: #eceff1; color: #7b8794; }
@media (max-width: 720px) { .checklist { columns: 1; } }
.brand-mark { letter-spacing: .02em; }

/* ==========================================================================
   ISP theme — matches the Industrial Service Partners Compliance Portal
   (mcportal): white top bar with the ISP logo, slate brand, orange accent,
   icon rail, gradient sign-in with logo watermark. Overrides everything above.
   ========================================================================== */
:root {
  --bg: #f4f6fb; --card: #ffffff; --panel: #ffffff; --ink: #1e2637; --muted: #6b7688; --line: #e3e8f0;
  --brand: #1f2733; --brand-2: #333b47; --accent: #e8801a;
  --ok: #1f9d55; --ok-bg: #e4f6ec; --err: #c0392b; --err-bg: #fbe4e1; --warn: #b7791f; --warn-bg: #fdf1dc;
  --info: #2778a8; --info-bg: #e0f0f8;
  --radius: 10px; --shadow: 0 1px 3px rgba(20,30,60,.08), 0 6px 18px rgba(20,30,60,.05);
  --topbar-h: 64px;
}
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--brand-2); }
h1 { font-size: 22px; }

/* Top bar */
body.app .topbar { position: sticky; top: 0; z-index: 20; height: var(--topbar-h); padding: 10px 18px; gap: 14px;
  background: var(--panel); color: var(--ink); border-bottom: 1px solid var(--line); flex-wrap: nowrap; }
.topbar .brand { display: flex; align-items: center; gap: 12px; color: var(--ink) !important; font-weight: 600; text-decoration: none; }
.brand-logo { height: 40px; width: auto; display: block; }
.brand-text { font-size: 21px; font-weight: 700; color: var(--brand-2); letter-spacing: .2px; padding-left: 12px; border-left: 1px solid var(--line); white-space: nowrap; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topbar .who { font-size: 13px; color: var(--muted); width: auto; text-decoration: none; }
.topbar .who:hover { color: var(--ink); }
.topbar .btn-plain { font-size: 13px; color: var(--muted); text-decoration: none; }
.topbar .btn-plain:hover { color: var(--ink); }
.role-chip { display: inline-flex; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 11px; font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.role-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 7px; }
.hamburger { display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--ink); padding: 0 4px; }

/* Shell + icon rail */
.shell { display: flex; min-height: calc(100vh - var(--topbar-h)); }
.sidebar.rail { width: 82px; flex-shrink: 0; background: var(--panel); border-right: 1px solid var(--line); padding: 10px 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px; position: sticky; top: var(--topbar-h);
  align-self: flex-start; height: calc(100vh - var(--topbar-h)); overflow-y: auto; z-index: 15; }
.rail-item { width: 72px; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border-radius: 12px; color: var(--brand-2); padding: 7px 2px; text-decoration: none; transition: background .12s ease, color .12s ease; }
.rail-item:hover { background: var(--bg); text-decoration: none; }
.rail-ico { display: flex; align-items: center; justify-content: center; height: 26px; }
.rail-ico svg { width: 25px; height: 25px; display: block; }
.rail-ico svg .l { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rail-ico svg .s { fill: currentColor; opacity: .16; stroke: none; }
.rail-ico svg .o { fill: var(--accent); stroke: none; }
.rail-ico svg .lo { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rail-label { font-size: 9.5px; font-weight: 600; line-height: 1.15; text-align: center; color: var(--muted); max-width: 70px; }
.rail-item:hover .rail-label { color: var(--ink); }
.rail-item.active { background: var(--brand-2); color: #fff; }
.rail-item.active .rail-label { color: #fff; }
.nav-scrim { display: none; }
main.content { flex: 1; min-width: 0; padding: 26px 30px; max-width: 1480px; }
.pagefoot { text-align: center; color: var(--muted); font-size: 12px; padding: 28px 0 8px; }
.foot { display: none; }

/* Panels, tables, tiles, badges, buttons — Compliance Portal styling */
.card { border-radius: var(--radius); box-shadow: var(--shadow); border-color: var(--line); }
.card h2, .rep-sec h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
section.card > h2, .page-head h2 { position: relative; padding-left: 12px; }
section.card > h2::before, .page-head h2::before { content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 3px; border-radius: 3px; background: var(--brand-2); opacity: .55; }
table.grid { border-radius: var(--radius); border-color: var(--line); }
.grid th { background: #fafbfe; color: var(--muted); font-size: 12px; letter-spacing: .4px; }
.grid th, .grid td { padding: 11px 14px; border-bottom-color: var(--line); }
.grid.compact th, .grid.compact td { padding: 8px 12px; }
.tile { position: relative; overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow); border-color: var(--line); }
.tile::after { content: ""; position: absolute; right: -18px; top: -18px; width: 60px; height: 60px; border-radius: 50%; background: var(--accent); opacity: .08; }
.tile .n { color: var(--ink); font-size: 26px; }
.tile.warn .n { color: var(--err); }
.badge { border-radius: 999px; padding: 3px 10px; letter-spacing: .2px; }
.btn { border-radius: 8px; font-weight: 600; transition: background .15s ease, box-shadow .15s ease, transform .05s ease; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn.primary:hover { background: var(--brand); box-shadow: 0 2px 8px rgba(51,59,71,.28); }
.btn.danger { color: var(--err); }
input, select, textarea { border-color: var(--line); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #cdd9f6; border-color: var(--brand-2); }
label { color: var(--ink); }
.flash { border-radius: 8px; border: 1px solid transparent; }
.flash.ok { border-color: #bfe6cd; } .flash.err { border-color: #f3c4bd; }
.tag { background: var(--bg); border: 1px solid var(--line); color: var(--brand-2); }
.res.r-info { background: var(--info-bg); color: var(--info); }
.opt.on.o-info { background: var(--info); border-color: var(--info); }
.sys-notice { background: #fff4e6; color: #8a4b0b; border-bottom-color: #f6d2a6; }

/* Inspection runner accents */
.progress .bar { background: var(--accent); }
.sec-nav { box-shadow: var(--shadow); }
.sec-nav a.cur { background: var(--bg); box-shadow: inset 3px 0 0 var(--accent); }
.tpl-opt:has(input:checked) { border-color: var(--brand-2); background: #f7f8fb; box-shadow: 0 0 0 1px var(--brand-2); }
.tpl-opt .tpl-name::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: 1px; }
.card.setup { background: linear-gradient(135deg, #fff7ef, #fffdfb); border-color: #f6d9b9; }
.checklist li.done .tick { background: var(--ok); border-color: var(--ok); }
.score.s3, .score.s4 { background: var(--ok); }
.report { border-radius: var(--radius); box-shadow: var(--shadow); }
.rep-head { border-bottom: 2px solid var(--brand-2); }
.rep-head::before { content: ""; display: block; width: 100%; height: 0; }
.ai-box { background: #f8f9fc; border-color: var(--line); }

/* Sign-in pages */
body.bare { background: var(--bg); }
.auth-wrap { position: relative; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 16px; overflow: hidden; background: linear-gradient(160deg, #f5f6f8, #e4e7ec); }
.auth-wrap::before { content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: center / min(58vw, 620px) no-repeat url('isp-logo.png'); opacity: .05; }
.auth-card { position: relative; z-index: 1; background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 26px 70px rgba(0,0,0,.45), 0 0 60px rgba(240,140,26,.14); width: 100%; max-width: 400px; padding: 32px; }
.auth-logo { text-align: center; margin-bottom: 20px; }
.auth-logo img { width: 130px; height: auto; }
.auth-card h1 { text-align: center; font-size: 20px; margin: 0 0 6px; }
.auth-sub { text-align: center; color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.auth-card label { font-size: 13px; font-weight: 600; }
.auth-card .btn-full { width: 100%; text-align: center; padding: 11px 16px; margin-top: 4px; }
.auth-links { margin: 16px 0 0; font-size: 13px; text-align: center; }
.auth-links a { color: var(--brand-2); font-weight: 600; }
.auth-note { text-align: center; color: var(--muted); font-size: 12.5px; line-height: 1.5; margin: 18px 0 0; }
.auth-foot { position: relative; z-index: 1; text-align: center; color: var(--muted); font-size: 12px; margin: 18px 0 0; }
.auth-card code { font-size: 11px; word-break: break-all; }

/* Mobile */
@media (max-width: 1100px) { .brand-text { font-size: 17px; } }
@media (max-width: 820px) {
  .hamburger { display: block; }
  .brand-text { display: none; }
  .brand-logo { height: 34px; }
  .topbar .who { display: none; }
  .sidebar.rail { position: fixed; top: var(--topbar-h); left: 0; bottom: 0; height: auto; transform: translateX(-100%);
    transition: transform .2s; z-index: 30; box-shadow: var(--shadow); }
  body.nav-open .sidebar.rail { transform: translateX(0); }
  body.nav-open .nav-scrim { display: block; position: fixed; inset: var(--topbar-h) 0 0 0; background: rgba(15,20,35,.25); z-index: 25; }
  main.content { padding: 18px 16px; }
  .sec-nav { margin: 0 -16px; top: var(--topbar-h); }
}
@media print {
  .sidebar.rail, .pagefoot, .hamburger, .topbar-right { display: none !important; }
  body.app .topbar { position: static; border: 0; padding: 0 0 8px; height: auto; }
  main.content { padding: 0; }
}
a { text-decoration: none; } a:hover { text-decoration: underline; }
.btn:hover, .rail-item:hover, .brand:hover { text-decoration: none; }
