/* ==========================================================================
   5-Axis Precision - platform design system
   One visual language across the public website and the portals:
   - Industrial graphite + gold identity on marketing surfaces
   - M-Pesa Business Hub style light, card-based productivity UI in portals
   ========================================================================== */

:root {
  --ink: #14181d;
  --ink-2: #3d454f;
  --muted: #64707d;
  --faint: #8b95a1;
  --line: #e4e8ec;
  --surface: #f5f7f8;
  --card: #ffffff;

  --graphite: #091128;
  --graphite-2: #0d1730;
  --graphite-3: #16234a;

  --gold: #d11f46;
  --gold-strong: #b81b3e;
  --gold-soft: #fdeef1;

  --green: #177245;
  --green-strong: #125c38;
  --green-soft: #e6f3ea;

  --amber-soft: #fdf3e0;
  --amber-text: #a01735;
  --red: #b3372c;
  --red-soft: #fbeae8;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 32, 0.05), 0 10px 28px rgba(16, 24, 32, 0.07);
  --shadow-soft: 0 1px 2px rgba(16, 24, 32, 0.05);

  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;

  --container: 1180px;
}

/* ----------------------------- reset ----------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
figure { margin: 0; }

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  line-height: 1.18;
  letter-spacing: -0.015em;
  font-weight: 700;
  color: var(--ink);
}

h1 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); }
h3 { font-size: 1.12rem; font-weight: 650; }

p { margin: 0 0 1em; }

a { color: var(--gold-strong); text-decoration: none; }
a:hover { color: var(--gold); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--graphite);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus { left: 0; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 780px; }

.icon { vertical-align: -0.22em; flex: none; }

/* --------------------------- typography -------------------------------- */

.kicker {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-strong);
  margin: 0 0 0.9em;
}

.lede { font-size: 1.14rem; color: var(--ink-2); max-width: 62ch; }

.fineprint { font-size: 0.86rem; color: var(--muted); }

.mono { font-family: var(--font-mono); font-size: 0.85rem; }

.section { padding: 72px 0; }
.section-alt { background: var(--surface); }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
}
.section-head h2 { margin-bottom: 0; }
.section-head .kicker { margin-bottom: 0.6em; }

/* ----------------------------- buttons --------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 22px;
  border-radius: 9px;
  border: 1.5px solid transparent;
  font: 600 0.95rem/1.2 var(--font);
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--graphite); color: #fff; }
.btn-primary:hover { background: var(--graphite-3); color: #fff; }

.btn-accent { background: var(--gold); color: #17130a; }
.btn-accent:hover { background: var(--gold-strong); color: #fff; }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--faint); color: var(--ink); }

.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.45); }
.btn-outline-light:hover { border-color: #fff; color: #fff; }

.btn-sm { padding: 8px 14px; font-size: 0.87rem; }
.btn-block { width: 100%; justify-content: center; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.93rem;
  color: var(--gold-strong);
}
.text-link:hover { color: var(--gold); }
.text-link.quiet { color: var(--muted); }

/* ------------------------------ topbar --------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 68px;
}

.brand { display: inline-flex; align-items: center; }

.brand-logo-img { height: 40px; width: auto; }

.brand-lockup { display: inline-flex; align-items: center; gap: 10px; }
.brand-word { font-size: 1.05rem; letter-spacing: -0.01em; line-height: 1.1; font-weight: 400; }
.brand-word strong { display: block; font-weight: 750; }

.mainnav { display: flex; align-items: center; gap: 26px; }
.mainnav > a {
  font: 600 0.93rem/1 var(--font);
  color: var(--ink-2);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.mainnav > a:hover { color: var(--ink); border-bottom-color: var(--gold); }

.mainnav-actions { display: none; }

.topbar-cta { display: flex; align-items: center; gap: 10px; }

.nav-toggle {
  display: none;
  background: none;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  color: var(--ink);
}

/* ------------------------------- hero ---------------------------------- */

.hero {
  background:
    linear-gradient(rgba(9, 17, 40, 0.93), rgba(9, 17, 40, 0.97)),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(255, 255, 255, 0.05) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(255, 255, 255, 0.05) 39px 40px),
    var(--graphite);
  color: #fff;
  padding: 88px 0;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.hero .kicker { color: var(--gold); }

