/* ── Reset ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Variables ───────────────────────────────────────── */
:root {
  --color-bg:          #f5f5f0;
  --color-surface:     #ffffff;
  --color-border:      rgba(0,0,0,.10);
  --color-border-md:   rgba(0,0,0,.18);
  --color-text:        #1a1a18;
  --color-muted:       #6b6b65;
  --color-accent:      #185FA5;
  --color-accent-dark: #0d4278;
  --color-accent-bg:   #e6f1fb;
  --color-danger:      #c0392b;
  --color-danger-bg:   #fdecea;
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --shadow-card: 0 1px 3px rgba(0,0,0,.06), 0 0 0 0.5px rgba(0,0,0,.09);
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ── Base ─────────────────────────────────────────────── */
html { font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout utilitaires ─────────────────────────────── */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Navbar ──────────────────────────────────────────── */
.navbar {
  background: var(--color-surface);
  border-bottom: 0.5px solid var(--color-border);
  height: 56px;
  display: flex;
  align-items: center;
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.navbar-brand {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--color-text);
  letter-spacing: -.3px;
}
.navbar-brand:hover { text-decoration: none; color: var(--color-accent); }
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
  font-size: .9rem;
}
.navbar-nav a { color: var(--color-muted); }
.navbar-nav a:hover { color: var(--color-text); text-decoration: none; }

/* ── Page login ──────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}
.login-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 40px 44px;
  width: 100%;
  max-width: 400px;
}
.login-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 6px;
  letter-spacing: -.5px;
}
.login-subtitle {
  font-size: .9rem;
  color: var(--color-muted);
  margin-bottom: 32px;
}

/* ── Formulaire ──────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: .85rem;
  font-weight: 500;
  color: var(--color-muted);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  font-size: .95rem;
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border-md);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(24,95,165,.12);
}
.form-control.is-invalid { border-color: var(--color-danger); }

/* ── Boutons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: .95rem;
  font-family: var(--font);
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background .15s, opacity .15s;
  text-decoration: none;
}
.btn-primary {
  background: var(--color-accent);
  color: #fff;
  width: 100%;
}
.btn-primary:hover { background: var(--color-accent-dark); text-decoration: none; color: #fff; }
.btn-sm { padding: 7px 14px; font-size: .85rem; }
.btn-outline {
  background: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
}
.btn-outline:hover { background: var(--color-accent-bg); text-decoration: none; }

/* ── Alertes ─────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  margin-bottom: 20px;
}
.alert-danger {
  background: var(--color-danger-bg);
  color: #922b21;
  border: 0.5px solid #f5b7b1;
}

/* ── Page formations ─────────────────────────────────── */
.page-header {
  padding: 40px 0 28px;
}
.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -.5px;
  margin-bottom: 4px;
}
.page-intro { color: var(--color-muted); font-size: .95rem; }

.formations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  padding-bottom: 60px;
}

