/* VIATechnik Appraisal System
   Brand palette: black, white, grey and VIATechnik red (#C7242B, sampled from the official logo).
   Brand variables (--accent, --text, --surface, --bg) can be overridden by /branding.css (HR settings). */
:root {
  --accent: #C7242B; --accent-dark: #A11C22; --accent-soft: #FBEAEB;
  --text: #141414; --surface: #FFFFFF; --bg: #F4F4F5;
  --ink-2: #262626; --muted: #52525B; --subtle: #71717A;
  --border: #E4E4E7; --border-strong: #A1A1AA; --row-hover: #FAFAFA; --head-bg: #FAFAFA;
  --side-bg: #0F0F10; --side-bg-2: #1A1A1C; --side-text: #D4D4D8; --side-muted: #8B8B93; --side-line: #27272A;
  --ok: #166534; --ok-bg: #E8F5EC; --warn: #8A4B00; --warn-bg: #FFF4DB;
  --bad: #A11C22; --bad-bg: #FDECEC; --info: #27272A; --info-bg: #EEEEF0; --focus: #C7242B;
  --shadow: 0 1px 2px rgba(15, 15, 16, .04), 0 1px 3px rgba(15, 15, 16, .06);
  --shadow-lift: 0 6px 18px rgba(15, 15, 16, .10);
  --radius: 12px; --radius-sm: 8px; --gap: 18px; --side-w: 264px;
  /* Charts: single series charcoal; ordinal stage ramp light grey -> charcoal -> near black
     (monotonic lightness, adjacent dE 24; values always shown as text with a table view). */
  --chart-1: #3F3F46; --phase-1: #A3A3A3; --phase-2: #5C5C5C; --phase-3: #1A1A1A;
  --chart-track: #EFEFF1; --chart-grid: #E4E4E7;
}
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; }
body { margin: 0; font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--text); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-dark); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 8px 12px; z-index: 60; }
.skip-link:focus { left: 8px; top: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; }

/* ---------------------------------------------------------------- App shell: sidebar + content */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--side-bg); color: var(--side-text); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 40; scrollbar-width: thin;
  scrollbar-color: var(--side-line) transparent; }
.brand { display: block; padding: 22px 22px 18px; border-bottom: 1px solid var(--side-line); text-decoration: none; }
.brand img { display: block; width: 168px; height: auto; }
.brand-sub { display: block; margin-top: 8px; color: var(--side-muted); font-size: .72rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; }
.side-nav { padding: 10px 12px 18px; flex: 1; }
.nav-group { margin: 18px 10px 6px; color: var(--side-muted); font-size: .7rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; }
.side-nav ul { list-style: none; margin: 0; padding: 0; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; margin: 1px 0; border-radius: var(--radius-sm);
  color: var(--side-text); text-decoration: none; font-size: .92rem; font-weight: 500; position: relative; }