.hero h1 { color: #fff; margin-bottom: 18px; }

.hero .lede { color: #c3cad3; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 30px;
  font-size: 0.9rem;
  color: #aab3bd;
}
.hero-meta .icon { color: var(--gold); }

.hero-media { position: relative; }
.hero-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.hero-media figcaption,
.gallery-item figcaption {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--faint);
}
.hero-media figcaption { color: #8b95a1; }

/* ----------------------------- page heads ------------------------------ */

.page-head {
  background: var(--graphite);
  color: #fff;
  padding: 64px 0;
}
.page-head.compact { padding: 52px 0; }
.page-head h1 { color: #fff; }
.page-head .lede { color: #c3cad3; }
.page-head .kicker { color: var(--gold); }

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #8b95a1;
  margin-bottom: 20px;
}
.breadcrumbs a { color: #c3cad3; }
.breadcrumbs a:hover { color: #fff; }

/* ------------------------------ stats ---------------------------------- */

.stats-band { background: var(--graphite-2); padding: 40px 0; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 750;
  color: var(--gold);
  letter-spacing: -0.02em;
}
.stat-label { display: block; font-size: 0.88rem; color: #aab3bd; margin-top: 4px; }

/* ------------------------------ cards ---------------------------------- */

.card-grid { display: grid; gap: 24px; }
.card-grid.two { grid-template-columns: repeat(2, 1fr); }
.card-grid.three { grid-template-columns: repeat(3, 1fr); }
.card-grid.four { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-soft);
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 11px;
  background: var(--gold-soft);
  color: var(--gold-strong);
  margin-bottom: 16px;
}

.card h3 { margin-bottom: 8px; }
.card p { color: var(--ink-2); font-size: 0.95rem; margin-bottom: 12px; }

.step-num {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold-strong);
  margin-bottom: 12px;
}

.aside-card { align-self: start; }

.banner-card {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 24px 0;
}
.banner-card .card-icon { margin-bottom: 0; flex: none; }
.banner-card strong { display: block; }
.banner-card span { color: var(--ink-2); font-size: 0.93rem; }
.banner-card .btn { margin-left: auto; }
.banner-card.notice { background: var(--gold-soft); border-color: #eadfc3; }
.banner-card.notice .card-icon { background: #fff; }

/* --------------------------- split layouts ----------------------------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

.split-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.split-copy h2 + p, .split-copy h2 { margin-top: 0; }
.split-copy p { color: var(--ink-2); }
.split-copy .fineprint { margin-top: 18px; }

.checklist { list-style: none; margin: 22px 0; padding: 0; }
.checklist li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 9px 0;
  color: var(--ink-2);
}
.checklist .icon { color: var(--green); margin-top: 3px; }
.checklist.compact li { padding: 5px 0; font-size: 0.94rem; }

.numbered { margin: 0; padding-left: 20px; color: var(--ink-2); }
.numbered li { padding: 5px 0; }

.contact-list { list-style: none; margin: 24px 0; padding: 0; }
.contact-list li { display: flex; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.contact-list .icon { color: var(--gold-strong); margin-top: 4px; }
.contact-list strong { display: block; font-size: 0.9rem; }
.contact-list span { color: var(--ink-2); font-size: 0.94rem; }

/* -------------------------- course cards ------------------------------- */

.course-grid, .card-grid .course-card { min-width: 0; }
.course-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.course-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.course-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.course-card-media { aspect-ratio: 16 / 8; overflow: hidden; background: var(--graphite-2); }
.course-card-media img { width: 100%; height: 100%; object-fit: cover; }

.course-card-body { padding: 22px 24px 24px; }
.course-card-body h3 { margin: 10px 0 8px; font-size: 1.18rem; }
.course-card-body h3 a { color: var(--ink); }
.course-card-body h3 a:hover { color: var(--gold-strong); }
.course-card-body > p { color: var(--ink-2); font-size: 0.94rem; }

.course-card-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.course-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--gold-soft);
  color: var(--amber-text);
}
.badge-quiet { background: var(--surface); color: var(--muted); border: 1px solid var(--line); }
.badge-green { background: var(--green-soft); color: var(--green-strong); }
.badge-amber { background: var(--amber-soft); color: var(--amber-text); }
.badge-red { background: var(--red-soft); color: var(--red); }

/* --------------------------- course detail ----------------------------- */

.course-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; }
.course-head h1 { margin: 14px 0 12px; }
.course-head-actions { display: flex; flex-direction: column; gap: 10px; flex: none; }

.module-block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-top: 18px;
}
.module-block h3 { margin-bottom: 4px; }
.module-summary { color: var(--muted); font-size: 0.92rem; margin-bottom: 14px; }

.lesson-list { list-style: none; margin: 0; padding: 0; }
.lesson-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 4px;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
}
.lesson-list .icon { color: var(--gold-strong); }
.lesson-duration { margin-left: auto; color: var(--faint); font-size: 0.83rem; }

/* ------------------------------ band ----------------------------------- */

.band {
  background: var(--graphite);
  color: #fff;
  padding: 56px 0;
}
.band h2 { color: #fff; }
.band p { color: #c3cad3; margin: 0; }
.band-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}
.band-actions { display: flex; gap: 14px; flex: none; }

/* --------------------------- verify strip ------------------------------ */

.verify-strip {
  display: flex;
  align-items: center;
  gap: 26px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 34px 38px;
}
.verify-strip h2 { margin-bottom: 6px; }
.verify-strip p { margin: 0; color: var(--ink-2); }
.verify-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  border-radius: 16px;
  background: var(--green-soft);
  color: var(--green);
  flex: none;
}
.verify-strip .btn { margin-left: auto; flex: none; }

