/* VeloOps · Shared styles · SSNIT-inspired institutional typography */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=DM+Mono:wght@400;500&display=swap');

:root {
  /* SSNIT institutional palette · navy primary + orange action + flat white surfaces */
  --purple: #111111;            /* POA deep navy · primary brand */
  --purple-dark: #0A0A0A;
  --purple-light: #F5EBE2;
  --purple-pale: #FAF6F1;
  --teal: #1E7A46;              /* success green · used sparingly */
  --teal-light: #E6F4EC;
  --teal-bright: #2E9D5C;
  --amber: #E8850C;             /* caution orange */
  --amber-light: #FDF0DE;
  --red: #C0392B;               /* critical only */
  --red-light: #FBEAE8;
  --blue: #111111;
  --blue-light: #F5EBE2;

  --bg: #F7F5F2;                /* warm off-white · POA page background */
  --white: #fff;
  --text-primary: #141414;      /* deep slate, not pure black */
  --text-secondary: #4A5866;
  --text-tertiary: #8494A3;
  --border: #E7E2DC;            /* warm neutral border */

  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', ui-monospace, monospace;

  /* Government theme · same SSNIT palette, darker sidebar */
  --gov-navy:    #14100D;      /* sidebar · POA warm black */
  --gov-navy-2:  #111111;
  --gov-orange:  #B0522D;      /* POA orange · action colour */
  --gov-orange-2:#93411F;      /* darker POA orange on hover */
  --gov-bg:      #F7F5F2;
  --gov-text-2:  #4A5866;
  --gov-border:  #E7E2DC;

  --shadow-sm: 0 1px 2px rgba(15, 48, 87, 0.05);
  --shadow-md: 0 3px 12px rgba(15, 48, 87, 0.08);
  --shadow-lg: 0 10px 28px rgba(15, 48, 87, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body); background: var(--bg);
  color: var(--text-primary); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

/* ----- TOP NAV (public marketplace) ----- */
.topnav {
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 14px 32px; display: flex; align-items: center; gap: 24px;
  position: sticky; top: 0; z-index: 50;
}
.topnav-logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 18px; }
.topnav-logo-mark {
  width: 30px; height: 30px; border-radius: 6px; background: var(--gov-orange);
  color: #fff; display: grid; place-items: center; font-size: 13px;
}
.topnav-logo-mark span { color: var(--teal-bright); }
.topnav-links { display: flex; gap: 18px; margin-left: auto; }
.topnav-link { font-size: 14px; color: var(--text-secondary); padding: 6px 10px; border-radius: 6px; }
.topnav-link:hover { background: var(--purple-pale); color: var(--text-primary); }
.topnav-link.active { color: var(--purple); font-weight: 600; }
.topnav-cta {
  background: var(--gov-orange); color: #fff; padding: 9px 16px;
  border-radius: 8px; font-weight: 600; font-size: 14px;
  transition: background 0.15s;
}
.topnav-cta:hover { background: var(--gov-orange-2); }

/* ----- BUTTONS ----- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 9px; font-weight: 600; font-size: 14px;
  transition: all 0.15s; white-space: nowrap;
}
.btn-primary { background: var(--gov-orange); color: #fff; }
.btn-primary:hover { background: var(--gov-orange-2); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; color: var(--text-primary); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--purple); color: var(--purple); }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: #0a5644; }
.btn-lg { padding: 14px 26px; font-size: 15px; }

/* ----- TAGS ----- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 99px;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.tag-verified { background: var(--teal-light); color: var(--teal); }
.tag-featured { background: var(--amber-light); color: var(--amber); }
.tag-new { background: var(--purple-light); color: var(--purple); }

/* ----- CARDS ----- */
.card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px; box-shadow: var(--shadow-sm);
}
.card-hover { transition: all 0.15s; cursor: pointer; }
.card-hover:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: #C7D6E8; }

/* ----- FORM ----- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.input, .select, textarea.input {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 9px; padding: 11px 14px; font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, textarea.input:focus {
  outline: none; border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(20, 71, 125, 0.12);
}

/* ----- FOOTER ----- */
.footer {
  background: var(--gov-navy); color: rgba(255,255,255,0.65);
  padding: 48px 32px; margin-top: 80px; text-align: center;
}
.footer-logo { font-family: var(--font-display); color: #fff; font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.footer-logo span { color: var(--teal-bright); }
.footer small { font-size: 12px; color: rgba(255,255,255,0.4); display: block; margin-top: 12px; }
.footer-links { display: flex; gap: 20px; justify-content: center; margin-top: 16px; font-size: 13px; }
.footer-links a:hover { color: #fff; }

/* ----- LAYOUT HELPERS ----- */
.container { max-width: 1240px; margin: 0 auto; padding: 0 32px; }
.section-pad { padding: 56px 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; }

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--text-primary); line-height: 1.15; }
h1 { font-size: 44px; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 30px; font-weight: 700; }
h3 { font-size: 20px; font-weight: 700; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--purple); }
.muted { color: var(--text-secondary); }