.side-nav a:hover { background: var(--side-bg-2); color: #fff; }
.side-nav a[aria-current="page"] { background: var(--side-bg-2); color: #fff; font-weight: 600; }
.side-nav a[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 6px; bottom: 6px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent); }
.side-nav a[aria-current="page"] .nav-icon { color: var(--accent); }
.side-nav a:focus-visible { outline-offset: -2px; }
.nav-icon { width: 18px; height: 18px; flex: 0 0 18px; color: var(--side-muted); }
.nav-count { margin-left: auto; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700;
  border-radius: 999px; padding: 0 7px; line-height: 18px; }
.side-foot { border-top: 1px solid var(--side-line); padding: 14px 16px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: .85rem; letter-spacing: .02em; }
.who { min-width: 0; flex: 1; }
.who strong { display: block; color: #fff; font-size: .88rem; font-weight: 600; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.who span { display: block; color: var(--side-muted); font-size: .76rem; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.side-foot form { margin: 0; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-sm);
  border: 1px solid var(--side-line); background: transparent; color: var(--side-text); cursor: pointer; }
.icon-btn:hover { background: var(--side-bg-2); color: #fff; }
.icon-btn svg { width: 17px; height: 17px; }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 10px 28px;
  background: rgba(255, 255, 255, .94); border-bottom: 1px solid var(--border); }
.topbar-title { font-weight: 600; color: var(--muted); font-size: .9rem; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.top-link { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: .88rem; font-weight: 600;
  background: var(--surface); }
.top-link:hover { border-color: var(--border-strong); color: var(--text); }
.top-link svg { width: 16px; height: 16px; }
.top-link .nav-count { margin-left: 2px; }
.menu-toggle { display: none; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--radius-sm); padding: 6px 10px; font: inherit; font-weight: 600; cursor: pointer; color: var(--text); }
.menu-toggle svg { width: 18px; height: 18px; }
.topbar-logo { display: none; }
.topbar-logo img { height: 14px; width: auto; display: block; }
.env-banner { background: var(--text); color: #fff; text-align: center; font-size: .8rem; padding: 5px 12px;
  letter-spacing: .01em; }
.env-banner.emergency { background: var(--accent); font-weight: 700; }
.scrim { display: none; }

@media (max-width: 1000px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .js .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(86vw, var(--side-w)); transform: translateX(-102%);
    transition: transform .2s ease; box-shadow: none; }
  .js .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
  .js .scrim.open { display: block; position: fixed; inset: 0; background: rgba(15, 15, 16, .45); z-index: 35; }
  html:not(.js) .sidebar { position: static; height: auto; }
  .js .menu-toggle { display: inline-flex; }
  .topbar { padding: 10px 16px; }
  .topbar-logo { display: block; }
  .topbar-title { display: none; }
}

/* Simple layout (sign-in and other pages without navigation) */
.plain-top { background: var(--surface); border-bottom: 1px solid var(--border); }
.plain-top .inner { max-width: 1100px; margin: 0 auto; padding: 18px 20px; display: flex; align-items: center;
  justify-content: space-between; gap: 16px; }
.plain-top img { height: 18px; width: auto; display: block; }
.plain-top .tag { color: var(--muted); font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }

main { width: 100%; max-width: 1280px; margin: 0 auto; padding: 30px 28px 64px; }
.plain main { max-width: 1100px; }
h1 { font-size: 1.7rem; line-height: 1.25; margin: 0 0 6px; letter-spacing: -.015em; font-weight: 700; }
h2 { font-size: 1.15rem; margin: 28px 0 10px; letter-spacing: -.005em; }
h3 { font-size: 1rem; margin: 18px 0 8px; }
.lead { color: var(--muted); margin-top: 0; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; justify-content: space-between;
  margin-bottom: 22px; }
.page-head .lead { margin-bottom: 0; max-width: 72ch; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 700; color: var(--subtle);
  margin: 0 0 4px; }
.eyebrow a { color: var(--subtle); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px;
  margin-bottom: var(--gap); box-shadow: var(--shadow); }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush table { border-radius: var(--radius); }