/* ------------------------------ gallery -------------------------------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.gallery-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.gallery-item figcaption { font-size: 0.85rem; color: var(--muted); }

/* ------------------------------ filter row ----------------------------- */

.filter-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }

.chip {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--card);
  font: 600 0.88rem/1 var(--font);
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--faint); }
.chip.is-active { background: var(--green); border-color: var(--green); color: #fff; }

/* ------------------------------- forms --------------------------------- */

.stack { display: flex; flex-direction: column; gap: 16px; }
.stack label { display: flex; flex-direction: column; gap: 7px; font: 600 0.88rem/1.3 var(--font); color: var(--ink-2); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row.three { grid-template-columns: 1.2fr 1fr 0.8fr; }

input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
input[type="date"], input[type="time"], input[type="number"], select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font: 400 0.95rem/1.4 var(--font);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(185, 137, 47, 0.15);
}
input:disabled { background: var(--surface); color: var(--muted); }

textarea { resize: vertical; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364707d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 38px;
}

.form-card { padding: 30px; }
.form-card h3 { margin-bottom: 4px; }

.inline-form select { width: auto; padding: 7px 34px 7px 10px; font-size: 0.86rem; }
.filter-form { display: flex; gap: 10px; align-items: center; }
.filter-form select { width: auto; padding: 9px 34px 9px 12px; font-size: 0.9rem; }

/* ------------------------------ wizard --------------------------------- */

.wizard-progress { display: flex; align-items: center; gap: 8px; margin-bottom: 22px; }
.wizard-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  font: 700 0.9rem/1 var(--font);
  color: var(--faint);
  background: #fff;
}
.wizard-step.is-active { border-color: var(--gold); color: var(--gold-strong); background: var(--gold-soft); }
.wizard-line { flex: 1; height: 1.5px; background: var(--line); }

.wizard-panel { border: 0; padding: 0; margin: 0 0 16px; display: none; }
.wizard-panel.is-active { display: block; }
.wizard-panel legend { font: 700 1.05rem/1.2 var(--font); margin-bottom: 14px; padding: 0; }
.wizard-panel .stack { gap: 16px; }
.wizard-controls { display: flex; justify-content: space-between; margin-top: 8px; }

/* ------------------------------- alerts -------------------------------- */

.flash-stack { display: flex; flex-direction: column; gap: 10px; margin: 18px auto; max-width: var(--container); }
.portal .flash-stack { margin: 0 0 24px; }

.alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-radius: 10px;
  font-size: 0.94rem;
  font-weight: 500;
  border: 1px solid;
}
.alert-success { background: var(--green-soft); color: var(--green-strong); border-color: #cbe5d4; }
.alert-error { background: var(--red-soft); color: var(--red); border-color: #f0d2ce; }
.alert-info { background: var(--gold-soft); color: var(--amber-text); border-color: #eadfc3; }

/* -------------------------------- FAQ ---------------------------------- */

.faq-group { margin-bottom: 34px; }
.faq-group h2 { font-size: 1.25rem; margin-bottom: 12px; }

.faq-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 10px;
}
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  list-style: none;
  cursor: pointer;
  padding: 17px 20px;
  font-weight: 600;
  color: var(--ink);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .icon { color: var(--faint); transition: transform 0.18s ease; }
.faq-item[open] summary .icon { transform: rotate(180deg); }
.faq-item p { padding: 0 20px 18px; margin: 0; color: var(--ink-2); font-size: 0.95rem; }

/* --------------------------- verify result ----------------------------- */

.verify-form { margin-bottom: 10px; }
.verify-label { display: block; font: 600 0.88rem/1.3 var(--font); margin-bottom: 8px; color: var(--ink-2); }
.verify-row { display: flex; gap: 12px; }
.verify-row input { flex: 1; font-family: var(--font-mono); letter-spacing: 0.04em; }

.verify-result { margin-top: 26px; }

.verify-card {
  border-radius: var(--radius);
  border: 1.5px solid var(--line);
  background: var(--card);
  padding: 30px;
  box-shadow: var(--shadow-soft);
}
.verify-card.is-valid { border-color: var(--green); }
.verify-card.is-revoked { border-color: var(--red); }
.verify-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  margin-bottom: 18px;
}
.is-valid .verify-status { color: var(--green); }
.is-revoked .verify-status { color: var(--red); }
.is-missing .verify-status { color: var(--amber-text); }

.verify-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px 28px;
  margin: 0 0 18px;
}
.verify-details dt { font: 700 0.78rem/1.3 var(--font); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.verify-details dd { margin: 4px 0 0; font-size: 1.02rem; font-weight: 600; }

/* ------------------------------- footer -------------------------------- */

.footer { background: var(--graphite); color: #aab3bd; padding: 60px 0 0; margin-top: 0; }

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1.1fr;
  gap: 44px;
  padding-bottom: 44px;
}
.footer h4 { color: #fff; font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 18px; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer ul li { margin-bottom: 10px; }
.footer a { color: #aab3bd; font-size: 0.93rem; }
.footer a:hover { color: #fff; }
.footer-brand p { font-size: 0.93rem; margin-top: 16px; max-width: 34ch; }

.footer-contact li { display: flex; gap: 10px; font-size: 0.9rem; }
.footer-contact .icon { color: var(--gold); margin-top: 3px; }

.footer-legal {
  border-top: 1px solid var(--graphite-3);
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  gap: 28px;
  font-size: 0.8rem;
  color: #77828e;
}
.footer-legal p { margin: 0; max-width: 72ch; }

/* =============================== PORTAL ================================ */

body.portal { background: var(--surface); }

.portal-shell { display: flex; min-height: 100vh; }

.sidenav {
  width: 248px;
  flex: none;
  background: var(--card);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidenav-brand {
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
}
.sidenav-brand .brand-logo-img { height: 34px; }

.sidenav nav { flex: 1; padding: 14px 12px; display: flex; flex-direction: column; gap: 3px; }

.sidenav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 9px;
  font: 600 0.92rem/1.2 var(--font);
  color: var(--ink-2);
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.sidenav-link:hover { background: var(--surface); color: var(--ink); }
.sidenav-link.is-active { background: var(--green); color: #fff; }
.sidenav-link .icon { flex: none; }

.sidenav-footer { padding: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
.sidenav-footer form { margin: 0; }

.portal-main { flex: 1; min-width: 0; padding: 0 32px 48px; }

.portal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}
.portal-title { font-size: 1.35rem; margin: 0; }
.portal-user { display: flex; flex-direction: column; align-items: flex-end; }
.portal-user-name { font-weight: 700; font-size: 0.92rem; }
.portal-user-role { font-size: 0.78rem; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }

.portal-content { max-width: 1060px; }

/* tiles */

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-soft);
}
.tile.is-attention { border-color: var(--gold); background: var(--gold-soft); }
.tile-value { display: block; font-size: 1.7rem; font-weight: 750; letter-spacing: -0.02em; }
.tile-label { display: block; font-size: 0.82rem; color: var(--muted); margin-top: 2px; }

/* panels */

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 28px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 22px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.panel-head h2 { font-size: 1.15rem; margin: 0; }
.panel-head .fineprint { max-width: 46ch; text-align: right; }

/* progress */

.course-progress-list { display: flex; flex-direction: column; gap: 14px; }

.progress-row {
  display: block;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.progress-row:hover { border-color: var(--faint); box-shadow: var(--shadow-soft); color: var(--ink); }
.progress-row-head { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.progress-row-foot { display: flex; justify-content: space-between; font-size: 0.83rem; color: var(--muted); margin-top: 8px; }

.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}
.progress-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--green), #1f9a63); border-radius: 999px; }

/* course hero */

.course-hero {
  display: flex;
  justify-content: space-between;
  gap: 34px;
  align-items: center;
  margin-bottom: 22px;
}
.course-hero h2 { margin: 10px 0 8px; }
.course-hero p { color: var(--ink-2); margin: 0; }
.course-hero-progress { flex: none; width: 250px; text-align: right; }
.course-hero-progress .tile-value { font-size: 1.9rem; }
.course-hero-progress .progress-bar { margin-top: 10px; }

/* lessons */

.lesson-accordion { display: flex; flex-direction: column; gap: 10px; }

.lesson-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.lesson-item.is-done { background: #fbfdfb; }

.lesson-item summary {
  display: flex;
  align-items: center;
  gap: 13px;
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
}
.lesson-item summary::-webkit-details-marker { display: none; }
.lesson-item summary > .icon:last-child { margin-left: auto; color: var(--faint); }

.lesson-check { color: var(--gold-strong); display: inline-flex; }
.is-done .lesson-check { color: var(--green); }
.lesson-title { font-weight: 600; font-size: 0.96rem; }
.lesson-duration { color: var(--faint); font-size: 0.82rem; flex: none; }

.lesson-body { padding: 4px 18px 18px 49px; border-top: 1px solid var(--line); }
.lesson-body p { color: var(--ink-2); font-size: 0.94rem; margin: 14px 0; }

/* tables */

.catalog-table { overflow-x: auto; }

.catalog-table table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.catalog-table th {
  text-align: left;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}
.catalog-table td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.catalog-table tr:last-child td { border-bottom: 0; }
.catalog-table strong { display: block; }

.table-sub { display: block; color: var(--muted); font-size: 0.83rem; font-weight: 400; max-width: 42ch; }
.table-wide { max-width: 320px; color: var(--ink-2); }
.table-actions { white-space: nowrap; }
.table-actions form { display: inline-block; margin-left: 8px; }
.table-actions .btn + form { margin-left: 8px; }
.table-actions form:first-child { margin-left: 0; }

/* bookings */

.booking-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }

.booking-list { display: flex; flex-direction: column; gap: 12px; }

.booking-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 15px 18px;
}
.booking-row.is-cancelled { opacity: 0.55; }
.booking-row strong { display: block; font-size: 0.95rem; }
.booking-row span { display: block; color: var(--muted); font-size: 0.85rem; }
.booking-row-actions { display: flex; align-items: center; gap: 10px; flex: none; }

/* certificates */

.certificate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }

.certificate-card {
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  background:
    linear-gradient(135deg, transparent 0 82%, var(--gold-soft) 82%),
    var(--card);
}
.certificate-card.is-revoked { opacity: 0.6; }
.certificate-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: var(--graphite);
  color: var(--gold);
  margin-bottom: 14px;
}
.certificate-card h3 { font-size: 1.05rem; }
.certificate-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.certificate-code span { font-family: var(--font-mono); font-weight: 700; font-size: 0.9rem; color: var(--ink); }

/* empty states */

.empty-state { text-align: center; padding: 44px 24px; }
.empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--faint);
  margin-bottom: 14px;
}
.empty-state h3 { margin-bottom: 6px; }
.empty-state p { color: var(--muted); max-width: 44ch; margin: 0 auto 18px; font-size: 0.94rem; }

