@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;600;700;800&family=Roboto:wght@400;500;700&display=swap');

:root {
  --navy: #0d2352;
  --navy-2: #113072;
  --blue: #1868dd;
  --blue-dark: #0056a7;
  --blue-light: #eaf1fd;
  --gray-bg: #f4f4f4;
  --gray-text: #5a5a5a;
  --gray-border: #e3e5ea;
  --white: #ffffff;
  --success: #1e9e5a;
  --success-light: #e7f7ee;
  --danger: #d64545;
  --danger-light: #fdecec;
  --gold: #c9a24b;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(13, 35, 82, 0.08);
  --shadow-lg: 0 12px 40px rgba(13, 35, 82, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Rubik', 'Roboto', sans-serif;
  background: var(--gray-bg);
  color: var(--gray-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

h1,
h2,
h3,
h4 {
  color: var(--navy);
  font-weight: 700;
  margin: 0 0 0.5em;
}

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

img {
  max-width: 100%;
}

/* Layout */
.topbar {
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.75rem;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.2px;
}

.topbar__brand img {
  height: 32px;
  width: auto;
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  font-size: 0.92rem;
}

.topbar__nav a,
.topbar__nav button {
  color: rgba(255, 255, 255, 0.85);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem 0;
  transition: color 0.15s;
}

.topbar__nav a.active,
.topbar__nav a:hover,
.topbar__nav button:hover {
  color: #fff;
}

.topbar__user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.88rem;
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78rem;
}

main {
  flex: 1;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 2rem 2.5rem 4rem;
}

@media (max-width: 900px) {
  main {
    padding: 1.5rem 1.25rem 3rem;
  }
}

.page-header--center {
  text-align: left;
}

.stat-grid--center {
  max-width: none;
}

.footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8rem;
  color: #9aa0ab;
}

/* Auth pages */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 45%, var(--blue) 130%);
  padding: 1.5rem;
}

.auth-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 2.4rem 2.2rem;
  width: 100%;
  max-width: 420px;
}

.auth-card__logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.6rem;
  text-align: center;
}

.auth-card__logo img {
  height: 56px;
}

.auth-card__logo span {
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--navy);
}

.auth-card h1 {
  font-size: 1.4rem;
  margin-bottom: 0.3rem;
}

.auth-card p.subtitle {
  margin: 0 0 1.6rem;
  font-size: 0.9rem;
}

.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.35rem;
}

.field input {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1.5px solid var(--gray-border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  transition: border-color 0.15s;
}

.field input:focus {
  outline: none;
  border-color: var(--blue);
}

.field-row {
  display: flex;
  gap: 0.8rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1.5rem;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, background 0.15s;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 6px 18px rgba(24, 104, 221, 0.35);
}

.btn-primary:hover {
  background: var(--blue-dark);
}

.btn-block {
  width: 100%;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--blue);
  color: var(--blue);
}

.btn-outline:hover {
  background: var(--blue-light);
}

