:root {
  --bg: #f7f0f8;
  --bg-accent: #f0deef;
  --panel: rgba(255, 251, 255, 0.94);
  --panel-strong: #fffaff;
  --ink: #341d41;
  --muted: #6e5a76;
  --line: rgba(92, 55, 111, 0.14);
  --primary: #962c9a;
  --primary-strong: #7d1b81;
  --gold: #d6a006;
  --accent: #c0881e;
  --accent-strong: #8a5f12;
  --accent-soft: rgba(192, 136, 30, 0.13);
  --success: #1e7a4d;
  --danger: #9f2f26;
  --shadow: 0 20px 60px rgba(93, 41, 110, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.005em;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.76), transparent 25%),
    radial-gradient(circle at right center, rgba(214, 160, 6, 0.14), transparent 20%),
    linear-gradient(135deg, var(--bg) 0%, #fcf7fc 45%, var(--bg-accent) 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto 24px;
  max-width: 1240px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand-logo {
  width: 82px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(150, 44, 154, 0.1));
}

.brand-lockup span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.brand-lockup small {
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.brand-lockup strong {
  font-size: 1.25rem;
  line-height: 1.1;
}

.nav {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 700;
}

.nav a,
.btn-secondary,
.link-btn {
  border: 1px solid var(--line);
  background: rgba(52, 29, 65, 0.06);
  color: var(--ink);
}

.nav a,
.btn-primary,
.btn-secondary,
.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 800;
  white-space: nowrap;
}

.btn-primary {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #b74fbb);
  box-shadow: 0 12px 28px rgba(150, 44, 154, 0.24);
}

.link-btn {
  border: 0;
  background: transparent;
  color: var(--primary-strong);
  padding: 0;
  min-height: 0;
}

.link-btn.danger {
  color: var(--danger);
}

.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-secondary {
  border-color: rgba(160, 113, 22, 0.36);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.btn-secondary:hover {
  border-color: rgba(160, 113, 22, 0.52);
  background: rgba(192, 136, 30, 0.2);
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.flash {
  max-width: 1240px;
  margin: 0 auto 18px;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(30, 122, 77, 0.11);
  color: var(--success);
  font-weight: 800;
}

.flash.error {
  background: rgba(159, 47, 38, 0.1);
  color: var(--danger);
}

.auth-grid,
.dashboard,
.exam-screen,
.instructions,
.result-view {
  width: min(1240px, 100%);
  margin: 0 auto;
}

.auth-grid {
  min-height: calc(100vh - 160px);
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(420px, 1.15fr);
  gap: 28px;
  align-items: center;
}

.split-auth {
  align-items: start;
  padding-top: 20px;
}

.auth-copy {
  position: sticky;
  top: 24px;
}

.auth-panel-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.login-card {
  position: relative;
  overflow: hidden;
}

.login-card h2 {
  margin: 8px 0 6px;
  font-size: 1.45rem;
}

.login-card p {
  margin: 0 0 16px;
}

.admin-login-card {
  background:
    linear-gradient(145deg, rgba(52, 29, 65, 0.06), rgba(255, 255, 255, 0.86)),
    var(--panel);
}

.user-login-card {
  background:
    linear-gradient(145deg, rgba(214, 160, 6, 0.08), rgba(255, 255, 255, 0.88)),
    var(--panel);
}

.request-card {
  grid-column: 1 / -1;
}

.auth-badge {
  display: inline-flex;
  width: fit-content;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(150, 44, 154, 0.1);
  color: var(--primary-strong);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-grid h1,
.toolbar h1,
.instructions h1,
.result-view h1,
.exam-top h1 {
  margin: 0 0 10px;
  font-size: 2.25rem;
  line-height: 1.08;
}

.auth-grid p,
.toolbar p,
.exam-card p,
.instructions p,
.exam-top p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.demo-logins {
  display: grid;
  gap: 8px;
  width: fit-content;
  margin-top: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
}

.form-panel,
.instructions,
.result-view {
  padding: 28px;
}

.stack-form,
.form-panel,
.inline-form {
  display: grid;
  gap: 12px;
}

.inline-form {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 18px;
}

.stack-form label,
.form-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  padding: 11px 12px;
  font-weight: 400;
  font-family: inherit;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.dashboard {
  display: grid;
  gap: 20px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.stats > div {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.stats strong {
  display: block;
  font-size: 1.8rem;
}

.stats span,
dt,
small {
  color: var(--muted);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.grid-2 > .panel,
.dashboard > .panel {
  padding: 20px;
}

h2 {
  margin: 0 0 16px;
  font-size: 1.25rem;
}

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

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.small-table table {
  min-width: 520px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(150, 44, 154, 0.1);
  color: var(--primary-strong);
  font-size: 0.78rem;
  font-weight: 900;
}

.filters {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.question-list {
  display: grid;
  gap: 12px;
}

.question-list article {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.question-list p {
  margin: 8px 0;
}

.question-list ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.section-head .row-actions {
  flex-shrink: 0;
}

.resend-action {
  margin-top: 10px;
}

.demo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.muted-text {
  color: var(--muted);
  font-weight: 800;
}

.report-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 20px;
  padding: 6px;
  border: 1px solid rgba(92, 55, 111, 0.12);
  border-radius: 14px;
  background: rgba(92, 55, 111, 0.05);
}

.report-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1 1 auto;
  padding: 11px 16px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.95rem;
  white-space: nowrap;
  cursor: pointer;
}

.report-tab:hover {
  color: var(--ink);
}

.report-tab.active {
  background: #fff;
  color: var(--primary-strong);
  box-shadow: 0 6px 16px rgba(93, 41, 110, 0.12);
}

.report-tab-count {
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(150, 44, 154, 0.12);
  color: var(--primary-strong);
  font-size: 0.76rem;
  font-weight: 900;
}

.report-tab-panel {
  display: none;
  margin-top: 16px;
}

.report-tab-panel.active {
  display: block;
}

.report-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

details {
  margin-top: 12px;
}

summary {
  color: var(--primary-strong);
  cursor: pointer;
  font-weight: 900;
}

.compact-edit {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

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

.exam-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.exam-card h2 {
  margin: 10px 0 8px;
}

.exam-card dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0;
}

.exam-card dd {
  margin: 4px 0 0;
  font-weight: 900;
}

.scoreline {
  margin: 0;
  color: var(--primary-strong);
  font-weight: 900;
}

.instructions {
  display: grid;
  gap: 20px;
}

.instructions form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.exam-screen {
  padding-bottom: 92px;
}

.exam-top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0;
  background: linear-gradient(180deg, rgba(247, 240, 248, 0.98), rgba(247, 240, 248, 0.84));
  backdrop-filter: blur(14px);
}

.timer {
  align-self: center;
  min-width: 112px;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 1.45rem;
  font-weight: 900;
  text-align: center;
}

.question-panel {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.question-panel h2 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.22;
}

.question-image {
  width: min(720px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.options {
  display: grid;
  gap: 10px;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  font-weight: 800;
}

.option input {
  width: auto;
  margin-top: 4px;
}

.submit-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  padding: 14px 24px calc(14px + env(safe-area-inset-bottom, 0px));
  background: rgba(52, 29, 65, 0.92);
  backdrop-filter: blur(16px);
  text-align: center;
}

.result-view {
  display: grid;
  gap: 16px;
}

.result-modern {
  max-width: 980px;
}

.result-score {
  display: flex;
  align-items: baseline;
  gap: 12px;
  color: var(--primary-strong);
  font-weight: 900;
}

.result-score strong {
  font-size: 3rem;
}

.result-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
}

.result-actions div {
  display: grid;
  gap: 4px;
  margin-right: auto;
}

.next-exams {
  display: grid;
  gap: 12px;
}

@media (max-width: 980px) {
  .auth-grid,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .auth-copy {
    position: static;
  }

  .inline-form,
  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .app-shell {
    padding: 14px;
  }

  .topbar,
  .toolbar,
  .exam-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-logo {
    width: 62px;
  }

  .brand-lockup strong {
    font-size: 1.05rem;
  }

  .nav {
    width: 100%;
    justify-content: space-between;
  }

  .auth-grid h1,
  .toolbar h1,
  .instructions h1,
  .result-view h1,
  .exam-top h1 {
    font-size: 1.75rem;
  }

  .form-panel,
  .instructions,
  .result-view,
  .grid-2 > .panel,
  .dashboard > .panel,
  .exam-card,
  .question-panel {
    padding: 16px;
  }

  .inline-form,
  .filters,
  .auth-panel-stack,
  .form-row,
  .stats,
  .exam-card dl {
    grid-template-columns: 1fr;
  }

  .request-card {
    grid-column: auto;
  }

  .question-list article {
    flex-direction: column;
  }

  .timer {
    width: 100%;
  }

  .submit-dock {
    padding-left: 14px;
    padding-right: 14px;
  }

  .submit-dock .btn-primary {
    width: 100%;
  }
}

/* Old assessment experience restored for live exam attempts */
body:has(.old-exam-screen) .topbar {
  display: none;
}

body:has(.old-exam-screen) .app-shell {
  padding: 28px clamp(18px, 4vw, 46px) 150px;
}

.old-exam-screen {
  width: min(1500px, 100%);
}

.exam-start-gate {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 28% 18%, rgba(214, 160, 6, 0.16), transparent 28%),
    radial-gradient(circle at 78% 24%, rgba(150, 44, 154, 0.18), transparent 30%),
    rgba(247, 240, 248, 0.92);
  backdrop-filter: blur(14px);
}

.exam-start-gate[hidden] {
  display: none;
}

.exam-start-gate > div {
  width: min(620px, 100%);
  padding: clamp(24px, 5vw, 46px);
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 28px 80px rgba(52, 29, 65, 0.2);
}

.exam-start-gate h2 {
  margin: 8px 0 10px;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 0.98;
}

.exam-start-gate p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.55;
}

.exam-waiting .exam-hero,
.exam-waiting #examForm {
  filter: blur(3px);
  pointer-events: none;
  user-select: none;
}

.exam-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.exam-brand {
  display: flex;
  align-items: center;
  gap: 22px;
  min-width: 0;
}

.exam-brand img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  padding: 8px;
  border-radius: 0;
  background: #fff;
  box-shadow: 0 16px 38px rgba(93, 41, 110, 0.08);
}

.exam-brand h1 {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.exam-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 54px;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(52, 29, 65, 0.08);
  color: var(--ink);
  font-weight: 900;
}

.old-exam-screen .timer {
  min-width: 112px;
  min-height: 58px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
}

.old-question-panel {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(28px, 4vw, 54px);
  border-radius: 34px;
  background: rgba(255, 251, 255, 0.9);
  box-shadow: 0 24px 70px rgba(93, 41, 110, 0.12);
}

.question-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 28px;
  align-items: start;
}

.question-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 900;
}