/* activity */

.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: baseline;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
}
.activity-list li:last-child { border-bottom: 0; }
.activity-action { font-family: var(--font-mono); font-size: 0.8rem; color: var(--gold-strong); white-space: nowrap; }
.activity-detail { color: var(--ink-2); }
.activity-time { color: var(--faint); font-size: 0.8rem; white-space: nowrap; }

/* team */

.team-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.team-photo img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.team-card figcaption strong { display: block; margin-top: 12px; font-size: 0.95rem; }
.team-card figcaption span { color: var(--muted); font-size: 0.85rem; }

/* auth */

.auth-section { display: flex; justify-content: center; padding: 64px 24px; background: var(--surface); min-height: 72vh; }
.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 38px;
}
.auth-brand { margin-bottom: 20px; }
.auth-card h1 { font-size: 1.45rem; }
.auth-card .fineprint { margin-bottom: 20px; }
.auth-alt { margin: 16px 0 0; font-size: 0.92rem; }
.auth-alt.quiet { color: var(--muted); }

/* responsive */

@media (max-width: 1020px) {
  .hero-inner, .split { grid-template-columns: 1fr; gap: 36px; }
  .card-grid.four { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .booking-layout { grid-template-columns: 1fr; }
  .course-head { flex-direction: column; align-items: flex-start; }
  .course-head-actions { flex-direction: row; }
  .sidenav { width: 210px; }
}

@media (max-width: 760px) {
  .section { padding: 52px 0; }
  .hero { padding: 60px 0; }

  .mainnav {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 24px 20px;
    box-shadow: var(--shadow);
  }
  .mainnav.is-open { display: flex; }
  .mainnav > a { padding: 13px 4px; border-bottom: 1px solid var(--line); }
  .mainnav-actions { display: flex; gap: 10px; padding-top: 16px; }
  .nav-toggle { display: inline-flex; }
  .topbar-cta .btn { display: none; }
  .topbar-cta .btn-accent { display: inline-flex; }

  .card-grid.two, .card-grid.three, .card-grid.four, .course-grid { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .band-inner { flex-direction: column; align-items: flex-start; }
  .verify-strip { flex-direction: column; align-items: flex-start; padding: 26px; }
  .verify-strip .btn { margin-left: 0; }
  .verify-details { grid-template-columns: 1fr; }
  .verify-row { flex-direction: column; }
  .form-row, .form-row.three { grid-template-columns: 1fr; }

  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .footer-legal { flex-direction: column; gap: 8px; }

  .portal-shell { display: block; }
  .sidenav {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    z-index: 40;
    padding: 0 8px;
  }
  .sidenav-brand { border-bottom: 0; padding: 14px 10px; }
  .sidenav-brand .brand-word { display: none; }
  .sidenav nav { flex-direction: row; padding: 8px 4px; }
  .sidenav-link span { white-space: nowrap; }
  .sidenav-footer { border-top: 0; flex-direction: row; padding: 8px 4px; }
  .portal-main { padding: 0 16px 40px; }
  .panel { padding: 20px 18px; }
  .panel-head { flex-direction: column; }
  .panel-head .fineprint { text-align: left; }
  .course-hero { flex-direction: column; align-items: flex-start; }
  .course-hero-progress { width: 100%; text-align: left; }
  .lesson-body { padding-left: 18px; }
  .catalog-table th, .catalog-table td { padding: 10px 8px; }
}

/* =================== Phase 3-4 additions: assessment, ===================
   competency, finance, trainer and reporting components ================= */

/* assessment requirement items */
.req-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.req-item {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  background: #fff;
}
.req-item.is-met { border-color: #bfe0cc; background: #fbfefc; }
.req-item.is-failed { border-color: #f0d2ce; background: #fffbfa; }
.req-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  flex: none;
}
.is-met .req-icon { background: var(--green-soft); color: var(--green); }
.is-failed .req-icon { background: var(--red-soft); color: var(--red); }
.req-item > div { flex: 1; min-width: 0; }
.req-item strong { display: block; font-size: 0.92rem; }
.req-item span { display: block; color: var(--muted); font-size: 0.83rem; }

.req-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 13px 16px;
  border-radius: 10px;
  background: var(--gold-soft);
  color: var(--amber-text);
  font-size: 0.9rem;
  font-weight: 600;
}
.req-note .icon { flex: none; }

.assessment-block { border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; margin-bottom: 16px; }
.assessment-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.assessment-head h3 { margin: 0; font-size: 1.05rem; }

/* quiz */
.quiz-question { border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin: 0; }
.quiz-question legend { font: 700 0.8rem/1 var(--font); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); padding: 0 6px; }
.quiz-text { font-weight: 600; margin-bottom: 12px; }
.quiz-options { display: grid; gap: 8px; }
.quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  padding: 11px 14px;
  cursor: pointer;
  font-size: 0.94rem;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.quiz-option:hover { border-color: var(--faint); }
.quiz-option:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); }
.quiz-option input { width: auto; accent-color: var(--gold-strong); }
.quiz-actions { display: flex; align-items: center; gap: 16px; }

