:root {
  /* Couleurs mesurées dans une capture de melyaformation.fr (03/11/2026).
     Valeurs à confirmer dans les sources de la charte graphique. */
  --melya-green-logo: #556a45;
  --melya-green: #64725a;
  --melya-green-hover: #4c6044;
  --melya-green-pale: #edf1e9;
  --melya-canvas: #fafafa;
  --melya-ink: #20211f;
  --melya-muted: #5e655d;
  --melya-border: #e1e5de;
  --melya-white: #ffffff;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--melya-ink);
  background: var(--melya-canvas);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid #8a9a7d; outline-offset: 3px; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 258px minmax(0, 1fr); }
.sidebar {
  background: var(--melya-white);
  border-right: 1px solid var(--melya-border);
  color: var(--melya-ink);
  padding: 27px 18px;
  display: flex;
  flex-direction: column;
}
.brand-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; padding: 0 7px; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  background: var(--melya-green-logo);
  color: #fff;
  width: 47px;
  height: 47px;
  border-radius: 14px;
  font: 32px Georgia, "Times New Roman", serif;
  flex: none;
}
.brand-text { display: flex; flex-direction: column; gap: 0; color: var(--melya-green-logo); line-height: 1.05; }
.brand-text strong { font: normal 26px Georgia, "Times New Roman", serif; letter-spacing: -.8px; }
.brand-text span { font: normal 21px Georgia, "Times New Roman", serif; letter-spacing: -.5px; }
.nav-heading { color: #768170; letter-spacing: 1.3px; font-size: 10px; font-weight: 700; padding: 0 13px; margin-bottom: 13px; }
.sidebar nav { display: flex; flex-direction: column; gap: 7px; }
.sidebar nav a {
  text-decoration: none;
  color: #465445;
  font-size: 14px;
  border-radius: 9px;
  padding: 13px 12px;
  transition: background .15s, color .15s;
}
.sidebar nav a:hover, .sidebar nav a.active { background: var(--melya-green-pale); color: #32442c; }
.sidebar nav a.active { box-shadow: inset 3px 0 0 var(--melya-green-logo); font-weight: 650; }
.sidebar-footer { margin: auto 9px 0; font-size: 11px; color: #798377; line-height: 1.6; }
.workspace { min-width: 0; }
.topbar {
  background: var(--melya-white);
  min-height: 72px;
  border-bottom: 1px solid var(--melya-border);
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--melya-muted);
  font-size: 13px;
  gap: 12px;
}
.account-tag { background: var(--melya-green-pale); color: #43563c; border-radius: 18px; padding: 8px 14px; font-size: 12px; font-weight: 600; }
.content { max-width: 1250px; padding: 52px 44px; margin: auto; }
.eyebrow { color: var(--melya-green-logo); font-size: 11px; font-weight: 800; letter-spacing: 1.4px; margin-bottom: 13px; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
h1 { font-size: clamp(27px, 3vw, 39px); letter-spacing: -.8px; margin: 0 0 11px; line-height: 1.2; }
h1:focus { outline: none; }
h2 { font-size: 23px; margin: 10px 0; }
.lead { color: var(--melya-muted); font-size: 15px; line-height: 1.7; margin: 0 0 27px; }
.notice {
  background: var(--melya-green-pale);
  border-left: 4px solid var(--melya-green-logo);
  color: #3a5036;
  border-radius: 9px;
  padding: 15px 18px;
  font-size: 13px;
  line-height: 1.6;
}
.stats { margin: 26px 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat, .panel { background: white; border: 1px solid var(--melya-border); border-radius: 14px; box-shadow: 0 3px 16px #20351b0a; }
.stat { min-height: 143px; padding: 22px; display: flex; flex-direction: column; gap: 6px; border-top: 3px solid #a9b7a0; }
.stat span { color: var(--melya-muted); font-size: 13px; }
.stat strong { font-size: 35px; font-weight: 650; color: var(--melya-green-logo); }
.stat small { color: #758070; }
.panel { padding: 30px; }
.panel p { color: var(--melya-muted); font-size: 14px; line-height: 1.7; margin-bottom: 23px; }
.primary-link, .secondary-link { display: inline-block; text-decoration: none; font-weight: 700; border-radius: 7px; padding: 13px 18px; font-size: 13px; }
.primary-link { color: #fff; background: var(--melya-green); box-shadow: 3px 3px 0 #1e241d; }
.primary-link:hover { background: var(--melya-green-hover); }
.secondary-link { color: var(--melya-green-logo); border: 1px solid #a7b4a0; }
.secondary-link:hover { background: var(--melya-green-pale); }
.empty-state { text-align: center; padding: 55px 30px; }
.empty-icon { font-size: 32px; color: var(--melya-green-logo); }
@media (max-width: 900px) {
  .shell { display: block; }
  .sidebar { padding: 18px; }
  .brand-heading { margin-bottom: 12px; }
  .sidebar nav { flex-direction: row; overflow-x: auto; }
  .sidebar nav a { white-space: nowrap; }
  .sidebar-footer, .nav-heading { display: none; }
  .topbar { padding: 14px 20px; flex-wrap: wrap; }
  .content { padding: 30px 20px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) { .stats { grid-template-columns: 1fr; } }

button, input, select { font: inherit; }
button { cursor: pointer; }
button.primary-link { border: 0; }
input:focus-visible, select:focus-visible { outline: 3px solid #8a9a7d; outline-offset: 2px; }
.auth-shell { min-height: 100vh; max-width: 540px; padding: 54px 24px; margin: 0 auto; }
.auth-brand { justify-content: center; margin-bottom: 32px; }
.auth-panel { padding: 36px; }
.auth-panel h1 { font-size: 34px; }
.auth-footer, .auth-help { color: var(--melya-muted); font-size: 12px; line-height: 1.7; }
.auth-footer { text-align: center; margin-top: 24px; }
.auth-help { margin: 28px 0 0; border-top: 1px solid var(--melya-border); padding-top: 18px; }
.form-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.form-field label { font-size: 14px; font-weight: 600; }
.form-field input, .form-field select { width: 100%; padding: 12px; border: 1px solid #a7b4a0; border-radius: 6px; color: var(--melya-ink); background: #fff; }
.form-field small { color: var(--melya-muted); font-size: 12px; line-height: 1.5; }
.form-error { color: #8b2921; font-size: 14px; line-height: 1.6; margin-bottom: 18px; }
.form-error:empty { display: none; }
.account-panel { max-width: 620px; }
.account-panel .notice { margin-bottom: 24px; }
.account-controls { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.account-controls a { overflow-wrap: anywhere; }
.logout-button { padding: 8px 12px; background: #fff; color: var(--melya-green-logo); border: 1px solid #a7b4a0; border-radius: 6px; font-size: 12px; }
.logout-button:hover { background: var(--melya-green-pale); }
@media (max-width: 480px) { .auth-panel { padding: 26px 22px; } .auth-shell { padding: 32px 16px; } }

.page-heading, .section-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; }
.page-heading { margin-bottom: 22px; }
.page-heading .lead { margin-bottom: 0; }
.catalog-toolbar { display: flex; gap: 18px; flex-wrap: wrap; align-items: end; margin-bottom: 24px; }
.search-field { display: flex; flex-direction: column; gap: 8px; font-size: 13px; flex: 1; min-width: 220px; }
.search-field input, .search-field select, .form-field textarea { padding: 12px; border: 1px solid #a7b4a0; border-radius: 6px; background: white; width: 100%; font: inherit; }
.form-field textarea { resize: vertical; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 12px 0; }
button.secondary-link { background: white; cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
.table-panel { padding: 0; overflow: hidden; }
.table-subtitle { display: block; color: var(--melya-muted); font-size: 12px; line-height: 1.5; margin-top: 6px; }
.row-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.field-readonly { margin: 0; padding: 12px; background: var(--melya-green-pale); border-radius: 6px; }
.registration-choice { flex: 1; min-width: 220px; margin-bottom: 0; }
.enrollment-table summary { cursor: pointer; color: var(--melya-green-logo); }
.enrollment-table details li { font-size: 12px; margin: 8px 0; }
.table-scroll { overflow-x: auto; }
.catalog-table { border-collapse: collapse; width: 100%; text-align: left; font-size: 14px; }
.catalog-table th, .catalog-table td { padding: 18px 20px; border-bottom: 1px solid var(--melya-border); }
.catalog-table th { background: var(--melya-green-pale); color: #43563c; font-size: 12px; }
.catalog-table a { color: var(--melya-green-logo); font-weight: 600; }
.catalog-table tr:last-child td { border-bottom: 0; }
.status-badge { display: inline-block; padding: 6px 10px; border-radius: 20px; background: var(--melya-green-pale); color: #43563c; font-size: 12px; white-space: nowrap; }
.back-link { display: inline-block; color: var(--melya-green-logo); margin-bottom: 22px; font-size: 14px; }
.editor-fieldset { padding: 0; margin: 0; border: 0; min-width: 0; }
.editor-fieldset > .panel, .program-preview, .version-history { margin-bottom: 24px; }
.panel + .version-history { margin-top: 24px; }
.lesson-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; }
.path-banner { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 32px; margin: 24px 0; border-radius: 16px; background: linear-gradient(120deg, #e7eedf, #f6f4e9); border: 1px solid #ced9c4; }
.path-banner > div { flex: 1; min-width: 0; }
.path-banner h2 { margin-top: 10px; }
.path-banner p { line-height: 1.7; }
.path-kicker { display: block; font-size: 11px; line-height: 1.7; font-weight: 700; letter-spacing: .07em; color: #4c6044; }
.path-tile { padding: 24px; border: 1px solid var(--melya-border); border-radius: 14px; background: #fdfefb; }
.path-tile h3 { line-height: 1.4; font-size: 20px; }
.path-tile p { line-height: 1.7; }
.path-studio { display: grid; grid-template-columns: minmax(230px, 300px) minmax(0, 1fr); gap: 24px; align-items: start; margin: 24px 0; }
.path-module-nav { position: sticky; top: 20px; padding: 20px; max-height: calc(100vh - 40px); overflow-y: auto; }
.path-module-choice { display: block; width: 100%; text-align: left; border: 1px solid transparent; background: transparent; padding: 15px 12px; border-radius: 8px; margin: 4px 0; color: #273123; line-height: 1.5; }
.path-module-choice small { display: block; color: var(--melya-muted); margin-top: 6px; }
.path-module-choice.selected, .path-activity-tab.selected { background: #edf1e9; border-color: #8c9e7e; font-weight: 600; }
.path-editor-content { min-width: 0; }
.path-activity-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.path-activity-tab { padding: 10px 14px; border: 1px solid var(--melya-border); border-radius: 20px; background: white; color: #43563c; text-align: left; font-size: 12px; line-height: 1.5; }
.path-long-text { font-size: 14px; line-height: 1.65; }
.course-text { max-width: 82ch; overflow-wrap: anywhere; }
.course-text p { white-space: pre-line; line-height: 1.85; margin: 18px 0; }
.course-text h3 { font-family: inherit; font-size: 12px; letter-spacing: .08em; color: #4c6044; margin: 32px 0 10px; }
.path-steps { list-style: none; margin: 24px 0 0; padding: 0; }
.path-step { display: flex; gap: 18px; align-items: flex-start; padding: 22px 0; border-top: 1px solid var(--melya-border); }
.path-step-icon { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #edf1e9; color: #43563c; font-weight: bold; }
.path-step > div { min-width: 0; }
.path-step a, .path-step strong { display: block; color: #273c22; font-size: 16px; line-height: 1.6; margin: 5px 0; overflow-wrap: anywhere; }
.path-step small { display: block; color: #5b6456; line-height: 1.7; }
.path-step.complete .path-step-icon { background: #516b43; color: white; }
.path-step.locked { background: #fafbf8; }
.path-step.locked strong { color: #697060; }
.path-feedback { padding: 20px; margin: 18px 0; border-left: 4px solid #8b9d7c; background: #f3f6ef; border-radius: 0 10px 10px 0; }
.path-completion { font-weight: 600; color: #354f2b; }
@media (max-width: 1050px) { .path-studio { grid-template-columns: 1fr; } .path-module-nav { position: static; max-height: none; } }
@media (max-width: 680px) { .path-banner { flex-direction: column; align-items: stretch; padding: 22px; } .path-tile { padding: 18px; } .path-step { gap: 12px; } .path-step-icon { width: 30px; height: 30px; } }
.learning-resources { margin: 24px 0; }
.learning-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 24px; }
.learning-cards .primary-link { margin-top: 18px; }
progress { display: block; width: 100%; height: 16px; accent-color: var(--melya-green-logo); margin: 14px 0; }
.lesson-list, .resource-list { padding-left: 24px; }
.lesson-list li, .resource-list li { padding: 14px 0; line-height: 1.7; overflow-wrap: anywhere; }
.lesson-list .status-badge, .resource-list .text-button { margin-left: 12px; }
.lesson-list small, .resource-list small { display: block; color: var(--melya-muted); font-size: 12px; }
.question-editor { margin: 24px 0; padding: 24px; border: 1px solid var(--melya-border); border-radius: 10px; }
.choice-editor { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.choice-editor .form-field { flex: 1; min-width: 180px; margin-bottom: 0; }
.question-preview { border-top: 1px solid var(--melya-border); margin-top: 24px; padding-top: 16px; }
.answer-question { min-width: 0; margin: 24px 0; }
.answer-question legend { font-weight: 600; padding: 0 10px; max-width: 100%; overflow-wrap: anywhere; }
.answer-choice { display: flex; align-items: start; gap: 12px; margin: 16px 0; line-height: 1.6; overflow-wrap: anywhere; }
.answer-choice input { flex: none; margin-top: 6px; accent-color: var(--melya-green-logo); }
.evaluation-result { margin-bottom: 24px; overflow-wrap: anywhere; }
.document-fields { margin: 20px 0; font-size: 13px; line-height: 1.7; }
.document-fields summary { cursor: pointer; color: var(--melya-green-logo); }
.document-fields ul { display: flex; flex-wrap: wrap; gap: 12px 24px; list-style: none; padding: 0; }
.document-history { margin-top: 32px; }
.document-table { min-width: 760px; }
.document-table td { overflow-wrap: anywhere; }
.document-scroll-help { display: none; }
@media (max-width: 800px) { .document-scroll-help { display: block; font-size: 13px; color: var(--melya-green-logo); } }
.form-grid, .program-descriptions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.editor-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 24px 0; }
.module-editor { padding: 24px; border: 1px solid var(--melya-border); border-radius: 10px; margin: 24px 0; }
.module-editor h3, .sequence-editor h4 { margin: 0 0 14px; }
.sequence-editor { padding: 18px; margin: 18px 0; background: var(--melya-canvas); border-left: 3px solid #a9b7a0; }
.text-button { border: 0; background: none; color: var(--melya-green-logo); text-decoration: underline; padding: 8px 0; font-size: 13px; }
.muted { color: var(--melya-muted); font-size: 13px; }
.positioning-modules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 24px 0; }
.positioning-module { border: 1px solid var(--melya-border); border-radius: 12px; padding: 20px; background: #f7f9f4; overflow-wrap: anywhere; }
.positioning-module h3 { margin: 0 0 12px; font-size: 19px; }
.positioning-guidance { border-left: 3px solid var(--melya-green-logo); padding: 8px 14px; background: #f2f5ed; }
.positioning-question { min-width: 0; border: 1px solid var(--melya-border); }
.positioning-question legend { font-weight: 700; padding: 0 8px; color: var(--melya-green-logo); }
.positioning-question h2 { font-size: 22px; line-height: 1.45; }
.positioning-choice { display: flex; align-items: start; gap: 12px; padding: 14px; margin: 10px 0; border: 1px solid var(--melya-border); border-radius: 9px; cursor: pointer; overflow-wrap: anywhere; }
.positioning-choice input { flex: 0 0 auto; margin-top: 4px; }
@media (max-width: 680px) { .positioning-modules { grid-template-columns: 1fr; } .positioning-question h2 { font-size: 19px; } }
.preserve-lines { white-space: pre-line; overflow-wrap: anywhere; }
.program-facts { display: flex; flex-wrap: wrap; gap: 20px 52px; padding-bottom: 24px; border-bottom: 1px solid var(--melya-border); }
.program-facts dt { font-size: 12px; color: var(--melya-muted); margin-bottom: 8px; }
.program-facts dd { margin: 0; font-weight: 600; }
.module-preview { margin-top: 24px; border-top: 1px solid var(--melya-border); padding-top: 14px; }
.module-preview h3 { font-size: 17px; }
.sequence-list { padding-left: 22px; line-height: 1.6; }
.sequence-list li { margin: 12px 0; }
.version-history li { margin: 14px 0; line-height: 1.6; }
.catalog-errors { background: #fff5f3; border: 1px solid #e8c5bf; border-radius: 8px; padding: 10px 18px; }
@media (max-width: 680px) {
  .form-grid, .program-descriptions { grid-template-columns: 1fr; }
  .module-editor { padding: 16px; }
  .sequence-editor { padding: 14px; }
  .catalog-table th, .catalog-table td { padding: 14px; }
  .catalog-toolbar .search-field { min-width: 100%; }
}

/* MFM-020 : menu simplifié et assistant « Ouvrir un cours à un groupe » */
.nav-advanced { margin-top: 1rem; }
.nav-advanced > summary { cursor: pointer; padding: .5rem .75rem; font-size: .85rem; opacity: .8; list-style: none; }
.nav-advanced > summary::before { content: "▸ "; }
.nav-advanced[open] > summary::before { content: "▾ "; }
.learner-row { align-items: end; }
progress { width: 8rem; vertical-align: middle; accent-color: #365B45; }

/* MFM-027 : actions d'une carte de cours */
.tile-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.topbar .account-controls { margin-left: auto; }
nav .nav-heading { margin-top: 18px; margin-bottom: 6px; }
nav .nav-heading:first-child { margin-top: 0; }

/* MFM-027 : erreur sous le champ concerné */
.field-error { display: block; color: #8b2921; font-size: 13px; font-weight: 600; margin-top: 4px; }
.form-field:has(.field-error) input, .form-field:has(.field-error) textarea, .form-field:has(.field-error) select { border-color: #b3261e; }
.required-mark { color: #8b2921; }
