:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #16233a;
  --muted: #6b7787;
  --line: #e2e7ee;
  --brand: #1b6ef3;
  --ok: #17795e;
  --ok-bg: #e6f5f0;
  --warn: #9a6700;
  --warn-bg: #fff6e0;
  --bad: #b4232c;
  --bad-bg: #fdeced;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
a { color: var(--brand); }
header.topbar {
  background: #12233b;
  color: #fff;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
header.topbar .brand { font-weight: 600; padding: 14px 0; margin-right: 8px; }
header.topbar nav { display: flex; gap: 18px; flex-wrap: wrap; }
header.topbar nav a { color: #c8d5e6; text-decoration: none; padding: 14px 0; border-bottom: 3px solid transparent; font-size: 14px; }
header.topbar nav a.active, header.topbar nav a:hover { color: #fff; border-bottom-color: var(--brand); }
header.topbar form { margin-left: auto; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 26px 20px 60px; }
.wrap.narrow { max-width: 560px; }
h1 { font-size: 22px; margin: 0 0 6px; }
h2 { font-size: 17px; margin: 26px 0 10px; }
p.lede { color: var(--muted); margin-top: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px; margin-bottom: 18px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.stat b { display: block; font-size: 26px; }
.stat span { color: var(--muted); font-size: 13px; }
label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; font-size: 14px; font-family: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 72px; }
.err { color: var(--bad); font-size: 12px; margin-top: 4px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
button, .btn {
  display: inline-block; background: var(--brand); color: #fff; border: 0; border-radius: 7px;
  padding: 9px 15px; font-size: 14px; cursor: pointer; text-decoration: none; font-family: inherit;
}
button.secondary, .btn.secondary { background: #eef1f6; color: var(--ink); border: 1px solid var(--line); }
button.danger { background: var(--bad); }
button.small, .btn.small { padding: 5px 10px; font-size: 12.5px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }
.tag.mute { background: #eef1f6; color: var(--muted); }
.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--bad-bg); color: var(--bad); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 180px; }
.inline { display: inline; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; }
.passcard { text-align: center; }
.passcard img { width: 260px; height: 260px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; }
.big { font-size: 30px; font-weight: 700; letter-spacing: .04em; }
details summary { cursor: pointer; font-size: 13px; color: var(--muted); }
@media (max-width: 640px) { .wrap { padding: 18px 14px 50px; } table { font-size: 12.5px; } }

/* ---------------------------------------------------------------- branding */
header.topbar .brand { display: flex; align-items: center; gap: 10px; }
header.topbar .brandmark { height: 24px; width: auto; max-width: 130px; display: block; }
header.topbar .brandsub { font-weight: 400; opacity: .65; }
header.topbar nav a.active, header.topbar nav a:hover { border-bottom-color: var(--brand); }
button, .btn { background: var(--brand); }
.tag.brand { background: color-mix(in srgb, var(--brand) 12%, #fff); color: var(--brand); }

.subnav {
  background: #1b2b42; padding: 0 20px; display: flex; gap: 16px; flex-wrap: wrap;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.subnav a { color: #a9bdd6; text-decoration: none; font-size: 13px; padding: 9px 0; border-bottom: 2px solid transparent; }
.subnav a.active, .subnav a:hover { color: #fff; border-bottom-color: var(--brand); }

/* ---------------------------------------------------------------- setup */
.checklist { display: grid; gap: 12px; }
.checkstep {
  display: flex; gap: 14px; align-items: flex-start; background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px;
}
.checkstep .mark {
  flex: 0 0 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 700; background: #eef1f6; color: var(--muted);
}
.checkstep.done .mark { background: var(--ok-bg); color: var(--ok); }
.checkstep h3 { margin: 0 0 3px; font-size: 15px; }
.checkstep p { margin: 0; color: var(--muted); font-size: 13.5px; }
.checkstep .detail { margin-left: auto; text-align: right; font-size: 12.5px; color: var(--muted); white-space: nowrap; }

.formgrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); align-items: end; }
.formgrid .wide { grid-column: 1 / -1; }
fieldset { border: 1px solid var(--line); border-radius: 9px; padding: 14px 16px; margin: 0 0 16px; }
legend { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 6px; }
.checkline { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 8px 0; }
.checkline input { width: auto; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ---------------------------------------------------------------- charts */
.viz { margin: 0; }
.viz svg { width: 100%; height: auto; display: block; }
.viz-grid { stroke: #e1e0d9; stroke-width: 1; }
.viz-baseline { stroke: #c3c2b7; stroke-width: 1; }
.viz-zero { fill: #dfe3e6; }
.viz-axis { fill: #898781; font-size: 11px; font-family: inherit; font-variant-numeric: tabular-nums; }
.viz-label { fill: var(--ink); font-size: 12.5px; font-family: inherit; }
.viz-value { fill: var(--muted); font-size: 12px; font-family: inherit; font-variant-numeric: tabular-nums; }
.viz-empty { color: var(--muted); font-size: 13.5px; margin: 10px 0; }
.viz-table { margin-top: 10px; }
.viz-table table { margin-top: 8px; }
.viz-table td.num, .viz-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.viz-meter { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.viz-meter-track { flex: 1; height: 8px; border-radius: 4px; background: #eef1f6; overflow: hidden; }
.viz-meter-track span { display: block; height: 100%; border-radius: 4px; }
.viz-meter-label { font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
:root {
  --viz-series-1: #2a78d6;
  --viz-good: #0ca30c;
  --viz-warning: #fab219;
  --viz-critical: #d03b3b;
  --viz-muted: #898781;
}
.chartgrid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* ---------------------------------------------------------------- documents & induction */
.doccard { display: flex; gap: 16px; align-items: flex-start; border-top: 1px solid var(--line); padding: 16px 0; }
.doccard:first-of-type { border-top: 0; }
.docthumb {
  flex: 0 0 84px; height: 84px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface-2, #f2f5f4); display: grid; place-items: center; overflow: hidden;
}
.docthumb img { width: 100%; height: 100%; object-fit: cover; }
.docbody { flex: 1; min-width: 0; }
.question { border-top: 1px solid var(--line); padding: 16px 0; }
.question:first-of-type { border-top: 0; }
.question p.prompt { font-weight: 600; margin: 0 0 10px; }
.option { display: flex; gap: 9px; align-items: flex-start; padding: 6px 0; font-size: 14.5px; }
.option input { width: auto; margin-top: 3px; }
.briefing { white-space: pre-wrap; line-height: 1.6; }
.contacts li { margin-bottom: 6px; }


/* --- Smart Visit platform branding (co-brand) --- */
header.topbar .brand { display:flex; align-items:center; gap:10px; min-width:0; }
header.topbar .brand-platform { display:flex; align-items:center; line-height:0; flex:0 0 auto; }
header.topbar .brandmark-platform { height:30px; width:auto; display:block; }
header.topbar .brand-divider { width:1px; height:26px; background:rgba(255,255,255,.22); margin:0 2px; display:inline-block; flex:0 0 auto; }
header.topbar .brandmark-client { height:26px; width:auto; max-width:130px; background:#fff; border-radius:5px; padding:3px 6px; display:block; flex:0 0 auto; }
header.topbar .brand-client-name { color:#c8d5e6; font-weight:600; font-size:14px; white-space:nowrap; }
header.topbar .brandsub { font-weight:400; opacity:.65; color:#c8d5e6; font-size:13px; margin-left:2px; }
.appfoot { text-align:center; padding:18px; color:#8a94a3; font-size:12px; display:flex; flex-direction:column; align-items:center; gap:8px; }
.appfoot .footmark { height:24px; width:auto; border-radius:5px; opacity:.95; }
@media (max-width:640px){ header.topbar .brandmark-platform{ height:26px } header.topbar .brand-client-name{ display:none } }