.btn-danger-outline {
  background: transparent;
  border: 1.5px solid var(--danger, #d92d20);
  color: var(--danger, #d92d20);
}

.btn-danger-outline:hover {
  background: rgba(217, 45, 32, 0.08);
}

.cat-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.9rem; }
.cat-chip { display: inline-flex; align-items: center; gap: 0.4rem; background: var(--blue-light); color: var(--navy); border-radius: 999px; padding: 0.35rem 0.85rem; font-size: 0.85rem; font-weight: 600; }
.cat-chip__del { border: none; background: transparent; color: var(--danger, #d92d20); cursor: pointer; font-size: 0.95rem; line-height: 1; padding: 0; }
.cat-chip__del:hover { color: #a01212; }
.cat-chip__act { border: none; background: transparent; cursor: pointer; font-size: 0.95rem; line-height: 1; padding: 0; }
.cat-chip--hidden { opacity: 0.55; }
.cat-chip--hidden em { font-style: normal; font-size: 0.72rem; opacity: 0.8; }
.hidden-badge { display: inline-block; background: #6b7280; color: #fff; border-radius: 6px; padding: 0.1rem 0.4rem; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; vertical-align: middle; }
.row-hidden { opacity: 0.55; }

.btn-ghost {
  background: transparent;
  color: var(--gray-text);
}

.btn-ghost:hover {
  color: var(--navy);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.auth-switch {
  text-align: center;
  margin-top: 1.3rem;
  font-size: 0.87rem;
}

.auth-switch a {
  color: var(--blue);
  font-weight: 600;
}

.alert {
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.alert-error {
  background: var(--danger-light);
  color: var(--danger);
}

.alert-success {
  background: var(--success-light);
  color: var(--success);
}

/* Dashboard */
.page-header {
  margin-bottom: 1.6rem;
}

.page-header h1 {
  font-size: 1.7rem;
}

.progress-summary {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem 1.6rem;
  display: flex;
  align-items: center;
  gap: 1.6rem;
  margin-bottom: 2rem;
}

.progress-ring {
  flex-shrink: 0;
}

.progress-summary__text strong {
  color: var(--navy);
  font-size: 1.1rem;
}

.progress-bar-track {
  background: var(--gray-border);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  margin-top: 0.5rem;
  width: 100%;
}

.progress-bar-fill {
  background: linear-gradient(90deg, var(--blue), var(--gold));
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.category-section {
  margin-bottom: 2.2rem;
}

.category-section__title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.05rem;
  color: var(--navy);
  margin-bottom: 0.9rem;
  font-weight: 700;
}

.category-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.cat-menaces {
  background: #d64545;
}

.cat-quotidien {
  background: #1868dd;
}

.cat-pro {
  background: #0d2352;
}

.cat-secteurs {
  background: #c9a24b;
}

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

.module-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0;
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s;
  border: 2px solid transparent;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: fadeInUp 0.45s ease both;
}

.module-card__img {
  height: 130px;
  background: linear-gradient(140deg, var(--blue-light), #f8fafe);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.module-card__img img {
  max-height: 118px;
  max-width: 88%;
  object-fit: contain;
  transition: transform 0.25s ease;
}

.module-card.is-clickable:hover .module-card__img img {
  transform: scale(1.07);
}

.module-card.is-locked .module-card__img img {
  filter: grayscale(1) opacity(0.55);
}

.module-card__body {
  padding: 1rem 1.2rem 1.15rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.module-card.is-clickable {
  cursor: pointer;
}

.module-card.is-clickable:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.module-card.is-locked {
  opacity: 0.6;
}

.module-card.is-next {
  border-color: var(--gold);
}

.module-card.is-completed {
  border-color: var(--success);
}

.module-card__badge {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  font-size: 1.1rem;
}

.module-card__num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.module-card__title {
  font-weight: 700;
  color: var(--navy);
  margin: 0.35rem 0 0.5rem;
  font-size: 1rem;
  line-height: 1.3;
}

.module-card__meta {
  font-size: 0.78rem;
  color: #8a8f99;
  display: flex;
  gap: 0.7rem;
}

.module-card__score {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--success);
}

/* Module detail */
.breadcrumb {
  font-size: 0.85rem;
  margin-bottom: 1rem;
  color: var(--blue);
  font-weight: 600;
  cursor: pointer;
}

.module-intro {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0;
  margin-bottom: 1.6rem;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  animation: fadeInUp 0.4s ease both;
}

.module-intro__text {
  padding: 1.6rem 1.8rem;
  flex: 1;
}

.module-intro__visual {
  flex: 0 0 260px;
  background: linear-gradient(140deg, var(--blue-light), #f8fafe);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.module-intro__visual img {
  max-height: 190px;
  max-width: 100%;
  object-fit: contain;
}

@media (max-width: 720px) {
  .module-intro {
    flex-direction: column-reverse;
  }
  .module-intro__visual {
    flex: none;
    height: 160px;
  }
}

.module-intro__cat {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--blue);
  background: var(--blue-light);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.7rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.info-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem 1.3rem;
  transition: transform 0.15s, box-shadow 0.15s;
  animation: fadeInUp 0.45s ease both;
}

.info-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.gallery-card {
  background: linear-gradient(140deg, var(--blue-light), #f8fafe);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  min-height: 200px;
  cursor: zoom-in;
  transition: transform 0.15s, box-shadow 0.15s;
  animation: fadeInUp 0.45s ease both;
}

.gallery-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: var(--shadow-lg);
}

.gallery-card img {
  max-height: 220px;
  max-width: 100%;
  object-fit: contain;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(13, 35, 82, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  cursor: zoom-out;
  animation: lightboxIn 0.18s ease;
}

.lightbox img {
  max-width: 90vw;
  max-height: 88vh;
  border-radius: 10px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.45);
}

@keyframes lightboxIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.info-card__heading {
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.7rem;
  font-size: 0.98rem;
}

.info-row {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  margin-bottom: 0.55rem;
  font-size: 0.86rem;
  line-height: 1.4;
}

.info-row__icon {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.info-row--bad .info-row__icon {
  color: var(--danger);
}

.info-row--risk .info-row__icon {
  color: var(--gold);
}

.info-row--good .info-row__icon {
  color: var(--success);
}

.info-row--detail {
  color: #8a8f99;
  font-size: 0.8rem;
}

.info-row strong {
  color: var(--navy);
  font-weight: 600;
}

.sticky-actions {
  position: sticky;
  bottom: 1rem;
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

/* Quiz */
.quiz-progress {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 0.6rem;
}

.quiz-progress-track {
  background: var(--gray-border);
  border-radius: 999px;
  height: 7px;
  overflow: hidden;
  margin-bottom: 1.1rem;
}

.quiz-progress-fill {
  background: linear-gradient(90deg, var(--blue), var(--gold));
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease;
}

.quiz-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.8rem 1.9rem;
}

.quiz-question {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1.3rem;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 1.6rem;
}

.quiz-option {
  border: 1.5px solid var(--gray-border);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  cursor: pointer;
  font-size: 0.94rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  transition: border-color 0.12s, background 0.12s;
}

.quiz-option:hover {
  border-color: var(--blue);
}

.quiz-option.selected {
  border-color: var(--blue);
  background: var(--blue-light);
  font-weight: 600;
}

.quiz-option input {
  accent-color: var(--blue);
}

.quiz-option.correct {
  border-color: var(--success);
  background: var(--success-light);
}

.quiz-option.incorrect {
  border-color: var(--danger);
  background: var(--danger-light);
}

.quiz-nav {
  display: flex;
  justify-content: space-between;
}

/* Results */
.result-hero {
  text-align: center;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.2rem 1.6rem;
  margin-bottom: 1.8rem;
}

.result-hero__score {
  font-size: 3rem;
  font-weight: 800;
  color: var(--navy);
}

.result-hero__pass {
  color: var(--success);
  font-weight: 700;
}

.result-hero__fail {
  color: var(--danger);
  font-weight: 700;
}

.result-item {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.3rem;
  margin-bottom: 0.8rem;
}

.result-item__q {
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.4rem;
}

.result-item__explain {
  font-size: 0.85rem;
  color: var(--gray-text);
  margin-top: 0.4rem;
}

.tag-ok {
  color: var(--success);
  font-weight: 700;
  font-size: 0.85rem;
}

.tag-ko {
  color: var(--danger);
  font-weight: 700;
  font-size: 0.85rem;
}

/* Certificate */
.certificate-preview {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  text-align: center;
  border: 3px solid var(--navy);
  position: relative;
}

.certificate-preview::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid var(--gold);
  border-radius: 8px;
  pointer-events: none;
}

.certificate-preview h2 {
  font-size: 1.8rem;
  margin-top: 0.6rem;
}

.certificate-preview .name {
  font-size: 1.9rem;
  color: var(--navy);
  font-weight: 800;
  margin: 1rem 0;
}

.certificate-locked {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem;
  text-align: center;
}

/* Admin */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem 1.3rem;
}

.stat-card__value {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--navy);
}

.stat-card__label {
  font-size: 0.82rem;
  color: var(--gray-text);
  margin-top: 0.2rem;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

table.data-table th,
table.data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--gray-border);
}

table.data-table th {
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

table.data-table tr:last-child td {
  border-bottom: none;
}

table.data-table tr.clickable {
  cursor: pointer;
}

table.data-table tr.clickable:hover {
  background: var(--blue-light);
}

.section-title {
  margin: 2rem 0 1rem;
  font-size: 1.15rem;
}

.loading {
  text-align: center;
  padding: 3rem;
  color: #9aa0ab;
}

/* Points & classement */
.points-chip {
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold), #e0bd6d);
  color: #fff;
  font-weight: 700;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  font-size: 0.95rem;
  box-shadow: 0 4px 14px rgba(201, 162, 75, 0.4);
  transition: transform 0.12s;
}

.points-chip:hover {
  transform: scale(1.05);
}

.leaderboard-rank {
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
  width: 60px;
}

.leaderboard-points {
  font-weight: 700;
  color: var(--navy);
}

tr.leaderboard-me {
  background: var(--blue-light);
}

tr.leaderboard-me td {
  font-weight: 600;
}

.tag-me {
  background: var(--blue);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Manager */
.join-code-banner {
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  color: #fff;
  border-radius: var(--radius);
  padding: 1.3rem 1.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.6rem;
  flex-wrap: wrap;
}

.join-code-banner strong {
  color: #fff;
  font-size: 1rem;
}

.join-code-banner p {
  margin: 0.3rem 0 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
}

.join-code {
  background: #fff;
  color: var(--navy);
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: 0.4em;
  padding: 0.5rem 1rem 0.5rem 1.4rem;
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
}

.join-code--small {
  font-size: 1.05rem;
  padding: 0.25rem 0.5rem 0.25rem 0.8rem;
  letter-spacing: 0.3em;
  background: var(--blue-light);
  border-radius: 6px;
  font-weight: 700;
  color: var(--navy);
}

.mini-progress {
  display: inline-block;
  vertical-align: middle;
  width: 90px;
  height: 7px;
  background: var(--gray-border);
  border-radius: 999px;
  overflow: hidden;
  margin-right: 0.5rem;
}

.mini-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--gold));
  border-radius: 999px;
}

/* Admin tabs & forms */
.admin-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1.4rem;
  border-bottom: 2px solid var(--gray-border);
}

.admin-tab {
  background: none;
  border: none;
  padding: 0.7rem 1.1rem;
  font-weight: 600;
  color: var(--gray-text);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}

.admin-tab:hover {
  color: var(--navy);
}

.admin-tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.admin-form-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.4rem;
}

