/* ============================================================
   EXPA Console — design system
   AIESEC palette, light + dark themes, zero dependencies
   ============================================================ */

:root {
  --sep: #C6CEDA;
  --primary: #037EF3;
  --primary-strong: #0259B0;
  --primary-soft: #E5F1FE;
  /* Text/icons sitting ON a --primary background. Its own token because the
     "For Asia" theme's primary is the logo gold, which needs dark navy text
     instead of white to stay readable. */
  --on-primary: #FFFFFF;
  /* GTa's programme colour — semantic, so it never follows the theme accent
     (the ROADMAP's GV red / GTe orange / GTa blue). */
  --gta: #037EF3;
  --gta-soft: #E5F1FE;
  --gta-strong: #0259B0;
  /* Ink on a saturated programme/status fill (tags, status pills). White on
     the light red/amber fills only reaches ~3:1, so the dark themes use dark
     ink instead — the fills stay the brand colours. */
  --on-prog: #FFFFFF;
  /* Applicant-popup header gradient and the inverted "snack" surfaces
     (toast, bulk bar) — always dark, but tuned per theme. */
  --dhead-grad: linear-gradient(120deg, var(--primary), var(--teal));
  --snack-bg: #1C232F;
  --snack-ink: #FFFFFF;
  --snack-btn-bg: #FFFFFF;
  --snack-btn-ink: #1C232F;
  --teal: #0CB9C1;
  --green: #30C39E;
  --green-soft: #E3F6EE;
  --red: #F85A40;
  --red-soft: #FDEAE6;
  --amber: #F48924;
  --amber-soft: #FDF3E2;
  --yellow: #FFC845;
  --ink: #1C232F;
  --slate: #4B5563;
  --muted: #6B7280;
  --line: #E5E8EE;
  --line-strong: #D3D8E0;
  --bg: #F2F5F9;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --surface-3: #EEF1F6;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 2px 8px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .18);
  --radius: 12px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  --sidebar-w: 228px;
}