/* ===========================================================
   GHANA GOVERNMENT THEME · activates when body has .theme-gov
   =========================================================== */
:root {
  --gh-red:   #CE1126;
  --gh-gold:  #FCD116;
  --gh-green: #006B3F;
  --gh-navy:  #0A1F3D;
}

.gh-tricolor {
  height: 4px;
  background: linear-gradient(90deg, var(--gh-red) 0%, var(--gh-red) 33.33%, var(--gh-gold) 33.33%, var(--gh-gold) 66.66%, var(--gh-green) 66.66%, var(--gh-green) 100%);
  flex-shrink: 0;
}

.gh-coat {
  width: 100%; height: 100%; display: block;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.35));
}

/* Institution mode: SSNIT-inspired navy sidebar + orange accent */
.theme-gov { background: var(--gov-bg); }
.theme-gov .erp-body { background: var(--gov-bg); }
.theme-gov .erp-sidebar { background: var(--gov-navy); border-right: 1px solid rgba(255,255,255,0.06); }
.theme-gov .erp-logo { border-bottom-color: rgba(255,255,255,0.08); }
.theme-gov .erp-logo .mark { background: transparent !important; border-radius: 4px !important; padding: 0 !important; overflow: visible; }
.theme-gov .erp-logo .name .brand-text { color: #fff; font-family: var(--font-display); font-size: 14px; font-weight: 700; letter-spacing: -0.1px; line-height: 1.25; display: block; }
/* The institution whose records you are in — a real name, so it is set in normal
   case and allowed to wrap to a second line. Uppercase with wide letter-spacing
   is for labels; a ministry's name is not a label. */
.theme-gov .erp-logo .name .brand-sub {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  font-size: 10.5px; letter-spacing: 0; text-transform: none;
  color: rgba(255,255,255,0.58); font-weight: 500; line-height: 1.35; margin-top: 2px;
}

/* Gov theme keeps orange accents from the base sidebar styles;
   nothing here needs to override — nav-item/group/sub already use var(--gov-orange). */

.theme-gov .erp-foot { color: rgba(255,255,255,0.35); text-align: center; border-top-color: rgba(255,255,255,0.06); }

.theme-gov .erp-foot .motto { display: block; font-style: italic; margin-top: 4px; color: rgba(255,255,255,0.35); letter-spacing: 0.5px; }

/* Government-mode headings + accents */
.theme-gov .erp-head h1 { color: var(--gov-navy); font-weight: 800; }
.theme-gov .erp-head h1::before {
  content: ''; display: inline-block; width: 4px; height: 22px;
  background: var(--gov-orange); margin-right: 12px; vertical-align: -3px; border-radius: 2px;
}
.theme-gov .erp-head .sub { color: var(--gov-text-2); }
.theme-gov .btn-primary { background: var(--gov-orange); color: #fff; }
.theme-gov .btn-primary:hover { background: var(--gov-orange-2); }
.theme-gov .stat-val { color: var(--gov-navy); }
.theme-gov .erp-card h3 { color: var(--gov-navy); font-weight: 700; }
.theme-gov .card-link { color: var(--gov-orange); }
.theme-gov .dtable th { color: var(--gov-text-2); background: #fbfcfe; }
.theme-gov .dtable td { color: var(--gov-navy); }
.theme-gov .status-pill.status-good, .theme-gov .status-pill.status-confirmed { background: rgba(33, 186, 69, 0.12); color: #21ba45; }
.theme-gov h3, .theme-gov h2 { color: var(--gov-navy); }

/* ===========================================================
   HAMBURGER + COLLAPSIBLE SIDEBAR (SSNIT-style)
   Sidebar is hidden by default; hamburger at top-left opens it.
   =========================================================== */
.hamburger-btn {
  position: fixed; top: 14px; left: 14px; z-index: 200;
  width: 44px; height: 44px; border-radius: 10px;
  background: #fff; border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  display: grid; place-items: center; cursor: pointer;
  transition: all 0.15s;
}
.hamburger-btn:hover { border-color: var(--purple); }
.hamburger-btn svg { width: 22px; height: 22px; stroke: var(--text-primary); stroke-width: 2; }
.theme-gov .hamburger-btn { background: var(--gov-orange); border-color: var(--gov-orange); }
.theme-gov .hamburger-btn svg { stroke: #fff; }

.sidebar-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.35);
  z-index: 199; opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }

/* Sidebar slides in from the left when body.sidebar-open */
.erp-body .erp-sidebar {
  position: fixed !important; top: 0; left: 0; height: 100vh;
  z-index: 210; transform: translateX(-100%);
  transition: transform 0.25s ease-out;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}
body.sidebar-open .erp-sidebar { transform: translateX(0); }

/* Main content takes full width now that sidebar is overlay-style */
.erp-body .erp-main { width: 100%; margin-left: 0; padding-top: 72px; }

/* Close button inside the sidebar */
.sidebar-close {
  position: absolute; top: 20px; right: 14px;
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255,255,255,0.08); border: none;
  color: #fff; font-size: 20px; cursor: pointer;
  display: grid; place-items: center;
}
.sidebar-close:hover { background: rgba(255,255,255,0.16); }

/* ===========================================================
   ERP SHARED LAYOUT (sidebar + main) — used by all owner screens
   =========================================================== */
.erp-body { background: #F4F3FA; display: flex; min-height: 100vh; margin: 0; }
.erp-sidebar {
  width: 240px; flex-shrink: 0; background: var(--gov-navy); color: rgba(255,255,255,0.75);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
}
.erp-logo { padding: 20px 56px 16px 18px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.erp-logo .name { font-family: var(--font-display); color: #fff; font-weight: 800; font-size: 15px; display: flex; align-items: flex-start; gap: 10px; line-height: 1.25; }
.erp-logo .mark { width: 28px; height: 28px; border-radius: 7px; background: var(--purple); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.erp-logo .mark span { color: var(--teal-bright); }
.erp-logo .sub { font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 4px; padding-left: 38px; }
.erp-nav { padding: 10px 8px; flex: 1; }

/* Top-level items (Dashboard, Calendar) */
.nav-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 7px; font-size: 13.5px; color: rgba(255,255,255,0.78); cursor: pointer; transition: background 0.12s, color 0.12s; text-decoration: none; margin: 1px 0; }
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { color: var(--gov-orange, #B0522D); font-weight: 600; }
.nav-item.active::before { content: ''; position: absolute; left: 0; width: 3px; height: 22px; background: var(--gov-orange, #B0522D); border-radius: 0 3px 3px 0; }
.nav-item { position: relative; }

.nav-icon { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; opacity: 0.85; }
.nav-icon svg { width: 18px; height: 18px; display: block; }
.nav-item:hover .nav-icon,
.nav-item.active .nav-icon { opacity: 1; }
.nav-label { flex: 1; min-width: 0; }

/* Collapsible groups */
.nav-group { position: relative; margin: 2px 0; }
.nav-group-head {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; border-radius: 7px; background: none; border: 0;
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  color: rgba(255,255,255,0.82); cursor: pointer; text-align: left;
  transition: background 0.12s, color 0.12s;
}
.nav-group-head:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-group.has-active > .nav-group-head { color: var(--gov-orange, #B0522D); }
.nav-group.has-active::before { content: ''; position: absolute; left: 0; top: 8px; bottom: auto; height: 24px; width: 3px; background: var(--gov-orange, #B0522D); border-radius: 0 3px 3px 0; }
.nav-group-head .nav-chev { margin-left: auto; opacity: 0.55; transition: transform 0.18s; flex-shrink: 0; }
.nav-group.open > .nav-group-head .nav-chev { transform: rotate(180deg); opacity: 0.85; }

/* Group body — collapsed by default */
.nav-group-body { display: none; padding: 2px 0 6px 20px; }
.nav-group.open > .nav-group-body { display: block; }

/* Child sub-item (grey dot + label) */
.nav-sub {
  display: flex; align-items: center; gap: 12px;
  padding: 7px 12px 7px 8px; border-radius: 6px; margin: 1px 0;
  font-size: 13px; color: rgba(255,255,255,0.7);
  text-decoration: none; cursor: pointer; transition: background 0.12s, color 0.12s;
  position: relative;
}
.nav-sub:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav-sub .nav-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.3); flex-shrink: 0; transition: background 0.12s; }
.nav-sub:hover .nav-dot { background: rgba(255,255,255,0.6); }
.nav-sub.active { color: var(--gov-orange, #B0522D); font-weight: 600; background: rgba(176,82,45,0.08); }
.nav-sub.active .nav-dot { background: var(--gov-orange, #B0522D); }
.nav-sub.soon { opacity: 0.4; cursor: not-allowed; }
/* Section heading inside a nav group (e.g. Learning → Manage) */
.nav-sub-label {
  font-size: 9px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase;
  color: rgba(255,255,255,0.32); padding: 12px 10px 4px; margin-top: 2px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.nav-sub-label:first-child { border-top: 0; margin-top: 0; padding-top: 4px; }
.nav-tag { margin-left: auto; font-size: 9px; font-weight: 700; letter-spacing: 0.6px; color: rgba(255,255,255,0.5); }
.erp-foot { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,0.06); font-size: 11px; color: rgba(255,255,255,0.4); }

.erp-main { flex: 1; min-width: 0; padding: 28px 36px 60px; }
.erp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 16px; }
.erp-head h1 { font-size: 26px; font-family: var(--font-display); font-weight: 800; }
.erp-head .sub { font-size: 14px; color: var(--text-secondary); margin-top: 2px; }
.head-actions { display: flex; gap: 8px; align-items: center; }

/* Header search (partials.js) — drops to its own row on narrow screens */
@media (max-width: 860px) {
  #topSearch { order: 3 !important; max-width: none !important; flex-basis: 100%; }
}

/* ===== Learner LMS surfaces (my-learning, my-training, discussions, profile) ===== */
.lms-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .lms-grid { grid-template-columns: 1fr; } }

.lms-rail { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x mandatory; }
.lms-rail::-webkit-scrollbar { height: 6px; }
.lms-rail::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

.lcard { width: 232px; flex-shrink: 0; scroll-snap-align: start; background: #fff; border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; cursor: pointer; transition: border-color 0.12s, transform 0.12s, box-shadow 0.12s; display: flex; flex-direction: column; }
.lcard:hover { border-color: var(--gov-orange); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.lcard-art { height: 92px; display: grid; place-items: center; font-size: 30px; color: rgba(255,255,255,0.92); position: relative; }
.lcard-art .kicker { position: absolute; top: 8px; left: 10px; font-size: 9px; font-weight: 800; letter-spacing: 0.8px;
  text-transform: uppercase; background: rgba(0,0,0,0.28); color: #fff; padding: 3px 7px; border-radius: 3px; }
.lcard-body { padding: 12px 13px 0; flex: 1; }
.lcard-kind { font-size: 9.5px; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-tertiary); }
.lcard-title { font-size: 13.5px; font-weight: 700; line-height: 1.3; margin: 3px 0 4px; color: var(--text-primary); }
.lcard-code { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-tertiary); }
.lcard-foot { padding: 10px 13px 13px; }
.lcard-bar { height: 26px; border-radius: 6px; background: #F4F3F0; display: flex; align-items: center; gap: 7px;
  padding: 0 9px; font-size: 11.5px; font-weight: 700; color: var(--text-secondary); position: relative; overflow: hidden; }
.lcard-bar .fillbar { position: absolute; inset: 0 auto 0 0; background: rgba(176,82,45,0.16); }
.lcard-bar span { position: relative; }
.lcard-bar.done { background: rgba(16,122,88,0.12); color: var(--teal); }
.lcard-bar.start { background: var(--gov-orange); color: #fff; }

/* Taking an open-catalogue course. It fills the whole bar rather than sitting
   inside it, so the hit area is the full width the learner already reads as
   the action — and it is a real <button>, so it is reachable by keyboard and
   announced to a screen reader, which a styled <span> would not be. */
.lcard-take { position: relative; appearance: none; border: 0; background: transparent;
  width: 100%; height: 100%; margin: 0 -9px; padding: 0 9px; cursor: pointer;
  font: inherit; color: inherit; text-align: left; }
.lcard-take:hover { background: rgba(0,0,0,0.10); }
.lcard-take:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }

.lms-list-row { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.lms-list-row:last-child { border-bottom: none; }
.dont-miss { list-style: none; margin: 0; padding: 0; }
.dont-miss li { display: flex; gap: 9px; align-items: flex-start; padding: 8px 0; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.dont-miss li::before { content: '•'; color: var(--gov-orange); font-weight: 800; line-height: 1.4; }
.dont-miss a { color: var(--gov-orange); font-weight: 600; text-decoration: none; }
.dont-miss a:hover { text-decoration: underline; }

.lms-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.lms-tab { padding: 10px 14px; font-size: 13px; color: var(--text-secondary); cursor: pointer; border: none;
  background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-family: inherit; }
.lms-tab:hover { color: var(--text-primary); }
.lms-tab.active { color: var(--gov-orange); border-bottom-color: var(--gov-orange); font-weight: 700; }

.empty-state { text-align: center; padding: 64px 24px; color: var(--text-secondary); }
.empty-state .glyph { font-size: 40px; margin-bottom: 14px; opacity: 0.5; }
.empty-state h3 { font-family: var(--font-display); font-size: 19px; color: var(--text-primary); margin-bottom: 6px; }
.empty-state p { font-size: 13.5px; }

.is-readonly .btn-primary[disabled], .is-readonly .btn-delete[disabled] { pointer-events: none; }

/* ===== Filter popover (My training · View) ===== */
.pop-wrap { position: relative; }
.pop-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px;
  border: 1px solid var(--border); border-radius: 99px; background: #fff;
  font-size: 13px; font-family: inherit; font-weight: 600; color: var(--text-primary); cursor: pointer;
}
.pop-btn:hover { border-color: var(--gov-orange); }
.pop-btn.on { background: rgba(176,82,45,0.08); border-color: var(--gov-orange); color: var(--gov-orange); }
.pop-btn .chev { font-size: 9px; opacity: 0.6; }
.pop-btn .dot { width: 16px; height: 16px; border-radius: 4px; background: var(--gov-orange); color: #fff;
  font-size: 10px; font-weight: 800; display: grid; place-items: center; }
.pop-panel {
  display: none; position: absolute; top: 44px; left: 0; z-index: 200; width: 264px;
  max-height: 380px; overflow-y: auto; background: #fff; border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 20px 60px rgba(20,16,50,0.18); padding: 8px 0;
}
.pop-panel.open { display: block; }
.pop-group { font-size: 10.5px; font-weight: 800; letter-spacing: 0.7px; text-transform: uppercase;
  color: var(--text-tertiary); padding: 12px 16px 6px; }
.pop-row { display: flex; align-items: center; gap: 10px; padding: 8px 16px; font-size: 13px; cursor: pointer; }
.pop-row:hover { background: #FAF7F4; }
.pop-row input { accent-color: var(--gov-orange); width: 15px; height: 15px; margin: 0; }
.pop-row .count { margin-left: auto; font-size: 11px; color: var(--text-tertiary); font-family: var(--font-mono); }
.pop-foot { border-top: 1px solid var(--border); margin-top: 6px; padding: 8px 16px 4px; }

.fav-star { position: absolute; top: 8px; right: 8px; z-index: 2; width: 26px; height: 26px;
  border-radius: 50%; border: 0; background: rgba(0,0,0,0.32); color: #fff; cursor: pointer;
  font-size: 13px; line-height: 1; display: grid; place-items: center; }
.fav-star:hover { background: rgba(0,0,0,0.5); }
.fav-star.on { background: #fff; color: #E0A612; }

/* ===== Gamification drawer (partials.js) ===== */
.gm-backdrop { position: fixed; inset: 0; background: rgba(10,15,25,0.45); z-index: 400; opacity: 0; pointer-events: none; transition: opacity 0.18s; }
.gm-backdrop.open { opacity: 1; pointer-events: auto; }
.gm-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 440px; max-width: 94vw; background: #fff;
  z-index: 401; box-shadow: -18px 0 60px rgba(20,16,50,0.22); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.22s ease;
}
.gm-drawer.open { transform: translateX(0); }
.gm-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.gm-head h3 { font-family: var(--font-display); font-size: 17px; font-weight: 800; flex: 1; margin: 0; }
.gm-close { border: 0; background: none; font-size: 20px; color: var(--text-tertiary); cursor: pointer; line-height: 1; }
.gm-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 20px 4px; }
.gm-tile { border: 1px solid var(--border); border-radius: 12px; padding: 14px 8px; text-align: center; }
.gm-tile .glyph { display: grid; place-items: center; color: var(--gov-orange); }
.gm-tile .val { font-family: var(--font-display); font-size: 21px; font-weight: 800; margin-top: 6px; }
.gm-tile .lbl { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-tertiary); margin-top: 2px; }
.gm-tabs { display: flex; gap: 2px; padding: 0 20px; border-bottom: 1px solid var(--border); margin-top: 14px; }
.gm-tab { padding: 10px 12px; font-size: 13px; background: none; border: 0; border-bottom: 2px solid transparent;
  margin-bottom: -1px; color: var(--text-secondary); cursor: pointer; font-family: inherit; }
.gm-tab:hover { color: var(--text-primary); }
.gm-tab.active { color: var(--gov-orange); border-bottom-color: var(--gov-orange); font-weight: 700; }
.gm-body { flex: 1; overflow-y: auto; padding: 6px 20px 20px; }
.gm-foot { border-top: 1px solid var(--border); padding: 12px 20px; text-align: right; }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.lb-row:last-child { border-bottom: none; }
.lb-row.me { background: rgba(176,82,45,0.06); margin: 0 -20px; padding-left: 20px; padding-right: 20px; }
.lb-rank { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 800; color: var(--text-secondary); flex-shrink: 0; }
.lb-rank.gold   { background: #E0A612; color: #fff; }
.lb-rank.silver { background: #B9BEC7; color: #fff; }
.lb-rank.bronze { background: #C07A3E; color: #fff; }
.lb-pts { margin-left: auto; font-family: var(--font-mono); font-weight: 700; }
.lv-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.lv-row:last-child { border-bottom: none; }
.lv-row.now { font-weight: 700; color: var(--gov-orange); }
.lv-badge { width: 30px; height: 30px; border-radius: 8px; background: #F1F0EB; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 12px; flex-shrink: 0; }
.lv-row.now .lv-badge { background: var(--gov-orange); color: #fff; }
.lv-row.locked { opacity: 0.5; }

/* ===== User administration (user-admin.js — roster, role pills, matrix) ===== */
.filter-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.filter-tabs .tab { padding: 10px 14px; font-size: 13px; color: var(--text-secondary); cursor: pointer;
  border: none; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.filter-tabs .tab:hover { color: var(--text-primary); }
.filter-tabs .tab.active { color: var(--purple); border-bottom-color: var(--purple); font-weight: 600; }
.filter-tabs .tab .badge { background: var(--purple-light); color: var(--purple-dark); padding: 1px 7px;
  border-radius: 99px; font-size: 11px; margin-left: 4px; font-weight: 600; }

.role-pill { font-size: 10px; padding: 3px 8px; border-radius: 4px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.4px; display: inline-block; }
.r-director    { background: #0A0A0A; color: var(--gov-orange); }
.r-manager     { background: var(--purple-light); color: var(--purple-dark); }
.r-finance     { background: var(--teal-light); color: var(--teal); }
.r-auditor     { background: #FBF3D1; color: #7C6205; }
.r-facilitator { background: var(--amber-light); color: var(--amber); }
.r-attendee    { background: #F1F0EB; color: var(--text-secondary); }
.r-admin       { background: var(--red-light); color: var(--red); }

.mfa-badge { font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 700; }
.mfa-on  { background: var(--teal-light); color: var(--teal); }
.mfa-off { background: var(--red-light); color: var(--red); }
.last-login { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); }

.perm-table th, .perm-table td { padding: 8px 12px; text-align: center; font-size: 12px; }
.perm-table td:first-child, .perm-table th:first-child { text-align: left; }
.perm-yes     { color: var(--teal); font-weight: 700; }
.perm-no      { color: var(--text-tertiary); }
.perm-partial { color: var(--amber); font-weight: 700; }

.action-btn { padding: 5px 10px; border-radius: 6px; font-size: 11px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border); background: #fff; transition: all 0.12s; font-family: inherit; }
.action-btn:hover { border-color: var(--purple); color: var(--purple); }

.erp-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; }
.erp-card h3 { font-family: var(--font-display); font-size: 16px; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }
.card-link { font-size: 12px; color: var(--purple); font-weight: 600; cursor: pointer; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.stat-label { font-size: 11px; text-transform: uppercase; font-weight: 700; letter-spacing: 0.6px; color: var(--text-tertiary); margin-bottom: 6px; }
.stat-val { font-family: var(--font-display); font-size: 26px; font-weight: 800; color: var(--text-primary); }
.stat-trend { font-size: 12px; margin-top: 4px; }
.stat-trend.up { color: var(--teal); }
.stat-trend.down { color: var(--red); }
.stat-trend.flat { color: var(--text-tertiary); }

/* Generic data tables */
.dtable { width: 100%; border-collapse: collapse; }
.dtable th { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-tertiary); text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); background: #FAFAFE; }
.dtable td { padding: 12px 14px; font-size: 14px; color: var(--text-primary); border-bottom: 1px solid var(--border); vertical-align: middle; }
.dtable tr:last-child td { border-bottom: none; }
.dtable tr:hover td { background: #FAFAFE; }
.dtable .muted-cell { color: var(--text-secondary); font-size: 13px; }
.dtable .mono { font-family: var(--font-mono); font-size: 13px; }

/* Status pills */
.status-pill { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 99px; text-transform: uppercase; letter-spacing: 0.4px; display: inline-block; }
.status-confirmed, .status-good, .status-active, .status-completed-ok { background: var(--teal-light); color: var(--teal); }
.status-pending, .status-low, .status-warning { background: var(--amber-light); color: var(--amber); }
.status-fault, .status-overdue, .status-fail { background: var(--red-light); color: var(--red); }
.status-info, .status-scheduled { background: var(--blue-light); color: var(--blue); }
.status-completed { background: var(--teal-light); color: var(--teal); }
.status-draft { background: #ECEAF2; color: var(--text-secondary); }

/* Avatar circles */
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--purple); color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; }
.avatar.teal { background: var(--teal); }
.avatar.amber { background: var(--amber); }
.avatar.blue { background: var(--blue); }
.avatar.red { background: var(--red); }

/* Progress bar */
.bar-track { width: 100%; height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; }
.bar-track .bar-go { height: 100%; background: var(--teal); border-radius: 99px; transition: width 0.4s; }
.bar-track .bar-go.warn { background: var(--amber); }
.bar-track .bar-go.danger { background: var(--red); }

@media (max-width: 1000px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .erp-main { padding: 18px; }
  /* Sidebar stays as slide-in drawer on mobile — no inline wrap layout */
}

/* ===========================================================
   MODAL · used by all editable screens
   =========================================================== */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(13, 13, 26, 0.55);
  display: none; align-items: center; justify-content: center;
  z-index: 200; padding: 24px; backdrop-filter: blur(2px);
}
.modal-backdrop.open { display: flex; animation: fadeIn 0.15s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: slideUp 0.2s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal.wide { max-width: 720px; }
.modal-head {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-head h3 { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px; background: #FAFAFE;
  display: grid; place-items: center; font-size: 18px; color: var(--text-secondary);
  cursor: pointer; transition: background 0.15s;
}
.modal-close:hover { background: var(--purple-pale); color: var(--purple); }
.modal-body { padding: 24px; }
.modal-foot {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end; background: #FAFAFE; border-radius: 0 0 16px 16px;
}
.modal-foot .btn-delete { margin-right: auto; color: var(--red); background: transparent; border: 1px solid var(--red-light); }
.modal-foot .btn-delete:hover { background: var(--red-light); }

/* Form grids inside modals */
.form-grid { display: grid; gap: 14px; }
.form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.field-hint { font-size: 11px; color: var(--text-tertiary); }
.input, .select, textarea.input {
  background: #fff; border: 1px solid var(--border);
  border-radius: 9px; padding: 10px 13px; font-size: 14px; width: 100%;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, textarea.input:focus {
  outline: none; border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(20, 71, 125, 0.12);
}
textarea.input { min-height: 80px; resize: vertical; }

/* Chip multi-select */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0; }
.chip {
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 99px;
  font-size: 12px; cursor: pointer; background: #fff; user-select: none;
  transition: all 0.12s;
}
.chip:hover { border-color: var(--purple); color: var(--purple); }
.chip.on { background: var(--purple); color: #fff; border-color: var(--purple); }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--gov-navy); color: #fff; padding: 12px 20px; border-radius: 10px;
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg);
  opacity: 0; transition: all 0.25s; z-index: 300; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--red); }
.toast.success { background: var(--teal); }

@media (max-width: 640px) {
  .form-grid.cols-2, .form-grid.cols-3 { grid-template-columns: 1fr; }
}

/* ----- RESPONSIVE (public site) ----- */
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .topnav { padding: 12px 18px; gap: 12px; }
  .topnav-links { display: none; }
  .container { padding: 0 18px; }
  h1 { font-size: 32px; }
  h2 { font-size: 24px; }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ===========================================================
   PHONE PASS · everything ≤ 640px
   =========================================================== */
@media (max-width: 640px) {
  /* App shell */
  .erp-body .erp-main { padding: 60px 14px 40px; }
  .erp-sidebar { width: min(88vw, 300px); }
  .erp-head { align-items: flex-start; flex-direction: column; gap: 12px; }
  .erp-head h1 { font-size: 22px; }
  .erp-head .sub { font-size: 13px; }
  .head-actions { flex-wrap: wrap; gap: 6px; }
  .head-actions .btn { flex: 1 1 auto; min-width: 0; font-size: 12px; padding: 8px 10px; }

  /* Stat cards — one column so numbers stay readable */
  .stat-grid { grid-template-columns: 1fr; gap: 10px; }
  .stat-card { padding: 14px 16px; }
  .stat-val { font-size: 22px; }

  /* Cards + spacing */
  .erp-card { padding: 14px 14px; border-radius: 10px; }
  .erp-card h3 { font-size: 14px; }

  /* Tables — wrap in horizontal scroll container.
     Any <table class="dtable"> gets an implicit horizontal scroll on phones. */
  .dtable { min-width: 560px; font-size: 12.5px; }
  .dtable th, .dtable td { padding: 8px 10px; }
  .erp-card:has(> .dtable),
  .erp-card:has(> table.dtable) { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Modals — near full-screen on phone with sticky footer */
  .modal { max-width: 100% !important; width: 100% !important; margin: 0; border-radius: 12px 12px 0 0; max-height: 92vh; display: flex; flex-direction: column; }
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal-body { padding: 14px 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .modal-head { padding: 14px 16px; position: sticky; top: 0; background: #fff; z-index: 2; }
  .modal-foot { padding: 12px 14px; flex-wrap: wrap; gap: 6px; position: sticky; bottom: 0; background: #fff; z-index: 2; border-top: 1px solid var(--border); }
  .modal-foot .btn { flex: 1 1 auto; min-width: 0; }

  /* Any two-column form → one column */
  .form-grid, .form-grid.cols-2, .form-grid.cols-3 { grid-template-columns: 1fr; gap: 10px; }

  /* Filter bars, toolbars, tab rows — allow horizontal scroll instead of stacking chaos */
  .filter-tabs, .tab-bar, .sess-tabs, .cal-view-tabs, .status-filter, .filter-row {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .filter-tabs::-webkit-scrollbar,
  .tab-bar::-webkit-scrollbar,
  .sess-tabs::-webkit-scrollbar,
  .cal-view-tabs::-webkit-scrollbar,
  .status-filter::-webkit-scrollbar,
  .filter-row::-webkit-scrollbar { display: none; }

  /* Calendar month grid — smaller cells + smaller day label */
  .cal-cell { min-height: 68px !important; padding: 3px !important; font-size: 10px; }
  .day-num { min-width: 18px !important; height: 18px !important; line-height: 18px !important; font-size: 10px !important; }
  .cal-pill { font-size: 9px !important; padding: 1px 3px !important; }
  .cal-more { font-size: 9px !important; }
  .cal-dow div { padding: 6px 4px !important; font-size: 9px !important; }
  .cal-title { min-width: 0 !important; font-size: 14px !important; }
  .cal-toolbar { flex-wrap: wrap; gap: 8px !important; padding: 10px !important; }
  .cal-toolbar select { min-width: 0 !important; font-size: 12px !important; padding: 6px 8px !important; }

  /* Program cards + detail hero */
  .prog-grid { grid-template-columns: 1fr !important; gap: 12px !important; }
  .prog-title-row { flex-direction: column; align-items: flex-start !important; gap: 12px !important; }
  .prog-meta-strip { gap: 12px !important; }

  /* Notification bell + hamburger positioning */
  .hamburger-btn { top: 12px !important; left: 12px !important; }

  /* Landing page hero */
  .hero-wrap { padding: 56px 0 48px; }
  .hero-inner { padding: 0 20px; }
  .hero-eyebrow { font-size: 10px; margin-bottom: 20px; gap: 8px; }
  .hero-eyebrow::before { width: 18px; }
  .hero-wrap h1 { font-size: 34px !important; line-height: 1.05; }
  .hero-sub { font-size: 15px; }
  .hero-cta-row { flex-direction: column; align-items: stretch; }
  .btn-primary-hero, .btn-ghost-hero { justify-content: center; padding: 14px 18px; }
  .hero-quiet { flex-direction: column; gap: 10px; font-size: 12px; padding-top: 24px; }

  /* Landing page other sections */
  .strip-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 16px !important; text-align: left !important; }
  .cta-band { padding: 36px 20px !important; margin: 30px 12px !important; }
  .cta-band h2 { font-size: 22px !important; }

  /* Login card */
  .login-wrap { padding: 12px; }
  .login-card { padding: 22px 18px; }
  .role-grid { grid-template-columns: 1fr !important; }

  /* Settings / users perms matrix - already scrolls via overflow-x, just shrink text */
  .perm-table th, .perm-table td { padding: 6px 8px; font-size: 11px; }
}

/* Extra squeeze for tiny phones (≤ 380px) */
@media (max-width: 380px) {
  .erp-body .erp-main { padding: 56px 10px 30px; }
  .erp-head h1 { font-size: 20px; }
  .hero-wrap h1 { font-size: 28px !important; }
  .cal-cell { min-height: 56px !important; }
}

/* ===========================================================
   SSNIT AUSTERE PASS · square corners, flat surfaces, dense data
   Loaded last so it wins over earlier component styles.
   =========================================================== */

/* Squarer corners across every surface */
.erp-card, .card, .stat-card, .modal, .prog-card, .policy-card, .feat-card,
.cal-month, .cal-week, .cal-toolbar, .cal-legend, .sess-table, .sess-toolbar,
.issued-list, .cert-toolbar, .int-card, .price-card, .hall-card, .vendor-card,
.login-card, .erp-head, .filter-row, .program-select, .info-band {
  border-radius: 3px !important;
}
.btn, .input, .select, textarea.input, .action-btn, .icon-btn,
.cal-nav button, .cal-view-tabs button, .sess-tabs button, .status-filter button,
.role-chip, .btn-signin, .topnav-cta {
  border-radius: 2px !important;
}
.status-pill, .tag, .prog-tag, .cal-pill, .cert-status, .sess-status, .role-pill, .mfa-badge {
  border-radius: 2px !important;
}

/* Flat: no floating shadows, no hover lift */
.erp-card, .card, .stat-card, .prog-card, .policy-card, .feat-card, .int-card, .price-card, .hall-card {
  box-shadow: none !important;
}
.card-hover:hover, .prog-card:hover, .rep-card:hover, .int-card:hover, .price-card:hover, .pillar-card:hover {
  transform: none !important;
  box-shadow: none !important;
  border-color: var(--purple) !important;
}
.btn-primary:hover { transform: none !important; box-shadow: none !important; }

/* Dense data tables · SSNIT information density */
.dtable th { padding: 8px 12px; font-size: 10.5px; background: var(--purple-pale); color: var(--text-secondary); border-bottom: 2px solid var(--purple); }
.dtable td { padding: 9px 12px; font-size: 13px; }
.dtable tr:hover td { background: var(--purple-pale); }

/* Headings: institutional weight, tighter */
.erp-head h1 { font-weight: 700; letter-spacing: -0.01em; }
.erp-card h3 { font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); }

/* Stat cards: rule-under-number instead of decoration */
.stat-card { border-top: 3px solid var(--purple); }
.stat-val { font-weight: 700; }

/* Sidebar active states: solid orange bar, no rounded highlight */
.nav-item, .nav-group-head, .nav-sub { border-radius: 0 !important; }
.nav-sub.active { background: rgba(176,82,45,0.10); }

/* Modals sit square */
.modal-head, .modal-foot { border-radius: 0 !important; }
