* { 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: #6b7186; }
.note { background: #eef2fb; border-left: 4px solid #2557d6; padding: 10px 14px; border-radius: 4px; }

.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; }
.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; }

@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; }

.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; }

/* 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; }
.criterion + .criterion { border-top: 1px solid #ecedf2; padding-top: 18px; }
.crit-head { margin-bottom: 10px; }
.crit-name { font-weight: 600; font-size: 1rem; color: #1f2330; }
.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; }
.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-peer          { background: #eaf3ec; color: #1d6b34; border-color: #bfe0c7; }
.rel-direct_report { background: #fdeede; color: #8a4500; border-color: #f3cf9e; }

/* 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-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.assessor-card 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; }
.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; }
.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; }

/* 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-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; }