/* ── Badge de formation ──────────────────────────────── */
.formation-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, transform .2s;
}
.formation-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.1), 0 0 0 0.5px rgba(0,0,0,.09);
  transform: translateY(-2px);
}
.formation-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}
.formation-thumb-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
}
.formation-body {
  padding: 20px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.formation-title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -.2px;
  margin-bottom: 6px;
  color: var(--color-text);
}
.formation-tagline {
  font-size: .875rem;
  color: var(--color-muted);
  flex: 1;
  margin-bottom: 20px;
  line-height: 1.5;
}
.formation-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.formation-badge {
  font-size: .75rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

/* Couleurs des thumbnails placeholder */
.thumb-blue   { background: #dbeafe; color: #1e40af; }
.thumb-green  { background: #dcfce7; color: #166534; }
.thumb-purple { background: #ede9fe; color: #5b21b6; }
.thumb-amber  { background: #fef3c7; color: #92400e; }

.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-green  { background: #dcfce7; color: #166534; }
.badge-purple { background: #ede9fe; color: #5b21b6; }
.badge-amber  { background: #fef3c7; color: #92400e; }

/* ── Lien vers le cours ──────────────────────────────── */
.btn-cours {
  background: var(--color-accent);
  color: #fff;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition: background .15s;
}
.btn-cours:hover { background: var(--color-accent-dark); color: #fff; text-decoration: none; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 480px) {
  .login-card { padding: 28px 20px; }
  .formations-grid { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════
   PAGE COURS
   ════════════════════════════════════════════════════════ */

body.cours-page { background: var(--color-bg); }

/* ── Navbar back ─────────────────────────────────────── */
.navbar-back {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── TOC mobile ──────────────────────────────────────── */
.toc-mobile-bar {
  display: none;
  background: var(--color-surface);
  border-bottom: 0.5px solid var(--color-border);
  position: sticky;
  top: 56px;
  z-index: 90;
}
.toc-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: .9rem;
  color: var(--color-text);
  font-family: var(--font);
  text-align: left;
}
.toc-mobile-list {
  display: none;
  padding: 8px 20px 16px;
  border-top: 0.5px solid var(--color-border);
}
.toc-mobile-list.open { display: block; }
.toc-mobile-list ol {
  list-style: none;
  counter-reset: toc;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.toc-mobile-list li { counter-increment: toc; }
.toc-mobile-list a {
  display: block;
  padding: 8px 0;
  font-size: .9rem;
  color: var(--color-muted);
  text-decoration: none;
}
.toc-mobile-list a:hover { color: var(--color-text); }

/* ── Layout desktop ──────────────────────────────────── */
.cours-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 56px);
  max-width: 1160px;
  margin: 0 auto;
}

/* ── Sidebar ─────────────────────────────────────────── */
.cours-sidebar {
  border-right: 0.5px solid var(--color-border);
  padding: 0;
}
.toc-sticky {
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 88px);
  overflow-y: auto;
  padding: 32px 0 32px 24px;
  scrollbar-width: thin;
}
.toc-heading {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 14px;
  padding-right: 20px;
}
.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.toc-link {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 20px 7px 0;
  text-decoration: none;
  color: var(--color-muted);
  font-size: .875rem;
  line-height: 1.4;
  border-radius: 6px 0 0 6px;
  transition: color .15s, background .15s;
}
.toc-link:hover { color: var(--color-text); text-decoration: none; }
.toc-link.active {
  color: var(--color-accent);
  font-weight: 500;
}
.toc-link.active .toc-num { background: var(--color-accent); color: #fff; }
.toc-num {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 600;
  color: var(--color-muted);
  transition: background .15s, color .15s;
  margin-top: 1px;
}
.toc-text { flex: 1; }

/* ── Contenu principal ───────────────────────────────── */
.cours-main {
  padding: 48px 60px 80px;
  max-width: 780px;
}

/* ── En-tête de formation ────────────────────────────── */
.cours-header { margin-bottom: 32px; }
.cours-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -.5px;
  line-height: 1.2;
  margin-bottom: 10px;
}
.cours-tagline {
  font-size: 1.05rem;
  color: var(--color-muted);
  margin-bottom: 12px;
}
.cours-meta {
  font-size: .85rem;
  color: var(--color-muted);
}
.cours-divider {
  border: none;
  border-top: 0.5px solid var(--color-border);
  margin: 0 0 48px;
}

/* ── Chapitre ────────────────────────────────────────── */
.chapitre {
  margin-bottom: 56px;
  scroll-margin-top: 80px;
}
.chapitre-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.chapitre-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-accent-bg);
  color: var(--color-accent);
  font-size: .8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chapitre-title {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -.3px;
}
.chapitre-intro {
  margin-bottom: 24px;
  padding: 16px 20px;
  background: var(--color-bg);
  border-left: 3px solid var(--color-border-md);
  border-radius: 0 6px 6px 0;
}
.chapitre-blocks {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Prose (html brut) ───────────────────────────────── */
.prose { line-height: 1.75; color: var(--color-text); }
.prose p { margin-bottom: .9em; }
.prose p:last-child { margin-bottom: 0; }
.prose code {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: .85em;
  background: var(--color-bg);
  border: 0.5px solid var(--color-border-md);
  padding: 1px 6px;
  border-radius: 4px;
}
.prose pre {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 20px 24px;
  border-radius: 8px;
  overflow-x: auto;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: .875rem;
  line-height: 1.6;
  margin-bottom: .9em;
}
.prose pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}
.prose ul, .prose ol {
  padding-left: 1.5em;
  margin-bottom: .9em;
}
.prose li { margin-bottom: .3em; }
.prose h3 { font-size: 1.05rem; font-weight: 600; margin: 1.2em 0 .5em; }
.prose a { color: var(--color-accent); }

/* ── Bloc vidéo ──────────────────────────────────────── */
.block-video {}
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: #000;
}
.video-wrapper iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

/* ── Bloc pièce jointe ───────────────────────────────── */
.attachment-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--color-surface);
  border: 0.5px solid var(--color-border-md);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}
.att-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.att-icon svg { width: 20px; height: 20px; }

/* Couleurs des icônes par type */
.att-pdf     { background: #fdecea; color: #c0392b; }
.att-video   { background: #e8f0fe; color: #1a73e8; }
.att-audio   { background: #e8f5e9; color: #2e7d32; }
.att-image   { background: #fdf6e3; color: #8d6e00; }
.att-archive { background: #f3e5f5; color: #6a1b9a; }
.att-text    { background: var(--color-bg); color: var(--color-muted); }
.att-default { background: var(--color-bg); color: var(--color-muted); }

.attachment-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.attachment-label {
  font-size: .9rem;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attachment-badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  align-self: flex-start;
}
/* Badge couleurs (réutilise les classes att-*) */
.attachment-badge.att-pdf     { background: #fdecea; color: #922b21; }
.attachment-badge.att-video   { background: #e8f0fe; color: #1558b0; }
.attachment-badge.att-audio   { background: #e8f5e9; color: #1b5e20; }
.attachment-badge.att-image   { background: #fdf6e3; color: #7d5a00; }
.attachment-badge.att-archive { background: #f3e5f5; color: #4a148c; }
.attachment-badge.att-text,
.attachment-badge.att-default { background: var(--color-bg); color: var(--color-muted); border: 0.5px solid var(--color-border-md); }

.attachment-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--color-accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s;
  white-space: nowrap;
}
.attachment-btn:hover { background: var(--color-accent-dark); color: #fff; text-decoration: none; }

/* ── Fin de formation ────────────────────────────────── */
.cours-fin {
  margin-top: 64px;
  padding: 48px 32px;
  text-align: center;
  background: var(--color-surface);
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.cours-fin-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 12px 0 20px;
}

/* ── Responsive cours ────────────────────────────────── */
@media (max-width: 768px) {
  .cours-sidebar  { display: none; }
  .toc-mobile-bar { display: block; }
  .cours-layout   { grid-template-columns: 1fr; }
  .cours-main     { padding: 28px 20px 60px; }
  .cours-title    { font-size: 1.5rem; }
  .attachment-card { flex-wrap: wrap; }
  .attachment-btn  { width: 100%; justify-content: center; }
}
@media (max-width: 480px) {
  .cours-main { padding: 20px 16px 60px; }
}

/* ════════════════════════════════════════════════════════
   ÉTAPES 3-4 : AUTH & RESET
   ════════════════════════════════════════════════════════ */

/* ── Alert info (timeout) ────────────────────────────── */
.alert-info {
  background: var(--color-accent-bg);
  color: #0d4278;
  border: 0.5px solid #b5d4f4;
}

/* ── Hint sous les champs ────────────────────────────── */
.form-hint {
  display: block;
  font-size: .78rem;
  color: var(--color-muted);
  margin-top: 4px;
}

/* ── Écran de succès (forgot / reset) ────────────────── */
.reset-success {
  text-align: center;
  padding: 8px 0 4px;
}
.reset-success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-accent-bg);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.reset-success-icon svg { width: 26px; height: 26px; }
.reset-success-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
}
.reset-success-text {
  font-size: .9rem;
  color: var(--color-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ════════════════════════════════════════════════════════
   ÉTAPES 5-6 : INTERFACE ADMIN
   ════════════════════════════════════════════════════════ */

body.admin-body { background: #f0efe9; }

/* ── Layout admin ────────────────────────────────────── */
.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────── */
.admin-sidebar {
  background: var(--color-surface);
  border-right: 0.5px solid var(--color-border);
}
.admin-sidebar-inner {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow-y: auto;
}
.admin-brand {
  padding: 20px 20px 16px;
  border-bottom: 0.5px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-brand-name {
  font-weight: 700;
  font-size: .95rem;
  color: var(--color-text);
}
.admin-brand-tag {
  font-size: .68rem;
  font-weight: 600;
  padding: 2px 7px;
  background: var(--color-accent-bg);
  color: var(--color-accent);
  border-radius: 20px;
  letter-spacing: .03em;
}
.admin-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: .875rem;
  color: var(--color-muted);
  transition: background .13s, color .13s;
}
.admin-nav-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.admin-nav-link:hover { background: var(--color-bg); color: var(--color-text); text-decoration: none; }
.admin-nav-link.active { background: var(--color-accent-bg); color: var(--color-accent); font-weight: 500; }
.admin-nav-badge {
  margin-left: auto;
  font-size: .7rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 20px;
  background: var(--color-bg);
  color: var(--color-muted);
}
.admin-nav-link.active .admin-nav-badge { background: rgba(24,95,165,.12); color: var(--color-accent); }
.admin-sidebar-footer {
  padding: 12px;
  border-top: 0.5px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.admin-footer-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  color: var(--color-muted);
  text-decoration: none;
  transition: background .13s, color .13s;
}
.admin-footer-link svg { width: 15px; height: 15px; flex-shrink: 0; }
.admin-footer-link:hover { background: var(--color-bg); color: var(--color-text); text-decoration: none; }
.admin-footer-logout:hover { color: var(--color-danger); }

/* ── Contenu admin ───────────────────────────────────── */
.admin-main { overflow: hidden; }
.admin-content { max-width: 960px; padding: 36px 40px 60px; }

/* ── En-tête de page ─────────────────────────────────── */
.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.admin-page-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -.4px;
}
.admin-section-title {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 14px;
}

/* ── Cartes stats dashboard ──────────────────────────── */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}
.admin-stat-card {
  background: var(--color-surface);
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-stat-value {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -.5px;
  color: var(--color-text);
}
.admin-stat-label {
  font-size: .8rem;
  color: var(--color-muted);
}
.admin-stat-warn .admin-stat-value { color: #b45309; }

/* ── Actions rapides ─────────────────────────────────── */
.admin-quick-actions { margin-bottom: 32px; }
.admin-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ── Tableau admin ───────────────────────────────────── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.admin-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--color-muted);
  background: var(--color-bg);
  border-bottom: 0.5px solid var(--color-border);
}
.admin-table td {
  padding: 12px 14px;
  border-bottom: 0.5px solid var(--color-border);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr.row-inactive td { opacity: .55; }
.actions-cell { white-space: nowrap; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ── Boutons tableau ─────────────────────────────────── */
.btn-table {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: .78rem;
  font-weight: 500;
  border-radius: 5px;
  border: 0.5px solid var(--color-border-md);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font);
  transition: background .12s, border-color .12s;
}
.btn-table:hover { background: var(--color-bg); text-decoration: none; color: var(--color-text); }
.btn-table-secondary { color: var(--color-muted); }
.btn-table-danger { color: var(--color-danger); border-color: #fca5a5; }
.btn-table-danger:hover { background: var(--color-danger-bg); }

/* ── Badges rôle & statut ────────────────────────────── */
.role-badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
}
.role-learner { background: #dbeafe; color: #1e40af; }
.role-admin   { background: #ede9fe; color: #5b21b6; }
.badge-you {
  display: inline-block;
  font-size: .68rem;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 20px;
  background: var(--color-bg);
  color: var(--color-muted);
  margin-left: 4px;
  border: 0.5px solid var(--color-border-md);
}
.status-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}
.status-on  { background: #22c55e; }
.status-off { background: #d1d5db; }

/* ── Formulaires admin ───────────────────────────────── */
.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
.admin-form-section {
  background: var(--color-surface);
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
}
.admin-form-footer {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
  align-items: center;
}

/* ── Radio & checkbox ────────────────────────────────── */
.radio-group { display: flex; gap: 20px; }
.radio-label, .checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .9rem;
  cursor: pointer;
}
.checkbox-formation {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--color-border);
  transition: background .12s;
}
.checkbox-formation:has(input:checked) { background: var(--color-accent-bg); border-color: var(--color-accent); }
.checkbox-formation span { display: flex; flex-direction: column; gap: 2px; }
.checkbox-formation small { font-size: .78rem; color: var(--color-muted); }
.formations-checkboxes { display: flex; flex-direction: column; gap: 8px; }

/* ── Éditeur JSON ────────────────────────────────────── */
.json-editor {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: .825rem;
  line-height: 1.55;
  resize: vertical;
  background: #1e1e1e;
  color: #d4d4d4;
  border: none;
  border-radius: var(--radius-sm);
}
.json-editor:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(24,95,165,.2);
}

/* ── Responsive admin ────────────────────────────────── */
@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .admin-content { padding: 24px 20px 40px; }
  .admin-form-grid { grid-template-columns: 1fr; }
}
