:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --text: #1c2333;
  --muted: #647087;
  --border: #e4e8f1;
  --accent: #2f6fed;
  --accent-2: #16a394;
  --accent-soft: #eaf1ff;
  --warn: #e0a13c;
  --danger: #d9534f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 30, 60, 0.04), 0 8px 24px rgba(20, 30, 60, 0.06);

  /* Brand identity: navy top bar, gold accent -- confirmed 2026-09-30.
     Gold fails WCAG AA as text on a light background (2.42:1), so it's
     used only against --navy (6.59:1) or as a non-text accent -- never
     as badge/label text on a white or light-tint background. */
  --navy: #0f1f4b;
  --gold: #c9a227;

  /* Status semantics (2026-09-30 color pass): green = selected/good/
     passed, blue = shortlisted/potential, amber = pending/unrated,
     red = concern/failed, grey = inactive/neutral (role badges).
     Every one of these is the darkened, WCAG-AA-safe version of its
     hue (>=4.5:1 on white at normal badge text size) -- the brighter
     "vivid" pair is for decorative use only (dots, tile borders),
     never for text. */
  --status-green: #19864f;
  --status-green-vivid: #1a8a52;
  --status-blue: #2f6fed;
  --status-amber: #9d6909;
  --status-amber-vivid: #b5790a;
  --status-red: #d43f3a;
  --status-grey: #647087;

  /* Per-tier colors -- text-safe (AA) values; each has a brighter
     "-vivid" companion for decorative use (dots, left-border accents)
     where text-contrast rules don't apply. */
  --tier-team-india: #8d721b;       /* gold family, darkened for text */
  --tier-team-india-vivid: #c9a227;
  --tier-tier1: #0f1f4b;            /* navy -- already AA at 15.9:1 */
  --tier-tier2: #2f6fed;            /* already AA at 4.55:1 */
  --tier-tier3: #128477;            /* teal family */
  --tier-tier3-vivid: #16a394;
  --tier-tier4: #177bb0;            /* sky family */
  --tier-tier4-vivid: #4fb3e8;
  --tier-junior: #b15f0c;           /* orange family */
  --tier-junior-vivid: #f08a24;
  --tier-intern: #8063d5;           /* purple family */
  --tier-intern-vivid: #8a6fd8;
  --tier-alumni: #647087;           /* slate -- already AA at 5.0:1 */
  --tier-uncategorized: #d43f3a;    /* red OUTLINE, not filled -- this
                                        tier is an alert, not a status */
}

* { box-sizing: border-box; }

/* A utility class always wins over a component's own display rule,
   regardless of source order -- same reasoning as Bootstrap's .d-none. */
.hidden { display: none !important; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv02","cv03","cv04","cv11";
}

a { color: inherit; text-decoration: none; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--navy);
  border-bottom: 3px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 10;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  font-weight: 700;
  font-size: 1.02rem;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.01em;
  color: #ffffff;
}
.brand-logo { height: 34px; width: 34px; object-fit: contain; }

.nav { display: flex; gap: 18px; font-size: 0.92rem; color: rgba(255,255,255,0.72); }
.nav a:hover { color: var(--gold); }
.nav a.active { color: var(--gold); font-weight: 600; }

.search-box { display: flex; gap: 8px; }
.search-autocomplete-wrap { position: relative; }
.search-box input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  min-width: 220px;
  font-size: 0.9rem;
}
.search-suggestions {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow); z-index: 50; overflow: hidden; max-height: 320px; overflow-y: auto;
}
.search-suggestion {
  display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px;
  font-size: 0.88rem; color: var(--text); border-bottom: 1px solid var(--border);
}
.search-suggestion:last-child { border-bottom: none; }
.search-suggestion:hover, .search-suggestion.active { background: var(--accent-soft); }
.suggestion-assoc { color: var(--muted); font-size: 0.8rem; }
.user-nav { margin-left: 12px; }
.user-nav-label { color: rgba(255,255,255,0.72); font-size: 0.85rem; }
.user-nav a { color: rgba(255,255,255,0.72); }
.user-nav a:hover { color: var(--gold); }
.search-box button {
  border: none;
  background: var(--accent);
  color: white;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
}

.container { max-width: 1180px; margin: 0 auto; padding: 28px; }

h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 6px; }
h2 { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 12px; }
.subtitle { color: var(--muted); margin: 0 0 24px; font-size: 0.95rem; max-width: 720px; }

.stat-row { display: flex; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  min-width: 130px;
  box-shadow: var(--shadow);
  display: block;
}
.stat-card-link { transition: transform 0.12s ease, box-shadow 0.12s ease; }
.stat-card-link:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(20,30,60,0.12); }
.stat-card-filter {
  font-family: inherit; text-align: left; cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, outline-color 0.12s ease;
  outline: 2px solid transparent; outline-offset: 2px;
}
.stat-card-filter:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(20,30,60,0.12); }
.stat-card-filter.active { outline-color: var(--accent); }