.result-banner {
  display: flex;
  align-items: center;
  gap: 18px;
  border-radius: 12px;
  border: 1.5px solid;
  padding: 22px 24px;
  margin-bottom: 20px;
}
.result-banner strong { display: block; font-size: 1.15rem; }
.result-banner span { color: var(--ink-2); }
.result-banner.is-pass { border-color: var(--green); background: var(--green-soft); }
.result-banner.is-pass .result-icon { color: var(--green); }
.result-banner.is-fail { border-color: var(--red); background: var(--red-soft); }
.result-banner.is-fail .result-icon { color: var(--red); }

/* assignment */
.assignment-brief, .assignment-submission { border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 18px; }
.assignment-brief h3, .assignment-submission h3 { font-size: 0.95rem; }
.submission-text {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  font-size: 0.93rem;
  color: var(--ink-2);
}
.submission-text p { margin: 0 0 8px; }
.submission-text p:last-child { margin-bottom: 0; }
.feedback-box { border-left: 3px solid var(--gold); background: var(--gold-soft); border-radius: 0 10px 10px 0; padding: 14px 18px; margin-top: 14px; }
.feedback-box strong { display: block; font-size: 0.85rem; margin-bottom: 4px; }
.feedback-box p { margin: 0; font-size: 0.92rem; color: var(--ink-2); }
.feedback-box.is-pass { border-left-color: var(--green); background: var(--green-soft); }

/* marking and competency verification (trainer) */
.marking-block { border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; margin-bottom: 16px; }
.marking-block.is-pending { border-color: #eadfc3; background: #fffdf7; }
.marking-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 12px; }
.marking-brief { margin-bottom: 12px; }
.review-form { border-top: 1px dashed var(--line); padding-top: 16px; margin-top: 14px; }
.review-form .span-2 { grid-column: span 2; }
.decision-row { display: flex; gap: 12px; }

.competency-course { font-size: 1rem; margin: 22px 0 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.competency-row {
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 16px;
  margin-bottom: 8px;
}
.competency-code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold-strong);
  background: var(--gold-soft);
  border-radius: 6px;
  padding: 4px 8px;
  flex: none;
}
.competency-main { flex: 1; min-width: 0; }
.competency-main strong { font-size: 0.94rem; }
.competency-title-chip { display: flex; align-items: center; gap: 12px; }
.competency-action { display: flex; align-items: center; gap: 10px; flex: none; }
.competency-action form { margin: 0; }

/* invoices and receipts */
.course-fee { margin-top: 12px; display: flex; align-items: center; gap: 12px; }

