* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f6fa;
  color: #1f2330;
}
a { color: #2557d6; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: #1f2330;
  color: #fff;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar a { color: #fff; }
.brand a { font-weight: 600; font-size: 1.1rem; }
.nav-links { display: flex; gap: 18px; align-items: center; }
.nav-links .who { color: #c7c9d1; font-size: 0.9rem; }
.nav-links .logout { color: #ff9b9b; }
.who-tag {
  display: inline-block; margin-left: 4px; padding: 1px 8px;
  border-radius: 999px; font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.3px; text-transform: lowercase;
  background: rgba(255,255,255,0.12); color: #e7e9f1;
  vertical-align: middle;
}
.who-tag-admin { background: #f0a500; color: #1f2330; }

.container { max-width: 1100px; margin: 24px auto; padding: 0 24px; }

h1 { margin-top: 0; }
.muted { color: #5f6678; }   /* darkened so muted text clears AA (4.5:1) on the grey app bg */
.note { background: #eef2fb; border-left: 4px solid #2557d6; padding: 10px 14px; border-radius: 4px; }

/* Friendly empty-state on My Assessments (no tasks). Navy accent = no role this
   cycle; green accent = a subject who's being assessed. */
.empty-role { border-left: 4px solid var(--navy); }
.empty-role.is-subject { border-left-color: #1d9e75; }
.empty-role h2 { margin-top: 0; }
.principle-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.principle-list li { padding: 10px 12px; background: #f7f8fc; border: 1px solid #eef0f5; border-radius: 8px; font-size: 14px; line-height: 1.5; }

.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; }
.flash-error { background: #fde2e2; color: #8a1a1a; }
.flash-ok    { background: #e0f3e6; color: #1d6b34; }

/* Login */
.card { background: #fff; border-radius: 10px; padding: 28px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.login-card { max-width: 420px; margin: 60px auto; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-card label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; color: #4a5066; }
.login-card input { padding: 10px; border: 1px solid #cdd1dd; border-radius: 6px; font-size: 1rem; }
.login-card button { padding: 11px; background: #2557d6; color: #fff; border: 0; border-radius: 6px; cursor: pointer; font-size: 1rem; }
.login-card button:hover { background: #1b46b3; }
.hint { margin-top: 18px; font-size: 0.85rem; color: #6b7186; }
.hint ul { padding-left: 18px; }

/* =========================================================================
   Sign-in: full-page brand split.
   Chin Hin palette (sampled from chinhingroup.com):
     brand red  #d61923   ·   deep navy #252a59   ·   text grey #666
   ========================================================================= */
.auth-shell { min-height: 100vh; }   /* full-bleed wrapper for the login page */
.auth {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 100vh;
  background: #fff;
}
.auth-hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: 56px;
  color: #fff;
  background: linear-gradient(157deg, #2e3566 0%, #252a59 52%, #1a1e44 100%);
}
/* faint brand-red glow anchored in the lower corner */
.auth-hero::after {
  content: ""; position: absolute; right: -120px; bottom: -120px;
  width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(214,25,35,0.30), rgba(214,25,35,0) 70%);
  pointer-events: none;
}
.auth-hero-inner { position: relative; z-index: 1; max-width: 380px; }
.auth-mark {
  display: flex; align-items: center;
  font-size: 0.74rem; letter-spacing: 1.8px; font-weight: 700;
  color: #fff; text-transform: uppercase;
}
.auth-mark-sq { width: 11px; height: 11px; background: #d61923; border-radius: 2px; margin-right: 11px; flex: none; }
.auth-illus { width: 200px; height: 200px; margin: 30px 0; display: block; }
.auth-nodes circle { fill: rgba(255,255,255,0.05); stroke: rgba(255,255,255,0.32); stroke-width: 1.5; }
.auth-tag { margin: 0 0 12px; font-size: 1.7rem; font-weight: 700; line-height: 1.18; letter-spacing: -0.2px; }
.auth-sub { margin: 0; color: #b6bbdb; font-size: 0.95rem; line-height: 1.6; }

.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px; }
/* Standalone single-column auth pages (forgot / reset password). */
.auth-solo { min-height: 78vh; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-form-inner { width: 100%; max-width: 360px; }
.auth-form-inner h1 { margin: 0 0 4px; font-size: 1.7rem; color: #252a59; }
.auth-form-inner .muted { margin: 0 0 28px; font-size: 0.9rem; color: #6b7186; }
.auth-form-inner form { display: flex; flex-direction: column; gap: 16px; }
.auth-form-inner label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 0.76rem; font-weight: 700; letter-spacing: 0.6px; color: #6b7186;
  text-transform: uppercase;
}
.auth-form-inner input {
  padding: 12px 13px; border: 1px solid #d7dbe6; border-radius: 8px;
  font-size: 1rem; color: #1f2330; background: #fbfcfe;
  transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
}
.auth-form-inner input:focus {
  outline: 0; border-color: #d61923; background: #fff;
  box-shadow: 0 0 0 3px rgba(214, 25, 35, 0.15);
}
.auth-form-inner button {
  margin-top: 8px; padding: 13px; background: #d61923; color: #fff; border: 0;
  border-radius: 8px; cursor: pointer; font-size: 1rem; font-weight: 600;
  letter-spacing: 0.2px; transition: background 0.12s;
}
.auth-form-inner button:hover { background: #b5141d; }
.auth-flash { margin-bottom: 16px; }
.auth-hint { margin: 18px 0 0; font-size: 0.85rem; color: #6b7186; text-align: center; }
.auth-hint strong { color: #252a59; font-weight: 600; }
.auth-hint a { color: #d61923; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.auth-hint a:hover { color: #b5141d; }

@media (max-width: 820px) {
  /* Stack to a single column but keep it full-page: hero on top, form fills the rest. */
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-hero { padding: 40px 32px; }
  .auth-hero-inner { max-width: 460px; margin: 0 auto; text-align: center; }
  .auth-mark { justify-content: center; }
  .auth-illus { width: 132px; height: 132px; margin: 18px auto 20px; }
  .auth-form { padding: 36px 32px 52px; }
  .auth-form-inner { margin: 0 auto; }
}

/* Dashboard tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 20px; }
.tile { background: #fff; padding: 22px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); color: inherit; display: block; }
.tile:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.08); text-decoration: none; }
.tile h2 { margin: 0 0 6px; color: #2557d6; }

/* Assessment */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; }
.status-pill {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.status-pending   { background: #fff4d4; color: #8a6500; }
/* `SUBMITTED` is what waits on the line manager — use amber, not blue, so it
   reads as "needs your action" rather than "inactive". */
.status-submitted { background: #ffe1b3; color: #8a4500; }
.status-reviewed  { background: #d4f5dc; color: #1d6b34; }
.status-progress  { background: #dbe7ff; color: #1f4ba3; }

/* ---- Rate page: principle tagline + optional per-principle comment ---- */
.crit-tag { font-style: italic; font-weight: 400; color: #c7cdf0; font-size: 0.92em; }
.crit-comment { margin-top: 12px; padding-top: 12px; border-top: 1px dashed #e4e7ef; }
.crit-comment label { display: block; font-weight: 600; font-size: 0.9rem; color: #252A59; margin-bottom: 6px; }
.crit-comment .opt { color: #8a93a6; font-weight: 400; font-size: 0.85em; }
.crit-comment textarea {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; line-height: 1.5;
  padding: 10px 12px; border: 1px solid #d7dbe6; border-radius: 8px; background: #fbfcfe;
  resize: vertical; min-height: 72px;
}
.crit-comment textarea:focus { outline: none; border-color: #252A59; box-shadow: 0 0 0 3px rgba(37,42,89,0.12); }
.crit-comment textarea[readonly] { background: #f1f3f8; color: #4a5066; cursor: default; }
.field-help { font-size: 0.8rem; color: #5f6678; margin: 6px 0 0; }
.note-resubmit { background: #fff4e6; border: 1px solid #f0c89a; color: #7a3e00; }
.resubmit-chip {
  display: inline-block; background: #fdeede; color: #8a4500; font-size: 0.72rem; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.4px; vertical-align: middle;
}

/* ---- Admin: assessor comments under behaviour agreement ---- */
.crit-feedback { margin: 8px 0 18px; padding: 10px 14px; background: #f7f9fc; border: 1px solid #eef0f5; border-radius: 8px; }
.crit-feedback-head { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #5f6678; margin-bottom: 6px; }
.feedback-item { padding: 7px 0; }
.feedback-item + .feedback-item { border-top: 1px solid #eef0f5; }
.feedback-item p { margin: 3px 0 0; font-size: 0.9rem; color: #1f2330; white-space: pre-wrap; }

/* ---- Sub-admin (company-scoped) management ---- */
.company-pick { border: 1px solid #e4e7ef; border-radius: 8px; padding: 10px 12px; margin: 12px 0; }
.company-pick legend { font-size: 0.85rem; font-weight: 600; color: #252A59; padding: 0 4px; }
.company-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 14px; }
.company-opt { display: flex; align-items: center; gap: 7px; font-size: 0.88rem; padding: 3px 0; }
.subadmin-row { border-top: 1px solid #eef0f5; padding: 14px 0; }
.subadmin-row:first-of-type { border-top: none; padding-top: 4px; }
.subadmin-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }

/* ---- One assessor's per-principle comment on the "View answers" page ---- */
.resp-comment { background: #f4f6fb; border: 1px solid #e4e7ef; border-radius: 8px; padding: 9px 12px; margin: 8px 0 18px; }
.resp-comment-head { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: #6b7186; margin-bottom: 3px; }
.resp-comment p { margin: 0; font-size: 0.9rem; color: #1f2330; white-space: pre-wrap; }

.page-head-right { display: flex; gap: 10px; align-items: center; }

/* Potential pill - shown to managers, HODs, admin (never the self-assessor) */
.potential-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  font-size: 0.82rem; font-weight: 600;
  background: #eef0f6; color: #4a5066;
  border: 1px solid #d8dbe6;
}
.potential-pill strong { font-weight: 700; }
.potential-pill[data-band="Low"]  { background: #fde6cc; color: #8a4500; border-color: #f3c186; }
.potential-pill[data-band="Mid"]  { background: #e0e9fb; color: #1b46b3; border-color: #bcd0f3; }
.potential-pill[data-band="High"] { background: #d4f5dc; color: #1d6b34; border-color: #a8e2b5; }
/* "Pending" (released but not yet enough submissions) — visually distinct from
   Low/Mid/High so it doesn't read as another band, and from the grey base so
   it doesn't collide with the neutral Direct/Indirect chip sitting beside it. */
.potential-pill[data-band="None"] { background: #ece7fb; color: #5b3fa6; border-color: #cdbdf0; }

/* Bottom-of-page two-bar panel: Self -> After review */
.potential-panel {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-top: 24px; padding: 18px 22px; background: #fff;
  border: 1px solid #e1e4ee; border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.potential-row { display: flex; flex-direction: column; gap: 6px; }
.potential-label {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px;
  color: #6b7186; font-weight: 600;
}
.potential-panel .potential-pill { font-size: 0.95rem; padding: 8px 16px; }
.potential-arrow { font-size: 1.4rem; color: #b7bdcc; }

.team-table .pot-cell { font-weight: 600; }
.team-table .pot-Low  { color: #8a4500; }
.team-table .pot-Mid  { color: #1b46b3; }
.team-table .pot-High { color: #1d6b34; }

.category-block { margin-top: 28px; background: #fff; padding: 20px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.category-block h2 { margin-top: 0; color: #2557d6; }

/* Skill Category subheading inside the Functional Competency section */
.skill-group-head {
  margin: 26px 0 8px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #2557d6;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: #eef2fb;
  border-left: 4px solid #2557d6;
  border-radius: 0 4px 4px 0;
}
/* Tighten the first group head's top margin so it sits close to the section heading. */
.category-block .skill-group-head:first-of-type { margin-top: 14px; }

/* Ability-items info tooltip on functional criterion headings.
   Hover or focus the (i) icon to reveal the bullet list. */
.info-tip {
  position: relative; display: inline-block; margin-left: 6px; cursor: help;
}
.info-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: #2557d6; color: #fff;
  font-size: 0.7rem; font-weight: 700; font-style: italic; font-family: Georgia, serif;
  line-height: 1;
}
.info-tip-body {
  display: none;
  position: absolute; left: 0; top: calc(100% + 8px); z-index: 30;
  background: #1f2330; color: #fff; padding: 12px 14px; border-radius: 6px;
  width: 480px; max-width: 80vw;
  max-height: 60vh; overflow-y: auto;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  /* Tooltip must never intercept clicks on underlying controls (Submit, etc.) */
  pointer-events: none;
}
/* When the trigger is near the bottom of the viewport, JS adds .flip-up
   to render the tooltip above the icon instead of below. */
.info-tip.flip-up .info-tip-body {
  top: auto; bottom: calc(100% + 8px);
}
.info-tip:hover .info-tip-body,
.info-tip:focus .info-tip-body,
.info-tip:focus-within .info-tip-body { display: block; }
.info-tip-body strong {
  display: block; font-size: 0.75rem; letter-spacing: 0.5px;
  text-transform: uppercase; color: #b8c0d4; margin-bottom: 6px;
}
.info-tip-body pre {
  margin: 0; font-family: inherit; font-size: 0.85rem; color: #fff;
  white-space: pre-wrap; word-wrap: break-word; line-height: 1.5;
}

/* Per-criterion block */
.criterion { margin-top: 22px; }
/* The navy header band now separates sections, so no divider rule is needed. */
.criterion + .criterion { border-top: none; padding-top: 0; }
/* Navy header band: each Leadership Principle gets its own filled bar so the
   seven sections read as distinct blocks. */
.crit-head {
  background: linear-gradient(135deg, #2e3566, #252a59);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 14px;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px;
}
.crit-name { font-weight: 700; font-size: 1.05rem; color: #fff; }
.crit-desc { font-size: 0.88rem; color: #6b7186; margin-top: 2px; }

.stmt-table { width: 100%; border-collapse: collapse; }
.stmt-table td { padding: 12px 6px; border-bottom: 1px solid #f0f1f6; vertical-align: middle; }
.stmt-table tr:last-child td { border-bottom: 0; }
.stmt-text { color: #2a3148; font-size: 0.92rem; }
.stmt-num  { display: inline-block; min-width: 32px; color: #6b7186; font-weight: 600; margin-right: 6px; }
.stmt-action { width: 320px; text-align: right; white-space: nowrap; }
.self-rating { font-size: 0.78rem; color: #6b7186; margin-bottom: 4px; }
.self-rating strong { color: #2a3148; }

/* Validation banner shown when user tries to submit with blanks */
.banner-error {
  background: #fde2e2; color: #8a1a1a; border: 1px solid #f5b5b5;
  padding: 12px 16px; border-radius: 6px; margin-bottom: 14px;
}
.banner-error strong { display: block; margin-bottom: 2px; }

/* Red outline on any unanswered rating group when validation fails */
.rating-buttons.incomplete {
  outline: 2px solid #d93025; outline-offset: 4px; border-radius: 10px;
}

/* Manager review: ring the selected button when manager's pick differs
   from the employee's self-rating, to make overrides easy to spot. */
.rating-buttons.changed .rating-btn:has(input:checked) {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #87ceeb;
  position: relative; z-index: 1;
}
/* Tiny inline preview of the override ring, used in the manager instruction. */
.ring-sample {
  display: inline-block; width: 12px; height: 12px; border-radius: 3px;
  background: #2557d6; box-shadow: 0 0 0 1px #fff, 0 0 0 2px #87ceeb;
  vertical-align: middle; margin: 0 4px;
}

/* Consistently / Inconsistently buttons (two side-by-side, segmented).
   Container does NOT clip overflow so the hover tooltip can escape upward.
   Corner rounding is applied to first/last button instead. */
.rating-buttons { display: inline-flex; }
.rating-btn {
  position: relative;        /* anchor for ::after tooltip */
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px 18px; min-width: 130px;
  background: #fff; color: #4a5066;
  border: 1px solid #cdd1dd;
  font-size: 0.9rem; font-weight: 500; cursor: pointer; user-select: none;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.rating-btn + .rating-btn { border-left: 0; }
.rating-btn:first-child { border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
.rating-btn:last-child  { border-top-right-radius: 8px; border-bottom-right-radius: 8px; }
.rating-btn:hover { background: #eef2fb; }
/* Visually hide the radio without removing it from the focus order
   (keyboard / screen-reader accessibility). */
.rating-btn input[type="radio"] {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* Visible focus ring when the (hidden) radio is keyboard-focused. */
.rating-btn:focus-within {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  z-index: 2;
}
.rating-btn.rating-yes:has(input:checked) {
  background: #2557d6; color: #fff; border-color: #2557d6;
}
.rating-btn.rating-no:has(input:checked) {
  background: #5d80d4; color: #fff; border-color: #5d80d4;
}
.rating-btn:has(input:disabled) { opacity: 0.55; cursor: not-allowed; }

/* Form is locked (employee after submit, manager after review).
   Buttons remain visible so the past selections are readable, but the whole
   panel is clearly greyed and non-interactive. */
.is-locked .rating-btn {
  cursor: default; color: #6b7186; background: #f5f6fa;
}
.is-locked .rating-btn:hover { background: #f5f6fa; }      /* kill hover */
.is-locked .rating-btn[data-tip]:hover::after,
.is-locked .rating-btn[data-tip]:hover::before { display: none; }
/* In locked state, the *unselected* button is rendered as static muted
   text — not a button — so a sighted user does not mistake it for an
   actionable control. */
.is-locked .rating-btn:not(:has(input:checked)) {
  background: transparent;
  color: #9098ac;
  border-color: transparent;
}
.is-locked .rating-btn.rating-yes:has(input:checked) {
  background: #6b86c9; color: #fff; border-color: #6b86c9;  /* muted blue */
}
.is-locked .rating-btn.rating-no:has(input:checked) {
  background: #a4b4d6; color: #fff; border-color: #a4b4d6;  /* muted lighter blue */
}
/* Manager override ring still visible but desaturated when locked */
.is-locked .rating-buttons.changed .rating-btn:has(input:checked) {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #b8d4e6;
}
.is-locked .self-rating { opacity: 0.85; }

/* CSS tooltip on hover, driven by data-tip="..." */
.rating-btn[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: #1f2330; color: #fff; padding: 6px 10px; border-radius: 6px;
  font-size: 0.78rem; font-weight: 400; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
  pointer-events: none; z-index: 10;
}
.rating-btn[data-tip]:hover::before {
  content: ""; position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: #1f2330;
  pointer-events: none; z-index: 10;
}

/* Legend shown in the instruction note */
.rating-legend {
  display: flex; gap: 22px; flex-wrap: wrap; margin-top: 8px;
  font-size: 0.85rem; color: #4a5066;
}
.rating-legend .dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px;
  vertical-align: middle;
  background: #2557d6;
}

.actions { margin-top: 22px; display: flex; gap: 10px; align-items: center; }
.actions button {
  padding: 10px 18px; border: 1px solid #cdd1dd; background: #fff; border-radius: 6px;
  font-size: 0.95rem; cursor: pointer;
}
.actions button.primary { background: #2557d6; color: #fff; border-color: #2557d6; }
.actions button.primary:hover { background: #1b46b3; }
.btn-link { padding: 10px 14px; }

/* Confirmation modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(31, 35, 48, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal-card {
  background: #fff; border-radius: 12px; max-width: 460px; width: 100%;
  padding: 26px 28px; box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.modal-card h2 { margin: 0 0 10px; font-size: 1.25rem; color: #1f2330; }
.modal-card p  { margin: 0 0 14px; color: #2a3148; line-height: 1.45; }
.modal-warning {
  background: #fff4d4; color: #6b4f00; border-left: 4px solid #d99100;
  padding: 10px 12px; border-radius: 4px; font-size: 0.9rem;
  line-height: 1.4;
}
.modal-warning strong { display: block; margin-bottom: 2px; color: #8a6500; }
.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px;
}
.modal-actions button {
  padding: 9px 16px; border: 1px solid #cdd1dd; background: #fff;
  border-radius: 6px; cursor: pointer; font-size: 0.95rem;
}
.modal-actions button.primary {
  background: #2557d6; color: #fff; border-color: #2557d6;
}
.modal-actions button.primary:hover { background: #1b46b3; }
.modal-actions button.primary:disabled {
  background: #6b86c9; border-color: #6b86c9; cursor: progress;
}

/* Floating "Back" FAB — visible while scrolling on subpages. */
.fab-back {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 900;                /* under the confirmation modal (1000) */
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 10px 14px;
  background: #1f2330;
  color: #fff !important;       /* override the generic `a` colour */
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(0,0,0,0.22);
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s;
}
.fab-back:hover {
  background: #2a3148;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(0,0,0,0.28);
}
.fab-back:focus-visible {
  outline: 3px solid #87b4ff;
  outline-offset: 2px;
}
.fab-back .fab-back-arrow {
  display: inline-block;
  font-size: 1.05rem;
  line-height: 1;
}
/* On narrow screens collapse the label to keep the FAB out of the way. */
@media (max-width: 520px) {
  .fab-back {
    padding: 12px;
    border-radius: 50%;
  }
  .fab-back .fab-back-label { display: none; }
}
@media print { .fab-back { display: none; } }

/* Friendly error pages (403/404/500) */
.error-card { max-width: 560px; margin: 40px auto; text-align: center; }
.error-card .error-code {
  font-size: 4rem; font-weight: 800; color: #2557d6; line-height: 1;
  letter-spacing: -2px; margin-bottom: 6px;
}
.error-card h1 { margin: 0 0 10px; }
.error-card .actions { justify-content: center; margin-top: 22px; }

/* Team filter input */
.team-filter { display: flex; gap: 8px; margin: 14px 0; }
.team-filter input {
  flex: 1; padding: 9px 12px; border: 1px solid #cdd1dd; border-radius: 6px;
  font-size: 0.95rem;
}
.team-filter button {
  padding: 9px 16px; background: #2557d6; color: #fff; border: 0;
  border-radius: 6px; cursor: pointer; font-size: 0.95rem;
}
.team-filter button:hover { background: #1b46b3; }

/* Admin portal */
.nav-admin { background: #f0a500; color: #fff !important; padding: 4px 10px; border-radius: 4px; font-weight: 600; }
.nav-admin:hover { background: #d18d00; text-decoration: none; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 16px 0 24px; }
.kpi { background: #fff; padding: 18px 20px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.kpi-label { font-size: 0.78rem; text-transform: uppercase; color: #6b7186; letter-spacing: 0.5px; font-weight: 600; }
.kpi-num { font-size: 2rem; font-weight: 700; color: #1f2330; margin-top: 4px; }

.admin-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; margin-bottom: 16px; }
.admin-card { background: #fff; padding: 18px 22px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.admin-card h2 { margin: 0 0 12px; color: #2557d6; font-size: 1.05rem; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 8px 10px; border-bottom: 1px solid #ecedf2; text-align: left; vertical-align: top; font-size: 0.9rem; }
.admin-table thead th { font-size: 0.78rem; text-transform: uppercase; color: #6b7186; letter-spacing: 0.5px; }

.admin-form { display: grid; gap: 10px; }
.admin-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: #4a5066; }
.admin-form label.row { flex-direction: row; align-items: center; gap: 10px; }
.admin-form label.row input { flex: 1; }
.admin-form label.checkbox { flex-direction: row; align-items: center; gap: 6px; }
.admin-form input, .admin-form select, .admin-form textarea {
  padding: 7px 10px; border: 1px solid #cdd1dd; border-radius: 5px; font-size: 0.92rem;
}
.admin-form-inline { display: grid; gap: 6px; padding: 10px; background: #fafbfd; border-radius: 6px; margin-top: 4px; }
.admin-form-inline input, .admin-form-inline textarea { width: 100%; }

.admin-form button.primary, .admin-actions button.primary { background: #2557d6; color: #fff; border: 1px solid #2557d6; padding: 8px 14px; border-radius: 5px; cursor: pointer; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-actions button { padding: 8px 14px; border-radius: 5px; border: 1px solid #cdd1dd; background: #fff; cursor: pointer; font-size: 0.9rem; }
.admin-actions button.danger, .admin-form-inline + form button.danger, button.danger {
  background: #fde2e2; color: #8a1a1a; border-color: #f5b5b5;
}
.admin-actions button.danger:hover, button.danger:hover { background: #f9c8c8; }

.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.tile-sm { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 8px;
           background: #eef2fb; color: #1f2330; }
.tile-sm:hover { background: #d6e4ff; text-decoration: none; }
.tile-sm strong { color: #2557d6; }
.tile-sm span { color: #6b7186; font-size: 0.85rem; }

.admin-list { padding-left: 18px; columns: 2; }
.admin-list li { break-inside: avoid; }
.small { font-size: 0.8rem; }
.cell-desc { max-width: 320px; }
.cell-pre { background: #f5f6fa; padding: 8px; border-radius: 4px; font-size: 0.78rem; white-space: pre-wrap; max-width: 360px; }

.score-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 12px 0; padding: 14px 16px; background: #fafbfd; border-radius: 8px; }
.score-num  { font-size: 1.8rem; font-weight: 700; color: #1f2330; margin: 2px 0 6px; }
.threshold-preview { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }

/* Admin user-list pagination */
.pagination { display: flex; gap: 14px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.pagination .btn-link { padding: 6px 10px; border: 1px solid #cdd1dd; border-radius: 5px; background: #fff; }
.pagination .btn-link:hover { background: #eef2fb; text-decoration: none; }
.pagination .per-page { margin-left: auto; }   /* push page-size to the right */
.per-page label { font-size: .9rem; color: #4a5060; font-weight: 600; }
.per-page select {
  font: inherit; padding: 4px 8px; border: 1px solid #cdd1dd; border-radius: 6px;
  margin: 0 2px; background: #fff;
}
.per-page-form { display: inline-flex; gap: 6px; align-items: center; }
.per-page-form select { padding: 4px 8px; border: 1px solid #cdd1dd; border-radius: 4px; }

/* Team table */
.team-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.04); margin-top: 14px; }
.team-table th, .team-table td { padding: 12px; border-bottom: 1px solid #ecedf2; text-align: left; }
.team-table thead th { background: #fafbfd; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; color: #6b7186; }
/* Job-title column is the worst offender for awkward line wraps. Let the
   browser balance the wrap so it doesn't end up with a single dangling word. */
.team-table td:nth-child(4) { text-wrap: balance; max-width: 260px; }

/* =========================================================================
   Leadership 360 additions
   ========================================================================= */

/* Relationship chips (line manager / peer / direct report) */
.rel-chip {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.2px;
  background: #eef0f6; color: #4a5066; border: 1px solid #d8dbe6;
}
.rel-line_manager  { background: #e0e9fb; color: #1b46b3; border-color: #bcd0f3; }
.rel-matrix_manager { background: #e0e9fb; color: #1b46b3; border-style: dashed; border-width: 1.5px; border-color: #7f9be0; }
.rel-peer          { background: #eaf3ec; color: #1d6b34; border-color: #bfe0c7; }
.rel-direct_report { background: #fdeede; color: #8a4500; border-color: #f3cf9e; }

/* HOD view "Direct"/"Indirect" reporting-line tag — a distinct concept from
   the assessor-relationship chips above (this is about org-chart proximity
   to the HOD, not a panel role), so it gets its own colour rather than
   reusing rel-line_manager/rel-direct_report. Indirect keeps the dashed
   border used elsewhere in the app for "secondary" relationships. */
.rel-chip.hod-direct { background: #e0e9fb; color: #1b46b3; border-color: #bcd0f3; }
.rel-chip.hod-indirect { border-style: dashed; }

/* Panel completion mini-meter, e.g. "3 / 5 submitted" */
.panel-meter { display: inline-flex; align-items: center; gap: 8px; }
.panel-bar { width: 90px; height: 8px; border-radius: 999px; background: #e4e7f0; overflow: hidden; }
.panel-bar > span { display: block; height: 100%; background: #2557d6; }
.panel-bar.full > span { background: #1d6b34; }
.panel-count { font-size: 0.82rem; color: #4a5066; font-weight: 600; }
.panel-short { color: #8a4500; }

/* Assessor / suggestion cards on the panel editor */
.panel-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin: 12px 0; }
.assessor-card {
  background: #fff; border: 1px solid #e1e4ee; border-radius: 10px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.assessor-card .a-name { font-weight: 600; }
.assessor-card .a-meta { font-size: 0.82rem; color: #6b7186; }
.assessor-card .a-org { font-size: 0.76rem; margin: 2px 0 6px; }
.assessor-card .a-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.assessor-card form { margin: 0; }

/* Assessor name-search (panel editor) */
.as-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.as-controls label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: #4a5066; }
.as-controls .as-search { flex: 1; min-width: 220px; }
.as-controls select,
.as-controls input[type="search"] {
  padding: 8px 10px; border: 1px solid #cdd1dd; border-radius: 6px; font-size: 0.92rem;
}
.as-controls .as-allbg-label { flex-direction: row; align-items: center; gap: 6px; white-space: nowrap; }
.as-results { margin-top: 12px; }
.as-results .sugg-list li form { margin: 0; }

.sugg-block { margin-top: 18px; }
.sugg-block h3 { font-size: 0.95rem; color: #2557d6; margin: 0 0 8px; }
.sugg-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
/* Long suggestion lists (peers / direct reports) scroll instead of truncating —
   shows ~8 rows then scrolls so every candidate is reachable. */
.sugg-list.scroll { max-height: 23rem; overflow-y: auto; padding-right: 6px; }
.sugg-list li {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: #fafbfd; border: 1px solid #ecedf2; border-radius: 8px;
}
.sugg-list li.is-on { opacity: 0.55; }
.sugg-list .grow { flex: 1; min-width: 0; }
.sugg-list .sugg-line1 { display: block; }
.sugg-list .sugg-line2 { display: block; font-size: 0.78rem; margin-top: 2px; }
.sugg-list .on-tag { font-size: 0.74rem; color: #1d6b34; font-weight: 600; }

/* Per-statement agreement heatmap on the subject detail page */
.agree-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.agree-table td { padding: 9px 6px; border-bottom: 1px solid #f0f1f6; vertical-align: middle; font-size: 0.9rem; }
.agree-bar-wrap { display: inline-flex; align-items: center; gap: 10px; min-width: 220px; }
.agree-bar { width: 140px; height: 10px; border-radius: 999px; background: #f0d6c2; overflow: hidden; }
.agree-bar > span { display: block; height: 100%; background: #1d6b34; }
.agree-num { font-size: 0.82rem; color: #4a5066; font-weight: 600; white-space: nowrap; }

/* Big band readout on subject detail */
.result-hero {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  background: #fff; border: 1px solid #e1e4ee; border-radius: 12px;
  padding: 20px 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); margin: 16px 0 24px;
}
.result-hero .big-band { font-size: 1.6rem; font-weight: 800; }
.result-hero .big-score { font-size: 2.2rem; font-weight: 800; color: #1f2330; line-height: 1; }
.result-hero .hero-sub { font-size: 0.82rem; color: #6b7186; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }

/* Single-stat version of .result-hero (My Feedback / Team / HOD drill-through
   report — only the band is shown, never the score) — hugs its content
   instead of stretching into an oversized, mostly-empty card. */
.band-hero {
  display: inline-flex; align-items: center; gap: 14px;
  background: #fff; border: 1px solid #e1e4ee; border-radius: 12px;
  padding: 14px 22px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); margin: 16px 0 24px;
}
.band-hero .hero-sub { font-size: 0.82rem; color: #6b7186; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.band-hero .potential-pill { font-size: 0.95rem; padding: 7px 16px; }

/* Prominent "download the template" callout — its own row on import pages */
.template-dl {
  display: flex; align-items: center; gap: 16px;
  margin: 18px 0; padding: 16px 20px;
  border: 2px solid var(--navy); border-radius: 12px;
  background: #f4f6fc; color: var(--ink); text-decoration: none;
  transition: background .15s, box-shadow .15s, transform .05s;
}
.template-dl:hover { background: #eaf0fb; box-shadow: 0 3px 12px rgba(37,42,89,.14); text-decoration: none; }
.template-dl:active { transform: scale(.995); }
.template-dl .tdl-ic { color: var(--navy); flex: none; }
.template-dl .tdl-main { flex: 1; min-width: 0; }
.template-dl .tdl-title { font-weight: 600; font-size: 15px; color: var(--navy); }
.template-dl .tdl-sub { font-size: 12.5px; color: #6b7186; margin-top: 2px; }
.template-dl .tdl-cta {
  flex: none; background: var(--navy); color: #fff; font-weight: 500;
  padding: 9px 18px; border-radius: 8px; white-space: nowrap;
}
.template-dl:hover .tdl-cta { background: var(--navy-700); }

/* Dropzone-ish import box */
.upload-box { background: #fff; border: 2px dashed #c5cbe0; border-radius: 12px; padding: 26px; text-align: center; }
.upload-box input[type=file] { margin: 10px 0; }
.seg { display: inline-flex; border: 1px solid #cdd1dd; border-radius: 8px; overflow: hidden; }
.seg a { padding: 6px 14px; color: #4a5066; background: #fff; }
.seg a.active { background: #2557d6; color: #fff; }

/* Excel-style sort & filter on the subjects table */
.col-menu-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  width: 100%; box-sizing: border-box; background: transparent; border: 0;
  font: inherit; font-weight: 700; color: inherit; text-align: left;
  cursor: pointer; padding: 3px 5px; border-radius: 6px;
}
.col-menu-btn:hover { background: rgba(37,87,214,0.10); }
.col-menu-btn .cm-caret { flex: none; font-size: 0; line-height: 1; }
.col-menu-btn .cm-caret::before { content: "\25BE"; font-size: 0.72rem; opacity: 0.5; }
.col-menu-btn.sort-asc  .cm-caret::before { content: "\25B2"; opacity: 1; color: #2557d6; }
.col-menu-btn.sort-desc .cm-caret::before { content: "\25BC"; opacity: 1; color: #2557d6; }
.col-menu-btn.has-filter { color: #2557d6; }
.col-menu-btn.has-filter .cm-label::after { content: " \2261"; font-size: 0.85em; opacity: 0.8; }

.col-menu {
  position: absolute; z-index: 1000; width: 244px; max-width: 92vw;
  background: #fff; border: 1px solid #cdd1dd; border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.18); padding: 8px; font-weight: 400; color: #1f2330;
}
.col-menu .cm-sort { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; }
.col-menu .cm-sort button {
  text-align: left; background: #fff; border: 0; padding: 7px 8px; border-radius: 6px;
  font-size: 0.85rem; color: #1f2330; cursor: pointer; width: 100%;
}
.col-menu .cm-sort button:hover { background: #eef3ff; }
.col-menu .cm-search { margin: 4px 0; }
.col-menu .cm-search input {
  width: 100%; box-sizing: border-box; padding: 6px 8px; font-size: 0.83rem;
  border: 1px solid #cdd1dd; border-radius: 6px;
}
.col-menu .cm-all { display: block; padding: 6px; font-size: 0.84rem; border-top: 1px solid #eef0f5; border-bottom: 1px solid #eef0f5; }
.col-menu .cm-list { max-height: 220px; overflow: auto; padding: 4px 0; }
.col-menu .cm-list label { display: block; padding: 4px 6px; font-size: 0.84rem; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-menu .cm-list label:hover { background: #f5f7fb; }
.col-menu .cm-list input, .col-menu .cm-all input { margin-right: 7px; vertical-align: middle; }
.col-menu .cm-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; }
.col-menu .cm-foot button { padding: 6px 12px; border-radius: 6px; font-size: 0.83rem; cursor: pointer; border: 1px solid #cdd1dd; background: #fff; color: #1f2330; }
.col-menu .cm-foot .cm-apply { background: #2557d6; border-color: #2557d6; color: #fff; }
.conf-yes { color: #1d6b34; font-weight: 600; font-size: 0.86rem; }

/* Dashboard incomplete-panel alert */
.dash-alert {
  display: flex; align-items: center; gap: 14px; text-decoration: none;
  border-radius: 12px; padding: 14px 18px; margin: 0 0 18px; border: 1px solid;
}
.dash-alert-warn { background: #fdeede; border-color: #f0c89a; color: #7a3e00; }
.dash-alert-warn:hover { background: #fbe4cd; }
.dash-alert-ok { background: #e3f3e8; border-color: #b9e0c5; color: #1d6b34; }
.dash-alert-info { background: #e8eefb; border-color: #c2d2f0; color: #1f4ba3; }
.dash-alert-info:hover { background: #dde7f9; }
.dash-alert-num { font-size: 1.7rem; font-weight: 800; line-height: 1; flex: none; min-width: 36px; text-align: center; }
.dash-alert-text { flex: 1; font-size: 0.92rem; line-height: 1.35; }
.dash-alert-go { flex: none; font-weight: 700; white-space: nowrap; }

/* "warn" flash category */
.flash-warn { background: #fdeede; border: 1px solid #f0c89a; color: #7a3e00; }
button.warn { background: #b8740f; color: #fff; border: 0; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 0.85rem; }
button.warn:hover { background: #9c6200; }

/* Activity / usage tracking */
.kpi-rate { font-size: 0.8rem; font-weight: 600; color: #6b7186; white-space: nowrap; }
td.nowrap, .nowrap { white-space: nowrap; }
.act-pill { display: inline-block; font-size: 0.74rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; text-transform: capitalize; letter-spacing: 0.2px; }
.act-login { background: #e6effd; color: #1f4fb0; }
.act-submit { background: #e3f3e8; color: #1d6b34; }

/* =========================================================================
   ADMIN UI REFRESH — Chin Hin navy + red brand system.
   A self-contained override layer that modernises the existing classes:
   primary = navy, brand accent = red, destructive = its own red. Restyles
   buttons, selects, tables, KPI cards, pills, nav — no markup overhaul.
   ========================================================================= */
:root{
  --navy:#252A59; --navy-700:#1d2249; --navy-600:#2e3566;
  --red:#D61923; --red-700:#b5141d; --ink:#1f2330;
  --rl-line:#e4e7ef; --rl-line-soft:#eef0f5;
  --rl-danger:#c0392b; --rl-danger-line:#f3c0bb;
  --rl-radius:12px; --rl-btn-radius:8px;
}
a { color: var(--navy-600); }

/* ---- Top bar + nav ---- */
.topbar { background: var(--navy); padding: 0 24px; min-height: 56px; }
.brand { display: flex; align-items: center; }
.brand::before { content:""; width:13px; height:13px; border-radius:3px; background:var(--red); margin-right:11px; flex:none; }
.nav-links { gap: 4px; }
.nav-links a { color:#c3c7d6; font-weight:500; padding:8px 12px; border-radius:7px; position:relative; transition:color .15s, background .15s; }
.nav-links a:hover { color:#fff; background:rgba(255,255,255,.08); text-decoration:none; }
.nav-links a.active { color:#fff; }
.nav-links a.active::after { content:""; position:absolute; left:12px; right:12px; bottom:-17px; height:3px; border-radius:3px 3px 0 0; background:var(--red); }
.nav-links .logout { color:#ff9b9b; }
.who-tag-admin { background: var(--red); color:#fff; }

/* ---- Unified button system ---- */
/* primary = solid navy */
button.primary, .admin-form button.primary, .admin-actions button.primary,
.actions button.primary, .modal-actions button.primary, .team-filter button {
  background: var(--navy); color:#fff; border:1px solid var(--navy);
  border-radius: var(--rl-btn-radius); font-weight:600; padding:9px 16px;
  transition: background .15s, border-color .15s, box-shadow .15s, color .15s;
}
button.primary:hover, .admin-form button.primary:hover, .admin-actions button.primary:hover,
.actions button.primary:hover, .modal-actions button.primary:hover, .team-filter button:hover {
  background: var(--navy-700); border-color: var(--navy-700);
}
/* secondary = outlined; covers .btn-link and plain admin-actions/actions buttons */
.btn-link, .admin-actions button, .actions button {
  display:inline-flex; align-items:center; gap:6px; white-space:nowrap;
  background:#fff; color:var(--ink); border:1px solid var(--rl-line);
  border-radius:7px; font-weight:600; font-size:0.85rem; padding:7px 12px;
  cursor:pointer; transition: background .15s, border-color .15s, box-shadow .15s, color .15s;
}
.btn-link:hover, .admin-actions button:hover, .actions button:hover {
  background:#f1f4fa; border-color:#cdd3e2; text-decoration:none;
}
/* danger = red outline -> fills on hover */
button.danger, .admin-actions button.danger {
  background:#fff; color:var(--rl-danger); border:1px solid var(--rl-danger-line);
}
button.danger:hover, .admin-actions button.danger:hover {
  background:var(--rl-danger); color:#fff; border-color:var(--rl-danger);
}
/* warn / archive = amber outline -> fills on hover */
button.warn {
  background:#fff; color:#9c6200; border:1px solid #f0c89a;
  border-radius:7px; font-weight:600; padding:7px 12px;
  transition: background .15s, color .15s, border-color .15s;
}
button.warn:hover { background:#b8740f; color:#fff; border-color:#b8740f; }
/* keyboard focus rings */
button:focus-visible, .btn-link:focus-visible {
  outline:none; box-shadow:0 0 0 3px rgba(37,42,89,.28);
}
/* Locked action (e.g. "Give feedback" before the review opens): greyed and
   non-actionable, but still hoverable so its title tooltip explains why. */
.btn-link.is-disabled {
  color:#8a90a2; background:#f3f4f8; border-color:var(--rl-line);
  opacity:.75; cursor:not-allowed;
}
.btn-link.is-disabled:hover { background:#f3f4f8; border-color:var(--rl-line); text-decoration:none; }
/* Notice shown when the active review hasn't started yet. */
.cycle-closed-notice { border-left:4px solid #e0a800; background:#fff9e8; }
.cycle-closed-notice h2 { margin-top:0; }
/* Cycle start/target inline editor: locked (greyed) until "Edit" is clicked. */
.inline-when { display:inline-flex; align-items:center; gap:6px; flex-wrap:wrap; }
.when-input { padding:5px 7px; border:1px solid var(--rl-line); border-radius:6px; }
.when-input:disabled { background:#f3f4f8; color:#5f6678; cursor:default; }
.when-input.editing { background:#fff; color:var(--ink); box-shadow:0 0 0 3px rgba(37,42,89,.12); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline:none; border-color:var(--navy); box-shadow:0 0 0 3px rgba(37,42,89,.16);
}

/* ---- Inputs + styled selects ---- */
.admin-form input, .admin-form select, .admin-form textarea,
.team-filter input, .per-page-form select, .as-controls select, .as-controls input[type="search"] {
  border:1px solid var(--rl-line); border-radius:8px;
}
select {
  appearance:none; -webkit-appearance:none; -moz-appearance:none;
  padding-right:32px; cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23252A59' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 10px center;
}

/* ---- Tables: row hover + tabular figures ---- */
.admin-table th, .team-table th { background:#f8fafd; }
.admin-table td, .team-table td { font-variant-numeric: tabular-nums; font-size: 0.875rem; }
.admin-table tbody tr, .team-table tbody tr { transition: background .12s; }
.admin-table tbody tr:hover, .team-table tbody tr:hover { background:#f6f9fe; }
/* Action cells -> tidy button row (subjects, users, etc.) */
/* Keep row actions on a single line. flex-wrap:wrap made the action column's
   min-content width tiny, so the auto table-layout squeezed it and the links
   wrapped to 2-3 lines — inflating every row's height. */
.acts { display:flex; flex-wrap:nowrap; gap:6px; align-items:center; white-space:nowrap; }
.acts form { margin:0; }
/* Users table actions: a tidy vertical stack of equal-width, left-aligned
   buttons (width auto-fits the widest label) so the table fits one screen
   without horizontal scroll to reach Mark inactive / Remove. */
#users-table th:last-child, #users-table td:last-child { width:1%; }
#users-table .acts { flex-direction:column; align-items:stretch; gap:6px; width:max-content; }
#users-table .acts form { margin:0; width:100%; }
#users-table .acts .btn-link { display:block; width:100%; text-align:left; padding:6px 10px; white-space:nowrap; }

/* Wide admin tables scroll horizontally INSIDE their card instead of widening
   the whole page (which previously stretched the pagination bar). */
.table-scroll { overflow-x:auto; -webkit-overflow-scrolling:touch; margin-top:14px; }
.table-scroll > .team-table, .table-scroll > .admin-table { margin-top:0; }
/* Caps a table to roughly 10 rows tall and scrolls the rest, so the whole
   page fits on one screen (Team view / HOD view). */
.table-scroll-capped { max-height: 490px; overflow-y: auto; }
.table-scroll-capped thead th { position: sticky; top: 0; background: #f8fafd; z-index: 1; }
/* Modal date picker (data-prompt-type="date", e.g. Mark confirmed). */
.dp-overlay { position:fixed; inset:0; background:rgba(20,24,40,.45); display:flex; align-items:center; justify-content:center; z-index:1000; }
.dp-card { background:#fff; border-radius:10px; padding:18px 20px; max-width:440px; width:90%; box-shadow:0 12px 40px rgba(0,0,0,.25); }
.dp-card p { margin:0 0 12px; }
.dp-card input[type="date"] { width:100%; padding:8px 10px; border:1px solid var(--rl-line); border-radius:7px; font:inherit; }
.dp-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; margin-top:16px; }

/* Vertical scroll box (~30 rows) with a sticky header — for long activity logs. */
.activity-scroll { max-height:62vh; overflow-y:auto; margin-top:14px; border:1px solid var(--rl-line); border-radius:8px; }
.activity-scroll > .admin-table { margin-top:0; }
.activity-scroll thead th { position:sticky; top:0; background:#eef2fb; z-index:1; }

/* Subjects table (non-bulk view): fit to 100% width so nothing overflows.
   Fixed layout + sized columns; long text wraps; action buttons wrap+compact. */
#subjects-table.fit { table-layout: fixed; width: 100%; }
#subjects-table.fit td { overflow-wrap: anywhere; }   /* wrap long data, not headers */
#subjects-table.fit th { overflow-wrap: normal; word-break: normal; hyphens: none; }
#subjects-table.fit th:nth-child(1), #subjects-table.fit td:nth-child(1) { width: 8%; }   /* Employee ID */
#subjects-table.fit th:nth-child(2), #subjects-table.fit td:nth-child(2) { width: 18%; }  /* Name */
#subjects-table.fit th:nth-child(3), #subjects-table.fit td:nth-child(3) { width: 5%; }   /* JG */
#subjects-table.fit th:nth-child(4), #subjects-table.fit td:nth-child(4) { width: 13%; max-width:none; } /* Department */
#subjects-table.fit th:nth-child(5), #subjects-table.fit td:nth-child(5) { width: 15%; }  /* Company */
#subjects-table.fit th:nth-child(6), #subjects-table.fit td:nth-child(6) { width: 7%; }   /* Panel */
#subjects-table.fit th:nth-child(7), #subjects-table.fit td:nth-child(7) { width: 8%; }   /* Avg score */
#subjects-table.fit th:nth-child(8), #subjects-table.fit td:nth-child(8) { width: 10%; }  /* Potential */
#subjects-table.fit th:nth-child(9), #subjects-table.fit td:nth-child(9) { width: 16%; }  /* Action */
#subjects-table.fit .acts { flex-wrap: wrap; gap: 4px; }
#subjects-table.fit .acts .btn-link { padding: 4px 8px; }

/* ---- KPI cards: left accent bar ---- */
.kpi { position:relative; overflow:hidden; border:1px solid var(--rl-line); }
.kpi::before { content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--navy); }
.kpi:last-child::before { background:var(--red); }
.kpi-num { font-variant-numeric: tabular-nums; }

/* ---- Headings & accents -> navy ---- */
.admin-card h2, .tile h2, .category-block h2, .sugg-block h3, .skill-group-head,
.tile-sm strong, .col-menu-btn.has-filter { color: var(--navy); }
.panel-bar > span { background: var(--navy); }
.col-menu .cm-foot .cm-apply { background: var(--navy); border-color: var(--navy); }
.col-menu-btn.sort-asc .cm-caret::before, .col-menu-btn.sort-desc .cm-caret::before { color: var(--navy); }
.seg a.active { background: var(--navy); }

/* ---- Status pills get a status dot ---- */
.status-pill { display:inline-flex; align-items:center; gap:6px; }
.status-pill::before { content:""; width:6px; height:6px; border-radius:50%; background:currentColor; }

/* ---- Softer, consistent card radius ---- */
.assessor-card, .admin-card, .kpi, .tile, .team-table { border-radius: var(--rl-radius); }
.error-card .error-code { color: var(--navy); }

/* =========================================================================
   MOBILE / RESPONSIVE  (≤768px) — phones & small tablets.
   Desktop layout is untouched; these rules only apply on narrow viewports.
   Priority is the assessor flow (My Assessments + the rating page), since
   employees will often fill in feedback on their phones.
   ========================================================================= */
@media (max-width: 768px) {
  .container { margin: 16px auto; padding: 0 14px; }
  h1 { font-size: 1.4rem; }
  /* 16px inputs on mobile so iOS Safari doesn't auto-zoom on focus */
  input, select, textarea { font-size: 16px; }

  /* --- Top nav: brand on its own row; links scroll horizontally --- */
  .topbar { flex-wrap: wrap; padding: 8px 14px; row-gap: 6px; }
  .brand a { font-size: 0.95rem; line-height: 1.2; }
  .nav-links {
    width: 100%; flex-wrap: nowrap; overflow-x: auto; gap: 2px;
    -webkit-overflow-scrolling: touch; padding-bottom: 2px;
  }
  .nav-links a { padding: 7px 10px; font-size: 0.85rem; white-space: nowrap; }
  .nav-links .who { white-space: nowrap; }
  .nav-links a.active::after { display: none; }          /* underline breaks once wrapped */
  .nav-links a.active { background: rgba(255,255,255,0.16); }

  /* --- Page header stacks --- */
  .page-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-head-right { flex-wrap: wrap; }
  .dash-alert { flex-wrap: wrap; }

  /* --- Wide data tables become horizontally scrollable (no squashing) --- */
  .team-table, .admin-table, .agree-table {
    display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap;
  }

  /* --- Rating page: stack statement text above full-width Yes/No buttons --- */
  .stmt-table, .stmt-table tbody, .stmt-table tr, .stmt-table td { display: block; width: 100%; }
  .stmt-table tr { padding: 12px 0; border-bottom: 1px solid #f0f1f6; }
  .stmt-table tr:last-child { border-bottom: 0; }
  .stmt-table td { padding: 4px 0; border-bottom: 0; }
  .stmt-action { width: auto; text-align: left; white-space: normal; margin-top: 8px; }
  .rating-buttons { display: flex; width: 100%; }
  .rating-btn { flex: 1; min-width: 0; padding: 12px 8px; }   /* large thumb targets */
  .rating-legend { gap: 12px; }

  /* --- Actions & forms stack / fill width --- */
  .actions { flex-wrap: wrap; }
  .actions button, .actions .btn-link { flex: 1 1 auto; justify-content: center; }
  .admin-form { grid-template-columns: 1fr !important; }
  .as-controls { flex-direction: column; align-items: stretch; }
  .as-controls .as-search { min-width: 0; }
  .score-grid { grid-template-columns: 1fr; }

  /* My Assessments list: each row becomes a tap-friendly card (the assessor's
     main screen) so the "Give feedback" button is always visible, not off to
     the right behind a horizontal scroll. */
  .team-table.assess-table {
    display: block; overflow: visible; white-space: normal;
    background: transparent; border: 0; box-shadow: none;
  }
  .team-table.assess-table thead { display: none; }
  .team-table.assess-table tbody,
  .team-table.assess-table tr,
  .team-table.assess-table td { display: block; width: 100%; }
  .team-table.assess-table tr {
    border: 1px solid var(--rl-line); border-radius: 12px;
    padding: 14px 16px; margin-bottom: 10px; background: #fff;
    box-shadow: var(--rl-shadow-sm);
  }
  .team-table.assess-table td { border: 0; padding: 3px 0; white-space: normal; }
  .team-table.assess-table td:first-child { font-size: 1.05rem; font-weight: 700; margin-bottom: 2px; }
  .team-table.assess-table .btn-link {
    display: flex; width: 100%; justify-content: center; margin-top: 12px; padding: 12px;
  }
  /* the card has no column header, so label the bare job-grade number */
  .team-table.assess-table td.jg-cell::before { content: "JG "; color: var(--rl-muted, #6b7186); }
}

/* =========================================================================
   ACCESSIBILITY & FORM-FEEDBACK POLISH (P1/P2 from the UX review)
   ========================================================================= */
/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important; scroll-behavior: auto !important;
  }
}

/* Darker placeholder text (the previous grey failed contrast) */
input::placeholder, textarea::placeholder { color: #6b7186; opacity: 1; }

/* Keyboard skip-link — hidden until focused */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 2000;
  background: var(--navy, #252A59); color: #fff; padding: 10px 16px;
  border-radius: 0 0 8px 0; font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: 0; }

/* Required-field asterisk */
.req { color: var(--red, #D61923); margin-left: 2px; font-weight: 700; }

/* Submit feedback: dim the clicked button while the form submits */
.btn-busy { opacity: 0.6; pointer-events: none; }

/* Password show/hide toggle — neutral light-grey eye icon (the higher
   specificity beats the red .auth-form-inner button rule on the login page). */
.pw-field { position: relative; display: block; }
.pw-field > input { width: 100%; box-sizing: border-box; padding-right: 44px; }
.pw-field .pw-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  margin: 0;                           /* override generic form-button margin (was shifting it ~8px low) */
  display: inline-flex; align-items: center; line-height: 0;
  background: transparent; border: 0; padding: 4px; cursor: pointer;
  color: #9aa1b4;                      /* neutral light grey, like most sites */
}
.pw-field .pw-toggle:hover,
.pw-field .pw-toggle:focus-visible { color: #6b7186; }
.pw-field .pw-toggle svg { width: 20px; height: 20px; }

/* Default-password hint shown on the sign-in form */
.auth-tip {
  margin: 0; background: #f4f6fb; border: 1px solid #e4e7ef;
  border-radius: 8px; padding: 9px 12px; font-size: 0.82rem; color: #5f6678; line-height: 1.45;
}
.auth-tip code { background: #fff; border: 1px solid #e4e7ef; padding: 1px 6px;
  border-radius: 5px; font-size: 0.95em; }

/* ---- Top bar: segmented task toggle + account dropdown -------------------- */
.nav-seg { display: inline-flex; background: rgba(255,255,255,.10); border-radius: 8px; padding: 3px; gap: 2px; }
.nav-seg a { padding: 6px 14px; border-radius: 6px; color: #c3c7d6; font-weight: 500; }
.nav-seg a:hover { color: #fff; background: rgba(255,255,255,.10); }
.nav-seg a.active { background: #fff; color: var(--navy); }
.nav-seg a.active::after { display: none; }   /* no red underline inside the pill */

.acct { position: relative; margin-left: 8px; }
.acct-trigger { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.10);
  color: #fff; border: 0; padding: 8px 14px; border-radius: 7px; font-weight: 500; font-size: 0.9rem; cursor: pointer; }
.acct-trigger:hover { background: rgba(255,255,255,.18); }
.acct-caret { font-size: 0.8em; }
/* position:fixed so the menu is never clipped by the mobile nav's overflow-x
   scroll strip; exact top/right are set in JS from the trigger's position. */
.acct-menu { position: fixed; min-width: 210px; background: #fff;
  border: 1px solid #e4e7ef; border-radius: 10px; box-shadow: 0 8px 28px rgba(20,25,50,.18); padding: 6px; z-index: 60; }
.acct-menu .acct-id { padding: 8px 12px 10px; font-size: 0.82rem; color: #5f6678; font-weight: 600;
  border-bottom: 1px solid #eef0f5; margin-bottom: 4px; }
.acct-menu a { display: block; padding: 9px 12px; border-radius: 7px; color: #1f2330; font-weight: 500; }
/* Kill the top-nav tab underline + white-on-hover that leak in via .nav-links a */
.acct-menu a::after { content: none; display: none; }
.acct-menu a:hover { background: #eef2fb; color: #1f2330; text-decoration: none; }
.acct-menu a.logout { color: #c0392b; }
.acct-menu a.logout:hover { background: #f9e6e6; color: #c0392b; }

/* "Manage" dropdown trigger — styled like a nav tab among the admin tabs */
.nav-dd-trigger { font: inherit; font-weight: 500; background: transparent; border: 0; cursor: pointer;
  color: #c3c7d6; padding: 8px 12px; border-radius: 7px; display: inline-flex; align-items: center; gap: 6px; }
.nav-dd-trigger:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-dd-trigger.active { color: #fff; background: rgba(255,255,255,.10); }
/* Section labels + active item inside a dropdown menu */
.acct-menu .menu-sec { padding: 8px 12px 3px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #9aa0b3; }
.acct-menu .menu-sec + a { margin-top: 0; }
.acct-menu a.active { background: #eef2fb; color: #2557d6; font-weight: 600; }

/* Greeting eyebrow above a page title */
.welcome-eyebrow { color: #5f6678; font-weight: 600; font-size: 0.95rem; margin: 0 0 4px; }

/* My Assessments tables (Name · Department · Relationship · Action/Status):
   keep Name + Department flexible, shrink the relationship + action columns to
   their content so a 4-column table doesn't stretch sparsely. Desktop only —
   mobile uses the stacked-card layout below. */
@media (min-width: 769px) {
  /* Fixed layout + identical column widths so the To-do and Submitted tables
     line up exactly. Everything left-aligned. */
  .assess-table { table-layout: fixed; }
  .assess-table th:nth-child(1), .assess-table td:nth-child(1) { width: 40%; }
  .assess-table th:nth-child(2), .assess-table td:nth-child(2) { width: 28%; }
  .assess-table th:nth-child(3), .assess-table td:nth-child(3) { width: 16%; }
  .assess-table th:nth-child(4), .assess-table td:nth-child(4) { width: 16%; text-align: left; }
}

/* "To do" count — heading-sized number in a highlighted box, spaced from the label */
.todo-count {
  display: inline-block; vertical-align: middle; position: relative; top: -2px;
  margin-left: 14px; padding: 2px 13px;
  font-size: 0.82em; font-weight: 700; line-height: 1.3;
  color: #2557d6; background: #eef2fb; border-radius: 9px;
}

/* "Never logged in" marker on the Progress roster */
.never-login { color: #c0392b; font-weight: 600; font-size: 0.9rem; }

/* Auto-save status next to the Submit button on the rating form */
.save-status { font-size: 0.85rem; color: #5f6678; align-self: center; }
.save-status.saved { color: #1d6b34; font-weight: 600; }
.save-status.failed { color: #c0392b; font-weight: 600; }

/* ---- Report release (admin) ---------------------------------------------- */
.release-badge {
  display: inline-block; vertical-align: middle; margin-left: 10px;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
  color: #1d6b34; background: #e7f5ec; border: 1px solid #bfe3cb;
  padding: 3px 9px; border-radius: 999px;
}
.release-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; margin-bottom: 12px;
  background: #f4f6fb; border: 1px solid #e4e7ef; border-radius: 8px;
}
.release-bar .rb-info { font-size: 0.88rem; color: #3a4050; }
.release-bar .rb-spacer { flex: 1 1 auto; }
.release-bar .btn-link { padding: 6px 10px; }
th.rel-col, td.rel-col { width: 34px; text-align: center; padding-left: 6px; padding-right: 6px; }
.rel-check, #sel-all-head { width: 16px; height: 16px; cursor: pointer; }
.rel-tag-on {
  font-size: 0.72rem; font-weight: 700; color: #1d6b34;
  margin-bottom: 4px;
}

/* ---- Employee self-service report ---------------------------------------- */
.report-intro p { margin: 0 0 8px; }
.report-basis { margin: 2px 0 14px; }
.report-principle { margin-top: 14px; }
.report-print-head { display: none; }   /* shown only when printing (below) */

@media print {
  /* Strip the app chrome so the PDF is just the report. The interactive season
     switcher is meaningless on paper — the chosen cycle is stated in the print
     banner header instead. */
  .topbar, .fab-back, .flash, .skip-link,
  .report-actions, .release-bar, #col-menu, .cycle-history { display: none !important; }
  body { background: #fff; }
  main.container { max-width: none; margin: 0; padding: 0; }
  .card, .report-principle {
    border: none; box-shadow: none; padding: 0; margin: 0 0 14px;
    break-inside: avoid; page-break-inside: avoid;
  }
  .report-print-head {
    display: block; border-bottom: 2px solid #2e3566;
    padding-bottom: 8px; margin-bottom: 14px;
  }
  .report-print-head .rph-org { font-weight: 800; color: #2e3566; font-size: 1.1rem; }
  .report-print-head .rph-name { color: #3a4050; margin-top: 2px; }
  /* Keep brand colours in the printed/saved PDF. */
  .crit-head, .agree-bar, .agree-bar > span, .crit-feedback {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
}

/* ---------------------------------------------------------------------------
   Review cycles (seasons)
   --------------------------------------------------------------------------- */
/* Season badge beside a page heading (user-facing pages). */
.season-badge {
  display: inline-block; vertical-align: middle; margin-left: 8px;
  padding: 2px 11px; font-size: 0.5em; font-weight: 700; letter-spacing: .02em;
  color: #2557d6; background: #eef2fb; border-radius: 999px;
  position: relative; top: -3px; text-transform: uppercase;
}

/* Non-admin nav cycle badge — static (regular users always see the active
   cycle only, no switcher) but same visual language as the admin one below. */
.cycle-badge {
  display: inline-flex; align-items: center; gap: 7px;
  color: #c3c7d6; font-weight: 500; font-size: 0.9rem;
  padding: 6px 4px; margin-right: 6px;
}

/* Admin nav cycle switcher (reuses .acct / .nav-dd-trigger base styles). */
.cycle-switch { margin-right: 2px; }
.cycle-trigger { display: inline-flex; align-items: center; gap: 7px; }
.cycle-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #36c08a;
  box-shadow: 0 0 0 3px rgba(54,192,138,.22); flex: none;
}
.cycle-trigger.cycle-past .cycle-dot { background: #f0a500; box-shadow: 0 0 0 3px rgba(240,165,0,.22); }
.cycle-ro {
  font-size: .72em; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  color: #1f2330; background: #f0a500; padding: 1px 6px; border-radius: 6px;
}
.cycle-live, .ch-live {
  font-size: .82em; font-weight: 700; color: #1b7a55; background: #e3f6ee;
  padding: 1px 7px; border-radius: 6px; margin-left: 4px;
}
.ch-pill.on .ch-live { color: #e3f6ee; background: rgba(255,255,255,.22); }
.cycle-arch {
  font-size: .82em; font-weight: 700; color: #8a6d00; background: #fbeecb;
  padding: 1px 7px; border-radius: 6px; margin-left: 4px;
}
.acct-menu a.cycle-manage { border-top: 1px solid #e7e9f0; margin-top: 4px; color: #2557d6; }
.status-pill.status-archived { background: #ece9e2; color: #6b6457; }
.status-pill.status-open { background: #e3f6ee; color: #1b7a55; }
.btn-link.danger-link { color: #c0392b; }
.inline-deadline { display: inline-flex; align-items: center; gap: 6px; }
.inline-deadline input[type=date] {
  font: inherit; padding: 4px 7px; border: 1px solid #cfd4e0; border-radius: 7px;
}

/* My Feedback: review-season history selector. */
.cycle-history {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 0 0 16px;
}
.cycle-history .ch-label { font-weight: 600; color: #4a5060; font-size: .92rem; }
.ch-pill {
  display: inline-block; padding: 5px 13px; border-radius: 999px;
  border: 1px solid #d4d9e6; color: #2557d6; text-decoration: none;
  font-size: .9rem; font-weight: 600; background: #fff;
}
.ch-pill:hover { background: #f4f7fd; }
.ch-pill.on { background: #2557d6; border-color: #2557d6; color: #fff; }

/* Cycle management form. */
.stack-form .form-row {
  display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 14px;
}
.stack-form .form-row label {
  display: flex; flex-direction: column; gap: 4px; font-weight: 600;
  color: #3a4050; font-size: .92rem; flex: 1 1 180px;
}
.stack-form .form-row input { font: inherit; padding: 8px 10px; border: 1px solid #cfd4e0; border-radius: 8px; }
.cycle-source { border: 1px solid #e7e9f0; border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; }
.cycle-source legend { font-weight: 700; color: #2e3566; padding: 0 6px; }
.radio-line {
  display: flex; gap: 10px; align-items: flex-start; padding: 7px 0;
  font-weight: 400; color: #3a4050; font-size: .92rem;
}
.radio-line input { margin-top: 3px; flex: none; }
.bullets { margin: 6px 0 10px; padding-left: 20px; }
.bullets li { margin: 4px 0; color: #3a4050; }

/* Percentage shown next to a count (dashboard progress/bands tables). */
.count-pct { color: #6b7186; font-weight: 600; font-size: .85em; margin-left: 4px; }

/* ---------------------------------------------------------------------------
   Leadership-framework tiers
   --------------------------------------------------------------------------- */
.tier-pill, .tier-chip {
  display: inline-block; font-weight: 700; font-size: .78em; letter-spacing: .02em;
  padding: 2px 9px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap;
}
.tier-chip { font-size: .85rem; padding: 4px 12px; margin: 0 6px 6px 0; }
.tier-pill[data-tier="1"], .tier-chip[data-tier="1"] { background:#eaf2ff; color:#1f4fb0; border-color:#cfe0fb; }
.tier-pill[data-tier="2"], .tier-chip[data-tier="2"] { background:#e6f6ee; color:#1b7a55; border-color:#c9ecd9; }
.tier-pill[data-tier="3"], .tier-chip[data-tier="3"] { background:#fdf0e3; color:#a85b1a; border-color:#f5dcc1; }
.tier-pill[data-tier="4"], .tier-chip[data-tier="4"] { background:#f1ebfb; color:#6b3fb5; border-color:#e0d3f5; }

.tier-summary { margin: 6px 0 14px; }
.tier-detail { border: 1px solid #e7e9f0; border-radius: 10px; margin-bottom: 10px; background:#fff; }
.tier-detail > summary {
  cursor: pointer; padding: 12px 14px; display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; list-style: none;
}
.tier-detail > summary::-webkit-details-marker { display: none; }
.tier-detail > summary::before { content: "▸"; color: #8a90a2; font-size: .8em; }
.tier-detail[open] > summary::before { content: "▾"; }
.tier-detail .tier-grades { font-weight: 700; color: #2e3566; }
.tier-body { padding: 0 16px 14px 36px; }
.tier-principle { padding: 10px 0; border-top: 1px solid #f0f1f6; }
.tier-principle h4 { margin: 0 0 6px; color: #2e3566; font-size: .98rem; }
.tier-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.tier-col-label { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.tcl-current { color: #1b7a55; }
.tcl-future { color: #6b3fb5; }
.tier-cols ul { margin: 0; padding-left: 18px; }
.tier-cols li { margin: 3px 0; color: #3a4050; font-size: .9rem; }
@media (max-width: 768px) { .tier-cols { grid-template-columns: 1fr; gap: 6px; } }

/* Editable tier grade-bands (Settings + per-cycle override). */
.tier-edit { border: 1px solid #e7e9f0; border-radius: 10px; padding: 12px 14px; margin: 14px 0; }
.tier-edit legend { font-weight: 700; color: #2e3566; padding: 0 6px; }
.tier-edit-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 5px 0; }
.tier-edit-row .tier-pill { min-width: 58px; text-align: center; }
.tier-edit-row label { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; color: #3a4050; font-weight: 600; }
.tier-edit-row input { width: 70px; font: inherit; padding: 5px 8px; border: 1px solid #cfd4e0; border-radius: 7px; }

/* Framework editor (principles + behaviours) */
.fw-principle > summary { cursor: pointer; padding: 4px 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fw-pname { font-weight: 700; color: #2e3566; font-size: 1.05rem; }
.fw-edit-crit { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin: 10px 0 4px; }
.fw-edit-crit label { display: flex; flex-direction: column; gap: 3px; font-size: .85rem; font-weight: 600; color: #3a4050; flex: 1 1 220px; }
.fw-edit-crit input { font: inherit; padding: 6px 9px; border: 1px solid #cfd4e0; border-radius: 7px; }
.fw-tier { border-top: 1px solid #eef0f5; padding: 10px 0; }
.fw-tier-head { margin-bottom: 8px; }
.fw-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.fw-beh { display: flex; gap: 8px; align-items: start; margin: 4px 0; }
.fw-beh textarea { flex: 1; font: inherit; padding: 6px 8px; border: 1px solid #cfd4e0; border-radius: 7px; resize: vertical; }
.fw-beh-acts { display: flex; flex-direction: column; gap: 2px; white-space: nowrap; }
.fw-add textarea { background: #fbfcfe; border-style: dashed; }
@media (max-width: 768px) { .fw-cols { grid-template-columns: 1fr; gap: 8px; } }

/* Page-level segmented toggle (light background) — the primary view switch. */
.seg-toggle {
  display: inline-flex; gap: 4px; background: #eceef4; border: 1px solid #dde1ea;
  border-radius: 11px; padding: 4px;
}
.seg-toggle a {
  padding: 8px 18px; border-radius: 8px; color: #3a4050; font-weight: 600;
  font-size: .96rem; text-decoration: none; line-height: 1.1;
}
.seg-toggle a:hover { background: #e0e4ee; }
.seg-toggle a.active { background: var(--navy); color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.seg-toggle a.active::after { content: none; display: none; }

/* Secondary "Show:" chip filter — clearly subordinate to the toggle. */
.subfilter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 14px 0 0; }
.subfilter .sf-label {
  font-size: .76rem; color: #6b7180; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; margin-right: 2px;
}
.subfilter a {
  padding: 4px 13px; border-radius: 999px; border: 1px solid #d4d9e6; background: #fff;
  color: #3a4050; font-size: .87rem; font-weight: 600; text-decoration: none;
}
.subfilter a:hover { background: #f4f7fd; }
.subfilter a.active { background: #2557d6; border-color: #2557d6; color: #fff; }
.subfilter a.active::after { content: none; display: none; }

/* Phone: tighten the toggle + account so they fit a 375px bar without
   overflow. Placed last so it overrides the base .nav-seg/.acct rules above. */
@media (max-width: 768px) {
  .nav-seg a { padding: 6px 9px; }
  .acct { margin-left: 4px; }
  .acct-trigger { padding: 7px 10px; font-size: 0.85rem; }
  .nav-dd-trigger { padding: 7px 10px; font-size: 0.85rem; }

  /* Behaviour-agreement rows (my-report + admin) stack on phones so the
     statement text and its bar/count don't overflow off-screen. The right
     cell carries inline width:240px/text-align:right, hence !important. */
  .agree-table, .agree-table tbody, .agree-table tr { display: block; width: 100%; }
  .agree-table tr { padding: 8px 0; }
  .agree-table td { display: block; width: 100% !important; text-align: left !important; padding: 4px 0; }
  .agree-table .stmt-text { margin-bottom: 2px; white-space: normal; }
  .agree-bar-wrap { min-width: 0; }
}

/* ---------------------------------------------------------------------------
   Reminder schedule editor (toggle switch + day rows + time)
   --------------------------------------------------------------------------- */
.sched-form { margin-top: 10px; }

/* On/off toggle switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { position: relative; flex: none; width: 44px; height: 24px;
  background: #cdd3e2; border-radius: 999px; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; background: #fff; border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked + .track { background: #2557d6; }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 2px solid #2557d6; outline-offset: 2px; }
.switch .switch-label { font-weight: 600; color: #252a59; }

/* Two-column field grid (days list | send time) */
.sched-grid { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 16px; }
.sched-field { min-width: 220px; }
.sched-lab { display: block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.4px;
  text-transform: uppercase; color: #6b7186; margin-bottom: 8px; }

.day-rows { display: flex; flex-direction: column; gap: 8px; }
.day-row { display: flex; align-items: center; gap: 8px; }
.day-row input[type="number"] { width: 76px; padding: 8px 10px; border: 1px solid #cdd3e2;
  border-radius: 6px; font: inherit; }
.day-suffix { color: #5f6678; font-size: 0.9rem; }
.day-rm { border: 1px solid #e3c4c4; background: #fff; color: #c0392b; width: 28px; height: 28px;
  border-radius: 6px; cursor: pointer; font-size: 18px; line-height: 1; padding: 0; }
.day-rm:hover { background: #fdecec; }
.add-day { margin-top: 10px; }
.time-input { padding: 8px 10px; border: 1px solid #cdd3e2; border-radius: 6px; font: inherit; }

/* Reminder recipients table: select-all banner + compact org columns */
.select-all-matching { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px;
  padding: 8px 12px; background: #eef2fb; border: 1px solid #d6def5; border-radius: 7px;
  font-size: 0.9rem; color: #252a59; cursor: pointer; }
.select-all-matching input { width: 16px; height: 16px; }
#subjects-table td.small, .admin-table td.small { font-size: 0.82rem; color: #4a5066; }

/* ---------------------------------------------------------------------------
   First-time product tour (static/tour.js)
   --------------------------------------------------------------------------- */
.tour-overlay { position: fixed; inset: 0; z-index: 100000; background: transparent; cursor: default; }
.tour-spot { position: fixed; z-index: 100001; border-radius: 8px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(15, 19, 32, 0.55); transition: all .18s ease;
  outline: 2px solid #fff; }
.tour-pop { position: fixed; z-index: 100002; width: 320px; max-width: calc(100vw - 24px);
  background: #fff; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.28);
  padding: 16px 18px; color: #1f2330; }
.tour-pop-head { font-weight: 700; font-size: 1.02rem; margin-bottom: 6px; color: #1f2330; }
.tour-pop-body { font-size: 0.9rem; line-height: 1.5; color: #4a5066; }
.tour-pop-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.tour-count { font-size: 0.78rem; color: #8a93a6; }
.tour-spacer { flex: 1; }
.tour-btn { font: inherit; font-size: 0.85rem; font-weight: 600; padding: 6px 12px;
  border-radius: 6px; border: 1px solid #cdd3e2; background: #fff; color: #2d3350; cursor: pointer; }
.tour-btn:hover { background: #f1f4fa; }
.tour-btn.tour-next { background: #2557d6; border-color: #2557d6; color: #fff; }
.tour-btn.tour-next:hover { background: #1c47b8; }
.tour-btn.tour-skip { border-color: transparent; color: #8a93a6; padding: 6px 8px; }
@media print { .tour-overlay, .tour-spot, .tour-pop { display: none !important; } }

/* ---- Draft with AI: single button opens a preset command menu ------------ */
.ai-draft { position: relative; }
.ai-split { position: relative; display: inline-flex; }
.ai-draft-btn[aria-expanded="true"] { background: #f1f4fa; border-color: #cdd3e2; }
.ai-draft-btn .ai-caret { font-size: 0.75rem; opacity: .8; margin-left: 2px; }
/* Daily limit reached (or mid-request): greyed out + inert (no hover effect). */
.ai-draft-btn:disabled, .ai-draft-btn:disabled:hover {
  opacity: .55;
  background: #f1f4fa; color: #8a93a6; border-color: var(--rl-line);
}
.ai-draft-btn:disabled .ai-caret { opacity: .45; }
.ai-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
  width: 270px; background: #fff; border: 1px solid var(--rl-line);
  border-radius: var(--rl-btn-radius); box-shadow: 0 8px 24px rgba(31,35,48,.14);
  overflow: hidden; padding: 4px 0;
}
.ai-menu[hidden] { display: none; }
.ai-menu .ai-menu-head {
  padding: 6px 12px; font-size: 0.68rem; letter-spacing: .04em;
  text-transform: uppercase; color: #8a93a6; border-bottom: 1px solid var(--rl-line-soft);
}
.ai-menu .ai-cmd {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: none; text-align: left; cursor: pointer;
  padding: 9px 12px; font-size: 0.88rem; color: var(--ink); font-weight: 500;
}
.ai-menu .ai-cmd:hover, .ai-menu .ai-cmd:focus-visible { background: #f1f4fa; outline: none; }
.ai-menu .ai-cmd .ai-cmd-ico { font-size: 1rem; width: 18px; text-align: center; }
.ai-menu .ai-cmd small { display: block; font-weight: 400; color: #8a93a6; font-size: 0.76rem; }
.ai-menu .ai-cmd.is-default { color: var(--navy); }
.ai-menu .ai-sep { border-top: 1px solid var(--rl-line-soft); margin: 4px 0; }
.ai-quota { color: #8a93a6; }
.ai-quota.is-last { color: #9c6200; }
.ai-quota.is-locked { color: #8a93a6; }
