/* Inter, self-hosted (CSP blocks CDNs). Variable font: one file per subset covers 400-800. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* RixMind palette — matches the PMO portal / mydesk (#0054FF primary) */
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #0054ff;
  --accent-dark: #0047d6;
  --accent-ghost: #e8f0ff;
  --hover: #f3f5f8;
  --danger: #d92d20;
  --danger-bg: #fdecea;
  --ok: #16a34a;
  --ok-bg: #e7f6ec;
  --warn-ink: #7a5c00;
  --warn-bg: #fdf3d7;
  --warn-line: #e5c14c;
  /* mydesk aliases so ported shell CSS reads naturally */
  --ink: var(--text);
  --line: var(--border);
  --card: var(--surface);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
  --sidebar-w: 236px;
  --sidebar-w-min: 68px;
  /* Page gutter — one knob for the density of every screen. */
  --gutter: 1.15rem;
}

/* Collapsed sidebar: one variable drives both the aside and the content offset. */
html[data-nav="collapsed"] { --sidebar-w: var(--sidebar-w-min); }

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 0.55rem; }
h2 { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; margin: 0.9rem 0 0.4rem; }

/* ---------- App shell ---------- */

.shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 0.9rem 0.7rem 0.8rem;
  z-index: 30;
  transition: width 0.14s ease;
}

