:root {
  --navy: #11254C;
  --navy-deep: #0B1A38;
  --navy-tint: #EEF1F6;
  --navy-tint-2: #DDE3ED;
  --amber: #DFA130;
  --amber-tint: #FBF0DA;
  --amber-deep: #8F6716;
  --grey: #A9AEB8;
  --grey-line: #D9DDE3;
  --white: #FFFFFF;
  --ink: #1A2436;
  --red: #9C2B1F;
  --red-tint: #F9E8E6;
  --radius-card: 6px;
  --radius-btn: 5px;
  --radius-chip: 3px;
  --maxw: 1240px;
  --measure: 68ch;
}

@media (min-width: 768px) {
  :root {
    --radius-card: 8px;
    --radius-btn: 6px;
    --radius-chip: 3px;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  color: var(--navy);
  line-height: 1.2;
  margin: 0 0 0.5rem;
  font-weight: 800;
}
h1 { font-size: 1.9rem; }
h2 { font-size: 1.45rem; }
h3, .h3 { font-size: 1.1rem; font-weight: 700; }
h4, .h4 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 1rem; }

a { color: var(--navy); text-underline-offset: 2px; }
a:hover { color: var(--amber-deep); }

code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.9em;
  background: var(--navy-tint);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-chip);
}
code.hash { font-size: 0.75rem; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.wrap.narrow { max-width: 780px; }
.muted { color: #4A5468; }
.prose > * { max-width: var(--measure); }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--amber); color: var(--navy);
  padding: 10px 16px; font-weight: 700; z-index: 100;
  border-radius: var(--radius-btn);
}
.skip-link:focus { left: 8px; top: 8px; }

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 10px 22px;
  font-weight: 700; font-size: 1rem;
  text-decoration: none; cursor: pointer;
  border: 2px solid transparent;
  font-family: inherit;
  border-radius: var(--radius-btn);
}
.btn-primary { background: var(--amber); color: var(--navy); border-color: var(--amber); }
.btn-primary:hover { background: #C98F22; border-color: #C98F22; color: var(--navy); }
.btn-secondary { background: var(--white); color: var(--navy); border-color: var(--navy); }
.btn-secondary:hover { background: var(--navy-tint); color: var(--navy); }
.btn-ghost-light { background: transparent; color: var(--white); border-color: var(--white); }
.btn-ghost-light:hover { background: rgba(255,255,255,0.12); color: var(--white); }
.btn-small { min-height: 40px; padding: 6px 14px; font-size: 0.9rem; }
.btn-danger { background: var(--white); color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red-tint); color: var(--red); }

/* ---------- Header ---------- */
.site-header { background: var(--navy); color: var(--white); position: sticky; top: 0; z-index: 40; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--white); }
.brand:hover { color: var(--white); }
.brand-logo {
  display: block; height: 46px; width: auto;
  background: var(--white); padding: 6px 10px;
  border-radius: var(--radius-card);
}
.brand-logo-footer { height: 60px; margin-bottom: 14px; }

.nav-toggle {
  display: inline-block; background: transparent; color: var(--white);
  border: 2px solid var(--white); border-radius: var(--radius-btn);
  min-height: 44px; padding: 8px 16px; font-weight: 700; font-family: inherit; font-size: 0.95rem;
  cursor: pointer;
}
.site-nav { display: none; width: 100%; flex-direction: column; gap: 4px; padding: 8px 0; }
.site-nav.open { display: flex; }
.site-nav a {
  color: var(--white); text-decoration: none; font-weight: 600;
  padding: 12px 14px; border-radius: var(--radius-btn); min-height: 44px;
  display: flex; align-items: center;
}
.site-nav a:hover { background: var(--navy-deep); color: var(--white); }
.site-nav a[aria-current="page"] { background: var(--navy-deep); color: var(--amber); }
.nav-cta { background: var(--amber); color: var(--navy) !important; justify-content: center; }
.nav-cta:hover { background: #C98F22 !important; color: var(--navy) !important; }
.nav-portal { border: 2px solid var(--amber) !important; }

/* ---------- Hero ---------- */
.hero { background: var(--navy); color: var(--white); padding: 40px 0 48px; }
.hero-grid { display: grid; gap: 28px; }
.kicker { color: var(--amber); font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; }
.hero h1 { color: var(--white); font-size: 2rem; }
.lede { font-size: 1.08rem; }
.hero .lede { color: var(--navy-tint-2); max-width: var(--measure); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.hero-media { border: 1px solid var(--navy-deep); }

.media-frame {
  aspect-ratio: var(--media-ratio, 16/9);
  background: var(--navy-tint);
  overflow: hidden;
  border-radius: var(--radius-card);
}
.media-frame img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Stats ---------- */
.stat-strip { background: var(--navy-deep); color: var(--white); }
.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--navy); padding: 0; }
.stat { background: var(--navy-deep); padding: 18px 20px; display: flex; flex-direction: column; }
.stat-num { font-size: 1.6rem; font-weight: 800; color: var(--amber); }
.stat-label { font-size: 0.85rem; color: var(--navy-tint-2); }