.invoice-list, .receipt-list { display: flex; flex-direction: column; gap: 12px; }
.invoice-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
}
.invoice-row.is-paid { opacity: 0.75; background: #fbfefc; }
.invoice-side { display: flex; align-items: center; gap: 16px; flex: none; }
.invoice-amount { font-weight: 750; white-space: nowrap; }
.pay-form { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.pay-phone input { width: 210px; padding: 8px 12px; font-size: 0.88rem; }

.receipt-row {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}
.receipt-row strong { display: block; font-size: 0.94rem; }
.receipt-icon { color: var(--green); flex: none; }

/* reports */
.report-rows { display: flex; flex-direction: column; gap: 16px; }
.report-row-head { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 7px; font-size: 0.9rem; }
.report-row-head span { color: var(--muted); font-size: 0.82rem; }
.progress-bar.gold span { background: linear-gradient(90deg, var(--gold), #d4a94a); }

.status-rows { display: flex; flex-direction: column; }
.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 0.93rem;
}
.status-row:last-child { border-bottom: 0; }

/* skills passport */
.passport-card {
  background: #fff;
  border: 1.5px solid var(--graphite);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.passport-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 22px 30px;
  background: var(--graphite);
}
.passport-code { display: flex; align-items: center; gap: 14px; }
.passport-code .mono { color: #e8ebef; font-weight: 700; letter-spacing: 0.06em; }
.passport-holder { padding: 30px 34px 8px; text-align: center; }
.passport-label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 6px;
}
.passport-holder h2 { font-size: 2rem; margin-bottom: 14px; }
.passport-holder h3 { font-size: 1.2rem; color: var(--gold-strong); margin-bottom: 10px; }
.passport-competencies { padding: 18px 34px 26px; }
.passport-competencies h4 {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  text-align: center;
}
.passport-competencies ul { list-style: none; margin: 0; padding: 0; max-width: 560px; margin: 0 auto; }
.passport-competencies li {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.95rem;
}
.passport-competencies .icon { color: var(--green); transform: translateY(2px); }
.passport-foot {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 16px 34px;
}
.passport-foot p { margin: 0; font-size: 0.8rem; color: var(--muted); text-align: center; }

@media (max-width: 900px) {
  .req-grid { grid-template-columns: 1fr; }
  .review-form .span-2 { grid-column: auto; }
  .invoice-row { flex-direction: column; align-items: flex-start; }
  .pay-form { align-items: stretch; }
  .pay-phone input { width: 100%; }
  .competency-row { flex-wrap: wrap; }
  .marking-head { flex-direction: column; }
}

/* ================== official brand integration =================== */

.brand-logo-img { height: 44px; width: auto; }
.sidenav-brand .brand-logo-img { height: 36px; }
.footer-logo-img { height: 88px; width: auto; margin-bottom: 14px; }
.passport-logo-img { height: 64px; width: auto; }

/* partners band */
.partners-band { padding-top: 56px; padding-bottom: 20px; }

.partners-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

.partner-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  min-height: 150px;
}
.partner-logo { max-height: 56px; max-width: 220px; width: auto; object-fit: contain; }
.partner-note { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.partner-text strong { display: block; font-size: 1.02rem; color: var(--ink); }
.partner-text span { color: var(--muted); font-size: 0.88rem; letter-spacing: 0.04em; }

/* facility mosaic (about) */
.facility-mosaic {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.facility-tile { position: relative; border-radius: var(--radius); overflow: hidden; }
.facility-tile.is-wide { grid-column: span 2; aspect-ratio: 21 / 8; }
.facility-tile:not(.is-wide) { aspect-ratio: 4 / 3; }
.facility-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.facility-tile:hover img { transform: scale(1.03); }
.facility-tile figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 34px 18px 14px;
  background: linear-gradient(transparent, rgba(16, 20, 26, 0.85));
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
}

/* ================= masonry gallery with lightbox ================= */

.masonry { columns: 3; column-gap: 20px; }

.masonry-item {
  break-inside: avoid;
  margin: 0 0 20px;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--line);
  background: var(--graphite-2);
}
.masonry-link { display: block; cursor: zoom-in; }
.masonry-item img { width: 100%; display: block; }

.masonry-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(transparent 45%, rgba(14, 17, 22, 0.88));
  opacity: 0;
  transition: opacity 0.22s ease;
}
.masonry-link:hover .masonry-overlay,
.masonry-link:focus-visible .masonry-overlay { opacity: 1; }

.masonry-zoom {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  backdrop-filter: blur(4px);
}
.masonry-caption { padding: 16px 18px; color: #fff; }
.masonry-caption strong { display: block; font-size: 0.95rem; }
.masonry-caption em { font-style: normal; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); }

/* lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 12, 16, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 40px;
}
.lightbox[hidden] { display: none; }

.lightbox-stage {
  max-width: min(1100px, 82vw);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lightbox-stage img {
  max-width: 100%;
  max-height: 74vh;
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.lightbox-stage figcaption {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-top: 16px;
  color: #c3cad3;
}
.lightbox-stage strong { color: #fff; font-size: 1rem; }
.lightbox-stage span { color: var(--faint); font-size: 0.85rem; }

.lightbox-close {
  position: absolute;
  top: 22px;
  right: 26px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.18); }

.lightbox-nav {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
}
.lightbox-nav:hover { background: rgba(255, 255, 255, 0.18); }
.lightbox-prev svg { transform: scaleX(-1); }

@media (max-width: 1020px) {
  .masonry { columns: 2; }
  .partners-row { grid-template-columns: 1fr; }
  .facility-tile.is-wide { grid-column: span 2; }
}
@media (max-width: 640px) {
  .masonry { columns: 1; }
  .facility-mosaic { grid-template-columns: 1fr; }
  .facility-tile.is-wide { grid-column: span 1; }
  .lightbox { flex-direction: column; padding: 20px; }
  .lightbox-nav { position: absolute; bottom: 26px; }
  .lightbox-prev { left: 26px; }
  .lightbox-next { right: 26px; }
}


/* ==== Refinement pass 2 (29 Sep 2026): live-site alignment, owner console, documents ==== */

/* Header brand scale - matches 5axisprecision.com header (max-height 65px) */
.brand-logo-img { height: 62px; width: auto; }
.sidenav-brand .brand-logo-img { height: 36px; }
.footer-logo-img { height: 58px; }

/* Footer partner block - exact placement as 5axisprecision.com footer */
.footer-partners {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 34px;
  padding-top: 25px;
  text-align: center;
}
.footer-partners .partners-line {
  color: #a0aabf;
  display: inline-block;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.footer-partners .partners-line strong { color: #fff; font-weight: 700; }
.partners-logos {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: center;
  margin-top: 20px;
}
.partners-logos img { height: 55px; width: auto; object-fit: contain; }

/* Owner console */
.portal-head {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 22px;
}
.portal-head h1 { margin: 0; }
.month-picker { align-items: center; display: flex; gap: 8px; }
.month-picker input[type="month"] {
  background: #fff;
  border: 1px solid #e4e8ec;
  border-radius: 8px;
  padding: 8px 10px;
}
.panel-subhead { font-size: 0.95rem; margin: 18px 0 10px; }
.invoice-summary { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); }
.invoice-figure { display: block; font-size: 1.25rem; font-weight: 800; }
.invoice-figure.is-good { color: #177245; }
.invoice-figure.is-due { color: #d11f46; }
.aging-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; }
.util-hero { align-items: baseline; display: flex; gap: 14px; margin: 8px 0 14px; }
.util-pct { color: #d11f46; font-size: 2.2rem; font-weight: 800; }

/* Printable documents: invoices and the monthly audit */
.report-doc {
  background: #fff;
  border: 1px solid #e4e8ec;
  border-radius: 12px;
  margin: 0 auto;
  max-width: 960px;
  padding: 34px 38px;
}
.report-head {
  align-items: flex-start;
  border-bottom: 2px solid #091128;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: space-between;
  padding-bottom: 18px;
}
.report-brand { display: flex; flex-direction: column; gap: 8px; }
.report-brand .brand-logo-img { height: 54px; width: auto; }
.report-classification {
  color: #d11f46;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.report-meta h1 { font-size: 1.5rem; margin: 0 0 4px; }
.report-meta p { color: #64707d; font-size: 0.92rem; margin: 0 0 2px; }
.report-controls { align-items: center; display: flex; gap: 8px; }
.report-controls input[type="month"] {
  border: 1px solid #e4e8ec;
  border-radius: 8px;
  padding: 8px 10px;
}
.report-section { margin-top: 26px; }
.report-section h2 { font-size: 1.05rem; margin: 0 0 12px; }
.report-section p { color: #3d454f; }
.report-section table { border-collapse: collapse; font-size: 0.92rem; width: 100%; }
.report-section th { background: #f5f7fa; border: 1px solid #e4e8ec; padding: 8px 10px; text-align: left; }
.report-section td { border: 1px solid #e4e8ec; padding: 8px 10px; }
.report-section .r { text-align: right; }
.report-kpis { display: grid; gap: 12px; grid-template-columns: repeat(5, 1fr); }
.report-kpis > div { border: 1px solid #e4e8ec; border-radius: 10px; padding: 12px; text-align: center; }
.report-kpis span:first-child { display: block; font-size: 1.05rem; font-weight: 800; }
.report-kpis span:last-child { color: #64707d; font-size: 0.78rem; }
.invoice-parties { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
.invoice-parties p { line-height: 1.55; margin: 0; }
.invoice-totals { display: grid; gap: 8px; margin-left: auto; margin-top: 14px; max-width: 320px; }
.invoice-totals div { display: flex; justify-content: space-between; }
.invoice-totals .is-good { color: #177245; }
.invoice-totals .is-due { color: #d11f46; }
.report-sign {
  border-top: 1px solid #e4e8ec;
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: space-between;
  margin-top: 30px;
  padding-top: 14px;
}
.report-sign span {
  color: #64707d;
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sign-line { border-bottom: 1px solid #14181d; display: inline-block; min-width: 160px; }

@media print {
  .topbar, .footer, .sidenav, .flash-stack, .nav-toggle,
  .report-controls, .month-picker, .portal-topbar { display: none !important; }
  .portal-shell { display: block; }
  .portal-main { padding: 0 !important; }
  .portal-content { max-width: none; }
  .report-doc { border: 0; border-radius: 0; max-width: none; padding: 0; }
}

.sr-only {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}
