/* ══════════════════════════════════════════════
   MatricMatch — Main Stylesheet
   MafaTechnologies · 2026
   Palette: Deep Navy + Warm Gold
══════════════════════════════════════════════ */

:root {
  --navy:        #0d1b2a;
  --navy-mid:    #1b2d45;
  --navy-light:  #243b55;
  --gold:        #e8a219;
  --gold-light:  #f5c842;
  --gold-dim:    #c8880f;
  --white:       #ffffff;
  --off-white:   #f7f8fa;
  --gray-50:     #f2f4f7;
  --gray-100:    #e4e7ec;
  --gray-200:    #cdd5df;
  --gray-400:    #9aa5b4;
  --gray-600:    #4d6080;
  --text:        #1a2740;
  --text-muted:  #5a6b80;
  --success:     #16a34a;
  --danger:      #dc2626;
  --warning:     #d97706;
  --radius:      10px;
  --radius-lg:   16px;
  --shadow:      0 2px 14px rgba(13,27,42,0.08);
  --shadow-md:   0 6px 28px rgba(13,27,42,0.13);
  --transition:  all 0.2s cubic-bezier(0.4,0,0.2,1);
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--off-white);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
h1,h2,h3,h4,h5,h6 { font-family: 'Syne', sans-serif; font-weight: 700; color: var(--navy); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.flex-1 { flex: 1; }

/* ─── NAVBAR ─────────────────────────────────── */
.navbar {
  background: var(--navy);
  position: sticky; top: 0; z-index: 200;
  width: 100%;
  box-shadow: 0 2px 20px rgba(0,0,0,0.25);
}
.nav-container {
  max-width: 1280px; margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex; align-items: center; gap: 12px;
}
.nav-logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--gold); color: var(--navy);
  font-family: 'Syne', sans-serif; font-weight: 800; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.logo-text { font-family: 'Syne', sans-serif; font-size: 17px; font-weight: 500; color: var(--white); }
.logo-text strong { font-weight: 800; color: var(--gold); }
.nav-links { display: flex; align-items: center; gap: 2px; flex: 1; flex-wrap: nowrap; }
.nav-item {
  padding: 7px 10px; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.7);
  white-space: nowrap;
  transition: var(--transition);
}
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,0.09); color: var(--white); }
.btn-apply {
  background: var(--gold); color: var(--navy);
  padding: 9px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 700; white-space: nowrap;
  transition: var(--transition); flex-shrink: 0;
}
.btn-apply:hover { background: var(--gold-light); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(232,162,25,0.4); }

/* ─── HERO ───────────────────────────────────── */
.hero {
  background: var(--navy);
  padding: 64px 24px 104px;
  position: relative; overflow: hidden;
  text-align: center;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 55% at 50% 0%, rgba(232,162,25,0.09) 0%, transparent 65%);
  pointer-events: none;
}
.hero-inner {
  max-width: 640px; margin: 0 auto;
  position: relative; z-index: 1;
}
.hero-tag {
  display: inline-block;
  background: rgba(232,162,25,0.15);
  border: 1px solid rgba(232,162,25,0.3);
  color: var(--gold-light);
  border-radius: 100px; padding: 5px 14px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 20px;
}
.hero-title {
  font-size: clamp(28px, 4.2vw, 44px);
  font-weight: 800; color: var(--white); line-height: 1.12;
  margin-bottom: 14px;
}
.hero-title .accent { color: var(--gold); }
.hero-sub { font-size: 15.5px; color: rgba(255,255,255,0.68); max-width: 480px; margin: 0 auto; }

/* ─── PORTAL HOME REDESIGN ───────────────────── */

/* Service tile grid — pulled up over the hero's bottom edge */
.portal-tiles { margin-top: -64px; position: relative; z-index: 2; padding: 0 24px; }
.portal-tiles-inner { max-width: 1200px; margin: 0 auto; }
.tile-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.tile {
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  padding: 26px 22px; display: flex; flex-direction: column;
  border-top: 3px solid transparent; transition: var(--transition);
}
.tile:hover { transform: translateY(-4px); }
.tile.t-gold   { border-top-color: var(--gold); }
.tile.t-green  { border-top-color: var(--success); }
.tile.t-blue   { border-top-color: #3b7dd8; }
.tile.t-violet { border-top-color: #8b5cf6; }
.tile-icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.tile-icon svg { width: 22px; height: 22px; }
.tile.t-gold   .tile-icon { background: rgba(232,162,25,0.14); color: var(--gold-dim); }
.tile.t-green  .tile-icon { background: rgba(22,163,74,0.12); color: var(--success); }
.tile.t-blue   .tile-icon { background: rgba(59,125,216,0.12); color: #3b7dd8; }
.tile.t-violet .tile-icon { background: rgba(139,92,246,0.12); color: #8b5cf6; }
.tile h3 { font-size: 17px; margin-bottom: 8px; }
.tile p { font-size: 13.5px; color: var(--text-muted); margin-bottom: 18px; flex: 1; }
.tile-stat {
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  padding-top: 14px; border-top: 1px solid var(--gray-100);
  display: flex; justify-content: space-between; align-items: center;
}
.tile-stat b { font-family: 'Syne', sans-serif; color: var(--navy); font-size: 13px; }

/* Shared section eyebrow label */
.section-eyebrow {
  font-size: 11.5px; font-weight: 700; color: var(--gold-dim);
  text-transform: uppercase; letter-spacing: 1.4px; margin-bottom: 10px;
}

/* Calculator section (now standalone, below the tiles) */
.calc-section { max-width: 640px; margin: 64px auto 0; padding: 0 24px; text-align: center; }
.calc-card {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 28px 28px 24px;
  text-align: left;
}

/* Quick links — "browse by what you need" */
.quick-links { max-width: 1200px; margin: 76px auto 0; padding: 0 24px; text-align: center; }
.quick-links h2 { font-size: clamp(22px, 2.6vw, 28px); margin-bottom: 26px; }
.quick-link-chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 780px; margin: 0 auto; }
.quick-link-chip {
  padding: 10px 18px; border-radius: 100px; border: 1.5px solid var(--gray-100);
  background: var(--white); font-size: 13px; font-weight: 600; color: var(--text);
  transition: var(--transition);
}
.quick-link-chip:hover { border-color: var(--gold); color: var(--gold-dim); }

/* How it works */
.how-it-works {
  max-width: 1200px; margin: 76px auto 0; padding: 56px 24px;
  background: var(--white); border-top: 1px solid var(--gray-100); border-bottom: 1px solid var(--gray-100);
}
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; text-align: center; }
.how-num { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 32px; color: var(--gold); margin-bottom: 8px; opacity: .55; }
.how-item h4 { font-size: 16px; margin-bottom: 8px; }
.how-item p { font-size: 13.5px; color: var(--text-muted); max-width: 280px; margin: 0 auto; }

/* Final CTA band */
.final-cta {
  background: var(--navy); border-radius: var(--radius-lg);
  margin: 64px auto; max-width: 1152px;
  padding: 48px; display: flex; align-items: center; justify-content: space-between; gap: 32px;
  position: relative; overflow: hidden;
}
.final-cta::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 85% 30%, rgba(232,162,25,0.14), transparent 60%);
}
.final-cta-text { position: relative; z-index: 1; }
.final-cta-text h3 { color: #fff; font-size: 22px; margin-bottom: 8px; }
.final-cta-text p { color: rgba(255,255,255,0.65); font-size: 14px; }
.final-cta-actions { position: relative; z-index: 1; display: flex; gap: 12px; flex-shrink: 0; }
.btn-cta-primary {
  background: var(--gold); color: var(--navy); padding: 13px 22px; border-radius: 9px;
  font-weight: 700; font-size: 14.5px; transition: var(--transition); white-space: nowrap;
}
.btn-cta-primary:hover { background: var(--gold-light); transform: translateY(-1px); }
.btn-cta-ghost {
  border: 1.5px solid var(--gray-200); color: #fff; padding: 13px 22px; border-radius: 9px;
  font-weight: 700; font-size: 14.5px; transition: var(--transition); white-space: nowrap;
  border-color: rgba(255,255,255,0.25);
}
.btn-cta-ghost:hover { border-color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.05); }