/* ---------- Sections ---------- */
.section { padding: 44px 0; }
.section-tint { background: var(--navy-tint); }
.section-lede { max-width: var(--measure); }
.split-grid { display: grid; gap: 28px; }

/* ---------- Level ladder (home) ---------- */
.level-ladder { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 0; }
.level-step { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--grey-line); }
.level-step:last-child { border-bottom: 0; }
.level-dot {
  width: 16px; height: 16px; margin-top: 4px;
  border: 3px solid var(--amber); border-radius: 50%;
  background: var(--navy);
  justify-self: center;
}
.level-name { font-weight: 800; color: var(--navy); display: block; }
.level-desc { color: #4A5468; font-size: 0.95rem; }

/* ---------- Badge legend & statuses ---------- */
.badge-legend { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 12px; }
.badge-legend li { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; }

.badge {
  display: inline-block; padding: 3px 10px;
  border-radius: var(--radius-chip); border: 1.5px solid;
  font-size: 0.8rem; font-weight: 700; white-space: nowrap;
  background: var(--white); color: var(--ink); border-color: var(--grey);
}
.badge-draft { color: #4A5468; border-color: var(--grey); background: #F4F5F7; }
.badge-submitted { color: var(--navy); border-color: var(--navy); background: var(--navy-tint); }
.badge-verified { color: var(--white); border-color: var(--navy); background: var(--navy); }
.badge-approved { color: var(--navy); border-color: var(--amber-deep); background: var(--amber); }
.badge-returned-for-correction { color: var(--amber-deep); border-color: var(--amber-deep); background: var(--amber-tint); white-space: normal; }
.badge-cancelled { color: var(--white); border-color: var(--red); background: var(--red); }
.badge-issued { color: var(--navy); border-color: var(--amber-deep); background: var(--amber); }
.badge-reprinted { color: var(--navy); border-color: var(--navy); background: var(--navy-tint); }
.badge-active { color: var(--white); border-color: var(--navy); background: var(--navy); }
.badge-disabled { color: var(--white); border-color: var(--red); background: var(--red); }
.badge-open { color: var(--navy); border-color: var(--navy); background: var(--navy-tint); }

/* ---------- Panels, lists, notices ---------- */
.panel {
  background: var(--white);
  border: 1px solid var(--grey-line);
  border-radius: var(--radius-card);
  padding: 22px;
}
.panel-accent { background: var(--navy-tint); border-color: var(--navy-tint-2); }
.panel-note { background: var(--navy-tint); border-color: var(--navy-tint-2); margin-top: 24px; }
.panel fieldset, fieldset.panel { border: 1px solid var(--grey-line); margin: 0; }
fieldset.panel legend { padding: 0 8px; }

.tick-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.tick-list li { padding-left: 30px; position: relative; }
.tick-list li::before {
  content: ""; position: absolute; left: 0; top: 4px;
  width: 16px; height: 16px;
  background: var(--amber);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
.step-list { padding-left: 22px; display: grid; gap: 8px; }

.record-list { list-style: none; padding: 0; margin: 0 0 12px; }
.record-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--grey-line);
}
.record-list li:last-child { border-bottom: 0; }

.notice { border: 1px solid; border-radius: var(--radius-card); padding: 14px 18px; margin-bottom: 20px; }
.notice-ok { background: var(--navy-tint); border-color: var(--navy); color: var(--navy); }
.notice-warn { background: var(--amber-tint); border-color: var(--amber-deep); color: var(--ink); }

.helpdesk-panel { background: var(--navy-tint); border-color: var(--navy-tint-2); margin-bottom: 28px; }

/* ---------- Role cards / grids ---------- */
.role-grid { display: grid; gap: 16px; margin-top: 8px; }
.role-card { border: 1px solid var(--grey-line); border-radius: var(--radius-card); padding: 20px; background: var(--white); }

.cta-band {
  margin-top: 28px; background: var(--navy); color: var(--white);
  border-radius: var(--radius-card); padding: 22px;
  display: grid; gap: 14px;
}
.cta-band .btn { justify-self: start; }

/* ---------- Forms ---------- */
.stack-form { display: grid; gap: 16px; max-width: 620px; }
.form-wide { max-width: 780px; }
.signin-card { background: var(--white); border: 1px solid var(--grey-line); border-radius: var(--radius-card); padding: 24px; }
.field { display: grid; gap: 6px; }
.field-row { display: grid; gap: 16px; }
label { font-weight: 700; color: var(--navy); }
input[type="text"], input[type="password"], input[type="search"], input[type="date"], select, textarea {
  width: 100%; padding: 12px 14px;
  font-size: 16px; font-family: inherit;
  border: 1.5px solid var(--grey); border-radius: var(--radius-btn);
  background: var(--white); color: var(--ink);
  min-height: 48px;
}
textarea { min-height: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--navy); outline: 3px solid var(--amber); outline-offset: 1px; }
input:disabled { background: var(--navy-tint); color: var(--ink); }
.field-help { font-size: 0.88rem; color: #4A5468; margin: 0; }
.field-error {
  background: var(--red-tint); border: 1px solid var(--red); color: var(--red);
  padding: 10px 14px; border-radius: var(--radius-chip); font-weight: 600;
}
.form-errors { background: var(--red-tint); border: 1px solid var(--red); border-radius: var(--radius-card); padding: 14px 18px; margin-bottom: 16px; color: var(--red); }
.form-errors ul { margin: 6px 0 0; padding-left: 20px; }

.scan-panel { margin-bottom: 20px; }
.qr-reader {
  margin-top: 14px; max-width: 420px;
  border: 1px solid var(--grey-line); border-radius: var(--radius-card);
  overflow: hidden; background: var(--navy-tint);
}
.qr-reader video { display: block; width: 100%; }

.verify-form input {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 1.3rem; letter-spacing: 0.12em; text-transform: uppercase;
  text-align: center;
}
.action-bar {
  display: flex; flex-wrap: wrap; gap: 12px;
  padding: 4px 0;
}
.action-bar .btn { flex: 1 1 auto; }
@media (min-width: 768px) {
  .action-bar .btn { flex: 0 0 auto; }
}

/* ---------- Verify result ---------- */
.verify-result {
  display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start;
  border: 2px solid; border-radius: var(--radius-card); padding: 22px; margin-top: 28px;
}
.verify-valid { border-color: var(--navy); background: var(--navy-tint); }
.verify-invalid { border-color: var(--red); background: var(--red-tint); }
.verify-invalid h2 { color: var(--red); }
.invalid-mark {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--red); color: var(--white);
  font-size: 2rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.result-list { display: grid; gap: 8px; margin: 0 0 10px; }
.result-list div { display: grid; grid-template-columns: 140px 1fr; gap: 8px; }
.result-list dt { font-weight: 700; color: var(--navy); }
.result-list dd { margin: 0; }
.result-note { font-size: 0.9rem; margin: 0; }

/* ---------- FAQ ---------- */
.faq-list { display: grid; gap: 10px; margin: 16px 0 32px; }
.faq-list details { border: 1px solid var(--grey-line); border-radius: var(--radius-card); background: var(--white); }
.faq-list summary {
  cursor: pointer; padding: 14px 18px; font-weight: 700; color: var(--navy);
  min-height: 48px; display: flex; align-items: center; gap: 12px;
  list-style: none;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "";
  width: 9px; height: 9px; flex: none; margin-left: auto;
  border-right: 2px solid var(--navy); border-bottom: 2px solid var(--navy);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s ease;
}
.faq-list details[open] summary { border-bottom: 1px solid var(--grey-line); }
.faq-list details[open] summary::after { transform: rotate(225deg) translateY(-2px); }
.faq-list details p { padding: 14px 18px; margin: 0; max-width: var(--measure); }

/* ---------- Page head ---------- */
.page-head { background: var(--navy-tint); padding: 36px 0; border-bottom: 1px solid var(--navy-tint-2); }
.page-head .lede { max-width: var(--measure); margin: 0; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--grey-line); border-radius: var(--radius-card); background: var(--white); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.data-table th {
  text-align: left; padding: 12px 14px; background: var(--navy); color: var(--white);
  font-weight: 700; white-space: nowrap;
}
.data-table td { padding: 12px 14px; border-top: 1px solid var(--grey-line); vertical-align: top; }
.data-table tbody tr:nth-child(even) { background: #F7F8FA; }

/* ---------- Filter bar ---------- */
.filter-bar { display: grid; gap: 10px; margin: 18px 0 20px; }

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center; padding: 44px 20px;
  border: 1px dashed var(--grey); border-radius: var(--radius-card);
  color: #4A5468;
}
.empty-state .seal { margin: 0 auto 12px; }

/* ---------- Not found ---------- */
.not-found { text-align: center; padding: 40px 0; }
.not-found .seal { margin: 0 auto 16px; }
.not-found-links { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 20px 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: var(--navy-tint-2); padding: 36px 0 44px; margin-top: 0; }
.footer-grid { display: grid; gap: 24px; }
.footer-name { color: var(--white); }
.footer-note { font-size: 0.88rem; max-width: var(--measure); }
.footer-links { display: grid; gap: 8px; }
.footer-links a, .footer-helpdesk a { color: var(--white); }
.footer-helpdesk p { margin: 0 0 6px; }
.footer-helpdesk { font-size: 0.9rem; }

.footer-bottom {
  margin-top: 28px; padding-top: 16px;
  border-top: 1px solid var(--navy-deep);
  display: flex; flex-direction: column; gap: 4px;
  align-items: center; text-align: center;
  font-size: 0.85rem; color: var(--navy-tint-2);
}
.footer-bottom p { margin: 0; }
.footer-bottom a { color: var(--white); text-decoration: none; }
.footer-bottom a:hover { text-decoration: underline; text-underline-offset: 3px; }

.app-footer {
  padding: 18px 16px 24px;
  font-size: 0.8rem; color: #4A5468;
  text-align: center;
}
.app-footer p { margin: 0; }
.app-footer a { color: var(--navy); text-decoration: none; }
.app-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Floating actions ---------- */
.float-actions { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 10px; z-index: 40; }
.float-btn {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--amber); border: 2px solid var(--navy);
  display: flex; align-items: center; justify-content: center;
}
.float-btn svg { width: 24px; height: 24px; fill: var(--navy); }