.admin-form-card h3 {
  margin-bottom: 0.8rem;
  font-size: 1rem;
}

.admin-inline-form {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.admin-inline-form input,
.admin-inline-form select {
  flex: 1;
  min-width: 140px;
  padding: 0.55rem 0.7rem;
  border: 1.5px solid var(--gray-border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.admin-inline-form input:focus,
.admin-inline-form select:focus {
  outline: none;
  border-color: var(--blue);
}

.form-hint {
  margin: 0.7rem 0 0;
  font-size: 0.78rem;
  color: #9aa0ab;
}

.inline-select {
  padding: 0.35rem 0.5rem;
  border: 1.5px solid var(--gray-border);
  border-radius: 6px;
  font-size: 0.82rem;
  background: #fff;
  cursor: pointer;
}

.inline-select:focus {
  outline: none;
  border-color: var(--blue);
}

.btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
}

.btn-icon-danger {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.55;
  transition: opacity 0.15s, transform 0.12s;
}

.btn-icon-danger:hover {
  opacity: 1;
  transform: scale(1.15);
}

.clickable-cell {
  cursor: pointer;
  color: var(--blue);
  font-weight: 600;
}

.clickable-cell:hover {
  text-decoration: underline;
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: #9aa0ab;
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .topbar__nav {
    gap: 0.8rem;
    font-size: 0.82rem;
  }
  .field-row {
    flex-direction: column;
    gap: 0;
  }
  main {
    padding: 1.2rem 1rem 3rem;
  }
}

/* ============ Lecteur de module paginé (style fiche PDF) ============ */
.reader { max-width: 1000px; margin: 0 auto; }
.reader__topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.reader__timer {
  background: #fff; border: 1.5px solid var(--gray-border); border-radius: 999px;
  padding: 0.35rem 0.9rem; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums;
}
.reader__progress { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1rem; }
.reader__progress-track { flex: 1; height: 8px; background: var(--gray-border); border-radius: 999px; overflow: hidden; }
.reader__progress-fill { height: 100%; background: linear-gradient(90deg, var(--blue), var(--gold)); border-radius: 999px; transition: width 0.3s ease; }
.reader__progress-label { font-size: 0.8rem; font-weight: 600; color: var(--gray-text); white-space: nowrap; }
.reader__stage { display: flex; align-items: stretch; gap: 0.8rem; }
.reader__arrow {
  flex: 0 0 54px; border: none; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  font-size: 2rem; color: var(--blue); cursor: pointer; transition: background 0.15s, transform 0.1s;
}
.reader__arrow:hover:not(:disabled) { background: var(--blue-light); }
.reader__arrow:active:not(:disabled) { transform: scale(0.96); }
.reader__arrow:disabled { opacity: 0.3; cursor: default; }
.reader__page { flex: 1; min-width: 0; }
.reader__dots { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 1rem; }
.reader__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gray-border); cursor: pointer; transition: background 0.15s, transform 0.15s; }
.reader__dot:hover { transform: scale(1.3); }
.reader__dot.active { background: var(--blue); }

