/* Upscale, understated look: ivory paper, charcoal ink, one restrained metallic
   accent (--brand, set per company), serif display type with a clean sans body. */
:root {
  /* Theme inputs; each company's Branding settings override these per page. */
  --brand: #8c6d3f; --on-brand: #fff; --bg: #f7f4ee; --night: #15130f;
  --night-ink: #ece6da; --night-muted: #9b9282; --night-2: #2a2620; --night-hover: #fff;
  --heading: "Cormorant Garamond", Georgia, serif; --body: "Jost", "Helvetica Neue", Arial, sans-serif;
  /* Derived from the theme so any background color stays coherent. */
  --panel: color-mix(in srgb, var(--bg) 30%, #fff); --ink: #1c1a17; --muted: #77705f;
  --line: color-mix(in srgb, var(--bg), #000 7%); --line-strong: color-mix(in srgb, var(--bg), #000 17%);
  --tint: color-mix(in srgb, var(--bg), #000 3%);
  --ok: #3f5f3a; --okbg: #eef2e8; --err: #8b2c23; --errbg: #f8ece9;
  font-family: var(--body); font-weight: 400; color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.55; font-size: 15px; }
body.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
main { padding: 44px 56px 56px; max-width: 1240px; width: 100%; }
body.bare main { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; }
a { color: var(--ink); text-decoration-color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand); }
h1, h2, h3 { font-family: var(--heading); font-weight: 500; letter-spacing: .01em; color: var(--ink); }
h1 { font-size: 2.4rem; line-height: 1.1; margin: 0 0 14px; }
h2 { font-size: 1.45rem; margin: 0 0 14px; }
.muted { color: var(--muted); } .small { font-size: .84rem; }
code { background: var(--tint); padding: 1px 5px; border-radius: 3px; font-size: .85em; }
.eyebrow, .navhead, .who, th { font-family: var(--body); text-transform: uppercase; letter-spacing: .14em; font-weight: 500; font-size: .68rem; }

/* Sidebar */
nav.side { background: var(--night); color: var(--night-ink); border-right: 1px solid var(--line); padding: 32px 22px 22px; display: flex; flex-direction: column; gap: 1px; position: sticky; top: 0; height: 100vh; }
nav.side .org { font-family: var(--heading); font-size: 1.5rem; line-height: 1.15; padding: 0 0 22px; margin-bottom: 18px; border-bottom: 1px solid var(--brand); letter-spacing: .02em; }
nav.side a { color: var(--night-ink); text-decoration: none; padding: 9px 0 9px 14px; border-left: 1px solid transparent; font-size: .9rem; letter-spacing: .03em; opacity: .82; }
nav.side a:hover { opacity: 1; color: var(--night-hover); }
nav.side a.on { opacity: 1; color: var(--night-hover); border-left-color: var(--brand); }
nav.side .navhead { color: var(--night-muted); padding: 26px 0 8px; }
nav.side .soon { font-size: .6rem; text-transform: uppercase; letter-spacing: .12em; color: var(--night-muted); margin-left: 6px; }
nav.side .me { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--night-2); font-size: .86rem; }
nav.side .me .muted { color: var(--night-muted); font-size: .78rem; }
nav.side .me .link { color: var(--night-ink); padding: 0; margin-top: 10px; font-size: .74rem; text-transform: uppercase; letter-spacing: .14em; }
nav.side .me .link:hover { color: var(--night-hover); }

/* Surfaces */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 2px; padding: 28px 32px; margin-bottom: 20px; }
.narrow { max-width: 540px; }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 10px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
section > h2 { margin-top: 8px; }