/* =========================================================
   App shell (signed-in)
   ========================================================= */
.app-body { background: #F4F5F7; }
.app-shell { display: block; }
.app-sidebar { display: none; }
.app-topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--navy); color: var(--white);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px;
}
.topbar-user { margin: 0; font-size: 0.9rem; color: var(--navy-tint-2); flex: 1; }
.app-content { padding: 20px 16px 48px; max-width: 1100px; margin: 0 auto; }
.app-content h1 { font-size: 1.6rem; }

.app-nav-toggle {
  background: transparent; color: var(--white);
  border: 2px solid var(--white); border-radius: var(--radius-btn);
  min-height: 44px; padding: 8px 16px; font-weight: 700; font-family: inherit; font-size: 0.9rem;
  cursor: pointer;
}
.app-nav-mobile { display: none; background: var(--navy); border-bottom: 1px solid var(--navy-deep); }
.app-nav-mobile.open { display: flex; flex-direction: column; padding: 6px 12px 14px; }
.app-nav-mobile a {
  color: var(--navy-tint-2); text-decoration: none; font-weight: 600;
  padding: 10px 14px; min-height: 44px; display: flex; align-items: center;
  border-radius: var(--radius-btn);
}
.app-nav-mobile a:hover { background: var(--navy-deep); color: var(--white); }
.app-nav-mobile a[aria-current="page"] { background: var(--navy-deep); color: var(--amber); }