/* ─── CALCULATOR CARD ───────────────────────── */
.calc-card {
  background: var(--white);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 28px 28px 0;
  box-shadow: 0 -4px 40px rgba(0,0,0,0.2);
}
.calc-card h2 {
  font-size: 20px; margin-bottom: 6px;
}
.calc-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }

.subject-row {
  display: grid; grid-template-columns: 1fr 90px;
  gap: 10px; align-items: center;
  margin-bottom: 10px;
}
.subject-row label { font-size: 13px; font-weight: 600; color: var(--text); }
.form-select, .form-input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px; color: var(--text);
  background: var(--white);
  transition: border-color 0.2s;
  appearance: none;
}
.form-select:focus, .form-input:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(232,162,25,0.15);
}
.pct-input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif; font-size: 14px;
  text-align: center; color: var(--text);
  transition: border-color 0.2s;
}
.pct-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232,162,25,0.15); }

.aps-bar {
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
  margin: 18px 0;
}
.aps-label { font-size: 13px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.aps-score-display {
  font-family: 'Syne', sans-serif;
  font-size: 28px; font-weight: 800; color: var(--gold);
}

/* ── Multi-institution APS display (live calculator) ── */
.aps-multi-display {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center;
}
.aps-empty-hint { font-size: 13px; color: var(--text-muted); font-style: italic; }
/* ── APS disclaimer note ── */
.aps-disclaimer {
  font-size: 11px; color: var(--text-muted);
  margin: 6px 0 0; line-height: 1.5;
}
.aps-disclaimer strong { color: var(--text); font-weight: 600; }
.aps-disclaimer a { color: var(--gold-dim); }
.results-disclaimer { margin-top: 8px; }
.browse-disclaimer { max-width: 1200px; margin: 4px auto 0; padding: 0 24px; }

.aps-live-chip {
  display: inline-flex; align-items: baseline; gap: 3px;
  background: var(--white); border: 1.5px solid var(--gray-200);
  border-radius: 20px; padding: 3px 11px;
  font-family: 'DM Sans', sans-serif;
}
.aps-live-chip strong {
  font-family: 'Syne', sans-serif; font-size: 18px; font-weight: 800;
}
.aps-chip-label { font-size: 10px; font-weight: 700; color: var(--text-muted); margin-right: 4px; text-transform: uppercase; letter-spacing: .4px; }
.aps-chip-max { font-size: 11px; color: var(--text-muted); }
.aps-live-chip.strong strong { color: #16a34a; }
.aps-live-chip.ok      strong { color: var(--gold); }
.aps-live-chip.low     strong { color: #dc2626; }

/* ── APS breakdown bar (results header) ── */
.aps-breakdown-bar {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px;
}
.aps-inst-pill {
  display: inline-flex; align-items: baseline; gap: 4px;
  background: rgba(232,162,25,.08); border: 1px solid rgba(232,162,25,.25);
  border-radius: 16px; padding: 3px 10px;
}
.aps-pill-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }
.aps-pill-score { font-family: 'Syne', sans-serif; font-size: 16px; font-weight: 800; color: var(--gold); }
.aps-pill-max { font-size: 11px; color: var(--text-muted); }

/* ── Per-card APS match row ── */
.aps-match-row {
  display: flex; align-items: center; gap: 8px;
  background: var(--gray-50); border-radius: var(--radius);
  padding: 8px 12px; margin: 8px 0;
}
.aps-match-item { display: flex; flex-direction: column; align-items: center; }
.aps-match-label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }
.aps-match-score {
  font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 800; line-height: 1.1;
}
.aps-match-score.strong { color: #16a34a; }
.aps-match-score.ok     { color: var(--gold); }
.aps-match-score.fail   { color: #dc2626; }
.aps-match-score.req    { color: var(--navy); }
.aps-match-denom { font-size: 10px; color: var(--text-muted); }
.aps-match-sep { font-size: 11px; color: var(--text-muted); padding: 0 2px; }
.aps-match-badge {
  margin-left: auto; font-size: 12px; font-weight: 700;
  border-radius: 10px; padding: 2px 8px;
}
.aps-match-badge.strong { background: #dcfce7; color: #16a34a; }
.aps-match-badge.ok     { background: rgba(232,162,25,.12); color: var(--gold-dim); }

/* ── Subject requirement chips ── */
.course-reqs { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.req-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; border-radius: 12px;
  padding: 3px 9px; border: 1px solid;
}
.req-chip.met   { background: #dcfce7; border-color: #86efac; color: #15803d; }
.req-chip.unmet { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }
.req-chip-yours { font-weight: 400; opacity: .85; }

.btn-calc-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 28px;
}
.btn-calc {
  width: 100%;
  background: var(--navy); color: var(--white);
  border: none; border-radius: var(--radius);
  padding: 14px; font-family: 'Syne', sans-serif;
  font-size: 16px; font-weight: 700;
  cursor: pointer; transition: var(--transition);
}
.btn-calc:hover { background: var(--navy-mid); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-reset {
  padding: 14px 18px;
  border: 2px solid var(--gray-200); border-radius: var(--radius);
  background: transparent; font-family: 'DM Sans', sans-serif;
  font-size: 14px; font-weight: 700; color: var(--text-muted);
  cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.btn-reset:hover { border-color: var(--danger); color: var(--danger); }

/* ─── RESULTS SECTION ───────────────────────── */
.results-section {
  max-width: 1200px; margin: 0 auto;
  width: 100%;
  padding: 40px 24px;
}
.results-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
  margin-bottom: 24px;
}
.results-title { font-size: 24px; }
.results-count {
  background: var(--gold);
  color: var(--navy);
  font-family: 'Syne', sans-serif; font-weight: 800;
  border-radius: 100px; padding: 4px 14px; font-size: 14px;
}

.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }

/* ── Upgraded filter bar ─────────────────────── */
.filter-bar-wrap {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 24px;
}
/* Search row */
.filter-search-wrap {
  display: flex; align-items: center;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 0 12px;
  gap: 8px;
  transition: border-color .15s;
}
.filter-search-wrap:focus-within { border-color: var(--gold); }
.filter-search-icon { font-size: 14px; color: var(--text-muted); flex-shrink: 0; }
.filter-search-input {
  flex: 1; border: none; outline: none;
  font-family: 'DM Sans', sans-serif; font-size: 14px;
  padding: 10px 0; background: transparent; color: var(--text);
}
.filter-search-input::placeholder { color: var(--gray-300); }
.filter-search-clear {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 14px; padding: 4px;
  line-height: 1; border-radius: 50%;
  transition: background .15s;
}
.filter-search-clear:hover { background: var(--gray-100); }

/* Dropdowns row */
.filter-dropdowns { display: flex; gap: 10px; flex-wrap: wrap; }

/* Extras row: sort, open-only, clear */
.filter-extras {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.filter-toggle-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-muted);
  cursor: pointer; user-select: none;
  padding: 8px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  transition: border-color .15s, background .15s;
  white-space: nowrap;
}
.filter-toggle-label:hover { border-color: var(--gold); }
.filter-toggle-label input { width: 14px; height: 14px; cursor: pointer; }

.filter-clear-link {
  background: none; border: none; cursor: pointer;
  font-size: 13px; color: #dc2626;
  padding: 8px 12px;
  border: 1.5px solid #fecaca;
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  transition: background .15s;
}
.filter-clear-link:hover { background: #fff1f2; }

/* Result count line */
.filter-result-count {
  font-size: 12px; color: var(--text-muted);
}
.filter-result-count strong { color: var(--navy); }

/* Empty-state for JS filter */
.filter-empty { margin-top: 16px; }

.filter-select {
  padding: 8px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif; font-size: 13px;
  background: var(--white); cursor: pointer;
}
.filter-select:focus { outline: none; border-color: var(--gold); }

.courses-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.course-card {
  background: var(--white);
  border: 1.5px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: var(--transition);
  position: relative;
  min-width: 0;
}
.course-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--gray-200); }
.course-card.selected { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232,162,25,0.15); }

.course-inst {
  font-size: 11px; font-weight: 700; color: var(--gold-dim);
  text-transform: uppercase; letter-spacing: 0.6px;
  margin-bottom: 6px;
}
.course-name { font-size: 16px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.course-faculty { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }

.course-meta {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px;
}
.meta-chip {
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: 6px; padding: 3px 10px;
  font-size: 12px; font-weight: 600; color: var(--gray-600);
}
.meta-chip.aps { background: rgba(232,162,25,0.1); border-color: rgba(232,162,25,0.25); color: var(--gold-dim); }
.meta-chip.qual { background: rgba(13,27,42,0.05); }
.meta-chip.lo-note { background: rgba(99,102,241,0.08); border-color: rgba(99,102,241,0.2); color: #4f46e5; cursor: help; }

.course-reqs { font-size: 12px; margin-bottom: 14px; }

.course-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-select {
  flex: 1;
  padding: 9px 0;
  border: 2px solid var(--gold);
  border-radius: var(--radius); background: transparent;
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 700;
  color: var(--gold-dim); cursor: pointer; transition: var(--transition);
}
.btn-select:hover, .course-card.selected .btn-select {
  background: var(--gold); color: var(--navy);
}
.btn-inst-link {
  padding: 9px 14px;
  border: 2px solid var(--gray-200); border-radius: var(--radius);
  background: transparent; font-size: 13px; color: var(--text-muted);
  cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.btn-inst-link:hover { border-color: var(--navy); color: var(--navy); }

.btn-jobs-link {
  padding: 9px 14px;
  border: 2px solid rgba(99,102,241,0.3); border-radius: var(--radius);
  background: rgba(99,102,241,0.06); font-size: 12px; font-weight: 700; color: #4f46e5;
  cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.btn-jobs-link:hover { background: #4f46e5; color: #fff; border-color: #4f46e5; }

/* ─── JOBS MODAL ───────────────────────────── */
.jobs-modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(13,27,42,0.6);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.jobs-modal {
  background: #fff; border-radius: 14px; max-width: 520px; width: 100%;
  max-height: 80vh; overflow-y: auto; padding: 28px; position: relative;
}
.jobs-modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; border-radius: 8px; border: none;
  background: var(--gray-50); color: var(--text-muted); font-size: 16px; cursor: pointer;
}
.jobs-modal-close:hover { background: var(--gray-100); }
.jobs-modal h3 { font-size: 18px; margin: 0 0 18px; padding-right: 36px; color: var(--navy); }
.job-card {
  background: var(--gray-50); border: 1px solid var(--gray-100); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 12px;
}
.job-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.job-card-top strong { font-size: 14px; color: var(--navy); }
.job-industry { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.job-salary { font-size: 13px; font-weight: 600; color: var(--gold-dim); margin-bottom: 6px; }
.job-desc { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

.leaderboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 700px) { .leaderboard-grid { grid-template-columns: 1fr; } }

.job-clickable { cursor: pointer; transition: var(--transition); }
.job-clickable:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(13,27,42,0.1); }

.job-course-link {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--gray-50); border: 1px solid var(--gray-100); border-radius: 10px;
  padding: 12px 16px; margin-bottom: 10px; text-decoration: none;
  transition: var(--transition);
}
.job-course-link:hover { border-color: var(--gold); background: rgba(232,162,25,0.06); }
.job-course-link strong { font-size: 14px; color: var(--navy); }
.job-course-link span { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* ─── SHORTLIST DRAWER ──────────────────────── */
.shortlist-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--navy);
  border-top: 2px solid var(--gold);
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  z-index: 300;
}
.shortlist-bar.visible { transform: translateY(0); }
.shortlist-info { color: var(--white); font-size: 14px; font-weight: 600; }
.shortlist-info span { color: var(--gold); font-family: 'Syne', sans-serif; font-size: 20px; }
.shortlist-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ─── SHARE BUTTONS ─────────────────────────── */
.share-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 700; cursor: pointer;
  border: none; transition: var(--transition);
}
.share-wa  { background: #25d366; color: #fff; }
.share-fb  { background: #1877f2; color: #fff; }
.share-em  { background: var(--gold); color: var(--navy); }
.share-tw  { background: #1da1f2; color: #fff; }
.share-btn:hover { opacity: 0.88; transform: translateY(-1px); }

.btn-request {
  background: var(--white); color: var(--navy);
  padding: 9px 18px; border-radius: 8px;
  font-size: 13px; font-weight: 700; border: none; cursor: pointer;
  transition: var(--transition);
}
.btn-request:hover { background: var(--gold); }

/* ─── AD BANNER ─────────────────────────────── */
.ad-banner {
  background: var(--gray-50);
  border: 1px dashed var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden; text-align: center;
  margin: 20px 0;
}
.ad-banner img { display: block; width: 100%; height: auto; }
.ad-banner a { display: block; }
.ad-label {
  font-size: 10px; color: var(--gray-400);
  text-align: right; padding: 3px 6px;
  text-transform: uppercase; letter-spacing: 0.5px;
}

/* ─── INSTITUTIONS PAGE ─────────────────────── */
.page-hero {
  background: var(--navy); padding: 48px 24px 40px;
}
.page-hero-inner { max-width: 1200px; margin: 0 auto; }
.page-hero h1 { color: var(--white); font-size: clamp(26px,4vw,40px); margin-bottom: 10px; }
.page-hero p { color: rgba(255,255,255,0.65); font-size: 15px; }

.institutions-grid {
  max-width: 1200px; margin: 32px auto;
  width: 100%;
  padding: 0 24px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 20px;
}
.inst-card {
  background: var(--white);
  border: 1.5px solid var(--gray-100);
  border-radius: var(--radius-lg); padding: 24px;
  transition: var(--transition);
}
.inst-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.inst-card.featured { border-color: var(--gold); }

.inst-logo-wrap {
  height: 56px; margin-bottom: 14px;
  display: flex; align-items: center;
}
.inst-logo-wrap img { max-height: 56px; max-width: 160px; object-fit: contain; }
.inst-logo-placeholder {
  width: 56px; height: 56px; border-radius: 10px;
  background: var(--navy); color: var(--gold);
  font-family: 'Syne', sans-serif; font-weight: 800; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
}

.inst-name { font-size: 17px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.inst-type {
  display: inline-block;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; padding: 3px 10px; border-radius: 100px;
  margin-bottom: 14px;
}
.type-university          { background: rgba(13,27,42,0.08); color: var(--navy-light); }
.type-university_of_technology { background: rgba(37,99,235,0.1); color: #1e40af; }
.type-tvet                { background: rgba(22,163,74,0.1);  color: #14532d; }
.type-private             { background: rgba(232,162,25,0.12); color: var(--gold-dim); }

.inst-detail {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-muted); margin-bottom: 6px;
}
.inst-detail strong { color: var(--text); }

.inst-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.btn-visit {
  flex: 1; padding: 10px 0; border-radius: var(--radius);
  background: var(--navy); color: var(--white);
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 700;
  text-align: center; border: none; cursor: pointer; transition: var(--transition);
}
.btn-visit:hover { background: var(--navy-mid); }
.btn-apply-inst {
  flex: 1; padding: 10px 0; border-radius: var(--radius);
  background: var(--gold); color: var(--navy);
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 700;
  text-align: center; border: none; cursor: pointer; transition: var(--transition);
}
.btn-apply-inst:hover { background: var(--gold-light); }

/* ─── TERMS & CONDITIONS ────────────────────── */
.terms-page {
  max-width: 800px; margin: 0 auto; width: 100%; padding: 40px 24px 80px;
  display: flex; flex-direction: column; gap: 20px;
}
.terms-nav {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 14px 20px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px;
}
.terms-nav span { color: var(--text-muted); font-weight: 600; margin-right: 4px; }
.terms-nav a {
  color: var(--gold-dim); text-decoration: none; font-weight: 500;
  padding: 2px 8px; border-radius: 4px; transition: var(--transition);
}
.terms-nav a:hover { background: rgba(232,162,25,0.1); color: var(--gold); }
.terms-card {
  background: var(--white); border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg); padding: 32px 36px;
  box-shadow: var(--shadow);
}
.terms-card h2 {
  font-family: 'Syne', sans-serif; font-size: 20px;
  color: var(--navy); margin-bottom: 14px;
}
.terms-card p { font-size: 15px; line-height: 1.75; color: var(--text-body); margin-bottom: 12px; }
.terms-card p:last-child { margin-bottom: 0; }
.terms-card ul { padding-left: 20px; margin: 10px 0 12px; display: flex; flex-direction: column; gap: 8px; }
.terms-card li { font-size: 15px; line-height: 1.7; color: var(--text-body); }
.terms-card a { color: var(--gold-dim); }
.terms-card a:hover { color: var(--gold); }
.terms-disclaimer {
  border-left: 4px solid #f59e0b;
  background: #fffbeb;
}
.terms-disclaimer h2 { color: #92400e; }
.terms-disclaimer li { color: #78350f; }
.terms-disclaimer p { color: #78350f; }

/* ─── APPLICATION ASSIST ────────────────────── */
.apply-page { max-width: 700px; margin: 48px auto; width: 100%; padding: 0 24px 80px; }
.apply-card {
  background: var(--white); border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg); padding: 36px;
  box-shadow: var(--shadow);
}
.apply-card h1 { font-size: 26px; margin-bottom: 8px; }
.apply-card .lead { font-size: 15px; color: var(--text-muted); margin-bottom: 28px; }
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-label span { color: var(--danger); }
.form-control {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif; font-size: 14px; color: var(--text);
  transition: border-color 0.2s;
}
.form-control:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232,162,25,0.12); }
textarea.form-control { min-height: 100px; resize: vertical; }

.selected-courses-list {
  background: var(--gray-50); border: 1px solid var(--gray-100);
  border-radius: var(--radius); padding: 14px 16px; margin-top: 6px;
  font-size: 13px; color: var(--text-muted); min-height: 60px;
}
.selected-courses-list .no-courses { color: var(--gray-400); font-style: italic; }
.selected-course-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0; border-bottom: 1px solid var(--gray-100);
}
.selected-course-item:last-child { border-bottom: none; }
.selected-course-item::before { content: '✓'; color: var(--success); font-weight: 700; }

.btn-submit {
  width: 100%; background: var(--navy); color: var(--white);
  border: none; border-radius: var(--radius);
  padding: 14px; font-family: 'Syne', sans-serif; font-size: 16px; font-weight: 700;
  cursor: pointer; transition: var(--transition); margin-top: 6px;
}
.btn-submit:hover { background: var(--navy-mid); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.wa-option {
  display: flex; align-items: center; gap: 12px;
  background: rgba(37,211,102,0.08); border: 1px solid rgba(37,211,102,0.3);
  border-radius: var(--radius); padding: 14px 16px; margin-top: 14px;
  cursor: pointer; transition: var(--transition); text-decoration: none;
}
.wa-option:hover { background: rgba(37,211,102,0.14); }
.wa-icon { font-size: 24px; }
.wa-text strong { display: block; font-size: 14px; color: var(--text); }
.wa-text small { font-size: 12px; color: var(--text-muted); }

/* ─── ADMIN PANEL ───────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px; background: var(--navy); flex-shrink: 0;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 10px;
}
.admin-brand .logo-icon { width: 32px; height: 32px; font-size: 16px; }
.admin-brand span { font-family: 'Syne', sans-serif; font-weight: 700; color: var(--white); font-size: 14px; }
.admin-nav { padding: 12px 10px; flex: 1; }
.admin-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.65);
  margin-bottom: 2px; transition: var(--transition);
}
.admin-nav-item:hover, .admin-nav-item.active { background: rgba(255,255,255,0.09); color: var(--white); }
.admin-nav-item.active { color: var(--gold); }
.admin-nav-section {
  font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.3);
  text-transform: uppercase; letter-spacing: 0.8px;
  padding: 14px 12px 6px;
}
.admin-main { flex: 1; background: var(--off-white); overflow-y: auto; }
.admin-topbar {
  background: var(--white); border-bottom: 1px solid var(--gray-100);
  padding: 0 28px; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
}
.admin-topbar h1 { font-size: 18px; color: var(--navy); }
.admin-content { padding: 28px; }

/* Admin table */
.data-table {
  width: 100%; border-collapse: collapse;
  background: var(--white); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow);
  font-size: 13px;
}
.data-table th {
  background: var(--navy); color: var(--gold);
  padding: 12px 16px; text-align: left;
  font-family: 'Syne', sans-serif; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--gray-100); color: var(--text); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--gray-50); }

/* Admin form */
.admin-form-card {
  background: var(--white); border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg); padding: 28px;
  box-shadow: var(--shadow); max-width: 800px;
}
.admin-form-card h2 { font-size: 20px; margin-bottom: 24px; padding-bottom: 14px; border-bottom: 1px solid var(--gray-100); }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* Status badges */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 700;
}
.badge-new      { background: #dbeafe; color: #1e40af; }
.badge-contacted { background: #fef3c7; color: #92400e; }
.badge-done     { background: #d1fae5; color: #065f46; }
.badge-active   { background: #d1fae5; color: #065f46; }
.badge-inactive { background: var(--gray-100); color: var(--gray-600); }
.badge-payment-pending { background: #fef3c7; color: #92400e; }
.badge-processing      { background: #dbeafe; color: #1e40af; }
.badge-completed       { background: #d1fae5; color: #065f46; }
.badge-cancelled       { background: #fee2e2; color: #991b1b; }
.badge-pending         { background: #fef3c7; color: #92400e; }
.badge-approved        { background: #dbeafe; color: #1e40af; }
.badge-rejected        { background: #fee2e2; color: #991b1b; }
.badge-paid            { background: #d1fae5; color: #065f46; }

/* General buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 700;
  cursor: pointer; border: none; transition: var(--transition);
  text-decoration: none;
}
.btn-primary   { background: var(--gold); color: var(--navy); }
.btn-primary:hover { background: var(--gold-light); }
.btn-navy      { background: var(--navy); color: var(--white); }
.btn-navy:hover { background: var(--navy-mid); }
.btn-danger    { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #b91c1c; }
.btn-outline   { background: transparent; color: var(--navy); border: 1.5px solid var(--gray-200); }
.btn-outline:hover { border-color: var(--navy); }
.btn-sm        { padding: 6px 12px; font-size: 12px; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 18px; font-size: 14px; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #86efac; }
.alert-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* Empty state */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; color: var(--navy); margin-bottom: 8px; }

/* Footer */
.site-footer { background: var(--navy); margin-top: auto; }
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 32px 24px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-site-name { font-family: 'Syne', sans-serif; font-weight: 700; color: var(--white); font-size: 15px; }
.footer-tagline { font-size: 12px; color: rgba(255,255,255,0.4); }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { font-size: 13px; color: rgba(255,255,255,0.55); transition: color 0.2s; }
.footer-links a:hover { color: var(--white); }
.footer-copy p { font-size: 12px; color: rgba(255,255,255,0.35); }
.footer-copy a { color: var(--gold); }

/* ─── BROWSE PAGE ────────────────────────────── */
.browse-controls-bar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  padding: 14px 24px;
  position: sticky; top: 64px; z-index: 100;
  box-shadow: var(--shadow);
}
.browse-controls-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.browse-search-wrap { flex: 1; min-width: 220px; }
.browse-search-input {
  width: 100%; padding: 9px 14px;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif; font-size: 14px; color: var(--text);
  background: var(--white); transition: border-color .2s;
}
.browse-search-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232,162,25,0.12); }
.browse-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.browse-aps-wrap { display: flex; align-items: center; gap: 8px; }
.browse-aps-label { font-size: 13px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.browse-aps-input {
  width: 80px; padding: 9px 10px;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif; font-size: 14px;
  text-align: center; color: var(--text); transition: border-color .2s;
}
.browse-aps-input:focus { outline: none; border-color: var(--gold); }
.browse-count { font-size: 13px; font-weight: 700; color: var(--text-muted); white-space: nowrap; padding: 0 4px; }
.browse-grid { max-width: 1200px; margin: 20px auto 48px; width: 100%; padding: 0 24px; }
.browse-all-link {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 20px;
  font-size: 14px; color: rgba(255,255,255,0.6);
  border-bottom: 1px solid rgba(255,255,255,0.2); padding-bottom: 2px;
  transition: color .2s, border-color .2s;
}
.browse-all-link:hover { color: var(--gold); border-color: var(--gold); }

/* ─── RESPONSIVE ─────────────────────────────── */

/* Courses grid — explicit column counts (viewport-based, not container-based) */
@media (max-width: 1100px) { .courses-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px)  { .courses-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; } }
@media (max-width: 480px)  { .courses-grid { grid-template-columns: 1fr; gap: 12px; } }

/* ── 900px Tablet ───────────────────────────── */
@media (max-width: 900px) {
  .tile-grid { grid-template-columns: repeat(2, 1fr); }
  .how-grid { grid-template-columns: 1fr; gap: 24px; }
}

/* ── 768px Large phone ──────────────────────── */
@media (max-width: 768px) {
  .hero { padding: 40px 20px 84px; }
  .portal-tiles { margin-top: -48px; }
  .calc-card { padding: 24px 22px 20px; }
  .how-it-works { padding: 40px 20px; }
  .results-section { padding: 28px 20px; }
  .institutions-grid { padding: 0 20px; margin: 24px auto; }
  .apply-page { padding: 0 20px 80px; margin: 28px auto; }
  .apply-card { padding: 28px 22px; }
  .terms-page { padding: 24px 20px 60px; }
  .terms-card { padding: 24px 22px; }
  .browse-grid { padding: 0 20px; }
  .browse-controls-bar { padding: 12px 20px; }
}

/* ── 1143px — Switch to hamburger nav ────────── */
@media (max-width: 1143px) {
  .nav-links     { display: none; }
  .nav-container { justify-content: space-between; }
}

/* ── 640px Phone ────────────────────────────── */
@media (max-width: 640px) {
  /* Nav */
  .nav-container { padding: 0 16px; gap: 10px; }

  /* Hero */
  .hero { padding: 32px 16px 72px; }
  .hero-title { font-size: clamp(24px, 7vw, 32px); }
  .hero-sub { font-size: 14px; }
  .portal-tiles { margin-top: -40px; }
  .tile-grid { grid-template-columns: 1fr; gap: 14px; }

  /* Calculator */
  .calc-card { padding: 22px 18px 18px; }

  /* Final CTA */
  .final-cta { flex-direction: column; text-align: center; padding: 32px 22px; gap: 20px; }
  .final-cta-actions { width: 100%; justify-content: center; flex-wrap: wrap; }

  /* Results */
  .results-section { padding: 20px 16px; }
  .results-title { font-size: 20px; }
  .results-header { gap: 10px; }
  .filter-bar { gap: 8px; }
  .filter-select { flex: 1; min-width: 0; }
  .filter-dropdowns { gap: 8px; }
  .filter-dropdowns .filter-select { flex: 1; min-width: 120px; }

  /* Shortlist bar — keep only essential buttons */
  .shortlist-bar { padding: 12px 16px; gap: 10px; }
  .share-fb, .share-em, .share-tw { display: none; }
  .shortlist-actions { gap: 8px; }
  .share-btn { padding: 9px 12px; font-size: 12px; }
  .btn-request { padding: 9px 14px; font-size: 12px; }

  /* Apply page */
  .apply-page { padding: 0 16px 80px; }
  .apply-card { padding: 22px 18px; }
  .form-grid-2 { grid-template-columns: 1fr !important; gap: 0 !important; }

  /* Institutions */
  .institutions-grid { padding: 0 16px; gap: 14px; }
  .inst-actions { flex-direction: column; }
  .btn-visit, .btn-apply-inst { flex: none; width: 100%; text-align: center; }

  /* Footer */
  .footer-inner { flex-direction: column; padding: 28px 16px; gap: 20px; align-items: flex-start; }
  .footer-links { gap: 12px 24px; }

  /* Browse page */
  .browse-controls-bar { padding: 12px 16px; }
  .browse-search-wrap { min-width: 100%; }
  .browse-filters { width: 100%; gap: 8px; }
  .browse-filters .filter-select { flex: 1; min-width: 0; }
  .browse-aps-input { width: 72px; }
  .browse-grid { padding: 0 16px; margin: 16px auto 60px; }

  /* Admin */
  .admin-sidebar { display: none; }
  .admin-main { width: 100%; }
}

/* ── 480px Small phone ──────────────────────── */
@media (max-width: 480px) {
  /* Nav */
  .btn-apply { padding: 8px 12px; font-size: 13px; }

  /* Hero */
  .hero { padding: 24px 16px 60px; }
  .hero-tag { font-size: 10px; margin-bottom: 12px; }
  .portal-tiles { margin-top: -32px; }

  /* Calculator */
  .calc-card { padding: 18px 14px 16px; }
  .calc-card h2 { font-size: 17px; }
  .calc-sub { font-size: 12px; margin-bottom: 16px; }
  .subject-row { grid-template-columns: 1fr 70px; gap: 8px; margin-bottom: 8px; }
  .form-select { font-size: 13px; padding: 8px 8px; }
  .pct-input { padding: 8px 4px; font-size: 13px; text-align: center; }
  .aps-bar { padding: 11px 14px; margin: 14px 0; }
  .aps-label { font-size: 12px; }
  .aps-score-display { font-size: 22px; }
  .btn-calc-row { grid-template-columns: 1fr; gap: 8px; }
  .btn-calc { font-size: 15px; padding: 13px; }
  .btn-reset { padding: 10px 14px; font-size: 13px; }

  /* Shortlist bar: stack on very small phones */
  .shortlist-bar { flex-direction: column; align-items: stretch; padding: 12px 14px; }
  .shortlist-info { text-align: center; }
  .shortlist-actions { justify-content: center; flex-wrap: wrap; }

  /* Course cards */
  .course-card { padding: 16px 14px; }
  .course-name { font-size: 15px; }

  /* Apply */
  .apply-card { padding: 18px 14px; }
  .apply-card h1 { font-size: 22px; }
  .terms-card { padding: 18px 14px; }
  .terms-card h2 { font-size: 17px; }

  /* Browse filters: wrap APS to its own row */
  .browse-aps-wrap { flex-basis: 100%; }
  .browse-aps-input { flex: 1; width: 100%; }
}

/* ── Reverse Calculator ──────────────────────── */
.rc-wrap { max-width: 1100px; margin: 0 auto; padding: 32px 24px 64px; }
.rc-header { margin-bottom: 24px; }
.rc-back { font-size: 13px; color: var(--text-muted); text-decoration: none; }
.rc-back:hover { color: var(--navy); }
.rc-title { font-family: 'Syne', sans-serif; font-size: 30px; font-weight: 800; color: var(--navy); margin: 10px 0 4px; }
.rc-sub { font-size: 14px; color: var(--text-muted); }
.rc-layout { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
.rc-sidebar { background: var(--white); border: 1px solid var(--gray-100); border-radius: var(--radius-lg); padding: 18px; position: sticky; top: 80px; }
.rc-course-list { max-height: 55vh; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.rc-course-list::-webkit-scrollbar { width: 4px; }
.rc-course-list::-webkit-scrollbar-track { background: var(--gray-50); }
.rc-course-list::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 2px; }
.rc-item { padding: 11px 12px; border-radius: var(--radius); cursor: pointer; border: 1.5px solid transparent; transition: background .12s, border-color .12s; margin-bottom: 4px; }
.rc-item:hover { background: var(--gray-50); border-color: var(--gray-200); }
.rc-item.active { background: #eff6ff; border-color: var(--navy); }
.rc-item-inst { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 2px; }
.rc-item-name { font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 4px; line-height: 1.3; }
.rc-item-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.rc-item-meta span { font-size: 10px; color: var(--text-muted); background: var(--gray-100); padding: 1px 6px; border-radius: 10px; }
.rc-detail { background: var(--white); border: 1px solid var(--gray-100); border-radius: var(--radius-lg); padding: 28px; min-height: 300px; }
.rc-placeholder { text-align: center; padding: 60px 20px; }
.rc-detail-inst { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.rc-detail-name { font-size: 22px; font-weight: 800; color: var(--navy); margin-bottom: 14px; line-height: 1.2; }
.rc-aps-box { background: var(--gray-50); border: 1px solid var(--gray-100); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 22px; }
.rc-aps-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.rc-aps-value { font-family: 'Syne', sans-serif; font-size: 34px; font-weight: 800; color: var(--navy); line-height: 1; }
.rc-aps-max { font-size: 16px; color: var(--text-muted); }
.rc-aps-note { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.rc-reqs-title { font-weight: 700; font-size: 13px; margin-bottom: 10px; }
.rc-reqs { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.rc-req-row { display: flex; align-items: center; justify-content: space-between; background: var(--gray-50); border: 1px solid var(--gray-100); border-radius: var(--radius); padding: 10px 14px; }
.rc-req-subj { font-weight: 600; font-size: 13px; }
.rc-req-val { font-size: 13px; color: var(--text-muted); }
.rc-req-level { font-size: 11px; }
.rc-sim-title { font-weight: 700; font-size: 14px; margin-bottom: 12px; padding-top: 20px; border-top: 1px solid var(--gray-100); }
.rc-sim-grid { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.rc-sim-row { display: grid; grid-template-columns: 1fr 80px 48px; gap: 8px; align-items: center; padding: 6px 0; }
.rc-sim-subj { font-size: 13px; font-weight: 500; }
.rc-lo-tag { font-size: 9px; background: var(--gray-200); color: var(--text-muted); padding: 1px 5px; border-radius: 6px; vertical-align: middle; }
.sim-level { font-size: 12px; color: var(--text-muted); text-align: center; font-weight: 600; }
.rc-sim-result { background: var(--gray-50); border: 1px solid var(--gray-100); border-radius: var(--radius); padding: 14px 16px; font-size: 14px; line-height: 1.6; transition: background .2s, border-color .2s; }
@media (max-width: 860px) {
  .rc-layout { grid-template-columns: 1fr; }
  .rc-sidebar { position: static; }
  .rc-course-list { max-height: 40vh; }
}

/* ── What-If Simulator ──────────────────────── */
.whatif-panel {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  margin-top: 16px;
  overflow: hidden;
}
.whatif-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px;
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
}
.whatif-toggle { transition: transform .2s; }
.whatif-body { padding: 16px 18px; }
.whatif-body.collapsed { display: none; }
.whatif-row { display: flex; gap: 10px; margin-bottom: 12px; }
.whatif-scores { display: flex; flex-wrap: wrap; gap: 8px; }
.whatif-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--gray-50); border: 1px solid var(--gray-100);
  border-radius: 20px; padding: 5px 12px; font-size: 12px;
}
.whatif-inst { color: var(--text-muted); }
.whatif-diff { font-size: 11px; font-weight: 700; }
.whatif-diff.pos { color: #16a34a; }
.whatif-diff.neg { color: #dc2626; }
.whatif-diff.neutral { color: var(--text-muted); }

/* ── Gap Analysis ────────────────────────────── */
.gap-section {
  margin-top: 36px;
  padding: 24px;
  background: linear-gradient(135deg, #fff7ed 0%, #fffbeb 100%);
  border: 1px solid #fed7aa;
  border-radius: var(--radius-lg);
}
.gap-title { font-size: 18px; font-weight: 700; color: #92400e; margin-bottom: 6px; }
.gap-sub { font-size: 13px; color: #78350f; margin-bottom: 16px; }
.gap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.gap-card {
  background: var(--white);
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  padding: 14px 16px;
}
.gap-needs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.gap-chip {
  font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 20px;
}
.gap-chip.aps { background: #fef3c7; color: #92400e; }
.gap-chip.subj { background: #fee2e2; color: #991b1b; }

/* ── Modals ──────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  display: none; place-items: center;
  z-index: 2000;
  padding: 16px;
}
.modal-overlay.open { display: grid; }
.modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  max-width: 480px; width: 100%;
  position: relative;
  max-height: 90vh; overflow-y: auto;
}
.modal-box.modal-wide { max-width: 860px; }
.modal-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; font-size: 18px;
  cursor: pointer; color: var(--text-muted);
}

/* ── Course Comparison ───────────────────────── */
.compare-col {
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--gray-50);
}
.compare-inst { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; }
.compare-name { font-size: 15px; font-weight: 700; color: var(--navy); margin-bottom: 12px; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.compare-table th { text-align: left; color: var(--text-muted); font-weight: 500; padding: 5px 0; width: 50%; }
.compare-table td { font-weight: 600; }
.compare-table td.good { color: #16a34a; }
.compare-table td.ok { color: #d97706; }

/* Compare button on course cards */
.btn-compare {
  padding: 6px 12px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--gray-200); border-radius: var(--radius);
  background: var(--white); cursor: pointer; color: var(--text);
  transition: background .15s;
}
.btn-compare:hover { background: var(--gray-50); }
.btn-compare.active { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* ── Print styles ────────────────────────────── */
@media print {
  .nav-bar, .hero, .shortlist-bar, .ad-banner, .filter-bar,
  .btn-select, .btn-compare, .btn-inst-link, .share-btn,
  .btn-request, .gap-section, .whatif-panel,
  .modal-overlay { display: none !important; }
  .results-header { border-bottom: 2px solid #000; padding-bottom: 12px; margin-bottom: 16px; }
  .courses-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .course-card { border: 1px solid #ccc; break-inside: avoid; }
  body { font-size: 12px; }
}

/* ── Deadline status badges ─────────────────── */
.deadline-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 3px 9px;
  border-radius: 20px;
  margin-bottom: 10px;
}
.deadline-badge.open     { background: #d1fae5; color: #065f46; }
.deadline-badge.closing  { background: #fef3c7; color: #92400e; }
.deadline-badge.closed   { background: #fee2e2; color: #991b1b; }
.deadline-badge.upcoming { background: #e0e7ff; color: #3730a3; }
.deadline-badge.unknown  { background: var(--gray-100); color: var(--text-muted); }

/* ── Feature toggle switch ──────────────────── */
.feat-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.feat-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.feat-toggle-track {
  width: 44px; height: 24px;
  background: var(--gray-200);
  border-radius: 12px;
  transition: background .2s;
  position: relative;
  display: block;
}
.feat-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  transition: transform .2s;
}
.feat-toggle-track.on { background: #22c55e; }
.feat-toggle input:checked + .feat-toggle-track { background: #22c55e; }
.feat-toggle input:checked + .feat-toggle-track::after { transform: translateX(20px); }

/* ── 480px Small phone — hide logo text when hamburger is crowded ── */
@media (max-width: 480px) {
  .logo-text { display: none; }
}

/* ── 380px Very small phone ─────────────────── */
@media (max-width: 380px) {
  .hero { padding: 20px 14px 0; }
  .hero-title { font-size: 22px; }
  .calc-card { padding: 16px 12px 0; }
  .course-card { padding: 14px 12px; }
  .apply-card { padding: 16px 12px; }
  .share-wa { padding: 8px 10px; font-size: 11px; }
  .btn-request { padding: 8px 10px; font-size: 11px; }
  .browse-controls-bar { padding: 10px 12px; }
  .browse-grid { padding: 0 12px; }
  .institutions-grid { padding: 0 12px; }
}

/* ══════════════════════════════════════════════
   PHASE 2 — Mobile Polish & Missing Classes
══════════════════════════════════════════════ */

/* ─── MISSING ADMIN BUTTON CLASSES ──────────── */
.btn-secondary {
  background: var(--gray-100); color: var(--text);
  border: 1.5px solid var(--gray-200);
}
.btn-secondary:hover { background: var(--gray-200); }

.btn-ghost {
  background: transparent; color: var(--text-muted);
  border: 1.5px solid var(--gray-100);
}
.btn-ghost:hover { background: var(--gray-50); border-color: var(--gray-200); color: var(--text); }

.btn-danger-sm {
  display: inline-flex; align-items: center;
  background: var(--danger); color: #fff;
  border: none; border-radius: var(--radius);
  padding: 5px 10px; font-size: 12px; font-weight: 700;
  font-family: 'DM Sans', sans-serif; cursor: pointer;
  transition: var(--transition);
}
.btn-danger-sm:hover { background: #b91c1c; }

/* ─── ADMIN TABLE + WRAPPER ──────────────────── */
.admin-table {
  width: 100%; border-collapse: collapse;
  background: var(--white); font-size: 13px; min-width: 560px;
}
.admin-table th {
  background: var(--navy); color: var(--gold);
  padding: 12px 16px; text-align: left;
  font-family: 'Syne', sans-serif; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap;
}
.admin-table td {
  padding: 12px 16px; border-bottom: 1px solid var(--gray-100);
  color: var(--text); vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--gray-50); }
.admin-table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
}

/* Admin card */
.admin-card {
  background: var(--white); border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
}

/* Scrollable wrapper for existing data-table instances */
.data-table-scroll {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.data-table-scroll .data-table { min-width: 520px; }

/* ─── PUBLIC NAV — HAMBURGER ─────────────────── */
.nav-hamburger {
  display: none; flex-shrink: 0;
  flex-direction: column; justify-content: center; align-items: center;
  gap: 5px; width: 36px; height: 36px;
  background: none; border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: 8px; cursor: pointer; padding: 7px;
}
.nav-hamburger span {
  display: block; width: 16px; height: 2px;
  background: rgba(255,255,255,0.85); border-radius: 2px;
  transition: transform 0.22s, opacity 0.18s;
  pointer-events: none;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (max-width: 1143px) { .nav-hamburger { display: flex; } }

/* Mobile nav drawer */
.mobile-nav-drawer {
  display: none; flex-direction: column;
  background: var(--navy-mid);
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 6px 12px 16px;
}
.mobile-nav-drawer.open { display: flex; }
.mobile-nav-link {
  display: block; padding: 12px 14px;
  font-size: 15px; font-weight: 600;
  color: rgba(255,255,255,0.75); border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.mobile-nav-link:hover,
.mobile-nav-link.active { background: rgba(255,255,255,0.09); color: var(--white); }
.mobile-nav-cta {
  display: block; margin-top: 10px;
  background: var(--gold); color: var(--navy);
  padding: 12px 14px; border-radius: 8px;
  font-size: 15px; font-weight: 700; text-align: center;
  transition: background 0.15s;
}
.mobile-nav-cta:hover { background: var(--gold-light); }

/* ─── ADMIN — MOBILE NAV BAR ─────────────────── */
.admin-mobile-bar {
  display: none;
  align-items: center; justify-content: space-between;
  background: var(--navy); padding: 0 16px; height: 52px;
  border-bottom: 1px solid rgba(255,255,255,0.09);
  position: fixed; top: 0; left: 0; right: 0; z-index: 270;
}
.admin-mobile-brand {
  display: flex; align-items: center; gap: 8px;
}
.admin-mobile-brand .logo-icon { width: 28px; height: 28px; font-size: 14px; border-radius: 6px; }
.admin-mobile-brand span {
  font-family: 'Syne', sans-serif; font-weight: 700;
  color: var(--white); font-size: 14px;
}
.admin-sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); z-index: 255;
}
.admin-sidebar-overlay.open { display: block; }

/* ─── ADMIN RESPONSIVE GRIDS ─────────────────── */
.admin-grid-2 {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 20px; margin-bottom: 22px;
}
.admin-grid-sidebar {
  display: grid; grid-template-columns: 220px 1fr; gap: 20px;
}
.admin-grid-detail {
  display: grid; grid-template-columns: 1fr 300px; gap: 20px;
}

/* ── 860px — Admin grids collapse early ─────── */
@media (max-width: 860px) {
  .admin-grid-2      { grid-template-columns: 1fr; }
  .admin-grid-sidebar { grid-template-columns: 1fr; }
  .admin-grid-detail { grid-template-columns: 1fr; }
}

/* ── 640px — Full admin mobile layout ───────── */
@media (max-width: 640px) {
  /* Show admin mobile bar */
  .admin-mobile-bar { display: flex; }

  /* Sidebar becomes a fixed slide-in overlay */
  .admin-sidebar {
    display: flex !important;
    position: fixed; top: 52px; left: 0; bottom: 0;
    width: 260px; height: calc(100% - 52px);
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
    z-index: 260;
    box-shadow: 6px 0 24px rgba(0,0,0,0.3);
    overflow-y: auto;
  }
  .admin-sidebar.mobile-open { transform: translateX(0); }

  /* Layout stacks, main gets top padding for fixed bar */
  .admin-layout { flex-direction: column; min-height: unset; }
  .admin-main { width: 100%; padding-top: 52px; overflow-x: hidden; }

  /* Topbar: compress height */
  .admin-topbar {
    padding: 10px 16px; height: auto;
    min-height: 48px; flex-wrap: wrap; gap: 8px;
  }
  .admin-topbar h1 { font-size: 16px; }

  /* Content padding mobile */
  .admin-content { padding: 14px 16px 28px; }

  /* Collapse ALL inline grid-template-columns inside admin forms */
  .admin-card [style*="grid-template-columns"],
  .admin-form-card [style*="grid-template-columns"],
  .admin-content [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  .admin-card { padding: 18px 14px; }
  .admin-form-card { padding: 18px 14px; }

  /* Tables: scrollable on mobile */
  .data-table { min-width: 520px; }
  .admin-table { min-width: 560px; }
  .data-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Analytics bar chart: slightly shorter on mobile */
  .bar-chart { height: 70px; }
  .bar-lbl { font-size: 8px; }

  /* Empty state mobile */
  .empty-state { padding: 40px 16px; }
  .empty-state .icon { font-size: 36px; margin-bottom: 12px; }
  .empty-state h3 { font-size: 16px; }
}

/* ── 480px — Admin content tighter ─────────── */
@media (max-width: 480px) {
  .admin-content { padding: 12px 12px 24px; }
  .admin-topbar { padding: 8px 12px; }
  .admin-topbar h1 { font-size: 14px; }
}

/* ─── BURSARIES PAGE ────────────────────────── */
.bursaries-grid {
  max-width: 1200px; margin: 24px auto 32px;
  padding: 0 24px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 20px;
}
.bursary-card {
  background: var(--white);
  border: 1.5px solid var(--gray-100);
  border-radius: var(--radius-lg); padding: 24px;
  transition: var(--transition);
  display: flex; flex-direction: column;
}
.bursary-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.bursary-card.bursary-closed { opacity: 0.72; }

.bursary-provider {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--gold-dim); margin-bottom: 6px;
}
.bursary-name {
  font-family: 'Syne', sans-serif; font-size: 17px; font-weight: 700;
  color: var(--navy); margin-bottom: 12px; line-height: 1.3;
}
.bursary-amount { margin-bottom: 12px; }
.bursary-amount-pill {
  display: inline-block;
  background: rgba(22,163,74,0.1); color: #14532d;
  font-size: 12px; font-weight: 700;
  padding: 4px 12px; border-radius: 100px;
}
.bursary-desc {
  font-size: 13px; color: var(--text-muted); line-height: 1.6;
  margin-bottom: 14px; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  overflow: hidden;
}
.bursary-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.bursary-tag {
  font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 100px;
  background: rgba(13,27,42,0.07); color: var(--navy-light);
}
.bursary-meta { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.bursary-meta-item { font-size: 13px; color: var(--text-muted); }
.bursary-meta-item strong { color: var(--text); }
.bursary-meta-warning { color: var(--warning); font-weight: 600; }
.bursary-meta-closed  { color: var(--danger); }

.bursary-card-actions { display: flex; gap: 8px; margin-top: auto; }
.btn-bursary-shortlist {
  flex: 1; padding: 10px 0; border-radius: var(--radius);
  background: transparent; color: var(--navy);
  border: 1.5px solid var(--gray-200);
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: var(--transition); text-align: center;
}
.btn-bursary-shortlist:hover { border-color: var(--gold); color: var(--gold-dim); }
.bursary-selected .btn-bursary-shortlist {
  border-color: var(--gold); color: var(--gold-dim); background: rgba(232,162,25,0.08);
}
.bursary-card.bursary-selected { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232,162,25,0.15); }

@media (max-width: 760px) {
  .bursaries-grid { grid-template-columns: 1fr; gap: 14px; padding: 0 20px; }
}
@media (max-width: 480px) {
  .bursaries-grid { padding: 0 16px; }
}