.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.split { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* Messages */
.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.messages li { padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 8px; border: 1px solid var(--border);
  border-left: 4px solid; background: var(--surface); box-shadow: var(--shadow); }
.messages .success { background: var(--ok-bg); border-color: var(--ok); }
.messages .error { background: var(--bad-bg); border-color: var(--bad); }
.messages .warning { background: var(--warn-bg); border-color: var(--warn); }
.messages .info { background: var(--info-bg); border-color: var(--info); }
.notice { padding: 12px 16px; border-radius: var(--radius-sm); border-left: 4px solid var(--info); background: var(--info-bg);
  margin-bottom: 16px; }
.notice.warn { border-color: var(--warn); background: var(--warn-bg); }
.notice.bad { border-color: var(--bad); background: var(--bad-bg); }
.notice.ok { border-color: var(--ok); background: var(--ok-bg); }
.sample-banner { background: repeating-linear-gradient(45deg, var(--bad-bg), var(--bad-bg) 10px, #fff 10px, #fff 20px);
  border: 1px solid var(--bad); color: var(--bad); font-weight: 700; padding: 10px 14px; border-radius: var(--radius-sm);
  margin-bottom: 16px; }

/* Badges: text + icon glyph so status is never colour-only */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 999px;
  font-size: .76rem; font-weight: 700; border: 1px solid; white-space: nowrap; vertical-align: middle; letter-spacing: .01em; }
.badge::before { font-weight: 900; }
.badge.ok { color: var(--ok); background: var(--ok-bg); } .badge.ok::before { content: "✓"; }
.badge.warn { color: var(--warn); background: var(--warn-bg); } .badge.warn::before { content: "!"; }
.badge.bad { color: var(--bad); background: var(--bad-bg); } .badge.bad::before { content: "✕"; }
.badge.info { color: var(--info); background: var(--info-bg); } .badge.info::before { content: "●"; }
.badge.muted { color: var(--muted); background: #F4F4F5; } .badge.muted::before { content: "–"; }
.tag-provisional { color: var(--warn); font-weight: 700; } .tag-final { color: var(--ok); font-weight: 700; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: .92rem; }
caption { text-align: left; font-weight: 700; padding: 8px 0; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
thead th { background: var(--head-bg); font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--subtle);
  font-weight: 700;
  white-space: nowrap; }
tbody tr:hover { background: var(--row-hover); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.overdue td:first-child { box-shadow: inset 4px 0 0 var(--bad); }
.person { font-weight: 600; }
.row-actions { white-space: nowrap; }

/* Forms */
form.stack > * + * { margin-top: 14px; }
label, legend { font-weight: 600; display: block; margin-bottom: 4px; }
.hint { color: var(--muted); font-size: .88rem; margin: 2px 0 6px; font-weight: 400; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=datetime-local], input[type=url],
input[type=password], input[type=search], select, textarea { width: 100%; max-width: 640px; padding: 9px 12px;
  border: 1px solid #C9C9CF; border-radius: var(--radius-sm); font: inherit; background: #fff; color: var(--text);
  transition: border-color .12s ease, box-shadow .12s ease; }
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { border-color: var(--text); box-shadow: 0 0 0 3px rgba(199, 36, 43, .15); }
textarea { min-height: 110px; max-width: 100%; }
input[aria-invalid=true], select[aria-invalid=true], textarea[aria-invalid=true], fieldset[aria-invalid=true] {
  border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
.field-error { color: var(--bad); font-weight: 600; margin: 4px 0; }
.field-error::before { content: "⚠ "; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin: 0; }
.choice { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; margin: 4px 0; }
.choice input { margin-top: 4px; width: 18px; height: 18px; }
/* Long numeric rating scales (e.g. 1–5 in 0.25 steps): wrap the options in a row of chips */
.choices-inline { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 6px; }
.choices-inline .choice { margin: 0; padding: 4px 10px 4px 8px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); align-items: center; min-width: 4.5rem; cursor: pointer; }
.choices-inline .choice input { margin-top: 0; }
.choices-inline .choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.choices-inline .choice:focus-within { outline: 3px solid var(--focus); outline-offset: 1px; }
.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.inline > * { flex: 0 1 auto; }
.question { padding: 16px 0; border-bottom: 1px dashed var(--border); }
.question[hidden] { display: none; }
.required-mark { color: var(--bad); }
.matrix th, .matrix td { text-align: center; } .matrix th:first-child, .matrix td:first-child { text-align: left; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin: 0 0 18px; }
.filter-bar label { margin: 0; }
.filter-bar select { width: auto; min-width: 220px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--accent); background: var(--accent); color: #fff; font: inherit;
  font-size: .92rem; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.3;
  transition: background .12s ease, border-color .12s ease, box-shadow .12s ease; }
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; box-shadow: var(--shadow-lift); }
.btn.secondary { background: #fff; color: var(--text); border-color: #C9C9CF; }
.btn.secondary:hover { border-color: var(--text); color: var(--text); background: #fff; }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn.ghost:hover { background: #F4F4F5; border-color: var(--border-strong); color: var(--text); box-shadow: none; }
.btn.danger { background: var(--bad); border-color: var(--bad); }
.btn.small { padding: 4px 11px; font-size: .82rem; }
.btn[disabled], .btn[aria-disabled=true] { background: #D4D4D8; border-color: #D4D4D8; color: #52525B; cursor: not-allowed;
  box-shadow: none; filter: none; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }

.save-status { font-size: .9rem; font-weight: 600; padding: 4px 10px; border-radius: 6px; background: var(--bg); }
.save-status[data-state=saved] { color: var(--ok); } .save-status[data-state=dirty] { color: var(--warn); }
.save-status[data-state=error] { color: var(--bad); } .save-status[data-state=saving] { color: var(--info); }
.sticky-bar { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--border);
  padding: 10px 16px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
  margin: 16px -20px -20px; border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 -4px 12px rgba(16, 24, 40, .06); }

/* Timeline */
.timeline { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 10px 0 16px; counter-reset: step; }
.timeline li { counter-increment: step; padding: 6px 12px 6px 8px; border-radius: 999px; border: 1px solid var(--border);
  font-size: .85rem; background: #fff; }
.timeline li::before { content: counter(step); display: inline-block; width: 20px; height: 20px; text-align: center;
  border-radius: 50%; margin-right: 6px; background: var(--border); font-weight: 700; font-size: .78rem; line-height: 20px; }
.timeline li.done::before { content: "✓"; background: var(--ok); color: #fff; }
.timeline li.current { border-color: var(--accent); font-weight: 700; }
.timeline li.current::before { background: var(--accent); color: #fff; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
.kv dt { font-weight: 600; color: var(--muted); } .kv dd { margin: 0; }
.score-big { font-size: 2rem; font-weight: 800; }
.score-pct { font-size: 1.1rem; font-weight: 600; color: var(--muted); }
details > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.next-action { border-left: 4px solid var(--accent); background: var(--surface); padding: 12px 16px; border-radius: var(--radius-sm);
  margin-bottom: 16px; box-shadow: var(--shadow); }
.muted { color: var(--muted); }
.pagination { display: flex; gap: 12px; margin-top: 12px; align-items: center; }
footer.site-footer { color: var(--subtle); font-size: .78rem; padding: 18px 28px 26px; border-top: 1px solid var(--border);
  margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; }
.auth-box { max-width: 460px; margin: 56px auto; }
.auth-box.card { padding: 32px; border-top: 3px solid var(--accent); }
code, pre { background: #F4F4F5; padding: 1px 5px; border-radius: 4px; font-size: .88em;
  font-family: "Cascadia Code", Consolas, "SFMono-Regular", monospace; }
.mono { font-family: "Cascadia Code", Consolas, "SFMono-Regular", monospace; font-size: .85rem; }
pre { padding: 10px; overflow-x: auto; white-space: pre-wrap; }

/* ---------------------------------------------------------------- Dashboards */
.tiles { list-style: none; margin: 0 0 var(--gap); padding: 0; display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; position: relative; overflow: hidden; }
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--border); }
.tile-label { font-size: .72rem; font-weight: 700; color: var(--subtle); text-transform: uppercase; letter-spacing: .08em; }
.tile-value { font-size: 2rem; font-weight: 700; line-height: 1.15; color: var(--text); letter-spacing: -.02em; }
.tile-value-sm { font-size: 1.25rem; padding: 6px 0 4px; }
.tile-sub { font-size: .85rem; color: var(--muted); }
.tile-icon { display: inline-block; width: 18px; height: 18px; line-height: 18px; text-align: center; border-radius: 50%;
  font-size: .75rem; font-weight: 900; color: #fff; margin-right: 6px; vertical-align: 1px; }
.tile-alert::before { background: var(--accent); } .tile-alert .tile-icon { background: var(--accent); }
.tile-good::before { background: var(--ok); } .tile-good .tile-icon { background: var(--ok); }
.tile-accent::before { background: var(--accent); }
.dash-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 8px; }
.dash-grid > .card { margin-bottom: 0; }
@media (max-width: 960px) { .dash-grid { grid-template-columns: 1fr; } }
.chart-title { font-size: 1.05rem; margin: 0; }
.chart-subtitle { font-size: .95rem; margin: 16px 0 6px; }
.chart-sub { color: var(--muted); font-size: .88rem; margin: 2px 0 14px; }
.item-list { list-style: none; margin: 10px 0 0; padding: 0; }
.item-list li { padding: 9px 0; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 4px 8px;
  align-items: center; }
.item-list li:last-child { border-bottom: 0; }
.item-list .badge { margin-left: auto; }
.empty-state { color: var(--muted); margin: 12px 0 4px; }
.empty-state-card { text-align: center; padding: 36px 20px; }
.empty-state-card p { color: var(--muted); }

/* Horizontal bar charts: thin bars, value as text, recessive track, 2px gaps */
.hbar { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hbar-row { display: grid; grid-template-columns: minmax(110px, 34%) minmax(0, 1fr) auto; gap: 10px; align-items: center;
  font-size: .9rem; }
.hbar-label { color: var(--text); overflow-wrap: anywhere; }
.hbar-value { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 2ch; text-align: right; white-space: nowrap; }
.hbar-value .muted { font-weight: 400; }
.hbar-track { display: flex; gap: 2px; height: 14px; background: var(--chart-track); border-radius: 0 4px 4px 0;
  border-left: 1px solid var(--border-strong); }
.hbar-fill { display: block; height: 100%; background: var(--chart-1); border-radius: 0 4px 4px 0; }
.hbar-row:hover .hbar-fill, .hbar-row:hover .seg { opacity: .82; }
.seg { display: block; height: 100%; flex: 0 1 auto; min-width: 3px; }
.seg:last-child { border-radius: 0 4px 4px 0; }
.seg-not_started { background: var(--phase-1); }
.seg-in_progress { background: var(--phase-2); }
.seg-final { background: var(--phase-3); }
.hbar-stacked .hbar-track { background: transparent; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 12px; padding: 0; font-size: .85rem;
  color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.chart-table { margin-top: 12px; font-size: .9rem; }
.chart-table table { margin-top: 6px; }
@media (max-width: 600px) { .hbar-row { grid-template-columns: 1fr auto; } .hbar-track { grid-column: 1 / -1; grid-row: 2; } }
/* Bar widths (CSP forbids inline styles, so widths are classes w-0 … w-100) */
.w-0{width:0}.w-1{width:1%}.w-2{width:2%}.w-3{width:3%}.w-4{width:4%}.w-5{width:5%}.w-6{width:6%}.w-7{width:7%}.w-8{width:8%}.w-9{width:9%}
.w-10{width:10%}.w-11{width:11%}.w-12{width:12%}.w-13{width:13%}.w-14{width:14%}.w-15{width:15%}.w-16{width:16%}.w-17{width:17%}.w-18{width:18%}.w-19{width:19%}
.w-20{width:20%}.w-21{width:21%}.w-22{width:22%}.w-23{width:23%}.w-24{width:24%}.w-25{width:25%}.w-26{width:26%}.w-27{width:27%}.w-28{width:28%}.w-29{width:29%}
.w-30{width:30%}.w-31{width:31%}.w-32{width:32%}.w-33{width:33%}.w-34{width:34%}.w-35{width:35%}.w-36{width:36%}.w-37{width:37%}.w-38{width:38%}.w-39{width:39%}
.w-40{width:40%}.w-41{width:41%}.w-42{width:42%}.w-43{width:43%}.w-44{width:44%}.w-45{width:45%}.w-46{width:46%}.w-47{width:47%}.w-48{width:48%}.w-49{width:49%}
.w-50{width:50%}.w-51{width:51%}.w-52{width:52%}.w-53{width:53%}.w-54{width:54%}.w-55{width:55%}.w-56{width:56%}.w-57{width:57%}.w-58{width:58%}.w-59{width:59%}
.w-60{width:60%}.w-61{width:61%}.w-62{width:62%}.w-63{width:63%}.w-64{width:64%}.w-65{width:65%}.w-66{width:66%}.w-67{width:67%}.w-68{width:68%}.w-69{width:69%}
.w-70{width:70%}.w-71{width:71%}.w-72{width:72%}.w-73{width:73%}.w-74{width:74%}.w-75{width:75%}.w-76{width:76%}.w-77{width:77%}.w-78{width:78%}.w-79{width:79%}
.w-80{width:80%}.w-81{width:81%}.w-82{width:82%}.w-83{width:83%}.w-84{width:84%}.w-85{width:85%}.w-86{width:86%}.w-87{width:87%}.w-88{width:88%}.w-89{width:89%}
.w-90{width:90%}.w-91{width:91%}.w-92{width:92%}.w-93{width:93%}.w-94{width:94%}.w-95{width:95%}.w-96{width:96%}.w-97{width:97%}.w-98{width:98%}.w-99{width:99%}
.w-100{width:100%}
/* Hover tooltip (positioned by app.js via CSSOM, which CSP allows) */
.viz-tip { position: fixed; z-index: 50; pointer-events: none; background: var(--text); color: #fff; font-size: .82rem;
  font-weight: 600; padding: 5px 9px; border-radius: 6px; box-shadow: var(--shadow-lift); max-width: 280px; }
.viz-tip[hidden] { display: none; }
@media (forced-colors: active) {
  .hbar-fill, .seg { forced-color-adjust: none; background: CanvasText; }
  .seg-in_progress { background: GrayText; } .seg-not_started { background: Canvas; border: 1px solid CanvasText; }
}

/* Employee hero */
.hero-card { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 24px; }
.hero-top { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; align-items: flex-start; }
.hero-next { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center;
  background: var(--bg); border-radius: 8px; padding: 14px 16px; }
.hero-action { font-size: 1.1rem; font-weight: 700; margin: 0 0 2px; }

@media (max-width: 600px) {
  h1 { font-size: 1.35rem; } .card { padding: 14px; } .sticky-bar { margin: 12px -14px -14px; }
  .kv { grid-template-columns: 1fr; } .kv dt { margin-top: 6px; }
  main { padding: 20px 16px 48px; } .tile-value { font-size: 1.6rem; }
}
@media print { .sidebar, .topbar, .actions, .sticky-bar, .env-banner, .page-actions, .filter-bar { display: none; }
  .shell { display: block; } body { background: #fff; } .card, .tile, .hero-card { box-shadow: none; } }

/* Utility classes (no inline styles: CSP style-src 'self') */
.u-mt0 { margin-top: 0; } .u-mt8 { margin-top: 8px; } .u-mt12 { margin-top: 12px; } .u-mt20 { margin-top: 20px; }
.u-mt24 { margin-top: 24px; } .u-m0 { margin: 0; } .u-pre { white-space: pre-wrap; } .u-inline { display: inline; }
.u-w90 { width: 90px; } .u-pad { padding: 12px 16px; } .u-narrow { max-width: 760px; margin: 24px auto; }
.u-answer { margin: 2px 0 0; white-space: pre-wrap; } .u-plain-list { list-style: none; padding: 0; }
.u-semibold { font-weight: 600; }

/* Evaluation structure (HR) */
.card-pad { padding-left: 20px; padding-right: 20px; }
.card.flush > h2.card-pad { padding-top: 18px; }
.structure th[scope="row"] { font-weight: 400; text-align: left; }
.structure .person { display: block; font-weight: 600; }
.structure .branch { color: var(--border-strong); margin-right: 6px; }
.structure .lvl-1 { padding-left: 2rem; } .structure .lvl-2 { padding-left: 3.5rem; }
.structure .lvl-3 { padding-left: 5rem; } .structure .lvl-4 { padding-left: 6.5rem; }
.structure .lvl-5 { padding-left: 8rem; } .structure .lvl-6 { padding-left: 9.5rem; }
.structure .lvl-7 { padding-left: 11rem; } .structure .lvl-8 { padding-left: 12.5rem; }
@media (max-width: 640px) {
  .structure .lvl-1 { padding-left: 1rem; } .structure .lvl-2 { padding-left: 1.6rem; }
  .structure .lvl-3 { padding-left: 2.2rem; } .structure .lvl-4, .structure .lvl-5, .structure .lvl-6,
  .structure .lvl-7, .structure .lvl-8 { padding-left: 2.8rem; }
}
.plain-list { list-style: none; padding: 0; margin: 0 0 12px; }
.plain-list li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.plain-list li:last-child { border-bottom: 0; }
.chain ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 0 0 16px; }
.chain li + li::before { content: "→"; color: var(--muted); margin-right: 4px; }
.chain li[aria-current] { font-weight: 600; }

/* Template editors (email templates / system alerts) */
.editor-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: var(--gap); align-items: start; }
.editor-side { position: sticky; top: 72px; }
@media (max-width: 1100px) { .editor-layout { grid-template-columns: 1fr; } .editor-side { position: static; } }
.var-list { margin: 0; display: grid; gap: 2px 0; }
.var-list dt { margin-top: 8px; } .var-list dd { margin: 0; color: var(--muted); font-size: .84rem; }
.toc { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.toc li { padding: 5px 0; border-bottom: 1px solid var(--border); } .toc li:last-child { border-bottom: 0; }
.toc a { color: var(--text); text-decoration: none; } .toc a:hover { color: var(--accent); }
.template-card { scroll-margin-top: 80px; }
.template-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding-bottom: 14px;
  margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.template-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }
@media (max-width: 900px) { .template-body { grid-template-columns: 1fr; } }
.email-preview { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px;
  align-self: start; }
.email-meta { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; padding: 10px 12px; background: #fff;
  border: 1px solid var(--border); border-bottom: 0; border-radius: var(--radius-sm) var(--radius-sm) 0 0; font-size: .9rem; }
.email-meta span { color: var(--subtle); }
.email-text { background: #fff; border: 1px solid var(--border); padding: 14px 12px; font-size: .9rem; min-height: 120px; }
.email-footer { background: #fff; border: 1px solid var(--border); border-top: 1px dashed var(--border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm); padding: 10px 12px; font-size: .8rem; color: var(--subtle); }

/* System administration */
.problem-list { margin: 8px 0 0; padding-left: 20px; color: var(--bad); font-size: .9rem; }
.u-pt { padding-top: 20px; }
.env-group { margin: 22px 0 8px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.env-group .hint { margin: 0; font-weight: 400; }

/* ---------------------------------------------------------------- Sign-in page */
.auth-plain main { max-width: none; padding: 0; }
.auth-split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(380px, .85fr); min-height: calc(100vh - 28px); }
.auth-split > * { min-width: 0; }
.auth-hero { background: #0F0F10; color: #F4F4F5; position: relative; overflow: hidden; padding: 40px 48px 36px;
  display: flex; flex-direction: column; }
.auth-hero::after { content: ""; position: absolute; right: -120px; top: -120px; width: 360px; height: 360px;
  border-radius: 50%; background: radial-gradient(closest-side, rgba(199, 36, 43, .22), rgba(199, 36, 43, 0)); }
.auth-logo { width: 210px; height: auto; position: relative; z-index: 1; }
.auth-hero-copy { position: relative; z-index: 1; margin-top: 44px; max-width: 34rem; }
.auth-kicker { margin: 0 0 10px; color: #A1A1AA; font-size: .78rem; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; }
.auth-headline { margin: 0; font-size: clamp(1.9rem, 3.2vw, 2.7rem); line-height: 1.12; letter-spacing: -.025em;
  font-weight: 700; color: #fff; }
.auth-headline span { color: #E35A60; }
.auth-sub { color: #C4C4CC; font-size: 1.02rem; margin: 16px 0 0; max-width: 30rem; }
.auth-art { position: relative; z-index: 0; width: 100%; max-width: 620px; height: auto; max-height: calc(100vh - 420px);
  min-height: 220px; margin: 14px auto 0; display: block; flex: 1 1 auto; object-fit: contain; }
.auth-steps { position: relative; z-index: 1; list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap;
  gap: 8px; }
.auth-steps li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px;
  border: 1px solid #2E2E33; background: #17171A; color: #E4E4E7; font-size: .85rem; font-weight: 600; }
.auth-steps span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: .75rem; font-weight: 700; }
.auth-panel { background: var(--surface); display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 40px 32px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card-logo { display: none; width: 170px; height: auto; margin-bottom: 26px; }
.auth-card h1 { font-size: 1.85rem; margin-bottom: 6px; }
.auth-card .lead { margin-bottom: 26px; }
.ms-btn { width: 100%; justify-content: center; gap: 12px; padding: 12px 18px; font-size: 1rem; background: var(--text);
  border-color: var(--text); }
.ms-btn:hover { background: #000; border-color: #000; }
.ms-logo { display: inline-grid; grid-template-columns: 9px 9px; gap: 2px; }
.ms-logo i { display: block; width: 9px; height: 9px; background: #F25022; }
.ms-logo i:nth-child(2) { background: #7FBA00; } .ms-logo i:nth-child(3) { background: #00A4EF; }
.ms-logo i:nth-child(4) { background: #FFB900; }
.ms-btn[disabled] .ms-logo { filter: grayscale(1); opacity: .6; }
.auth-wide { width: 100%; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 14px; color: var(--subtle); font-size: .74rem;
  font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-assure { list-style: none; padding: 18px 0 0; margin: 24px 0 0; border-top: 1px solid var(--border); display: grid;
  gap: 10px; color: var(--muted); font-size: .86rem; }
.auth-assure li { display: flex; gap: 10px; align-items: flex-start; }
.auth-assure svg { width: 18px; height: 18px; flex: 0 0 18px; color: var(--accent); margin-top: 1px; }
.auth-emergency { margin-top: 18px; }
.auth-foot { margin: 28px 0 0; color: var(--subtle); font-size: .78rem; }
@media (max-width: 900px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-hero { padding: 26px 22px 22px; }
  .auth-hero-copy { margin-top: 22px; }
  .auth-art { max-height: 240px; }
  .auth-panel { padding: 30px 20px 40px; }
}
.env-table { table-layout: fixed; min-width: 720px; }
.env-table th:nth-child(1) { width: 26%; } .env-table th:nth-child(2) { width: 38%; }
.env-table th:nth-child(3) { width: 24%; } .env-table th:nth-child(4) { width: 12%; }
.env-table td, .env-table th { overflow-wrap: anywhere; }
.page-head .filter-bar { margin: 0; flex-wrap: nowrap; }
.page-head .filter-bar input[type=search] { width: 260px; }
@media (max-width: 600px) {
  .top-link-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .top-link { padding: 6px 10px; } .menu-toggle span { display: none; } .topbar { gap: 8px; }
}

/* Eligibility: narrow number inputs (months) */
input.input-narrow { width: 6.5rem; }

/* Emergency HR credentials page: long otpauth URI */
code.wrap { word-break: break-all; }

/* Role preview banner */
.env-banner.preview { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; background: #FDECEC; color: #7A1116; border-bottom: 2px solid var(--brand, #C7242B); }
.env-banner.preview form { margin: 0; }
.preview-group + .preview-group { margin-top: 20px; }
.preview-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.preview-people li { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid var(--border, #E4E4E7); border-radius: 10px; padding: 10px 12px; }
.preview-people form { margin: 0; }