.sheet {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 2.4rem 2.6rem; min-height: 440px; animation: fadeInUp 0.35s ease both;
  display: flex; flex-direction: column;
}
.sheet__num { font-size: 0.78rem; font-weight: 700; color: var(--blue); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.6rem; }
.sheet__heading { font-size: 1.5rem; color: var(--navy); margin-bottom: 1.2rem; }
.sheet__img { text-align: center; margin: 0 auto 1.4rem; cursor: zoom-in; }
.sheet__img img { max-height: 240px; max-width: 100%; object-fit: contain; }
.sheet__rows { font-size: 1rem; }
.sheet__rows .info-row { margin-bottom: 0.9rem; font-size: 1rem; line-height: 1.55; }
.sheet--intro { text-align: center; align-items: center; justify-content: center; }
.sheet__cat { display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--blue); background: var(--blue-light); padding: 0.3rem 0.9rem; border-radius: 999px; margin-bottom: 1rem; }
.sheet__title { font-size: 1rem; color: var(--blue); letter-spacing: 2px; text-transform: uppercase; margin: 0; }
.sheet__subtitle { font-size: 2rem; color: var(--navy); margin: 0.4rem 0 1rem; }
.sheet__summary { font-size: 1.1rem; max-width: 640px; margin: 0 auto 1.4rem; line-height: 1.6; }
.sheet__hero img { max-height: 220px; margin: 0 auto 1rem; }
.sheet__hint { font-size: 0.85rem; color: #9aa0ab; }
.sheet--end { text-align: center; align-items: center; justify-content: center; }
.sheet__end-icon { font-size: 3.5rem; margin-bottom: 0.5rem; }
.sheet--end h2 { font-size: 1.8rem; }
.sheet--end p { max-width: 560px; font-size: 1.05rem; line-height: 1.6; }
.btn-lg { padding: 0.9rem 2rem; font-size: 1.05rem; margin-top: 1rem; }

@media (max-width: 640px) {
  .reader__arrow { flex-basis: 40px; font-size: 1.5rem; }
  .sheet { padding: 1.6rem 1.3rem; }
}

/* ============ Quiz : difficulté + scénario ============ */
.quiz-diff { display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 0.15rem 0.6rem; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.4px; margin-left: 0.5rem; }
.quiz-diff--facile { background: var(--success-light); color: var(--success); }
.quiz-diff--moyen { background: #fff4e0; color: #b8811f; }
.quiz-diff--difficile { background: var(--danger-light); color: var(--danger); }
.quiz-scenario { background: var(--blue-light); border-left: 5px solid var(--blue); padding: 1.2rem 1.4rem; border-radius: 10px; margin-bottom: 1.5rem; font-size: 1.1rem; line-height: 1.65; color: var(--navy); font-weight: 500; }
.quiz-scenario__label { display: block; font-weight: 800; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--blue); margin-bottom: 0.45rem; }
.result-item__scenario { background: var(--blue-light); border-radius: 8px; padding: 0.6rem 0.9rem; font-size: 0.85rem; margin-bottom: 0.6rem; }

/* ============ Éditeur admin de contenu ============ */
.edit-card, .edit-q { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.2rem; margin-bottom: 0.7rem; }
.edit-card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
.edit-card__head strong { color: var(--navy); }
.edit-q--inactive { opacity: 0.5; }
.edit-q__head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.edit-q__head strong { color: var(--navy); font-weight: 600; }
.edit-q__type { font-size: 0.72rem; background: var(--gray-border); padding: 0.1rem 0.5rem; border-radius: 6px; color: var(--gray-text); }
.edit-q__opts { font-size: 0.85rem; color: var(--gray-text); margin-bottom: 0.6rem; line-height: 1.6; }
.edit-q__actions { display: flex; align-items: center; gap: 0.8rem; }
.admin-form-card textarea { width: 100%; min-height: 60px; padding: 0.6rem 0.7rem; border: 1.5px solid var(--gray-border); border-radius: var(--radius-sm); font-size: 0.9rem; font-family: inherit; resize: vertical; }
.admin-form-card textarea:focus { outline: none; border-color: var(--blue); }
.qf-opt { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.qf-opt-text { flex: 1; padding: 0.5rem 0.6rem; border: 1.5px solid var(--gray-border); border-radius: var(--radius-sm); }
.qf-opt-text:focus { outline: none; border-color: var(--blue); }
.switch { font-size: 0.82rem; color: var(--gray-text); display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer; }

/* ============ Impression du récapitulatif ============ */
.print-header { display: none; }
.result-list { }
@media print {
  .topbar, .footer, .sticky-actions, .no-print, .reader__arrow, .reader__dots { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .print-header { display: flex !important; align-items: center; gap: 12px; border-bottom: 2px solid #0d2352; padding-bottom: 10px; margin-bottom: 16px; }
  .print-header img { height: 42px; }
  .result-item, .result-hero { box-shadow: none !important; border: 1px solid #ddd; break-inside: avoid; }
  .quiz-option.correct { border: 1px solid #1e9e5a; }
  .quiz-option.incorrect { border: 1px solid #d64545; }
}

/* ============ Dashboards graphiques ============ */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.1rem; margin-bottom: 1.6rem; }
.dash-grid--2 { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.dash-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.3rem 1.4rem; animation: fadeInUp 0.4s ease both; }
.dash-card h3 { font-size: 0.95rem; color: var(--navy); margin: 0 0 1rem; }
.dash-card--ring { display: flex; flex-direction: column; align-items: center; }

.donut { position: relative; width: 150px; height: 150px; }
.donut svg { width: 100%; height: 100%; transform: rotate(0); }
.donut circle:last-child { transition: stroke-dasharray 0.6s ease; }
.donut__center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut__top { font-size: 1.7rem; font-weight: 800; color: var(--navy); line-height: 1; }
.donut__bottom { font-size: 0.72rem; color: #9aa0ab; margin-top: 0.25rem; text-transform: uppercase; letter-spacing: 0.4px; }

.bars { display: flex; flex-direction: column; gap: 0.6rem; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; align-items: center; gap: 0.7rem; font-size: 0.85rem; }
.bar-row__label { color: var(--navy); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row__track { background: var(--gray-border); border-radius: 999px; height: 12px; overflow: hidden; }
.bar-row__fill { height: 100%; border-radius: 999px; transition: width 0.6s ease; min-width: 4px; }
.bar-row__val { font-weight: 700; color: var(--gray-text); font-variant-numeric: tabular-nums; white-space: nowrap; }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.6rem; }
.kpi-tile { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.3rem; display: flex; align-items: center; gap: 0.9rem; animation: fadeInUp 0.4s ease both; }
.kpi-tile__icon { font-size: 1.6rem; width: 46px; height: 46px; border-radius: 12px; background: var(--blue-light); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.kpi-tile__val { font-size: 1.7rem; font-weight: 800; color: var(--navy); line-height: 1; }
.kpi-tile__lbl { font-size: 0.78rem; color: var(--gray-text); margin-top: 0.2rem; }

.kpi-list { display: flex; flex-direction: column; gap: 0.7rem; }
.kpi-line { display: flex; align-items: center; justify-content: space-between; font-size: 0.9rem; padding-bottom: 0.55rem; border-bottom: 1px solid var(--gray-border); }
.kpi-line:last-child { border-bottom: none; padding-bottom: 0; }
.kpi-line strong { color: var(--navy); font-size: 1.05rem; }

.avatar--sm { width: 24px; height: 24px; font-size: 0.68rem; display: inline-flex; vertical-align: middle; margin-right: 0.35rem; }

/* ============ Classement : bandeau perso + podium ============ */
.me-banner { display: flex; align-items: center; gap: 1.5rem; background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; border-radius: var(--radius); padding: 1.2rem 1.6rem; margin-bottom: 1.8rem; flex-wrap: wrap; }
.me-banner__item { display: flex; flex-direction: column; }
.me-banner__val { font-size: 1.8rem; font-weight: 800; }
.me-banner__lbl { font-size: 0.78rem; color: rgba(255,255,255,0.7); text-transform: uppercase; letter-spacing: 0.4px; }
.me-banner__ring { margin-left: auto; width: 110px; height: 110px; }
.me-banner__ring .donut { width: 110px; height: 110px; }
.me-banner__ring .donut__top { color: #fff; font-size: 1.3rem; }
.me-banner__ring .donut__bottom { color: rgba(255,255,255,0.7); }
.me-banner__ring .donut circle:first-child { stroke: rgba(255,255,255,0.2); }

.podium { display: flex; align-items: flex-end; justify-content: center; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.podium__col { display: flex; flex-direction: column; align-items: center; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem 1.1rem 0; width: 190px; position: relative; animation: fadeInUp 0.5s ease both; }
.podium__medal { font-size: 2rem; }
.podium__avatar { width: 54px; height: 54px; border-radius: 50%; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.1rem; margin: 0.4rem 0; }
.podium__name { font-weight: 700; color: var(--navy); text-align: center; font-size: 0.9rem; }
.podium__points { color: var(--gold); font-weight: 800; margin: 0.3rem 0 0.8rem; }
.podium__stand { width: 100%; text-align: center; font-weight: 800; color: #fff; border-radius: 8px 8px 0 0; padding: 0.5rem 0; }
.podium__col--1 { order: 2; transform: translateY(-14px); }
.podium__col--1 .podium__avatar { background: var(--gold); }
.podium__col--1 .podium__stand { background: var(--gold); height: 74px; }
.podium__col--2 { order: 1; }
.podium__col--2 .podium__stand { background: #9aa7bd; height: 56px; }
.podium__col--3 { order: 3; }
.podium__col--3 .podium__stand { background: #c08457; height: 42px; }
.leaderboard-table .bar-row { grid-template-columns: 1fr auto; }

.admin-actions-bar { display: flex; justify-content: flex-end; gap: 0.6rem; margin-bottom: 1rem; }

/* ============ Logo topbar (version blanche) ============ */
.topbar__logo { height: 30px; width: auto; }

/* ============ Certificat (aperçu in-app) ============ */
.cert { display: flex; justify-content: center; padding: 0.5rem 0 1rem; }
.cert__frame {
  position: relative; width: 100%; max-width: 860px; background: #fff;
  border: 3px solid var(--navy); border-radius: 6px; padding: 2.6rem 3rem 2rem;
  box-shadow: var(--shadow-lg); text-align: center; overflow: hidden;
}
.cert__frame::before {
  content: ''; position: absolute; inset: 10px; border: 1px solid var(--gold); border-radius: 4px; pointer-events: none;
}
.cert__frame::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 6px;
  background: linear-gradient(90deg, var(--blue), var(--gold)); 
}
.cert__corner { position: absolute; width: 26px; height: 26px; border-color: var(--gold); border-style: solid; z-index: 2; }
.cert__corner--tl { top: 16px; left: 16px; border-width: 2px 0 0 2px; }
.cert__corner--tr { top: 16px; right: 16px; border-width: 2px 2px 0 0; }
.cert__corner--bl { bottom: 16px; left: 16px; border-width: 0 0 2px 2px; }
.cert__corner--br { bottom: 16px; right: 16px; border-width: 0 2px 2px 0; }
.cert__logo { height: 66px; width: auto; margin-bottom: 0.6rem; }
.cert__kicker { font-size: 0.72rem; letter-spacing: 2px; text-transform: uppercase; color: var(--blue); font-weight: 600; }
.cert__title { font-size: 2.1rem; color: var(--navy); letter-spacing: 1px; margin: 0.5rem 0 0; text-transform: uppercase; }
.cert__rule { width: 130px; height: 2px; background: var(--gold); margin: 0.8rem auto 1.2rem; }
.cert__intro { color: var(--gray-text); font-size: 0.95rem; margin: 0; }
.cert__name { font-size: 2.3rem; font-weight: 800; color: var(--navy); font-family: 'Rubik', serif; margin: 0.5rem 0; }
.cert__body { color: var(--gray-text); font-size: 0.95rem; max-width: 560px; margin: 0.4rem auto 0; line-height: 1.6; }
.cert__score { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 1.4rem 0 0.5rem; }
.cert__score-ring { width: 96px; height: 96px; }
.cert__score-ring .donut { width: 96px; height: 96px; }
.cert__score-ring .donut__top { font-size: 1.2rem; }
.cert__score-txt { text-align: left; color: var(--gray-text); font-size: 0.85rem; }
.cert__score-txt strong { font-size: 1.6rem; color: var(--gold); }
.cert__footer { display: flex; align-items: center; justify-content: space-between; margin-top: 1.6rem; font-size: 0.85rem; color: var(--gray-text); border-top: 1px solid var(--gray-border); padding-top: 1rem; }
.cert__foot-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.6px; color: var(--gold-70, #9aa0ab); }
.cert__seal { width: 48px; height: 48px; border-radius: 50%; background: var(--gold); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; font-weight: 800; box-shadow: 0 4px 12px rgba(201,162,75,0.4); border: 2px solid var(--navy); }

/* ============ Certificat — DA élégante (overrides) ============ */
.cert__frame::after { display: none !important; }           /* retire le trait bleu */
.cert__frame { border: 1.5px solid var(--navy); padding: 2.4rem 3rem 1.4rem; background: #fff; }
.cert__frame::before { inset: 8px; border: 0.75px solid var(--gold); }
.cert__logo { height: 96px; margin-bottom: 0.4rem; }
.cert__kicker { color: var(--gold); letter-spacing: 2.5px; }
.cert__title { font-family: 'Georgia', 'Times New Roman', serif; font-weight: 700; font-size: 2.4rem; letter-spacing: 0.5px; text-transform: none; color: var(--navy); }
.cert__rule { width: 120px; height: 1.5px; background: var(--gold); margin: 0.7rem auto 1.1rem; }
.cert__intro { font-family: 'Georgia', serif; font-style: italic; font-size: 1rem; color: var(--gray-text); }
.cert__name { font-family: 'Georgia', 'Times New Roman', serif; font-weight: 700; font-size: 2.4rem; color: var(--navy); margin: 0.4rem 0; }
.cert__body { color: var(--gray-text); font-size: 0.95rem; max-width: 600px; margin: 0.3rem auto 0; line-height: 1.6; }
.cert__score-badge { width: 96px; height: 96px; border: 2.5px solid var(--gold); border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 1.3rem auto 0.3rem; }
.cert__score-pct { font-size: 1.7rem; font-weight: 800; color: var(--navy); line-height: 1; }
.cert__score-lbl { font-size: 0.6rem; letter-spacing: 1px; text-transform: uppercase; color: var(--gold); margin-top: 3px; font-weight: 700; }
.cert__footer { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 1.4rem; font-size: 0.82rem; color: var(--gray-text); border-top: none; padding-top: 0; }
.cert__foot-label { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.6px; color: var(--light, #9aa0ab); }
.cert__sign { text-align: center; }
.cert__sign-name { font-family: 'Georgia', serif; font-weight: 700; color: var(--navy); border-top: 1px solid var(--gray-border); padding-top: 0.4rem; min-width: 220px; }
.cert__seal { display: none; }

/* Certificat — nom calligraphié (Great Vibes) + centrage de la page */
@font-face {
  font-family: 'GreatVibes';
  src: url('/assets/fonts/GreatVibes-Regular.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}
.cert-page { max-width: 1040px; margin-inline: auto; }
/* Aperçu écran = le VRAI PDF embarqué (toujours synchronisé avec le certificat généré) */
.cert-embed-wrap { max-width: 1000px; margin: 0.5rem auto 0; }
.cert-embed { width: 100%; aspect-ratio: 1123 / 794; border: 1px solid var(--gray-border, #e3e5ea); border-radius: 10px; box-shadow: var(--shadow-lg); background: #fff; display: block; }
.cert-embed-hint { text-align: center; color: var(--light, #8a8f99); font-size: 0.85rem; margin: 0.7rem 0 0; }
.cert__address { text-align: center; font-size: 0.68rem; color: #9aa0ab; margin-top: 0.9rem; line-height: 1.5; }

/* Retrait du cercle doré autour du score (certificat aperçu) */
.cert__score-badge { border: none !important; width: auto !important; height: auto !important; margin: 1.6rem auto 0.4rem !important; }
.cert__score-pct { font-size: 2rem; }

/* ============================================================
   Ajouts : rôles, documentation, style module explicite,
   éditeur de quiz (options dynamiques + prévisualisation)
   ============================================================ */

/* Lien documentation dans la barre de navigation */
.topbar__nav .nav-doc { opacity: 0.92; }
.footer a { color: #cfe0fb; text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* Étiquettes de rôle */
.role-tag { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; border: 1px solid transparent; }
.role-tag--admin { background: #efe7fb; color: #6b32c9; border-color: #ddccf6; }
.role-tag--org_admin { background: var(--blue-light); color: var(--blue-dark); border-color: #cfe0fb; }
.role-legend { background: #fff; border: 1px solid var(--border, #e3e8f0); border-radius: 12px; padding: .7rem 1rem; margin-bottom: 1rem; }
.role-legend summary { cursor: pointer; font-weight: 600; color: var(--blue-dark, #0D2352); }
.role-legend[open] summary { margin-bottom: .6rem; }
.role-legend__table td:first-child { white-space: nowrap; }
.role-legend__table td { vertical-align: top; }
.role-tag--editor { background: #e3f6ef; color: #1f7a5a; border-color: #c4eadb; }
.role-tag--manager { background: #fff4e0; color: #a9701a; border-color: #f3e0bb; }
.role-tag--user { background: #eef1f6; color: #566079; border-color: #e0e5ee; }

/* Actions en ligne dans les tableaux */
.row-actions { white-space: nowrap; display: flex; gap: 0.35rem; }
.btn-icon { background: var(--blue-light); border: 1px solid #cfe0fb; color: var(--blue-dark); border-radius: 8px; padding: 0.28rem 0.5rem; cursor: pointer; font-size: 0.95rem; line-height: 1; }
.btn-icon:hover { background: #dce9fd; }

/* État explicite des modules */
.module-card__state { display: inline-block; margin-top: 0.5rem; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; border: 1px solid var(--gray-border); }
.module-card__state--locked { background: #f3f4f7; color: #8a90a0; }
.module-card__state--available { background: var(--blue-light); color: var(--blue-dark); border-color: #cfe0fb; }
.module-card__state--next { background: #fff4e0; color: #a9701a; border-color: #f3e0bb; }
.module-card__state--done { background: var(--success-light); color: var(--success); border-color: #bfe7cf; }

/* Section documentation (fin du parcours) */
.doc-section { display: flex; align-items: center; gap: 1.1rem; margin-top: 2rem; padding: 1.4rem 1.6rem; border-radius: 16px; background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 130%); color: #fff; flex-wrap: wrap; }
.doc-section__icon { font-size: 2.2rem; }
.doc-section__body { flex: 1; min-width: 220px; }
.doc-section__body h3 { margin: 0 0 0.25rem; color: #fff; font-size: 1.1rem; }
.doc-section__body p { margin: 0; color: #d6e2fb; font-size: 0.9rem; line-height: 1.5; }
.doc-section .btn-primary { background: #fff; color: var(--navy); border: none; }
.doc-section .btn-primary:hover { background: #eaf1fd; }
.sheet__doc { margin-top: 1rem; font-size: 0.85rem; color: #566079; }
.sheet__doc a { color: var(--blue); }

/* Éditeur de question : disposition éditeur + prévisualisation */
.qf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
@media (max-width: 860px) { .qf-grid { grid-template-columns: 1fr; } }
.qf-inline { display: flex; flex-direction: column; font-size: 0.75rem; font-weight: 600; color: #566079; gap: 0.2rem; }
.qf-preview-pane { background: #f7f9fc; border: 1px dashed #cfd8e6; border-radius: 12px; padding: 1rem; }
.qf-preview-label { font-size: 0.8rem; font-weight: 700; color: var(--navy); margin-bottom: 0.6rem; }
.quiz-card--preview { box-shadow: none; margin: 0; }

/* Options de réponse : ligne = bouton correct + texte + suppression */
.qf-opt { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.qf-correct-toggle { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--gray-border); background: #fff; color: var(--success); font-weight: 800; cursor: pointer; font-size: 0.95rem; line-height: 1; }
.qf-correct-toggle.is-correct { background: var(--success); border-color: var(--success); color: #fff; }
.qf-opt-text { flex: 1; }
.qf-opt-text[readonly] { background: #f3f4f7; color: #566079; }
.qf-opt-del { flex: 0 0 auto; background: var(--danger-light); color: var(--danger); border: 1px solid #f3caca; border-radius: 8px; width: 30px; height: 30px; cursor: pointer; }
.qf-opt-del:disabled { opacity: 0.4; cursor: not-allowed; }

/* Réponse correcte mise en avant dans la prévisualisation / correction */
.quiz-option.correct { border-color: var(--success); background: var(--success-light); color: #14663b; font-weight: 600; }

/* Barre de progression sur la carte module (remplace le badge d'état) */
.module-card__progress { display: flex; align-items: center; gap: 0.5rem; margin-top: auto; padding-top: 0.7rem; }
.module-card__progress-track { flex: 1; height: 7px; background: #e9edf4; border-radius: 999px; overflow: hidden; }
.module-card__progress-fill { height: 100%; border-radius: 999px; transition: width 0.4s ease; }
.module-card__progress-pct { font-size: 0.78rem; font-weight: 800; color: var(--navy); min-width: 34px; text-align: right; }

/* Documentation verrouillée (parcours non terminé) */
.doc-section--locked { background: #f3f4f7; color: #566079; }
.doc-section--locked .doc-section__body h3 { color: #566079; }
.doc-section--locked .doc-section__body p { color: #6b7280; }

/* Import d'image dans l'éditeur de fiche */
.cf-image-row { display: flex; gap: 0.5rem; align-items: center; }
.cf-image-row input[type="text"] { flex: 1; }

/* ---------- Parcours segmenté : cartes par thème (avec image) ---------- */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.2rem; margin-bottom: 1.8rem; }
.theme-card {
  display: flex; flex-direction: column; text-align: left; padding: 0; overflow: hidden;
  background: #fff; border: 1.5px solid var(--border, #e3e8f0); border-radius: var(--radius);
  box-shadow: var(--shadow); cursor: pointer; width: 100%;
  transition: transform 0.16s, box-shadow 0.16s, border-color 0.16s;
}
.theme-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(13, 35, 82, 0.16); border-color: var(--blue); }
.theme-card:hover .theme-card__cover.has-img::after { opacity: 0.35; }
.theme-card__cover {
  position: relative; height: 132px; background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  background-color: var(--navy);
}
/* Repli sans image : dégradé teinté par thème */
.theme-card__cover.cat-menaces { background-image: linear-gradient(135deg, #d64545, #7a1f1f); }
.theme-card__cover.cat-quotidien { background-image: linear-gradient(135deg, #1868dd, #0a2e6b); }
.theme-card__cover.cat-pro { background-image: linear-gradient(135deg, #0d2352, #1868dd); }
.theme-card__cover.cat-secteurs { background-image: linear-gradient(135deg, #c9a24b, #6e5320); }
.theme-card__cover.has-img { background-image: none; } /* l'image inline prend le dessus via style="" */
.theme-card__cover.has-img::after {
  content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(13,35,82,0.15), rgba(13,35,82,0.55));
  opacity: 0.5; transition: opacity 0.16s;
}
.theme-card__badge {
  position: absolute; top: 0.6rem; right: 0.6rem; z-index: 2;
  font-size: 0.72rem; font-weight: 800; padding: 0.2rem 0.55rem; border-radius: 999px; background: #fff;
}
.theme-card__badge.is-done { color: #1f8b4c; }
.theme-card__badge.is-next { color: #a6791f; }
.theme-card__body { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.9rem 1rem 1rem; }
.theme-card__title { font-weight: 800; color: var(--navy); font-size: 1.08rem; line-height: 1.25; }
.theme-card__meta { font-size: 0.84rem; color: #6b7280; }
.theme-card__bar { display: block; height: 8px; background: #e9edf4; border-radius: 999px; overflow: hidden; }
.theme-card__bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--blue), var(--gold)); transition: width 0.4s ease; }
.theme-card__cta { font-size: 0.85rem; font-weight: 800; color: var(--blue); margin-top: 0.1rem; }
.theme-card.is-next { border-color: var(--gold); }
.theme-card.is-done .theme-card__cover::before {
  content: ''; position: absolute; inset: 0; z-index: 1; background: rgba(31, 139, 76, 0.28);
}

.page-header--sub h1 { display: flex; align-items: center; gap: 0.55rem; }
.page-header--sub .category-dot { width: 14px; height: 14px; }
.page-header--sub #theme-back { margin-bottom: 0.6rem; }

/* ---------- Étape finale : quiz général ---------- */
.section-heading { font-size: 1.1rem; font-weight: 800; color: var(--navy); margin: 0 0 0.8rem; }
.exam-section { margin-bottom: 1.6rem; }
.exam-tile {
  display: flex; align-items: center; gap: 1rem; width: 100%; text-align: left;
  border-radius: var(--radius); padding: 1.15rem 1.25rem; cursor: pointer;
  border: 1.5px solid var(--border, #e3e8f0); box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}
.exam-tile__icon { font-size: 2rem; flex: 0 0 auto; }
.exam-tile__body { display: flex; flex-direction: column; gap: 0.25rem; flex: 1; min-width: 0; }
.exam-tile__title { font-weight: 800; color: var(--navy); font-size: 1.05rem; }
.exam-tile__desc { font-size: 0.85rem; color: #556; }
.exam-tile__cta { font-weight: 800; flex: 0 0 auto; padding: 0.5rem 0.9rem; border-radius: var(--radius-sm); }
.exam-tile.is-ready { background: linear-gradient(140deg, var(--blue-light), #f8fafe); border-color: var(--blue); }
.exam-tile.is-ready:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(13, 35, 82, 0.14); }
.exam-tile.is-ready .exam-tile__cta { background: var(--blue); color: #fff; }
.exam-tile.is-done { background: #eef8f1; border-color: #b6e0c4; }
.exam-tile.is-done .exam-tile__cta { background: #1f8b4c; color: #fff; }
.exam-tile.is-locked { background: #f3f4f7; border-color: #e3e6ec; cursor: not-allowed; opacity: 0.85; }
.exam-tile.is-locked .exam-tile__title, .exam-tile.is-locked .exam-tile__desc { color: #6b7280; }
.exam-tile.is-locked .exam-tile__cta { background: #d7dbe3; color: #6b7280; }

/* Ligne d'un module supprimé (tombstone) dans l'admin */
.row-deleted { opacity: 0.5; }
.row-deleted td:first-child { text-decoration: line-through; }

/* Vignette d'image de thème dans les chips de catégorie (admin) */
.cat-chip__thumb { width: 26px; height: 26px; border-radius: 6px; object-fit: cover; margin-right: 0.15rem; vertical-align: middle; }
.cat-chip__thumb--empty { display: inline-block; background: #dfe4ec; }
.cat-chip__open { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 0.4rem; }
.cat-chip__open:hover { text-decoration: underline; }
.cat-chip__count { background: var(--blue); color: #fff; border-radius: 999px; padding: 0 0.45rem; font-size: 0.72rem; font-weight: 800; min-width: 1.1rem; text-align: center; }

/* Table des thèmes en cascade (admin Modules & quiz) */
.cat-row__name { display: inline-flex; align-items: center; gap: 0.55rem; }
.cat-row__thumb { width: 34px; height: 34px; border-radius: 7px; object-fit: cover; flex: 0 0 auto; }
.cat-row__thumb--empty { display: inline-block; }

/* Aperçu de l'image de couverture sur la page d'un thème (admin) */
.theme-cover-preview {
  width: 100%; max-width: 440px; height: 170px; border-radius: var(--radius);
  background-size: cover; background-position: center; background-color: var(--navy);
  display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.85); font-size: 0.9rem;
}
.theme-cover-preview.cat-menaces { background-image: linear-gradient(135deg, #d64545, #7a1f1f); }
.theme-cover-preview.cat-quotidien { background-image: linear-gradient(135deg, #1868dd, #0a2e6b); }
.theme-cover-preview.cat-pro { background-image: linear-gradient(135deg, #0d2352, #1868dd); }
.theme-cover-preview.cat-secteurs { background-image: linear-gradient(135deg, #c9a24b, #6e5320); }
