/* =====================================================================
   i-School Consult Programme Manager
   Everything reads from the tokens below, so light/dark is one attribute flip
   (html[data-bs-theme]). Brand red is sampled from the logo.
   ===================================================================== */
:root {
  --brand: #ef3037;
  --brand-dark: #c4222a;
  --brand-deep: #a81c22;
  --brand-tint: #fdecec;
  --brand-tint-strong: rgba(239,48,55,.18);

  --page: #f3f4f8;
  --surface: #ffffff;
  --surface-alt: #f7f8fb;
  --surface-raised: #ffffff;
  --input-bg: #ffffff;
  --border: #e7e9ee;
  --border-strong: #d5d9e0;
  --text: #1f2430;
  --text-muted: #6b7280;

  --radius: .75rem;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --shadow-md: 0 8px 24px rgba(16,24,40,.12);

  --indigo-bg:#eef2ff; --indigo-fg:#3730a3;
  --amber-bg:#fff4d6;  --amber-fg:#92600a;
  --green-bg:#e3f5ea;  --green-fg:#17653a;
  --grey-bg:#eef0f3;   --grey-fg:#566070;
  --teal-bg:#dff4f4;   --teal-fg:#0f6b6b;
  --red-bg:#fde8e8;    --red-fg:#9b1c1c;
  --brandt-bg:#fdecec; --brandt-fg:#a81c22;

  --side-bg: #12151c; --side-bg-2: #181c26; --side-ink: #aab1c0;

  --bs-primary: #ef3037;
  --bs-primary-rgb: 239, 48, 55;
  --bs-body-bg: var(--page);
  --bs-body-color: var(--text);
  --bs-border-color: var(--border);
  --bs-link-color: #d1242c;
  --bs-link-color-rgb: 209, 36, 44;
  --bs-link-hover-color: #a81c22;
  --bs-link-hover-color-rgb: 168, 28, 34;
  --bs-border-radius: .5rem;
  color-scheme: light;
}

[data-bs-theme="dark"] {
  --brand-tint: rgba(239,48,55,.14);
  --brand-tint-strong: rgba(239,48,55,.28);

  --page: #0d1017;
  --surface: #151a24;
  --surface-alt: #1a202c;
  --surface-raised: #1b2230;
  --input-bg: #0f131b;
  --border: #263042;
  --border-strong: #34405a;
  --text: #e6e9f0;
  --text-muted: #96a0b2;

  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 1px 3px rgba(0,0,0,.35);
  --shadow-md: 0 12px 28px rgba(0,0,0,.55);

  --indigo-bg:rgba(129,140,248,.16); --indigo-fg:#a5b4fc;
  --amber-bg:rgba(245,176,45,.16);   --amber-fg:#f6c75e;
  --green-bg:rgba(52,199,120,.16);   --green-fg:#6fe0a3;
  --grey-bg:rgba(148,163,184,.16);   --grey-fg:#aab4c4;
  --teal-bg:rgba(45,212,191,.16);    --teal-fg:#5eead4;
  --red-bg:rgba(248,113,113,.16);    --red-fg:#fca5a5;
  --brandt-bg:rgba(239,48,55,.2);    --brandt-fg:#ff8a8f;

  --side-bg: #0a0d13; --side-bg-2: #0f131b;

  --bs-body-bg: var(--page);
  --bs-body-color: var(--text);
  --bs-border-color: var(--border);
  --bs-link-color: #ff7a7f;
  --bs-link-color-rgb: 255, 122, 127;
  --bs-link-hover-color: #ffa0a4;
  --bs-link-hover-color-rgb: 255, 160, 164;
  color-scheme: dark;
}

html { font-size: 15px; }
@media (min-width: 768px) { html { font-size: 16px; } }