[data-theme="dark"] {
  --sep: #4E5B70;
  --primary: #2B93FF;
  --primary-strong: #66B1FF;
  --primary-soft: #122C4A;
  --teal: #2DD4DE;
  --green: #3BD0A9;
  --green-soft: #12332A;
  --red: #FF7A63;
  --red-soft: #3A1D17;
  --amber: #FFA64D;
  --amber-soft: #332514;
  --ink: #E7EAF0;
  --slate: #A7AFBC;
  --muted: #838B99;
  --line: #2A3140;
  --line-strong: #39424F;
  --bg: #10151D;
  --surface: #171D27;
  --surface-2: #1D242F;
  --surface-3: #242C39;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 2px 8px rgba(0, 0, 0, .45);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .6);
  --on-primary: #FFFFFF;
  --on-prog: #141A23;
  --gta: #2B93FF;
  --gta-soft: #122C4A;
  --gta-strong: #66B1FF;
  --dhead-grad: linear-gradient(120deg, #2B93FF, #0CB9C1);
  --snack-bg: #262F3D;
  --snack-ink: #F2F5F9;
  --snack-btn-bg: #2B93FF;
  --snack-btn-ink: #08121E;
}

/* "For Asia" — the LC's own identity, built from the logo in assets/:
   navy #222831 and gold #DDB822 (sampled from the PNGs). Deep navy surfaces,
   gold as the accent, warm off-white text. Programme colours stay untouched. */
[data-theme="asia"] {
  --sep: #46536B;
  --primary: #DDB822;
  --primary-strong: #EFCF53;
  --primary-soft: #2E2A16;
  --on-primary: #171C24;
  --on-prog: #141A23;
  --gta: #4A9EFF;
  --gta-soft: #12283F;
  --gta-strong: #7CBCFF;
  --teal: #2DD4DE;
  --green: #3BD0A9;
  --green-soft: #12332A;
  --red: #FF7A63;
  --red-soft: #3A1D17;
  --amber: #FFA64D;
  --amber-soft: #332514;
  --yellow: #FFC845;
  --ink: #F3F0E7;
  --slate: #C5CAD4;
  --muted: #8F97A5;
  --line: #2B3440;
  --line-strong: #3A4453;
  --bg: #12161D;
  --surface: #191F28;
  --surface-2: #1F2631;
  --surface-3: #262E3B;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
  --shadow: 0 2px 8px rgba(0, 0, 0, .5);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .62);
  --dhead-grad: linear-gradient(120deg, #232B36, #3C4655);
  --snack-bg: #232B38;
  --snack-ink: #F3F0E7;
  --snack-btn-bg: #DDB822;
  --snack-btn-ink: #171C24;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- app shell ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { padding: 16px 18px 12px; display: block; text-decoration: none !important; }
/* The "For Asia" lockup (from assets/, trimmed to its ink). Both colourways
   sit in the DOM and CSS picks one per theme, so the switch is instant and
   correct before any JS runs (the no-flash script is inline in the head). */
.brand .brandimg { height: 34px; width: auto; display: block; }
/* One colourway per theme, for every place the logo appears (sidebar brand,
   onboarding splash): the navy lockup on light, the white one on the dark
   themes. CSS-only so it is right before any JS runs. */
.brandimg { width: auto; display: block; }
.brandimg.logo-white { display: none; }
[data-theme="dark"] .brandimg.logo-ink,
[data-theme="asia"] .brandimg.logo-ink { display: none; }
[data-theme="dark"] .brandimg.logo-white,
[data-theme="asia"] .brandimg.logo-white { display: block; }
.brand .sub {
  display: block; margin-top: 8px;
  font-size: 11px; color: var(--muted); font-weight: 600;
}

.nav { padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--slate); font-weight: 600; font-size: 13.5px;
  cursor: pointer; user-select: none;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.nav-item.active { background: var(--primary-soft); color: var(--primary-strong); }
.nav-item svg { width: 17px; height: 17px; flex: 0 0 auto; }
.nav-section { padding: 14px 14px 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.side-foot { padding: 12px; border-top: 1px solid var(--line); }
/* Light / Dark / For Asia — same segmented language as the page filters. */
.themepick { display: flex; gap: 3px; background: var(--surface-3); border-radius: 10px; padding: 3px; }
.themepick .tp {
  flex: 1; min-width: 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 11.5px; font-weight: 650; color: var(--slate);
  padding: 6px 2px; border-radius: 8px; white-space: nowrap;
  transition: background .12s, color .12s;
}
.themepick .tp:hover { color: var(--ink); }
.themepick .tp[hidden] { display: none; }   /* a theme kept but not offered */
.themepick .tp.on { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-sm); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 18px; font-weight: 750; margin: 0; flex: 1; letter-spacing: -.01em; }
.topbar .spacer { flex: 1; }

.content { padding: 22px 28px 60px; max-width: 1280px; width: 100%; margin: 0 auto; }

/* ---------- onboarding splash ----------
   Shown once per browser session (the app launch), painted with the app so
   there is no flash, and dismissed by the page finishing plus a minimum
   read time — never by a fetch. See runOnboarding() in app.js.

   The splash is its own night scene on purpose (brand navy, always the white
   logo): flames, ash and the Maiden's Tower silhouette only read against a
   dark sky, so it does not follow the light/dark theme like the rest. */
.onboard {
  position: fixed; inset: 0; z-index: 70;
  display: none; align-items: center; justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(115% 55% at 50% 104%, rgba(255, 142, 46, .30), rgba(255, 120, 20, 0) 62%),
    radial-gradient(70% 45% at 50% 100%, rgba(255, 196, 90, .16), rgba(255, 160, 40, 0) 70%),
    linear-gradient(180deg, #080B12 0%, #0E1523 48%, #191521 74%, #2B1A15 100%);
  transition: opacity .45s ease;
}
html[data-boarding] .onboard { display: flex; }
.onboard.out { opacity: 0; pointer-events: none; }
/* focuses the eye on the card, and a warm band that drifts across the
   horizon behind the fire (transform-only, so it stays on the compositor) */
.onboard::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(78% 62% at 50% 44%, rgba(0, 0, 0, 0) 42%, rgba(0, 0, 0, .45) 100%);
}
.onboard::before {
  content: ""; position: absolute; left: -20%; right: -20%; bottom: 0; height: 46%;
  pointer-events: none; opacity: .5;
  background: radial-gradient(50% 100% at 50% 100%, rgba(255, 158, 60, .22), rgba(255, 140, 40, 0) 72%);
  animation: obHaze 7s ease-in-out infinite alternate;
}

/* Maiden's Tower (Kız Kulesi) silhouette — kept, but switched off for now
   by the `hidden` attribute in base.html (author styles beat the UA's
   [hidden] rule, so it is turned off explicitly below). */
.onboard-scene {
  position: absolute; left: 0; right: 0; bottom: 0; height: 46%;
  display: flex; align-items: flex-end; justify-content: center;
  pointer-events: none;
}
.onboard-scene[hidden] { display: none; }
.onboard-tower { width: min(700px, 80vw); height: 100%; opacity: .96; }
.tw-body { fill: #0A0D14; }
.tw-win  { fill: #F2C24A; opacity: .9; }
.tw-rim  { fill: none; stroke: #DDB822; stroke-width: 1.4; opacity: .5; stroke-linecap: round; }
.tw-water { fill: none; stroke: #8FB6E6; stroke-width: 1.3; opacity: .30; stroke-linecap: round; }
.tw-reflect { fill: rgba(255, 186, 84, .13); }

/* flames + ash (canvas) */
.onboard-fx { position: absolute; inset: 0; width: 100%; height: 100%; }

.onboard-card {
  position: relative; z-index: 1; text-align: center; padding: 32px 28px 84px;
  max-width: 560px;
  animation: obCard .5s cubic-bezier(.2, .7, .3, 1) both;
}
/* the fire's glow catching the mark */
.onboard-card::before {
  content: ""; position: absolute; left: 50%; top: 40px; width: 320px; height: 210px;
  transform: translateX(-50%); pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%, rgba(255, 176, 70, .22), rgba(255, 150, 50, 0) 70%);
  animation: obBreathe 2.6s ease-in-out infinite;
}
/* always the white lockup on this scene, whatever the app theme is */
.onboard .brandimg { height: 44px; margin: 0 auto 18px; position: relative; }
.onboard .brandimg.logo-white { animation: obRise .55s ease both; }
.onboard .brandimg.logo-ink { display: none; }
.onboard .brandimg.logo-white { display: block; }
.onboard-name {
  font-size: 22px; font-weight: 800; letter-spacing: -.015em; color: #F4F1E8;
  animation: obRise .55s ease .08s both;
}
.onboard-sub {
  margin-top: 5px; font-size: 12.5px; font-weight: 600; color: #A9B1C0;
  animation: obRise .55s ease .16s both;
}
.onboard-line {
  margin-top: 28px; min-height: 21px;
  font-size: 14px; font-weight: 650; color: #E4CF9E;
  text-shadow: 0 0 18px rgba(255, 186, 88, .30);
  animation: obIn .4s ease both;
}
/* the warm-up phase line: quiet, monospace-ish, sits between the flavour line
   and the bar. Hidden unless the server is actually still warming. */
.onboard-status {
  margin-top: 6px; font-size: 12px; font-weight: 600;
  color: var(--muted); letter-spacing: .02em;
  animation: onboardFade .4s ease both;
}
.onboard-bar {
  margin: 22px auto 0; width: 220px; height: 3px;
  border-radius: 999px; background: rgba(255, 255, 255, .12); overflow: hidden;
  box-shadow: 0 0 22px rgba(255, 170, 70, .22);
  animation: obRise .55s ease .24s both;
}
.onboard-bar span {
  display: block; width: 40%; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #B98A10, #FFD24A, #B98A10);
  animation: obSlide 1.15s ease-in-out infinite;
}
/* with the silhouette on screen the card sits higher, clear of the island */
.onboard-scene:not([hidden]) ~ .onboard-card { padding-bottom: 120px; }

@keyframes obSlide { from { transform: translateX(-105%); } to { transform: translateX(360%); } }
@keyframes obIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes obCard { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@keyframes obRise { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
@keyframes obBreathe { 0%, 100% { opacity: .65; transform: translateX(-50%) scale(1); } 50% { opacity: 1; transform: translateX(-50%) scale(1.08); } }
@keyframes obHaze { from { transform: translateX(-4%); } to { transform: translateX(4%); } }
@media (prefers-reduced-motion: reduce) {
  .onboard, .onboard-card, .onboard-card::before, .onboard::before, .onboard::after,
  .onboard .brandimg, .onboard-name, .onboard-sub, .onboard-line, .onboard-bar, .onboard-bar span {
    animation: none; transition: none;
  }
  .onboard-bar span { width: 100%; }
}

/* ---------- footer ---------- */
.foot {
  margin-top: auto;                      /* sits at the bottom on short pages */
  border-top: 1px solid var(--line);
  padding: 15px 28px 20px;
}
.foot-in {
  max-width: 1280px; width: 100%; margin: 0 auto;
  display: flex; align-items: baseline; gap: 8px 14px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted);
}
.foot-strong { color: var(--slate); font-weight: 650; }
.foot-right { margin-left: auto; }

/* ---------- token pill ---------- */
.tok {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 650; cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface); color: var(--slate);
}
.tok .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.tok.ok { color: #0E9F6E; border-color: transparent; background: var(--green-soft); }
.tok.ok .dot { background: var(--green); }
.tok.warn { color: #B06A10; background: var(--amber-soft); border-color: transparent; }
.tok.warn .dot { background: var(--amber); }
.tok.bad { color: #C0392B; background: var(--red-soft); border-color: transparent; }
.tok.bad .dot { background: var(--red); }

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.card-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 0 0 12px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
}
.stat .ico {
  width: 38px; height: 38px; border-radius: 10px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
}
.stat .ico svg { width: 19px; height: 19px; }
.stat .num { font-size: 22px; font-weight: 750; line-height: 1.1; letter-spacing: -.02em; }
.stat .lbl { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 1px; }
.tint-blue { background: var(--gta-soft); color: var(--gta-strong); }
.tint-green { background: var(--green-soft); color: #0E9F6E; }
.tint-red { background: var(--red-soft); color: #C0392B; }
.tint-amber { background: var(--amber-soft); color: #B06A10; }
.tint-slate { background: var(--surface-3); color: var(--slate); }

/* ---------- toolbar ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field[hidden] { display: none; }   /* author styles beat the UA hidden rule */
.field > label { font-size: 11.5px; font-weight: 650; color: var(--muted); }

.input, select.input {
  font: inherit; font-size: 13.5px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink);
  outline: none; transition: border .12s, box-shadow .12s;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input::placeholder { color: var(--muted); }
input[type="date"].input { font-family: var(--font); }

/* segmented control */
.seg { display: inline-flex; flex-wrap: wrap; background: var(--surface-3); border-radius: 10px; padding: 3px; gap: 2px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  padding: 6px 13px; border-radius: 8px; font-size: 13px; font-weight: 650;
  color: var(--slate); cursor: pointer; user-select: none; white-space: nowrap;
  transition: background .12s, color .12s;
}
.seg label:hover { color: var(--primary); }
.seg input:checked + label { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-sm); }

/* chips (multi toggle) */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
/* Direct child only: the chip body. A bare `.chip span` also matched the
   .cdot inside it (an <i> in some pages, a <span> in others), giving the dot
   the body's padding and turning it into a stretched oval. */
.chip > span {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 12.5px; font-weight: 600; color: var(--slate);
  cursor: pointer; user-select: none; transition: all .12s;
}
.chip > span:hover { border-color: var(--primary); color: var(--primary); }
.chip input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.chip .cnt { font-size: 11px; opacity: .75; font-weight: 700; }
.chip input:checked + span .cnt { opacity: .9; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font: inherit; font-size: 13.5px; font-weight: 650;
  padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer;
  transition: opacity .12s, background .12s, transform .05s;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-strong); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { opacity: .9; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 7px; }
.btn svg { width: 15px; height: 15px; }

.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line-strong);
  color: var(--slate); cursor: pointer; transition: all .12s;
}
.iconbtn:hover { color: var(--ink); background: var(--surface-3); }
.iconbtn svg { width: 16px; height: 16px; }

/* ---------- table ---------- */
.tblwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl thead th {
  position: sticky; top: 0; z-index: 5;
  text-align: left; padding: 10px 12px;
  background: var(--surface-2); color: var(--muted);
  font-weight: 700; font-size: 12px; letter-spacing: .03em;
  text-transform: uppercase; white-space: nowrap;
  border-bottom: 1px solid var(--line);
  cursor: pointer; -webkit-user-select: none; user-select: none;
}
.tbl thead th:hover { color: var(--primary); }
.tbl thead th .dir { color: var(--primary); }
.tbl tbody td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl tbody tr.selected td { background: var(--primary-soft); }

/* Upcoming Fin urgency rows: whole-row wash + left accent so the imminent
   finishes pop when scanning, while staying readable in both themes (the
   "Ends in" pill still carries the exact number). */
.tbl tbody tr.row-urgent td { background: color-mix(in srgb, var(--red) 10%, transparent); }
.tbl tbody tr.row-warn td { background: color-mix(in srgb, var(--amber) 10%, transparent); }
.tbl tbody tr.row-urgent td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.tbl tbody tr.row-warn td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.tbl tbody tr.row-urgent:hover td { background: color-mix(in srgb, var(--red) 16%, transparent); }
.tbl tbody tr.row-warn:hover td { background: color-mix(in srgb, var(--amber) 16%, transparent); }
.tbl td.muted { color: var(--muted); }
.tbl td.strong { font-weight: 650; }
.tbl td.wrap { white-space: normal; min-width: 180px; }

.cell-main { display: flex; align-items: center; gap: 10px; }
.cell-main .meta { display: flex; flex-direction: column; line-height: 1.3; }
.cell-main .meta small { color: var(--muted); font-size: 12px; }

.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 750; color: #fff;
}

/* checkbox */
.cb { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

/* ---------- tags / pills / badges ---------- */
/* A tag is a chip, so it owns a readable default surface. It used to set only
   `color: var(--on-prog)` and rely on a programme class for the background —
   a tag with no (or an unknown) programme class painted white-on-white in
   Light and navy-on-navy in For Asia: the label was there, invisible. */
.tag { display: inline-block; padding: 2.5px 9px; border-radius: 6px; font-size: 11.5px; font-weight: 750; background: var(--surface-3); color: var(--ink); letter-spacing: .02em; }
/* Programme colours app-wide: GV = red, GTe (Teacher) = orange, GTa (Talent) = blue.
   The solid tints take the on-programme ink; the soft tints set their own. */
.GV, .GTe, .GTa, .iGV, .iGTe, .iGTa { color: var(--on-prog); }
.GV { background: var(--red); } .GTe { background: var(--amber); } .GTa { background: var(--gta); }
.iGV { background: var(--red); } .oGV { background: var(--red-soft); color: #C0392B; }
.iGTe { background: var(--amber); } .oGTe { background: var(--amber-soft); color: #B06A10; }
.iGTa { background: var(--gta); } .oGTa { background: var(--gta-soft); color: var(--gta-strong); }

/* Scope chip colour dots (same programme colours) */
.cdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; flex: 0 0 auto; }
.cGV { background: var(--red); }
.cGTe { background: var(--amber); }
.cGTa { background: var(--gta); }

.pill { display: inline-block; padding: 2.5px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.pill.done { background: var(--green-soft); color: #0E9F6E; }
.pill.pending, .pill.started { background: var(--amber-soft); color: #B06A10; }
.pill.na { background: var(--surface-3); color: var(--muted); }
/* Urgency pills for the Upcoming Fin "Ends in" column (<15d amber, <8d red) */
.pill.warn { background: var(--amber-soft); color: #B06A10; }
/* GA's top band: over-achieved (>125% of the month's goal). Blue is the one
   GTa token pair, and it is theme-aware in all three palettes. */
.pill.over { background: var(--gta-soft); color: var(--gta-strong); }
.pill.bad { background: var(--red-soft); color: #C0392B; }
[data-theme="dark"] .pill.warn { color: #FFA64D; }
[data-theme="dark"] .pill.bad { color: #FF7A63; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.sent { background: var(--green-soft); color: #0E9F6E; }
.badge.failed { background: var(--red-soft); color: #C0392B; }
.badge.skipped { background: var(--amber-soft); color: #B06A10; }
.badge.pending { background: var(--primary-soft); color: var(--primary-strong); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.st { display: inline-block; padding: 2.5px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: var(--on-prog); background: #94A3B8; }
.st-open { background: var(--primary); color: var(--on-primary); }
.st-matched { background: var(--amber); color: #5C3A00; }
.st-accepted { background: #2FA98C; }
.st-approved { background: var(--green); color: var(--on-prog); }
.st-realized { background: #0E9F8A; }
.st-finished, .st-completed { background: #7B61FF; }
.st-rejected { background: var(--red); color: var(--on-prog); }
.st-withdrawn { background: #8A94A6; }
.st-approval_broken { background: #C0392B; }

.dir { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 6px; }
.dir.ICX { background: var(--primary-soft); color: var(--primary-strong); }
.dir.OGX { background: var(--green-soft); color: #0E9F6E; }

/* ---------- bulk bar ---------- */
.bulkbar {
  position: sticky; bottom: 16px; z-index: 25;
  display: flex; align-items: center; gap: 14px;
  margin-top: 14px; padding: 12px 16px;
  background: var(--snack-bg); color: var(--snack-ink);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.bulkbar .n { font-weight: 750; }
.bulkbar .btn-primary { background: var(--snack-btn-bg); color: var(--snack-btn-ink); }
.bulkbar .btn-primary:hover { filter: brightness(1.07); }
.bulkbar .btn-ghost { background: transparent; color: var(--snack-ink); border-color: rgba(255,255,255,.35); }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(10, 14, 22, .45);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadeIn .15s ease;
}
.modal {
  background: var(--surface); border-radius: 14px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  width: 100%; max-width: 560px; max-height: 86vh;
  display: flex; flex-direction: column;
  animation: popIn .16s ease;
}
.modal-lg { max-width: 760px; }
.modal-head { display: flex; align-items: center; padding: 16px 20px 12px; }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 750; flex: 1; }
.modal-body { padding: 4px 20px 18px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(.97) translateY(6px); } }

.modal-close {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 20px; line-height: 1; padding: 4px 8px; border-radius: 6px;
}
.modal-close:hover { background: var(--surface-3); color: var(--ink); }

.preview-frame { width: 100%; height: 68vh; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
[data-theme="dark"] .preview-frame { background: #fff; }

/* send progress rows */
.prog { display: flex; flex-direction: column; gap: 6px; }
.prog-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.prog-row .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prog-row .st { width: 76px; flex: 0 0 auto; text-align: right; }
.prog-status { font-size: 11.5px; font-weight: 700; }
.prog-status.ok { color: #0E9F6E; }
.prog-status.bad { color: #C0392B; }
.spinner {
  width: 14px; height: 14px; border: 2px solid var(--line-strong);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .7s linear infinite; flex: 0 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- toasts ---------- */
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--snack-bg); color: var(--snack-ink); padding: 11px 16px;
  border-radius: 10px; box-shadow: var(--shadow-lg);
  font-size: 13.5px; font-weight: 600; max-width: 380px;
  animation: popIn .18s ease;
  display: flex; gap: 10px; align-items: flex-start;
}
.toast.err { background: #C0392B; }
.toast.ok { background: #0E9F6E; }
.toast .t-ico { flex: 0 0 auto; font-weight: 800; }

/* ---------- misc ---------- */
.kpi-note { font-size: 12px; color: var(--muted); }
.muted { color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }

.empty {
  text-align: center; padding: 46px 20px; color: var(--muted);
}
.empty .big { font-size: 15px; font-weight: 700; color: var(--slate); margin-bottom: 6px; }

.skeleton {
  border-radius: 8px;
  background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skel-table { display: flex; flex-direction: column; gap: 10px; }
.skel-table .skeleton { height: 38px; }

.pager { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.pager .pg { min-width: 30px; text-align: center; font-size: 13px; font-weight: 650; color: var(--slate); }
.pager .info { font-size: 12.5px; color: var(--muted); margin-right: auto; }

.chart-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; margin-bottom: 16px; }
@media (max-width: 960px) { .chart-grid { grid-template-columns: 1fr; } }
.chart-box { position: relative; height: 240px; }
.chart-box canvas { position: absolute; inset: 0; }

.errbox {
  background: var(--red-soft); color: #C0392B;
  border: 1px solid color-mix(in srgb, var(--red) 30%, transparent);
  padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 14px;
  font-size: 13.5px; font-weight: 550;
  display: none;
}
.errbox.show { display: block; }

.details-box { font-size: 13px; color: var(--slate); line-height: 1.6; }
.details-box code { font-family: var(--mono); font-size: 12px; background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }
.details-box .how { border-left: 3px solid var(--primary); background: var(--primary-soft); padding: 8px 12px; border-radius: 0 8px 8px 0; margin-top: 8px; }

/* responsive */
@media (max-width: 760px) {
  .sidebar { width: 62px; flex-basis: 62px; }
  .brand .txt, .nav-item span, .side-foot .iconbtn span { display: none; }
  .content { padding: 16px; }
  .foot { padding: 14px 16px 18px; }
  .topbar { padding: 12px 16px; }
}

/* ---------- applicant detail modal ---------- */
.modal-xl { max-width: 1000px; }

.dhead {
  background: var(--dhead-grad);
  border-radius: 10px;
  padding: 18px 20px 16px;
  color: #fff;
  margin-bottom: 14px;
}
.dhead.dhead-male {
  background: linear-gradient(120deg, #0A5CC5, #2B93FF);
}
.dhead.dhead-female {
  background: linear-gradient(120deg, #C2265C, #E8678F);
}
.dhead.dhead-unknown {
  background: linear-gradient(120deg, #4A3BBA, #6A5BD4);
}
.dhead.dhead-male .dbadge, .dhead.dhead-female .dbadge, .dhead.dhead-unknown .dbadge {
  background: rgba(255,255,255,.20);
  border-color: rgba(255,255,255,.45);
}
.dhead.dhead-male .btn, .dhead.dhead-female .btn, .dhead.dhead-unknown .btn {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.55);
}
.dhead.dhead-male .btn:hover, .dhead.dhead-female .btn:hover, .dhead.dhead-unknown .btn:hover {
  background: rgba(255,255,255,.32);
}
.dhead-main { display: flex; align-items: center; gap: 14px; }
.davatar {
  width: 52px; height: 52px; border-radius: 14px; flex: none;
  background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.35);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 19px; color: #fff;
}
.dhead-id { flex: 1; min-width: 0; }
.dname-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dname { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.dname.cp:hover { text-decoration: underline; text-underline-offset: 3px; }
.dpid {
  font-size: 12px; font-weight: 650; padding: 2.5px 10px; border-radius: 999px;
  background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.4);
  letter-spacing: .02em;
}
.dpid:hover { background: rgba(255,255,255,.36); }
.cp { cursor: pointer; }
.dhead-meta a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.dhead-meta a:hover { opacity: .85; }
.dbadges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.dbadge {
  font-size: 10.5px; font-weight: 700; padding: 2.5px 9px; border-radius: 999px;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35);
  color: #fff; text-transform: uppercase; letter-spacing: .04em;
}
.dhead-actions { display: flex; gap: 8px; flex-wrap: wrap; flex: none; }
.dhead .btn {
  background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.45);
}
.dhead .btn:hover { background: rgba(255,255,255,.3); }
.dhead-meta {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.25);
  display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px;
  color: rgba(255,255,255,.92); font-weight: 550;
}

.dcols { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,1fr); gap: 14px; align-items: start; }
.dcol { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.dcard {
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); padding: 14px 16px; min-width: 0;
}
.dcard-title {
  font-size: 11px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px;
}

.dlist { display: flex; flex-direction: column; }
.drow {
  display: flex; justify-content: space-between; gap: 18px;
  padding: 6.5px 0; border-bottom: 1px dashed var(--line); font-size: 13px;
}
.drow:last-child { border-bottom: 0; padding-bottom: 0; }
.drow .dl { color: var(--muted); font-weight: 600; flex: none; }
.drow .dv { font-weight: 650; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.drow .dv .pill { font-size: 11px; }
/* opportunity title in the applicant popup — opens the project info modal */
.opplink {
  font: inherit; font-weight: 650; color: var(--primary-strong);
  background: none; border: 0; padding: 0; cursor: pointer;
  text-align: right; text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.opplink:hover { text-decoration-style: solid; }

/* ---------- Projects page (public catalogue) ---------- */
.thumb { width: 62px; height: 40px; object-fit: cover; border-radius: 6px; display: block; background: var(--surface-3); }
.thumb-none { background: var(--surface-3); border: 1px dashed var(--line-strong); }
.benefit-cell { min-width: 220px; }
.benefit-cell .pill { margin: 1.5px 3px 1.5px 0; }
.num { font-variant-numeric: tabular-nums; font-weight: 650; }
.modal-cover { width: 100%; max-height: 220px; object-fit: cover; border-radius: 10px; margin-bottom: 14px; }
.modal-body p { margin: 0 0 10px; white-space: normal; }
.modal-body p.strong { font-weight: 700; margin-bottom: 6px; }
.slots-title { font-size: 12px; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 14px 0 8px; }
.slot-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px;
}
.slot-row:last-child { border-bottom: 0; }
.slot-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.slot-side { display: flex; flex-direction: column; gap: 2px; align-items: flex-end; font-size: 12px; flex: none; }

/* ---------- Informations: the reference shelf ----------
   A docs page, not a chat: contents on the left (sticky), the documents on the
   right, and a search box that is the actual interface — it narrows all 41
   sections live and highlights the hit, so "where is the yellow" is one
   keystroke away. Reading measure is capped on the text so a 1400px screen
   does not stretch paragraphs across the page. */
.info-wrap { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 14px; align-items: start; }
.info-toc { position: sticky; top: 74px; max-height: calc(100vh - 96px); overflow: auto; padding: 14px 16px; }
.info-toc-shelf + .info-toc-shelf { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.info-toc-shelfname { font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 4px; }
.info-toc-doc {
  display: block; padding: 2px 0 2px 8px; font-size: 12px; color: var(--slate); text-decoration: none;
  border-left: 2px solid transparent; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.info-toc-doc:hover { color: var(--primary-strong); border-left-color: var(--primary); }

/* shelves: the documents build on each other, so the page says in which order */
.info-shelf { margin-bottom: 18px; }
.info-shelfhead { display: flex; align-items: baseline; gap: 10px; margin: 0 2px 8px; }
.info-shelfname { margin: 0; font-size: 13px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.info-kind {
  flex: none; padding: 2px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 750;
  text-transform: uppercase; letter-spacing: .05em;
  background: var(--surface-3); color: var(--muted);
}
.info-kind.kind-charter { background: var(--amber-soft); color: #B06A10; }
.info-kind.kind-policy { background: var(--primary-soft); color: var(--primary-strong); }
.info-kind.kind-identity { background: var(--green-soft); color: #0E9F6E; }
.info-meta { margin-left: auto; }
.info-note { margin: 4px 0 0; color: var(--slate); }
.info-related { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 8px 0 0; }
.info-rel {
  font: inherit; font-size: 11.5px; font-weight: 650; cursor: pointer;
  padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--slate); text-decoration: none;
}
.info-rel:hover { border-color: var(--primary); color: var(--primary-strong); }
.info-flash { box-shadow: 0 0 0 2px var(--primary); }
.info-doc[hidden] { display: none; }
.info-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.info-doc { padding: 16px 18px; }
/* a family — the APIP with its nine annexes, the charter with its 16
   regulations — is ONE section on the shelf, its parts listed inside it as rows
   rather than as cards beside their own document */
.info-family { padding: 16px 18px; }
.info-famhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.info-famhead .info-title { font-size: 18px; }
.info-famhead .info-famtoggle { margin-left: auto; }
.info-famdocs { margin-top: 12px; border-top: 1px solid var(--line); }
.info-famdocs .info-doc {
  padding: 13px 0 0; background: none; border: 0; border-radius: 0; box-shadow: none;
}
.info-famdocs .info-doc + .info-doc { margin-top: 13px; border-top: 1px solid var(--line); }
.info-famdocs .info-title { font-size: 15px; }
.info-toc-fam { margin: 7px 0 1px; font-size: 11.5px; font-weight: 750; color: var(--slate); }
.info-toc-sub { padding-left: 14px; }
.info-dhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.info-title { margin: 0; font-size: 17px; font-weight: 750; letter-spacing: -.01em; }
.info-tag {
  flex: none; padding: 3px 10px; border-radius: 999px; background: var(--primary-soft);
  color: var(--primary-strong); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em;
}
.info-dhead .btn { margin-left: auto; }
.info-about { margin: 6px 0 0; line-height: 1.55; }
.info-sec { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.info-sec:target, .info-doc:target { scroll-margin-top: 80px; }
.info-shead { display: flex; align-items: baseline; gap: 8px; margin: 0 0 6px; font-size: 14px; font-weight: 700; }
.info-anchor { color: var(--line-strong); text-decoration: none; font-weight: 700; }
.info-anchor:hover { color: var(--primary); }
.info-page {
  flex: none; margin-left: auto; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-3); color: var(--muted);
  font-size: 11px; font-weight: 700; text-decoration: none;
}
.info-page:hover { color: var(--primary-strong); background: var(--primary-soft); }
/* the reading column: capped measure, airy lines, and the documents' own
   numbering hung in a column so clauses line up and their depth shows */
.info-content { max-width: 74ch; font-size: 13.5px; line-height: 1.66; }
.info-content p { margin: 0 0 9px; }
.info-content h4 { margin: 14px 0 6px; font-size: 12.5px; font-weight: 750; letter-spacing: .02em; color: var(--slate); text-transform: uppercase; }
.info-content ul { margin: 0 0 10px; padding-left: 20px; }
.info-content li { margin: 4px 0; }
.info-content .clause { display: grid; grid-template-columns: minmax(3.2em, auto) 1fr; gap: 0 12px; margin: 0 0 7px; padding-left: 4px; }
.info-content .clause[data-d="3"] { margin-left: 16px; }
.info-content .clause[data-d="4"] { margin-left: 30px; }
.info-content .clause[data-d="5"] { margin-left: 44px; }
.info-content .cnum { color: var(--muted); font-weight: 650; font-size: 12px; text-align: right; padding-top: 2px; white-space: nowrap; }
.info-content .clause:hover .cnum { color: var(--primary-strong); }
.info-sec + .info-sec { margin-top: 18px; }
/* the shelf's own display rules (display: block on the TOC links) outrank the
   browser's [hidden] rule, so hiding has to be said here too — without this the
   contents list stays full while the search narrows the documents */
.info-wrap [hidden] { display: none !important; }
.info mark { background: var(--yellow); color: #1C232F; border-radius: 3px; padding: 0 1px; }
.info kbd {
  font: inherit; font-size: 10.5px; font-weight: 700; padding: 0 5px;
  border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px;
  background: var(--surface-3); color: var(--muted);
}
@media (max-width: 1000px) {
  .info-wrap { grid-template-columns: 1fr; }
  .info-toc { position: static; max-height: none; }
}

/* ---------- History of Asia: one card per executive board ----------
   A roster, not a table: each seat is a small tile (name over role) in an
   auto-filling grid, so a 10-seat board reads as one glance and the page stays
   usable at any width. The LCP wears the amber "leadership" wash the design
   system already uses for pending/warn, and the term is a soft-primary pill —
   no new colours, all three themes follow the tokens. */
.hoa-src { margin: 0; line-height: 1.55; }
.hoa-src a { color: var(--primary-strong); }
.hoa-board { padding: 14px 16px; }
.hoa-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.hoa-term {
  flex: none; padding: 3px 10px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-strong);
  font-size: 12px; font-weight: 750; letter-spacing: .02em;
}
.hoa-eb { font-size: 15px; font-weight: 750; letter-spacing: .01em; }
.hoa-n { margin-left: auto; }
.hoa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 7px; }
.hoa-person {
  position: relative; display: flex; flex-direction: column; gap: 1px;
  padding: 7px 30px 7px 11px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface);
  transition: background .12s, border-color .12s;
}
.hoa-person:hover { background: var(--surface-3); }
.hoa-person.lead { background: var(--amber-soft); border-color: transparent; }
.hoa-name { font-size: 13.5px; font-weight: 650; }
.hoa-role { font-size: 11.5px; color: var(--muted); }
.hoa-person.lead .hoa-role { color: inherit; }
.hoa-in {
  position: absolute; top: 7px; right: 9px;
  width: 17px; height: 17px; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gta-soft); color: var(--gta-strong);
  font-size: 10px; font-weight: 800; text-decoration: none; letter-spacing: .01em;
}
.hoa-in:hover { background: var(--gta); color: var(--on-prog); }
@media (max-width: 700px) { .hoa-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Projects: the filter panel ----------
   Every filter lives in ONE 12-column grid, so labels and controls share a
   column rhythm. The old pair of wrapped flex toolbars gave each row its own
   x positions and control widths from 97px (Duration type) to 430px (SDG).
   Band 1 is search/sort/reload, band 2 the grid, band 3 the benefits — a
   sub-band of the same card rather than a second card, so the table starts
   higher up the page. */
.pfilters .pf-top { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 14px; margin-bottom: 14px; }
.pfilters .pf-top .grow { flex: 1 1 320px; }
.pfilters .pf-sort { flex: 0 0 216px; }
.pfilters .pf-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 11px 16px; }
.pfilters .pf-grid > .field { grid-column: span 3; }
.pfilters .pf-grid > .pf-wide { grid-column: span 4; }
@media (max-width: 1420px) {
  .pfilters .pf-grid > .field, .pfilters .pf-grid > .pf-wide { grid-column: span 4; }
}
@media (max-width: 1140px) {
  .pfilters .pf-grid > .field, .pfilters .pf-grid > .pf-wide { grid-column: span 6; }
}
@media (max-width: 720px) {
  .pfilters .pf-grid > .field, .pfilters .pf-grid > .pf-wide { grid-column: span 12; }
  .pfilters .pf-sort { flex: 1 1 100%; }
}

/* one control height everywhere, so the bottom edge of every field in a row
   sits on the same line — inputs, selects, multiselect triggers and chips */
.pfilters .field > label { display: block; }
.pfilters .pf-top .field > .input,
.pfilters .pf-grid > .field > .input { height: 34px; padding: 0 11px; font-size: 13px; }
.pfilters .pf-grid > .field > .input { width: 100%; }
.pfilters input[type="number"].input { padding: 0 8px; }
.pfilters .msel { display: block; }
.pfilters .msel-trig { width: 100%; min-width: 0; height: 34px; padding: 0 11px; font-size: 13px; }
.pfilters .pf-top .btn { height: 34px; padding: 0 14px; }
.pfilters .chips { align-items: center; min-height: 34px; }
.pfilters .chip > span { height: 34px; padding: 0 12px; }

/* the fee reads as one control: [€] [min] – [max] */
.pfilters .pf-range { display: flex; align-items: center; gap: 6px; max-width: 330px; }
.pfilters .pf-range .pf-cur { flex: 0 0 58px; padding: 0 4px 0 8px; }
.pfilters .pf-range input.input { flex: 1 1 0; min-width: 0; }
.pfilters .pf-range .pf-dash { flex: none; color: var(--muted); }

.pfilters .pf-sub { margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--line); }
.pfilters .pf-sub .card-title { margin: 0 0 10px; font-size: 12px; }

/* Benefits: rows of segmented tri-state controls */
.bengrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 28px; }
@media (max-width: 900px) { .bengrid { grid-template-columns: 1fr; } }
.benrow { display: flex; align-items: center; gap: 12px; }
.pfilters .seg { padding: 2px; }
.pfilters .seg label { padding: 5px 12px; }
.benrow-wide { grid-column: 1 / -1; }
/* Fixed label column so the controls sit right next to their names and all
   rows line up (the old space-between pushed Food's options to the far edge
   of the full-width row). */
.benname { flex: 0 0 115px; font-size: 13px; font-weight: 650; color: var(--slate); }
/* The meal-count options inside the Food control are scan-mode: visually
   separated from the coverage options with a divider. */
.seg label.seg-meals { border-left: 1px solid var(--line-strong); border-radius: 0 8px 8px 0; color: var(--muted); }
.benscan-note {
  margin-top: 12px; font-size: 12.5px; color: var(--muted); line-height: 1.5;
  background: var(--surface); border: 1px dashed var(--line-strong);
  border-radius: 8px; padding: 8px 12px;
}

/* Multiselect dropdown (countries / backgrounds) */
.msel { position: relative; display: inline-block; }
.msel-trig { min-width: 170px; display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; }
.msel-trig svg { width: 13px; height: 13px; }
.msel-trig span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msel-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 10px; box-shadow: var(--shadow-lg);
  width: 280px; max-height: 360px; display: flex; flex-direction: column;
}
.msel-search { margin: 8px; width: calc(100% - 16px); flex: none; font-size: 12.5px; }
.msel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px 0; }
.msel-head .btn { padding: 3px 9px; font-size: 11.5px; }
.msel-selinfo { font-size: 11.5px; color: var(--muted); }
.msel-body { overflow-y: auto; padding: 2px 8px 8px; }
.msel-region {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px 4px; font-size: 12.5px; font-weight: 750;
  color: var(--slate); border-bottom: 1px dashed var(--line);
  cursor: pointer; user-select: none;
}
.msel-region:hover { background: var(--surface-2); }
.msel-region .msel-check span { color: var(--slate); }
.msel-chev { width: 12px; flex: none; color: var(--muted); font-size: 10px; }
.msel-item {
  display: flex; align-items: center; gap: 8px;
  padding: 4.5px 8px 4.5px 26px; border-radius: 6px; font-size: 13px;
}
.msel-item:hover { background: var(--surface-3); }
.msel-country { cursor: pointer; }
.msel-lc { padding-left: 46px; font-size: 12.5px; }
.msel-lc .msel-check span { color: var(--slate); }
.msel-check { display: flex; align-items: center; gap: 8px; cursor: pointer; flex: 1; min-width: 0; }
.msel-check input { accent-color: var(--primary); flex: none; }
.msel-check span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msel-cnt { margin-left: auto; color: var(--muted); font-size: 11.5px; font-weight: 650; }

.qbox {
  margin-top: 10px; background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--primary); border-radius: 8px;
  padding: 10px 13px; font-size: 13px; line-height: 1.55; color: var(--slate);
  white-space: pre-wrap; overflow-wrap: anywhere;
}

.stepper { display: flex; flex-direction: column; }
.step { position: relative; display: flex; gap: 12px; padding-bottom: 16px; }
.step:last-child { padding-bottom: 0; }
.step::before {
  content: ""; position: absolute; left: 5.5px; top: 15px; bottom: 0;
  width: 2px; background: var(--line-strong);
}
.step:last-child::before { display: none; }
.sdot {
  width: 13px; height: 13px; border-radius: 50%; flex: none; margin-top: 2px;
  background: var(--surface); border: 3.5px solid var(--primary); position: relative; z-index: 1;
}
.step:last-child .sdot { border-color: var(--green); }
.sbody { flex: 1; min-width: 0; }
.slabel { font-weight: 650; font-size: 13px; line-height: 1.3; }
.smeta { font-size: 12px; color: var(--muted); margin-top: 1px; }
.smeta .swho { color: var(--slate); }
.schg { font-size: 11px; color: var(--muted); font-family: var(--mono); margin-top: 3px; }

.skel-detail { display: flex; flex-direction: column; gap: 10px; }
.skel-detail .skeleton { height: 22px; }
.skel-detail .skeleton:nth-child(2) { height: 90px; }

.cell-click { cursor: pointer; }
.cell-click:hover .cell-main .strong { color: var(--primary); }

@media (max-width: 820px) {
  .dcols { grid-template-columns: 1fr; }
  .dhead-main { flex-wrap: wrap; }
  .dhead-actions { width: 100%; }
}

/* ---------- profile photos ---------- */
.avatar-ph { position: relative; display: inline-block; flex: 0 0 auto; }
.avatar-ph .avatar-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border-radius: 50%; object-fit: cover; z-index: 1;
}
.davatar { position: relative; overflow: hidden; }
.davatar-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 1;
}

/* ---------- copied bubble ---------- */
.copied-bubble {
  position: fixed; transform: translate(-50%, -100%);
  background: var(--ink); color: var(--bg);
  font-size: 11.5px; font-weight: 700;
  padding: 4px 11px; border-radius: 999px;
  opacity: 0; pointer-events: none;
  transition: opacity .15s ease;
  z-index: 1200;
  box-shadow: var(--shadow-lg);
}
.copied-bubble.show { opacity: 1; }
.copied-bubble::after {
  content: ""; position: absolute; left: 50%; bottom: -4px;
  transform: translateX(-50%);
  border: 4px solid transparent; border-top-color: var(--ink); border-bottom: 0;
}

/* ---------- resizable applicants table ---------- */
#tbl { table-layout: fixed; width: max-content; min-width: 100%; }
#tbl tbody td { overflow: hidden; text-overflow: ellipsis; }
.colgrip {
  position: absolute; right: -3px; top: 0; bottom: 0; width: 7px;
  cursor: col-resize; z-index: 6;
}
.colgrip:hover, .colgrip:active { background: var(--primary); opacity: .5; border-radius: 3px; }
body.resizing { cursor: col-resize; user-select: none; }
body.resizing * { cursor: col-resize !important; }

/* ---------- drag-to-reorder columns ---------- */
body.col-dragging { cursor: grabbing; -webkit-user-select: none; user-select: none; }
body.col-dragging * { cursor: grabbing !important; -webkit-user-select: none !important; user-select: none !important; }
.tbl thead th.drag-src { opacity: .4; }
.tbl thead th.drop-before { box-shadow: inset 2.5px 0 0 var(--primary); }
.tbl thead th.drop-after { box-shadow: inset -2.5px 0 0 var(--primary); }

/* ---------- EXPA actions menu ---------- */
.actions-menu {
  position: fixed; z-index: 200; min-width: 200px; max-width: 240px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-lg);
  padding: 6px; display: flex; flex-direction: column; gap: 2px;
}
.actions-menu .actbtn {
  text-align: left; padding: 7px 10px; font-size: 13px; border-radius: 6px;
  background: transparent; border: none; color: inherit; cursor: pointer;
}
.actions-menu .actbtn:hover { background: var(--primary-soft); color: var(--primary-strong); }
.actions-menu .act-loading,
.actions-menu .act-error,
.actions-menu .act-none {
  padding: 8px 10px; font-size: 12.5px; color: var(--muted);
  white-space: normal;
}
.actrow { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- analytics deep dive ---------- */
.funrow { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.funlbl { width: 92px; flex: 0 0 auto; font-size: 12.5px; font-weight: 650; color: var(--muted); }
.funbar { flex: 1; height: 18px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.funbar > div { height: 100%; border-radius: 4px; transition: width .4s ease; }
.funnum { width: 92px; flex: 0 0 auto; font-size: 12.5px; font-weight: 650; color: var(--text); text-align: right; }

table.lctable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.lctable thead th {
  text-align: left; font-size: 11.5px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
  padding: 8px 12px; border-bottom: 1px solid var(--line);
  cursor: pointer; user-select: none; white-space: nowrap;
}
.lctable thead th.num { text-align: right; }
.lctable thead th:hover { color: var(--primary); }
.lctable thead th.sort-asc::after { content: " ▲"; color: var(--primary); }
.lctable thead th.sort-desc::after { content: " ▼"; color: var(--primary); }
.lctable tbody td { padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.lctable tbody td.num { text-align: right; }
.lctable tbody tr:last-child td { border-bottom: none; }
.lctable tbody tr:hover td { background: var(--surface-2); }
.lctable td.num.pct-good { color: #0E9F6E; font-weight: 750; }
.lctable td.num.pct-mid { color: #B06A10; font-weight: 750; }
.lctable td.num.pct-low { color: #C0392B; font-weight: 650; }

.chart-empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13px; font-weight: 600; text-align: center;
  padding: 0 24px; pointer-events: none;
}

.lctable tbody tr.others-row td { color: var(--muted); font-style: italic; border-top: 1px solid var(--line-strong); }

/* ---------- compare periods (Analytics card) ---------- */
.cmp-pos { color: #0E9F6E; font-weight: 750; }
.cmp-neg { color: #C0392B; font-weight: 700; }
.cmp-flat { color: var(--muted); font-weight: 600; }
.cmp-better { background: color-mix(in srgb, var(--green) 12%, transparent); }
.cmp-worse { background: color-mix(in srgb, var(--red) 10%, transparent); }
[data-theme="dark"] .cmp-pos { color: #3BD0A9; }
[data-theme="dark"] .cmp-neg { color: #FF7A63; }
.cmp-periods { font-size: 12.5px; color: var(--slate); margin: -4px 0 12px; }
.cmp-periods b { color: var(--ink); }
/* diverging mini-bar under the movers Δ% (better = right+green, worse = left+red) */
.cmp-mbar { display: block; position: relative; height: 4px; background: var(--surface-3); border-radius: 2px; margin-top: 3px; overflow: hidden; }
.cmp-mbar i { position: absolute; top: 0; bottom: 0; border-radius: 2px; opacity: .7; }
/* custom (DOM) tooltip for the pacing chart — lifted above the hovered point
   with a gap so it never covers the cursor; flips below only when it would
   clip the chart's top edge */
.cmp-chart-tip {
  position: absolute; z-index: 6; pointer-events: none;
  transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 8px; box-shadow: var(--shadow-lg);
  padding: 7px 11px; font-size: 12.5px; line-height: 1.45; color: var(--ink);
  white-space: nowrap; opacity: 0;
  transition: opacity .12s ease;
}
.cmp-chart-tip .ct-title { font-weight: 750; margin-bottom: 2px; }
.cmp-chart-tip .ct-row { display: flex; align-items: center; gap: 6px; }
.cmp-chart-tip .ct-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }

/* ---------- Analytics page: same density rules as the NTT mirror ----------
   The panel was four blocks of prose-spaced cards; the conversion strip and
   the funnel are both three-row summaries, so they pair, and the tables get the
   same tighter cells + group rules the NTT page uses. */
.ana .card { padding: 14px 16px; }
.ana .subhead { margin: 14px 0 8px; }
.ana .lctable thead th, .ana .lctable tbody td { padding: 6px 10px; }
.ana .lctable th.sep, .ana .lctable td.sep { border-left: 1px solid var(--sep); }
.ana-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
.ana-pair .subhead { margin-top: 0; }
@media (max-width: 1180px) { .ana-pair { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Analytics page: sticky filter bar, section subheads, jump links ---------- */
/* The filter card scrolls away with the page (it used to pin under the
   topbar; the jump-offset maths below still only has the topbar to clear). */

/* Deep-dive jump targets carry the bar offset as their OWN scroll-margin
   (--scrolloffset = topbar + 12px, measured by the page JS)
   instead of a root scroll-padding-top: Chrome honours a root scroll-padding
   in its focus-scroll as well, so clicking a control inside the stuck filter
   card — whose layout position sits at the top of the document — scrolled the
   page up, sometimes to the very top. scroll-margin only affects scrolling TO
   that element, never the focus of anything else. */
.subhead {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 12px; font-weight: 750; color: var(--slate);
  text-transform: uppercase; letter-spacing: .06em;
  margin: 20px 0 10px;
  scroll-margin-top: var(--scrolloffset, 0px);
}
#comparecard { scroll-margin-top: var(--scrolloffset, 0px); }
.subhead::before {
  content: ''; width: 3px; height: 15px; border-radius: 2px;
  background: var(--primary); flex: 0 0 auto;
}
.subhead .kpi-note { text-transform: none; letter-spacing: 0; }
.subhead .grow { flex: 1; }

/* jump-link chips are anchors, not toggles */
a.chip { text-decoration: none; }

/* ---------- NTT page ---------- */
/* One sentence that says what the whole page is scoped to — the department is
   the only scope control, so it has to be impossible to miss. */
.scope-line {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin: 0 2px 12px; padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft); color: var(--ink);
  font-size: 13px; border-left: 3px solid var(--primary);
}
[data-theme="dark"] .scope-line { color: var(--ink); }
/* "share of the leader" column on the national leaderboard */
.sharebar {
  display: inline-block; width: 100%; height: 6px; border-radius: 3px;
  background: var(--surface-3); overflow: hidden; vertical-align: middle;
}
.sharebar > span { display: block; height: 100%; border-radius: 3px; }
/* in-table section header rows (the Worldwide card stacks several tables) */
.tbl td.subrow { background: var(--surface-2); font-weight: 700; }

/* ---------- NTT layout: an analytical page, so denser and paired ----------
   Most of this page is 17-row tables with four or five columns; stacked full
   width they leave half the screen empty and scroll forever. Cells are
   tightened, and the short tables sit two-up. Both grids collapse to one
   column when the content area can no longer hold two readable tables. */
.ntt .card { padding: 14px 16px; margin-bottom: 14px; }
.ntt .tbl thead th { padding: 6px 10px; }
.ntt .tbl tbody td { padding: 6px 10px; }
.ntt .subhead { margin: 14px 0 8px; }
.ntt-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.ntt-split { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 14px; align-items: start; }
.ntt-cols .subhead { margin-top: 0; }
/* Group separator: a card's columns come in blocks (a period's goal/done/%,
   a phase's rank/value/leader), and without a line the eye reads straight
   across ten columns of the same weight. */
.ntt .tbl th.sep, .ntt .tbl td.sep { border-left: 1px solid var(--sep); }
@media (max-width: 1180px) {
  .ntt-cols, .ntt-split { grid-template-columns: minmax(0, 1fr); }
}
/* "us" / "not us" markers beside an LC name. NOT `.tag`: that class only sets
   `color: var(--on-prog)` and expects a programme colour to supply the
   background, so on its own it paints white-on-white (light) or navy-on-navy
   (For Asia) — the other Istanbul LC was there, just invisible. */
.lc-us {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  background: var(--gta-soft); color: var(--gta-strong);
  font-size: 10.5px; font-weight: 750; letter-spacing: .02em;
}

/* ---------- Analytics: insight line, KPI deltas, NTT strip, LC links ---------- */
.kpi-delta { font-weight: 750; font-size: 11px; margin-left: 4px; color: var(--muted); }
.kpi-delta.up { color: #0E9F6E; }
.kpi-delta.down { color: #C0392B; }
.kpi-delta.new { color: var(--gta-strong); }
#ins-line { font-style: italic; }
.nttline {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 7px 12px; margin: 0 0 12px; font-size: 13px;
}
.nttline .ntttag {
  background: var(--gta-soft); color: var(--gta-strong);
  border-radius: 999px; padding: 2px 9px; font-size: 10.5px; font-weight: 750;
  letter-spacing: .02em;
}
.nttline b { font-weight: 800; }
.nttline .kpi-note { margin-left: auto; }
.lctable a.lclink { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--muted); }
.lctable a.lclink:hover { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- print: white, clean, whole-card ---------- */
@media print {
  .sidebar, .topbar, .onboard, .toast, .toasts, .pager, .btn,
  #lbcolpick, .filtercard .btn, .colgrip, #comparecard .btn { display: none !important; }
  html, body { background: #fff !important; }
  .main { overflow: visible !important; }
  .content, .card, .stat, .chart-box, .nttline {
    background: #fff !important; color: #111827 !important;
    box-shadow: none !important; border-color: #d1d5db !important;
  }
  .card { break-inside: avoid; page-break-inside: avoid; }
  .subhead, .kpi-note, .lbl, .num { color: #374151 !important; }
  .lctable thead th, .lctable tbody td, .tbl th, .tbl td { color: #111827 !important; }
  .lctable td.num.pct-good, .cmp-pos { color: #0E9F6E !important; }
  .lctable td.num.pct-mid { color: #B06A10 !important; }
  .lctable td.num.pct-low, .cmp-neg { color: #C0392B !important; }
  .others-row td { color: #6B7280 !important; }
  .tblwrap { max-height: none !important; overflow: visible !important; }
  a { color: #111827 !important; text-decoration: none !important; }
  canvas { max-width: 100% !important; }
}

/* Conversion-over-time rate picker: small chips inside the subhead */
.trend-picks { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.trate {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 650; color: var(--slate);
  cursor: pointer; text-transform: none; letter-spacing: 0;
}
.trate input { accent-color: var(--primary); margin: 0; }
.trate i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.trate input:disabled + i { opacity: .35; }
.trate:has(input:disabled) { color: var(--muted); cursor: not-allowed; }

/* ---------- nav teasers: CORE, Asian Intelligence (no pages yet) ---------- */
/* .nav-item styles an <a>; a <button> needs its defaults reset to match. */
button.nav-item { width: 100%; text-align: left; background: none; border: 0; font: inherit; }
.soonpop {
  position: fixed; z-index: 60; width: 190px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-lg); padding: 12px 14px;
}
.soonpop-x {
  position: absolute; top: 6px; right: 8px;
  border: 0; background: none; color: var(--muted); cursor: pointer;
  font-size: 12px; line-height: 1; padding: 4px;
}
.soonpop-x:hover { color: var(--ink); }
.soonpop-t { font-weight: 800; font-size: 13px; letter-spacing: .04em; color: var(--ink); }
.soonpop-b { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