.dash-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.dash-head h1 { margin: 0; }
.dash-head .muted { margin: 4px 0 0; }

.stat-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.stat-card {
  background: var(--white); border: 1px solid var(--grey-line);
  border-radius: var(--radius-card); padding: 16px;
  display: flex; flex-direction: column; text-decoration: none; color: var(--ink);
}
.stat-card .stat-num { color: var(--navy); }
.stat-card .stat-label { color: #4A5468; }
.stat-card:hover { border-color: var(--navy); color: var(--ink); }

.dash-grid { display: grid; gap: 16px; }
.crumbs { font-size: 0.85rem; color: #4A5468; margin-bottom: 12px; }

.deadline-list { margin: 0; display: grid; gap: 10px; }
.deadline-list div { display: grid; grid-template-columns: 1fr; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--grey-line); }
.deadline-list div:last-child { border-bottom: 0; }
.deadline-list dt { font-weight: 700; color: var(--navy); font-size: 0.85rem; }
.deadline-list dd { margin: 0; }

/* Progression timeline */
.progress-ladder { list-style: none; padding: 0; margin: 16px 0 0; }
.progress-step { display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--grey-line); }
.progress-step:last-child { border-bottom: 0; }
.progress-dot {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--grey); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 800; justify-self: center; background: var(--white);
}
.progress-step.is-done .progress-dot { background: var(--navy); border-color: var(--navy); }
.progress-step.is-done p strong { color: var(--navy); }
.progress-step.is-current .progress-dot { border-color: var(--amber); border-width: 4px; }
.progress-step.is-current { background: var(--amber-tint); margin: 0 -22px; padding: 12px 22px; }
.progress-step p { margin: 0; }