.chart-legend {
  display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px;
  font-size: 0.8rem; color: var(--muted);
}
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend-dot-cpd { background: transparent; border: 2px solid #c9a227; width: 8px; height: 8px; }
.legend-dot-top5 { background: #fff8e6; border: 2px solid #e0b43d; width: 8px; height: 8px; }

.by-assoc-controls { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.by-assoc-legend { margin-bottom: 18px; }
.assoc-group summary { cursor: pointer; list-style: none; }
.assoc-group summary::-webkit-details-marker { display: none; }
.assoc-group-summary {
  display: flex; justify-content: flex-start; align-items: center; flex-wrap: wrap; gap: 8px; text-align: left;
}
.assoc-group-summary::before { content: "▸"; margin-right: 8px; color: var(--muted); display: inline-block; }
.assoc-group[open] .assoc-group-summary::before { content: "▾"; }
.assoc-group-name { font-weight: 700; font-size: 1.05rem; }
.assoc-group-stats { display: flex; gap: 14px; font-size: 0.82rem; color: var(--muted); margin-left: auto; }
.assoc-group table { margin-top: 14px; }
.stat-card .num { font-size: 1.6rem; font-weight: 700; }
.stat-card .lbl { color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-advanced { border-left: 4px solid #1a8a52; }
.stat-intermediate { border-left: 4px solid #b5790a; }
.stat-developing { border-left: 4px solid #2f6fed; }
.stat-beginner { border-left: 4px solid #d9534f; }
.stat-good { border-left: 4px solid #1a8a52; }
.stat-potential { border-left: 4px solid #2f6fed; }
.stat-unrated { border-left: 4px solid #b5790a; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--tile-border-color, var(--tile-color, var(--accent)));
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  display: block;
}
.tile:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(20,30,60,0.12); }
.tile .count { font-size: 1.9rem; font-weight: 800; color: var(--tile-color, var(--accent)); letter-spacing: -0.02em; }
.tile .name { font-size: 0.9rem; color: var(--text); margin-top: 2px; font-weight: 600; }
.tile.empty { border-left-color: var(--border); }
.tile.empty .count, .tile.empty .name { color: var(--muted); }

.num-sm { font-size: 1rem; font-weight: 700; line-height: 1.3; }

.breadcrumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 10px; }
.breadcrumb a { color: var(--accent); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { margin: 0 4px; }

.alert-card {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border-left: 4px solid var(--tier-uncategorized); margin-bottom: 22px;
  color: var(--text); font-size: 0.95rem;
}
.alert-card strong { color: var(--tier-uncategorized); font-size: 1.2rem; margin-right: 4px; }
.alert-icon { font-size: 1.3rem; color: var(--tier-uncategorized); }
.alert-action { margin-left: auto; }

.ladder-heading { margin-top: 8px; }
.side-tracks-heading { margin-top: 28px; }
.grid-side-tracks { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); max-width: 560px; }
.ladder-step .share, .tile .share { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
.num-of-total { font-size: 1rem; font-weight: 600; color: var(--muted); }

.ladder {
  display: flex; align-items: stretch; gap: 8px; margin-bottom: 8px;
  overflow-x: auto; padding-bottom: 4px;
}
.ladder-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: 4px solid var(--tile-border-color, var(--tile-color, var(--accent)));
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  display: block;
  flex: 1 1 140px;
  min-width: 130px;
  text-align: center;
}
.ladder-step:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(20,30,60,0.12); }
.ladder-step .count { font-size: 1.7rem; font-weight: 800; color: var(--tile-color, var(--accent)); letter-spacing: -0.02em; }
.ladder-step .name { font-size: 0.82rem; color: var(--text); margin-top: 2px; font-weight: 600; }
.ladder-step.empty { border-bottom-color: var(--border); }
.ladder-step.empty .count, .ladder-step.empty .name { color: var(--muted); }
.ladder-arrow { display: flex; align-items: center; color: var(--muted); font-size: 1.2rem; flex-shrink: 0; }

/* score bands (workshop ranking) */
.band-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.band-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 0.76rem; font-weight: 700; }

/* homepage directory */
.callout-warn { border-left: 4px solid var(--warn); }
.callout-subtitle { margin-bottom: 10px; }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; }

.dir-controls { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.dir-controls input { flex: 1; min-width: 200px; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--border); font-size: 0.9rem; }
.dir-table th { cursor: pointer; user-select: none; }
.dir-table th:hover { color: var(--accent); }
.dir-table th .arrow { opacity: 0.4; font-size: 0.7em; margin-left: 3px; }
.score-type { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; }
.score-unassessed { color: var(--muted); font-style: italic; }

.avatar-initials {
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px; background: var(--accent-soft); color: var(--accent);
  font-weight: 700; flex-shrink: 0;
}
.profile-avatar { font-size: 30px; }
.section-toggle { display: flex; gap: 8px; margin-bottom: 18px; }
.section-toggle button {
  border: 1px solid var(--border); background: var(--surface); padding: 8px 16px;
  border-radius: 999px; font-size: 0.86rem; cursor: pointer; font-weight: 600; color: var(--muted);
}
.section-toggle button.active { background: var(--accent); color: white; border-color: var(--accent); }

/* Info-icon tooltip trigger -- one per table/section (column header or a
   label), not one per row: see workshop_analysts.html and profile.html.
   JS-positioned (see base.html) rather than CSS ::after, because ::after
   inside a table cell with overflow:hidden gets clipped and never becomes
   visible. Works on hover, keyboard focus, and click/tap (base.html). */
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--muted);
  background: none;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  font-family: inherit;
  line-height: 1;
  cursor: help;
  padding: 0;
  margin-left: 4px;
  vertical-align: middle;
}
.info-icon:hover { border-color: var(--accent); color: var(--accent); }
.global-tooltip {
  position: fixed;
  display: block;
  max-width: 280px;
  background: #1c2333;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.4;
  padding: 10px 12px;
  border-radius: 8px;
  z-index: 9999;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}

.group-sub-badge { font-size: 0.7rem; padding: 2px 8px; border-radius: 999px; margin-left: 6px; font-weight: 700; }
.chart-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.chart-toolbar h2 { margin-right: auto; }
.sticky-header thead th { position: sticky; top: 0; background: var(--surface); z-index: 2; }
.composite-cell { display: flex; flex-direction: row; align-items: center; justify-content: flex-end; gap: 10px; }
.data-bar-wrap { flex: none; width: 110px; height: 10px; background: #e4e8f1; border-radius: 999px; overflow: hidden; }
.data-bar { height: 100%; border-radius: 999px; }
.disagreement-icon { border-color: var(--status-amber); color: var(--status-amber); margin-left: 4px; }
.disagreement-icon:hover { border-color: var(--status-amber); color: var(--status-amber); }
#chart-wrap { position: relative; }
.leaderboard-table { margin-top: 20px; }
.section-heading-spaced { margin-top: 32px; }
.count-suffix { color: var(--muted); font-weight: 500; }
.explain-box {
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 0.88rem;
  color: var(--text);
  margin-top: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; table-layout: fixed; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
/* Headers are short, controlled text (never truncate a 3-letter "CPD"
   into "C..."); only data cells clip long values, and only when they
   don't carry .wrap (association names, category badges). */
th { overflow: visible; white-space: normal; }
td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
th.num, td.num { text-align: right; }
td.wrap { white-space: normal; }
th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }
/* Declared AFTER tr:hover so these win the specificity tie (both are
   element+class+element selectors) without needing !important. */
tr:hover td { background: var(--accent-soft); }
tr.rank-1 td { background: #fff8e6; }
tr.rank-2 td { background: #f5f7fb; }
tr.rank-3 td { background: #fbf1ea; }
tr.highlight-row td { background: #fff8e6; font-weight: 600; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  white-space: nowrap;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
}
/* Same green/blue/amber/red semantics as every other status colour. */
/* Matches the official evaluation report's grade colors -- confirmed
   with user 2026-10-01. */
.badge.grade-advanced { background: #e5f7ee; color: #19864f; }
.badge.grade-intermediate { background: #fdf3e0; color: #9d6909; }
.badge.grade-developing { background: #eaf1ff; color: #2f6fed; }
.badge.grade-beginner { background: #fdeceb; color: #d43f3a; }
.badge.grade-noknowledge { background: #f1f1f4; color: #4a5568; }

/* Dynamic per-row colours (band/tier/status) come from the database, not
   the design system, so the two values (solid + a translucent tint, the
   same 2-hex-digit alpha suffix trick used everywhere else here) are bound
   via custom properties on the element, and the class supplies the actual
   CSS properties -- no inline `style="background:...; color:...;"` left
   in the templates. */
.dyn-badge, .dyn-dot, .dyn-border {
  --dyn: #2f6fed;
  --dyn-bg: #eaf1ff;
}
.dyn-badge { background: var(--dyn-bg); color: var(--dyn); }
/* Uncategorized is an alert, not a normal tier -- an outline reads as
   "needs attention" where a filled badge would look like just another
   status among equals. */
.dyn-badge.badge-outline { background: transparent; border: 1.5px solid var(--dyn); }
.dyn-dot { background: var(--dyn); }
.dyn-border { border-left-color: var(--dyn); }

.badge-cpd { background: #e5f7ee; color: #19864f; }
/* Role (Candidate/Faculty/Evaluator) is deliberately neutral -- it isn't
   a status judgement, so it doesn't get a semantic colour. */
.badge-neutral { background: #f1f1f4; color: #4a5568; }
.name-badge { margin-left: 8px; }

/* Base form control styling -- every plain <button>/<input>/<select> in
   the app (Season save, CPD save, admin filter, etc.) matches the design
   system instead of falling back to browser-default chrome. More specific
   classes (.pill-select, .search-box button, .section-toggle button)
   still win since they're class-scoped and this isn't. */
button {
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); font-size: 0.9rem; font-weight: 600;
  cursor: pointer; font-family: inherit; color: var(--text);
}
button:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: #2559c9; color: #fff; }
input[type="text"], input[type="password"], select {
  padding: 9px 14px; border-radius: 10px; border: 1px solid var(--border);
  font-size: 0.9rem; font-family: inherit; background: var(--surface); color: var(--text);
}

.pill-select {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.88rem;
}
a.pill-select { display: inline-block; }

.profile-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.profile-header .top { display: flex; gap: 18px; align-items: flex-start; flex: 1 1 auto; min-width: 0; }
.profile-header .name { font-size: 1.5rem; font-weight: 700; }
.profile-header .meta { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }
@media (max-width: 640px) {
  .profile-header { flex-direction: column; }
}
.profile-photo { width: 88px; height: 88px; border-radius: 12px; object-fit: cover; border: 1px solid var(--border); flex-shrink: 0; }
.profile-tier-block { text-align: right; flex-shrink: 0; margin-left: auto; }
@media (max-width: 640px) {
  .profile-tier-block { margin-left: 0; text-align: left; width: 100%; }
}
.profile-tier-score { margin-top: 8px; }
.profile-tier-score .value { font-size: 1.3rem; font-weight: 800; color: var(--accent); }
.profile-tier-score .max { font-size: 0.9rem; color: var(--muted); }
.profile-tier-score .lbl { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.profile-background { margin: 8px 0 0; font-size: 0.92rem; }
.chip {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 0.78rem; background: var(--bg); color: var(--text);
  border: 1px solid var(--border);
}
.doc-chip { text-decoration: none; cursor: pointer; }
.doc-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.stepper { display: flex; align-items: center; }
.stepper-step { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.stepper-dot {
  width: 16px; height: 16px; border-radius: 50%; background: var(--border);
  border: 2px solid var(--border); box-sizing: border-box;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; line-height: 1; color: var(--muted); font-weight: 700;
}
.stepper-completed .stepper-dot { background: var(--status-green); border-color: var(--status-green); }
.stepper-attempted .stepper-dot { background: var(--status-red); border-color: var(--status-red); color: #fff; }
.stepper-current .stepper-dot { background: #fff; border-color: var(--accent); border-width: 3px; }
.stepper-recommended .stepper-dot { background: #fff; border-color: var(--gold); border-width: 3px; }
.stepper-not_required .stepper-dot { background: #fff; border: 2px dashed #3f4a63; color: #3f4a63; }
.stepper-unavailable .stepper-dot { position: relative; background: #fff; border: 3px solid #8a94a6; }
.stepper-unavailable .stepper-dot::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 2px;
  background: #8a94a6; transform: translate(-50%, -50%) rotate(-45deg);
}
.stepper-label { font-size: 0.78rem; color: var(--muted); margin-top: 6px; white-space: nowrap; }
.stepper-not_required .stepper-label { color: #3f4a63; }
.stepper-unavailable .stepper-label { color: #4a5568; font-weight: 600; }
.stepper-completed .stepper-label { color: var(--text); font-weight: 600; }
.stepper-attempted .stepper-label { color: var(--status-red); font-weight: 600; }
.stepper-current .stepper-label { color: var(--accent); font-weight: 600; }
.stepper-recommended .stepper-label { color: var(--status-amber); font-weight: 600; }
.stepper-tag {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em;
  color: var(--status-amber); border: 1px solid var(--gold); border-radius: 999px;
  padding: 1px 6px; white-space: nowrap;
}
.stepper-tag-attempted { color: var(--status-red); border-color: var(--status-red); }
.stepper-tag-unavailable { color: #4a5568; border-color: #8a94a6; }
.stepper-tag-current { color: var(--accent); border-color: var(--accent); }
.stepper-line { flex: 1; height: 2px; background: var(--border); margin: 0 4px 22px; min-width: 20px; }
.stepper-line.done { background: var(--status-green); }
.stepper-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--border); font-size: 0.78rem; color: var(--muted);
}
.stepper-legend .stepper-step { flex-direction: row; gap: 6px; }
.stepper-legend .stepper-dot { width: 14px; height: 14px; font-size: 0.65rem; }

.card-header-row { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.card-header-row h2 { margin: 0; }
.workshop-location-date { color: var(--muted); font-size: 0.88rem; font-weight: 600; }

.stat-tiles-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 14px; margin-bottom: 22px;
}
.summary-stat { text-align: center; }
.summary-stat .value {
  font-size: 1.6rem; font-weight: 800; color: var(--accent);
  display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap;
}
.summary-stat .lbl { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }

.criterion-rows { display: flex; flex-direction: column; gap: 10px; }
.criterion-row {
  display: grid; grid-template-columns: 220px 1fr 110px 50px;
  align-items: center; gap: 12px; font-size: 0.86rem;
}
.criterion-label { color: var(--text); }
.self-rated-tag { color: var(--muted); font-size: 0.74rem; font-weight: 400; }
.criterion-bar-track {
  position: relative; height: 8px; border-radius: 999px; background: var(--border); overflow: visible;
}
.criterion-bar-fill { position: absolute; inset: 0; border-radius: 999px; width: 0; }
.criterion-bar-fill.grade-beginner { background: var(--status-red); }
.criterion-bar-fill.grade-developing { background: var(--status-blue); }
.criterion-bar-fill.grade-intermediate { background: var(--status-amber); }
.criterion-bar-fill.grade-advanced { background: var(--status-green); }
.criterion-bar-fill.grade-noknowledge { background: var(--status-grey); }
.criterion-bar-fill.grade-none { background: var(--border); }
.criterion-bar-fill.grade-neutral { background: #9aa5b8; }
.criterion-bar-tick {
  position: absolute; top: -3px; bottom: -3px; width: 2px; background: #4a5568;
  transform: translateX(-1px);
}
.criterion-badge { text-align: left; }
.criterion-badge-text { color: var(--muted); font-size: 0.78rem; }
.criterion-score { font-weight: 600; }

.workshop-card-footer {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
  margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 0.8rem; color: var(--muted);
}
.tick-legend { display: inline-flex; align-items: center; gap: 6px; }
.criterion-bar-tick-sample { display: inline-block; width: 2px; height: 12px; background: #4a5568; }

@media (max-width: 640px) {
  .criterion-row { grid-template-columns: 110px 1fr 46px; }
  .criterion-badge { display: none; }
}

.status-pill-large { display: inline-block; padding: 6px 16px; border-radius: 999px; font-size: 0.95rem; font-weight: 700; margin-top: 6px; }


.faculty-group { padding: 12px 0; border-bottom: 1px solid var(--border); }
.faculty-group:last-child { border-bottom: none; }
.faculty-group-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }

.competency-details summary { cursor: pointer; color: var(--text); list-style: none; display: flex; gap: 8px; align-items: baseline; }
.competency-details summary::-webkit-details-marker { display: none; }
.competency-details summary::before { content: "\203A"; color: var(--muted); font-weight: 700; display: inline-block; transition: transform 0.12s ease; flex-shrink: 0; }
.competency-details[open] summary::before { transform: rotate(90deg); }
.competency-details p { margin: 6px 0 0; color: var(--text); }
.full-assessment-toggle summary { cursor: pointer; color: var(--accent); font-size: 0.88rem; margin-bottom: 8px; }
.full-assessment-toggle table { margin-top: 8px; }
.narrative-details summary { cursor: pointer; list-style: none; }
.narrative-details summary::-webkit-details-marker { display: none; }
.narrative-details summary::after { content: " \2192 full note"; color: var(--accent); font-size: 0.78rem; font-weight: 600; }
.narrative-details[open] summary::after { content: ""; }
.narrative-details[open] summary { margin-bottom: 2px; }
.admin-only-note { margin: 4px 0 0; font-size: 0.72rem; color: var(--muted); max-width: 220px; text-align: right; }

.timeline { border-left: 2px solid var(--border); padding-left: 20px; margin-left: 6px; }
.timeline-item { margin-bottom: 22px; position: relative; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dyn, var(--accent));
}
.timeline-sort-note { margin-top: -6px; margin-bottom: 14px; }
.timeline-item .prog-type { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.timeline-item .prog-name { font-weight: 600; font-size: 1rem; margin: 2px 0; }
.timeline-item .meta { color: var(--muted); font-size: 0.85rem; }
.timeline-item table { margin-top: 12px; }
.timeline-item table + table { margin-top: 10px; }
.timeline-composite { margin: 10px 0 0; font-size: 0.85rem; }
.timeline-evaluators { margin: 8px 0 0; font-size: 0.85rem; color: var(--muted); }
.timeline-notes { margin-top: 10px; font-size: 0.88rem; line-height: 1.7; }
.competency-name { font-weight: 600; }

.empty-state { text-align: center; color: var(--muted); padding: 40px 0; }

.back-link { color: var(--accent); font-size: 0.88rem; display: inline-block; margin-bottom: 14px; }

.no-top-margin { margin-top: 0; }
.callout-success { background: #e5f7ee; color: #1a8a52; margin-bottom: 16px; }
.admin-narrow-card { max-width: 420px; }
.admin-hint { color: var(--muted); font-size: 0.85rem; }
.admin-season-input { padding: 8px; width: 200px; box-sizing: border-box; }
.admin-filter-input { padding: 8px; width: 100%; max-width: 400px; box-sizing: border-box; margin-bottom: 12px; }
.admin-checkbox-col { width: 56px; }
.admin-save-btn { margin-top: 12px; }
.admin-save-btn-top { margin-left: auto; }
.admin-cpd-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.admin-cpd-toolbar .admin-filter-input { margin-bottom: 0; flex: 1; min-width: 200px; }
.admin-toggle { display: flex; align-items: center; gap: 6px; font-size: 0.88rem; color: var(--muted); white-space: nowrap; }
.admin-selected-count { font-size: 0.88rem; color: var(--muted); white-space: nowrap; }
.admin-unsaved-badge {
  font-size: 0.82rem; font-weight: 700; color: #b5790a; background: #fff4e0;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
tr.admin-row-selected td { background: #e5f7ee; }

.login-card { max-width: 360px; margin: 60px auto; }
.login-error { color: var(--danger); font-size: 0.9rem; }
.login-field { display: block; margin-bottom: 10px; }
.login-field-last { margin-bottom: 16px; }
.login-field-label { display: block; font-size: 0.85rem; margin-bottom: 4px; }
.login-input { width: 100%; padding: 8px; box-sizing: border-box; }
.login-submit { width: 100%; padding: 10px; cursor: pointer; }

.section-note { text-align: center; margin-top: 12px; }
.section-note-top { margin-top: 14px; }

canvas { max-width: 100%; }

/* Keyboard/touch accessibility */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
th[tabindex]:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 640px) {
  .container { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .search-box input { min-width: 140px; }
  /* Tables keep their natural column widths and scroll horizontally
     instead of every cell truncating names/labels down to nothing. */
  .card { overflow-x: auto; }
  .card table { min-width: 560px; }
}

.shortlist-bar {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25); display: flex; align-items: center; gap: 14px;
  z-index: 100; font-size: 0.88rem;
}
.shortlist-bar button { background: transparent; border: 1px solid rgba(255,255,255,0.4); color: #fff; }
.shortlist-bar button:disabled { opacity: 0.5; cursor: not-allowed; }
.shortlist-bar a.btn-primary { padding: 6px 14px; }
.shortlist-bar-link { color: #fff; border: 1px solid rgba(255,255,255,0.4); border-radius: 8px; padding: 5px 12px; }
body.has-shortlist-bar { padding-bottom: 96px; }
@media (max-width: 640px) {
  .shortlist-bar { flex-wrap: wrap; justify-content: center; border-radius: 16px; width: calc(100% - 24px); bottom: 12px; gap: 8px; padding: 8px 10px; font-size: 0.8rem; }
  .shortlist-bar button, .shortlist-bar-link, .shortlist-bar a.btn-primary { padding: 4px 9px; font-size: 0.8rem; }
  body.has-shortlist-bar { padding-bottom: 110px; }
}

.compare-table th, .compare-table td { text-align: center; vertical-align: middle; white-space: normal; overflow: visible; padding-top: 10px; padding-bottom: 10px; }
.compare-table th:first-child, .compare-table td:first-child { text-align: left; color: var(--muted); font-weight: 600; width: 190px; }
.compare-head { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.compare-photo { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; }
.compare-avatar { display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.compare-assoc { font-size: 0.75rem; color: var(--muted); font-weight: 400; }
.compare-cell { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 10px; }
.compare-cell.is-best { background: #e5f7ee; outline: 2px solid #19864f; }
.compare-cell .score { font-weight: 700; }
.compare-best-mark { font-size: 0.68rem; color: #19864f; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.compare-wrap { overflow-x: auto; }

.marksheet th, .marksheet td { overflow: visible; }
.marksheet-group th { background: var(--bg); font-size: 0.78rem; text-transform: none; letter-spacing: 0; color: var(--text); text-align: left; padding-top: 10px; }
.marksheet-note { color: var(--muted); font-weight: 400; font-size: 0.74rem; }
.marksheet-total td { border-top: 2px solid var(--border); font-weight: 700; }
.data-flag { background: #fff8e6; border-left: 3px solid var(--gold); padding: 6px 10px; border-radius: 6px; font-size: 0.82rem; }

.muted-note { color: var(--muted); font-size: 0.85rem; }

/* Level 1 / Workshop score columns (directory, search, shortlist) */
.col-hidden, .na-hidden { display: none; }
.na { color: var(--muted); font-style: italic; }
th.num, td.num { text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.check-col { width: 36px; }

/* real buttons for link-style actions */
.btn {
  display: inline-block; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border);
  font-size: 0.9rem; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer;
  font-family: inherit; background: var(--surface); color: var(--text);
}
.btn.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.btn-primary:hover { background: #2559c9; color: #fff; border-color: #2559c9; }
a.btn, a.btn:hover { text-decoration: none; }

/* search results */
.avatar-col { width: 60px; overflow: visible; text-overflow: clip; }
.check-col { overflow: visible; text-overflow: clip; }
.mini-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; display: inline-block; vertical-align: middle; }
.mini-avatar-initials { background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 0.72rem; display: inline-flex; align-items: center; justify-content: center; }
mark { background: #fff1b8; color: inherit; padding: 0 1px; border-radius: 3px; }

/* audit log */
.num-left { white-space: nowrap; color: var(--muted); }
.audit-filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.audit-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.audit-filters input[type="date"] { padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); font-family: inherit; font-size: 0.9rem; }
.audit-filter-actions { display: flex; gap: 8px; margin-left: auto; }
.audit-count { margin: 0 0 12px; }
.audit-batch summary { cursor: pointer; }
.audit-batch .chip-wrap { margin-top: 8px; }
.audit-pager { display: flex; gap: 14px; align-items: center; justify-content: center; margin-top: 16px; color: var(--muted); font-size: 0.85rem; }
.admin-reason { display: flex; flex-direction: column; gap: 4px; margin: 14px 0 10px; font-size: 0.82rem; color: var(--muted); font-weight: 600; max-width: 520px; }

/* PDF downloads */
.profile-pdf { margin-top: 10px; }
.pdf-status { font-size: 0.8rem; color: var(--muted); margin-top: 6px; min-height: 1em; }
.pdf-status:empty { display: none; }
.pdf-status-ok { color: var(--status-green); }
.pdf-status-error { color: var(--status-red); font-weight: 600; }
.shortlist-bar .pdf-status { color: #fff; margin: 0; }
.shortlist-bar .pdf-status-error { color: #ffb4b0; }
.shortlist-bar-status { max-width: 260px; }
.bulk-pdf-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.bulk-pdf-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.bulk-pdf-form label.admin-toggle { flex-direction: row; align-items: center; }
button.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.profile-category { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.profile-category .group-sub-badge { margin-left: 0; }
.category-cell .group-sub-badge { white-space: nowrap; }
.coe-admin { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 0.84rem; color: var(--muted); }
.coe-admin-reason { flex: 1 1 220px; max-width: 360px; }
.list-note { margin: 0 0 12px; font-size: 0.88rem; color: var(--muted); }

/* Phase 2/3 */
.admin-savebar {
  position: sticky; bottom: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin: 16px -4px -4px; padding: 12px 16px; background: #fff; border: 1px solid #e0b25c; border-radius: 10px;
  box-shadow: 0 -4px 14px rgba(15, 31, 75, 0.12);
}
.admin-unsaved-text { font-weight: 700; color: #8a5a07; font-size: 0.9rem; }
.admin-savebar-reason { flex: 1 1 260px; min-width: 200px; padding: 8px; box-sizing: border-box; }
.btn-remove { background: none; border: 1px solid var(--border); color: var(--danger, #d43f3a); border-radius: 6px; padding: 3px 10px; font-size: 0.8rem; cursor: pointer; }
.btn-remove:hover { background: #fdecec; border-color: var(--danger, #d43f3a); }
.remove-col { width: 84px; }
.composite-cell .band-badge { width: 9.6rem; justify-content: flex-start; box-sizing: border-box; flex: none; }
#chart-wrap { width: 100%; }
#chart-wrap canvas { width: 100% !important; }
.audit-batch .chip-wrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 10px; }
.audit-batch .chip-wrap .badge { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uniform-note { font-weight: 600; font-size: 0.85rem; color: var(--muted); margin-left: 8px; }

.stepper-did_not_attend .stepper-dot { position: relative; background: #8a94a6; border-color: #8a94a6; }
.stepper-did_not_attend .stepper-dot::after { content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 2px; background: #fff; transform: translate(-50%, -50%) rotate(-45deg); }
.stepper-did_not_attend .stepper-label { color: #4a5568; font-weight: 600; }
.stepper-tag-did_not_attend { color: #4a5568; border-color: #8a94a6; }
.stepper-branch { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.stepper-branch .stepper-step { flex-direction: row; gap: 8px; }
.stepper-branch .stepper-label { margin-top: 0; }
.stepper-branch-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }

.category-cell .badge, .category-cell .group-sub-badge { white-space: nowrap; }
.legend-star { color: #0f1f4b; font-size: 0.9rem; line-height: 1; }
.has-savebar { padding-bottom: 110px; }
.admin-flag-warning { flex: 1 1 100%; color: #8a1f1b; background: #fdecec; border-radius: 6px; padding: 6px 10px; font-size: 0.85rem; font-weight: 600; }

/* ---- keyboard focus everywhere (gold on the navy top bar) ---- */
summary:focus-visible, textarea:focus-visible, [role="button"]:focus-visible, .pill-select:focus-visible, details:focus-within > summary {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px;
}
.topbar a:focus-visible, .topbar button:focus-visible, .topbar input:focus-visible { outline-color: var(--gold); }
th[aria-sort] { cursor: pointer; }

/* ---- phones: top bar, tiles, stepper ---- */
.search-toggle { display: none; }
@media (max-width: 640px) {
  .topbar { gap: 8px 10px; padding: 10px 14px; }
  .brand { order: 1; flex: 1 1 auto; min-width: 0; font-size: 0.95rem; }
  .brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .search-toggle {
    order: 2; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
    background: transparent; border: 1px solid rgba(255,255,255,0.35); border-radius: 10px; color: #fff; cursor: pointer;
    padding: 0; flex: none;
  }
  .search-toggle svg { flex: none; width: 18px; height: 18px; }
  .user-nav { order: 3; margin-left: 0; }
  .user-nav-label { display: none; }
  .topbar > .nav:not(.user-nav) { order: 5; flex: 1 1 100%; flex-wrap: wrap; gap: 6px 18px; }
  .search-box { order: 6; flex: 1 1 100%; display: none; }
  .search-box.open { display: flex; }
  .search-box input { min-width: 0; flex: 1; }
  .search-autocomplete-wrap { flex: 1; min-width: 0; }

  .stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { min-width: 0; width: auto; }

  /* the stepper becomes a vertical list: nothing runs off the side */
  .stepper { flex-direction: column; align-items: flex-start; }
  .stepper > .stepper-step { flex-direction: row; gap: 10px; align-items: center; }
  .stepper > .stepper-step .stepper-label { margin-top: 0; white-space: normal; }
  .stepper > .stepper-line { flex: none; width: 2px; height: 14px; min-width: 0; margin: 3px 0 3px 7px; }
  .stepper-branch { flex-wrap: wrap; }
  .stepper-legend { gap: 6px 14px; }

  /* small two-column tables inside a card fit instead of scrolling the whole card */
  .timeline table, .marksheet, .card table.compact { min-width: 0; }
  .timeline td, .timeline th { white-space: normal; }
}

/* ---- print: a profile prints cleanly on A4 ---- */
@page { size: A4; margin: 14mm; }
@media print {
  body { background: #fff; font-size: 10pt; padding-bottom: 0 !important; }
  .topbar, .search-box, .search-toggle, .section-toggle, #global-tooltip, .pill-select, .back-link, .shortlist-bar,
  .profile-pdf, .pdf-status, .info-icon, .admin-savebar, .stepper-legend button, .btn, button { display: none !important; }
  .container { max-width: none; padding: 0; }
  .card { box-shadow: none; border: 1px solid #bbb; border-radius: 6px; overflow: visible !important; break-inside: auto; margin-bottom: 10pt; }
  .profile-header, .stepper, .stepper-legend, .criterion-row, tr, .data-flag { break-inside: avoid; }
  .timeline-item { break-inside: auto; }
  thead { display: table-header-group; }
  .card table { min-width: 0 !important; }
  td, th { overflow: visible !important; white-space: normal !important; text-overflow: clip !important; }
  .tile { box-shadow: none; }
  a { text-decoration: none; color: inherit; }
  details > *:not(summary) { display: block !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (max-width: 640px) {
  .marksheet col:first-child { width: 48% !important; }
  .marksheet col:last-child { width: 52% !important; }
  .marksheet td.num, .marksheet th.num { white-space: nowrap; }
}

.team-india-badge { margin-left: 6px; white-space: nowrap; }
.profile-category .team-india-badge { margin-left: 0; }

.stepper-coe_grey .stepper-dot { background: #8a94a6; border-color: #8a94a6; }
.stepper-coe_grey .stepper-label { color: #4a5568; font-weight: 600; }
.stepper-tag-coe_grey { color: #4a5568; border-color: #8a94a6; }

.compare-section th { text-align: left !important; background: var(--bg); color: var(--navy, #0f1f4b); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 8px 12px; }
.compare-empty { color: var(--muted); }
.compare-note { font-size: 0.7rem; color: var(--muted); font-weight: 400; }
.compare-table td .score { white-space: normal; }