.brandrow { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.brand { display: inline-block; text-decoration: none; }
.brandlogo { height: 24px; width: auto; display: block; }

/* Collapse control — desktop only; on mobile the drawer checkbox takes over. */
.navcollapse {
  display: flex; align-items: center; justify-content: center;
  flex: none;
  width: 26px; height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.navcollapse:hover { background: var(--hover); color: var(--text); }
.navcollapse svg { width: 16px; height: 16px; transition: transform 0.14s ease; }
html[data-nav="collapsed"] .navcollapse svg { transform: rotate(180deg); }
.applabel {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.sidebar .brand { padding: 0.15rem 0.4rem 0.4rem; }

.cyclelabel {
  display: block;
  padding: 0 0.5rem 0.6rem;
  margin-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.sidenav { display: flex; flex-direction: column; gap: 0.1rem; flex: 1; overflow-y: auto; }
.navlink {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.navlink svg { width: 18px; height: 18px; flex: none; }
.navlink:hover { background: var(--hover); color: var(--text); }
.navlink.active { background: var(--accent-ghost); color: var(--accent); font-weight: 600; }

.navsection {
  margin: 0.8rem 0 0.3rem;
  padding: 0.45rem 0.6rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.sidefoot { border-top: 1px solid var(--border); padding-top: 0.6rem; margin-top: 0.6rem; }
.userchip { display: flex; align-items: center; gap: 0.55rem; padding: 0 0.3rem 0.45rem; min-width: 0; }
.avatar {
  flex: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-ghost);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
}
.username { font-weight: 600; font-size: 0.88rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.signout {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.signout svg { width: 16px; height: 16px; flex: none; }
.signout:hover { background: var(--hover); color: var(--text); }

/* ---------- Collapsed sidebar (desktop) ---------- */

html[data-nav="collapsed"] .sidebar { padding-left: 0.5rem; padding-right: 0.5rem; }
html[data-nav="collapsed"] .applabel,
html[data-nav="collapsed"] .navlink .label,
html[data-nav="collapsed"] .username,
html[data-nav="collapsed"] .signout span,
html[data-nav="collapsed"] .cyclelabel,
html[data-nav="collapsed"] .navsection { display: none; }
html[data-nav="collapsed"] .brandrow { flex-direction: column; align-items: center; gap: 0.5rem; }
html[data-nav="collapsed"] .sidebar .brand { padding: 0.15rem 0 0.3rem; }
html[data-nav="collapsed"] .brandlogo { height: 22px; }
html[data-nav="collapsed"] .navlink,
html[data-nav="collapsed"] .signout { justify-content: center; padding-inline: 0.4rem; }
html[data-nav="collapsed"] .userchip { justify-content: center; padding-inline: 0; }
/* The section rule still separates the groups, just without its caption. */
html[data-nav="collapsed"] .navsection {
  display: block;
  font-size: 0;
  margin: 0.5rem 0.25rem 0.35rem;
  padding: 0;
}

/* ---------- Content and sub-navigation ---------- */

.content { margin-left: var(--sidebar-w); transition: margin-left 0.14s ease; }
.content.solo { margin-left: 0; }
.page { padding: var(--gutter) var(--gutter) 2rem; }
.content.solo .page { max-width: 900px; margin: 0 auto; }

/* Sections *inside* the active sidebar tab live here, not in the sidebar. */
.subbar {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0 var(--gutter);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.subtab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.subtab:hover { color: var(--text); }
.subtab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.navtoggle { display: none; }
.mobilebar { display: none; }
.backdrop { display: none; }

/* ---------- Cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.8rem 0.95rem;
  margin-bottom: 0.65rem;
}

.login-card {
  max-width: 420px;
  margin: 12vh auto 0;
  text-align: center;
  padding: 2.2rem 1.6rem;
}

.muted { color: var(--muted); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: var(--hover); border-color: var(--accent); color: var(--accent); }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }

.btn-sm { padding: 0.25rem 0.6rem; font-size: 0.8rem; }

.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b42318; border-color: #b42318; color: #fff; }

.card.danger { border-color: var(--danger); background: var(--danger-bg); }

/* ---------- Forms ---------- */

label { display: block; margin: 8px 0 3px; font-weight: 500; text-align: left; }

input[type="text"], input[type="email"], input[type="date"],
input[type="number"], select, textarea {
  width: 100%;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  margin-bottom: 8px;
  background: var(--surface);
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ghost);
}
input[type=checkbox] { width: auto; accent-color: var(--accent); }

textarea { min-height: 84px; resize: vertical; }

/* ---------- Flash ---------- */

.flash {
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.6rem;
  border: 1px solid var(--border);
  font-weight: 500;
}
.flash-success { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.flash-error { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); }

/* ---------- Tables ---------- */

table.list {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  overflow: hidden;
}

table.list th, table.list td {
  padding: 0.35rem 0.55rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}
table.list tr:last-child td { border-bottom: none; }
table.list tbody tr:hover td { background: var(--hover); }

table.list th { font-size: 12px; color: var(--muted); font-weight: 600; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--muted);
  vertical-align: middle;
}

.badge-draft { color: var(--muted); }
.badge-snapshot_ready { color: var(--accent); border-color: var(--accent); }
.badge-launched { color: var(--ok); border-color: var(--ok); }
.badge-closed, .badge-decided { color: #7c3aed; border-color: #7c3aed; }
.badge-pm { color: var(--accent); border-color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}
.chip-pod_lead { border-color: #0f766e; color: #0f766e; font-weight: 600; }
.chip-pm { border-color: var(--accent); color: var(--accent); }
.chip-bdm { border-color: #7c3aed; color: #7c3aed; }
.chip-dd { border-color: var(--border); color: var(--muted); }
.chip-manual { border-style: dashed; font-weight: 600; }

/* Tenure "generation" pills on the summary (§10.6) — sequential tint by band */
.tenure-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.tenure-new         { background: var(--hover);        color: var(--muted);       border-color: var(--border); }
.tenure-established { background: var(--ok-bg);        color: #15803d;            border-color: #b7e2c4; }
.tenure-senior      { background: var(--accent-ghost); color: var(--accent-dark); border-color: #c3d8ff; }
.tenure-veteran     { background: #f3e8ff;             color: #7c3aed;            border-color: #e0c9ff; }

.warn-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid #b45309;
  color: #b45309;
}

.chip-x {
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
  font-weight: 700;
  padding: 0 0 0 5px;
  line-height: 1;
}
.chip-x:hover { color: var(--danger); }

.addrev { display: inline-flex; gap: 4px; align-items: center; }
.addrev input { width: 170px; margin: 0; padding: 4px 8px; }
.addrev select { width: auto; margin: 0; padding: 4px 6px; }

.checklist { list-style: none; padding: 0; margin: 0 0 12px; }
.checklist li { padding: 1px 0; }
.chk-ok { color: var(--ok); }
.chk-no { color: var(--danger); }

/* Reviewer home */
.reviewlist { display: flex; flex-direction: column; gap: 6px; }
.reviewcard {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 9px 13px; text-decoration: none; color: var(--text);
}
.reviewcard:hover { border-color: var(--accent); }
.reviewcard.is-submitted { opacity: .7; }
.rc-main { display: flex; align-items: center; gap: 10px; min-width: 230px; }
.rc-name { font-weight: 600; }
.rc-meta { flex: 1; font-size: 13px; }
.statuschip {
  font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted); white-space: nowrap;
}
.status-in_progress { color: var(--accent); border-color: var(--accent); }
.status-submitted { color: var(--ok); border-color: var(--ok); }

/* Progress bars — native <progress>, no inline styles (CSP-safe) */
.progcell { display: flex; align-items: center; gap: 8px; }
.progtext { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
progress.pbar {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  width: 120px; height: 8px; border: none; border-radius: 999px;
  background: var(--hover); overflow: hidden; vertical-align: middle;
}
progress.pbar::-webkit-progress-bar { background: var(--hover); border-radius: 999px; }
progress.pbar::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress.pbar::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
progress.pbar.done::-webkit-progress-value { background: var(--ok); }
progress.pbar.done::-moz-progress-bar { background: var(--ok); }
progress.pbar-lg { width: 100%; height: 12px; }

.progsummary { display: flex; gap: 20px; flex-wrap: wrap; }
.bigprog { flex: 1; min-width: 220px; }
.bigprog-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.ok-text { color: var(--ok); }

/* Utilization traffic light vs role target (Delivery 75%, PM 65%) */
td.util-good { color: var(--ok); font-weight: 700; }
td.util-warn { color: var(--warn-ink); font-weight: 700; }
td.util-bad { color: var(--danger); font-weight: 700; }

.selfcta { display: flex; align-items: center; justify-content: space-between; gap: 14px; }

/* Review page */
.qblock {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 11px 13px; margin-bottom: 8px;
}
.qblock.qmissing { border-color: var(--danger); }
.qtitle { font-weight: 600; margin-bottom: 2px; }
.qprobe { font-size: 12.5px; margin-bottom: 7px; }
.req { color: var(--danger); }
.qradios { display: flex; flex-wrap: wrap; gap: 5px 16px; margin-top: 5px; }
.scaleopt { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; cursor: pointer; }
.scaleopt .scalenum { font-weight: 700; }
.scaleopt.na { color: var(--muted); }
#reviewform textarea { min-height: 74px; }

table.list select[data-member-role] {
  width: auto;
  margin: 0;
  padding: 4px 8px;
}
table.list select.saved { border-color: var(--ok); }

.actionlog {
  background: #10151d;
  color: #d3dae4;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 13px;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 10px;
  max-height: 260px;
  overflow-y: auto;
}

.log-warn { color: #eab308; }
.log-error { color: #f87171; }

.row-excluded td { color: var(--muted); text-decoration: line-through; }
.row-excluded td:nth-child(5) { text-decoration: none; }

.formrow { display: flex; gap: 10px; flex-wrap: wrap; }
.formrow > div { flex: 1 1 160px; }
/* a row ending in a bare button, so it lines up with the field beside it rather
   than with that field's label. Lives here, not in a style="" attribute: this
   app's CSP is default-src 'self', which blocks those too. */
.formrow-end { align-items: flex-end; }
.formrow-end > div:last-child { margin-bottom: 8px; }
select.wide { min-width: 260px; }

.actions { display: flex; gap: 7px; flex-wrap: wrap; }
/* a form that is only a wrapper around one button, sitting in a line of
   links. A class, not style="display:inline" -- CSP drops that. */
.inline-form { display: inline; }

/* KPI + manual-hours entry */
.tablescroll { overflow-x: auto; }
table.list th.num, table.list td.num { text-align: right; }
/* `table.` prefix is required: the generic `table.list th, table.list td` rule
   is more specific (0,1,2) than a bare `.kpigrid td` (0,1,1) and would win. */
table.kpigrid td, table.manualgrid td { padding: 2px 5px; }
.kpigrid input, .manualgrid input { margin: 0; }
.kpicell { min-width: 92px; }
.kpicell input[type="number"] { padding: 5px 6px; text-align: right; }
.kpinote {
  margin-top: 3px !important;
  padding: 3px 6px !important;
  font-size: 12px;
  color: var(--muted);
}
.manualgrid td.num input { width: 110px; text-align: right; padding: 5px 6px; }
.addperiod { display: inline-flex; gap: 6px; align-items: center; margin-bottom: 12px; }
.addperiod input { width: 220px; margin: 0; padding: 6px 8px; }
/* Period column reorder controls */
.period-ctl { display: inline-flex; gap: 1px; margin-right: 4px; vertical-align: middle; }
.period-move {
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  cursor: pointer; border-radius: 5px; width: 18px; height: 18px; line-height: 1;
  font-size: 13px; padding: 0; font-family: inherit;
}
.period-move:hover { color: var(--accent); border-color: var(--accent); }
.savestate { font-weight: 600; margin-left: 6px; }
.savestate.saving { color: var(--muted); }
.savestate.ok { color: var(--ok); }
.savestate.err { color: var(--danger); }

/* Summary cockpit */
.summarytbl { font-size: 12px; white-space: nowrap; }
table.summarytbl th, table.summarytbl td { padding: 3px 6px; }
.summarytbl .chips { flex-wrap: nowrap; }
.comp-col { background: #faf6ff; }
.dc-col { background: #f2f9f4; }
.dc-caveat { border-left: 3px solid var(--accent); padding-left: 8px; }

/* Summary colour bands (higher is better): green / neutral / amber / red text.
   'ok' is the neutral middle and is intentionally left unstyled. */
.mark-good { color: var(--ok); font-weight: 700; }
.mark-warn { color: var(--warn-ink); font-weight: 700; }
.mark-bad  { color: var(--danger); font-weight: 700; }

/* Highlighted KPI columns (Client mentions, CIP/SIP) */
.kpi-highlight { background: #fff7d6; }

/* DC € four-segment pill (loss/low/mid/high) — reuses .tenure-pill base */
.dcband-loss { background: var(--danger-bg);   color: #b42318;         border-color: #f4b8b0; }
.dcband-low  { background: var(--warn-bg);      color: var(--warn-ink); border-color: var(--warn-line); }
.dcband-mid  { background: var(--accent-ghost); color: var(--accent-dark); border-color: #c3d8ff; }
.dcband-high { background: var(--ok-bg);        color: #15803d;         border-color: #b7e2c4; }

/* Salary-age pill */
.stale-fresh { background: var(--ok-bg);      color: #15803d;         border-color: #b7e2c4; }
.stale-aging { background: var(--warn-bg);    color: var(--warn-ink); border-color: var(--warn-line); }
.stale-stale { background: var(--danger-bg);  color: #b42318;         border-color: #f4b8b0; }

/* Keep the Name column visible when the wide summary table scrolls right.
   overflow:hidden on table.list would trap the sticky against the table itself,
   so the summary table opts out of that clip. */
table.summarytbl { overflow: visible; }
.summarytbl th:first-child, .summarytbl td:first-child {
  position: sticky; left: 0; z-index: 1;
  background: var(--surface);
  box-shadow: 1px 0 0 var(--border);
}
.summarytbl thead th:first-child { z-index: 3; }
.summarytbl tbody tr:hover td:first-child { background: var(--hover); }
.badge-decision-open { color: var(--muted); }
.badge-decision-drafted { color: var(--accent); border-color: var(--accent); }
.badge-decision-confirmed { color: var(--ok); border-color: var(--ok); }
.npcell { font-weight: 600; }
.np-yes { color: var(--ok); margin-right: 4px; }
.np-res { color: #b45309; margin-right: 4px; }
.np-no { color: var(--danger); }
.spark { color: var(--accent); vertical-align: middle; margin-left: 3px; }
.linklike {
  border: none; background: none; color: var(--accent); cursor: pointer;
  font: inherit; padding: 0; text-decoration: underline;
}

/* Self-eval drawer */
.drawer {
  position: fixed; top: 0; right: 0; width: min(460px, 92vw); height: 100%;
  background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: -4px 0 18px rgba(0,0,0,.12); padding: 24px 26px; overflow-y: auto;
  z-index: 40;
}
.drawer h3 { margin-top: 0; }
.drawer h4 { margin: 14px 0 2px; font-size: 14px; }
.drawer p { margin: 0 0 4px; white-space: pre-wrap; }
.drawer-close {
  position: absolute; top: 10px; right: 14px; border: none; background: none;
  font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted);
}
.drawer-bg { position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 39; }

/* Member detail page */
.detail-grid { display: grid; grid-template-columns: 1fr 360px; gap: 11px; align-items: start; }
.detail-side { position: sticky; top: 16px; }
.comp-card { border-color: #c4a8f0; }
.reviewblock { border-top: 1px solid var(--border); padding: 8px 0; }
.rb-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rb-scores { margin: 8px 0; display: flex; flex-wrap: wrap; gap: 5px; }
.rb-notes p { margin: 4px 0; }
.scorepill {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px;
  border: 1px solid var(--border); color: var(--muted); background: var(--bg);
}
.auditfilter { display: flex; gap: 8px; margin-bottom: 14px; }
.auditfilter input { width: 280px; margin: 0; }

/* ---------- Mobile ---------- */

@media (max-width: 840px) {
  .mobilebar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    padding: 0 0.8rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    z-index: 20;
  }
  .mobilebar .brandlogo { height: 22px; }
  .navbtn {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
  }
  .navbtn svg { width: 22px; height: 22px; }
  .navbtn:hover { background: var(--hover); }

  .sidebar { transform: translateX(-100%); transition: transform 0.18s ease; box-shadow: none; }
  .navtoggle:checked ~ .sidebar { transform: translateX(0); box-shadow: 0 8px 30px rgba(16, 24, 40, 0.18); }
  .navtoggle:checked ~ .backdrop {
    display: block;
    position: fixed; inset: 0;
    background: rgba(17, 24, 39, 0.35);
    z-index: 25;
    cursor: pointer;
  }

  .content, html[data-nav="collapsed"] .content { margin-left: 0; }
  .page { padding: calc(56px + 0.75rem) 0.85rem 2rem; }
  .content.solo .page { padding-top: 0.85rem; }
  .card { padding: 0.8rem 0.9rem; }

  /* The drawer is always full width with its labels: the collapse preference is
     a desktop space trade-off, and honouring it here would leave the slide-out
     menu as a column of unlabelled icons. The toggle itself is hidden — the
     hamburger owns the drawer on mobile. */
  html[data-nav="collapsed"] .sidebar { width: 236px; padding-inline: 0.7rem; }
  html[data-nav="collapsed"] .applabel,
  html[data-nav="collapsed"] .navlink .label,
  html[data-nav="collapsed"] .username,
  html[data-nav="collapsed"] .signout span,
  html[data-nav="collapsed"] .cyclelabel { display: revert; }
  html[data-nav="collapsed"] .navsection {
    display: block;
    font-size: 0.66rem;
    margin: 0.8rem 0 0.3rem;
    padding: 0.45rem 0.6rem 0;
  }
  html[data-nav="collapsed"] .brandrow { flex-direction: row; align-items: flex-start; }
  html[data-nav="collapsed"] .sidebar .brand { padding: 0.15rem 0.4rem 0.4rem; }
  html[data-nav="collapsed"] .navlink,
  html[data-nav="collapsed"] .signout { justify-content: flex-start; padding-inline: 0.6rem; }
  html[data-nav="collapsed"] .userchip { justify-content: flex-start; padding-inline: 0.3rem; }
  .navcollapse { display: none; }
}

@media (max-width: 820px) {
  .detail-grid { grid-template-columns: 1fr; }
  .detail-side { position: static; }
}

/* ── My delivery contribution (/my-dc) ─────────────────────────────────────
   The employee's own DC. Three figures at most and no table: everything else a
   DC page could show — per-hour, cost rate, cohort median, band — inverts to a
   salary, theirs or a colleague's, so there is deliberately little here to
   style. */
.mydc-head { display: flex; flex-wrap: wrap; gap: 1.6rem 2.4rem; align-items: flex-end; }
.mydc-figure { min-width: 0; }
.mydc-label {
  font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 2px;
}
.mydc-big { font-size: 2rem; font-weight: 700; line-height: 1.15; }
/* A negative month is a real outcome, not an error — assumed revenue that did
   not cover a share of loaded cost. Marked, not alarmed. */
.mydc-neg { color: var(--danger); }

.mydc-preview {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
}
.mydc-narrow { max-width: 520px; }
.mydc-passcode { max-width: 240px; }

.mydc-bar {
  position: relative; height: 10px; border-radius: 999px;
  background: var(--hover); border: 1px solid var(--border); overflow: hidden;
}
.mydc-bar-fill {
  display: block; height: 100%; background: var(--accent); border-radius: 999px;
}
.mydc-bar-fill.is-over { background: var(--ok); }
/* Width comes from an enumerated class, for the same CSP reason. A block-level
   span with no width fills its parent, so the missing style="" did not render an
   empty bar -- it rendered a FULL one at every attainment, which is the one
   failure mode a bar about somebody's own pay must not have. Rounded to 5%: the
   exact figure is printed above the bar, so the bar only carries the shape. */
.mydc-bar-fill.mydc-w0 { width: 0%; }
.mydc-bar-fill.mydc-w5 { width: 5%; }
.mydc-bar-fill.mydc-w10 { width: 10%; }
.mydc-bar-fill.mydc-w15 { width: 15%; }
.mydc-bar-fill.mydc-w20 { width: 20%; }
.mydc-bar-fill.mydc-w25 { width: 25%; }
.mydc-bar-fill.mydc-w30 { width: 30%; }
.mydc-bar-fill.mydc-w35 { width: 35%; }
.mydc-bar-fill.mydc-w40 { width: 40%; }
.mydc-bar-fill.mydc-w45 { width: 45%; }
.mydc-bar-fill.mydc-w50 { width: 50%; }
.mydc-bar-fill.mydc-w55 { width: 55%; }
.mydc-bar-fill.mydc-w60 { width: 60%; }
.mydc-bar-fill.mydc-w65 { width: 65%; }
.mydc-bar-fill.mydc-w70 { width: 70%; }
.mydc-bar-fill.mydc-w75 { width: 75%; }
.mydc-bar-fill.mydc-w80 { width: 80%; }
.mydc-bar-fill.mydc-w85 { width: 85%; }
.mydc-bar-fill.mydc-w90 { width: 90%; }
.mydc-bar-fill.mydc-w95 { width: 95%; }
.mydc-bar-fill.mydc-w100 { width: 100%; }
.mydc-bar-note { margin: 0.45rem 0 0 !important; }

.mydc-chart { display: block; width: 100%; overflow: visible; }
.mydc-rect { fill: var(--accent); }
.mydc-rect.is-neg { fill: var(--danger); }
/* Portfolio bars are a different colour from personal ones on purpose: the two
   charts must not read as one series split across two cards. */
.mydc-rect.mydc-managed { fill: var(--muted); }
.mydc-rect.mydc-managed.is-neg { fill: var(--danger); }
.mydc-sep { margin: 0 0 0.9rem; }
.mydc-zero { stroke: var(--border); stroke-width: 1; }
/* The period average. Dash lengths run along the path, so they scale with the
   card; the stroke width is perpendicular to a horizontal line and therefore
   scales with y, which is 1:1. */
.mydc-avg { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 6 5; fill: none; }
.mydc-avg-key {
  font-size: 12px; font-weight: 400; color: var(--muted);
  margin-left: 10px; white-space: nowrap;
}
.mydc-avg-swatch {
  display: inline-block; width: 22px; margin-right: 5px;
  border-top: 2px dashed var(--muted); vertical-align: middle;
}
/* Flex with equal-basis items, not `grid-template-columns: repeat(N, 1fr)`:
   N is per-render, and a per-render value can only travel in a style="" attribute,
   which our own default-src 'self' CSP drops. `flex: 1 1 0` gives the identical
   equal columns with nothing to interpolate. */
.mydc-axis { display: flex; gap: 0; margin-top: 6px; }
.mydc-tick {
  flex: 1 1 0;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  font-size: 11px; text-align: center; min-width: 0;
}
.mydc-tick-v { font-weight: 600; }

@media (max-width: 720px) {
  .mydc-head { gap: 1rem 1.6rem; }
  .mydc-big { font-size: 1.55rem; }
  .mydc-tick { font-size: 10px; }
  /* The euro value per month is the first thing to go when the columns get
     narrow — the bars still carry the shape, and the figures are one tap away
     on a wider screen. */
  .mydc-tick-v { display: none; }
}