/* Certificates */
.cert-grid { display: grid; gap: 16px; }
.cert-card { background: var(--white); border: 1px solid var(--grey-line); border-radius: var(--radius-card); padding: 18px; }
.cert-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.cert-num { margin: 0; }
.cert-head .muted { margin: 0; font-size: 0.85rem; }
.cert-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--grey-line); }
.cert-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.cert-qr { display: block; margin: 10px 0 14px; }
.cert-issue { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cert-issue select, .cert-issue input { min-height: 40px; font-size: 0.9rem; padding: 6px 10px; }
.cert-issue input { max-width: 150px; }

/* =========================================================
   Breakpoints
   ========================================================= */
@media (min-width: 640px) {
  .stat-row { grid-template-columns: repeat(4, 1fr); }
  .role-grid { grid-template-columns: repeat(3, 1fr); }
  .field-row { grid-template-columns: 1fr 1fr; }
  .filter-bar { grid-template-columns: 1fr auto auto auto; align-items: end; }
  .cert-grid { grid-template-columns: 1fr 1fr; }
  .cta-band { grid-template-columns: 1fr auto; align-items: center; }
}

@media (min-width: 768px) {
  body { font-size: 17px; }
  .nav-toggle { display: none; }
  .site-nav { display: flex; width: auto; flex-direction: row; align-items: center; gap: 2px; padding: 0; }
  .site-nav a { padding: 8px 12px; min-height: 44px; }
  .site-nav a[aria-current="page"] { color: var(--amber); background: transparent; }
  .nav-cta { margin-left: 8px; }
  .wrap { padding: 0 24px; }
  .hero { padding: 88px 0 96px; }
  .hero-grid { grid-template-columns: 1.1fr 1fr; align-items: center; }
  .hero h1 { font-size: clamp(2.5rem, 4.5vw, 4rem); letter-spacing: -0.01em; }
  .hero .lede { font-size: 1.15rem; }
  .page-head { padding: 56px 0; }
  .page-head h1 { font-size: clamp(2rem, 3.4vw, 2.75rem); }
  .section { padding: clamp(80px, 8vw, 104px) 0; }
  .section h2 { font-size: clamp(1.9rem, 3vw, 2.5rem); }
  h3, .h3 { font-size: 1.25rem; }
  .stat-num { font-size: 1.9rem; }
  .badge { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em; padding: 4px 10px; }
  label { font-size: 0.9rem; }
  .btn { padding: 0 24px; }
  .section p, .panel p { max-width: 68ch; }
  .split-grid { grid-template-columns: 1.2fr 1fr; }
  .level-ladder { grid-template-columns: repeat(3, 1fr); gap: 0 24px; }
  .level-step { border-bottom: 0; border-right: 1px solid var(--grey-line); padding-right: 18px; }
  .level-step:nth-child(3n) { border-right: 0; }
  .footer-grid { grid-template-columns: 1.4fr 0.8fr 0.8fr; }
  .site-footer { padding: 40px 0 44px; }
  .footer-bottom { flex-direction: row; justify-content: space-between; align-items: center; text-align: left; }
  .float-actions { bottom: 20px; }
  .dash-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .span-2 { grid-column: span 2; }
  .stat-cards { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .panel { padding: 26px; }
  .role-grid { gap: 24px; }
  .role-card { padding: 26px; display: flex; flex-direction: column; }
  .role-card p { font-size: 0.95rem; }
  .cert-grid { gap: 24px; }
  .cert-card { padding: 24px; display: flex; flex-direction: column; }
  .cert-card .cert-foot { margin-top: auto; }
  .signin-card { padding: 28px; }
  .app-content h1 { font-size: 1.8rem; }
}

@media (min-width: 1024px) {
  .app-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
  .app-sidebar {
    display: flex; flex-direction: column;
    background: var(--navy); color: var(--white);
    padding: 18px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  }
  .brand-sidebar { padding: 0 20px 18px; border-bottom: 1px solid var(--navy-deep); }
  .side-nav { display: flex; flex-direction: column; padding: 14px 12px; gap: 2px; flex: 1; }
  .side-nav a {
    color: var(--navy-tint-2); text-decoration: none; font-weight: 600; font-size: 0.95rem;
    padding: 10px 14px; border-radius: var(--radius-btn); min-height: 44px; display: flex; align-items: center;
  }
  .side-nav a:hover { background: var(--navy-deep); color: var(--white); }
  .side-nav a[aria-current="page"] { background: var(--navy-deep); color: var(--amber); }
  .side-user { padding: 14px 20px; border-top: 1px solid var(--navy-deep); font-size: 0.85rem; color: var(--navy-tint-2); }
  .side-user p { margin: 0 0 2px; }
  .side-user a { color: var(--amber); }
  .app-topbar { display: none; }
  .app-content { padding: 32px 36px 60px; }
  .app-nav-toggle, .app-nav-mobile { display: none !important; }
  .cert-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1280px) {
  .wrap { padding: 0 40px; }
  .app-content { padding: 40px 48px 72px; }
}

@media (min-width: 1400px) {
  .level-ladder { grid-template-columns: repeat(6, 1fr); }
  .level-step { border-right: 1px solid var(--grey-line); }
  .level-step:nth-child(3n) { border-right: 1px solid var(--grey-line); }
  .level-step:last-child { border-right: 0; }
}

@media (hover: hover) {
  .stat-card, .role-card, .cert-card {
    transition: transform 200ms ease, box-shadow 200ms ease;
  }
  .stat-card:hover, .role-card:hover, .cert-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgba(11, 26, 56, 0.10);
  }
}

/* Mobile table stacking */
@media (max-width: 640px) {
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tr { border-top: 1px solid var(--navy-tint-2); padding: 8px 0; }
  .data-table tbody tr:first-child { border-top: 0; }
  .data-table td { border-top: 0; padding: 4px 14px; }
  .data-table td::before {
    content: attr(data-label);
    display: block; font-size: 0.72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em; color: #4A5468;
  }
}

@media (max-width: 767px) {
  /* 2-col card grids: edge distance = gap = 6px */
  .stat-cards {
    gap: 6px;
    margin: 0 -10px 20px;
  }
  .stat-card { padding: 6px; }
  .stat-card .stat-num { font-size: 1.35rem; }
  .stat-card .stat-label { font-size: 0.8rem; }

  .stat-strip .wrap { padding: 0 6px; }
  .stat-row { gap: 6px; }
  .stat { padding: 6px; }
  .stat-num { font-size: 1.35rem; }
  .stat-label { font-size: 0.8rem; }

  /* 1-col card areas: 8px from screen edge */
  .role-grid { margin: 8px -12px 0; }
  .faq-list { margin-left: -12px; margin-right: -12px; }
  .dash-grid { margin-left: -8px; margin-right: -8px; }
  .cert-grid { margin-left: -8px; margin-right: -8px; }

  /* Two-button rows stay on one line on phones */
  .hero-actions,
  .action-bar {
    flex-wrap: nowrap;
    gap: 8px;
  }
  .hero-actions > .btn,
  .action-bar > .btn {
    flex: 1 1 0;
    min-width: 0;
    height: 44px;
    min-height: 44px;
    padding: 0 12px;
    font-size: clamp(13px, 3.6vw, 14px);
    font-weight: 600;
    white-space: nowrap;
    line-height: 1;
    align-items: center;
    justify-content: center;
  }
  .hero-actions > .btn:active,
  .action-bar > .btn:active {
    transform: scale(0.98);
  }
  .not-found-links {
    flex-direction: column;
    align-items: stretch;
  }
}

@media print {
  .site-header, .site-footer, .app-sidebar, .app-topbar, .app-nav-mobile, .float-actions, .action-bar { display: none; }
  .app-content { padding: 0; }
}
