/* Underpin PRISM. Brand tokens from the Underpin playbook / Growth Assessment (Deliverable 3, B1). */
@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 {
  --navy: #1E2A35; --navy-light: #2A3A48; --ink: #26313B; --gold: #C5A880; --gold-dark: #8A6A3B; --gold-bg: #F7F4EF;
  --teal: #2F8F8B; --teal-dark: #24706D; --teal-bg: #EAF4F3; --grey: #DDE1E6; --grey-light: #F4F6F8; --muted: #5A636D;
  --white: #FFFFFF; --rust: #B3542C; --rust-bg: #FBF0EA; --amber: #B7791F; --amber-bg: #FDF5E6; --green: #2F7D4F; --green-bg: #EAF5EE;
  --radius: 8px; --shadow: 0 1px 3px rgba(30,42,53,.08), 0 1px 2px rgba(30,42,53,.06);
  --font: 'Montserrat', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --s1: #B3542C; --s2: #D08A3A; --s3: #C9B458; --s4: #5E9E77; --s5: #2F7D4F;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--grey-light); font-size: 14px; line-height: 1.5; }
a { color: var(--teal-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--navy); font-weight: 600; line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; } h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
p { margin: 0 0 .75em; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* Layout */
.shell { display: flex; min-height: 100vh; }
.side { width: 232px; background: var(--navy); color: #cfd6dd; flex-shrink: 0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side .brand { padding: 20px 18px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.side .brand img { width: 150px; display: block; }
.side .brand .product { color: var(--gold); font-weight: 700; letter-spacing: .28em; font-size: 12px; margin-top: 8px; }
.side nav { padding: 10px 0; flex: 1; overflow-y: auto; }
.side nav a { display: block; padding: 9px 20px; color: #cfd6dd; font-weight: 500; border-left: 3px solid transparent; }
.side nav a:hover { background: var(--navy-light); text-decoration: none; color: #fff; }
.side nav a.active { border-left-color: var(--gold); color: #fff; background: var(--navy-light); }
.side .who { padding: 14px 18px; font-size: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.side .who form { display: inline; }
.side .who button { background: none; border: 0; color: var(--gold); cursor: pointer; padding: 0; font: inherit; }
.side .motto { font-size: 11px; color: #8996a3; margin-top: 6px; }
.main { flex: 1; min-width: 0; padding: 24px 28px 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.crumbs a { color: var(--muted); }

/* Client workspace tabs */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--grey); margin: 0 0 18px; flex-wrap: wrap; }
.tabs a { padding: 8px 12px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tabs a.active { color: var(--navy); border-bottom-color: var(--gold); }
.tabs a:hover { text-decoration: none; color: var(--navy); }

/* Cards and grids */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .shell { flex-direction: column; } .side { width: 100%; height: auto; position: static; }
  .side nav { display: flex; flex-wrap: wrap; } .side nav a { padding: 6px 10px; border-left: 0; }
  .main { padding: 16px; }
}
.stat { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.stat .v { font-size: 22px; font-weight: 700; color: var(--navy); }
.stat .l { font-size: 12px; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: 12px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.stack > * + * { margin-top: 10px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--grey); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--grey-light); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.total td { font-weight: 700; border-top: 2px solid var(--navy); }
.table-wrap { overflow-x: auto; }

/* Forms */
label { display: block; font-weight: 600; font-size: 12px; color: var(--navy); margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=url], select, textarea {
  width: 100%; padding: 7px 9px; border: 1px solid #c5ccd3; border-radius: 6px; font: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 70px; resize: vertical; }
textarea.tall { min-height: 160px; }
.field { margin-bottom: 12px; }
.help { font-size: 12px; color: var(--muted); margin-top: 3px; font-weight: 400; }
.check { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.check input { width: auto; }
.btn { display: inline-block; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--navy); background: var(--navy); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--navy-light); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--navy); }
.btn.secondary:hover { background: var(--grey-light); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.btn.danger { background: #fff; color: var(--rust); border-color: var(--rust); }
.btn.small { padding: 4px 9px; font-size: 12px; }
.inline-form { display: inline; }

/* Badges and status */
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; background: var(--grey); color: var(--ink); white-space: nowrap; }
.badge.gold { background: var(--gold-bg); color: var(--gold-dark); }
.badge.teal { background: var(--teal-bg); color: var(--teal-dark); }
.badge.rust { background: var(--rust-bg); color: var(--rust); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.green { background: var(--green-bg); color: var(--green); }
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; }
.flash.ok { background: var(--green-bg); color: var(--green); }
.flash.err { background: var(--rust-bg); color: var(--rust); }
.notice { background: var(--gold-bg); border-left: 3px solid var(--gold); padding: 10px 14px; border-radius: 4px; margin-bottom: 14px; }
.risk { background: var(--rust-bg); border-left: 3px solid var(--rust); padding: 10px 14px; border-radius: 4px; margin-bottom: 8px; }

/* Score chips and bars */
.score { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 24px; border-radius: 12px; font-weight: 700; font-size: 12px; color: #fff; padding: 0 8px; background: #9aa4ae; }
.score.s1 { background: var(--s1); } .score.s2 { background: var(--s2); } .score.s3 { background: var(--s3); color: var(--ink); } .score.s4 { background: var(--s4); } .score.s5 { background: var(--s5); }
.score.na { background: var(--grey); color: var(--muted); }
.bar { height: 8px; background: var(--grey); border-radius: 4px; overflow: hidden; min-width: 60px; }
.bar > span { display: block; height: 100%; background: var(--teal); }
.cov { font-size: 11px; color: var(--muted); }
.profile td { vertical-align: middle; }

/* Assessment item editor */
.item { border: 1px solid var(--grey); border-radius: var(--radius); background: #fff; margin-bottom: 10px; }
.item > summary { list-style: none; cursor: pointer; padding: 10px 14px; display: flex; gap: 10px; align-items: center; }
.item > summary::-webkit-details-marker { display: none; }
.item[open] > summary { border-bottom: 1px solid var(--grey); background: var(--grey-light); }
.item .body { padding: 14px; }
.item .code { font-size: 11px; color: var(--muted); font-weight: 600; width: 58px; flex-shrink: 0; }
.scale { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.scale label { display: flex; align-items: center; gap: 5px; border: 1px solid var(--grey); border-radius: 6px; padding: 5px 9px; font-weight: 500; cursor: pointer; margin: 0; }
.scale input { width: auto; margin: 0; }
.guide { font-size: 12px; background: var(--grey-light); border-radius: 6px; padding: 8px 10px; margin-bottom: 10px; }
.guide b { color: var(--navy); }
.diag { width: 100%; font-size: 13px; }
.diag td { padding: 4px 6px; }
.diag select { width: auto; padding: 3px 6px; }
.lens-head { margin: 18px 0 8px; display: flex; align-items: center; gap: 10px; }

/* Report */
.report { background: #fff; max-width: 860px; margin: 0 auto; padding: 40px 48px; box-shadow: var(--shadow); border-radius: var(--radius); }
.report header { border-bottom: 3px solid var(--gold); padding-bottom: 14px; margin-bottom: 24px; }
.report header img { width: 170px; }
.report h1 { font-size: 24px; margin-top: 16px; }
.report section { margin-bottom: 26px; page-break-inside: avoid; }
.report section h2 { border-bottom: 1px solid var(--grey); padding-bottom: 4px; }
.report ul { padding-left: 20px; margin: 0 0 .75em; } .report li { margin-bottom: 4px; }
.report footer { border-top: 1px solid var(--grey); padding-top: 10px; font-size: 11px; color: var(--muted); }
.draft-mark { color: var(--rust); font-weight: 700; letter-spacing: .1em; }
@media print {
  .side, .no-print, .tabs, .topbar, .crumbs { display: none !important; }
  .main { padding: 0; } body { background: #fff; }
  .report { box-shadow: none; padding: 0; max-width: none; }
}

/* Login */
.login { max-width: 380px; margin: 10vh auto; }
.login .brandbox { background: var(--navy); padding: 26px; border-radius: var(--radius) var(--radius) 0 0; text-align: center; }
.login .brandbox img { width: 180px; }
.login .brandbox .product { color: var(--gold); letter-spacing: .3em; font-weight: 700; margin-top: 10px; }
.login .card { border-radius: 0 0 var(--radius) var(--radius); }

.linkish{background:none;border:0;padding:0;color:inherit;text-decoration:underline;cursor:pointer;font:inherit}