.old-question-panel h2 {
  color: var(--ink);
  font-size: clamp(2.6rem, 5vw, 5.3rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.old-question-panel p {
  color: var(--muted);
  font-size: 1.08rem;
}

.mark-card {
  display: grid;
  place-items: center;
  min-height: 78px;
  padding: 18px 16px;
  border-radius: 24px;
  background: rgba(52, 29, 65, 0.07);
  color: var(--muted);
  font-size: 1.14rem;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  white-space: nowrap;
}

.old-options {
  width: min(660px, 100%);
  margin-top: 28px;
}

.old-option {
  min-height: 78px;
  border-radius: 22px;
  padding: 18px 22px;
  background: #fff;
  font-size: 1.12rem;
}

.old-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-badge {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(52, 29, 65, 0.08);
  color: #24212a;
  font-weight: 900;
  flex: 0 0 auto;
}

.old-option:has(input:checked) {
  border-color: rgba(150, 44, 154, 0.5);
  background: rgba(150, 44, 154, 0.1);
}

.helper-text {
  margin-top: 20px;
  color: var(--muted);
  font-weight: 700;
}

.text-answer {
  margin-top: 26px;
  min-height: 150px;
  font-size: 1.1rem;
}

.progress-dock {
  position: fixed;
  left: clamp(14px, 2vw, 28px);
  right: clamp(14px, 2vw, 28px);
  bottom: clamp(14px, 2vw, 28px);
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 22px 26px;
  border-radius: 22px;
  background: rgba(47, 40, 34, 0.96);
  color: #fff;
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.2);
}

.progress-copy {
  grid-column: 1;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  font-weight: 900;
}

.progress-track {
  grid-column: 1;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--primary));
}

.progress-dock .btn-primary {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-width: 190px;
}

@media (max-width: 820px) {
  body:has(.old-exam-screen) .app-shell {
    padding: 18px 14px 180px;
  }

  .exam-hero,
  .exam-brand {
    align-items: flex-start;
    flex-direction: column;
  }

  .exam-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(128px, 0.72fr);
    width: 100%;
    gap: 12px;
  }

  .old-exam-screen .status-pill,
  .old-exam-screen .timer {
    justify-content: center;
    width: 100%;
    min-height: 64px;
  }

  .exam-brand img {
    width: 78px;
    height: 78px;
  }

  .exam-brand h1 {
    font-size: 2.25rem;
  }

  .old-question-panel {
    padding: 22px;
    border-radius: 24px;
  }

  .question-copy {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .mark-card {
    order: -1;
    min-height: auto;
    width: fit-content;
    padding: 11px 16px;
    border-radius: 999px;
    font-size: 1rem;
  }

  .old-question-panel h2 {
    font-size: 2.25rem;
  }

  .progress-dock {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .progress-dock .btn-primary,
  .progress-copy,
  .progress-track {
    grid-column: 1;
    grid-row: auto;
  }

  .progress-copy {
    flex-direction: column;
    gap: 4px;
  }
}

/* 2026 dashboard refresh */
body {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.84), rgba(247, 240, 248, 0.72)),
    radial-gradient(circle at 18% 0%, rgba(214, 160, 6, 0.12), transparent 24%),
    radial-gradient(circle at 90% 18%, rgba(150, 44, 154, 0.12), transparent 26%),
    #f7f0f8;
}

.app-shell {
  padding: 18px clamp(18px, 3vw, 34px) 42px;
}