body {
  background: var(--page); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, .h1, h2, .h2, h3, .h3, h4, .h4 { font-weight: 650; letter-spacing: -.01em; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
.text-muted { color: var(--text-muted) !important; }

/* ---------- icons ---------- */
.ico, .icon-svg { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico-sm { width: 16px; height: 16px; flex-basis: 16px; }

/* ---------- cards, panels, tables ---------- */
.card, .panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  --bs-card-bg: var(--surface); --bs-card-cap-bg: transparent; --bs-card-border-color: var(--border); --bs-card-color: var(--text);
}
.card-header { padding: .85rem 1.25rem; font-size: .95rem; font-weight: 600; border-bottom: 1px solid var(--border); }
.card-body { padding: 1.25rem; }
.panel { overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.panel-head h2 { margin: 0; font-size: 1.05rem; font-weight: 650; display: flex; align-items: center; gap: .55rem; }
.panel-head h2 .count { font-size: .75rem; font-weight: 600; color: var(--text-muted); background: var(--surface-alt); border: 1px solid var(--border); border-radius: 99px; padding: .05rem .5rem; }
.panel-body { padding: 1.25rem; }
.panel .table-responsive { border: 0; border-radius: 0; box-shadow: none; }

.table-responsive { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.table { margin-bottom: 0; --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-border-color: var(--border); }
.table > :not(caption) > * > * { padding: .7rem .9rem; border-bottom-color: var(--border); }
.table thead th {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 600;
  background: var(--surface-alt); border-bottom: 1px solid var(--border);
}
.table tbody tr:last-child > * { border-bottom: 0; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--surface-alt); color: var(--text); }
.table td, .table th { font-variant-numeric: tabular-nums; }
.table a:not(.btn) { color: var(--text); font-weight: 600; }
.table a:not(.btn):hover { color: var(--brand-dark); text-decoration: none; }
.table .table-actions a { color: var(--bs-link-color); font-weight: 600; }
.table-nums th, .table-nums td { white-space: nowrap; }
.table-nums .cohort-col { white-space: normal; }
.cohort-col { min-width: 14rem; }
.cell-clip { max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 575.98px) { .cell-clip { max-width: 7rem; } }

/* ---------- pills / tags ---------- */
.pill { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; background: var(--p-bg, var(--grey-bg)); color: var(--p-fg, var(--grey-fg)); }
.pill-registered, .pill-furthertraining, .pill-facilitator { --p-bg: var(--indigo-bg); --p-fg: var(--indigo-fg); }
.pill-intraining { --p-bg: var(--amber-bg); --p-fg: var(--amber-fg); }
.pill-completed, .pill-employed, .pill-active { --p-bg: var(--green-bg); --p-fg: var(--green-fg); }
.pill-ownbusiness { --p-bg: var(--teal-bg); --p-fg: var(--teal-fg); }
.pill-unemployed { --p-bg: var(--red-bg); --p-fg: var(--red-fg); }
.pill-manager, .pill-finance { --p-bg: var(--teal-bg); --p-fg: var(--teal-fg); }
.pill-admin { --p-bg: var(--brandt-bg); --p-fg: var(--brandt-fg); }
.pill-withdrawn, .pill-other, .pill-inactive { --p-bg: var(--grey-bg); --p-fg: var(--grey-fg); }
.pill-lg { font-size: .8rem; padding: .25rem .75rem; }

.tag { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .65rem; border-radius: .5rem; font-size: .78rem; font-weight: 600; background: var(--surface-alt); border: 1px solid var(--border); color: var(--text-muted); }
.tag-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em; color: var(--text); }
.tag-warn { background: var(--amber-bg); color: var(--amber-fg); border-color: transparent; }

.avatar-sm {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: .75rem; font-weight: 700; color: #fff; background: linear-gradient(135deg, #ff5b61, #c4222a); overflow: hidden;
}
.avatar-sm img { width: 100%; height: 100%; object-fit: cover; }
.name-cell { display: flex; align-items: center; gap: .7rem; }
.name-cell .sub { display: block; font-size: .78rem; font-weight: 400; color: var(--text-muted); }

/* ---------- buttons, forms ---------- */
.btn { font-weight: 600; border-radius: .55rem; padding: .5rem 1rem; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; }
.btn-sm { padding: .3rem .65rem; }
.btn-primary {
  --bs-btn-bg: #ef3037; --bs-btn-border-color: #ef3037; --bs-btn-color: #fff;
  --bs-btn-hover-bg: #d1242c; --bs-btn-hover-border-color: #c4222a; --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: #a81c22; --bs-btn-active-border-color: #a81c22;
  --bs-btn-disabled-bg: #ef3037; --bs-btn-disabled-border-color: #ef3037;
  box-shadow: 0 1px 2px rgba(239,48,55,.3);
}
.btn-outline-primary {
  --bs-btn-color: var(--bs-link-color); --bs-btn-border-color: #ef3037;
  --bs-btn-hover-bg: #ef3037; --bs-btn-hover-border-color: #ef3037; --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: #d1242c; --bs-btn-active-border-color: #d1242c; --bs-btn-active-color: #fff;
}
.btn-outline-secondary {
  --bs-btn-color: var(--text-muted); --bs-btn-border-color: var(--border-strong);
  --bs-btn-hover-bg: var(--surface-alt); --bs-btn-hover-color: var(--text); --bs-btn-hover-border-color: var(--border-strong);
  --bs-btn-active-bg: var(--surface-alt); --bs-btn-active-color: var(--text);
}

.form-label { font-weight: 600; font-size: .875rem; margin-bottom: .3rem; }
.form-control, .form-select { background-color: var(--input-bg); color: var(--text); border-color: var(--border-strong); padding: .6rem .8rem; border-radius: .55rem; }
.form-control::placeholder { color: var(--text-muted); opacity: .8; }
.form-control:focus, .form-select:focus { background-color: var(--input-bg); color: var(--text); border-color: var(--brand); }
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-select:focus, .form-check-input:focus { box-shadow: 0 0 0 .22rem rgba(239,48,55,.22); }
.form-check-input { width: 1.15em; height: 1.15em; background-color: var(--input-bg); border-color: var(--border-strong); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.text-danger { font-size: .85rem; }

.page-link { color: var(--bs-link-color); background: var(--surface); border-color: var(--border); }
.page-link:hover { background: var(--surface-alt); }
.page-item.active .page-link { background: var(--brand); border-color: var(--brand); color: #fff; }

.alert { border-radius: var(--radius); border: 0; box-shadow: var(--shadow); }
.alert-success { background: var(--green-bg); color: var(--green-fg); }
.alert-warning { background: var(--amber-bg); color: var(--amber-fg); }
.alert-light { background: var(--surface); color: var(--text); border: 1px solid var(--border); }

.filter-bar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1rem 1.1rem; margin-left: 0; margin-right: 0; --bs-gutter-x: .75rem; }

/* ---------- signature + photo capture ---------- */
.signature-canvas { width: 100%; height: 180px; border: 2px dashed var(--border-strong); border-radius: var(--radius); background: #fff; touch-action: none; cursor: crosshair; }
.signature-canvas:hover { border-color: var(--brand); }
.signature-view { display: block; max-width: 100%; width: auto; height: auto; max-height: 110px; object-fit: contain; padding: .5rem .75rem; background: #fff; border: 1px solid var(--border); border-radius: .6rem; }

/* choices-lite (shared with the PMS) expects these token names */
:root { --radius-token: var(--radius); }

/* ---------- login ---------- */
.login-wrap { min-height: 70vh; display: flex; align-items: center; }
.login-card { padding: 2rem 1.75rem; border-top: 4px solid var(--brand); }
.login-logo { max-width: 240px; width: 100%; height: auto; }
[data-bs-theme="dark"] .login-logo { background: #fff; border-radius: .75rem; padding: .75rem 1rem; }

/* =====================================================================
   APP SHELL: dark sidebar + content column
   ===================================================================== */
:root { --side-w: 264px; }
.shell { display: flex; min-height: 100vh; }
.main-col { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.content { flex: 1 0 auto; width: 100%; max-width: 1360px; padding: 2rem 2.25rem 1.5rem; margin: 0 auto; }
.content-guest { max-width: 1100px; }
.app-footer { padding: 1rem 2.25rem; font-size: .8rem; color: var(--text-muted); border-top: 1px solid var(--border); }

.sidebar {
  position: sticky; top: 0; height: 100vh; width: var(--side-w); flex: 0 0 var(--side-w);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--side-bg-2) 0%, var(--side-bg) 100%);
  color: var(--side-ink); border-right: 1px solid rgba(255,255,255,.04); z-index: 1040;
}
.side-brand { display: flex; align-items: center; gap: .75rem; padding: 1.25rem 1.25rem 1.1rem; text-decoration: none !important; border-bottom: 1px solid rgba(255,255,255,.07); }
.side-brand img { height: 38px; width: auto; }
.side-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.side-brand-text strong { color: #fff; font-size: 1rem; font-weight: 700; letter-spacing: -.01em; }
.side-brand-text small { color: #7f8798; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; margin-top: 2px; }
.side-nav { flex: 1 1 auto; overflow-y: auto; padding: .75rem .8rem; display: flex; flex-direction: column; gap: 2px; }
.side-label { padding: .8rem .8rem .3rem; font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #5f6779; }
.side-label:first-child { padding-top: .2rem; }
.side-link { position: relative; display: flex; align-items: center; gap: .8rem; padding: .5rem .8rem; border-radius: .6rem; color: var(--side-ink); font-weight: 500; font-size: .93rem; text-decoration: none !important; transition: background .15s, color .15s; }
.side-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-link .ico { opacity: .85; }
.side-link.active { background: linear-gradient(90deg, rgba(239,48,55,.24), rgba(239,48,55,.08)); color: #fff; }
.side-link.active::before { content: ""; position: absolute; left: -.8rem; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand); }
.side-link.active .ico { color: #ff7a7f; opacity: 1; }

.side-foot { padding: 0 .6rem .6rem; display: flex; flex-direction: column; gap: .5rem; }
.theme-switch {
  display: flex; align-items: center; gap: .75rem; width: 100%; padding: .6rem .8rem; border-radius: .6rem;
  border: 0; background: transparent; color: var(--side-ink); font-weight: 500; font-size: .93rem; text-align: left;
}
.theme-switch:hover { background: rgba(255,255,255,.06); color: #fff; }
.theme-switch .track { margin-left: auto; width: 34px; height: 20px; border-radius: 99px; background: rgba(255,255,255,.14); position: relative; transition: background .2s; }
.theme-switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s; }
[data-bs-theme="dark"] .theme-switch .track { background: var(--brand); }
[data-bs-theme="dark"] .theme-switch .track::after { transform: translateX(14px); }
.theme-switch .when-dark, [data-bs-theme="dark"] .theme-switch .when-light { display: none; }
[data-bs-theme="dark"] .theme-switch .when-dark { display: inline-flex; }

.side-user { display: flex; align-items: center; gap: .7rem; padding: .7rem .75rem; border-radius: .8rem; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.06); }
.side-avatar { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, #ff5b61, #c4222a); }
.side-user-meta { min-width: 0; flex: 1 1 auto; }
.side-user-name { color: #fff; font-size: .85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-role { color: #7f8798; font-size: .72rem; }
.side-signout { border: 0; background: transparent; color: #8b93a5; padding: .4rem; border-radius: .5rem; line-height: 0; cursor: pointer; }
.side-signout:hover { background: rgba(239,48,55,.18); color: #fff; }

.sidebar-backdrop { display: none; }
.mobile-bar, .guest-bar {
  display: none; align-items: center; gap: .75rem; padding: .7rem 1rem;
  background: var(--surface); border-bottom: 1px solid var(--border); border-top: 3px solid var(--brand);
  position: sticky; top: 0; z-index: 1030;
}
.guest-bar { display: flex; }
.mobile-brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; color: var(--text); text-decoration: none !important; }
.mobile-brand img { height: 30px; width: auto; }
.mobile-toggle, .theme-btn { border: 1px solid var(--border); background: var(--surface); border-radius: .55rem; padding: .4rem; line-height: 0; color: var(--text); }
.theme-btn { margin-left: auto; }
.theme-btn .when-dark, [data-bs-theme="dark"] .theme-btn .when-light { display: none; }
[data-bs-theme="dark"] .theme-btn .when-dark { display: inline-flex; }

@media (max-width: 991.98px) {
  .mobile-bar { display: flex; }
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .22s ease; }
  body.sidebar-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.45); }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(10,12,18,.55); z-index: 1035; }
  body.sidebar-open { overflow: hidden; }
  .content { padding: 1.25rem 1rem 1rem; }
  .app-footer { padding: 1rem; }
}
@media (max-width: 575.98px) {
  .form-control, .form-select { padding: .75rem .9rem; font-size: 1rem; }
  .btn { padding: .65rem 1rem; }
  .btn-sm { padding: .4rem .7rem; }
}

/* =====================================================================
   PAGE-LEVEL COMPONENTS
   ===================================================================== */
.content h1.h3 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }
.page-sub { color: var(--text-muted); margin: .15rem 0 0; font-size: .92rem; }

.kpi { position: relative; display: flex; align-items: center; gap: .9rem; padding: 1.1rem 1.2rem; height: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.kpi:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.kpi-icon { width: 44px; height: 44px; flex: 0 0 44px; border-radius: .8rem; display: grid; place-items: center; background: var(--t-bg, var(--grey-bg)); color: var(--t-fg, var(--grey-fg)); }
.kpi-icon .ico { width: 22px; height: 22px; }
.kpi-value { font-size: 1.85rem; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi-label { color: var(--text-muted); font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-top: .3rem; }
.tone-brand  { --t-bg: var(--brandt-bg); --t-fg: var(--brandt-fg); }
.tone-indigo { --t-bg: var(--indigo-bg); --t-fg: var(--indigo-fg); }
.tone-amber  { --t-bg: var(--amber-bg);  --t-fg: var(--amber-fg); }
.tone-green  { --t-bg: var(--green-bg);  --t-fg: var(--green-fg); }
.tone-grey   { --t-bg: var(--grey-bg);   --t-fg: var(--grey-fg); }
.tone-teal   { --t-bg: var(--teal-bg);   --t-fg: var(--teal-fg); }
.tone-red    { --t-bg: var(--red-bg);    --t-fg: var(--red-fg); }
.kpi-plain { display: block; border-left: 4px solid var(--border); }
.kpi-plain.tone-brand  { border-left-color: var(--brand); }
.kpi-plain.tone-amber  { border-left-color: #f0a81c; }
.kpi-plain.tone-green  { border-left-color: #2fa866; }
.kpi-plain.tone-indigo { border-left-color: #5a63e0; }

.bar { height: 8px; min-width: 90px; background: var(--grey-bg); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, #ff5b61, #ef3037); border-radius: 99px; }
.bar-cell { display: flex; align-items: center; gap: .6rem; }
.bar-cell small { color: var(--text-muted); font-variant-numeric: tabular-nums; width: 2.6rem; text-align: right; }

/* ---------- trainee profile ---------- */
.profile-hero { background: var(--surface); border: 1px solid var(--border); border-radius: calc(var(--radius) + .15rem); box-shadow: var(--shadow); overflow: hidden; }
.hero-banner {
  height: 96px;
  background:
    radial-gradient(circle at 18% 30%, rgba(255,255,255,.18) 0 2px, transparent 3px) 0 0 / 28px 28px,
    linear-gradient(120deg, #ef3037 0%, #b3212a 55%, #5c0f14 100%);
}
.hero-body { display: flex; align-items: flex-end; gap: 1.25rem; padding: 0 1.5rem 1.25rem; flex-wrap: wrap; }
.hero-avatar {
  width: 104px; height: 104px; flex: 0 0 104px; margin-top: -52px; border-radius: 50%;
  border: 4px solid var(--surface); box-shadow: var(--shadow-md); overflow: hidden;
  display: grid; place-items: center; font-size: 2.2rem; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #ff5b61, #c4222a);
}
.hero-avatar img { width: 100%; height: 100%; object-fit: cover; }
.hero-main { flex: 1 1 280px; min-width: 0; padding-top: .9rem; }
.hero-name { font-size: 1.65rem; font-weight: 750; letter-spacing: -.02em; margin: 0 0 .5rem; }
.hero-tags { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.hero-actions { display: flex; gap: .5rem; padding-top: .9rem; }
.hero-stats { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--border); background: var(--surface-alt); }
.hero-stat { padding: .9rem 1.25rem; border-right: 1px solid var(--border); min-width: 0; }
.hero-stat:last-child { border-right: 0; }
.hero-stat .k { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.hero-stat .v { font-size: 1.05rem; font-weight: 650; margin-top: .15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 991.98px) {
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .hero-stat { border-bottom: 1px solid var(--border); }
  .hero-stat:nth-child(2n) { border-right: 0; }
  .hero-stat:last-child { grid-column: 1 / -1; border-bottom: 0; }
}
@media (max-width: 575.98px) {
  .hero-body { padding: 0 1rem 1rem; }
  .hero-avatar { width: 84px; height: 84px; flex-basis: 84px; margin-top: -42px; font-size: 1.8rem; }
  .hero-name { font-size: 1.35rem; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1; }
}

.info-list { list-style: none; margin: 0; padding: 0; }
.info-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.info-row:last-child { border-bottom: 0; padding-bottom: 0; }
.info-row:first-child { padding-top: 0; }
.info-row .lbl { color: var(--text-muted); font-size: .85rem; display: flex; align-items: center; gap: .5rem; flex: 0 0 auto; }
.info-row .val { font-weight: 550; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.info-row .val.muted { color: var(--text-muted); font-weight: 400; }
.contact-line { display: flex; align-items: center; gap: .85rem; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.contact-line:first-child { padding-top: 0; }
.contact-line:last-child { border-bottom: 0; padding-bottom: 0; }
.contact-ico { width: 38px; height: 38px; flex: 0 0 38px; border-radius: .7rem; display: grid; place-items: center; background: var(--t-bg); color: var(--t-fg); }
.contact-line .meta { min-width: 0; flex: 1; }
.contact-line .meta .k { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.contact-line .meta .v { font-weight: 600; overflow-wrap: anywhere; }
.contact-line .meta .v.muted { color: var(--text-muted); font-weight: 400; }
.contact-line .go { flex: 0 0 auto; }

.consent-ok { display: flex; align-items: center; gap: .65rem; padding: .7rem .85rem; border-radius: .7rem; background: var(--green-bg); color: var(--green-fg); font-weight: 600; font-size: .92rem; }
.consent-ok small { display: block; font-weight: 500; opacity: .85; }
.consent-no { background: var(--amber-bg); color: var(--amber-fg); }
.sig-label { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; margin: 1rem 0 .4rem; }

/* follow-up timeline */
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.75rem; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: .5rem; bottom: .5rem; width: 2px; background: var(--border); border-radius: 2px; }
.tl-item { position: relative; padding: 0 0 1.4rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: -1.75rem; top: .3rem; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--dot, var(--grey-fg)); box-sizing: border-box; }
.tl-employed { --dot: var(--green-fg); } .tl-ownbusiness { --dot: var(--teal-fg); } .tl-furthertraining { --dot: var(--indigo-fg); }
.tl-unemployed { --dot: var(--red-fg); } .tl-other { --dot: var(--grey-fg); }
.tl-card { background: var(--surface-alt); border: 1px solid var(--border); border-radius: .8rem; padding: .9rem 1rem; }
.tl-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.tl-date { font-size: .82rem; color: var(--text-muted); display: inline-flex; align-items: center; gap: .4rem; }
.tl-title { font-weight: 650; margin-top: .55rem; }
.tl-sub { color: var(--text-muted); font-size: .92rem; }
.tl-income { display: inline-flex; align-items: baseline; gap: .35rem; margin-top: .55rem; padding: .2rem .65rem; border-radius: .5rem; background: var(--green-bg); color: var(--green-fg); font-weight: 700; font-variant-numeric: tabular-nums; }
.tl-income small { font-weight: 500; opacity: .85; }
.tl-notes { margin: .6rem 0 0; font-size: .9rem; color: var(--text-muted); border-left: 3px solid var(--border-strong); padding-left: .7rem; }
.tl-latest .tl-card { border-color: var(--brand-tint-strong); box-shadow: 0 0 0 3px var(--brand-tint); }

.empty-state { text-align: center; padding: 2.25rem 1rem; }
.empty-state .ring { width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 50%; display: grid; place-items: center; background: var(--brandt-bg); color: var(--brandt-fg); }
.empty-state .ring .ico { width: 28px; height: 28px; }
.empty-state h3 { font-size: 1.05rem; margin-bottom: .25rem; }
.empty-state p { color: var(--text-muted); margin: 0 auto; max-width: 30rem; font-size: .92rem; }

/* inputs line up on one baseline even when a label wraps to two lines */
.form-aligned > [class*="col-"] { display: flex; flex-direction: column; justify-content: flex-end; }
.form-aligned > .col-12 > .btn { align-self: flex-start; }


/* ---------- Gallery, files and forms register ---------- */
.subtabs { list-style: none; display: flex; gap: .25rem; padding: 0; margin: 0 0 1.25rem; border-bottom: 1px solid var(--border); }
.subtabs a { display: inline-flex; align-items: center; gap: .45rem; padding: .6rem 1rem; color: var(--text-muted); text-decoration: none; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtabs a:hover { color: var(--text); }
.subtabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.back-link { font-size: .88rem; color: var(--text-muted); text-decoration: none; }
.back-link:hover { color: var(--brand); }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; }
.photo-tile { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.photo-tile > a { display: block; aspect-ratio: 4 / 3; background: var(--surface-alt); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tile figcaption { display: flex; justify-content: flex-end; gap: .35rem; padding: .35rem .5rem; }
.photo-tile figcaption a, .link-btn { color: var(--text-muted); background: none; border: 0; padding: .2rem; line-height: 1; display: inline-flex; }
.photo-tile figcaption a:hover, .link-btn:hover { color: var(--brand); }

.passport-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.passport { display: block; text-align: center; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: .75rem .6rem .85rem; transition: transform .12s ease, border-color .12s ease; }
.passport:hover { transform: translateY(-2px); border-color: var(--brand); color: var(--text); }
.passport-photo { aspect-ratio: 3 / 4; border-radius: .6rem; overflow: hidden; background: var(--brand-tint); display: grid; place-items: center; color: var(--brand-deep); font-size: 2rem; font-weight: 700; margin-bottom: .6rem; }
.passport-photo img { width: 100%; height: 100%; object-fit: cover; }
.passport-name { font-weight: 650; font-size: .92rem; line-height: 1.25; overflow-wrap: anywhere; }
.passport-meta { margin-top: .35rem; }

.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.1rem; }
.album-card { display: block; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: transform .12s ease, border-color .12s ease; }
.album-card:hover { transform: translateY(-2px); border-color: var(--brand); color: var(--text); }
.album-cover { aspect-ratio: 16 / 10; background: var(--surface-alt); display: grid; place-items: center; color: var(--text-muted); }
.album-cover img { width: 100%; height: 100%; object-fit: cover; }
.album-cover .ico { width: 36px; height: 36px; }
.album-body { padding: .8rem 1rem 1rem; }
.album-title { font-weight: 650; }
.album-meta { color: var(--text-muted); font-size: .85rem; }

.link-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.link-row .link-text { flex: 1 1 14rem; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Dashboard: completed training by region ---------- */
.prog-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.prog-chips .chip { border: 1px solid var(--border); background: var(--surface-alt); color: var(--text); border-radius: 99px; padding: .25rem .75rem; font-size: .85rem; font-weight: 600; cursor: pointer; }
.prog-chips .chip .chip-n { margin-left: .35rem; font-weight: 700; color: var(--text-muted); }
.prog-chips .chip.active { background: var(--brand, #c8102e); border-color: var(--brand, #c8102e); color: #fff; }
.prog-chips .chip.active .chip-n { color: #fff; }
#completion-map { --gh-surface: var(--surface); --gh-ink: var(--text); --gh-ink-2: var(--text-muted); --gh-line: var(--border); --gh-stroke: var(--surface); }
.region-rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.region-rank li { display: grid; grid-template-columns: 1.9rem 1fr 2.6rem; gap: .5rem; align-items: center; }
.region-rank .rk { width: 1.7rem; height: 1.7rem; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; font-size: .75rem; font-weight: 700; }
.region-rank .rn { position: relative; background: var(--surface-alt); border-radius: .35rem; overflow: hidden; min-height: 1.7rem; display: flex; align-items: center; }
.region-rank .rbar { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--brand, #c8102e) 28%, transparent); }
.region-rank .rlabel { position: relative; padding: 0 .6rem; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.region-rank .rv { text-align: center; font-weight: 800; background: var(--surface-alt); border-radius: .35rem; padding: .2rem 0; font-variant-numeric: tabular-nums; }
.region-rank li.zero { opacity: .65; }

/* ---------- Results page ---------- */
.mf-bar { display: flex; height: .7rem; border-radius: 99px; overflow: hidden; min-width: 2px; }
.mf-bar .m, .mf-legend .m { background: #2f6fd0; }
.mf-bar .f, .mf-legend .f { background: var(--brand, #ef3037); }
.mf-legend { font-size: .85rem; color: var(--text-muted); display: flex; align-items: center; gap: .35rem; }
.mf-legend .m, .mf-legend .f { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; }
.table-total td { font-weight: 700; background: var(--surface-alt); }

/* Graduate portal / alumni access */
.guest-bar form ~ .theme-btn { margin-left: 0; }
.invite-box { overflow-wrap: anywhere; border: 1px dashed var(--brand); border-radius: .75rem; padding: .85rem 1rem; background: var(--surface-alt); }
.invite-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.6rem; font-weight: 700; letter-spacing: .12em; }
.pill-alumni { --p-bg: var(--teal-bg); --p-fg: var(--teal-fg); }
.side-badge { margin-left: auto; min-width: 1.35rem; padding: 0 .4rem; border-radius: 999px; background: var(--brand); color: #fff; font-size: .72rem; font-weight: 700; line-height: 1.35rem; text-align: center; }

/* ---------- finance ---------- */
.bar.over > span { background: #c62828; }
.roll-sub td { font-size: .9rem; }
.roll-total td { border-top: 2px solid var(--border-strong); background: var(--surface-alt); }
.cur-tabs { margin-bottom: 1rem; }
.line-parent td { background: var(--surface-alt); }
.budget-table td, .budget-table th { vertical-align: middle; }
.budget-table td a:not(.btn) { font-weight: 550; }

/* ---------- training team ---------- */
.team-avatar { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%; object-fit: cover; }
.team-avatar-initials { display: grid; place-items: center; font-weight: 700; font-size: .9rem; color: #fff; background: linear-gradient(135deg, #ff5b61, #c4222a); }

/* ---------- Enterprise infographics ----------
   Chart colours follow the validated reference palette: Male is always blue, Female always orange, single series blue. */
.viz {
  --viz-surface: #fcfcfb; --viz-ink: #0b0b0b; --viz-ink-2: #52514e; --viz-muted: #898781; --viz-grid: #e1e0d9; --viz-base: #c3c2b7;
  --viz-m: #2a78d6; --viz-f: #eb6834; --viz-s: #2a78d6;
}
[data-bs-theme="dark"] .viz {
  --viz-surface: #151a24; --viz-ink: #f0efec; --viz-ink-2: #c3c2b7; --viz-muted: #96a0b2; --viz-grid: #263042; --viz-base: #34405a;
  --viz-m: #3987e5; --viz-f: #d95926; --viz-s: #3987e5;
}
.viz-panel .panel-head { align-items: flex-start; }
.viz-panel h2 { font-size: 1rem; }
.viz-sub { color: var(--text-muted); font-size: .8rem; margin-top: .15rem; font-weight: 400; }
.viz-toggle { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-muted); border-radius: .5rem; padding: .2rem .65rem; font-size: .78rem; font-weight: 600; }
.viz-toggle:hover { color: var(--text); background: var(--surface-alt); }
.viz-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 1rem; padding: 0; margin: 0 0 .9rem; font-size: .8rem; color: var(--viz-ink-2); }
.viz-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .4rem; }
.sw.f, .viz-mark.f { background: var(--viz-f); } .sw.m, .viz-mark.m { background: var(--viz-m); } .sw.s, .viz-mark.s { background: var(--viz-s); }
.viz-rows { display: flex; flex-direction: column; gap: .85rem; }
.viz-row { display: grid; grid-template-columns: minmax(84px, 34%) 1fr; gap: .75rem; align-items: center; }
.viz-lab { font-size: .82rem; color: var(--viz-ink-2); line-height: 1.25; }
.viz-bars { display: flex; flex-direction: column; gap: 3px; border-left: 1px solid var(--viz-base); padding: 2px 0; min-width: 0; }
.viz-line { display: flex; align-items: center; gap: .45rem; min-height: 16px; }
.viz-mark { display: block; outline: none; transition: filter .12s; }
.viz-mark:hover, .viz-mark:focus-visible { filter: brightness(1.12) saturate(1.1); }
.viz-mark:focus-visible { box-shadow: 0 0 0 2px var(--viz-surface), 0 0 0 4px var(--viz-ink-2); }
.viz-mark.bar { height: 14px; border-radius: 0 4px 4px 0; min-width: 2px; }
.viz-stack { display: flex; height: 16px; gap: 2px; }
.viz-stack .seg { height: 100%; min-width: 2px; }
.viz-stack .seg:first-child { border-radius: 0; }
.viz-stack .seg.end { border-radius: 0 4px 4px 0; }
.viz-val { font-size: .8rem; font-weight: 650; color: var(--viz-ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.viz-val small { font-weight: 500; color: var(--viz-muted); margin-left: .3rem; }
.viz-cols { display: flex; align-items: stretch; gap: 6px; height: 236px; }
.viz-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; height: 100%; }
.viz-col-area { flex: 1; position: relative; min-height: 0; border-bottom: 1px solid var(--viz-base); }
.viz-col-fill { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; }
.viz-col-fill .viz-mark { flex: 1; }
.viz-col-val { position: absolute; top: -18px; font-size: .72rem; font-weight: 650; color: var(--viz-ink); line-height: 16px; }
.viz-mark.col { width: min(24px, 100%); border-radius: 4px 4px 0 0; min-height: 2px; }
.viz-col-lab { height: 22px; line-height: 22px; font-size: .68rem; color: var(--viz-muted); text-align: center; white-space: nowrap; }
.viz-table-wrap { max-height: 360px; overflow: auto; }
.viz-note { margin: .9rem 0 0; font-size: .76rem; color: var(--text-muted); }
.viz-empty { color: var(--text-muted); font-size: .9rem; padding: 1rem 0; }
.viz-hero { display: grid; grid-template-columns: minmax(260px, 1.2fr) 2fr; gap: 1rem; }
.viz-hero-main, .viz-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.viz-hero-main { padding: 1.4rem 1.5rem; }
.viz-hero-value { font-size: 3.4rem; font-weight: 750; line-height: 1; letter-spacing: -.03em; color: var(--viz-ink); }
.viz-hero-label { font-size: .95rem; font-weight: 650; margin-top: .35rem; color: var(--viz-ink); }
.viz-hero-sub { font-size: .82rem; color: var(--text-muted); margin-top: .6rem; }
.viz-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.viz-tile { padding: 1.1rem 1.25rem; display: flex; flex-direction: column; justify-content: center; }
.viz-tile .v { font-size: 1.9rem; font-weight: 750; line-height: 1; letter-spacing: -.02em; color: var(--viz-ink); }
.viz-tile .l { font-size: .8rem; color: var(--text-muted); margin-top: .35rem; font-weight: 600; }
.viz-tile .l span { font-weight: 500; margin-left: .3rem; }
.viz-tip { position: fixed; z-index: 2000; pointer-events: none; background: #1f2430; color: #fff; border-radius: .5rem; padding: .4rem .65rem; font-size: .78rem; box-shadow: 0 6px 20px rgba(0,0,0,.25); display: flex; flex-direction: column; gap: 1px; max-width: 260px; }
.viz-tip strong { font-size: .9rem; }
.viz-tip span { color: #c3c2b7; }
@media (max-width: 767.98px) {
  .viz-hero { grid-template-columns: 1fr; }
  .viz-row { grid-template-columns: 1fr; gap: .25rem; }
  .viz-hero-value { font-size: 2.8rem; }
}
@media print {
  .no-print, .sidebar, .side-nav, .topbar, header, .app-sidebar, .mobile-bar { display: none !important; }
  .viz-cell { break-inside: avoid; }
  .viz-hero-main, .viz-tile, .panel { box-shadow: none !important; }
}
.viz-tip[hidden], .viz-legend[hidden], .viz-table-wrap[hidden], [data-viz-plot][hidden] { display: none !important; }
.subtabs { overflow-x: auto; scrollbar-width: none; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs a { white-space: nowrap; }
@media (max-width: 575.98px) { .subtabs a { padding: .6rem .7rem; } }
.login-partner { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--bs-border-color, #dee2e6); display: flex; flex-direction: column; align-items: center; gap: .35rem; font-size: .8rem; color: var(--bs-secondary-color, #6c757d); }
.login-partner img { height: 48px; width: auto; }
[data-bs-theme="dark"] .login-partner img { background: #fff; border-radius: .5rem; padding: .25rem .6rem; }
