/* =================================================================
   Staff Training Portal — visual identity
   Ink navy ground, brass amber accent (progress/active), muted teal
   (pass), rust (overdue/fail). Display serif for authority, Inter
   for UI, mono for course codes / certificate serials.
   ================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --ink:        #12151C;
  --panel:      #1B2029;
  --panel-2:    #232936;
  --line:       #303747;
  --text:       #E7E9EE;
  --text-dim:   #99A1B3;
  --paper:      #F3EFE6;
  --brass:      #f7931f;
  --brass-dim:  #D66F0A;
  --teal:       #4C9C87;
  --rust:       #C1523A;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --radius: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  color: #FFFFFF;
}

a { color: var(--brass); text-decoration: none; }
a:hover { text-decoration: underline; }

code, .mono { font-family: var(--font-mono); }

button, input, select, textarea { font-family: inherit; font-size: inherit; }

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

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Layout shells ---------- */

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

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
}

.sidebar .brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: #fff;
  margin-bottom: 28px;
  padding: 0 8px;
}
.sidebar .brand span { color: var(--brass); }

.sidebar .brand-logo {
  display: block;
  width: 80px;
  max-height: 56px;
  object-fit: contain;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 4px 6px;
  margin-left:auto;
  margin-right:auto;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 0.92rem;
  font-weight: 500;
  margin-bottom: 2px;
}
.nav-link:hover { background: var(--panel-2); text-decoration: none; color: var(--text); }
.nav-link.active { background: var(--panel-2); color: #fff; }

.nav-icon {
  width: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  line-height: 1;
  flex-shrink: 0;
}
.nav-text {
  display: inline-block;
}

.sidebar .user-box {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--text-dim);
}
.sidebar .user-box strong { color: var(--text); display:block; font-size: 0.92rem; }
.sidebar .user-box a { color: var(--text-dim); font-size: 0.8rem; }
.sidebar .mobile-logout { display: none; }

.powered-by {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 0.74rem;
  color: var(--text-dim);
  text-align: center;
  letter-spacing: 0.03em;
}

.powered-by-standalone {
  border-top: 0;
  padding-top: 0;
}

.mobile-powered-by {
  display: none;
}

.mobile-menu-toggle,
.mobile-menu-backdrop,
.mobile-brand {
  display: none;
}

.main {
  flex: 1;
  padding: 40px 48px;
  max-width: 1100px;
}

@media (min-width: 781px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
  }

  .main {
    margin-left: 240px;
    width: calc(100% - 240px);
  }
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.84rem;
  color: var(--text-dim);
}

.crumbs a {
  color: var(--brass);
}

.crumbs .sep {
  color: #6f788b;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 6px;
  display: block;
}

/* ---------- Auth (login) ---------- */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 20% 15%, rgba(217,164,65,0.08), transparent 40%),
    var(--ink);
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px 24px 28px;
}
.auth-card h1 { font-size: 1.5rem; margin-bottom: 4px; }
.auth-card h2 { font-size: 1.1rem; margin-bottom: 4px; }
.auth-card p.sub { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 20px; }
.contact-card { max-width: 560px; }
.contact-heading { margin-bottom: 20px; }
.contact-heading .eyebrow { margin-bottom: 4px; }
.contact-logo { display: block; width: min(190px, 70%); max-height: 58px; object-fit: contain; object-position: left center; margin-bottom: 20px; border-radius: 7px; background: #fff; padding: 5px 8px; }
.auth-back { display: inline-block; margin-bottom: 20px; color: var(--text-dim); font-size: 0.82rem; }
.auth-back:hover { color: var(--text); }
.auth-help-link { margin: 14px 0 0; text-align: center; font-size: 0.84rem; }

.auth-tabs { display: block; }
.auth-tab-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.auth-tab {
  flex: 1;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-dim);
  font-weight: 600;
  cursor: pointer;
}
.auth-tab.active {
  background: var(--panel-2);
  color: var(--text);
  border-color: var(--brass);
}
.auth-tab-panel { display: none; }
.auth-tab-panel.active { display: block; }

/* ---------- Portal landing ---------- */