.topbar {
  max-width: 1360px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(92, 55, 111, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 38px rgba(93, 41, 110, 0.08);
}

.brand-logo {
  width: 112px;
  max-height: 58px;
  object-fit: contain;
  padding: 4px;
  border-radius: 10px;
  background: #fff;
}

.brand-lockup small,
.eyebrow {
  letter-spacing: 0.08em;
}

.brand-lockup strong {
  font-size: 1.05rem;
}

.dashboard,
.exam-screen,
.instructions,
.result-view,
.auth-grid {
  width: min(1360px, 100%);
}

.dashboard {
  gap: 18px;
}

.hero-toolbar {
  padding: 10px 2px 4px;
}

.toolbar h1,
.auth-grid h1,
.instructions h1,
.result-view h1,
.exam-top h1 {
  font-size: clamp(2rem, 4vw, 3.7rem);
  letter-spacing: 0;
}

.toolbar p {
  max-width: 760px;
  font-size: 1rem;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-primary,
.btn-secondary,
.nav a {
  min-height: 44px;
  border-radius: 12px;
  padding: 11px 16px;
}

.btn-primary {
  background: linear-gradient(135deg, #962c9a 0%, #b846bb 100%);
  box-shadow: 0 14px 28px rgba(150, 44, 154, 0.2);
}

.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stats > div {
  display: grid;
  gap: 6px;
  min-height: 96px;
  padding: 18px 20px;
  border-color: rgba(92, 55, 111, 0.12);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 32px rgba(93, 41, 110, 0.08);
}

.stats strong {
  order: 2;
  font-size: 2.25rem;
  line-height: 1;
}

.stats span {
  order: 1;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.compact-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tab-bar {
  position: sticky;
  top: 10px;
  z-index: 15;
  display: flex;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  padding: 6px;
  overflow-x: auto;
  border: 1px solid rgba(92, 55, 111, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 30px rgba(93, 41, 110, 0.1);
}

.tab-button {
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  padding: 11px 16px;
  font-weight: 900;
  white-space: nowrap;
}

.tab-button.active {
  background: var(--ink);
  color: #fff;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.section-panel,
.dashboard > .panel {
  padding: 20px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(52, 29, 65, 0.04);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-head h2 {
  margin-bottom: 3px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.grid-2 {
  grid-template-columns: minmax(340px, 0.7fr) minmax(0, 1.3fr);
  align-items: start;
}

.form-strip,
.inline-form {
  grid-template-columns: minmax(130px, 1fr) minmax(190px, 1.2fr) minmax(120px, 0.9fr) minmax(110px, 0.75fr) minmax(150px, 1fr) auto;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
}

.stack-form {
  gap: 14px;
}

input,
textarea,
select {
  min-height: 42px;
  border-radius: 11px;
  background: #fff;
}

label input[type="checkbox"] {
  width: auto;
  min-height: auto;
  margin-right: 8px;
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
}

table {
  min-width: 900px;
}

th {
  background: rgba(52, 29, 65, 0.045);
  font-size: 0.72rem;
}

th,
td {
  padding: 14px 16px;
}

tbody tr:hover {
  background: rgba(150, 44, 154, 0.045);
}

.pill {
  min-height: 30px;
  border: 1px solid rgba(150, 44, 154, 0.16);
  background: rgba(150, 44, 154, 0.09);
}

.checkbox-label {
  align-content: center;
  min-height: 42px;
}

.form-note {
  margin: -2px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(214, 160, 6, 0.18);
  border-radius: 12px;
  background: rgba(214, 160, 6, 0.08);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.45;
}

.time-select-row {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.time-select-row select {
  min-width: 0;
}

.window-pill {
  margin-top: 6px;
}

.admin-dashboard,
.admin-manage-exam {
  width: min(1200px, 100%);
  margin: 0 auto;
}

.admin-exams-layout {
  display: grid;
  grid-template-columns: minmax(320px, 460px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.admin-exams-layout > * {
  min-width: 0;
}

.exam-create-card,
.user-add-card {
  position: sticky;
  top: 88px;
  overflow: hidden;
}

.exam-form textarea,
.exam-settings-form textarea {
  min-height: 78px;
}

.exam-settings-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  align-items: start;
}

.exam-settings-form > .field-wide,
.exam-settings-form > .form-row,
.exam-settings-form > .schedule-grid,
.exam-settings-form > .form-note,
.exam-settings-form > button {
  grid-column: 1 / -1;
}

.exam-create-card input,
.exam-create-card textarea,
.exam-create-card select,
.exam-create-card label,
.user-add-card input,
.user-add-card textarea,
.user-add-card select,
.user-add-card label,
.admin-manage-exam input,
.admin-manage-exam textarea,
.admin-manage-exam select,
.admin-manage-exam label {
  min-width: 0;
}

.metric-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.exam-create-card .metric-row {
  gap: 10px;
}

.schedule-grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(260px, 1.35fr) minmax(168px, 0.85fr);
  gap: 12px;
  align-items: end;
}

.exam-create-card .schedule-grid {
  grid-template-columns: 1fr;
}

.exam-create-card .schedule-toggle {
  grid-column: 1 / -1;
}

.schedule-grid input[type="date"] {
  min-width: 0;
  font-size: 0.95rem;
}

.schedule-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  line-height: 1.18;
}

.switch-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(92, 55, 111, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
}

.switch-row input[type="checkbox"],
.schedule-toggle input[type="checkbox"] {
  flex: 0 0 auto;
  margin: 0;
}

.exam-modules-card {
  overflow: hidden;
  min-width: 0;
}

.exam-module-list {
  display: grid;
  gap: 12px;
}

.exam-module-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  padding: 16px 20px;
  border: 1px solid rgba(92, 55, 111, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 251, 255, 0.74)),
    radial-gradient(circle at right top, rgba(150, 44, 154, 0.08), transparent 30%);
  box-shadow: 0 14px 34px rgba(93, 41, 110, 0.08);
  text-decoration: none;
  color: inherit;
}

.exam-module-item:hover {
  border-color: rgba(150, 44, 154, 0.22);
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(93, 41, 110, 0.12);
}

.module-main {
  flex: 1 1 100%;
  min-width: 0;
}

.module-main strong {
  display: block;
  font-size: 1.06rem;
  line-height: 1.2;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.module-main small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.module-facts {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  gap: 6px;
}

.module-fact {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(92, 55, 111, 0.14);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.module-fact b {
  color: var(--ink);
  font-weight: 900;
}

.module-status {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.module-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.module-status .window-pill {
  margin-top: 0;
}

.module-status small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

.module-open {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), #b74fbb);
  color: #fff;
  font-weight: 800;
  white-space: nowrap;
}

.module-open::after {
  content: "\2192";
  font-size: 1.05em;
}

.exam-module-table-wrap {
  overflow-x: auto;
}

.exam-module-table {
  min-width: 920px;
  table-layout: fixed;
}

.exam-module-table th:nth-child(1),
.exam-module-table td:nth-child(1) {
  width: 38%;
}

.exam-module-table th:nth-child(2),
.exam-module-table td:nth-child(2) {
  width: 22%;
}

.exam-module-table th:nth-child(3),
.exam-module-table td:nth-child(3) {
  width: 10%;
}

.exam-module-table th:nth-child(4),
.exam-module-table td:nth-child(4) {
  width: 15%;
}

.exam-module-table th:nth-child(5),
.exam-module-table td:nth-child(5) {
  width: 15%;
}

.exam-module-table td {
  vertical-align: middle;
}

.exam-module-table td strong,
.exam-module-table td small {
  overflow-wrap: anywhere;
}

.action-cell {
  text-align: right;
  white-space: nowrap;
}

.action-cell .btn-secondary {
  min-width: 124px;
  justify-content: center;
}

.manage-exam-toolbar {
  align-items: center;
  gap: 18px;
  padding: clamp(20px, 2.6vw, 30px);
  border: 1px solid rgba(92, 55, 111, 0.12);
  border-radius: 22px;
  background:
    radial-gradient(circle at right top, rgba(150, 44, 154, 0.1), transparent 48%),
    rgba(255, 255, 255, 0.82);
  box-shadow: 0 16px 38px rgba(93, 41, 110, 0.08);
}

.admin-manage-exam .toolbar.manage-exam-toolbar h1 {
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  line-height: 1.14;
  letter-spacing: -0.01em;
}

.exam-settings-card {
  padding: clamp(22px, 3vw, 32px);
}

.settings-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.settings-summary > div {
  min-height: 82px;
  padding: 15px;
  border: 1px solid rgba(92, 55, 111, 0.12);
  border-radius: 16px;
  background:
    radial-gradient(circle at right top, rgba(214, 160, 6, 0.09), transparent 44%),
    rgba(255, 255, 255, 0.7);
}

.settings-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-summary strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.manage-question-grid {
  grid-template-columns: minmax(360px, 0.68fr) minmax(0, 1.32fr);
}

.add-question-card {
  position: sticky;
  top: 88px;
}

.question-library-card .question-list article {
  border: 1px solid rgba(92, 55, 111, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
}

.question-card .question-body {
  flex: 1;
  min-width: 0;
}

.question-card .question-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.question-card .qtag {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(92, 55, 111, 0.16);
  background: rgba(255, 255, 255, 0.85);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.question-card .qtag-set {
  border-color: rgba(150, 44, 154, 0.28);
  background: rgba(150, 44, 154, 0.1);
  color: var(--primary-strong);
}

.question-card .qtag-image {
  overflow-wrap: anywhere;
}

.question-card .question-text {
  margin: 0 0 10px;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.4;
}

.question-card .question-options {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 5px;
}

.question-card .question-options li {
  padding: 7px 11px;
  border-radius: 9px;
  background: rgba(92, 55, 111, 0.05);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.question-card .question-options li.is-correct {
  background: rgba(30, 122, 77, 0.12);
  color: #1b6e45;
  font-weight: 800;
}

.window-open {
  border-color: rgba(30, 122, 77, 0.18);
  background: rgba(30, 122, 77, 0.1);
  color: var(--success);
}

.window-upcoming {
  border-color: rgba(214, 160, 6, 0.24);
  background: rgba(214, 160, 6, 0.12);
  color: #865f00;
}

.window-closed {
  border-color: rgba(159, 47, 38, 0.18);
  background: rgba(159, 47, 38, 0.09);
  color: var(--danger);
}

.window-locked-panel {
  border-color: rgba(214, 160, 6, 0.22);
  background: rgba(214, 160, 6, 0.08);
}

.certificate-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border-radius: 18px;
  background:
    radial-gradient(circle at right top, rgba(214, 160, 6, 0.16), transparent 32%),
    rgba(255, 255, 255, 0.78);
}

.certificate-summary h2,
.certificate-summary p {
  margin: 0;
}

.certificate-summary p {
  margin-top: 6px;
  color: var(--muted);
}

.certificate-summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.certificate-page {
  width: min(1360px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 22px;
}

.certificate-toolbar {
  align-items: flex-end;
}

.certificate-card {
  position: relative;
  overflow: hidden;
  min-height: 760px;
  padding: clamp(28px, 5vw, 64px);
  border: 1px solid rgba(92, 55, 111, 0.16);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 251, 255, 0.86)),
    radial-gradient(circle at 88% 16%, rgba(150, 44, 154, 0.16), transparent 26%),
    radial-gradient(circle at 12% 86%, rgba(214, 160, 6, 0.18), transparent 24%);
  box-shadow: 0 30px 90px rgba(93, 41, 110, 0.16);
}

.certificate-watermark {
  position: absolute;
  right: -30px;
  bottom: 20px;
  color: rgba(150, 44, 154, 0.05);
  font-size: clamp(5rem, 12vw, 11rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.certificate-card-head,
.certificate-footer,
.certificate-meta {
  position: relative;
  z-index: 1;
}

.certificate-card-head {
  display: flex;
  align-items: center;
  gap: 22px;
}

.certificate-card-head img {
  width: 128px;
  max-height: 92px;
  object-fit: contain;
  padding: 10px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(93, 41, 110, 0.1);
}

.certificate-card-head span {
  display: block;
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.certificate-card-head strong {
  display: block;
  margin-top: 5px;
  color: var(--gold);
  font-size: 1.2rem;
}

.certificate-main {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: clamp(42px, 7vw, 86px) auto 34px;
  text-align: center;
}

.certificate-main h1 {
  margin: 14px 0;
  color: var(--ink);
  font-size: clamp(3.2rem, 8vw, 7rem);
  line-height: 0.95;
}

.certificate-main p {
  max-width: 760px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.18rem;
  line-height: 1.6;
}

.certificate-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 34px 0;
}

.certificate-meta div,
.certificate-modules {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
}

.certificate-meta div {
  padding: 18px;
}

.certificate-meta span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.certificate-meta strong {
  display: block;
  margin-top: 6px;
  font-size: 1.08rem;
}

.certificate-modules {
  position: relative;
  z-index: 1;
  padding: 20px;
}

.certificate-modules h2 {
  margin-bottom: 10px;
}

.certificate-modules ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.certificate-modules li {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(150, 44, 154, 0.09);
  color: var(--primary-strong);
  font-weight: 800;
}

.certificate-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-top: 52px;
}

.certificate-footer div {
  display: grid;
  gap: 4px;
}

.certificate-footer span {
  color: var(--muted);
}

.signature-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  min-width: 240px;
}

.signature-image {
  display: block;
  max-width: 220px;
  max-height: 72px;
  margin-bottom: 4px;
  object-fit: contain;
}

.signature-line {
  min-width: 240px;
  padding-top: 8px;
  border-top: 2px solid rgba(52, 29, 65, 0.28);
  text-align: center;
}

.signature-upload {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(248, 247, 251, 0.6);
}

.signature-upload-label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.signature-upload-current {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #fff;
}

.signature-upload-current img {
  max-width: 180px;
  max-height: 60px;
  object-fit: contain;
}

.signature-upload-remove {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.signature-upload-remove input[type="checkbox"] {
  width: auto;
  min-height: auto;
}

.signature-upload-input span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.certificate-download-body {
  padding: 28px;
}

.standalone-certificate {
  width: min(1180px, 100%);
}

.certificate-admin-grid {
  grid-template-columns: minmax(340px, 0.8fr) minmax(0, 1.2fr);
}

.certificate-preview-panel {
  overflow: hidden;
}

.certificate-preview-frame {
  max-height: 760px;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
}

.certificate-preview-frame .certificate-card {
  min-height: 620px;
  padding: 34px;
  border-radius: 22px;
  box-shadow: none;
}

.certificate-preview-frame .certificate-card-head img {
  width: 98px;
  max-height: 76px;
}

.certificate-preview-frame .certificate-main {
  margin: 34px auto 24px;
}

.certificate-preview-frame .certificate-main h1 {
  font-size: clamp(2.6rem, 5vw, 4.5rem);
}

details {
  max-width: 360px;
}

summary {
  margin-top: 8px;
}

.filters {
  grid-template-columns: repeat(4, minmax(150px, 1fr)) repeat(2, minmax(140px, 0.8fr)) auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
}

.exam-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.exam-card {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.exam-card h2 {
  font-size: 1.45rem;
  line-height: 1.18;
}

.exam-card dl {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.exam-intro {
  display: grid;
  gap: 20px;
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.rule-panel {
  padding: 18px;
  border: 1px solid rgba(159, 47, 38, 0.16);
  border-radius: 16px;
  background: rgba(159, 47, 38, 0.06);
}

.rule-panel p {
  margin: 0;
}

.exam-top {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 34px rgba(93, 41, 110, 0.1);
}

.question-panel {
  border-radius: 22px;
  padding: clamp(20px, 3vw, 34px);
}

.question-panel h2 {
  font-size: clamp(1.7rem, 3vw, 2.7rem);
}

.options {
  gap: 14px;
}

.option {
  border-radius: 16px;
  padding: 18px;
  font-size: 1.08rem;
}

.option:has(input:checked) {
  border-color: rgba(150, 44, 154, 0.48);
  background: rgba(150, 44, 154, 0.09);
}

@media (max-width: 980px) {
  .grid-2,
  .form-strip,
  .inline-form,
  .filters {
    grid-template-columns: 1fr 1fr;
  }

  .admin-exams-layout,
  .manage-question-grid {
    grid-template-columns: 1fr;
  }

  .exam-create-card,
  .add-question-card,
  .user-add-card {
    position: static;
  }

  .exam-module-table {
    min-width: 720px;
  }

  .stats,
  .compact-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .app-shell {
    padding: 12px;
    overflow-x: hidden;
  }

  body {
    overflow-x: hidden;
  }

  .topbar {
    border-radius: 14px;
  }

  .brand-logo {
    width: 86px;
  }

  .toolbar-actions,
  .toolbar-actions a,
  .form-strip,
  .inline-form,
  .filters,
  .stats,
  .compact-stats,
  .auth-panel-stack {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .request-card {
    grid-column: auto;
  }

  .tab-bar {
    width: 100%;
  }

  .tab-button {
    flex: 1 0 auto;
  }

  .section-panel {
    padding: 16px;
  }

  .toolbar h1,
  .auth-grid h1,
  .instructions h1,
  .result-view h1,
  .exam-top h1 {
    font-size: 2rem;
  }

  .certificate-summary,
  .certificate-card-head,
  .certificate-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .certificate-meta {
    grid-template-columns: 1fr;
  }

  .certificate-card {
    min-height: auto;
    padding: 22px;
    border-radius: 22px;
  }

  .certificate-main {
    text-align: left;
  }

  .certificate-main h1 {
    font-size: 3.2rem;
  }
}

@media (max-width: 640px) {
  .user-dashboard {
    gap: 14px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .user-dashboard .hero-toolbar {
    padding: 4px 0 0;
  }

  .user-dashboard .eyebrow {
    font-size: 0.92rem;
    letter-spacing: 0.18em;
  }

  .user-dashboard .toolbar h1 {
    max-width: 100%;
    font-size: clamp(2.05rem, 13vw, 3rem);
    line-height: 0.96;
    overflow-wrap: anywhere;
  }

  .user-dashboard .toolbar p,
  .user-dashboard .section-head p,
  .certificate-summary p {
    max-width: 100%;
    font-size: 1rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }

  .user-dashboard .toolbar-actions {
    width: 100%;
  }

  .user-dashboard .toolbar-actions .btn-primary,
  .certificate-summary-actions,
  .certificate-summary-actions .btn-primary,
  .certificate-summary-actions .btn-secondary {
    width: 100%;
  }

  .user-dashboard .stats,
  .user-dashboard .compact-stats {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .user-dashboard .stats > div {
    min-height: 86px;
    padding: 18px;
    border-radius: 14px;
  }

  .user-dashboard .stats strong {
    font-size: 2.4rem;
  }

  .user-dashboard .section-panel,
  .user-dashboard > .panel {
    padding: 18px;
    border-radius: 22px;
  }

  .user-dashboard .section-head {
    display: block;
    margin-bottom: 14px;
  }

  .user-dashboard .section-head h2,
  .certificate-summary h2 {
    font-size: clamp(1.65rem, 8vw, 2.2rem);
    line-height: 1.05;
  }

  .certificate-summary {
    padding: 20px;
    gap: 16px;
  }

  .user-exam-table {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .user-exam-table table,
  .user-exam-table thead,
  .user-exam-table tbody,
  .user-exam-table tr,
  .user-exam-table th,
  .user-exam-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .user-exam-table table {
    border-collapse: separate;
    border-spacing: 0;
  }

  .user-exam-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .user-exam-table tr {
    margin-bottom: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 12px 28px rgba(93, 41, 110, 0.08);
  }

  .user-exam-table td {
    display: grid;
    grid-template-columns: minmax(92px, 0.45fr) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(92, 55, 111, 0.1);
    font-size: 0.98rem;
    overflow-wrap: anywhere;
  }

  .user-exam-table td:first-child {
    display: block;
    padding: 16px 14px;
    background: rgba(52, 29, 65, 0.04);
  }

  .user-exam-table td:last-child {
    border-bottom: 0;
  }

  .user-exam-table td::before {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .user-exam-table td:nth-child(1)::before {
    content: "";
    display: none;
  }

  .user-exam-table td:nth-child(2)::before {
    content: "Status";
  }

  .user-exam-table td:nth-child(3)::before {
    content: "Time / Pass";
  }

  .user-exam-table td:nth-child(4)::before {
    content: "Window";
  }

  .user-exam-table td:nth-child(5)::before {
    content: "Attempts";
  }

  .user-exam-table td:nth-child(6)::before {
    content: "Score";
  }

  .user-exam-table td:nth-child(7)::before {
    content: "Action";
  }

  .user-exam-table .pill {
    width: fit-content;
    max-width: 100%;
    white-space: normal;
  }

  .user-exam-table .btn-primary,
  .user-exam-table .btn-secondary {
    width: 100%;
    min-height: 46px;
  }
}

@media (max-width: 640px) {
  .admin-dashboard,
  .admin-manage-exam {
    width: 100%;
    max-width: 100%;
    gap: 14px;
    overflow: hidden;
  }

  .admin-dashboard .hero-toolbar {
    padding-top: 4px;
  }

  .admin-dashboard .toolbar h1,
  .admin-manage-exam .toolbar h1 {
    max-width: 100%;
    font-size: clamp(2.2rem, 13vw, 3.15rem);
    line-height: 0.95;
    overflow-wrap: anywhere;
  }

  .admin-dashboard .toolbar p,
  .admin-dashboard .section-head p,
  .admin-manage-exam .toolbar p,
  .admin-manage-exam .section-head p {
    max-width: 100%;
    font-size: 1rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }

  .admin-dashboard .toolbar-actions,
  .admin-dashboard .toolbar-actions .btn-secondary,
  .admin-manage-exam .toolbar-actions,
  .admin-manage-exam .toolbar-actions .btn-secondary,
  .admin-manage-exam .toolbar > .btn-secondary {
    width: 100%;
  }

  .admin-dashboard .stats {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .admin-dashboard .stats > div {
    min-height: 84px;
    padding: 18px;
    border-radius: 14px;
  }

  .admin-dashboard .stats strong {
    font-size: 2.4rem;
  }

  .admin-dashboard .tab-bar {
    position: sticky;
    top: 8px;
    width: 100%;
    max-width: 100%;
    padding: 5px;
    gap: 6px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .admin-dashboard .tab-button {
    flex: 0 0 auto;
    min-width: max-content;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.95rem;
    scroll-snap-align: start;
  }

  .admin-dashboard .section-panel,
  .admin-dashboard > .panel,
  .admin-manage-exam .section-panel,
  .admin-manage-exam > .panel {
    padding: 18px;
    border-radius: 22px;
  }

  .admin-dashboard .section-head,
  .admin-dashboard .report-head,
  .admin-manage-exam .section-head {
    display: block;
    margin-bottom: 14px;
  }

  .admin-dashboard .section-head h2,
  .admin-manage-exam .section-head h2 {
    font-size: clamp(1.65rem, 8vw, 2.2rem);
    line-height: 1.05;
  }

  .admin-dashboard .form-strip,
  .admin-dashboard .inline-form,
  .admin-dashboard .stack-form,
  .admin-dashboard .filters,
  .admin-dashboard .form-row,
  .admin-dashboard .grid-2,
  .admin-exams-layout,
  .admin-manage-exam .form-row,
  .admin-manage-exam .grid-2,
  .exam-settings-form,
  .schedule-grid,
  .settings-summary,
  .manage-question-grid,
  .certificate-admin-grid {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100%;
  }

  .exam-create-card,
  .add-question-card,
  .user-add-card {
    position: static;
  }

  .metric-row {
    grid-template-columns: 1fr;
  }

  .admin-dashboard .form-strip,
  .admin-dashboard .inline-form {
    padding: 12px;
    border-radius: 18px;
  }

  .time-select-row {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .schedule-grid input[type="date"] {
    min-width: 0;
  }

  .schedule-toggle {
    min-height: 52px;
  }

  .settings-summary {
    gap: 10px;
  }

  .settings-summary > div {
    min-height: auto;
  }

  .admin-dashboard .btn-primary,
  .admin-dashboard .btn-secondary,
  .admin-manage-exam .btn-primary,
  .admin-manage-exam .btn-secondary {
    width: 100%;
    min-height: 46px;
  }

  .exam-module-item {
    padding: 14px 16px;
  }

  .admin-dashboard .row-actions {
    width: 100%;
  }

  .admin-dashboard .demo-actions,
  .admin-dashboard .demo-actions form {
    width: 100%;
  }

  .admin-dashboard .row-actions .btn-primary,
  .admin-dashboard .row-actions .btn-secondary {
    flex: 1 1 140px;
  }

  .admin-dashboard .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .admin-dashboard .table-wrap table,
  .admin-dashboard .table-wrap thead,
  .admin-dashboard .table-wrap tbody,
  .admin-dashboard .table-wrap tr,
  .admin-dashboard .table-wrap th,
  .admin-dashboard .table-wrap td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .admin-dashboard .table-wrap table {
    border-collapse: separate;
    border-spacing: 0;
  }

  .admin-dashboard .table-wrap thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .admin-dashboard .table-wrap tr {
    margin-bottom: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 12px 28px rgba(93, 41, 110, 0.08);
  }

  .admin-dashboard .table-wrap td {
    display: grid;
    grid-template-columns: minmax(98px, 0.42fr) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(92, 55, 111, 0.1);
    font-size: 0.98rem;
    overflow-wrap: anywhere;
  }

  .admin-dashboard .table-wrap td:last-child {
    border-bottom: 0;
  }

  .admin-dashboard .action-cell {
    text-align: left;
  }

  .admin-dashboard .action-cell .btn-secondary {
    min-width: 0;
  }

  .admin-dashboard .table-wrap td::before {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .admin-dashboard [data-tab-panel="users"] td:nth-child(1)::before,
  .admin-dashboard [data-tab-panel="requests"] td:nth-child(1)::before,
  .admin-dashboard [data-tab-panel="exams"] td:nth-child(1)::before,
  .admin-dashboard [data-tab-panel="assignments"] td:nth-child(1)::before,
  .admin-dashboard [data-tab-panel="reports"] td:nth-child(1)::before {
    content: "Name";
  }

  .admin-dashboard [data-tab-panel="users"] td:nth-child(2)::before {
    content: "Email / Mobile";
  }

  .admin-dashboard [data-tab-panel="users"] td:nth-child(3)::before {
    content: "Role";
  }

  .admin-dashboard [data-tab-panel="users"] td:nth-child(4)::before,
  .admin-dashboard [data-tab-panel="requests"] td:nth-child(3)::before,
  .admin-dashboard [data-tab-panel="assignments"] td:nth-child(3)::before,
  .admin-dashboard [data-tab-panel="reports"] td:nth-child(5)::before {
    content: "Status";
  }

  .admin-dashboard [data-tab-panel="users"] td:nth-child(5)::before,
  .admin-dashboard [data-tab-panel="requests"] td:nth-child(7)::before,
  .admin-dashboard [data-tab-panel="exams"] td:nth-child(5)::before,
  .admin-dashboard [data-tab-panel="assignments"] td:nth-child(5)::before,
  .admin-dashboard [data-tab-panel="reports"] td:nth-child(8)::before {
    content: "Action";
  }

  .admin-dashboard [data-tab-panel="requests"] td:nth-child(2)::before {
    content: "Email / Phone";
  }

  .admin-dashboard [data-tab-panel="requests"] td:nth-child(4)::before {
    content: "Requested";
  }

  .admin-dashboard [data-tab-panel="requests"] td:nth-child(5)::before {
    content: "Login";
  }

  .admin-dashboard [data-tab-panel="requests"] td:nth-child(6)::before {
    content: "Email";
  }

  .admin-dashboard [data-tab-panel="exams"] td:nth-child(1)::before,
  .admin-dashboard [data-tab-panel="assignments"] td:nth-child(2)::before,
  .admin-dashboard [data-tab-panel="reports"] td:nth-child(2)::before {
    content: "Exam";
  }

  .admin-dashboard [data-tab-panel="exams"] td:nth-child(2)::before {
    content: "Config";
  }

  .admin-dashboard [data-tab-panel="exams"] td:nth-child(3)::before {
    content: "Questions";
  }

  .admin-dashboard [data-tab-panel="exams"] td:nth-child(4)::before {
    content: "Status";
  }

  .admin-dashboard [data-tab-panel="assignments"] td:nth-child(4)::before {
    content: "Attempts";
  }

  .admin-dashboard [data-tab-panel="reports"] td:nth-child(3)::before {
    content: "Attempt";
  }

  .admin-dashboard [data-tab-panel="reports"] td:nth-child(4)::before {
    content: "Score";
  }

  .admin-dashboard [data-tab-panel="reports"] td:nth-child(6)::before {
    content: "Submission";
  }

  .admin-dashboard [data-tab-panel="reports"] td:nth-child(7)::before {
    content: "Time";
  }

  .admin-dashboard .report-assignment-table td:nth-child(1)::before {
    content: "User";
  }

  .admin-dashboard .report-assignment-table td:nth-child(2)::before {
    content: "Exam";
  }

  .admin-dashboard .report-assignment-table td:nth-child(3)::before {
    content: "Window";
  }

  .admin-dashboard .report-assignment-table td:nth-child(4)::before {
    content: "Status";
  }

  .admin-dashboard .report-assignment-table td:nth-child(5)::before {
    content: "Attempts";
  }

  .admin-dashboard .report-assignment-table td:nth-child(6)::before {
    content: "Score";
  }

  .admin-dashboard .report-assignment-table td:nth-child(7)::before {
    content: "Submission";
  }

  .admin-dashboard .report-assignment-table td:nth-child(8)::before {
    content: "Action";
  }

  .admin-dashboard .table-wrap .pill {
    width: fit-content;
    max-width: 100%;
    white-space: normal;
  }

  .admin-dashboard details {
    margin-top: 10px;
  }

  .admin-dashboard details .compact-edit {
    margin-top: 10px;
  }

  .certificate-preview-frame {
    max-height: none;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .certificate-preview-frame .certificate-card {
    padding: 22px;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 10px 8px 26px;
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    width: 100%;
    margin-bottom: 18px;
    padding: 14px;
    border-radius: 22px;
    background:
      radial-gradient(circle at 10% 0%, rgba(214, 160, 6, 0.08), transparent 38%),
      rgba(255, 255, 255, 0.86);
  }

  .brand-lockup {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    width: 100%;
  }

  .brand-logo {
    width: 78px;
    max-height: 78px;
    padding: 6px;
    border-radius: 16px;
  }

  .brand-lockup span {
    gap: 6px;
  }

  .brand-lockup small {
    font-size: 0.78rem;
    line-height: 1.2;
    letter-spacing: 0.08em;
    overflow-wrap: anywhere;
  }

  .brand-lockup strong {
    font-size: 1.18rem;
    line-height: 1.12;
  }

  .nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    width: 100%;
  }

  .nav span {
    min-width: 0;
    font-size: 1rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .nav a {
    min-height: 48px;
    padding: 10px 16px;
    border-radius: 16px;
    white-space: nowrap;
  }

  .admin-dashboard .hero-toolbar,
  .user-dashboard .hero-toolbar {
    gap: 14px;
    padding: 4px 4px 0;
  }

  .admin-dashboard .eyebrow,
  .user-dashboard .eyebrow {
    font-size: 0.86rem;
    line-height: 1.25;
    letter-spacing: 0.16em;
  }

  .admin-dashboard .toolbar h1,
  .user-dashboard .toolbar h1,
  .admin-manage-exam .toolbar h1 {
    font-size: clamp(2.45rem, 10vw, 3.05rem);
    line-height: 0.98;
    letter-spacing: -0.03em;
  }

  .admin-dashboard .toolbar p,
  .user-dashboard .toolbar p {
    font-size: 1rem;
    line-height: 1.5;
  }

  .admin-dashboard .toolbar-actions .btn-secondary,
  .user-dashboard .toolbar-actions .btn-primary {
    min-height: 50px;
    border-radius: 18px;
  }

  .admin-dashboard .stats,
  .user-dashboard .stats,
  .user-dashboard .compact-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .admin-dashboard .stats > div,
  .user-dashboard .stats > div {
    min-height: 112px;
    padding: 16px;
    border-radius: 18px;
    background:
      radial-gradient(circle at 95% 10%, rgba(150, 44, 154, 0.08), transparent 38%),
      rgba(255, 255, 255, 0.82);
  }

  .admin-dashboard .stats span,
  .user-dashboard .stats span {
    font-size: 0.75rem;
    line-height: 1.2;
  }

  .admin-dashboard .stats strong,
  .user-dashboard .stats strong {
    font-size: clamp(2.15rem, 12vw, 3rem);
  }

  .admin-dashboard .tab-bar {
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.9);
  }

  .admin-dashboard .tab-button {
    min-height: 44px;
    padding: 9px 13px;
  }

  .admin-dashboard .section-panel,
  .admin-dashboard > .panel,
  .user-dashboard .section-panel,
  .user-dashboard > .panel,
  .admin-manage-exam .section-panel,
  .admin-manage-exam > .panel {
    padding: 16px;
    border-radius: 20px;
  }

  .admin-dashboard .section-head h2,
  .user-dashboard .section-head h2,
  .certificate-summary h2,
  .admin-manage-exam .section-head h2 {
    font-size: clamp(1.45rem, 7vw, 2rem);
  }

  .exam-module-item,
  .user-exam-table tr,
  .admin-dashboard .table-wrap tr {
    border-radius: 16px;
  }
}

@media (max-width: 380px) {
  .admin-dashboard .stats,
  .user-dashboard .stats,
  .user-dashboard .compact-stats {
    grid-template-columns: 1fr;
  }

  .brand-lockup {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .brand-logo {
    width: 68px;
  }
}

body:has(.admin-console) {
  background:
    radial-gradient(circle at 92% 4%, rgba(150, 44, 154, 0.11), transparent 26%),
    radial-gradient(circle at 12% 0%, rgba(214, 160, 6, 0.12), transparent 22%),
    #f8f7fb;
}

body:has(.admin-console) .app-shell {
  padding: 0;
}

body:has(.admin-console) > .app-shell > .topbar {
  display: none;
}

.admin-console {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  width: 100%;
  min-height: 100vh;
  margin: 0;
  color: #2f1d3f;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 16px;
  height: 100vh;
  padding: 18px 14px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: #ffffff;
  box-shadow: none;
}

.admin-sidebar-brand {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.admin-sidebar-brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
}

.admin-sidebar-brand span,
.admin-org-card {
  min-width: 0;
}

.admin-sidebar-brand small,
.admin-org-card span {
  display: block;
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  line-height: 1.25;
  text-transform: uppercase;
}

.admin-sidebar-brand strong {
  display: block;
  margin-top: 2px;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.admin-org-card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(125, 27, 129, 0.035);
}

.admin-org-card strong {
  display: block;
  margin-top: 6px;
  font-size: 0.95rem;
  font-weight: 800;
}

.admin-org-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.admin-side-nav.tab-bar {
  position: static;
  display: grid;
  align-content: start;
  width: 100%;
  min-height: 0;
  padding: 0 4px 0 0;
  overflow-y: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  scrollbar-width: thin;
}

.admin-side-nav.tab-bar::-webkit-scrollbar {
  width: 6px;
}

.admin-side-nav.tab-bar::-webkit-scrollbar-thumb {
  border-radius: 6px;
  background: rgba(92, 55, 111, 0.22);
}

.admin-side-nav .tab-button {
  justify-content: flex-start;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
}

.admin-side-nav .tab-button::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 10px;
  border-radius: 999px;
  background: rgba(125, 27, 129, 0.24);
}

.admin-side-nav .tab-button:hover {
  background: rgba(52, 29, 65, 0.04);
  color: var(--ink);
}

.admin-side-nav .tab-button.active {
  background: rgba(125, 27, 129, 0.09);
  color: var(--primary-strong);
  box-shadow: none;
  font-weight: 800;
}

.admin-side-nav .tab-button.active::before {
  background: var(--primary-strong);
}

.admin-sidebar-footer {
  display: grid;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid rgba(92, 55, 111, 0.12);
}

.admin-sidebar-footer span {
  color: var(--muted);
  font-weight: 900;
}

.admin-sidebar-footer a {
  display: inline-flex;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
}

.admin-sidebar-footer span {
  font-size: 0.8rem;
  font-weight: 700;
}

.admin-workspace {
  min-width: 0;
  padding: 18px clamp(18px, 2vw, 34px) 38px;
}

.admin-commandbar {
  position: sticky;
  top: 0;
  z-index: 22;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 70px;
  margin: -18px calc(clamp(18px, 2vw, 34px) * -1) 22px;
  padding: 14px clamp(18px, 2vw, 34px);
  border-bottom: 1px solid rgba(92, 55, 111, 0.1);
  background: rgba(248, 247, 251, 0.88);
  backdrop-filter: blur(18px);
}

.admin-search {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  width: min(430px, 100%);
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid rgba(92, 55, 111, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
}

.admin-search span {
  color: var(--primary-strong);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-search input {
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
}

.admin-search input::placeholder {
  color: var(--muted);
  font-weight: 600;
}

.admin-search input:focus {
  outline: none;
}

.admin-search:focus-within {
  border-color: rgba(150, 44, 154, 0.4);
  box-shadow: 0 0 0 3px rgba(150, 44, 154, 0.12);
}

.search-hidden {
  display: none !important;
}

.search-summary {
  display: none;
}

.is-searching .search-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 15px 20px;
  border: 1px solid rgba(150, 44, 154, 0.22);
  border-radius: 18px;
  background:
    radial-gradient(circle at right top, rgba(150, 44, 154, 0.12), transparent 52%),
    rgba(255, 255, 255, 0.85);
}

.search-summary strong {
  display: block;
  margin-top: 3px;
  font-size: 1.15rem;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.is-searching .admin-welcome,
.is-searching .admin-kpi-grid,
.is-searching .filters {
  display: none;
}

.is-searching .tab-panel {
  display: block;
}

.is-searching .tab-panel + .tab-panel {
  margin-top: 18px;
}

.is-searching .tab-panel.search-empty,
.is-searching .panel.search-empty,
.is-searching .report-tab-panel.search-empty,
.is-searching .report-tabs {
  display: none;
}

.is-searching .report-tab-panel {
  display: block;
}

.is-searching .admin-exams-layout,
.is-searching .grid-2 {
  grid-template-columns: 1fr;
}

.admin-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  flex: 0 0 auto;
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  line-height: 1.25;
}

.admin-clock strong {
  font-size: 1.06rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.admin-clock span {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.admin-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 0;
  margin-bottom: 18px;
  padding: 22px 26px;
  overflow: hidden;
  border-radius: 16px;
  color: #fff;
  background:
    radial-gradient(circle at 92% 12%, rgba(247, 210, 0, 0.18), transparent 30%),
    linear-gradient(135deg, #2c1738 0%, #4a2360 55%, #7b2783 100%);
  box-shadow: 0 4px 14px rgba(52, 29, 65, 0.12);
}

.admin-welcome h1 {
  margin: 4px 0 6px;
  color: #fff;
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.admin-welcome p {
  max-width: 720px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.95rem;
  line-height: 1.5;
}

.admin-welcome .eyebrow {
  color: #f2c84b;
  font-size: 0.72rem;
}

.admin-kpi-grid {
  margin-bottom: 20px;
}

.admin-kpi-grid > div {
  min-height: 100px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(52, 29, 65, 0.04);
}

.admin-kpi-grid strong {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.admin-kpi-grid span {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.admin-kpi-grid small {
  order: 3;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
}

.admin-console .section-panel,
.admin-console > .panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(52, 29, 65, 0.04);
}

.admin-console .tab-panel.active {
  animation: adminPanelIn 0.22s ease-out;
}

@keyframes adminPanelIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .admin-console {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    height: auto;
    overflow: visible;
    grid-template-columns: 1fr;
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid rgba(92, 55, 111, 0.12);
  }

  .admin-org-card {
    display: none;
  }

  .admin-sidebar-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
  }

  .admin-sidebar-footer span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }

  .admin-sidebar-footer a {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 8px 18px;
  }

  .admin-side-nav.tab-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .admin-side-nav .tab-button {
    flex: 0 0 auto;
    min-width: max-content;
  }

  .admin-workspace {
    padding: 16px;
  }

  .admin-commandbar {
    position: static;
    margin: 0 0 16px;
    padding: 0;
    border: 0;
    background: transparent;
    backdrop-filter: none;
  }
}

@media (max-width: 720px) {
  .admin-commandbar,
  .admin-welcome {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-search {
    width: 100%;
  }

  .admin-clock {
    align-items: flex-start;
  }

  .admin-welcome {
    min-height: 0;
    padding: 18px 20px;
    border-radius: 14px;
  }

  .admin-welcome h1 {
    font-size: clamp(1.3rem, 5vw, 1.7rem);
    line-height: 1.2;
  }

  .admin-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .admin-sidebar-brand {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .admin-sidebar-brand img {
    width: 58px;
    height: 58px;
  }

  .admin-kpi-grid {
    grid-template-columns: 1fr;
  }
}

body:has(.trainee-console) {
  background:
    radial-gradient(circle at 90% 6%, rgba(150, 44, 154, 0.11), transparent 28%),
    radial-gradient(circle at 10% 2%, rgba(214, 160, 6, 0.1), transparent 24%),
    #f9f6fb;
}

body:has(.trainee-console) > .app-shell {
  width: 100%;
  padding: 0;
}

body:has(.trainee-console) > .app-shell > .topbar {
  display: none;
}

.trainee-console {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: 100vh;
  color: var(--ink);
}

.trainee-sidebar {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 16px;
  height: 100vh;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: #ffffff;
  box-shadow: none;
}

.trainee-sidebar-brand {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.trainee-sidebar-brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
}

.trainee-sidebar-brand small,
.trainee-profile-card small,
.trainee-welcome-meta span,
.user-exam-meta span {
  color: var(--muted);
}

.trainee-sidebar-brand strong {
  display: block;
  margin-top: 2px;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.trainee-profile-card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(125, 27, 129, 0.035);
}

.trainee-profile-card strong,
.trainee-profile-card small {
  display: block;
}

.trainee-profile-card strong {
  margin: 6px 0 3px;
  font-size: 0.98rem;
  font-weight: 800;
}

.trainee-side-nav {
  display: grid;
  align-content: start;
  gap: 4px;
}

.trainee-side-nav a {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}

.trainee-side-nav a:hover {
  background: rgba(52, 29, 65, 0.04);
  color: var(--ink);
}

.trainee-side-nav a.active {
  background: rgba(125, 27, 129, 0.09);
  color: var(--primary-strong);
  font-weight: 800;
}

.trainee-sidebar-footer {
  display: grid;
  gap: 12px;
}

.trainee-sidebar-footer span {
  color: var(--muted);
  font-weight: 800;
}

.trainee-sidebar-footer .btn-secondary {
  width: 100%;
}

.trainee-workspace {
  min-width: 0;
  padding: clamp(18px, 3vw, 36px);
}

.trainee-commandbar {
  position: sticky;
  top: 0;
  z-index: 7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: calc(clamp(18px, 3vw, 36px) * -1) calc(clamp(18px, 3vw, 36px) * -1) 22px;
  padding: 14px clamp(18px, 3vw, 36px);
  border-bottom: 1px solid rgba(92, 55, 111, 0.1);
  background: rgba(255, 251, 255, 0.78);
  backdrop-filter: blur(18px);
}

.trainee-commandbar strong {
  display: block;
  margin-top: 2px;
  font-size: 1.15rem;
}

.trainee-command-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.trainee-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 0;
  margin-bottom: 18px;
  padding: 22px 26px;
  overflow: hidden;
  border-radius: 16px;
  color: #fff;
  background:
    radial-gradient(circle at 92% 12%, rgba(247, 210, 0, 0.18), transparent 30%),
    linear-gradient(135deg, #2c1738 0%, #4a2360 55%, #7b2783 100%);
  box-shadow: 0 4px 14px rgba(52, 29, 65, 0.12);
}

.trainee-welcome h1 {
  margin: 4px 0 6px;
  color: #fff;
  font-size: clamp(1.4rem, 2.4vw, 1.95rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.015em;
}

.trainee-welcome p {
  max-width: 720px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.95rem;
  line-height: 1.5;
}

.trainee-welcome .eyebrow {
  color: #f2c84b;
  font-size: 0.72rem;
}

.trainee-welcome-meta {
  width: min(100%, 240px);
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.trainee-welcome-meta span {
  display: block;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trainee-welcome-meta strong {
  display: block;
  margin-top: 6px;
  color: #fff;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.25;
}

.trainee-kpi-grid {
  margin-bottom: 20px;
}

.trainee-kpi-grid > div {
  min-height: 100px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(52, 29, 65, 0.04);
}

.trainee-kpi-grid strong {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.trainee-kpi-grid span {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.trainee-kpi-grid small {
  order: 3;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
}

.trainee-certificate-card,
.trainee-console .section-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(52, 29, 65, 0.04);
}

.user-exam-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.user-exam-card {
  display: grid;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(52, 29, 65, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.user-exam-card:hover {
  border-color: rgba(125, 27, 129, 0.2);
  box-shadow: 0 4px 12px rgba(52, 29, 65, 0.06);
}

.user-exam-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.user-exam-main h3 {
  margin: 4px 0 4px;
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.user-exam-main p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.user-exam-main .status-pill {
  flex: 0 0 auto;
}

.user-exam-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.user-exam-meta > div {
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(248, 247, 251, 0.6);
}

.user-exam-meta span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.user-exam-meta strong {
  display: block;
  color: var(--ink);
  font-size: 1.04rem;
  line-height: 1.25;
}

.user-exam-meta small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.user-exam-action {
  display: flex;
  justify-content: flex-end;
}

.user-exam-action .btn-primary,
.user-exam-action .btn-secondary {
  min-width: 180px;
}

.user-exam-card.empty-state {
  grid-column: 1 / -1;
  text-align: center;
}

@media (max-width: 1180px) {
  .trainee-console {
    grid-template-columns: 1fr;
  }

  .trainee-sidebar {
    position: static;
    height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    padding: 14px 16px;
    border-right: 0;
    border-bottom: 1px solid rgba(92, 55, 111, 0.12);
  }

  .trainee-profile-card,
  .trainee-sidebar-footer {
    display: none;
  }

  .trainee-side-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .trainee-side-nav a {
    flex: 0 0 auto;
    min-width: max-content;
  }

  .trainee-workspace {
    padding: 16px;
  }

  .trainee-commandbar {
    position: static;
    margin: 0 0 16px;
    padding: 0;
    border: 0;
    background: transparent;
    backdrop-filter: none;
  }
}

@media (max-width: 860px) {
  .user-exam-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .trainee-commandbar,
  .trainee-welcome,
  .certificate-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .trainee-command-actions,
  .trainee-command-actions .btn-primary,
  .trainee-command-actions .btn-secondary,
  .certificate-summary-actions,
  .certificate-summary-actions .btn-primary,
  .certificate-summary-actions .btn-secondary {
    width: 100%;
  }

  .trainee-welcome {
    min-height: 0;
    padding: 18px 20px;
    border-radius: 14px;
  }

  .trainee-welcome h1 {
    font-size: clamp(1.4rem, 5.5vw, 1.95rem);
    line-height: 1.2;
  }

  .trainee-welcome-meta {
    width: 100%;
  }

  .trainee-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .user-exam-main,
  .user-exam-action {
    align-items: stretch;
    flex-direction: column;
  }

  .user-exam-main .status-pill,
  .user-exam-action .btn-primary,
  .user-exam-action .btn-secondary {
    width: 100%;
  }
}

@media (max-width: 460px) {
  .trainee-sidebar-brand {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .trainee-sidebar-brand img {
    width: 58px;
    height: 58px;
  }

  .trainee-kpi-grid,
  .user-exam-meta {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #fff;
  }

  .topbar,
  .flash,
  .certificate-toolbar,
  .nav {
    display: none !important;
  }

  .app-shell,
  .certificate-download-body {
    padding: 0;
  }

  .certificate-page,
  .standalone-certificate {
    width: 100%;
    margin: 0;
  }

  .certificate-card {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    break-inside: avoid;
  }
}

/* Landing page */
.landing {
  width: min(1200px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 26px;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 32px;
  align-items: center;
  padding: clamp(28px, 4vw, 52px);
  border-radius: 28px;
  background:
    radial-gradient(circle at 14% 16%, rgba(196, 92, 200, 0.32), transparent 46%),
    linear-gradient(135deg, #3a1b4d, #5c376f);
  color: #fff;
  box-shadow: 0 30px 64px rgba(60, 25, 80, 0.3);
}

.landing-hero-text .eyebrow {
  color: #f1c9ff;
}

.landing-hero-text h1 {
  margin: 12px 0 14px;
  font-size: clamp(2rem, 3.6vw, 3rem);
  line-height: 1.07;
  color: #fff;
}

.landing-hero-text p {
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1.04rem;
  line-height: 1.6;
}

.landing-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.landing-ghost-btn {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.landing-hero-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.landing-point {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.09);
}

.landing-point strong {
  display: block;
  margin-bottom: 5px;
  color: #fff;
  font-size: 0.98rem;
}

.landing-point span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.85rem;
  line-height: 1.45;
}

.landing-auth {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  align-items: start;
}

.landing-auth-block {
  padding: clamp(22px, 2.6vw, 32px);
  border: 1px solid rgba(92, 55, 111, 0.14);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 42px rgba(93, 41, 110, 0.1);
}

.register-block {
  border-color: rgba(160, 113, 22, 0.26);
  background:
    radial-gradient(circle at right top, var(--accent-soft), transparent 56%),
    rgba(255, 255, 255, 0.92);
}

.landing-auth-head {
  margin-bottom: 18px;
}

.landing-auth-head h2 {
  margin: 10px 0 6px;
  font-size: 1.5rem;
}

.landing-auth-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label,
.auth-narrow-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.9rem;
}

.auth-form-note {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.auth-back-link {
  justify-self: start;
  color: var(--primary-strong);
  font-weight: 800;
  font-size: 0.9rem;
  text-decoration: none;
}

.auth-back-link:hover {
  text-decoration: underline;
}

.auth-narrow-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
}

.auth-narrow {
  width: min(480px, 100%);
  margin: 0 auto;
}

.auth-narrow-card {
  display: grid;
  gap: 14px;
  padding: clamp(24px, 4vw, 36px);
}

.auth-narrow-card h1 {
  margin: 6px 0 0;
  font-size: 1.55rem;
  line-height: 1.16;
}

.auth-narrow-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.user-account-panel .change-password-form {
  max-width: 640px;
}

.password-pair {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 880px) {
  .landing-hero,
  .landing-auth {
    grid-template-columns: 1fr;
  }

  .password-pair {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .landing-hero-points {
    grid-template-columns: 1fr;
  }

  .landing-hero-actions .btn-primary,
  .landing-hero-actions .btn-secondary {
    flex: 1 1 100%;
  }
}

/* Site footer */
.site-footer {
  width: min(1200px, 100%);
  margin: 36px auto 0;
  padding: 32px clamp(20px, 3vw, 40px) 22px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 12% 14%, rgba(196, 92, 200, 0.28), transparent 44%),
    linear-gradient(135deg, #3a1b4d, #5c376f);
  color: rgba(255, 255, 255, 0.82);
}

.site-footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.site-footer-brand img {
  display: block;
  width: 116px;
  height: auto;
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #fff;
}

.site-footer-brand p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.74);
}

.site-footer-col h4 {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-footer-col a,
.site-footer-address {
  display: block;
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.92rem;
  line-height: 1.55;
}

.site-footer-col a:hover {
  color: #fff;
  text-decoration: underline;
}

.site-footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.site-footer-social a {
  margin: 0;
  padding: 6px 13px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
}

.site-footer-social a:hover {
  border-color: var(--accent);
  background: rgba(192, 136, 30, 0.22);
  text-decoration: none;
}

.site-footer-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  padding-top: 18px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.68);
}

.site-footer-credit a {
  color: var(--accent);
  font-weight: 800;
}

.site-footer-credit a:hover {
  text-decoration: underline;
}

@media (max-width: 760px) {
  .site-footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 460px) {
  .site-footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Assignments: grouped, collapsible, filterable
   ============================================================ */
.assignments-panel .assignments-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin: 4px 0 16px;
  padding: 14px 16px;
  background: rgba(243, 233, 250, 0.55);
  border: 1px solid rgba(120, 70, 152, 0.12);
  border-radius: 12px;
}

.assign-filter {
  display: grid;
  gap: 4px;
  min-width: 180px;
  flex: 1 1 200px;
}

.assign-filter > span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.assign-filter select,
.assign-filter input {
  padding: 9px 10px;
  font-size: 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(120, 70, 152, 0.18);
}

.assign-filter-search {
  flex: 2 1 260px;
}

.assignments-toolbar .link-btn {
  align-self: flex-end;
  padding: 9px 12px;
  border: 1px solid rgba(120, 70, 152, 0.18);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.assign-counter {
  margin-left: auto;
  align-self: center;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.assignment-groups {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  align-items: start;
}

.assignment-group[open] {
  grid-column: 1 / -1;
}

@media (max-width: 720px) {
  .assignment-groups {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 360px) {
  .assignment-groups {
    grid-template-columns: 1fr;
  }
}

.assignment-group {
  border: 1px solid rgba(120, 70, 152, 0.14);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.assignment-group[open] {
  border-color: rgba(120, 70, 152, 0.3);
  box-shadow: 0 4px 18px rgba(93, 41, 110, 0.07);
}

.assignment-group.ag-hidden {
  display: none;
}

.ag-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px 12px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.ag-summary .ag-counts {
  grid-column: 1 / -1;
}

.ag-summary::-webkit-details-marker {
  display: none;
}

.ag-summary:hover {
  background: rgba(243, 233, 250, 0.45);
}

.ag-caret {
  width: 14px;
  height: 14px;
  display: inline-block;
  position: relative;
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

.ag-caret::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 4px;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
}

.assignment-group[open] .ag-caret {
  transform: rotate(90deg);
}

.ag-user {
  display: grid;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}

.ag-user strong {
  font-size: 15px;
  color: var(--ink);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ag-user small {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ag-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.ag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(243, 233, 250, 0.7);
  color: var(--ink);
  border: 1px solid rgba(120, 70, 152, 0.12);
}

.ag-pill-total {
  background: rgba(120, 70, 152, 0.08);
  color: var(--ink);
}

.ag-pill-passed {
  background: rgba(40, 160, 100, 0.12);
  border-color: rgba(40, 160, 100, 0.28);
  color: #1f6b46;
}

.ag-pill-progress {
  background: rgba(255, 184, 28, 0.16);
  border-color: rgba(220, 145, 0, 0.32);
  color: #8a5a00;
}

.ag-pill-pending {
  background: rgba(120, 70, 152, 0.08);
  border-color: rgba(120, 70, 152, 0.18);
  color: var(--muted);
}

.ag-pill-failed {
  background: rgba(212, 60, 80, 0.1);
  border-color: rgba(212, 60, 80, 0.28);
  color: #a3304d;
}

.ag-body {
  border-top: 1px solid rgba(120, 70, 152, 0.1);
  padding: 0 16px 12px;
  background: rgba(252, 248, 254, 0.5);
}

.ag-table {
  width: 100%;
  min-width: 0;
  margin-top: 6px;
  display: block;
}

.ag-table thead {
  display: none;
}

.ag-table tbody {
  display: block;
  width: 100%;
}

.ag-table tbody tr {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 6px 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(120, 70, 152, 0.08);
}

.ag-table tbody tr:last-child {
  border-bottom: 0;
}

.ag-table tbody td {
  padding: 0;
  font-size: 14px;
  border: 0;
  display: flex;
  align-items: center;
  min-width: 0;
}

.ag-table tbody td:nth-child(1) {
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.ag-table tbody td:nth-child(3) {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 13px;
}

.ag-table tbody tr.ag-hidden {
  display: none;
}

.ag-table .pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(120, 70, 152, 0.08);
}

.ag-table .pill-passed {
  background: rgba(40, 160, 100, 0.12);
  color: #1f6b46;
}

.ag-table .pill-in_progress {
  background: rgba(255, 184, 28, 0.16);
  color: #8a5a00;
}

.ag-table .pill-not_started {
  background: rgba(120, 70, 152, 0.08);
  color: var(--muted);
}

.ag-table .pill-failed {
  background: rgba(212, 60, 80, 0.1);
  color: #a3304d;
}

.ag-table form {
  margin: 0;
}

.ag-table .link-btn.danger {
  color: #a3304d;
  background: transparent;
  border: 1px solid rgba(212, 60, 80, 0.3);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.ag-table .link-btn.danger:hover {
  background: rgba(212, 60, 80, 0.08);
}

@media (max-width: 720px) {
  .ag-summary {
    padding: 10px 12px;
    gap: 8px;
  }
  .ag-counts {
    width: 100%;
    gap: 4px;
  }
  .ag-pill {
    font-size: 10.5px;
    padding: 2px 7px;
  }
  .ag-user strong {
    font-size: 14px;
  }
  .ag-user small {
    font-size: 11px;
  }
  .ag-table tbody tr {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 10px;
  }
  .ag-table tbody td:nth-child(1) {
    grid-column: 1 / -1;
  }
  .ag-table tbody td:nth-child(2),
  .ag-table tbody td:nth-child(3),
  .ag-table tbody td:nth-child(4) {
    justify-self: start;
  }
  .assign-counter {
    margin-left: 0;
  }
}

/* ============================================================
   Exam Modules: sort + filter toolbar
   ============================================================ */
.exam-modules-card .exam-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin: 4px 0 14px;
  padding: 14px 16px;
  background: rgba(243, 233, 250, 0.55);
  border: 1px solid rgba(120, 70, 152, 0.12);
  border-radius: 12px;
}

.exam-filter {
  display: grid;
  gap: 4px;
  min-width: 160px;
  flex: 1 1 180px;
}

.exam-filter > span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.exam-filter select,
.exam-filter input {
  padding: 9px 10px;
  font-size: 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(120, 70, 152, 0.18);
}

.exam-filter-search {
  flex: 2 1 240px;
}

.exam-toolbar .link-btn {
  align-self: flex-end;
  padding: 9px 12px;
  border: 1px solid rgba(120, 70, 152, 0.18);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.exam-counter {
  margin-left: auto;
  align-self: center;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.exam-module-item.exam-hidden {
  display: none;
}

@media (max-width: 720px) {
  .exam-counter {
    margin-left: 0;
  }
}

/* ============================================================
   Users panel: toolbar + collapsible user cards + Add User modal
   ============================================================ */
.users-panel .section-head .row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.users-panel .users-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin: 4px 0 16px;
  padding: 14px 16px;
  background: rgba(243, 233, 250, 0.55);
  border: 1px solid rgba(120, 70, 152, 0.12);
  border-radius: 12px;
}

.users-filter {
  display: grid;
  gap: 4px;
  min-width: 140px;
  flex: 1 1 160px;
}

.users-filter > span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.users-filter select,
.users-filter input {
  padding: 9px 10px;
  font-size: 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(120, 70, 152, 0.18);
}

.users-filter-search {
  flex: 2 1 220px;
}

.users-toolbar .link-btn {
  align-self: flex-end;
  padding: 9px 12px;
  border: 1px solid rgba(120, 70, 152, 0.18);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.users-counter {
  margin-left: auto;
  align-self: center;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.user-cards {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  grid-auto-flow: dense;
  align-items: start;
}

@media (min-width: 720px) {
  .user-cards { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1100px) {
  .user-cards { grid-template-columns: 1fr 1fr 1fr; }
}

.user-card {
  border: 1px solid rgba(120, 70, 152, 0.14);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  max-width: none;
}

.user-card[open] {
  grid-column: 1 / -1;
  border-color: rgba(120, 70, 152, 0.3);
  box-shadow: 0 4px 18px rgba(93, 41, 110, 0.07);
}

.user-card.user-hidden {
  display: none;
}

.user-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.user-summary .user-avatar { flex: 0 0 auto; }

.user-summary .user-main { flex: 1 1 160px; min-width: 0; }

.user-summary .user-tags { flex: 0 0 auto; }

.user-summary .user-progress { flex: 1 1 100%; margin-left: 0; justify-content: flex-start; }

.user-summary::-webkit-details-marker {
  display: none;
}

.user-summary:hover {
  background: rgba(243, 233, 250, 0.4);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(120, 70, 152, 0.25), rgba(180, 130, 60, 0.18));
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  border: 1px solid rgba(120, 70, 152, 0.18);
  flex-shrink: 0;
}

.user-main {
  display: grid;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}

.user-main strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-main small {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.user-tags .pill {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.pill-role-admin {
  background: rgba(180, 130, 60, 0.12);
  border-color: rgba(180, 130, 60, 0.3);
  color: #7a4f12;
}

.pill-role-user {
  background: rgba(120, 70, 152, 0.08);
  border-color: rgba(120, 70, 152, 0.2);
  color: var(--ink);
}

.pill-status-active {
  background: rgba(40, 160, 100, 0.12);
  border-color: rgba(40, 160, 100, 0.28);
  color: #1f6b46;
}

.pill-status-inactive {
  background: rgba(212, 60, 80, 0.1);
  border-color: rgba(212, 60, 80, 0.28);
  color: #a3304d;
}

.user-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
  max-width: 100%;
}

.user-progress-empty {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

.up-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(120, 70, 152, 0.06);
  border: 1px solid rgba(120, 70, 152, 0.12);
  color: var(--ink);
  white-space: nowrap;
}

.up-total {
  background: rgba(120, 70, 152, 0.1);
}

.up-passed {
  background: rgba(40, 160, 100, 0.12);
  border-color: rgba(40, 160, 100, 0.24);
  color: #1f6b46;
}

.up-progress {
  background: rgba(255, 184, 28, 0.18);
  border-color: rgba(220, 145, 0, 0.32);
  color: #8a5a00;
}

.up-pending {
  background: rgba(120, 70, 152, 0.06);
  border-color: rgba(120, 70, 152, 0.16);
  color: var(--muted);
}

.up-failed {
  background: rgba(212, 60, 80, 0.1);
  border-color: rgba(212, 60, 80, 0.24);
  color: #a3304d;
}

.user-body {
  border-top: 1px solid rgba(120, 70, 152, 0.1);
  padding: 14px 16px 16px;
  background: rgba(252, 248, 254, 0.5);
}

.user-body-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.user-body .compact-edit {
  display: grid;
  gap: 10px;
}

.user-body .compact-edit label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.user-body .compact-edit input,
.user-body .compact-edit select {
  font-weight: 400;
  font-size: 14px;
  padding: 9px 10px;
}

.user-edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.user-side {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 12px;
  background: #fff;
  border: 1px solid rgba(120, 70, 152, 0.12);
  border-radius: 10px;
}

.user-side-form .btn-secondary {
  width: 100%;
}

.user-meta {
  font-size: 12px;
  display: grid;
  gap: 2px;
  margin: 0;
}

.user-meta span {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: var(--muted);
}

.user-meta strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

@media (max-width: 900px) {
  .user-summary .user-progress {
    margin-left: 0;
  }
  .user-body-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .users-counter {
    margin-left: 0;
    width: 100%;
  }
}

/* Add User dialog */
.cv-dialog {
  border: none;
  border-radius: 14px;
  padding: 28px 28px 24px;
  width: min(440px, 92vw);
  background: #fff;
  box-shadow: 0 20px 60px rgba(40, 8, 50, 0.25);
  color: var(--ink);
}

.cv-dialog::backdrop {
  background: rgba(40, 8, 50, 0.35);
  backdrop-filter: blur(2px);
}

.cv-dialog h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 800;
}

.cv-dialog .cv-dialog-sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.cv-dialog-close-form {
  margin: 0;
  display: flex;
  justify-content: flex-end;
}

.cv-dialog-close {
  background: transparent;
  border: 0;
  font-size: 28px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0 4px;
  margin: -8px -8px 0 0;
}

.cv-dialog-close:hover {
  color: var(--ink);
}

.cv-dialog-form {
  display: grid;
  gap: 12px;
}

.cv-dialog-form label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cv-dialog-form input,
.cv-dialog-form select {
  font-weight: 400;
  font-size: 14px;
  padding: 10px 12px;
}

.cv-dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 6px;
}

/* ============================================================
   Danger zone (delete-exam) panel
   ============================================================ */
.danger-zone {
  border: 1px solid rgba(212, 60, 80, 0.35);
  background: linear-gradient(180deg, rgba(212, 60, 80, 0.04), rgba(212, 60, 80, 0.01));
}

.danger-zone .section-head h2 {
  color: #a3304d;
}

.danger-zone .section-head p {
  color: #7a3142;
}

.danger-zone-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 6px 0 16px;
}

.danger-zone-stats > div {
  background: #fff;
  border: 1px solid rgba(212, 60, 80, 0.18);
  border-radius: 10px;
  padding: 10px 12px;
  display: grid;
  gap: 2px;
}

.danger-zone-stats span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #a3304d;
}

.danger-zone-stats strong {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
}

.btn-danger {
  background: #a3304d;
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 11px 22px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(212, 60, 80, 0.25);
}

.btn-danger:hover {
  background: #872840;
}

@media (max-width: 560px) {
  .danger-zone-stats {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Trainee — blinking dot on Current Exam + certificate progress
   ============================================================ */
.trainee-current-exam-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav-pulse {
  position: relative;
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: navPulse 1.6s ease-out infinite;
  flex-shrink: 0;
}

.nav-pulse::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid rgba(34, 197, 94, 0.5);
  animation: navPulseRing 1.6s ease-out infinite;
}

@keyframes navPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
    transform: scale(1.08);
  }
}

@keyframes navPulseRing {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-pulse,
  .nav-pulse::after {
    animation: none;
  }
}

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

.trainee-certificate-card {
  display: grid;
  gap: 18px;
}

.trainee-certificate-card .cert-progress-head h2 {
  margin: 4px 0 6px;
}

.trainee-certificate-card .cert-progress-head p {
  margin: 0;
  color: var(--muted);
}

.cert-progress-meter {
  display: grid;
  gap: 10px;
}

.cert-progress-bar {
  position: relative;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(120, 70, 152, 0.1);
  overflow: hidden;
  border: 1px solid rgba(120, 70, 152, 0.12);
}

.cert-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(120, 70, 152, 0.85), rgba(34, 197, 94, 0.9));
  transition: width 0.4s ease;
}

.cert-progress-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
}

.cert-stat {
  font-size: 13px;
  color: var(--muted);
}

.cert-stat strong {
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
  margin-right: 4px;
}

.cert-stat-passed strong {
  color: #1f6b46;
}

.cert-stat-remaining strong {
  color: #a3304d;
}

.cert-remaining-list {
  background: rgba(252, 248, 254, 0.6);
  border: 1px solid rgba(120, 70, 152, 0.1);
  border-radius: 12px;
  padding: 12px 14px;
}

.cert-remaining-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.cert-remaining-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.cert-remaining-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(120, 70, 152, 0.1);
}

.cert-remaining-list li:last-child {
  border-bottom: 0;
}

.cert-rmod {
  font-size: 14px;
  color: var(--ink);
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cert-rstatus {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
}

.cert-rstatus-pending {
  background: rgba(120, 70, 152, 0.08);
  border-color: rgba(120, 70, 152, 0.18);
  color: var(--muted);
}

.cert-rstatus-progress {
  background: rgba(255, 184, 28, 0.16);
  border-color: rgba(220, 145, 0, 0.32);
  color: #8a5a00;
}

.cert-rstatus-failed {
  background: rgba(212, 60, 80, 0.1);
  border-color: rgba(212, 60, 80, 0.28);
  color: #a3304d;
}

.cert-rmod-more {
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
}

/* ============================================================
   Match the Following — trainee exam grid + admin pair listing
   ============================================================ */
.match-grid {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.match-headrow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 14px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid rgba(120, 70, 152, 0.18);
}

.match-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(120, 70, 152, 0.14);
  border-radius: 12px;
}

.match-left {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  line-height: 1.35;
}

.match-right select {
  width: 100%;
  font-size: 14px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid rgba(120, 70, 152, 0.2);
  border-radius: 9px;
  color: var(--ink);
  font-weight: 500;
}

.match-right select:focus {
  outline: 2px solid rgba(120, 70, 152, 0.35);
  outline-offset: 1px;
}

@media (max-width: 560px) {
  .match-headrow,
  .match-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .match-headrow > span:nth-child(2),
  .match-left,
  .match-right select {
    width: 100%;
  }
}

/* Admin: pair list display */
.question-options .match-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.1fr);
  gap: 10px;
  align-items: center;
  background: rgba(40, 160, 100, 0.06);
  border-color: rgba(40, 160, 100, 0.2);
}

.match-pair-arrow {
  color: var(--muted);
  font-size: 13px;
}

.match-pair-left {
  font-weight: 600;
}

.match-pair-right {
  color: #1f6b46;
  font-weight: 500;
}

/* ============================================================
   Study Material — admin panel + trainee library
   ============================================================ */
.study-admin-panel {
  display: grid;
  gap: 18px;
}

.study-upload-form {
  background: rgba(243, 233, 250, 0.45);
  border: 1px solid rgba(120, 70, 152, 0.14);
  border-radius: 12px;
  padding: 16px 18px;
  display: grid;
  gap: 12px;
}

.study-upload-form label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.study-upload-form input,
.study-upload-form textarea {
  font-size: 14px;
  font-weight: 400;
  padding: 10px 12px;
}

.study-admin-list {
  display: grid;
  gap: 10px;
}

.study-admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid rgba(120, 70, 152, 0.14);
  border-radius: 12px;
}

.study-admin-row.is-hidden {
  background: rgba(245, 245, 245, 0.6);
  opacity: 0.7;
}

.study-admin-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.study-admin-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.study-admin-title strong {
  font-size: 15px;
  color: var(--ink);
}

.study-admin-meta p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.study-admin-meta small {
  font-size: 12px;
  color: var(--muted);
}

.study-admin-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.study-admin-actions form {
  margin: 0;
}

@media (max-width: 720px) {
  .study-admin-row {
    grid-template-columns: 1fr;
  }
  .study-admin-actions {
    width: 100%;
  }
}

/* Trainee-side library */
.study-library {
  background: linear-gradient(180deg, rgba(243, 233, 250, 0.35), rgba(255, 255, 255, 0.4));
}

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

.study-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  padding: 16px;
  background: #fff;
  border: 1px solid rgba(120, 70, 152, 0.14);
  border-radius: 14px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.study-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(93, 41, 110, 0.08);
}

.study-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.study-file-badge {
  display: inline-block;
  background: #d4143c;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 4px;
}

.study-card-size {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.study-card-body h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
}

.study-card-body p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.study-card-cta {
  text-align: center;
  text-decoration: none;
  font-size: 14px;
  padding: 9px 14px;
}

/* ============================================================
   Certificate redesign — matches the reference template
   (pink/purple watercolor background, logo TR, centered content)
   ============================================================ */
.cryo-cert {
  position: relative;
  display: block;
  width: min(100%, 1100px);
  aspect-ratio: 1.414 / 1;        /* A4 landscape */
  margin: 0 auto;
  padding: clamp(36px, 5vw, 64px) clamp(48px, 7vw, 90px);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  color: #2a0f3a;
  box-shadow: 0 30px 80px rgba(82, 24, 113, 0.18);
  isolation: isolate;
}

.cryo-cert-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 55% 45% at 22% 28%, rgba(232, 178, 220, 0.85), transparent 70%),
    radial-gradient(ellipse 60% 40% at 78% 35%, rgba(212, 145, 198, 0.65), transparent 70%),
    radial-gradient(ellipse 45% 55% at 30% 80%, rgba(192, 138, 200, 0.55), transparent 70%),
    radial-gradient(ellipse 50% 50% at 80% 85%, rgba(241, 198, 220, 0.6), transparent 70%),
    linear-gradient(135deg, #f8e8f2 0%, #f1dcec 40%, #ede0ec 70%, #f6e9f1 100%);
  filter: saturate(1.05);
}

.cryo-cert-bg::after {
  /* Subtle grain so the gradient feels painterly, not flat */
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.18;
  mix-blend-mode: overlay;
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.4) 1px, transparent 0);
  background-size: 5px 5px;
}

.cryo-cert-watermark {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(80px, 14vw, 180px);
  font-weight: 900;
  letter-spacing: 0.08em;
  color: rgba(82, 24, 113, 0.04);
  pointer-events: none;
  text-transform: uppercase;
}

.cryo-cert-logo {
  position: absolute;
  top: clamp(18px, 2.5vw, 30px);
  right: clamp(20px, 3vw, 36px);
  z-index: 3;
  height: clamp(48px, 6vw, 78px);
  width: auto;
}

.cryo-cert-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  display: grid;
  gap: 16px;
  padding-top: clamp(70px, 9vw, 110px); /* reserve space below the logo so title never overlaps */
}

.cryo-cert-title {
  margin: 0;
  font-size: clamp(22px, 3.4vw, 44px);
  font-weight: 900;
  letter-spacing: 0.03em;
  color: #2a0f3a;
  line-height: 1.1;
  font-family: "Times New Roman", "Georgia", serif;
  white-space: nowrap;
}

/* Narrow container fallback: allow wrap, but keep clear of logo via the inner padding-top above */
@container (max-width: 600px) {
  .cryo-cert-title {
    white-space: normal;
    font-size: clamp(20px, 5vw, 32px);
  }
}

.cryo-cert {
  container-type: inline-size;
}

.cryo-cert-lede {
  margin: 6px 0 0;
  font-size: clamp(14px, 1.5vw, 18px);
  color: rgba(42, 15, 58, 0.78);
  font-style: italic;
}

.cryo-cert-name {
  margin: 12px 0;
  font-size: clamp(28px, 4.2vw, 48px);
  font-weight: 800;
  color: #2a0f3a;
  letter-spacing: 0.01em;
  border-bottom: 1.5px solid rgba(42, 15, 58, 0.35);
  padding-bottom: 14px;
  max-width: 80%;
  margin-inline: auto;
  width: fit-content;
  font-family: "Times New Roman", "Georgia", serif;
}

.cryo-cert-body {
  margin: 0;
  font-size: clamp(13px, 1.4vw, 17px);
  line-height: 1.65;
  color: rgba(42, 15, 58, 0.88);
  max-width: 78%;
  margin-inline: auto;
}

.cryo-cert-body strong {
  color: #2a0f3a;
  font-weight: 700;
}

.cryo-cert-wish {
  margin: 16px 0 0;
  font-size: clamp(13px, 1.4vw, 17px);
  font-style: italic;
  color: rgba(42, 15, 58, 0.85);
}

.cryo-cert-footer {
  position: absolute;
  left: clamp(48px, 7vw, 90px);
  right: clamp(48px, 7vw, 90px);
  bottom: clamp(36px, 4vw, 56px);
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: end;
}

.cryo-cert-signblock {
  display: grid;
  gap: 4px;
  text-align: left;
}

.cryo-cert-signblock-right {
  text-align: right;
  justify-items: end;
}

.cryo-cert-signimage {
  max-height: 52px;
  max-width: 180px;
  object-fit: contain;
  margin-bottom: 2px;
}

.cryo-cert-signline {
  width: 100%;
  max-width: 220px;
  height: 1px;
  background: rgba(42, 15, 58, 0.55);
  margin-bottom: 4px;
}

.cryo-cert-signlabel {
  font-size: clamp(11px, 1vw, 13px);
  font-weight: 700;
  color: #2a0f3a;
  letter-spacing: 0.05em;
}

.cryo-cert-signvalue {
  font-size: clamp(12px, 1.1vw, 14px);
  color: rgba(42, 15, 58, 0.78);
  font-weight: 500;
}

/* Standalone (download) page */
.certificate-download-body {
  margin: 0;
  padding: 0;
  background: #f5e9f3;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.standalone-certificate {
  padding: 0;
  max-width: none;
}

.standalone-certificate .cryo-cert {
  margin: clamp(20px, 4vw, 60px);
  box-shadow: 0 40px 90px rgba(82, 24, 113, 0.25);
}

.cert-preview-body {
  background: #f5e9f3;
  display: block;
}

.cert-preview-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  background: #fff;
  border-bottom: 1px solid rgba(120, 70, 152, 0.18);
  box-shadow: 0 4px 12px rgba(82, 24, 113, 0.05);
}

.cert-preview-bar strong {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}

.cert-preview-bar span {
  color: var(--muted);
  font-size: 13px;
  flex: 1 1 240px;
  min-width: 0;
}

.cert-preview-bar .btn-primary,
.cert-preview-bar .btn-secondary {
  padding: 8px 16px;
  font-size: 13px;
}

.cert-preview-body .certificate-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 80px);
  padding: 32px;
}

.certificate-designer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.certificate-designer-actions .btn-secondary {
  text-decoration: none;
}

@media print {
  .cert-preview-bar {
    display: none !important;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 0;
  }
  body, html {
    background: #fff !important;
  }
  .toolbar, .certificate-toolbar, header.topbar, footer.site-footer, nav, .admin-sidebar, .trainee-sidebar {
    display: none !important;
  }
  .cryo-cert {
    box-shadow: none !important;
    border-radius: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    aspect-ratio: auto !important;
    margin: 0 !important;
    page-break-after: always;
  }
}

@media (max-width: 720px) {
  .cryo-cert {
    aspect-ratio: auto;
    padding: 28px 22px;
  }
  .cryo-cert-footer {
    position: static;
    margin-top: 28px;
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .cryo-cert-signblock-right {
    text-align: left;
    justify-items: start;
  }
  .cryo-cert-name,
  .cryo-cert-body {
    max-width: 100%;
  }
}