/* Forms */
label { display: block; margin-bottom: 16px; font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 500; color: var(--muted); }
label.check, label.inline { font-weight: 400; display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: .9rem; color: var(--ink); white-space: nowrap; }
input, select, textarea { font: inherit; font-size: .95rem; color: var(--ink); text-transform: none; letter-spacing: 0; width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 2px; background: #fff; margin-top: 6px; transition: border-color .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent); }
input[type=checkbox], input[type=radio] { width: auto; margin: 0; accent-color: var(--brand); }
input[type=color] { width: 64px; height: 40px; padding: 3px; }
textarea { resize: vertical; }
button, .button { font: inherit; font-size: .74rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 500; cursor: pointer; padding: 11px 22px; border-radius: 2px; border: 1px solid var(--ink); background: transparent; color: var(--ink); text-decoration: none; display: inline-block; transition: background .15s, color .15s, border-color .15s; }
button:hover, .button:hover { background: var(--ink); color: var(--panel); }
button.primary, .button.primary { background: var(--ink); border-color: var(--ink); color: #fbf8f2; }
button.primary:hover, .button.primary:hover { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
button.secondary { border-color: var(--line-strong); color: var(--muted); }
button.link { background: none; border: none; color: var(--brand); padding: 4px 6px; }
button.link:hover { background: none; color: var(--ink); }
.danger { color: var(--err) !important; }
.row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.row input { margin: 0; width: 200px; } .row .grow { flex: 1; width: auto; min-width: 0; } .row .num { width: 84px; } .row .mid { width: 150px; }
.row select { margin: 0; width: auto; }
.full { margin: 6px 0 12px; } .strong { font-weight: 500; font-family: var(--heading); font-size: 1.15rem; }
.ok, .error { padding: 12px 16px; border-left: 2px solid; font-size: .92rem; }
.ok { background: var(--okbg); color: var(--ok); } .error { background: var(--errbg); color: var(--err); }

/* Sign-in */
.auth { width: 420px; max-width: 100%; background: var(--panel); padding: 48px 44px; border: 1px solid var(--line); border-top: 2px solid var(--brand); }
.auth h1 { text-align: center; font-size: 2.2rem; }
.auth > p.muted:first-of-type { text-align: center; margin-bottom: 28px; }
.auth button { width: 100%; margin-top: 8px; }
body.bare { background: radial-gradient(ellipse at top, var(--panel), var(--bg) 60%); }
.auth .brandlogo { display: block; max-height: 80px; max-width: 70%; margin: 0 auto 18px; }

/* Tables & lists */
table.list { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); margin-bottom: 14px; }
table.list th, table.list td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { color: var(--muted); background: transparent; border-bottom: 1px solid var(--line-strong); }
table.list tr:last-child td { border-bottom: 0; }
table.list td a { text-decoration: none; font-weight: 500; }
tr.inactive td { color: #b3ab9c; }
.tabs { display: flex; gap: 28px; margin: 14px 0 22px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 10px 0; text-decoration: none; color: var(--muted); border-bottom: 1px solid transparent; margin-bottom: -1px; font-size: .74rem; text-transform: uppercase; letter-spacing: .14em; }
.tabs a.on { color: var(--ink); border-color: var(--brand); }

.pill { font-size: .62rem; text-transform: uppercase; letter-spacing: .12em; padding: 3px 9px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; border-radius: 0; }
.pill.self_assessment { border-color: #cdb98f; color: #7d6a3f; }
.pill.manager_assessment { border-color: #a9b4c0; color: #4d5a68; }
.pill.acknowledgement { border-color: #b9a9be; color: #634f69; }
.pill.completed { border-color: #a9b89f; color: var(--ok); }
ul.todo { list-style: none; padding: 0; margin: 0; } ul.todo li { padding: 14px 0; border-bottom: 1px solid var(--line); }
ul.todo li:last-child { border: 0; } ul.todo a { font-family: var(--heading); font-size: 1.2rem; text-decoration: none; }
.linkgrid, .tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 28px; }
.linkcard, .tile { background: var(--panel); border: 1px solid var(--line); padding: 20px 22px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, transform .15s; }
.linkcard strong, .tile strong { font-family: var(--heading); font-weight: 500; font-size: 1.25rem; }
.linkcard:hover, a.tile:hover { border-color: var(--brand); color: var(--ink); transform: translateY(-1px); }
.tile.off { opacity: .55; }

/* Review page */
ol.steps { display: flex; list-style: none; padding: 0; margin: 22px 0; gap: 0; counter-reset: s; border-bottom: 1px solid var(--line); }
ol.steps li { flex: 1; padding: 10px 0; font-size: .7rem; text-transform: uppercase; letter-spacing: .13em; color: var(--muted); counter-increment: s; border-bottom: 2px solid transparent; margin-bottom: -1px; }
ol.steps li::before { content: counter(s, upper-roman) ". "; font-family: var(--heading); font-size: .95rem; letter-spacing: 0; }
ol.steps li.done { color: var(--ink); } ol.steps li.on { color: var(--ink); border-color: var(--brand); font-weight: 500; }
.intro { background: transparent; border-left: 2px solid var(--brand); padding: 4px 0 4px 16px; font-family: var(--heading); font-size: 1.2rem; font-style: italic; color: #4a443a; }
.review-grid { display: grid; grid-template-columns: 1fr 280px; gap: 28px; align-items: start; }
.review-grid aside { position: sticky; top: 24px; }
.sect h2 { border-bottom: 1px solid var(--line-strong); padding-bottom: 10px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sect h2 .small { font-family: var(--body); font-size: .66rem; text-transform: uppercase; letter-spacing: .14em; color: var(--brand); }
.item { padding: 18px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border: 0; }
.item .q { margin-bottom: 10px; }
.item .q strong { font-weight: 500; font-size: 1rem; }
.target { font-size: .66rem; text-transform: uppercase; letter-spacing: .12em; border: 1px solid var(--line-strong); padding: 2px 8px; margin-left: 8px; color: var(--muted); }
.cols { display: grid; gap: 28px; } .cols.n2 { grid-template-columns: 1fr 1fr; }
.col .who { color: var(--muted); margin-bottom: 6px; }
.answer { white-space: pre-wrap; margin: 4px 0; }
.scale { display: flex; gap: 0; margin: 8px 0; border: 1px solid var(--line-strong); }
.scale label { margin: 0; flex: 1 1 0; min-width: 0; text-align: center; cursor: pointer; text-transform: none; letter-spacing: 0; color: var(--ink); border-right: 1px solid var(--line-strong); }
.scale label:last-child { border-right: 0; }
.scale input { position: absolute; opacity: 0; }
.scale span { display: block; padding: 6px 4px 2px; font-family: var(--heading); font-size: 1.25rem; font-weight: 500; }
.scale small { display: block; font-size: .62rem; line-height: 1.25; min-height: 2.5em; padding: 0 3px 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; hyphens: auto; }
.scale label:hover { background: var(--tint); }
.scale input:checked + span, .scale input:checked + span + small { background: var(--ink); color: #fbf8f2; }
.scale input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: -2px; }
.rating { display: inline-block; min-width: 1.6em; text-align: center; font-family: var(--heading); font-size: 1.15rem; font-weight: 600; color: var(--brand); border: 1px solid var(--brand); line-height: 1.3; margin-right: 4px; }
.score { border-top: 2px solid var(--brand); }
.score .big { font-family: var(--heading); font-size: 3.4rem; font-weight: 500; line-height: 1; margin: 8px 0 4px; }
.score .big .small { font-family: var(--body); font-size: .9rem; }
.score > div:nth-child(3) { font-family: var(--heading); font-style: italic; font-size: 1.15rem; color: var(--brand); }
table.mini { width: 100%; font-size: .82rem; margin-top: 14px; border-top: 1px solid var(--line); border-collapse: collapse; }
table.mini td { padding: 6px 0; border-bottom: 1px solid var(--line); } table.mini td:last-child { text-align: right; font-weight: 500; }
.actions { display: flex; gap: 10px; align-items: center; position: sticky; bottom: 0; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(4px); padding: 14px 0; border-top: 1px solid var(--line); }
.scaleguide summary { font-size: .74rem; text-transform: uppercase; letter-spacing: .14em; }
.scaleguide ul { margin: 12px 0 0; padding-left: 18px; }
.sectedit { border-left: 2px solid var(--brand); }
.itemedit { padding: 10px 0 4px 14px; border-top: 1px dashed var(--line); }
details summary { cursor: pointer; font-weight: 500; }

/* KPI rows, tables and signatures */
.kpirow { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; font-size: .9rem; }
.kpirow label.inline { margin: 0; font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
input.short { width: 110px; margin: 0; padding: 6px 8px; }
.variance { font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; border: 1px solid var(--line-strong); padding: 2px 8px; color: var(--muted); }
.tablewrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.grid th, table.grid td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
table.grid th { color: var(--muted); border-bottom-color: var(--line-strong); }
table.grid.edit td { padding: 2px; border: 1px solid var(--line); }
table.grid.edit input, table.grid.edit select { margin: 0; border: 0; padding: 8px; min-width: 110px; background: transparent; }
td.sig { font-family: var(--heading); font-style: italic; font-size: 1.3rem; }
.signline { flex: 1; margin: 0; min-width: 240px; } .signline input { margin: 0; flex: 1; min-width: 140px; }
.signoffform { margin-top: 12px; }
.item.k-field { padding: 10px 0; } .item.k-field .q { margin-bottom: 4px; }
.review-grid > * { min-width: 0; }
.cols > .col { min-width: 0; }
/* In two-column (self vs reviewer) layout the level names move below the buttons. */
.scale-label { display: none; margin: -2px 0 8px; font-style: italic; }
.cols.n2 .scale small { display: none; }
.cols.n2 .scale span { padding: 6px 4px; }
.cols.n2 .scale-label { display: block; }

/* Company branding */
nav.side .org img.logo { max-width: 100%; max-height: 72px; display: block; }
.logoprev { background: var(--night); padding: 18px; margin-bottom: 14px; }
.logoprev img { max-height: 72px; max-width: 100%; display: block; }

@media (max-width: 860px) {
  body.app { grid-template-columns: 1fr; }
  nav.side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-content: flex-start; align-items: center; gap: 2px 18px; padding: 18px 16px 14px; }
  nav.side .org { padding-bottom: 12px; margin-bottom: 6px; font-size: 1.3rem; }
  nav.side .navhead { width: 100%; padding: 10px 0 0; }
  nav.side .me { display: flex; align-items: center; gap: 12px; padding-top: 10px; margin-top: 8px; border-top: 1px solid var(--night-2); }
  nav.side .me form { margin-left: auto; } nav.side .me .link { margin: 0; }
  .actions { flex-wrap: wrap; }
  .scale small { display: none; } .scale span { padding: 8px 4px; } .scale-label { display: block; }
  nav.side .org { width: 100%; }
  nav.side a { padding: 6px 0; border-left: 0; }
  nav.side .me { width: 100%; }
  main { padding: 24px 16px; }
  h1 { font-size: 1.9rem; }
  .card { padding: 20px 18px; }
  .review-grid, .two, .cols.n2 { grid-template-columns: 1fr; }
  .review-grid aside { position: static; }
  ol.steps { flex-direction: column; }
}
@media print {
  body.app { display: block; } nav.side, .noprint, .actions, aside form, .signoffform { display: none !important; }
  .review-grid { display: block; } .card { break-inside: avoid; border-color: #ccc; }
  main { padding: 0; }
}

.scale span, .rating, .score .big, ol.steps li::before { font-variant-numeric: lining-nums; }

/* Branding page */
.brandgrid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.brandgrid aside { position: sticky; top: 24px; }
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.preset { margin: 0; border: 1px solid var(--line); padding: 12px; cursor: pointer; text-transform: none; letter-spacing: 0; font-size: .88rem; color: var(--ink); display: flex; flex-direction: column; gap: 8px; }
.preset input { position: absolute; opacity: 0; }
.preset:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.preset:has(input:focus-visible) { outline: 2px solid var(--brand); }
.swatch { display: flex; height: 28px; border: 1px solid var(--line); }
.swatch i { flex: 1; } .swatch i:first-child { flex: 1.4; }
.colors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.colors input[type=color] { width: 100%; height: 44px; }
.logofield .logoprev { min-height: 64px; display: flex; align-items: center; }
.logoprev.light { background: var(--panel); border: 1px solid var(--line); }
.eyebrow { margin-bottom: 8px; }
.preview { --pv-accent: #8c6d3f; --pv-side: #15130f; --pv-bg: #f7f4ee; display: grid; grid-template-columns: 120px 1fr; min-height: 300px; border: 1px solid var(--line); font-family: var(--pv-body); background: var(--pv-bg); font-size: 12px; overflow: hidden; }
.pv-side { background: var(--pv-side); color: var(--pv-side-ink); padding: 14px 10px; border-right: 1px solid color-mix(in srgb, var(--pv-bg), #000 8%); }
.pv-org { font-family: var(--pv-heading); font-size: 15px; line-height: 1.15; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--pv-accent); }
.pv-org img { max-width: 100%; max-height: 40px; display: block; }
.pv-link { padding: 4px 0 4px 8px; border-left: 1px solid transparent; opacity: .8; font-size: 11px; }
.pv-link.on { border-color: var(--pv-accent); opacity: 1; }
.pv-main { padding: 16px; }
.pv-h { font-family: var(--pv-heading); font-size: 22px; margin-bottom: 10px; color: #1c1a17; }
.pv-card { background: color-mix(in srgb, var(--pv-bg) 30%, #fff); border: 1px solid color-mix(in srgb, var(--pv-bg), #000 8%); padding: 12px; }
.pv-h2 { font-family: var(--pv-heading); font-size: 15px; }
.pv-body { color: #77705f; margin: 2px 0 8px; }
.pv-row { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.pv-rating { border: 1px solid var(--pv-accent); color: var(--pv-accent); font-family: var(--pv-heading); padding: 0 5px; }
.pv-btn { display: inline-block; background: var(--pv-accent); color: var(--pv-on-accent); padding: 6px 10px; font-size: 9px; text-transform: uppercase; letter-spacing: .12em; }
@media (max-width: 960px) { .brandgrid { grid-template-columns: 1fr; } .brandgrid aside { position: static; } .colors { grid-template-columns: 1fr; } }
/* The app's own wordmark on unbranded sign-in pages. */
.auth h1.wordmark { font-size: 3rem; font-weight: 500; letter-spacing: .32em; text-transform: uppercase; margin: 0 -0.32em 6px 0; }