.portal-landing { min-height: 100vh; background: #10161a; }
.landing-shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 24px 0 40px; }
.landing-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 20px; padding: 12px 20px; border-radius: var(--radius); background: #fff; }
.landing-brand { font-family: var(--font-display); color: #fff; font-size: 1.3rem; text-decoration: none; }
.landing-brand span { color: var(--brass); margin-left: 6px; }
.landing-brand-logo { display: block; width: min(220px, 42vw); max-height: 64px; object-fit: contain; object-position: left center; border-radius: 7px; background: #fff; padding: 5px 8px; }
.landing-admin-link { color: #4b5563; font-size: 0.88rem; }
.landing-admin-link:hover { color: var(--ink); }
.landing-hero { display: grid; grid-template-columns: minmax(0, .94fr) minmax(380px, 1.06fr); min-height: 535px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.landing-copy { display: flex; flex-direction: column; justify-content: center; padding: clamp(40px, 7vw, 92px); }
.landing-copy h1 { max-width: 600px; font-size: clamp(2.3rem, 4vw, 4.6rem); line-height: 1.03; margin: 0 0 22px; }
.landing-steps { display: grid; gap: 12px; margin: 0 0 30px; padding: 0; list-style: none; color: var(--text); font-size: 1.02rem; }
.landing-steps li { display: flex; align-items: center; gap: 12px; }
.landing-step-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex: 0 0 28px; border: 1px solid var(--brass); border-radius: 50%; color: var(--brass); font-family: var(--font-mono); font-size: .75rem; }
.landing-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.landing-cta { align-self: flex-start; }
.landing-request-link { align-self: flex-start; font-size: .9rem; }
.landing-image { position: relative; min-height: 420px; overflow: hidden; background: var(--panel-2); }
.landing-image::after { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(18,21,28,.1), rgba(18,21,28,.35)); content: ''; pointer-events: none; }
.landing-image img { display: block; width: 100%; height: 100%; min-height: 420px; object-fit: cover; object-position: center; }
.landing-benefits { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-top: 0; background: #171d22; }
.landing-benefits div { min-height: 118px; padding: 22px 26px; border-right: 1px solid var(--line); }
.landing-benefits div:last-child { border-right: 0; }
.landing-benefits strong { display: block; color: var(--text); font-size: .95rem; margin-bottom: 7px; }
.landing-benefits span { display: block; color: var(--text-dim); font-size: .84rem; }

@media (max-width: 780px) {
  .landing-shell { width: min(100% - 32px, 620px); padding-top: 16px; }
  .landing-header { padding-bottom: 18px; }
  .landing-hero { grid-template-columns: 1fr; min-height: auto; }
  .landing-image { order: -1; }
  .landing-copy { order: 1; }
  .landing-copy { padding: 46px 28px; }
  .landing-copy h1 { font-size: 2.55rem; }
  .landing-image { min-height: 280px; }
  .landing-benefits { grid-template-columns: 1fr; border-top: 1px solid var(--line); }
  .landing-benefits div { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .landing-benefits div:last-child { border-bottom: 0; }
}

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.field-note { font-size: 0.75rem; color: var(--text-dim); font-weight: 400; }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
}
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--brass); }
.field textarea { min-height: 150px; resize: vertical; }

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 42px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--brass);
  color: #1a1305;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.92rem;
}
.btn:hover { background: #e7b458; text-decoration: none; }
.btn.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn.btn-ghost:hover { background: var(--panel-2); }
.btn.btn-danger { background: var(--rust); color: #fff; }
.btn.full { width: 100%; }
.btn-small { padding: 7px 10px; font-size: 0.78rem; white-space: nowrap; }

.form-select {
  width: 100%;
  padding: 10px 12px;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
}

body.modal-open { overflow: hidden; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 10, 14, 0.78);
}
.modal-backdrop[hidden] { display: none; }
.modal {
  width: min(100%, 500px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}
.modal-header { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.modal-header h2 { font-size: 1.35rem; margin: 0; }
.modal-close { border: 0; background: transparent; color: var(--text-dim); font-size: 1.7rem; line-height: 1; cursor: pointer; padding: 0 2px; }
.modal-close:hover { color: var(--text); }
.modal-subtitle, .modal-hint { color: var(--text-dim); font-size: 0.84rem; margin: 4px 0 0; }
.modal-hint { margin: -4px 0 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.error-msg {
  background: rgba(193,82,58,0.15);
  border: 1px solid rgba(193,82,58,0.4);
  color: #f0a898;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 16px;
}
.success-msg {
  background: rgba(76,156,135,0.14);
  border: 1px solid rgba(76,156,135,0.35);
  color: #a0d3c8;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

/* ---------- Cards / grids ---------- */

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

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
}

.course-card .code { font-family: var(--font-mono); font-size: 0.72rem; color: var(--brass-dim); }
.course-card h3 { font-size: 1.05rem; margin: 4px 0 8px; }
.course-card p { color: var(--text-dim); font-size: 0.88rem; margin: 0 0 14px; }

.course-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
  display: block;
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.course-duration {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-dim);
}

.course-hero-image {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: block;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 100px;
  font-family: var(--font-mono);
  text-transform: capitalize;
}
.badge.not_started { background: var(--panel-2); color: var(--text-dim); }
.badge.in_progress { background: rgba(217,164,65,0.18); color: var(--brass); }
.badge.passed { background: rgba(76,156,135,0.18); color: var(--teal); }
.badge.failed { background: rgba(193,82,58,0.18); color: #e58671; }
.badge.required { background: rgba(193,82,58,0.15); color: #e58671; }

/* ---------- Route-line progress (signature element) ---------- */

.route {
  display: flex;
  align-items: center;
  margin: 28px 0 36px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.route-stop {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 92px;
  position: relative;
  flex-shrink: 0;
}
.route-stop .dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--panel-2);
  border: 2px solid var(--line);
  z-index: 1;
}
.route-stop.done .dot { background: var(--teal); border-color: var(--teal); }
.route-stop.current .dot { background: var(--brass); border-color: var(--brass); box-shadow: 0 0 0 4px rgba(217,164,65,0.2); }
.route-stop .label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 8px;
  max-width: 100px;
}
.route-stop.current .label, .route-stop.done .label { color: var(--text); }
.route-line-seg {
  height: 2px;
  background: var(--line);
  flex: 1;
  min-width: 24px;
  margin-bottom: 24px;
}
.route-line-seg.done { background: var(--teal); }

/* ---------- Lesson / quiz content ---------- */

.lesson-body { font-size: 0.98rem; color: var(--text); }
.lesson-body iframe { max-width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }

.quiz-q { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin-bottom: 14px; }
.quiz-q .qtext { font-weight: 500; margin-bottom: 12px; }
.quiz-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.quiz-opt:hover { background: var(--panel-2); }
.quiz-opt input { accent-color: var(--brass); }
.quiz-opt-correct { background: rgba(126, 201, 142, 0.14); color: #9be3aa; cursor: default; }
.quiz-opt-correct:hover { background: rgba(126, 201, 142, 0.14); }
.quiz-opt-incorrect { background: rgba(240, 168, 152, 0.14); color: #f0a898; cursor: default; }
.quiz-opt-incorrect:hover { background: rgba(240, 168, 152, 0.14); }
.quiz-answer-icon { margin-left: auto; font-size: 1.1rem; font-weight: 700; line-height: 1; }
.quiz-answer-icon-correct { color: #9be3aa; }
.quiz-answer-icon-incorrect { color: #f0a898; }

/* ---------- Certificate ---------- */

.certificate {
  background: #ffffff;
  color: #2A2416;
  border-radius: 6px;
  padding: 56px 48px;
  max-width: 720px;
  margin: 0 auto;
  border: 1px solid #cdbf9c;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.28);
}
.certificate::before {
  content: '';
  position: absolute; inset: 14px;
  border: 1.5px solid #b58d46;
  pointer-events: none;
}
.certificate .eyebrow { color: var(--cert-brand-color, #2A2416); }
.certificate h1 { font-size: 1.7rem; color: var(--cert-brand-color, #2A2416); }
.certificate .name { font-family: var(--font-display); font-size: 1.6rem; margin: 18px 0 4px; color: var(--cert-brand-color, #2A2416); text-align: center; }
.certificate .meta { font-family: var(--font-mono); font-size: 0.78rem; color: var(--cert-brand-color, #2A2416); margin-top: 24px; }
.certificate .seal {
  width: 64px; height: 64px; border-radius: 50%;
  border: 2px solid var(--brass-dim);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.65rem; color: var(--cert-brand-color, #2A2416);
  position: absolute; right: 48px; bottom: 48px;
  text-align: center; line-height: 1.2;
}

.certificate-header {
  text-align: center;
  margin-bottom: 14px;
}

.certificate-logo {
  max-width: 180px;
  max-height: 72px;
  margin: 0 auto 10px;
  display: block;
  object-fit: contain;
}

.certificate-copy {
  text-align: center;
  margin: 10px 0;
  font-size: 1rem;
  color: var(--cert-brand-color, #2A2416);
}

.certificate-course-title {
  font-family: var(--font-display);
  font-size: 1.28rem;
  text-align: center;
  margin: 10px auto 14px;
  color: var(--cert-brand-color, #2A2416);
  max-width: 560px;
}

.certificate-outcome {
  border: 1px solid #d5c7a8;
  border-radius: 8px;
  background: rgba(255,255,255,0.45);
  padding: 12px 14px;
  margin: 0 auto 18px;
  max-width: 620px;
}

.certificate-outcome strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--cert-brand-color, #2A2416);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.certificate-outcome p {
  margin: 0;
  color: #3f3728;
  line-height: 1.45;
}

.certificate-sign-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.certificate-sign-block {
  width: 240px;
  text-align: center;
}

.certificate-signature {
  max-width: 200px;
  max-height: 62px;
  object-fit: contain;
  margin: 0 auto 4px;
  display: block;
}

.certificate-sign-line {
  border-bottom: 1.5px solid #81673a;
  margin: 0 auto;
  width: 210px;
}

.certificate-sign-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--cert-brand-color, #2A2416);
  margin-top: 5px;
}

@media print {
  body * { visibility: hidden; }
  .certificate, .certificate * { visibility: visible; }
  .certificate { position: absolute; top: 0; left: 0; margin: 0; box-shadow: none; }
}

/* ---------- Tables (admin reporting) ---------- */

table.report { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.report th, table.report td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.report th { color: var(--text-dim); font-weight: 500; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.users-title-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 10px; }
.users-title-row h1 { margin-bottom: 0; }
.users-create-button { flex-shrink: 0; }
.users-create-icon { display: none; font-size: 1.35rem; line-height: 1; }
.user-search-form { margin-bottom: 18px; }
.user-search-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.user-search-controls input { flex: 1 1 260px; min-width: 0; padding: 10px 12px; background: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); }
.user-search-controls input:focus { border-color: var(--brass); outline: none; }
.user-pagination { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 16px 0 0; }
.user-pagination-links { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.user-page-current { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; padding: 6px 9px; border: 1px solid var(--brass); border-radius: var(--radius); color: var(--brass); font-weight: 600; }
.report-muted { color: var(--text-dim); }
.user-list-empty { color: var(--text-dim); text-align: center !important; }
.user-status-summary { display: flex; justify-content: flex-end; gap: 18px; padding: 0 0 10px; color: var(--text-dim); font-size: 0.82rem; }
.user-status-summary strong { color: var(--text); font-weight: 700; }
.user-table-scroll { width: 100%; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.user-table-scroll:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
.user-results.is-loading { opacity: .55; pointer-events: none; transition: opacity .15s ease; }

.empty-state { text-align:center; padding: 60px 20px; color: var(--text-dim); }
.empty-state h3 { color: var(--text); }

/* ---------- Responsive ---------- */

@media (max-width: 780px) {
  .shell { flex-direction: column; }
  .mobile-menu-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1102;
    display: inline-flex;
    width: 46px;
    height: 46px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
    border: 2px solid var(--brass);
    border-radius: 10px;
    background: var(--panel-2);
    color: var(--brass);
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
  }
  .mobile-menu-toggle:hover { background: var(--panel-2); color: #ffc56d; }
  .mobile-menu-toggle span {
    display: block;
    width: 19px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform .2s ease, opacity .2s ease;
  }
  .mobile-menu-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .mobile-menu-toggle.is-open span:nth-child(2) { opacity: 0; }
  .mobile-menu-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .mobile-brand {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1101;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 84px;
    padding: 12px 16px;
    color: var(--ink);
    background: #ffffff;
    border-bottom: 1px solid #d8dde5;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 3px 14px rgba(18, 21, 28, 0.08);
  }
  .mobile-brand:hover { text-decoration: none; }
  .mobile-brand img {
    display: block;
    width: auto;
    max-width: min(190px, calc(100vw - 88px));
    height: 58px;
    object-fit: contain;
    object-position: right center;
    border-radius: 7px;
    background: #fff;
    padding: 5px 9px;
  }
  .mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1098;
    display: block;
    background: rgba(8, 10, 14, 0.64);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }
  .mobile-menu-backdrop.is-visible { opacity: 1; pointer-events: auto; }
  .sidebar {
    width: min(86vw, 330px);
    flex-direction: column;
    align-items: stretch;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 96px 18px 76px;
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    height: 100vh;
    z-index: 1100;
    border-right: 0;
    border-left: 1px solid var(--line);
    transform: translateX(100%);
    transition: transform .24s ease;
    box-shadow: -18px 0 45px rgba(0, 0, 0, 0.3);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar .brand {
    display: none;
  }
  .sidebar .brand-logo { width: 190px; max-width: 100%; max-height: 58px; }
  .sidebar .nav-link,
  .sidebar .mobile-logout {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 11px 12px;
    margin: 0 0 5px;
    text-align: left;
    white-space: nowrap;
  }
  .sidebar .nav-link .nav-icon,
  .sidebar .mobile-logout .nav-icon {
    width: 22px;
    font-size: 1.1rem;
  }
  .sidebar .nav-link .nav-text,
  .sidebar .mobile-logout .nav-text {
    display: block;
    font-size: 0.9rem;
  }
  .sidebar .mobile-logout {
    order: 10;
    margin-top: auto;
    margin-bottom: 8px;
    flex-shrink: 0;
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }
  .sidebar .mobile-logout:hover { text-decoration: none; background: #2d3746; }
  .sidebar .user-box { display: none; }
  .sidebar .powered-by { display: none; }
  .mobile-powered-by {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    padding: 9px 12px;
    text-align: center;
    font-size: 0.74rem;
    color: var(--text-dim);
    background: var(--panel);
    border-top: 1px solid var(--line);
    letter-spacing: 0.03em;
  }
  .main { padding: 108px 20px 24px; margin-left: 0; width: auto; margin-top: 0; padding-bottom: 56px; }
  body.menu-is-open { overflow: hidden; }
}

/* ---------- Compliance report ---------- */

.report-intro { margin: 0 0 24px; color: var(--text-dim); }
.report-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.report-stat { min-height: 112px; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.report-stat span { display: block; color: var(--text-dim); font-size: 0.78rem; margin-bottom: 12px; }
.report-stat strong { display: block; font-family: var(--font-display); font-size: 1.7rem; line-height: 1.2; color: var(--text); overflow-wrap: anywhere; }
.report-stat-course strong { font-family: var(--font-body); font-size: 0.92rem; font-weight: 600; }
.report-controls { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(180px, .7fr) minmax(220px, 1fr); gap: 14px; padding: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; }
.report-controls .field { margin: 0; }
.report-controls select, .report-controls input { width: 100%; }
.report-results { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.report-results-header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 18px 18px 10px; }
.report-results-header h2 { font-size: 1.1rem; margin: 0; }
.report-count { color: var(--text-dim); font-size: 0.85rem; white-space: nowrap; }
.course-summary { margin-bottom: 24px; background: linear-gradient(135deg, rgba(247, 147, 31, 0.09), transparent 42%), var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--brass); border-radius: var(--radius); overflow: hidden; }
.course-summary-header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 18px 18px 14px; }
.course-summary-header h2 { margin: 0; font-size: 1.15rem; }
.course-summary-header .report-count { color: var(--brass); font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.04em; text-transform: uppercase; }
.course-summary-table-wrap { overflow-x: auto; }
.course-summary-table { min-width: 680px; }
.course-summary-table th { background: rgba(18, 21, 28, 0.38); color: var(--text-dim); font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.04em; }
.course-summary-table th:not(:first-child), .course-summary-table td:not(:first-child) { text-align: center; white-space: nowrap; }
.course-summary-table th:nth-child(2), .course-summary-table td:nth-child(2) { text-align: left; white-space: normal; }
.course-summary-table tbody tr:nth-child(even) { background: rgba(35, 41, 54, 0.42); }
.course-summary-table tbody tr:hover { background: rgba(247, 147, 31, 0.08); }
.course-summary-number { width: 56px; color: var(--brass); font-family: var(--font-mono); font-size: 0.78rem; text-align: center !important; }
.course-summary-title { min-width: 280px; color: var(--text); font-weight: 600; }
.course-summary-count { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; }
.course-summary-started { color: var(--brass); }
.course-summary-completed { color: var(--text); }
.course-summary-passed { color: var(--teal); }
.course-summary-failed { color: #e58a76; }
.report-table-wrap { overflow-x: auto; }
table.report-list { min-width: 940px; }
.report-list td { vertical-align: middle; }
.report-empty { padding: 30px !important; color: var(--text-dim); text-align: center !important; }
.report-pagination { min-height: 58px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 12px 18px; color: var(--text-dim); font-size: 0.85rem; }
.report-pagination button:disabled { opacity: .45; cursor: not-allowed; }

@media (max-width: 980px) {
  .report-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .report-summary, .report-controls { grid-template-columns: 1fr; }
  .report-results-header { align-items: flex-start; flex-direction: column; }
  .report-pagination { justify-content: center; }
  .users-title-row { align-items: center; }
  .users-create-button { width: 44px; height: 44px; padding: 0; border-radius: 50%; }
  .users-create-text { display: none; }
  .users-create-icon { display: inline-block; }

  .user-table-scroll {
    margin-right: -20px;
    padding-right: 20px;
  }
  .user-table { min-width: 900px; }
}
